NASA World Wind

gov.nasa.worldwind.layers.Earth
Class UTMBaseGraticuleLayer

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.AbstractGraticuleLayer
                  extended by gov.nasa.worldwind.layers.Earth.UTMBaseGraticuleLayer
All Implemented Interfaces:
AVList, Disposable, MessageListener, Layer, Restorable, WWObject, PropertyChangeListener, EventListener
Direct Known Subclasses:
MGRSGraticuleLayer, UTMGraticuleLayer

public class UTMBaseGraticuleLayer
extends AbstractGraticuleLayer

Displays the UTM graticule.


Nested Class Summary
protected  class UTMBaseGraticuleLayer.MetricScaleSupport
           
protected  class UTMBaseGraticuleLayer.SquareGrid
          Represent a square 10x10 grid and recursive tree in easting/northing coordinates
protected  class UTMBaseGraticuleLayer.SquareZone
          Represent a 100km square zone inside an UTM zone.
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.layers.AbstractGraticuleLayer
AbstractGraticuleLayer.GridElement
 
Field Summary
protected  long frameCount
           
static String GRATICULE_UTM
           
protected  UTMBaseGraticuleLayer.MetricScaleSupport metricScaleSupport
           
protected static double ONEHT
           
protected static int UTM_MAX_LATITUDE
           
protected static int UTM_MIN_LATITUDE
           
 
Fields inherited from class gov.nasa.worldwind.layers.AbstractGraticuleLayer
globe, graticuleSupport, gridElements, lastEyePoint, lastVerticalExaggeration, lastViewFOV, lastViewHeading, lastViewPitch, LINE_STYLE_DASHED, LINE_STYLE_DOTTED, LINE_STYLE_SOLID, polylineTerrainConformance, useSurfaceShapes, viewFrustum
 
Constructor Summary
UTMBaseGraticuleLayer()
           
 
Method Summary
protected  Position computePosition(int zone, String hemisphere, double easting, double northing)
           
protected  Position computePositionFromUPS(String hemisphere, double easting, double northing)
           
protected  Position computePositionFromUTM(int zone, String hemisphere, double easting, double northing)
           
protected  ArrayList<UTMBaseGraticuleLayer.SquareZone> createSquaresGrid(int UTMZone, String hemisphere, Sector UTMZoneSector, double minEasting, double maxEasting, double minNorthing, double maxNorthing)
           
 Color getGraticuleLineColor()
          Returns the graticule line Color.
 String getGraticuleLineStyle()
          Returns the graticule line rendering style.
 double getGraticuleLineWidth()
          Returns the graticule line width.
 Color getLabelColor()
          Returns the graticule label Color.
 Font getLabelFont()
          Returns the Font used for graticule labels.
protected  String getTypeFor(int resolution)
           
protected  void initRenderingParams()
           
 boolean isDrawGraticule()
          Returns whether or not graticule lines will be rendered.
 boolean isDrawLabels()
          Returns whether or not graticule labels will be rendered.
protected  void selectRenderables(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(Color color)
          Sets the graticule line Color.
 void setGraticuleLineStyle(String lineStyle)
          Sets the graticule line rendering style.
 void setGraticuleLineWidth(double lineWidth)
          Sets the graticule line width.
 void setLabelColor(Color color)
          Sets the graticule label Color.
 void setLabelFont(Font font)
          Sets the Font used for graticule labels.
 
Methods inherited from class gov.nasa.worldwind.layers.AbstractGraticuleLayer
addRenderable, clear, computeAltitudeAboveGround, computeLabelOffset, computeTerrainConformance, computeTruncatedSegment, createLineRenderable, doPreRender, doRender, getDeltaLongitude, getGraticuleLineColor, getGraticuleLineStyle, getGraticuleLineWidth, getLabelColor, getLabelFont, getRenderingParams, getRestorableState, getSurfacePoint, greatCircleIntersectionAtLatitude, greatCircleIntersectionAtLongitude, greatCircleMidPoint, isDrawGraticule, isDrawLabels, needsToUpdate, preRenderGraticule, removeAllRenderables, renderGraticule, restoreState, setDrawGraticule, setDrawLabels, setGraticuleLineColor, setGraticuleLineStyle, setGraticuleLineWidth, setLabelColor, setLabelFont, setRenderingParams
 
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
createLayerConfigElements, dispose, doPick, getDataFileStore, getExpiryTime, getLayerConfigParams, getMaxActiveAltitude, getMaxEffectiveAltitude, getMinActiveAltitude, getMinEffectiveAltitude, getName, getOpacity, getScale, getScreenCredit, isAtMaxResolution, isEnabled, isLayerActive, isLayerConfigDocument, isLayerInView, isMultiResolution, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, render, setDataFileStore, setEnabled, setExpiryTime, setMaxActiveAltitude, setMinActiveAltitude, setName, setNetworkRetrievalEnabled, setOpacity, setPickEnabled, setScreenCredit, toString
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, 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
 
Methods inherited from interface gov.nasa.worldwind.event.MessageListener
onMessage
 

Field Detail

frameCount

protected long frameCount

GRATICULE_UTM

public static final String GRATICULE_UTM
See Also:
Constant Field Values

metricScaleSupport

protected UTMBaseGraticuleLayer.MetricScaleSupport metricScaleSupport

ONEHT

protected static final double ONEHT
See Also:
Constant Field Values

UTM_MAX_LATITUDE

protected static final int UTM_MAX_LATITUDE
See Also:
Constant Field Values

UTM_MIN_LATITUDE

protected static final int UTM_MIN_LATITUDE
See Also:
Constant Field Values
Constructor Detail

UTMBaseGraticuleLayer

public UTMBaseGraticuleLayer()
Method Detail

computePosition

protected Position computePosition(int zone,
                                   String hemisphere,
                                   double easting,
                                   double northing)

computePositionFromUPS

protected Position computePositionFromUPS(String hemisphere,
                                          double easting,
                                          double northing)

computePositionFromUTM

protected Position computePositionFromUTM(int zone,
                                          String hemisphere,
                                          double easting,
                                          double northing)

createSquaresGrid

protected ArrayList<UTMBaseGraticuleLayer.SquareZone> createSquaresGrid(int UTMZone,
                                                                        String hemisphere,
                                                                        Sector UTMZoneSector,
                                                                        double minEasting,
                                                                        double maxEasting,
                                                                        double minNorthing,
                                                                        double maxNorthing)

getGraticuleLineColor

public Color getGraticuleLineColor()
Returns the graticule line Color.

Returns:
Color used to render graticule lines.

getGraticuleLineStyle

public 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 Color getLabelColor()
Returns the graticule label Color.

Returns:
Color used to render graticule labels.

getLabelFont

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

Returns:
Font used to render graticule labels.

getTypeFor

protected String getTypeFor(int resolution)

initRenderingParams

protected void initRenderingParams()

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.

selectRenderables

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

Overrides:
selectRenderables in class AbstractGraticuleLayer
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(Color color)
Sets the graticule line Color.

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

setGraticuleLineStyle

public void setGraticuleLineStyle(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:
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(Color color)
Sets the graticule label Color.

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

setLabelFont

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

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

NASA World Wind