Class RectangularPolygon
java.lang.Object
com.xinapse.multisliceimage.roi.RectangularPolygon
- All Implemented Interfaces:
Shape
Substitute for standard class java.awt.geom.Rectangle.
Don't use the standard java.awt.geom.Rectangle2D: if we do then getBounds2D always
returns the original rectangle, regardless of whether the shape is subsequently changed
by intersection etc.
The shape of this rectangular polygon is malleable - all checking uses the General Path
not the bounds of the original rectangle.
-
Constructor Summary
ConstructorsConstructorDescriptionRectangularPolygon(double x, double y, double width, double height) Create aRectangularPolygonat the specified position, with the specified size. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(double x, double y) booleancontains(double x, double y, double width, double height) booleanbooleangetPathIterator(AffineTransform at, double flatness) booleanintersects(double x, double y, double width, double height) boolean
-
Constructor Details
-
RectangularPolygon
public RectangularPolygon(double x, double y, double width, double height) Create aRectangularPolygonat the specified position, with the specified size.- Parameters:
x- the x-coordinate of the top left corner.y- the y-coordinate of the top left corner.width- the width of the RectangularPolygon.height- the height of the RectangularPolygon.
-
-
Method Details
-
contains
-
contains
-
contains
-
contains
-
getBounds
-
getBounds2D
- Specified by:
getBounds2Din interfaceShape
-
getPathIterator
- Specified by:
getPathIteratorin interfaceShape
-
getPathIterator
- Specified by:
getPathIteratorin interfaceShape
-
intersects
- Specified by:
intersectsin interfaceShape
-
intersects
public boolean intersects(double x, double y, double width, double height) - Specified by:
intersectsin interfaceShape
-