Package noaa.coastwatch.render
Class AnnotationOverlay
java.lang.Object
noaa.coastwatch.render.EarthDataOverlay
noaa.coastwatch.render.LineOverlay
noaa.coastwatch.render.PolygonOverlay
noaa.coastwatch.render.AnnotationOverlay
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable
An annotation overlay annotes a data view with annotation elements.
Annotation elements may be based in the image reference
frame or the data reference frame. With image
referencing, the annotation location and size follow the image
coordinates and do not change when the view window location and
size changes. With data referencing, the annotation follows the
data coordinates and changes with the view window and size.
- Since:
- 3.1.1
- Author:
- Peter Hollemans
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The data reference frame.protected List
The list of annotation elements.static final int
The image reference frame.Fields inherited from class noaa.coastwatch.render.LineOverlay
drawingShadow
Fields inherited from class noaa.coastwatch.render.EarthDataOverlay
alpha, lastTrans, prepared
-
Constructor Summary
ConstructorDescriptionAnnotationOverlay
(Color color) Constructs a new annotation overlay.AnnotationOverlay
(Color color, int layer, Stroke stroke, Color fillColor, int reference) Constructs a new annotation overlay. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement
(AnnotationElement element) Adds an annotation element to the list.protected void
draw
(Graphics2D g, EarthDataView view) Draws the overlay graphics.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
setReference
(int frame) Sets the annotation element reference frame.Methods inherited from class noaa.coastwatch.render.PolygonOverlay
getColors, getFillColor, getFillColorWithAlpha, setFillColor
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, getColorWithAlpha, getLayer, getMetadataAtPoint, getName, getTransparency, getVisible, hasMetadata, invalidate, isPrepared, setColor, setLayer, setName, setTransparency, setVisible
-
Field Details
-
IMAGE
public static final int IMAGEThe image reference frame.- See Also:
-
DATA
public static final int DATAThe data reference frame.- See Also:
-
elements
The list of annotation elements.
-
-
Constructor Details
-
AnnotationOverlay
Constructs a new annotation 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.reference
- the annotation reference frame. The options areIMAGE
andDATA
.
-
AnnotationOverlay
Constructs a new annotation overlay. The layer number is initialized to 0, the stroke to the defaultBasicStroke
, the fill color to null, and the reference to the image reference frame.- Parameters:
color
- the overlay color.
-
-
Method Details
-
addElement
Adds an annotation element to the list. -
setReference
public void setReference(int frame) Sets the annotation element reference frame.- Parameters:
frame
- the reference frame, eitherIMAGE
andDATA
.
-
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.
-