Package com.luciad.view.vertical
Class TLcdDefaultVVRenderer
java.lang.Object
com.luciad.view.vertical.TLcdDefaultVVRenderer
- All Implemented Interfaces:
ILcdVVRenderer
- Direct Known Subclasses:
TLcdVVTerrainProfileRenderer
This class is a default implementation of
ILcdVVRenderer
.
This class has get and set methods for customizing its default behavior.
For example the rendering mode can be set for all the sub-profiles at once.
A default ILcdIcon
can be set to be displayed at each points of
the main-profile etc.
Consider using TLcdDefaultVVRendererJ2D instead.
It offers the same functionality but has greater styling flexibility.- See Also:
-
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
drawProfileLine
(Graphics aGraphics, TLcdVVJPanel aVV, int aState, int aSegmentIndex, int aX1, int aY1, int aX2, int aY2) Draws the line of the main profile that corresponds to the segment with the given index.void
drawSubProfileLine
(Graphics aGraphics, TLcdVVJPanel aVV, int aState, int aRenderingMode, int aSubProfileStepIndex, int aSegmentIndex, int aSubProfileIndex, int aX1, int aY1, int aX2, int aY2) void
fillSubProfileStepPolygon
(Graphics aGraphics, TLcdVVJPanel aVV, int aState, int aRenderingMode, int aSubProfileStepIndex, int aSegmentIndex, int aSubProfileIndex, int[] aXArray, int[] aYArray) int
Returns the format to display labels for the main profile points.getPointIcon
(int aPointIndex) getPointIconDimension
(int aIndex) Color[]
int
Color[]
int
int
getSubProfileRenderingMode
(int aSubProfileIndex) boolean
Returns whether to use anti-aliasing when painting.boolean
Deprecated.This method has been deprecated.void
paintPointIcon
(Graphics aGraphics, TLcdVVJPanel aVV, int aPointIndex, int aXPosition, Rectangle aBounds) Paints the icon of the point with the given index on the graphics.void
paintPointLabel
(Graphics g, TLcdVVJPanel aVerticalView, int aPointIndex, int aXPos, int aYPos) Used for painting a label when a point is moved over with the mouse.void
paintVerticalCursor
(Graphics aGraphics, TLcdVVJPanel aVV, int aCurrentXPosition, int aYOffset, int aHeight, int aLeftPointIndex, int aRightPointIndex, int aMouseY, double aPercentage) Paints the VerticalCursor.void
paintYAxisParallelLine
(Graphics aGraphics, TLcdVVJPanel aVV, int aPointIndex, int aX, Rectangle aBounds) Paints a vertical line from the point with the given point index on the main profile to the X-axis.void
setAntiAliasing
(boolean aAntiAliasing) Sets whether to use anti-aliasing when painting.static void
setClassTraceOn
(boolean aClassTraceOn) Deprecated.This method has been deprecated.void
setMainProfileLabelArray
(String[] aLabelArray) Sets the labels to be painted for the main profile points.void
setMainProfileRenderingMode
(int aMode) Sets the rendering mode for the main-profile.void
setPointFormat
(Format aPointFormat) Sets the format to display labels for the points.void
setPointIcon
(ILcdIcon aIcon) Sets the defaultILcdIcon
for the main-profile-points.void
setProfileColor
(Color aColor) Sets the color for painting the main-profile.void
setProfileColorArray
(Color[] aColorArray) void
setSubProfileColor
(Color aColor) Configures the visualizationColor
for the sub-profiles.void
setSubProfileColorArray
(Color[] aColorArray) void
setSubProfileRenderingMode
(int aMode) Sets one value for all the sub-profilesvoid
setSubProfileRenderingMode
(int[] aModeArray) Sets the rendering modes for each of the sub-profiles.void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.void
setVerticalCursorColor
(Color aColor) Sets thePaint
to use for painting the vertical-cursor.void
subprofilesPaintEpilogue
(Graphics aGraphics) Is called once per painting cycle.void
subprofilesPaintPrologue
(Graphics aGraphics) Is called once per painting cycle.
-
Constructor Details
-
TLcdDefaultVVRenderer
public TLcdDefaultVVRenderer()
-
-
Method Details
-
setClassTraceOn
public static void setClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for all instances of this class. If the argument istrue
then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.- Parameters:
aClassTraceOn
- if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Parameters:
aTraceOn
- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
setVerticalCursorColor
Sets thePaint
to use for painting the vertical-cursor.- Parameters:
aColor
-
-
getVerticalCursorColor
- See Also:
-
paintPointIcon
public void paintPointIcon(Graphics aGraphics, TLcdVVJPanel aVV, int aPointIndex, int aXPosition, Rectangle aBounds) Description copied from interface:ILcdVVRenderer
Paints the icon of the point with the given index on the graphics.- Specified by:
paintPointIcon
in interfaceILcdVVRenderer
- Parameters:
aGraphics
- the graphics to paint the icon on.aVV
- the source object of this call.aPointIndex
- the point index within the main profile.aXPosition
- the X position on the screen for the icon.aBounds
- thelocation
of this bounds is positioned on the screen coordinate that has the Y value of the main profile point's altitude and the X of the first point on the grid. The width is equal to the portion between the first X on the grid and the last X on the grid. The height is equal to the portion between the lowest grid line and the main profile point.
-
setProfileColor
Sets the color for painting the main-profile.- Parameters:
aColor
-
-
setProfileColorArray
- Parameters:
aColorArray
- an array that holds for each segment of the profile a color
-
getProfileColorArray
- Returns:
- an array that holds for each segment of the main profile a color
-
getProfileColor
- See Also:
-
setSubProfileColor
Configures the visualizationColor
for the sub-profiles. This value is used indrawSubProfileLine(java.awt.Graphics, com.luciad.view.vertical.TLcdVVJPanel, int, int, int, int, int, int, int, int, int)
. SeesetSubProfileColorArray(java.awt.Color[])
for more fine-grained configuration. -
setSubProfileColorArray
- Parameters:
aColorArray
- configures which color should be used for each sub-profile. The first element is used for the first subProfile, and so on. If the sub-profile index is outside this array, the defaultsetSubProfileColor(java.awt.Color)
is used.
-
setMainProfileLabelArray
Sets the labels to be painted for the main profile points.setPointFormat(java.text.Format)
is a more convenient way to define the labels for these points.- Parameters:
aLabelArray
- an array of Strings containing a label for every main-profile point.- See Also:
-
getPointFormat
Returns the format to display labels for the main profile points. The default value is null.- Returns:
- the format to display labels for the points
- See Also:
-
setPointFormat
Sets the format to display labels for the points. The format should be able to handle ILcdPoint instances from the main profile of the vertical view model. A non-null point format overrides the currentlyset labels
.- Parameters:
aPointFormat
- the format to display labels for the points.- See Also:
-
getSubProfileColor
- See Also:
-
getSubProfileColorArray
- See Also:
-
setPointIcon
Sets the defaultILcdIcon
for the main-profile-points.- Parameters:
aIcon
-
-
setMainProfileRenderingMode
public void setMainProfileRenderingMode(int aMode) Sets the rendering mode for the main-profile.- Parameters:
aMode
- see constants defined inILcdVVRenderer
-
getMainProfileRenderingMode
public int getMainProfileRenderingMode()- See Also:
-
setSubProfileRenderingMode
public void setSubProfileRenderingMode(int aMode) Sets one value for all the sub-profiles- Parameters:
aMode
- see constants defined inILcdVVRenderer
-
getSubProfileRenderingMode
public int getSubProfileRenderingMode()- See Also:
-
setSubProfileRenderingMode
public void setSubProfileRenderingMode(int[] aModeArray) Sets the rendering modes for each of the sub-profiles.- Parameters:
aModeArray
- this array contains the values for the mode for all the sub-profiles. See constants defined inILcdVVRenderer
-
getPointIcon
-
isAntiAliasing
public boolean isAntiAliasing()Returns whether to use anti-aliasing when painting.- Returns:
- whether to use anti-aliasing when painting
- See Also:
-
setAntiAliasing
public void setAntiAliasing(boolean aAntiAliasing) Sets whether to use anti-aliasing when painting.- Parameters:
aAntiAliasing
- iftrue
, uses anti-aliasing when painting- See Also:
-
getPointIconDimension
- Specified by:
getPointIconDimension
in interfaceILcdVVRenderer
- Parameters:
aIndex
- the point index within the main profile.- Returns:
- The dimension of the icon, null if no icon is available
-
subprofilesPaintEpilogue
Description copied from interface:ILcdVVRenderer
Is called once per painting cycle. It is called, as it name indicates, just after the sub profiles are rendered.- Specified by:
subprofilesPaintEpilogue
in interfaceILcdVVRenderer
- Parameters:
aGraphics
- The Graphics on which the sub profiles will be painted
-
subprofilesPaintPrologue
Description copied from interface:ILcdVVRenderer
Is called once per painting cycle. It is called, as it name indicates, just before the sub profiles are rendered.- Specified by:
subprofilesPaintPrologue
in interfaceILcdVVRenderer
- Parameters:
aGraphics
- The Graphics on which the sub profiles will be painted
-
getRenderingMode
public int getRenderingMode()- Specified by:
getRenderingMode
in interfaceILcdVVRenderer
- Returns:
- Returns the mode in which the main profile should be drawn only NO_PAINTING and TOP_LINE are considered valid.
-
drawProfileLine
public void drawProfileLine(Graphics aGraphics, TLcdVVJPanel aVV, int aState, int aSegmentIndex, int aX1, int aY1, int aX2, int aY2) Description copied from interface:ILcdVVRenderer
Draws the line of the main profile that corresponds to the segment with the given index.- Specified by:
drawProfileLine
in interfaceILcdVVRenderer
- Parameters:
aGraphics
- the graphics to paint the line on.aVV
- the source object of this call.aState
- Not used yetaSegmentIndex
- The segment index within the main-profile.aX1
- the X-coordinate of the start of the line.aY1
- the Y-coordinate of the start of the line.aX2
- the X-coordinate of the end of the line.aY2
- the Y-coordinate of the end of the line.
-
paintYAxisParallelLine
public void paintYAxisParallelLine(Graphics aGraphics, TLcdVVJPanel aVV, int aPointIndex, int aX, Rectangle aBounds) Description copied from interface:ILcdVVRenderer
Paints a vertical line from the point with the given point index on the main profile to the X-axis.- Specified by:
paintYAxisParallelLine
in interfaceILcdVVRenderer
- Parameters:
aGraphics
- the graphics to paint onaVV
- the source of this callaPointIndex
- the point index of the main profileaX
- the X position on the screenaBounds
- thelocation
of this bounds is positioned on the screen coordinate that has the X of the first point on the grid and the Y value of altitude of the point with the given index on the main profile. The width is equal to the portion between the first X on the grid and the last X on the grid. The height is equal to the portion between the lowest grid line and the main profile point.
-
getSubProfileRenderingMode
public int getSubProfileRenderingMode(int aSubProfileIndex) - Specified by:
getSubProfileRenderingMode
in interfaceILcdVVRenderer
- Parameters:
aSubProfileIndex
- the index of the sub-profile.- Returns:
- Returns the mode in which the specified sub-profile should be drawn.
-
drawSubProfileLine
public void drawSubProfileLine(Graphics aGraphics, TLcdVVJPanel aVV, int aState, int aRenderingMode, int aSubProfileStepIndex, int aSegmentIndex, int aSubProfileIndex, int aX1, int aY1, int aX2, int aY2) - Specified by:
drawSubProfileLine
in interfaceILcdVVRenderer
- Parameters:
aGraphics
- the graphics to paint the line of the profile 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.aX1
- the X-coordinate of the start of the line.aY1
- the Y-coordinate of the start of the line.aX2
- the X-coordinate of the end of the line.aY2
- the Y-coordinate of the end of the line.
-
fillSubProfileStepPolygon
public void fillSubProfileStepPolygon(Graphics aGraphics, TLcdVVJPanel aVV, int aState, int aRenderingMode, int aSubProfileStepIndex, int aSegmentIndex, int aSubProfileIndex, int[] aXArray, int[] aYArray) - Specified by:
fillSubProfileStepPolygon
in interfaceILcdVVRenderer
- 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 g, TLcdVVJPanel aVerticalView, int aPointIndex, int aXPos, int aYPos) Description copied from interface:ILcdVVRenderer
Used for painting a label when a point is moved over with the mouse. Only points on the main profile will be processed. Notice that the user needs to paint the label himself.- Specified by:
paintPointLabel
in interfaceILcdVVRenderer
- Parameters:
g
- the graphics to paint label of the point on.aXPos
- the X-coordinate of the point.aYPos
- the Y-coordinate of the point.
-
paintVerticalCursor
public void paintVerticalCursor(Graphics aGraphics, TLcdVVJPanel aVV, int aCurrentXPosition, int aYOffset, int aHeight, int aLeftPointIndex, int aRightPointIndex, int aMouseY, double aPercentage) Description copied from interface:ILcdVVRenderer
Paints the VerticalCursor.- Specified by:
paintVerticalCursor
in interfaceILcdVVRenderer
- 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.aPercentage
- 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.
-