Package noaa.coastwatch.render
Class DataReferenceOverlay
java.lang.Object
noaa.coastwatch.render.EarthDataOverlay
noaa.coastwatch.render.LineOverlay
noaa.coastwatch.render.LabeledLineOverlay
noaa.coastwatch.render.DataReferenceOverlay
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable
The
DataReferenceOverlay
class annotates an EarthDataView
object with row/column grid lines and labels.- 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
ConstructorDescriptionDataReferenceOverlay
(Color color) Constructs a new grid overlay.DataReferenceOverlay
(Color color, int layer, Stroke stroke, boolean manualLines, double[] rows, double[] cols, boolean drawLabels, Font font) Constructs a new grid overlay. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
getCols()
Gets the current reference row lines.protected LineCollection
getLines
(EarthDataView view) Gets the collection of lines for this overlay.boolean
Gets the manual grid increment mode flag.double[]
getRows()
Gets the current reference row lines.static void
Tests this class.void
setCols
(double[] cols) Sets the reference row lines.void
setManualLines
(boolean flag) Sets the manual grid lines flag.void
setRows
(double[] rows) Sets the reference row lines.Methods inherited from class noaa.coastwatch.render.LabeledLineOverlay
draw, getDrawLabels, getFont, getTextDropShadow, prepare, setDrawLabels, setFont, setTextDropShadow
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, toString
-
Constructor Details
-
DataReferenceOverlay
public DataReferenceOverlay(Color color, int layer, Stroke stroke, boolean manualLines, double[] rows, double[] cols, boolean drawLabels, Font font) Constructs a new grid overlay.- Parameters:
color
- the overlay color.layer
- the overlay layer number.stroke
- the stroke to use for vector paths.manualLines
- the manual lines flag.rows
- the reference row line values.cols
- the reference column line values.drawLabels
- the grid labels flag, true if grid labels should be drawn.font
- the grid labels font. The labels font may be null if no labels are to be drawn.
-
DataReferenceOverlay
Constructs a new grid overlay. The layer number is initialized to 0, the stroke to the defaultBasicStroke
, the manual lines flag to false, labels to true, and the font to the default font face, plain style, 12 point.- Parameters:
color
- the overlay color.
-
-
Method Details
-
setManualLines
public void setManualLines(boolean flag) Sets the manual grid lines flag. When off, the grid lines are calculated automatically at rendering time for an optimal number of grid lines in both the rows and columns directions. -
getManualLines
public boolean getManualLines()Gets the manual grid increment mode flag. -
setRows
public void setRows(double[] rows) Sets the reference row lines. -
getRows
public double[] getRows()Gets the current reference row lines. -
setCols
public void setCols(double[] cols) Sets the reference row lines. -
getCols
public double[] getCols()Gets the current reference row lines. -
getLines
Description copied from class:LabeledLineOverlay
Gets the collection of lines for this overlay. This method should be implemented by the subclass and is called byLabeledLineOverlay.prepare(java.awt.Graphics2D, noaa.coastwatch.render.EarthDataView)
.- Specified by:
getLines
in classLabeledLineOverlay
- Parameters:
view
- the earth view for line rendering.- Returns:
- the collection of lines to render.
-
main
Tests this class.- Parameters:
argv
- the array of command line parameters.
-