Package gov.nasa.worldwind.layers
Class GARSGraticuleLayer
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.layers.AbstractLayer
-
- gov.nasa.worldwind.layers.AbstractGraticuleLayer
-
- gov.nasa.worldwind.layers.GARSGraticuleLayer
-
- All Implemented Interfaces:
AVList
,Disposable
,MessageListener
,Layer
,Restorable
,WWObject
,java.beans.PropertyChangeListener
,java.util.EventListener
public class GARSGraticuleLayer extends AbstractGraticuleLayer
Displays the geographic Global Area Reference System (GARS) graticule. The graticule has four levels. The first level displays lines of latitude and longitude. The second level displays 30 minute square grid cells. The third level displays 15 minute grid cells. The fourth and final level displays 5 minute grid cells. This graticule is intended to be used on 2D globes because it is so dense.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
GARSGraticuleLayer.GraticuleTile
-
Nested classes/interfaces inherited from class gov.nasa.worldwind.layers.AbstractGraticuleLayer
AbstractGraticuleLayer.GridElement
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
angleFormat
protected static java.lang.String
chars
static java.lang.String
GRATICULE_GARS_LEVEL_0
static java.lang.String
GRATICULE_GARS_LEVEL_1
static java.lang.String
GRATICULE_GARS_LEVEL_2
static java.lang.String
GRATICULE_GARS_LEVEL_3
protected GARSGraticuleLayer.GraticuleTile[][]
gridTiles
protected java.util.ArrayList<java.lang.Double>
latitudeLabels
protected static java.util.ArrayList<java.lang.String>
latLabels
protected static java.lang.String[][]
level2Labels
protected java.util.ArrayList<java.lang.Double>
longitudeLabels
protected static java.util.ArrayList<java.lang.String>
lonLabels
protected static int
MIN_CELL_SIZE_PIXELS
protected double[]
thresholds
Indicates the eye altitudes in meters below which each level should be displayed.-
Fields inherited from class gov.nasa.worldwind.layers.AbstractGraticuleLayer
frameTimeStamp, globe, graticuleSupport, gridElements, lastEyePoint, lastProjection, lastVerticalExaggeration, lastViewFOV, lastViewHeading, lastViewPitch, LINE_STYLE_DASHED, LINE_STYLE_DOTTED, LINE_STYLE_SOLID, terrainConformance
-
-
Constructor Summary
Constructors Constructor Description GARSGraticuleLayer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addLevel0Label(double value, java.lang.String labelType, java.lang.String graticuleType, double resolution, LatLon labelOffset)
protected void
clear(DrawContext dc)
protected void
clearTiles()
double
get15MinuteThreshold()
Indicates the eye altitude below which the 15 minute grid is displayed.double
get30MinuteThreshold()
Indicates the eye altitude below which the 30 minute grid is displayed.double
get5MinuteThreshold()
Indicates the eye altitude below which the 5 minute grid is displayed.java.lang.String
getAngleFormat()
Get the graticule division and angular display format.protected java.lang.String[]
getOrderedTypes()
protected java.lang.String
getTypeFor(double resolution)
protected java.util.ArrayList<GARSGraticuleLayer.GraticuleTile>
getVisibleTiles(DrawContext dc)
protected void
initRenderingParams()
protected java.lang.String
makeAngleLabel(Angle angle, double resolution)
protected java.lang.String
makeLabel(Sector sector, java.lang.String graticuleType)
protected void
selectRenderables(DrawContext dc)
Select the visible grid elementsvoid
set15MinuteThreshold(double altitude)
Specifies the eye altitude below which the 15 minute grid is displayed.void
set30MinuteThreshold(double altitude)
Specifies the eye altitude below which the 30 minute grid is displayed.void
set5MinuteThreshold(double altitude)
Specifies the eye altitude below which the 5 minute grid is displayed.void
setAngleFormat(java.lang.String format)
Sets the graticule division and angular display format.-
Methods inherited from class gov.nasa.worldwind.layers.AbstractGraticuleLayer
addRenderable, computeAltitudeAboveGround, computeLabelOffset, computeTerrainConformance, computeTruncatedSegment, createLineRenderable, doPreRender, doRender, getDeltaLongitude, getGraticuleLineColor, getGraticuleLineStyle, getGraticuleLineWidth, getLabelColor, getLabelFont, getRenderingParams, getRestorableState, getSurfacePoint, greatCircleIntersectionAtLatitude, greatCircleIntersectionAtLongitude, greatCircleMidPoint, isDrawGraticule, isDrawLabels, needsToUpdate, 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, 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 gov.nasa.worldwind.event.MessageListener
onMessage
-
-
-
-
Field Detail
-
GRATICULE_GARS_LEVEL_0
public static final java.lang.String GRATICULE_GARS_LEVEL_0
- See Also:
- Constant Field Values
-
GRATICULE_GARS_LEVEL_1
public static final java.lang.String GRATICULE_GARS_LEVEL_1
- See Also:
- Constant Field Values
-
GRATICULE_GARS_LEVEL_2
public static final java.lang.String GRATICULE_GARS_LEVEL_2
- See Also:
- Constant Field Values
-
GRATICULE_GARS_LEVEL_3
public static final java.lang.String GRATICULE_GARS_LEVEL_3
- See Also:
- Constant Field Values
-
MIN_CELL_SIZE_PIXELS
protected static final int MIN_CELL_SIZE_PIXELS
- See Also:
- Constant Field Values
-
gridTiles
protected GARSGraticuleLayer.GraticuleTile[][] gridTiles
-
latitudeLabels
protected java.util.ArrayList<java.lang.Double> latitudeLabels
-
longitudeLabels
protected java.util.ArrayList<java.lang.Double> longitudeLabels
-
angleFormat
protected java.lang.String angleFormat
-
thresholds
protected double[] thresholds
Indicates the eye altitudes in meters below which each level should be displayed.
-
latLabels
protected static java.util.ArrayList<java.lang.String> latLabels
-
lonLabels
protected static java.util.ArrayList<java.lang.String> lonLabels
-
chars
protected static java.lang.String chars
-
level2Labels
protected static java.lang.String[][] level2Labels
-
-
Method Detail
-
getAngleFormat
public java.lang.String getAngleFormat()
Get the graticule division and angular display format. Can be one ofAngle.ANGLE_FORMAT_DD
orAngle.ANGLE_FORMAT_DMS
.- Returns:
- the graticule division and angular display format.
-
setAngleFormat
public void setAngleFormat(java.lang.String format)
Sets the graticule division and angular display format. Can be one ofAngle.ANGLE_FORMAT_DD
,Angle.ANGLE_FORMAT_DMS
ofAngle.ANGLE_FORMAT_DM
.- Parameters:
format
- the graticule division and angular display format.- Throws:
java.lang.IllegalArgumentException
- isformat
is null.
-
set30MinuteThreshold
public void set30MinuteThreshold(double altitude)
Specifies the eye altitude below which the 30 minute grid is displayed.- Parameters:
altitude
- the eye altitude in meters below which the 30 minute grid is displayed.
-
get30MinuteThreshold
public double get30MinuteThreshold()
Indicates the eye altitude below which the 30 minute grid is displayed.- Returns:
- the eye altitude in meters below which the 30 minute grid is displayed.
-
set15MinuteThreshold
public void set15MinuteThreshold(double altitude)
Specifies the eye altitude below which the 15 minute grid is displayed.- Parameters:
altitude
- the eye altitude in meters below which the 15 minute grid is displayed.
-
get15MinuteThreshold
public double get15MinuteThreshold()
Indicates the eye altitude below which the 15 minute grid is displayed.- Returns:
- the eye altitude in meters below which the 15 minute grid is displayed.
-
set5MinuteThreshold
public void set5MinuteThreshold(double altitude)
Specifies the eye altitude below which the 5 minute grid is displayed.- Parameters:
altitude
- the eye altitude in meters below which the 5 minute grid is displayed.
-
get5MinuteThreshold
public double get5MinuteThreshold()
Indicates the eye altitude below which the 5 minute grid is displayed.- Returns:
- the eye altitude in meters below which the 5 minute grid is displayed.
-
initRenderingParams
protected void initRenderingParams()
-
getOrderedTypes
protected java.lang.String[] getOrderedTypes()
-
getTypeFor
protected java.lang.String getTypeFor(double resolution)
-
clear
protected void clear(DrawContext dc)
- Overrides:
clear
in classAbstractGraticuleLayer
-
selectRenderables
protected void selectRenderables(DrawContext dc)
Select the visible grid elements- Overrides:
selectRenderables
in classAbstractGraticuleLayer
- Parameters:
dc
- the currentDrawContext
.
-
getVisibleTiles
protected java.util.ArrayList<GARSGraticuleLayer.GraticuleTile> getVisibleTiles(DrawContext dc)
-
clearTiles
protected void clearTiles()
-
makeAngleLabel
protected java.lang.String makeAngleLabel(Angle angle, double resolution)
-
addLevel0Label
protected void addLevel0Label(double value, java.lang.String labelType, java.lang.String graticuleType, double resolution, LatLon labelOffset)
-
makeLabel
protected java.lang.String makeLabel(Sector sector, java.lang.String graticuleType)
-
-