public class TLcdTerrainProfileController extends ALcdGXYSmartController implements MouseListener, MouseMotionListener, PropertyChangeListener
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
.Constructor and Description |
---|
TLcdTerrainProfileController() |
Modifier and Type | Method and Description |
---|---|
void |
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.
|
Color |
getBackground()
Gets the color of the label frames filling.
|
Font |
getFont()
Gets the
Font for drawing the labels. |
Color |
getForeground()
Gets the color for drawing the labels.
|
Color |
getGhostColor()
Gets the property that holds the color of the lines and circles that
are drawn.
|
int |
getGhostLineWidth()
GhostLineWidth is the property that holds the width of the lines and circle that
are drawn.
|
TLcdGXYViewBasedTerrainElevationProvider |
getGXYViewBasedTerrainElevationProvider()
Returns the provider that is used to retrieve elevation data for this profile controller.
|
ILcdProfileView |
getProfileView()
Gets the
ILcdProfileView the terrain profile is shown on |
double |
getScanResolution()
Gets scan resolution in meters.
|
Color |
getTextColor()
Gets the color of the text.
|
ILcdFormatter |
getValueFormat()
Gets the formatter used to format elevation values.
|
boolean |
isFallBackOnNonVisibleLayers()
Returns the flag indicating if invisible layers should be scanned.
|
boolean |
isOutOfRasterBoundsValueLabeled()
Returns whether points corresponding to invalid elevation values should be labeled or not.
|
boolean |
isUnknownElevationLabeled()
Returns whether points corresponding to invalid elevation values should be labeled or not.
|
void |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e)
Will perform a pan depending on the values of isDragging,
isPanOnMouseDragExit and isPanOnMouseMoveExit properties
|
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
paint(Graphics aGraphics)
Enables the controller to give visual feedback on the current user interactions.
|
void |
propertyChange(PropertyChangeEvent e) |
void |
resetProfile()
Clear the profile.
|
void |
setBackground(Color aBackground)
Sets the color of the label frames filling to
aBackground . |
void |
setFallBackOnNonVisibleLayers(boolean aFallBackOnNonVisibleLayers)
By default only visible layers will be scanned for terrain information.
|
void |
setFont(Font newFont)
Sets the
Font for drawing the labels to newFont . |
void |
setForeground(Color newForeground)
Sets the color for drawing the labels to
newForeground . |
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 the
ILcdProfileView to show the terrain profile on |
void |
setScanResolution(double aScanResolution)
Sets scan resolution in meters.
|
void |
setTextColor(Color aTextColor)
Sets the color of the text to
aTextColor . |
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.
|
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
addStatusListener, asGXYController, fireStatusEvent, getCursor, getGXYView, getIcon, getName, getShortDescription, registerInstance, removeStatusListener, retrieveGXYViewXYWorldTransformation, setClassTraceOn, setCursor, setGXYView, setIcon, setName, setShortDescription, viewRepaint
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLayered
public TLcdGXYViewBasedTerrainElevationProvider getGXYViewBasedTerrainElevationProvider()
setGXYViewBasedTerrainElevationProvider(com.luciad.tea.TLcdGXYViewBasedTerrainElevationProvider)
public void setGXYViewBasedTerrainElevationProvider(TLcdGXYViewBasedTerrainElevationProvider aViewElevationProvider)
aViewElevationProvider
- the elevation provider to be used.setGXYViewBasedTerrainElevationProvider(com.luciad.tea.TLcdGXYViewBasedTerrainElevationProvider)
public void resetProfile()
public void startInteraction(ILcdGXYView aGXYView)
ALcdGXYController
All ILcdGXYView
implementations that support interaction call this method when the controller
has been made active with setGXYController
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
.
startInteraction
in interface ILcdGXYController
startInteraction
in class ALcdGXYSmartController
aGXYView
- the ILcdGXYView
this ILcdGXYController
will interact with.ILcdGXYView.setGXYController(com.luciad.view.gxy.ILcdGXYController)
,
ILcdGXYController.terminateInteraction(com.luciad.view.gxy.ILcdGXYView)
public void terminateInteraction(ILcdGXYView aGXYView)
ALcdGXYController
terminateInteraction
in interface ILcdGXYController
terminateInteraction
in class ALcdGXYSmartController
aGXYView
- the ILcdGXYView
this ILcdGXYController
interacted with.ILcdGXYView.setGXYController(com.luciad.view.gxy.ILcdGXYController)
,
ILcdGXYController.startInteraction(com.luciad.view.gxy.ILcdGXYView)
public void cleanGhost(ILcdGXYView aGXYView)
aGXYView
- The view from which to remove the line.public void paint(Graphics aGraphics)
ALcdGXYController
Empty implementation. Redefine this method to render on the Graphics on which the view is rendered.
paint
in interface ILcdGXYController
paint
in class ALcdGXYController
aGraphics
- the Graphics on which the view was rendered.public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
mousePressed
in class ALcdGXYSmartController
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class ALcdGXYSmartController
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
mouseClicked
in class ALcdGXYSmartController
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
mouseEntered
in class ALcdGXYSmartController
public void mouseExited(MouseEvent e)
ALcdGXYSmartController
mouseExited
in interface MouseListener
mouseExited
in class ALcdGXYSmartController
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class ALcdGXYSmartController
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
mouseMoved
in class ALcdGXYSmartController
public void setProfileView(ILcdProfileView aProfileView)
ILcdProfileView
to show the terrain profile onaProfileView
- The ILcdProfileView
to be setgetProfileView()
public ILcdProfileView getProfileView()
ILcdProfileView
the terrain profile is shown onILcdProfileView
the terrain profile is shown on.setProfileView(com.luciad.tea.ILcdProfileView)
public void setGhostColor(Color aGhostColor)
aGhostColor
- the color to use for the drawing of lines and circles.getGhostColor()
public Color getGhostColor()
setGhostColor(java.awt.Color)
public void setGhostLineWidth(int aGhostLineWidth)
aGhostLineWidth
- the line width to set.getGhostLineWidth()
public int getGhostLineWidth()
setGhostLineWidth(int)
public void setFont(Font newFont)
Font
for drawing the labels to newFont
.newFont
- the new font for drawing the labels.getFont()
public Font getFont()
Font
for drawing the labels.setFont(java.awt.Font)
public void setFallBackOnNonVisibleLayers(boolean aFallBackOnNonVisibleLayers)
aFallBackOnNonVisibleLayers
- the flag indicating if invisible layers should be scanned.isFallBackOnNonVisibleLayers()
public boolean isFallBackOnNonVisibleLayers()
setFallBackOnNonVisibleLayers(boolean)
public void setForeground(Color newForeground)
newForeground
.newForeground
- the new color for drawing the labels.getForeground()
public Color getForeground()
setForeground(java.awt.Color)
public void setBackground(Color aBackground)
aBackground
.aBackground
- the new color of the label frames filling.getBackground()
public Color getBackground()
setBackground(java.awt.Color)
public void setTextColor(Color aTextColor)
aTextColor
.aTextColor
- the new color of the text.getTextColor()
public Color getTextColor()
setTextColor(java.awt.Color)
public void setValueFormat(ILcdFormatter aValueFormat)
aValueFormat
- the formatter used to format elevation values.getValueFormat()
public ILcdFormatter getValueFormat()
setValueFormat(com.luciad.util.ILcdFormatter)
public void setScanResolution(double aScanResolution)
aScanResolution
- the new scan resolution in meters.getScanResolution()
public double getScanResolution()
setScanResolution(double)
public void setUnknownElevationLabeled(boolean aUnknownElevationLabeled)
aUnknownElevationLabeled
- the new flag indicating if invalid elevation points are labeled.isUnknownElevationLabeled()
public boolean isUnknownElevationLabeled()
setUnknownElevationLabeled(boolean)
public void setOutOfRasterBoundsValueLabeled(boolean aOutOfRasterBoundsValueLabeled)
aOutOfRasterBoundsValueLabeled
- the new flag indicating if invalid elevation points are labeled.isOutOfRasterBoundsValueLabeled()
public boolean isOutOfRasterBoundsValueLabeled()
setOutOfRasterBoundsValueLabeled(boolean)
public void propertyChange(PropertyChangeEvent e)
propertyChange
in interface PropertyChangeListener
protected String formatAltitude(double aAltitude)
Double.toString
method is used.aAltitude
- the altitude value to format.setValueFormat(ILcdFormatter)
protected boolean shouldDisplayLabel(double aElevationValue)
aElevationValue
- the value to display a label for, or not.setOutOfRasterBoundsValueLabeled(boolean)
,
setUnknownElevationLabeled(boolean)