public class TLcdDefaultVVRenderer extends Object implements ILcdVVRenderer
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.BOTTOM_LINE, DEFAULT, FILLED, LEFT_LINE, NO_PAINTING, POLYGON, RIGHT_LINE, TOP_LINE
Constructor and Description |
---|
TLcdDefaultVVRenderer() |
Modifier and Type | Method and Description |
---|---|
void |
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 |
getMainProfileRenderingMode() |
Format |
getPointFormat()
Returns the format to display labels for the main profile points.
|
ILcdIcon |
getPointIcon(int aPointIndex) |
Dimension |
getPointIconDimension(int aIndex) |
Color |
getProfileColor() |
Color[] |
getProfileColorArray() |
int |
getRenderingMode() |
Color |
getSubProfileColor() |
Color[] |
getSubProfileColorArray() |
int |
getSubProfileRenderingMode() |
int |
getSubProfileRenderingMode(int aSubProfileIndex) |
Color |
getVerticalCursorColor() |
boolean |
isAntiAliasing()
Returns whether to use anti-aliasing when painting.
|
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
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. It is recommended to use the
standard Java logging framework directly.
|
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 default
ILcdIcon 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 visualization
Color for the sub-profiles. |
void |
setSubProfileColorArray(Color[] aColorArray) |
void |
setSubProfileRenderingMode(int aMode)
Sets one value for all the sub-profiles
|
void |
setSubProfileRenderingMode(int[] aModeArray)
Sets the rendering modes for each of the sub-profiles.
|
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setVerticalCursorColor(Color aColor)
Sets the
Paint 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.
|
public static void setClassTraceOn(boolean aClassTraceOn)
true
then all log messages are recorded, otherwise only
the informative, warning and error messages are recorded.aClassTraceOn
- if true then all log messages are recorded,
otherwise only the informative, warning and error messages are recorded.public void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.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.public boolean isTraceOn()
true
if tracing is enabled for this class.public void setVerticalCursorColor(Color aColor)
Paint
to use for painting the vertical-cursor.aColor
- public Color getVerticalCursorColor()
setVerticalCursorColor(Color)
public void paintPointIcon(Graphics aGraphics, TLcdVVJPanel aVV, int aPointIndex, int aXPosition, Rectangle aBounds)
ILcdVVRenderer
paintPointIcon
in interface ILcdVVRenderer
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
- the location
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.public void setProfileColor(Color aColor)
aColor
- public void setProfileColorArray(Color[] aColorArray)
aColorArray
- an array that holds for each segment of the profile a colorpublic Color[] getProfileColorArray()
public Color getProfileColor()
setProfileColor(java.awt.Color)
public void setSubProfileColor(Color aColor)
Color
for the sub-profiles.
This value is used in drawSubProfileLine(java.awt.Graphics, com.luciad.view.vertical.TLcdVVJPanel, int, int, int, int, int, int, int, int, int)
.
See setSubProfileColorArray(java.awt.Color[])
for more fine-grained configuration.public void setSubProfileColorArray(Color[] aColorArray)
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 default setSubProfileColor(java.awt.Color)
is used.public void setMainProfileLabelArray(String[] aLabelArray)
setPointFormat(java.text.Format)
is a more convenient way to define the labels for these points.aLabelArray
- an array of Strings containing a label for every
main-profile point.paintPointLabel(java.awt.Graphics, com.luciad.view.vertical.TLcdVVJPanel, int, int, int)
,
setPointFormat(java.text.Format)
public Format getPointFormat()
paintPointLabel(java.awt.Graphics, com.luciad.view.vertical.TLcdVVJPanel, int, int, int)
public void setPointFormat(Format aPointFormat)
set labels
.aPointFormat
- the format to display labels for the points.paintPointLabel(Graphics, TLcdVVJPanel, int, int, int)
public Color getSubProfileColor()
setSubProfileColor(java.awt.Color)
public Color[] getSubProfileColorArray()
public void setPointIcon(ILcdIcon aIcon)
ILcdIcon
for the main-profile-points.aIcon
- public void setMainProfileRenderingMode(int aMode)
aMode
- see constants defined in ILcdVVRenderer
public int getMainProfileRenderingMode()
setMainProfileRenderingMode(int)
public void setSubProfileRenderingMode(int aMode)
aMode
- see constants defined in ILcdVVRenderer
public int getSubProfileRenderingMode()
setSubProfileRenderingMode(int)
public void setSubProfileRenderingMode(int[] aModeArray)
aModeArray
- this array contains the values for the mode for all the
sub-profiles. See constants defined in ILcdVVRenderer
public ILcdIcon getPointIcon(int aPointIndex)
public boolean isAntiAliasing()
setAntiAliasing(boolean)
public void setAntiAliasing(boolean aAntiAliasing)
aAntiAliasing
- if true
, uses anti-aliasing when paintingisAntiAliasing()
public Dimension getPointIconDimension(int aIndex)
getPointIconDimension
in interface ILcdVVRenderer
aIndex
- the point index within the main profile.public void subprofilesPaintEpilogue(Graphics aGraphics)
ILcdVVRenderer
subprofilesPaintEpilogue
in interface ILcdVVRenderer
aGraphics
- The Graphics on which the sub profiles will be paintedpublic void subprofilesPaintPrologue(Graphics aGraphics)
ILcdVVRenderer
subprofilesPaintPrologue
in interface ILcdVVRenderer
aGraphics
- The Graphics on which the sub profiles will be paintedpublic int getRenderingMode()
getRenderingMode
in interface ILcdVVRenderer
public void drawProfileLine(Graphics aGraphics, TLcdVVJPanel aVV, int aState, int aSegmentIndex, int aX1, int aY1, int aX2, int aY2)
ILcdVVRenderer
drawProfileLine
in interface ILcdVVRenderer
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.public void paintYAxisParallelLine(Graphics aGraphics, TLcdVVJPanel aVV, int aPointIndex, int aX, Rectangle aBounds)
ILcdVVRenderer
paintYAxisParallelLine
in interface ILcdVVRenderer
aGraphics
- the graphics to paint onaVV
- the source of this callaPointIndex
- the point index of the main profileaX
- the X position on the screenaBounds
- the location
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.public int getSubProfileRenderingMode(int aSubProfileIndex)
getSubProfileRenderingMode
in interface ILcdVVRenderer
aSubProfileIndex
- the index of the sub-profile.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)
drawSubProfileLine
in interface ILcdVVRenderer
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 until ILcdVVModel.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.public void fillSubProfileStepPolygon(Graphics aGraphics, TLcdVVJPanel aVV, int aState, int aRenderingMode, int aSubProfileStepIndex, int aSegmentIndex, int aSubProfileIndex, int[] aXArray, int[] aYArray)
fillSubProfileStepPolygon
in interface ILcdVVRenderer
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 until ILcdVVModel.subProfilePointCount(int, int)
- 2.aSegmentIndex
- The segment index within the main-profile.aSubProfileIndex
- the index of the sub-profile.aXArray
- an array of int
that contains the X-values of the
points of the polygon in clockwise direction.aYArray
- an array of int
that contains the Y-values of the
points of the polygon in clockwise direction.public void paintPointLabel(Graphics g, TLcdVVJPanel aVerticalView, int aPointIndex, int aXPos, int aYPos)
ILcdVVRenderer
paintPointLabel
in interface ILcdVVRenderer
g
- the graphics to paint label of the point on.aXPos
- the X-coordinate of the point.aYPos
- the Y-coordinate of the point.public void paintVerticalCursor(Graphics aGraphics, TLcdVVJPanel aVV, int aCurrentXPosition, int aYOffset, int aHeight, int aLeftPointIndex, int aRightPointIndex, int aMouseY, double aPercentage)
ILcdVVRenderer
paintVerticalCursor
in interface ILcdVVRenderer
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.