Package noaa.coastwatch.render
Class ShapeOverlay
java.lang.Object
noaa.coastwatch.render.EarthDataOverlay
noaa.coastwatch.render.LineOverlay
noaa.coastwatch.render.ShapeOverlay
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable
The
ShapeOverlay
class may be used to render a list of
generic shapes.- Since:
- 3.1.7
- 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
ConstructorDescriptionShapeOverlay
(Color color) Creates a new shape overlay with the specified color. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new shape to the list.protected void
draw
(Graphics2D g, EarthDataView view) Draws the overlay graphics.Gets an iterator over the list of shapes.protected boolean
Returns false as this class needs no preparation.protected void
prepare
(Graphics2D g, EarthDataView view) Prepares the overlay graphics prior to drawing.void
removeShape
(Shape shape) Removes a shape from the list.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, getAlphaVersion, getColor, getColors, getColorWithAlpha, getLayer, getMetadataAtPoint, getName, getTransparency, getVisible, hasMetadata, invalidate, isPrepared, setColor, setLayer, setName, setTransparency, setVisible, toString
-
Constructor Details
-
ShapeOverlay
Creates a new shape overlay with the specified color. The layer number is initialized to 0, and the stroke to the defaultBasicStroke
.
-
-
Method Details
-
addShape
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
Gets an iterator over the list of shapes. -
removeShape
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 classEarthDataOverlay
- Returns:
- true if this overlay class needs a preparation stage, or false if not.
-
prepare
Description copied from class:EarthDataOverlay
Prepares the overlay graphics prior to drawing.- Specified by:
prepare
in classEarthDataOverlay
- Parameters:
g
- the graphics object for drawing.view
- the earth data view.
-
draw
Description copied from class:EarthDataOverlay
Draws the overlay graphics.- Specified by:
draw
in classEarthDataOverlay
- Parameters:
g
- the graphics object for drawing.view
- the earth data view.
-