Class MapGraphics.ProjectedMapShape

java.lang.Object
edu.cnu.mdi.mapping.graphics.MapGraphics.ProjectedMapShape
Enclosing class:
MapGraphics

public static final class MapGraphics.ProjectedMapShape extends Object
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 Details

    • ProjectedMapShape

      public ProjectedMapShape(List<Path2D.Double> paths, boolean closed)
      Creates a new projected map shape.
      Parameters:
      paths - the projected subpaths; a defensive copy is made
      closed - whether the originating shape was closed
  • Method Details

    • getPaths

      public List<Path2D.Double> 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:
      true for polygons, false for polylines
    • isEmpty

      public boolean isEmpty()
      Returns whether this projected shape has no subpaths.
      Returns:
      true if empty; false otherwise
    • getBounds

      public Rectangle getBounds()
      Computes the union of the bounds of all projected subpaths.
      Returns:
      the bounding rectangle in device coordinates