Package noaa.coastwatch.render
Class LatLonOverlay
java.lang.Object
noaa.coastwatch.render.EarthDataOverlay
noaa.coastwatch.render.LineOverlay
noaa.coastwatch.render.LabeledLineOverlay
noaa.coastwatch.render.LatLonOverlay
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable
The
LatLonOverlay
class annotates an EarthDataView
view with latitude/longitude grid lines and
labels.- Since:
- 3.1.1
- 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
ConstructorDescriptionLatLonOverlay
(Color color) Constructs a new grid overlay.LatLonOverlay
(Color color, int layer, Stroke stroke, boolean manualIncrement, int inc, boolean drawLabels, Font font) Constructs a new grid overlay. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the current grid increment value in degrees.protected LineCollection
getLines
(EarthDataView view) Gets the collection of lines for this overlay.boolean
Gets the manual grid increment mode flag.void
setIncrement
(int inc) Sets the grid increment in degrees.void
setManualIncrement
(boolean flag) Sets the manual grid increment mode flag.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
-
LatLonOverlay
public LatLonOverlay(Color color, int layer, Stroke stroke, boolean manualIncrement, int inc, 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.manualIncrement
- the manual increment flag.inc
- the latitude and longitude grid increment in degrees.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.
-
LatLonOverlay
Constructs a new grid overlay. The layer number is initialized to 0, the stroke to the defaultBasicStroke
, the grid increment mode to automatic, labels to true, and the font to the default font face, plain style, 12 point.- Parameters:
color
- the overlay color.
-
-
Method Details
-
setManualIncrement
public void setManualIncrement(boolean flag) Sets the manual grid increment mode flag. When off, the grid increment is calculated automatically at rendering time for an optimal number of grid lines. -
getManualIncrement
public boolean getManualIncrement()Gets the manual grid increment mode flag. -
setIncrement
public void setIncrement(int inc) Sets the grid increment in degrees. -
getIncrement
public int getIncrement()Gets the current grid increment value in degrees. -
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.
-