|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.WWObjectImpl
gov.nasa.worldwind.layers.AbstractLayer
gov.nasa.worldwind.layers.TerrainProfileLayer
public class TerrainProfileLayer
Displays a terrain profile graph in a screen corner.
Usage: do setEventSource(wwd) to have the graph activated and updated with position changes See public properties for options: keepProportions, follow, unit, start and end latlon...
Field Summary | |
---|---|
static java.lang.String |
FOLLOW_CURSOR
|
static java.lang.String |
FOLLOW_EYE
|
static java.lang.String |
FOLLOW_NONE
|
static java.lang.String |
FOLLOW_OBJECT
|
static java.lang.String |
FOLLOW_VIEW
|
static double |
METER_TO_FEET
|
static java.lang.String |
NORTHEAST
|
static java.lang.String |
NORTHWEST
|
static java.lang.String |
RESIZE_KEEP_FIXED_SIZE
|
static java.lang.String |
RESIZE_SHRINK_ONLY
|
static java.lang.String |
RESIZE_STRETCH
|
static java.lang.String |
SOUTHEAST
|
static java.lang.String |
SOUTHWEST
|
static java.lang.String |
UNIT_IMPERIAL
|
static java.lang.String |
UNIT_METRIC
|
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl |
---|
changeSupport |
Constructor Summary | |
---|---|
TerrainProfileLayer()
Renders a terrain profile graphic in a screen corner |
Method Summary | |
---|---|
void |
computeProfile(DrawContext dc)
Compute the terrain profile. |
void |
dispose()
|
void |
doPick(DrawContext dc,
java.awt.Point pickPoint)
|
void |
doRender(DrawContext dc)
|
void |
drawProfile(DrawContext dc)
|
int |
getBorderWidth()
|
java.awt.Color |
getColor()
Get the graphic color |
LatLon |
getEndLatLon()
Get the profile end position lat/lon when FOLLOW_NONE |
java.lang.String |
getFollow()
Get the graph center point placement behavior |
boolean |
getFollowCursor()
Get whether the graph center point follows the mouse cursor |
java.awt.Font |
getFont()
Get the graphic legend Font |
boolean |
getIsMaximized()
Get whether the profile graph is maximized - displays over the whole viewport. |
boolean |
getIsMinimized()
Get whether the profile graph is minimized |
boolean |
getKeepProportions()
Get whether distance/elevation proportions are maintained |
java.awt.Point |
getLocationCenter()
Get the screen location of the graph center if set (can be null) |
Angle |
getObjectHeading()
|
Position |
getObjectPosition()
|
java.lang.String |
getPosition()
|
double |
getProfileLenghtFactor()
Get the profile length factor |
java.lang.String |
getResizeBehavior()
Returns the layer's resize behavior. |
int |
getSamples()
Get the number of elevation samples in the profile |
boolean |
getShowEyePosition()
Get whether the eye position is shown on the graph when FOLLOW_EYE |
java.awt.Dimension |
getSize()
Get the graphic Dimension (in pixels) |
LatLon |
getStartLatLon()
Get the profile start position lat/lon when FOLLOW_NONE |
double |
getToViewportScale()
Returns the graphic-to-viewport scale factor. |
java.lang.String |
getUnit()
|
boolean |
getUpdate()
Get whether the profile should be recomputed |
boolean |
getZeroBased()
Get whether the profile graph should include sea level |
void |
moved(PositionEvent event)
|
void |
propertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
The property change listener for this instance. |
void |
selected(SelectEvent event)
|
void |
setBorderWidth(int borderWidth)
Sets the graphic offset from the viewport border. |
void |
setColor(java.awt.Color color)
Set the graphic Color |
void |
setEndLatLon(LatLon latLon)
Set the profile end position lat/lon when FOLLOW_NONE |
void |
setEventSource(WorldWindow wwd)
|
void |
setFollow(java.lang.String behavior)
Set the graph center point placement behavior. |
void |
setFollowCursor(boolean state)
Set whether the graph center point should follows the mouse cursor |
void |
setFont(java.awt.Font font)
Set the graphic legend Font |
void |
setIsMaximized(boolean state)
Set wheter the profile graph should be maximized - displays over the whole viewport. |
void |
setIsMinimized(boolean state)
Set wheter the profile graph should be minimized. |
void |
setKeepProportions(boolean state)
Set whether distance/elevation proportions are maintained |
void |
setLocationCenter(java.awt.Point point)
Set the screen location of the graph center - overrides SetPosition if not null |
void |
setObjectHeading(Angle heading)
|
void |
setObjectPosition(Position pos)
|
void |
setPosition(java.lang.String position)
Sets the relative viewport location to display the graphic. |
void |
setProfileLengthFactor(double factor)
Set the profile length factor - has no effect if FOLLOW_NONE |
void |
setResizeBehavior(java.lang.String resizeBehavior)
Sets the behavior the layer uses to size the graphic when the viewport size changes, typically when the World Wind window is resized. |
void |
setSamples(int number)
Set the number of elevation samples in the profile |
void |
setShowEyePosition(java.lang.Boolean state)
Set whether the eye position is shown on the graph when FOLLOW_EYE |
void |
setSize(java.awt.Dimension size)
Set the graphic Dimenion (in pixels) |
void |
setStartLatLon(LatLon latLon)
Set the profile start position lat/lon when FOLLOW_NONE |
void |
setToViewportScale(double toViewportScale)
Sets the scale factor applied to the viewport size to determine the displayed size of the graphic. |
void |
setUnit(java.lang.String unit)
Sets the unit the graphic uses to display distances and elevations. |
void |
setUpdate(boolean state)
Set wheter the profile should be recomputed |
void |
setZeroBased(boolean state)
Set whether the profile graph should include sea level. |
java.lang.String |
toString()
|
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer |
---|
getMaxActiveAltitude, getMinActiveAltitude, getName, getOpacity, getRestorableState, getScale, isAtMaxResolution, isEnabled, isLayerActive, isLayerInView, isMultiResolution, isPickEnabled, pick, render, restoreState, setEnabled, setMaxActiveAltitude, setMinActiveAltitude, setName, setOpacity, setPickEnabled |
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 |
Field Detail |
---|
public static final java.lang.String FOLLOW_CURSOR
public static final java.lang.String FOLLOW_EYE
public static final java.lang.String FOLLOW_NONE
public static final java.lang.String FOLLOW_OBJECT
public static final java.lang.String FOLLOW_VIEW
public static final double METER_TO_FEET
public static final java.lang.String NORTHEAST
public static final java.lang.String NORTHWEST
public static final java.lang.String RESIZE_KEEP_FIXED_SIZE
public static final java.lang.String RESIZE_SHRINK_ONLY
public static final java.lang.String RESIZE_STRETCH
public static final java.lang.String SOUTHEAST
public static final java.lang.String SOUTHWEST
public static final java.lang.String UNIT_IMPERIAL
public static final java.lang.String UNIT_METRIC
Constructor Detail |
---|
public TerrainProfileLayer()
Method Detail |
---|
public void computeProfile(DrawContext dc)
If {@link #FOLLOW_VIEW ], {@link #FOLLOW_EYE] or {@link #FOLLOW_CURSOR] collects terrain profile data along a great circle line centered at the current position (view, eye or cursor) and perpendicular to the view heading. If {@link #FOLLOW_NONE] the profile is computed in between start and end latlon
dc
- the current DrawContext
.public void dispose()
dispose
in interface Disposable
dispose
in class AbstractLayer
public void doPick(DrawContext dc, java.awt.Point pickPoint)
doPick
in class AbstractLayer
public void doRender(DrawContext dc)
doRender
in class AbstractLayer
public void drawProfile(DrawContext dc)
public int getBorderWidth()
public java.awt.Color getColor()
public LatLon getEndLatLon()
FOLLOW_NONE
public java.lang.String getFollow()
public boolean getFollowCursor()
public java.awt.Font getFont()
public boolean getIsMaximized()
public boolean getIsMinimized()
public boolean getKeepProportions()
public java.awt.Point getLocationCenter()
public Angle getObjectHeading()
public Position getObjectPosition()
public java.lang.String getPosition()
public double getProfileLenghtFactor()
public java.lang.String getResizeBehavior()
public int getSamples()
public boolean getShowEyePosition()
FOLLOW_EYE
public java.awt.Dimension getSize()
public LatLon getStartLatLon()
FOLLOW_NONE
public double getToViewportScale()
public java.lang.String getUnit()
public boolean getUpdate()
public boolean getZeroBased()
public void moved(PositionEvent event)
moved
in interface PositionListener
public void propertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
WWObjectImpl
propertyChange
in interface java.beans.PropertyChangeListener
propertyChange
in class WWObjectImpl
propertyChangeEvent
- the eventpublic void selected(SelectEvent event)
selected
in interface SelectListener
public void setBorderWidth(int borderWidth)
borderWidth
- the number of pixels to offset the graphic from the borders indicated by setPosition(String)
.public void setColor(java.awt.Color color)
color
- the graphic Colorpublic void setEndLatLon(LatLon latLon)
FOLLOW_NONE
latLon
- the profile end position lat/lonpublic void setEventSource(WorldWindow wwd)
public void setFollow(java.lang.String behavior)
FOLLOW_VIEW
(the default),
FOLLOW_CURSOR
, FOLLOW_EYE
or FOLLOW_NONE
. If FOLLOW_NONE
the profile will
be computed between startLatLon and endLatLon.
behavior
- the graph center point placement behaviorpublic void setFollowCursor(boolean state)
state
- true if the graph center point should follows the mouse cursorpublic void setFont(java.awt.Font font)
font
- the graphic legend Fontpublic void setIsMaximized(boolean state)
state
- true if the profile should be maximizedpublic void setIsMinimized(boolean state)
Note that the graph can be both minimized and maximized at the same time. The minimized state will take precedence and the graph will display as an icon. When 'un-minimized' it will display as maximized.
state
- true if the profile should be minimizedthis.setIsMaximized()
public void setKeepProportions(boolean state)
state
- true if the graph should maintains distance/elevation proportionspublic void setLocationCenter(java.awt.Point point)
point
- the screen location of the graph center (can be null)public void setObjectHeading(Angle heading)
public void setObjectPosition(Position pos)
public void setPosition(java.lang.String position)
NORTHEAST
(the default), NORTHWEST
, SOUTHEAST
, or SOUTHWEST
. These indicate the corner of the viewport.
position
- the desired graphic positionpublic void setProfileLengthFactor(double factor)
FOLLOW_NONE
factor
- the new factorpublic void setResizeBehavior(java.lang.String resizeBehavior)
RESIZE_KEEP_FIXED_SIZE
, the graphic size is kept to the size specified
in its Dimension scaled by the layer's current icon scale. If the value is RESIZE_STRETCH
, the graphic is
resized to have a constant size relative to the current viewport size. If the viewport shrinks the graphic size
decreases; if it expands then the graphic enlarges. If the value is RESIZE_SHRINK_ONLY
(the default),
graphic sizing behaves as for RESIZE_STRETCH
but it will not grow larger than the size specified in its
Dimension.
resizeBehavior
- the desired resize behaviorpublic void setSamples(int number)
number
- the number of elevation samples in the profilepublic void setShowEyePosition(java.lang.Boolean state)
FOLLOW_EYE
state
- if true the eye position is shown on the graphpublic void setSize(java.awt.Dimension size)
size
- the graphic Dimensionpublic void setStartLatLon(LatLon latLon)
FOLLOW_NONE
latLon
- the profile start position lat/lonpublic void setToViewportScale(double toViewportScale)
RESIZE_STRETCH
or RESIZE_SHRINK_ONLY
. The
graphic's width is adjusted to occupy the proportion of the viewport's width indicated by this factor. The graphic's
height is adjusted to maintain the graphic's Dimension aspect ratio.
toViewportScale
- the graphic to viewport scale factorpublic void setUnit(java.lang.String unit)
UNIT_METRIC
(the default), or UNIT_IMPERIAL
.
unit
- the desired unitpublic void setUpdate(boolean state)
state
- true if the profile should be recomputedpublic void setZeroBased(boolean state)
state
- true if the profile graph should include sea levelpublic java.lang.String toString()
toString
in class AbstractLayer
|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |