Class PolygonOverlay

All Implemented Interfaces:
Serializable, Cloneable, Comparable
Direct Known Subclasses:
AnnotationOverlay, CoastOverlay, FilledShapeOverlay, PointFeatureOverlay, PolygonFeatureOverlay

public abstract class PolygonOverlay extends LineOverlay
A polygon overlay annotes a data view with vector-specified polygon lines and shapes. The polygon overlay adds the concept of a fill color to the parent class.
Since:
3.1.1
Author:
Peter Hollemans
See Also:
  • Constructor Details

    • PolygonOverlay

      protected PolygonOverlay(Color color, int layer, Stroke stroke, Color fillColor)
      Constructs a new polygon overlay.
      Parameters:
      color - the overlay color.
      layer - the overlay layer number.
      stroke - the stroke to use for vector paths.
      fillColor - the fill color to use for polygon fills.
    • PolygonOverlay

      protected PolygonOverlay(Color color)
      Constructs a new polygon overlay. The layer number is initialized to 0, the stroke to the default BasicStroke, and the fill color to the overlay color.
      Parameters:
      color - the overlay color.
  • Method Details

    • setFillColor

      public void setFillColor(Color fillColor)
      Sets the polygon fill color. Only opaque colors are allowed. If the color has an alpha component, the alpha value is set to 255 and the overlay transparency is set using the new alpha value. This behaviour may be changed in the future to ignore the color's alpha value entirely -- overlay transparency should really be set by calling EarthDataOverlay.setTransparency(int).
      Parameters:
      fillColor - the new opaque polygon fill color, or null to perform no filling.
    • getFillColor

      public Color getFillColor()
      Gets the polygon fill color. The polygon fill color is always opaque, even if a call to setFillColor(java.awt.Color) specifies a color with an alpha component. The overlay transparency may be accessed through EarthDataOverlay.setTransparency(int) or EarthDataOverlay.getTransparency().
      Returns:
      the polygon fill color.
    • getFillColorWithAlpha

      public Color getFillColorWithAlpha()
      Gets the polygon fill color with alpha component.
    • getColors

      public List getColors()
      Gets a list of all the colors used by this overlay.
      Overrides:
      getColors in class EarthDataOverlay
      Returns:
      the list of colors.