public final class ShapeUtilities
extends java.lang.Object
Constructor and Description |
---|
ShapeUtilities() |
Modifier and Type | Method and Description |
---|---|
static java.awt.Shape |
cloneShape(java.awt.Shape s)
Clone a shape.
|
static java.awt.geom.Rectangle2D |
computeStrokedBounds(java.awt.Shape shape,
java.awt.Stroke stroke)
Compute the bounds of a shape when stroked with the given stroke.
|
static java.awt.Shape |
createCloudShape()
Create the "cloud" shape.
|
static java.awt.Shape |
createSwatchShape()
Create the "swatch" shape.
|
static java.awt.BasicStroke |
getStroke(float floatwidth)
Get a new stroke of the given width and with no dashing.
|
static java.awt.BasicStroke |
getStroke(int width)
Get a stroke of the given width and with no dashing.
|
static boolean |
intersectsOutline(java.awt.geom.Rectangle2D r,
java.awt.Shape s)
Return true if the outline of the given shape intersects with the
given rectangle.
|
static boolean |
isOrthogonal(java.awt.geom.AffineTransform at)
Return true if the given transform maps a rectangle
to a rectangle.
|
static boolean |
jdk12beta4()
Test if we are running in JDK1.2beta4
|
static void |
main(java.lang.String[] argv)
Main function.
|
static java.lang.String |
printShapeAsCode(java.lang.String name,
java.awt.Shape shape)
Print a Shape to a String, as a code fragment that creates
a new GeneralPath.
|
static java.awt.geom.Rectangle2D |
transformBounds(java.awt.geom.Rectangle2D rect,
java.awt.geom.AffineTransform at)
Given a bounding-box rectangle, return a new rectangle
by transforming the argument rectangle and taking the bounding
box of the result.
|
static java.awt.Shape |
transformModify(java.awt.Shape s,
java.awt.geom.AffineTransform at)
Transform a shape with the supplied transform.
|
static void |
transformModifyRect(java.awt.geom.RectangularShape s,
java.awt.geom.AffineTransform at)
In-place transform of a rectangular shape.
|
static java.awt.Shape |
translateModify(java.awt.Shape s,
double x,
double y)
Translate a shape the given distance.
|
public static boolean jdk12beta4()
public static java.awt.Shape cloneShape(java.awt.Shape s)
public static java.awt.Shape createCloudShape()
public static java.awt.Shape createSwatchShape()
public static java.awt.geom.Rectangle2D computeStrokedBounds(java.awt.Shape shape, java.awt.Stroke stroke)
public static java.awt.BasicStroke getStroke(int width)
public static java.awt.BasicStroke getStroke(float floatwidth)
public static boolean intersectsOutline(java.awt.geom.Rectangle2D r, java.awt.Shape s)
public static boolean isOrthogonal(java.awt.geom.AffineTransform at)
public static java.lang.String printShapeAsCode(java.lang.String name, java.awt.Shape shape)
public static java.awt.geom.Rectangle2D transformBounds(java.awt.geom.Rectangle2D rect, java.awt.geom.AffineTransform at)
public static void transformModifyRect(java.awt.geom.RectangularShape s, java.awt.geom.AffineTransform at)
public static java.awt.Shape transformModify(java.awt.Shape s, java.awt.geom.AffineTransform at)
public static java.awt.Shape translateModify(java.awt.Shape s, double x, double y)
public static void main(java.lang.String[] argv)