public class AbstractGraticuleLayer extends AbstractLayer
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractGraticuleLayer.GridElement |
Modifier and Type | Field and Description |
---|---|
protected long |
frameTimeStamp |
protected Globe |
globe |
protected GraticuleSupport |
graticuleSupport |
protected java.util.ArrayList<AbstractGraticuleLayer.GridElement> |
gridElements |
protected Vec4 |
lastEyePoint |
protected GeographicProjection |
lastProjection |
protected double |
lastVerticalExaggeration |
protected double |
lastViewFOV |
protected double |
lastViewHeading |
protected double |
lastViewPitch |
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.
|
protected double |
terrainConformance |
Constructor and Description |
---|
AbstractGraticuleLayer() |
Modifier and Type | Method and Description |
---|---|
protected void |
addRenderable(java.lang.Object renderable,
java.lang.String paramsKey) |
protected void |
clear(DrawContext dc) |
protected double |
computeAltitudeAboveGround(DrawContext dc) |
protected LatLon |
computeLabelOffset(DrawContext dc) |
protected double |
computeTerrainConformance(DrawContext dc) |
protected void |
computeTruncatedSegment(Position p1,
Position p2,
Sector sector,
java.util.ArrayList<Position> positions) |
protected java.lang.Object |
createLineRenderable(java.lang.Iterable<? extends Position> positions,
java.lang.String pathType) |
void |
doPreRender(DrawContext dc) |
void |
doRender(DrawContext dc) |
protected Angle |
getDeltaLongitude(LatLon p1,
Angle longitude) |
java.awt.Color |
getGraticuleLineColor(java.lang.String key)
Returns the graticule line Color.
|
java.lang.String |
getGraticuleLineStyle(java.lang.String key)
Returns the graticule line rendering style.
|
double |
getGraticuleLineWidth(java.lang.String key)
Returns the graticule line width.
|
java.awt.Color |
getLabelColor(java.lang.String key)
Returns the graticule label Color.
|
java.awt.Font |
getLabelFont(java.lang.String key)
Returns the Font used for graticule labels.
|
protected GraticuleRenderingParams |
getRenderingParams(java.lang.String key) |
java.lang.String |
getRestorableState()
Returns an XML document string describing the object's state.
|
protected Vec4 |
getSurfacePoint(DrawContext dc,
Angle latitude,
Angle longitude) |
protected LatLon |
greatCircleIntersectionAtLatitude(LatLon p1,
LatLon p2,
Angle latitude)
Computes the intersection point position between a great circle segment and a parallel.
|
protected LatLon |
greatCircleIntersectionAtLongitude(LatLon p1,
LatLon p2,
Angle longitude)
Computes the intersection point position between a great circle segment and a meridian.
|
protected LatLon |
greatCircleMidPoint(LatLon p1,
LatLon p2) |
boolean |
isDrawGraticule(java.lang.String key)
Returns whether or not graticule lines will be rendered.
|
boolean |
isDrawLabels(java.lang.String key)
Returns whether or not graticule labels will be rendered.
|
protected boolean |
needsToUpdate(DrawContext dc)
Determines whether the grid should be updated.
|
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 |
selectRenderables(DrawContext dc)
Select the visible grid elements
|
void |
setDrawGraticule(boolean drawGraticule,
java.lang.String key)
Sets whether or not graticule lines will be rendered.
|
void |
setDrawLabels(boolean drawLabels,
java.lang.String key)
Sets whether or not graticule labels will be rendered.
|
void |
setGraticuleLineColor(java.awt.Color color,
java.lang.String key)
Sets the graticule line Color.
|
void |
setGraticuleLineStyle(java.lang.String lineStyle,
java.lang.String key)
Sets the graticule line rendering style.
|
void |
setGraticuleLineWidth(double lineWidth,
java.lang.String key)
Sets the graticule line width.
|
void |
setLabelColor(java.awt.Color color,
java.lang.String key)
Sets the graticule label Color.
|
void |
setLabelFont(java.awt.Font font,
java.lang.String key)
Sets the Font used for graticule labels.
|
protected void |
setRenderingParams(java.lang.String key,
GraticuleRenderingParams renderingParams) |
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
onMessage, propertyChange
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
onMessage
protected long frameTimeStamp
protected Globe globe
protected GraticuleSupport graticuleSupport
protected java.util.ArrayList<AbstractGraticuleLayer.GridElement> gridElements
protected Vec4 lastEyePoint
protected GeographicProjection lastProjection
protected double lastVerticalExaggeration
protected double lastViewFOV
protected double lastViewHeading
protected double lastViewPitch
public static final java.lang.String LINE_STYLE_DASHED
- - - - -
public static final java.lang.String LINE_STYLE_DOTTED
. . . . .
is an example of a dotted line.public static final java.lang.String LINE_STYLE_SOLID
_________
protected double terrainConformance
protected void addRenderable(java.lang.Object renderable, java.lang.String paramsKey)
protected void clear(DrawContext dc)
protected double computeAltitudeAboveGround(DrawContext dc)
protected LatLon computeLabelOffset(DrawContext dc)
protected double computeTerrainConformance(DrawContext dc)
protected void computeTruncatedSegment(Position p1, Position p2, Sector sector, java.util.ArrayList<Position> positions)
protected java.lang.Object createLineRenderable(java.lang.Iterable<? extends Position> positions, java.lang.String pathType)
public void doPreRender(DrawContext dc)
doPreRender
in class AbstractLayer
public void doRender(DrawContext dc)
doRender
in class AbstractLayer
public java.awt.Color getGraticuleLineColor(java.lang.String key)
key
- the rendering parameters key.java.lang.IllegalArgumentException
- key
is null.public java.lang.String getGraticuleLineStyle(java.lang.String key)
key
- the rendering parameters key.java.lang.IllegalArgumentException
- key
is null.public double getGraticuleLineWidth(java.lang.String key)
key
- the rendering parameters key.java.lang.IllegalArgumentException
- key
is null.public java.awt.Color getLabelColor(java.lang.String key)
key
- the rendering parameters key.java.lang.IllegalArgumentException
- key
is null.public java.awt.Font getLabelFont(java.lang.String key)
key
- the rendering parameters key.java.lang.IllegalArgumentException
- key
is null.protected GraticuleRenderingParams getRenderingParams(java.lang.String key)
public java.lang.String getRestorableState()
Restorable
restoreState
and passing the XML document.getRestorableState
in interface Restorable
getRestorableState
in class AbstractLayer
protected Vec4 getSurfacePoint(DrawContext dc, Angle latitude, Angle longitude)
protected LatLon greatCircleIntersectionAtLatitude(LatLon p1, LatLon p2, Angle latitude)
p1
- the great circle segment start position.p2
- the great circle segment end position.latitude
- the parallel latitude Angle
Position
or null if there was no intersection found.protected LatLon greatCircleIntersectionAtLongitude(LatLon p1, LatLon p2, Angle longitude)
p1
- the great circle segment start position.p2
- the great circle segment end position.longitude
- the meridian longitude Angle
Position
or null if there was no intersection found.public boolean isDrawGraticule(java.lang.String key)
key
- the rendering parameters key.java.lang.IllegalArgumentException
- key
is null.public boolean isDrawLabels(java.lang.String key)
key
- the rendering parameters key.java.lang.IllegalArgumentException
- key
is null.protected boolean needsToUpdate(DrawContext dc)
dc
- the current DrawContext
.protected void removeAllRenderables()
protected void renderGraticule(DrawContext dc)
public void restoreState(java.lang.String stateInXml)
Restorable
restoreState
in interface Restorable
restoreState
in class AbstractLayer
stateInXml
- an XML document string describing an object's state.protected void selectRenderables(DrawContext dc)
dc
- the current DrawContext
.public void setDrawGraticule(boolean drawGraticule, java.lang.String key)
drawGraticule
- true to render graticule lines; false to disable rendering.key
- the rendering parameters key.java.lang.IllegalArgumentException
- key
is null.public void setDrawLabels(boolean drawLabels, java.lang.String key)
drawLabels
- true to render graticule labels; false to disable rendering.key
- the rendering parameters key.java.lang.IllegalArgumentException
- key
is null.public void setGraticuleLineColor(java.awt.Color color, java.lang.String key)
color
- Color that will be used to render graticule lines.key
- the rendering parameters key.java.lang.IllegalArgumentException
- if color
or key
is null.public void setGraticuleLineStyle(java.lang.String lineStyle, java.lang.String key)
lineStyle
- rendering style of the graticule lines. One of LINE_STYLE_PLAIN, LINE_STYLE_DASHED, or
LINE_STYLE_DOTTED.key
- the rendering parameters key.java.lang.IllegalArgumentException
- if lineStyle
or key
is null.public void setGraticuleLineWidth(double lineWidth, java.lang.String key)
lineWidth
- width of the graticule lines.key
- the rendering parameters key.java.lang.IllegalArgumentException
- key
is null.public void setLabelColor(java.awt.Color color, java.lang.String key)
color
- Color that will be used to render graticule labels.key
- the rendering parameters key.java.lang.IllegalArgumentException
- if color
or key
is null.public void setLabelFont(java.awt.Font font, java.lang.String key)
font
- Font that will be used to render graticule labels.key
- the rendering parameters key.java.lang.IllegalArgumentException
- if font
or key
is null.protected void setRenderingParams(java.lang.String key, GraticuleRenderingParams renderingParams)