Package gov.nasa.worldwind.layers.Earth
Class UTMBaseGraticuleLayer
- 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.Earth.UTMBaseGraticuleLayer
-
- All Implemented Interfaces:
AVList,Disposable,MessageListener,Layer,Restorable,WWObject,java.beans.PropertyChangeListener,java.util.EventListener
- Direct Known Subclasses:
MGRSGraticuleLayer,UTMGraticuleLayer
public class UTMBaseGraticuleLayer extends AbstractGraticuleLayer
Displays the UTM graticule.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classUTMBaseGraticuleLayer.MetricScaleSupportprotected classUTMBaseGraticuleLayer.SquareGridRepresent a square 10x10 grid and recursive tree in easting/northing coordinatesprotected classUTMBaseGraticuleLayer.SquareZoneRepresent a 100km square zone inside an UTM zone.-
Nested classes/interfaces inherited from class gov.nasa.worldwind.layers.AbstractGraticuleLayer
AbstractGraticuleLayer.GridElement
-
-
Field Summary
Fields Modifier and Type Field Description protected longframeCountstatic java.lang.StringGRATICULE_UTMprotected UTMBaseGraticuleLayer.MetricScaleSupportmetricScaleSupportprotected static doubleONEHTprotected static intUTM_MAX_LATITUDEprotected static intUTM_MIN_LATITUDE-
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 UTMBaseGraticuleLayer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PositioncomputePosition(int zone, java.lang.String hemisphere, double easting, double northing)protected PositioncomputePositionFromUPS(java.lang.String hemisphere, double easting, double northing)protected PositioncomputePositionFromUTM(int zone, java.lang.String hemisphere, double easting, double northing)protected java.util.ArrayList<UTMBaseGraticuleLayer.SquareZone>createSquaresGrid(int UTMZone, java.lang.String hemisphere, Sector UTMZoneSector, double minEasting, double maxEasting, double minNorthing, double maxNorthing)java.awt.ColorgetGraticuleLineColor()Returns the graticule line Color.java.lang.StringgetGraticuleLineStyle()Returns the graticule line rendering style.doublegetGraticuleLineWidth()Returns the graticule line width.java.awt.ColorgetLabelColor()Returns the graticule label Color.java.awt.FontgetLabelFont()Returns the Font used for graticule labels.protected java.lang.StringgetTypeFor(int resolution)protected voidinitRenderingParams()booleanisDrawGraticule()Returns whether or not graticule lines will be rendered.booleanisDrawLabels()Returns whether or not graticule labels will be rendered.protected voidselectRenderables(DrawContext dc)Select the visible grid elementsvoidsetDrawGraticule(boolean drawGraticule)Sets whether or not graticule lines will be rendered.voidsetDrawLabels(boolean drawLabels)Sets whether or not graticule labels will be rendered.voidsetGraticuleLineColor(java.awt.Color color)Sets the graticule line Color.voidsetGraticuleLineStyle(java.lang.String lineStyle)Sets the graticule line rendering style.voidsetGraticuleLineWidth(double lineWidth)Sets the graticule line width.voidsetLabelColor(java.awt.Color color)Sets the graticule label Color.voidsetLabelFont(java.awt.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, 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_UTM
public static final java.lang.String GRATICULE_UTM
- See Also:
- Constant Field Values
-
ONEHT
protected static final double ONEHT
- See Also:
- Constant Field Values
-
UTM_MIN_LATITUDE
protected static final int UTM_MIN_LATITUDE
- See Also:
- Constant Field Values
-
UTM_MAX_LATITUDE
protected static final int UTM_MAX_LATITUDE
- See Also:
- Constant Field Values
-
metricScaleSupport
protected UTMBaseGraticuleLayer.MetricScaleSupport metricScaleSupport
-
frameCount
protected long frameCount
-
-
Method Detail
-
isDrawGraticule
public boolean isDrawGraticule()
Returns whether or not graticule lines will be rendered.- Returns:
- true if graticule lines will be rendered; false otherwise.
-
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.
-
getGraticuleLineColor
public java.awt.Color getGraticuleLineColor()
Returns the graticule line Color.- Returns:
- Color used to render graticule lines.
-
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- ifcoloris null.
-
getGraticuleLineWidth
public double getGraticuleLineWidth()
Returns the graticule line width.- Returns:
- width of the graticule lines.
-
setGraticuleLineWidth
public void setGraticuleLineWidth(double lineWidth)
Sets the graticule line width.- Parameters:
lineWidth- width of the graticule lines.
-
getGraticuleLineStyle
public java.lang.String getGraticuleLineStyle()
Returns the graticule line rendering style.- Returns:
- rendering style of the graticule lines.
-
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- iflineStyleis null.
-
isDrawLabels
public boolean isDrawLabels()
Returns whether or not graticule labels will be rendered.- Returns:
- true if graticule labels will be rendered; false otherwise.
-
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.
-
getLabelColor
public java.awt.Color getLabelColor()
Returns the graticule label Color.- Returns:
- Color used to render graticule labels.
-
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- ifcoloris null.
-
getLabelFont
public java.awt.Font getLabelFont()
Returns the Font used for graticule labels.- Returns:
- Font used to render graticule labels.
-
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- iffontis null.
-
getTypeFor
protected java.lang.String getTypeFor(int resolution)
-
initRenderingParams
protected void initRenderingParams()
-
selectRenderables
protected void selectRenderables(DrawContext dc)
Select the visible grid elements- Overrides:
selectRenderablesin classAbstractGraticuleLayer- Parameters:
dc- the currentDrawContext.
-
computePosition
protected Position computePosition(int zone, java.lang.String hemisphere, double easting, double northing)
-
computePositionFromUTM
protected Position computePositionFromUTM(int zone, java.lang.String hemisphere, double easting, double northing)
-
computePositionFromUPS
protected Position computePositionFromUPS(java.lang.String hemisphere, double easting, double northing)
-
createSquaresGrid
protected java.util.ArrayList<UTMBaseGraticuleLayer.SquareZone> createSquaresGrid(int UTMZone, java.lang.String hemisphere, Sector UTMZoneSector, double minEasting, double maxEasting, double minNorthing, double maxNorthing)
-
-