public class ShapeUtilities extends Object
Modifier and Type | Method and Description |
---|---|
static Shape |
createTransformedShape(Shape src,
AffineTransform trans)
Apply a transformation to a Shape, trying to keep the type of the Shape.
|
static ShapeUtilities |
getInstance()
Return the unique instance of this class.
|
static double |
getRotationAngle(AffineTransform tr)
Return the rotation angle for an AffineTransform.
|
static AffineTransform |
getRotationTransform(AffineTransform tr)
Return the rotation Component of an AffineTransform.
|
boolean |
keepSimpleShape(Shape src,
AffineTransform trans)
Return false if the transform will be delegated to the AffineTransform.
|
static boolean |
simpleShapeAsTransform(Shape src,
AffineTransform trans)
Return false if the transform will be delegated to the AffineTransform.
|
Shape |
transform(Shape src,
AffineTransform trans)
Apply a transformation to a Shape, trying to keep the type of the Shape.
|
public static ShapeUtilities getInstance()
public static Shape createTransformedShape(Shape src, AffineTransform trans)
src
- the source Shapetrans
- the AffineTransformtransform(Shape, AffineTransform)
public static double getRotationAngle(AffineTransform tr)
tr
- the AffineTransformpublic static AffineTransform getRotationTransform(AffineTransform tr)
tr
- the AffineTransformpublic Shape transform(Shape src, AffineTransform trans)
src
- the source Shapetrans
- the AffineTransformpublic static boolean simpleShapeAsTransform(Shape src, AffineTransform trans)
src
- the source Shapetrans
- the AffineTransformpublic boolean keepSimpleShape(Shape src, AffineTransform trans)
src
- the source Shapetrans
- the AffineTransform