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) void
boolean
contains
(double x, double y) boolean
contains
(double x, double y, double w, double h) boolean
boolean
(package private) void
endRing()
getPathIterator
(AffineTransform at, double flatness) boolean
intersects
(double x, double y, double w, double h) boolean
private GeneralPath
toPath
(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:
getBounds2D
in interfaceShape
-
contains
public boolean contains(double x, double y) -
contains
-
intersects
public boolean intersects(double x, double y, double w, double h) - Specified by:
intersects
in interfaceShape
-
intersects
- Specified by:
intersects
in interfaceShape
-
contains
public boolean contains(double x, double y, double w, double h) -
contains
-
getPathIterator
- Specified by:
getPathIterator
in interfaceShape
-
getPathIterator
- Specified by:
getPathIterator
in interfaceShape
-