Package noaa.coastwatch.render
Class TextOverlay
java.lang.Object
noaa.coastwatch.render.EarthDataOverlay
noaa.coastwatch.render.TextOverlay
- All Implemented Interfaces:
Serializable,Cloneable,Comparable
The
TextOverlay class may be used to render a list of
text annotation elements.- Since:
- 3.1.7
- Author:
- Peter Hollemans
- See Also:
-
Field Summary
Fields inherited from class noaa.coastwatch.render.EarthDataOverlay
alpha, lastTrans, prepared -
Constructor Summary
ConstructorsConstructorDescriptionTextOverlay(Color color) Creates a new text overlay with the specified color. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddElement(TextElement element) Adds a new text element to the list.protected voiddraw(Graphics2D g, EarthDataView view) Draws the overlay graphics.Gets an iterator over the list of text elements.getFont()Gets the text font.booleanGets the text drop shadow flag.protected booleanReturns false as this class needs no preparation.protected voidprepare(Graphics2D g, EarthDataView view) Prepares the overlay graphics prior to drawing.voidremoveElement(TextElement element) Removes an element from the list.voidSets the text font.voidsetTextDropShadow(boolean flag) Sets the text drop shadow flag.Methods inherited from class noaa.coastwatch.render.EarthDataOverlay
clone, compareTo, getAlphaVersion, getColor, getColors, getColorWithAlpha, getLayer, getMetadataAtPoint, getName, getTransparency, getVisible, hasMetadata, invalidate, isPrepared, render, setColor, setLayer, setName, setTransparency, setVisible, toString
-
Constructor Details
-
TextOverlay
Creates a new text overlay with the specified color. The layer number is initialized to 0.
-
-
Method Details
-
getTextDropShadow
public boolean getTextDropShadow()Gets the text drop shadow flag. -
setTextDropShadow
public void setTextDropShadow(boolean flag) Sets the text drop shadow flag. When drop shadow mode is on, a shadow is drawn behind the text. By default, drop shadow mode is off. -
setFont
Sets the text font. The font is set for each text element in the list. -
getFont
Gets the text font. We assume that all text elements have the same font, and that there is at least one text element. -
addElement
Adds a new text element to the list. The base point coordinates are considered to be in the data coordinate reference frame.- Parameters:
element- the new text element to add to the list.
-
getElementIterator
Gets an iterator over the list of text elements. -
removeElement
Removes an element from the list.- Parameters:
element- the element to remove from the list.
-
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.
-