public class RectangleReader extends Object
If a shape is a rectangle, then certain operations can be optimized.
Also there is a bug when clipping shapes using Quartz on Mac: a GeneralPath encapsulating exactly the same area as a Rectangle2D may not clip correctly. If this abstract shape is instead converted to a Rectangle2D: the bug goes away!
| Constructor and Description |
|---|
RectangleReader()
|
| Modifier and Type | Method and Description |
|---|---|
static Rectangle2D |
convert(Shape
This studies a shape and determines if it is a
Rectangle, a
Rectangle2D, or neither.
|
static Rectangle2D |
convert(Shape
This studies a shape and determines if it is a
Rectangle, a
Rectangle2D, or neither.
|
static boolean |
isRectangle(Shape
Returns true if a shape is a rectangle.
|
static boolean |
isRectangle(Shape
Returns true if a shape is a rectangle when the transform is applied.
|
public static boolean isRectangle(Shapes)
public static boolean isRectangle(Shapes, AffineTransform tx)
public static final Rectangle2Dconvert(Shape shape)
Rectangle, a
Rectangle2D, or neither.
shape - the shape to study
Rectangle,
Rectangle2D, or
null.
public static final Rectangle2Dconvert(Shape shape, AffineTransform transform)
Rectangle, a
Rectangle2D, or neither.
shape - the shape to study
transform - the optional transform to apply to the shape.
Rectangle,
Rectangle2D, or
null.