Package com.luciad.tea
Class TLcdTerrainProfileController
java.lang.Object
com.luciad.view.gxy.controller.ALcdGXYController
com.luciad.view.gxy.controller.ALcdGXYSmartController
com.luciad.tea.TLcdTerrainProfileController
- All Implemented Interfaces:
ILcdUndoableSource
,ILcdStatusSource
,ILcdGXYController
,KeyListener
,MouseListener
,MouseMotionListener
,PropertyChangeListener
,Serializable
,EventListener
public class TLcdTerrainProfileController
extends ALcdGXYSmartController
implements MouseListener, MouseMotionListener, PropertyChangeListener
A
ILcdGXYController
implementation that contains information on the altitude of terrain
beneath the position of the mouse over the view. The controller allows to draw a line segment on
the map of which a side-view or profile can be calculated. This profile can then be displayed
by an ILcdProfileView
.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanGhost
(ILcdGXYView aGXYView) Remove the ghost line segment of the controller from the view.protected String
formatAltitude
(double aAltitude) Returns a string representation of the given altitude value.Gets the color of the label frames filling.getFont()
Gets theFont
for drawing the labels.Gets the color for drawing the labels.Gets the property that holds the color of the lines and circles that are drawn.int
GhostLineWidth is the property that holds the width of the lines and circle that are drawn.Returns the provider that is used to retrieve elevation data for this profile controller.Gets theILcdProfileView
the terrain profile is shown ondouble
Gets scan resolution in meters.Gets the color of the text.Gets the formatter used to format elevation values.boolean
Returns the flag indicating if invisible layers should be scanned.boolean
Returns whether points corresponding to invalid elevation values should be labeled or not.boolean
Returns whether points corresponding to invalid elevation values should be labeled or not.void
void
void
void
Will perform a pan depending on the values of isDragging, isPanOnMouseDragExit and isPanOnMouseMoveExit propertiesvoid
void
void
void
Enables the controller to give visual feedback on the current user interactions.void
void
Clear the profile.void
setBackground
(Color aBackground) Sets the color of the label frames filling toaBackground
.void
setFallBackOnNonVisibleLayers
(boolean aFallBackOnNonVisibleLayers) By default only visible layers will be scanned for terrain information.void
Sets theFont
for drawing the labels tonewFont
.void
setForeground
(Color newForeground) Sets the color for drawing the labels tonewForeground
.void
setGhostColor
(Color aGhostColor) Sets the property that holds the color of the lines and circles that are drawn.void
setGhostLineWidth
(int aGhostLineWidth) GhostLineWidth is the property that holds the width of the lines and circle that are drawn.void
setGXYViewBasedTerrainElevationProvider
(TLcdGXYViewBasedTerrainElevationProvider aViewElevationProvider) Sets a new elevation provider to retrieve elevation data for this profile controller.void
setOutOfRasterBoundsValueLabeled
(boolean aOutOfRasterBoundsValueLabeled) Sets the flag indicating whether points corresponding to unknown elevation values should be labeled or not.void
setProfileView
(ILcdProfileView aProfileView) Sets theILcdProfileView
to show the terrain profile onvoid
setScanResolution
(double aScanResolution) Sets scan resolution in meters.void
setTextColor
(Color aTextColor) Sets the color of the text toaTextColor
.void
setUnknownElevationLabeled
(boolean aUnknownElevationLabeled) Sets the flag indicating whether points corresponding to unknown elevation values should be labeled or not.void
setValueFormat
(ILcdFormatter aValueFormat) Sets the formatter used to format elevation values.protected boolean
shouldDisplayLabel
(double aElevationValue) Checks whether the elevation is an unknown value as returned by the terrain elevation provider.void
startInteraction
(ILcdGXYView aGXYView) Sets up the controller to receive input through the view passed.void
terminateInteraction
(ILcdGXYView aGXYView) Releases a few items.Methods inherited from class com.luciad.view.gxy.controller.ALcdGXYSmartController
addUndoableListener, doPanGXYView, doZoomGXYView, fireUndoableEvent, getDownPanChars, getDownPanCodes, getLeftPanChars, getLeftPanCodes, getPanAbsDelta, getPanAbsDelta, getRightPanChars, getRightPanCodes, getUndoableListenerCount, getUpPanChars, getUpPanCodes, getZoomInChars, getZoomInCodes, getZoomOutChars, getZoomOutCodes, isDragging, isPanOnMouseDragExit, isPanOnMouseMoveExit, isPanUndoable, isRequestFocusOnMouseEntered, isRequestFocusOnMousePressed, isTraceOn, isZoomUndoable, keyPressed, keyReleased, keyTyped, removeUndoableListener, setDownPanChars, setDownPanCodes, setIsDragging, setLeftPanChars, setLeftPanCodes, setPanAbsDelta, setPanOnMouseDragExit, setPanOnMouseMoveExit, setPanUndoable, setRequestFocusOnMouseEntered, setRequestFocusOnMousePressed, setRightPanChars, setRightPanCodes, setTraceOn, setUpPanChars, setUpPanCodes, setZoomInChars, setZoomInCodes, setZoomOutChars, setZoomOutCodes, setZoomUndoable, updateViewLocationAfterZoomSFCT
Methods inherited from class com.luciad.view.gxy.controller.ALcdGXYController
addStatusListener, asGXYController, fireStatusEvent, getCursor, getGXYView, getIcon, getName, getShortDescription, registerInstance, removeStatusListener, retrieveGXYViewXYWorldTransformation, setClassTraceOn, setCursor, setGXYView, setIcon, setName, setShortDescription, viewRepaint
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYController
getLayered
-
Constructor Details
-
TLcdTerrainProfileController
public TLcdTerrainProfileController()
-
-
Method Details
-
getGXYViewBasedTerrainElevationProvider
Returns the provider that is used to retrieve elevation data for this profile controller.- Returns:
- the provider that is used to retrieve elevation data for this profile controller.
- See Also:
-
setGXYViewBasedTerrainElevationProvider
public void setGXYViewBasedTerrainElevationProvider(TLcdGXYViewBasedTerrainElevationProvider aViewElevationProvider) Sets a new elevation provider to retrieve elevation data for this profile controller.- Parameters:
aViewElevationProvider
- the elevation provider to be used.- See Also:
-
resetProfile
public void resetProfile()Clear the profile. -
startInteraction
Description copied from class:ALcdGXYController
Sets up the controller to receive input through the view passed.All
ILcdGXYView
implementations that support interaction call this method when the controller has been made active withsetGXYController
on the view, so this method shouldn't normally be called directly. Note that most view implementations add the controller as listener if appropriate before calling this method.Sets the cursor on the view and sets the view for which this controller is now active. Sends out a status event based on the
short description
.- Specified by:
startInteraction
in interfaceILcdGXYController
- Overrides:
startInteraction
in classALcdGXYSmartController
- Parameters:
aGXYView
- theILcdGXYView
thisILcdGXYController
will interact with.- See Also:
-
terminateInteraction
Description copied from class:ALcdGXYController
Releases a few items. Can be redefined but this 'super' method should be called too.- Specified by:
terminateInteraction
in interfaceILcdGXYController
- Overrides:
terminateInteraction
in classALcdGXYSmartController
- Parameters:
aGXYView
- theILcdGXYView
thisILcdGXYController
interacted with.- See Also:
-
cleanGhost
Remove the ghost line segment of the controller from the view.- Parameters:
aGXYView
- The view from which to remove the line.
-
paint
Description copied from class:ALcdGXYController
Enables the controller to give visual feedback on the current user interactions. Note that the controller is responsible for repainting the view.Empty implementation. Redefine this method to render on the Graphics on which the view is rendered.
- Specified by:
paint
in interfaceILcdGXYController
- Overrides:
paint
in classALcdGXYController
- Parameters:
aGraphics
- the Graphics on which the view was rendered.
-
mousePressed
- Specified by:
mousePressed
in interfaceMouseListener
- Overrides:
mousePressed
in classALcdGXYSmartController
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
- Overrides:
mouseReleased
in classALcdGXYSmartController
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
- Overrides:
mouseClicked
in classALcdGXYSmartController
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
- Overrides:
mouseEntered
in classALcdGXYSmartController
-
mouseExited
Description copied from class:ALcdGXYSmartController
Will perform a pan depending on the values of isDragging, isPanOnMouseDragExit and isPanOnMouseMoveExit properties- Specified by:
mouseExited
in interfaceMouseListener
- Overrides:
mouseExited
in classALcdGXYSmartController
-
mouseDragged
- Specified by:
mouseDragged
in interfaceMouseMotionListener
- Overrides:
mouseDragged
in classALcdGXYSmartController
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
- Overrides:
mouseMoved
in classALcdGXYSmartController
-
setProfileView
Sets theILcdProfileView
to show the terrain profile on- Parameters:
aProfileView
- TheILcdProfileView
to be set- See Also:
-
getProfileView
Gets theILcdProfileView
the terrain profile is shown on- Returns:
- the
ILcdProfileView
the terrain profile is shown on. - See Also:
-
setGhostColor
Sets the property that holds the color of the lines and circles that are drawn.- Parameters:
aGhostColor
- the color to use for the drawing of lines and circles.- See Also:
-
getGhostColor
Gets the property that holds the color of the lines and circles that are drawn.- Returns:
- the color to use for the drawing of lines and circles.
- See Also:
-
setGhostLineWidth
public void setGhostLineWidth(int aGhostLineWidth) GhostLineWidth is the property that holds the width of the lines and circle that are drawn. This property has an effect only for JVM versions higher than 1.2. For lower versions, the line width will be always 1.- Parameters:
aGhostLineWidth
- the line width to set.- See Also:
-
getGhostLineWidth
public int getGhostLineWidth()GhostLineWidth is the property that holds the width of the lines and circle that are drawn. This property has an effect only for JVM versions upper that 1.2 For lower versions, the line width will be always 1.- Returns:
- the current line width.
- See Also:
-
setFont
Sets theFont
for drawing the labels tonewFont
.- Parameters:
newFont
- the new font for drawing the labels.- See Also:
-
getFont
Gets theFont
for drawing the labels.- Returns:
- the font used for drawing the labels.
- See Also:
-
setFallBackOnNonVisibleLayers
public void setFallBackOnNonVisibleLayers(boolean aFallBackOnNonVisibleLayers) By default only visible layers will be scanned for terrain information. When set to true, also layers that are not visible will be scanned.- Parameters:
aFallBackOnNonVisibleLayers
- the flag indicating if invisible layers should be scanned.- See Also:
-
isFallBackOnNonVisibleLayers
public boolean isFallBackOnNonVisibleLayers()Returns the flag indicating if invisible layers should be scanned. Default is false.- Returns:
- the flag indicating if invisible layers should be scanned.
- See Also:
-
setForeground
Sets the color for drawing the labels tonewForeground
.- Parameters:
newForeground
- the new color for drawing the labels.- See Also:
-
getForeground
Gets the color for drawing the labels.- Returns:
- the color for drawing the labels.
- See Also:
-
setBackground
Sets the color of the label frames filling toaBackground
.- Parameters:
aBackground
- the new color of the label frames filling.- See Also:
-
getBackground
Gets the color of the label frames filling.- Returns:
- the color of the label frames filling.
- See Also:
-
setTextColor
Sets the color of the text toaTextColor
.- Parameters:
aTextColor
- the new color of the text.- See Also:
-
getTextColor
Gets the color of the text.- Returns:
- the color of the text.
- See Also:
-
setValueFormat
Sets the formatter used to format elevation values.- Parameters:
aValueFormat
- the formatter used to format elevation values.- See Also:
-
getValueFormat
Gets the formatter used to format elevation values.- Returns:
- the formatter used to format elevation values.
- See Also:
-
setScanResolution
public void setScanResolution(double aScanResolution) Sets scan resolution in meters.- Parameters:
aScanResolution
- the new scan resolution in meters.- See Also:
-
getScanResolution
public double getScanResolution()Gets scan resolution in meters.- Returns:
- the scan resolution in meters.
- See Also:
-
setUnknownElevationLabeled
public void setUnknownElevationLabeled(boolean aUnknownElevationLabeled) Sets the flag indicating whether points corresponding to unknown elevation values should be labeled or not. The default is false.- Parameters:
aUnknownElevationLabeled
- the new flag indicating if invalid elevation points are labeled.- See Also:
-
isUnknownElevationLabeled
public boolean isUnknownElevationLabeled()Returns whether points corresponding to invalid elevation values should be labeled or not.- Returns:
- whether invalid elevation points are labeled or not.
- See Also:
-
setOutOfRasterBoundsValueLabeled
public void setOutOfRasterBoundsValueLabeled(boolean aOutOfRasterBoundsValueLabeled) Sets the flag indicating whether points corresponding to unknown elevation values should be labeled or not. The default is false.- Parameters:
aOutOfRasterBoundsValueLabeled
- the new flag indicating if invalid elevation points are labeled.- See Also:
-
isOutOfRasterBoundsValueLabeled
public boolean isOutOfRasterBoundsValueLabeled()Returns whether points corresponding to invalid elevation values should be labeled or not.- Returns:
- whether invalid elevation points are labeled or not.
- See Also:
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
formatAltitude
Returns a string representation of the given altitude value. This implementation checks whether a value format is set. If so, this format is used to format the altitude, otherwise the defaultDouble.toString
method is used.- Parameters:
aAltitude
- the altitude value to format.- Returns:
- a string representation of the given altitude value.
- See Also:
-
shouldDisplayLabel
protected boolean shouldDisplayLabel(double aElevationValue) Checks whether the elevation is an unknown value as returned by the terrain elevation provider. If so, a label is displayed depending on the values of the properties OutOfRasterBoundsLabeled and UnknownElevationLabeled.- Parameters:
aElevationValue
- the value to display a label for, or not.- Returns:
- true for known values and, depending on the properties OutOfRasterBoundsLabeled and UnknownElevationLabeled, for the corresponding unknown values, otherwise false.
- See Also:
-