NASA World Wind

gov.nasa.worldwind.layers.Earth
Class UTMGraticuleLayer

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.layers.AbstractLayer
              extended by gov.nasa.worldwind.layers.Earth.UTMGraticuleLayer
All Implemented Interfaces:
AVList, Disposable, Layer, Restorable, WWObject, java.beans.PropertyChangeListener, java.util.EventListener
Direct Known Subclasses:
MGRSGraticuleLayer

public class UTMGraticuleLayer
extends AbstractLayer

Displays the UTM graticule.


Nested Class Summary
protected  class UTMGraticuleLayer.GridElement
           
 
Field Summary
static java.lang.String GRATICULE_UTM
           
static java.lang.String LINE_STYLE_DASHED
          Dashed line rendering style.
static java.lang.String LINE_STYLE_DOTTED
          Dotted line rendering style.
static java.lang.String LINE_STYLE_SOLID
          Solid line rendering style.
 
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl
changeSupport
 
Constructor Summary
UTMGraticuleLayer()
           
 
Method Summary
protected  void addRenderable(java.lang.Object renderable, java.lang.String paramsKey)
           
 void doRender(DrawContext dc)
           
 java.awt.Color getGraticuleLineColor()
          Returns the graticule line Color.
 java.lang.String getGraticuleLineStyle()
          Returns the graticule line rendering style.
 double getGraticuleLineWidth()
          Returns the graticule line width.
 java.awt.Color getLabelColor()
          Returns the graticule label Color.
 java.awt.Font getLabelFont()
          Returns the Font used for graticule labels.
protected  gov.nasa.worldwind.layers.Earth.GraticuleRenderingParams getRenderingParams(java.lang.String key)
           
 java.lang.String getRestorableState()
          Returns an XML document string describing the object?s state.
 boolean isDrawGraticule()
          Returns whether or not graticule lines will be rendered.
 boolean isDrawLabels()
          Returns whether or not graticule labels will be rendered.
protected  void removeAllRenderables()
           
protected  void renderGraticule(DrawContext dc)
           
 void restoreState(java.lang.String stateInXml)
          Restores the object?s state to what is described in the specified XML document string.
protected  void selectUTMRenderables(DrawContext dc)
          Select the visible grid elements
 void setDrawGraticule(boolean drawGraticule)
          Sets whether or not graticule lines will be rendered.
 void setDrawLabels(boolean drawLabels)
          Sets whether or not graticule labels will be rendered.
 void setGraticuleLineColor(java.awt.Color color)
          Sets the graticule line Color.
 void setGraticuleLineStyle(java.lang.String lineStyle)
          Sets the graticule line rendering style.
 void setGraticuleLineWidth(double lineWidth)
          Sets the graticule line width.
 void setLabelColor(java.awt.Color color)
          Sets the graticule label Color.
 void setLabelFont(java.awt.Font font)
          Sets the Font used for graticule labels.
protected  void setRenderingParams(java.lang.String key, gov.nasa.worldwind.layers.Earth.GraticuleRenderingParams renderingParams)
           
 
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
dispose, doPick, getMaxActiveAltitude, getMinActiveAltitude, getName, getOpacity, getScale, isAtMaxResolution, isEnabled, isLayerActive, isLayerInView, isMultiResolution, isPickEnabled, pick, render, setEnabled, setMaxActiveAltitude, setMinActiveAltitude, setName, setOpacity, setPickEnabled, toString
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
propertyChange
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Field Detail

GRATICULE_UTM

public static final java.lang.String GRATICULE_UTM
See Also:
Constant Field Values

LINE_STYLE_DASHED

public static final java.lang.String LINE_STYLE_DASHED
Dashed line rendering style. This style specifies that a line will be drawn as a series of long strokes, with space in between.
- - - - -

is an example of a dashed line.

See Also:
Constant Field Values

LINE_STYLE_DOTTED

public static final java.lang.String LINE_STYLE_DOTTED
Dotted line rendering style. This style specifies that a line will be drawn as a series of evenly spaced "square" dots.
. . . . .
is an example of a dotted line.

See Also:
Constant Field Values

LINE_STYLE_SOLID

public static final java.lang.String LINE_STYLE_SOLID
Solid line rendering style. This style specifies that a line will be drawn without any breaks.
_________

is an example of a solid line.

See Also:
Constant Field Values
Constructor Detail

UTMGraticuleLayer

public UTMGraticuleLayer()
Method Detail

addRenderable

protected void addRenderable(java.lang.Object renderable,
                             java.lang.String paramsKey)

doRender

public void doRender(DrawContext dc)
Specified by:
doRender in class AbstractLayer

getGraticuleLineColor

public java.awt.Color getGraticuleLineColor()
Returns the graticule line Color.

Returns:
Color used to render graticule lines.

getGraticuleLineStyle

public java.lang.String getGraticuleLineStyle()
Returns the graticule line rendering style.

Returns:
rendering style of the graticule lines.

getGraticuleLineWidth

public double getGraticuleLineWidth()
Returns the graticule line width.

Returns:
width of the graticule lines.

getLabelColor

public java.awt.Color getLabelColor()
Returns the graticule label Color.

Returns:
Color used to render graticule labels.

getLabelFont

public java.awt.Font getLabelFont()
Returns the Font used for graticule labels.

Returns:
Font used to render graticule labels.

getRenderingParams

protected gov.nasa.worldwind.layers.Earth.GraticuleRenderingParams getRenderingParams(java.lang.String key)

getRestorableState

public java.lang.String getRestorableState()
Description copied from interface: Restorable
Returns an XML document string describing the object?s state. This state can be restored later by calling restoreState and passing the XML document.

Specified by:
getRestorableState in interface Restorable
Overrides:
getRestorableState in class AbstractLayer
Returns:
an XML document string describing the object's state.

isDrawGraticule

public boolean isDrawGraticule()
Returns whether or not graticule lines will be rendered.

Returns:
true if graticule lines will be rendered; false otherwise.

isDrawLabels

public boolean isDrawLabels()
Returns whether or not graticule labels will be rendered.

Returns:
true if graticule labels will be rendered; false otherwise.

removeAllRenderables

protected void removeAllRenderables()

renderGraticule

protected void renderGraticule(DrawContext dc)

restoreState

public void restoreState(java.lang.String stateInXml)
Description copied from interface: Restorable
Restores the object?s state to what is described in the specified XML document string.

Specified by:
restoreState in interface Restorable
Overrides:
restoreState in class AbstractLayer
Parameters:
stateInXml - an XML document string describing an object's state.

selectUTMRenderables

protected void selectUTMRenderables(DrawContext dc)
Select the visible grid elements

Parameters:
dc - the current DrawContext.

setDrawGraticule

public void setDrawGraticule(boolean drawGraticule)
Sets whether or not graticule lines will be rendered.

Parameters:
drawGraticule - true to render graticule lines; false to disable rendering.

setDrawLabels

public void setDrawLabels(boolean drawLabels)
Sets whether or not graticule labels will be rendered.

Parameters:
drawLabels - true to render graticule labels; false to disable rendering.

setGraticuleLineColor

public void setGraticuleLineColor(java.awt.Color color)
Sets the graticule line Color.

Parameters:
color - Color that will be used to render graticule lines.
Throws:
java.lang.IllegalArgumentException - if color is null.

setGraticuleLineStyle

public void setGraticuleLineStyle(java.lang.String lineStyle)
Sets the graticule line rendering style.

Parameters:
lineStyle - rendering style of the graticule lines. One of LINE_STYLE_PLAIN, LINE_STYLE_DASHED, or LINE_STYLE_DOTTED.
Throws:
java.lang.IllegalArgumentException - if lineStyle is null.

setGraticuleLineWidth

public void setGraticuleLineWidth(double lineWidth)
Sets the graticule line width.

Parameters:
lineWidth - width of the graticule lines.

setLabelColor

public void setLabelColor(java.awt.Color color)
Sets the graticule label Color.

Parameters:
color - Color that will be used to render graticule labels.
Throws:
java.lang.IllegalArgumentException - if color is null.

setLabelFont

public void setLabelFont(java.awt.Font font)
Sets the Font used for graticule labels.

Parameters:
font - Font that will be used to render graticule labels.
Throws:
java.lang.IllegalArgumentException - if font is null.

setRenderingParams

protected void setRenderingParams(java.lang.String key,
                                  gov.nasa.worldwind.layers.Earth.GraticuleRenderingParams renderingParams)

NASA World Wind