Package noaa.coastwatch.render
Class PolygonOverlay
java.lang.Object
noaa.coastwatch.render.EarthDataOverlay
noaa.coastwatch.render.LineOverlay
noaa.coastwatch.render.PolygonOverlay
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable
- Direct Known Subclasses:
AnnotationOverlay
,CoastOverlay
,FilledShapeOverlay
,PointFeatureOverlay
,PolygonFeatureOverlay
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:
-
Field Summary
Fields inherited from class noaa.coastwatch.render.LineOverlay
drawingShadow
Fields inherited from class noaa.coastwatch.render.EarthDataOverlay
alpha, lastTrans, prepared
-
Constructor Summary
ModifierConstructorDescriptionprotected
PolygonOverlay
(Color color) Constructs a new polygon overlay.protected
PolygonOverlay
(Color color, int layer, Stroke stroke, Color fillColor) Constructs a new polygon overlay. -
Method Summary
Modifier and TypeMethodDescriptionGets a list of all the colors used by this overlay.Gets the polygon fill color.Gets the polygon fill color with alpha component.void
setFillColor
(Color fillColor) Sets the polygon fill color.Methods inherited from class noaa.coastwatch.render.LineOverlay
clip, drawShadow, getDropShadow, getShadowColor, getStroke, render, setDropShadow, setStroke
Methods inherited from class noaa.coastwatch.render.EarthDataOverlay
clone, compareTo, draw, getAlphaVersion, getColor, getColorWithAlpha, getLayer, getMetadataAtPoint, getName, getTransparency, getVisible, hasMetadata, invalidate, isPrepared, needsPrepare, prepare, setColor, setLayer, setName, setTransparency, setVisible
-
Constructor Details
-
PolygonOverlay
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
Constructs a new polygon overlay. The layer number is initialized to 0, the stroke to the defaultBasicStroke
, and the fill color to the overlay color.- Parameters:
color
- the overlay color.
-
-
Method Details
-
setFillColor
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 callingEarthDataOverlay.setTransparency(int)
.- Parameters:
fillColor
- the new opaque polygon fill color, or null to perform no filling.
-
getFillColor
Gets the polygon fill color. The polygon fill color is always opaque, even if a call tosetFillColor(java.awt.Color)
specifies a color with an alpha component. The overlay transparency may be accessed throughEarthDataOverlay.setTransparency(int)
orEarthDataOverlay.getTransparency()
.- Returns:
- the polygon fill color.
-
getFillColorWithAlpha
Gets the polygon fill color with alpha component. -
getColors
Gets a list of all the colors used by this overlay.- Overrides:
getColors
in classEarthDataOverlay
- Returns:
- the list of colors.
-