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
FieldsModifier and TypeFieldDescriptionstatic final intThe data reference frame.protected ListThe list of annotation elements.static final intThe image reference frame.Fields inherited from class noaa.coastwatch.render.LineOverlay
drawingShadowFields inherited from class noaa.coastwatch.render.EarthDataOverlay
alpha, lastTrans, prepared -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationOverlay(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 TypeMethodDescriptionvoidaddElement(AnnotationElement element) Adds an annotation element to the list.protected voiddraw(Graphics2D g, EarthDataView view) Draws the overlay graphics.protected booleanReturns false as this class needs no preparation.protected voidprepare(Graphics2D g, EarthDataView view) Prepares the overlay graphics prior to drawing.voidsetReference(int frame) Sets the annotation element reference frame.Methods inherited from class noaa.coastwatch.render.PolygonOverlay
getColors, getFillColor, getFillColorWithAlpha, setFillColorMethods inherited from class noaa.coastwatch.render.LineOverlay
clip, drawShadow, getDropShadow, getShadowColor, getStroke, render, setDropShadow, setStrokeMethods 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, toString
-
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 areIMAGEandDATA.
-
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, eitherIMAGEandDATA.
-
needsPrepare
protected boolean needsPrepare()Returns false as this class needs no preparation.- Overrides:
needsPreparein classEarthDataOverlay- Returns:
- true if this overlay class needs a preparation stage, or false if not.
-
prepare
Description copied from class:EarthDataOverlayPrepares the overlay graphics prior to drawing.- Specified by:
preparein classEarthDataOverlay- Parameters:
g- the graphics object for drawing.view- the earth data view.
-
draw
Description copied from class:EarthDataOverlayDraws the overlay graphics.- Specified by:
drawin classEarthDataOverlay- Parameters:
g- the graphics object for drawing.view- the earth data view.
-