Package com.luciad.tea
Class TLcdVVTerrainProfileRenderer
java.lang.Object
com.luciad.view.vertical.TLcdDefaultVVRenderer
com.luciad.tea.TLcdVVTerrainProfileRenderer
- All Implemented Interfaces:
ILcdVVRenderer
This class is used for rendering the terrain profile with the use
of a Vertical View. Most of the functionality is used from the
TLcdDefaultVVRenderer
-
Field Summary
Fields inherited from interface com.luciad.view.vertical.ILcdVVRenderer
BOTTOM_LINE, DEFAULT, FILLED, LEFT_LINE, NO_PAINTING, POLYGON, RIGHT_LINE, TOP_LINE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
fillSubProfileStepPolygon
(Graphics aGraphics, TLcdVVJPanel aVView, int aState, int aRenderingMode, int aSubProfileStepIndex, int aSegmentIndex, int aSubProfileIndex, int[] aXArray, int[] aYArray) This method actually paints the terrain profile.Gets the format used to display altitude values.Returns the color used to display unknown altitudes.protected boolean
isValidElevation
(double aElevationValue) Checks whether the given elevation value is a known value as returned by the terrain elevation provider.void
paintPointLabel
(Graphics aGraphics, TLcdVVJPanel aVView, int aPointIndex, int xPos, int yPos) Paints the labels for the main profile points.void
paintVerticalCursor
(Graphics aGraphics, TLcdVVJPanel aVView, int aCurrentXPosition, int aYOffset, int aHeight, int aLeftPointIndex, int aRightPointIndex, int aMouseY, double aRatio) Paints the vertical cursor.void
setAltitudeFormat
(Format aAltitudeFormat) Set the format used to display altitude values.void
setUnknownColor
(Color aUnknownColor) Sets the color to use to display unknown altitudes.Methods inherited from class com.luciad.view.vertical.TLcdDefaultVVRenderer
drawProfileLine, drawSubProfileLine, getMainProfileRenderingMode, getPointFormat, getPointIcon, getPointIconDimension, getProfileColor, getProfileColorArray, getRenderingMode, getSubProfileColor, getSubProfileColorArray, getSubProfileRenderingMode, getSubProfileRenderingMode, getVerticalCursorColor, isAntiAliasing, isTraceOn, paintPointIcon, paintYAxisParallelLine, setAntiAliasing, setClassTraceOn, setMainProfileLabelArray, setMainProfileRenderingMode, setPointFormat, setPointIcon, setProfileColor, setProfileColorArray, setSubProfileColor, setSubProfileColorArray, setSubProfileRenderingMode, setSubProfileRenderingMode, setTraceOn, setVerticalCursorColor, subprofilesPaintEpilogue, subprofilesPaintPrologue
-
Constructor Details
-
TLcdVVTerrainProfileRenderer
public TLcdVVTerrainProfileRenderer()
-
-
Method Details
-
setAltitudeFormat
Set the format used to display altitude values.- Parameters:
aAltitudeFormat
- the format used to display altitude values.- See Also:
-
getAltitudeFormat
Gets the format used to display altitude values.- Returns:
- the format used to display altitude values.
- See Also:
-
fillSubProfileStepPolygon
public void fillSubProfileStepPolygon(Graphics aGraphics, TLcdVVJPanel aVView, int aState, int aRenderingMode, int aSubProfileStepIndex, int aSegmentIndex, int aSubProfileIndex, int[] aXArray, int[] aYArray) This method actually paints the terrain profile.- Specified by:
fillSubProfileStepPolygon
in interfaceILcdVVRenderer
- Overrides:
fillSubProfileStepPolygon
in classTLcdDefaultVVRenderer
- Parameters:
aGraphics
- The graphics to paint on.aState
- Not used yetaRenderingMode
- See constants defined in this interfaceaSubProfileStepIndex
- The segment-index of the subprofile. Can go from zero untilILcdVVModel.subProfilePointCount(int, int)
- 2.aSegmentIndex
- The segment index within the main-profile.aSubProfileIndex
- The index of the sub-profile.aXArray
- An array ofint
that contains the X-values of the points of the polygon in clockwise direction.aYArray
- An array ofint
that contains the Y-values of the points of the polygon in clockwise direction.
-
paintPointLabel
public void paintPointLabel(Graphics aGraphics, TLcdVVJPanel aVView, int aPointIndex, int xPos, int yPos) Paints the labels for the main profile points.- Specified by:
paintPointLabel
in interfaceILcdVVRenderer
- Overrides:
paintPointLabel
in classTLcdDefaultVVRenderer
- Parameters:
aGraphics
- the graphics to paint label of the point on.xPos
- the X-coordinate of the point.yPos
- the Y-coordinate of the point.
-
paintVerticalCursor
public void paintVerticalCursor(Graphics aGraphics, TLcdVVJPanel aVView, int aCurrentXPosition, int aYOffset, int aHeight, int aLeftPointIndex, int aRightPointIndex, int aMouseY, double aRatio) Paints the vertical cursor. This is the red line which follows the mouse over the terrain profile when the left mouse buttons is pressed and indicates the terrain level at the cursor position.- Specified by:
paintVerticalCursor
in interfaceILcdVVRenderer
- Overrides:
paintVerticalCursor
in classTLcdDefaultVVRenderer
- Parameters:
aGraphics
- the graphics to paint the vertical cursor on.aCurrentXPosition
- The position on aGraphics where the cursor should be drawn.aYOffset
- The position indicating the top Y position for the cursor.aHeight
- The amount of pixels in the Y dimension.aLeftPointIndex
- The main profile point on the left of the cursor.aRightPointIndex
- The main profile point on the right of the cursor.aMouseY
- The Y value indicating where the mouse was last located (while dragging of the cursor occurred). Can be useful for painting the label on the cursor. Will be -1 if no dragging has appeared yet.aRatio
- If the total delta between left and right point is 1, then this ratio indicates the cursor's new position relative to the first point.
-
setUnknownColor
Sets the color to use to display unknown altitudes. The default value is red.- Parameters:
aUnknownColor
- the color to use to display unknown altitudes.- See Also:
-
getUnknownColor
Returns the color used to display unknown altitudes. The default value is red.- Returns:
- the color used to display unknown altitudes.
- See Also:
-
isValidElevation
protected boolean isValidElevation(double aElevationValue) Checks whether the given elevation value is a known value as returned by the terrain elevation provider. This method returnsfalse
if the elevation value isDouble.NaN
,Double.POSITIVE_INFINITY
orDouble.NEGATIVE_INFINITY
.- Parameters:
aElevationValue
- the elevation value to check.- Returns:
- true for known values, false for the unknown values.
-