Package org.locationtech.jts.awt
Class PolygonShape
java.lang.Object
org.locationtech.jts.awt.PolygonShape
- All Implemented Interfaces:
Shape
A
Shape which represents a polygon which may contain holes.
Provided because the standard AWT Polygon class does not support holes.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPolygonShape(Coordinate[] shellVertices, Collection holeVerticesCollection) Creates a new polygonShape. -
Method Summary
Modifier and TypeMethodDescription(package private) voidbooleancontains(double x, double y) booleancontains(double x, double y, double w, double h) booleanboolean(package private) voidendRing()getPathIterator(AffineTransform at, double flatness) booleanintersects(double x, double y, double w, double h) booleanprivate GeneralPathtoPath(Coordinate[] coordinates) Creates a GeneralPath representing a polygon ring having the given coordinate sequence.
-
Field Details
-
polygonPath
-
ringPath
-
-
Constructor Details
-
PolygonShape
Creates a new polygonShape.- Parameters:
shellVertices- the vertices of the shellholeVerticesCollection- a collection of Coordinate[] for each hole
-
PolygonShape
public PolygonShape()
-
-
Method Details
-
addToRing
-
endRing
void endRing() -
toPath
Creates a GeneralPath representing a polygon ring having the given coordinate sequence. Uses the GeneralPath.WIND_EVEN_ODD winding rule.- Parameters:
coordinates- a coordinate sequence- Returns:
- the path for the coordinate sequence
-
getBounds
-
getBounds2D
- Specified by:
getBounds2Din interfaceShape
-
contains
public boolean contains(double x, double y) -
contains
-
intersects
public boolean intersects(double x, double y, double w, double h) - Specified by:
intersectsin interfaceShape
-
intersects
- Specified by:
intersectsin interfaceShape
-
contains
public boolean contains(double x, double y, double w, double h) -
contains
-
getPathIterator
- Specified by:
getPathIteratorin interfaceShape
-
getPathIterator
- Specified by:
getPathIteratorin interfaceShape
-