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
drawingShadowFields inherited from class noaa.coastwatch.render.EarthDataOverlay
alpha, lastTrans, prepared -
Constructor Summary
ConstructorsConstructorDescriptionLabeledLineOverlay(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 voiddraw(Graphics2D g, EarthDataView view) Draws the overlay graphics.booleanGets the line labels flag.getFont()Gets the line labels font.protected abstract LineCollectiongetLines(EarthDataView view) Gets the collection of lines for this overlay.booleanGets the text drop shadow flag.protected voidprepare(Graphics2D g, EarthDataView view) Prepares the overlay graphics prior to drawing.voidsetDrawLabels(boolean drawLabels) Sets the line labels flag.voidSets the line labels font.voidsetTextDropShadow(boolean flag) Sets the text drop shadow flag.Methods 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, getColors, getColorWithAlpha, getLayer, getMetadataAtPoint, getName, getTransparency, getVisible, hasMetadata, invalidate, isPrepared, needsPrepare, setColor, setLayer, setName, setTransparency, setVisible, toString
-
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: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.
-