public final class ShapeUtilities extends Object
Constructor and Description |
---|
ShapeUtilities() |
Modifier and Type | Method and Description |
---|---|
static Shape |
cloneShape(Shape s)
Clone a shape.
|
static Rectangle2D |
computeStrokedBounds(Shape shape,
Stroke stroke)
Compute the bounds of a shape when stroked with the given stroke.
|
static Shape |
createCloudShape()
Create the "cloud" shape.
|
static Shape |
createSwatchShape()
Create the "swatch" shape.
|
static BasicStroke |
getStroke(float floatwidth)
Get a new stroke of the given width and with no dashing.
|
static BasicStroke |
getStroke(int width)
Get a stroke of the given width and with no dashing.
|
static boolean |
intersectsOutline(Rectangle2D r,
Shape s)
Return true if the outline of the given shape intersects with the
given rectangle.
|
static boolean |
isOrthogonal(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(String[] argv)
Main function.
|
static String |
printShapeAsCode(String name,
Shape shape)
Print a Shape to a String, as a code fragment that creates
a new GeneralPath.
|
static Rectangle2D |
transformBounds(Rectangle2D rect,
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 Shape |
transformModify(Shape s,
AffineTransform at)
Transform a shape with the supplied transform.
|
static void |
transformModifyRect(RectangularShape s,
AffineTransform at)
In-place transform of a rectangular shape.
|
static Shape |
translateModify(Shape s,
double x,
double y)
Translate a shape the given distance.
|
public static boolean jdk12beta4()
public static Shape cloneShape(Shape s)
public static Shape createCloudShape()
public static Shape createSwatchShape()
public static Rectangle2D computeStrokedBounds(Shape shape, Stroke stroke)
public static BasicStroke getStroke(int width)
public static BasicStroke getStroke(float floatwidth)
public static boolean intersectsOutline(Rectangle2D r, Shape s)
public static boolean isOrthogonal(AffineTransform at)
public static String printShapeAsCode(String name, Shape shape)
public static Rectangle2D transformBounds(Rectangle2D rect, AffineTransform at)
public static void transformModifyRect(RectangularShape s, AffineTransform at)
public static Shape transformModify(Shape s, AffineTransform at)
public static Shape translateModify(Shape s, double x, double y)
public static void main(String[] argv)
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.