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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanGhost(ILcdGXYView aGXYView) Remove the ghost line segment of the controller from the view.protected StringformatAltitude(double aAltitude) Returns a string representation of the given altitude value.Gets the color of the label frames filling.getFont()Gets theFontfor 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.intGhostLineWidth 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 theILcdProfileViewthe terrain profile is shown ondoubleGets scan resolution in meters.Gets the color of the text.Gets the formatter used to format elevation values.booleanReturns the flag indicating if invisible layers should be scanned.booleanReturns whether points corresponding to invalid elevation values should be labeled or not.booleanReturns whether points corresponding to invalid elevation values should be labeled or not.voidvoidvoidvoidWill perform a pan depending on the values of isDragging, isPanOnMouseDragExit and isPanOnMouseMoveExit propertiesvoidvoidvoidvoidEnables the controller to give visual feedback on the current user interactions.voidvoidClear the profile.voidsetBackground(Color aBackground) Sets the color of the label frames filling toaBackground.voidsetFallBackOnNonVisibleLayers(boolean aFallBackOnNonVisibleLayers) By default only visible layers will be scanned for terrain information.voidSets theFontfor drawing the labels tonewFont.voidsetForeground(Color newForeground) Sets the color for drawing the labels tonewForeground.voidsetGhostColor(Color aGhostColor) Sets the property that holds the color of the lines and circles that are drawn.voidsetGhostLineWidth(int aGhostLineWidth) GhostLineWidth is the property that holds the width of the lines and circle that are drawn.voidsetGXYViewBasedTerrainElevationProvider(TLcdGXYViewBasedTerrainElevationProvider aViewElevationProvider) Sets a new elevation provider to retrieve elevation data for this profile controller.voidsetOutOfRasterBoundsValueLabeled(boolean aOutOfRasterBoundsValueLabeled) Sets the flag indicating whether points corresponding to unknown elevation values should be labeled or not.voidsetProfileView(ILcdProfileView aProfileView) Sets theILcdProfileViewto show the terrain profile onvoidsetScanResolution(double aScanResolution) Sets scan resolution in meters.voidsetTextColor(Color aTextColor) Sets the color of the text toaTextColor.voidsetUnknownElevationLabeled(boolean aUnknownElevationLabeled) Sets the flag indicating whether points corresponding to unknown elevation values should be labeled or not.voidsetValueFormat(ILcdFormatter aValueFormat) Sets the formatter used to format elevation values.protected booleanshouldDisplayLabel(double aElevationValue) Checks whether the elevation is an unknown value as returned by the terrain elevation provider.voidstartInteraction(ILcdGXYView aGXYView) Sets up the controller to receive input through the view passed.voidterminateInteraction(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, updateViewLocationAfterZoomSFCTMethods 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, viewRepaintMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ALcdGXYControllerSets up the controller to receive input through the view passed.All
ILcdGXYViewimplementations that support interaction call this method when the controller has been made active withsetGXYControlleron 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:
startInteractionin interfaceILcdGXYController- Overrides:
startInteractionin classALcdGXYSmartController- Parameters:
aGXYView- theILcdGXYViewthisILcdGXYControllerwill interact with.- See Also:
-
terminateInteraction
Description copied from class:ALcdGXYControllerReleases a few items. Can be redefined but this 'super' method should be called too.- Specified by:
terminateInteractionin interfaceILcdGXYController- Overrides:
terminateInteractionin classALcdGXYSmartController- Parameters:
aGXYView- theILcdGXYViewthisILcdGXYControllerinteracted 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:ALcdGXYControllerEnables 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:
paintin interfaceILcdGXYController- Overrides:
paintin classALcdGXYController- Parameters:
aGraphics- the Graphics on which the view was rendered.
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classALcdGXYSmartController
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classALcdGXYSmartController
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener- Overrides:
mouseClickedin classALcdGXYSmartController
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener- Overrides:
mouseEnteredin classALcdGXYSmartController
-
mouseExited
Description copied from class:ALcdGXYSmartControllerWill perform a pan depending on the values of isDragging, isPanOnMouseDragExit and isPanOnMouseMoveExit properties- Specified by:
mouseExitedin interfaceMouseListener- Overrides:
mouseExitedin classALcdGXYSmartController
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classALcdGXYSmartController
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classALcdGXYSmartController
-
setProfileView
Sets theILcdProfileViewto show the terrain profile on- Parameters:
aProfileView- TheILcdProfileViewto be set- See Also:
-
getProfileView
Gets theILcdProfileViewthe terrain profile is shown on- Returns:
- the
ILcdProfileViewthe 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 theFontfor drawing the labels tonewFont.- Parameters:
newFont- the new font for drawing the labels.- See Also:
-
getFont
Gets theFontfor 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:
propertyChangein 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.toStringmethod 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:
-