Package edu.cnu.mdi.mapping.graphics
Class MapGraphics.ProjectedMapShape
java.lang.Object
edu.cnu.mdi.mapping.graphics.MapGraphics.ProjectedMapShape
- Enclosing class:
MapGraphics
Immutable representation of a projected map shape that may consist of
multiple subpaths.
Multiple subpaths arise naturally when a geographic polyline or polygon crosses the seam of a wrapped map projection. Each path is already expressed in device coordinates and is therefore ready for drawing and hit testing.
-
Constructor Summary
ConstructorsConstructorDescriptionProjectedMapShape(List<Path2D.Double> paths, boolean closed) Creates a new projected map shape. -
Method Summary
Modifier and TypeMethodDescriptionComputes the union of the bounds of all projected subpaths.getPaths()Returns the projected subpaths in device coordinates.booleanisClosed()Returns whether the original geographic shape was closed.booleanisEmpty()Returns whether this projected shape has no subpaths.
-
Constructor Details
-
ProjectedMapShape
Creates a new projected map shape.- Parameters:
paths- the projected subpaths; a defensive copy is madeclosed- whether the originating shape was closed
-
-
Method Details
-
getPaths
Returns the projected subpaths in device coordinates.- Returns:
- an unmodifiable list of subpaths
-
isClosed
public boolean isClosed()Returns whether the original geographic shape was closed.- Returns:
truefor polygons,falsefor polylines
-
isEmpty
public boolean isEmpty()Returns whether this projected shape has no subpaths.- Returns:
trueif empty;falseotherwise
-
getBounds
Computes the union of the bounds of all projected subpaths.- Returns:
- the bounding rectangle in device coordinates
-