NASA World Wind

gov.nasa.worldwind.layers
Class LatLonGraticuleLayer

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.LatLonGraticuleLayer
All Implemented Interfaces:
AVList, Disposable, Layer, Restorable, WWObject, PropertyChangeListener, EventListener

public class LatLonGraticuleLayer
extends AbstractGraticuleLayer

Displays the geographic latitude/longitude graticule.


Nested Class Summary
protected  class LatLonGraticuleLayer.GraticuleTile
           
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.layers.AbstractGraticuleLayer
AbstractGraticuleLayer.GridElement
 
Field Summary
static String GRATICULE_LATLON_LEVEL_0
           
static String GRATICULE_LATLON_LEVEL_1
           
static String GRATICULE_LATLON_LEVEL_2
           
static String GRATICULE_LATLON_LEVEL_3
           
static String GRATICULE_LATLON_LEVEL_4
           
static String GRATICULE_LATLON_LEVEL_5
           
protected  LatLonGraticuleLayer.GraticuleTile[][] gridTiles
           
protected  ArrayList<Double> latitudeLabels
           
protected  ArrayList<Double> longitudeLabels
           
protected static int MIN_CELL_SIZE_PIXELS
           
 
Fields inherited from class gov.nasa.worldwind.layers.AbstractGraticuleLayer
graticuleSupport, gridElements
 
Fields inherited from class gov.nasa.worldwind.layers.AbstractLayer
screenCredit
 
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl
changeSupport
 
Constructor Summary
LatLonGraticuleLayer()
           
 
Method Summary
protected  void addLabel(double value, String labelType, String graticuleType, double resolution, LatLon labelOffset)
           
protected  void clear(DrawContext dc)
           
protected  void clearTiles()
           
protected  LatLon computeLabelOffset(DrawContext dc)
           
protected  double computeTerrainConformance(DrawContext dc)
           
 void doRender(DrawContext dc)
           
 String getAngleFormat()
          Get the graticule division and angular display format.
protected  String[] getOrderedTypes()
           
protected  String getTypeFor(double resolution)
           
protected  ArrayList<LatLonGraticuleLayer.GraticuleTile> getVisibleTiles(DrawContext dc)
           
protected  void initRenderingParams()
           
protected  String makeAngleLabel(Angle angle, double resolution)
           
protected  boolean needsToUpdate(DrawContext dc)
          Determines whether the grid should be updated.
protected  void selectRenderables(DrawContext dc)
          Select the visible grid elements
 void setAngleFormat(String format)
          Sets the graticule division and angular display format.
 
Methods inherited from class gov.nasa.worldwind.layers.AbstractGraticuleLayer
addRenderable, computeAltitudeAboveGround, getGraticuleLineColor, getGraticuleLineStyle, getGraticuleLineWidth, getLabelColor, getLabelFont, getRenderingParams, getRestorableState, getSurfacePoint, isDrawGraticule, isDrawLabels, removeAllRenderables, renderGraticule, restoreState, setDrawGraticule, setDrawLabels, setGraticuleLineColor, setGraticuleLineStyle, setGraticuleLineWidth, setLabelColor, setLabelFont, setRenderingParams
 
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
dispose, doPick, doPreRender, getExpiryTime, getMaxActiveAltitude, getMinActiveAltitude, getName, getOpacity, getScale, getScreenCredit, isAtMaxResolution, isEnabled, isLayerActive, isLayerInView, isMultiResolution, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, render, setEnabled, setExpiryTime, setMaxActiveAltitude, setMinActiveAltitude, setName, setNetworkRetrievalEnabled, setOpacity, setPickEnabled, setScreenCredit, 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_LATLON_LEVEL_0

public static final String GRATICULE_LATLON_LEVEL_0
See Also:
Constant Field Values

GRATICULE_LATLON_LEVEL_1

public static final String GRATICULE_LATLON_LEVEL_1
See Also:
Constant Field Values

GRATICULE_LATLON_LEVEL_2

public static final String GRATICULE_LATLON_LEVEL_2
See Also:
Constant Field Values

GRATICULE_LATLON_LEVEL_3

public static final String GRATICULE_LATLON_LEVEL_3
See Also:
Constant Field Values

GRATICULE_LATLON_LEVEL_4

public static final String GRATICULE_LATLON_LEVEL_4
See Also:
Constant Field Values

GRATICULE_LATLON_LEVEL_5

public static final String GRATICULE_LATLON_LEVEL_5
See Also:
Constant Field Values

gridTiles

protected LatLonGraticuleLayer.GraticuleTile[][] gridTiles

latitudeLabels

protected ArrayList<Double> latitudeLabels

longitudeLabels

protected ArrayList<Double> longitudeLabels

MIN_CELL_SIZE_PIXELS

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

LatLonGraticuleLayer

public LatLonGraticuleLayer()
Method Detail

addLabel

protected void addLabel(double value,
                        String labelType,
                        String graticuleType,
                        double resolution,
                        LatLon labelOffset)

clear

protected void clear(DrawContext dc)

clearTiles

protected void clearTiles()

computeLabelOffset

protected LatLon computeLabelOffset(DrawContext dc)

computeTerrainConformance

protected double computeTerrainConformance(DrawContext dc)

doRender

public void doRender(DrawContext dc)
Overrides:
doRender in class AbstractGraticuleLayer

getAngleFormat

public String getAngleFormat()
Get the graticule division and angular display format. Can be one of or .

Returns:
the graticule division and angular display format.

getOrderedTypes

protected String[] getOrderedTypes()

getTypeFor

protected String getTypeFor(double resolution)

getVisibleTiles

protected ArrayList<LatLonGraticuleLayer.GraticuleTile> getVisibleTiles(DrawContext dc)

initRenderingParams

protected void initRenderingParams()

makeAngleLabel

protected String makeAngleLabel(Angle angle,
                                double resolution)

needsToUpdate

protected boolean needsToUpdate(DrawContext dc)
Determines whether the grid should be updated. It returns true if:
  • the eye has moved more than 1% of its altitude above ground
  • the view FOV, heading or pitch have changed more than 1 degree
  • vertical exaggeration has changed
Parameters:
dc - the current DrawContext.
Returns:
true if the graticule should be updated.

selectRenderables

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

Overrides:
selectRenderables in class AbstractGraticuleLayer
Parameters:
dc - the current DrawContext.

setAngleFormat

public void setAngleFormat(String format)
Sets the graticule division and angular display format. Can be one of or .

Parameters:
format - the graticule division and angular display format.
Throws:
IllegalArgumentException - is format is null.

NASA World Wind

Hosted by docs.bugaco.com