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
ConstructorDescriptionTextOverlay
(Color color) Creates a new text overlay with the specified color. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement
(TextElement element) Adds a new text element to the list.protected void
draw
(Graphics2D g, EarthDataView view) Draws the overlay graphics.Gets an iterator over the list of text elements.getFont()
Gets the text font.boolean
Gets the text drop shadow flag.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
removeElement
(TextElement element) Removes an element from the list.void
Sets the text font.void
setTextDropShadow
(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
-
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:
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.
-