Class ShapeOverlay

All Implemented Interfaces:
Serializable, Cloneable, Comparable

public class ShapeOverlay extends LineOverlay
The ShapeOverlay class may be used to render a list of generic shapes.
Since:
3.1.7
Author:
Peter Hollemans
See Also:
  • Constructor Details

    • ShapeOverlay

      public ShapeOverlay(Color color)
      Creates a new shape overlay with the specified color. The layer number is initialized to 0, and the stroke to the default BasicStroke.
  • Method Details

    • addShape

      public void addShape(Shape shape)
      Adds a new shape to the list. The shape coordinates are considered to be in the data coordinate reference frame.
      Parameters:
      shape - the new shape to add to the list.
    • getShapeIterator

      public Iterator getShapeIterator()
      Gets an iterator over the list of shapes.
    • removeShape

      public void removeShape(Shape shape)
      Removes a shape from the list.
      Parameters:
      shape - the shape to remove from the list.
    • needsPrepare

      protected boolean needsPrepare()
      Returns false as this class needs no preparation.
      Overrides:
      needsPrepare in class EarthDataOverlay
      Returns:
      true if this overlay class needs a preparation stage, or false if not.
    • prepare

      protected void prepare(Graphics2D g, EarthDataView view)
      Description copied from class: EarthDataOverlay
      Prepares the overlay graphics prior to drawing.
      Specified by:
      prepare in class EarthDataOverlay
      Parameters:
      g - the graphics object for drawing.
      view - the earth data view.
    • draw

      protected void draw(Graphics2D g, EarthDataView view)
      Description copied from class: EarthDataOverlay
      Draws the overlay graphics.
      Specified by:
      draw in class EarthDataOverlay
      Parameters:
      g - the graphics object for drawing.
      view - the earth data view.