Package noaa.coastwatch.render
Class LabeledLineOverlay
java.lang.Object
noaa.coastwatch.render.EarthDataOverlay
noaa.coastwatch.render.LineOverlay
noaa.coastwatch.render.LabeledLineOverlay
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable
- Direct Known Subclasses:
DataReferenceOverlay
,LatLonOverlay
A
LabeledLineOverlay
renders lines and labels on
an EarthDataView
. A labeled line is any line that has
a labeled value and some connected set of points to display
such as a line of latitude/longitude or a data contour line.- Since:
- 3.2.2
- 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
ConstructorDescriptionLabeledLineOverlay
(Color color) Constructs a new labeled line overlay.LabeledLineOverlay
(Color color, int layer, Stroke stroke, boolean drawLabels, Font font) Constructs a new labeled line overlay. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
draw
(Graphics2D g, EarthDataView view) Draws the overlay graphics.boolean
Gets the line labels flag.getFont()
Gets the line labels font.protected abstract LineCollection
getLines
(EarthDataView view) Gets the collection of lines for this overlay.boolean
Gets the text drop shadow flag.protected void
prepare
(Graphics2D g, EarthDataView view) Prepares the overlay graphics prior to drawing.void
setDrawLabels
(boolean drawLabels) Sets the line labels flag.void
Sets the line labels font.void
setTextDropShadow
(boolean flag) Sets the text drop shadow flag.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, needsPrepare, setColor, setLayer, setName, setTransparency, setVisible
-
Constructor Details
-
LabeledLineOverlay
Constructs a new labeled line overlay.- Parameters:
color
- the overlay color.layer
- the overlay layer number.stroke
- the stroke to use for vector paths.drawLabels
- the line labels flag, true if labels should be drawn.font
- the line labels font. The labels font may be null if no labels are to be drawn.
-
LabeledLineOverlay
Constructs a new labeled line overlay. The layer number is initialized to 0, the stroke to the defaultBasicStroke
, labels to true, and the font to the default font face, plain style, 12 point.- Parameters:
color
- the overlay color.
-
-
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 text drop shadow mode is on, a shadow is drawn behind the text labels. By default, text drop shadow mode is on. -
setDrawLabels
public void setDrawLabels(boolean drawLabels) Sets the line labels flag. -
getDrawLabels
public boolean getDrawLabels()Gets the line labels flag. -
setFont
Sets the line labels font. -
getFont
Gets the line labels font. -
getLines
Gets the collection of lines for this overlay. This method should be implemented by the subclass and is called byprepare(java.awt.Graphics2D, noaa.coastwatch.render.EarthDataView)
.- Parameters:
view
- the earth view for line rendering.- Returns:
- the collection of lines to render.
-
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.
-