Class TLcdDefaultVVRenderer

java.lang.Object
com.luciad.view.vertical.TLcdDefaultVVRenderer
All Implemented Interfaces:
ILcdVVRenderer
Direct Known Subclasses:
TLcdVVTerrainProfileRenderer

public class TLcdDefaultVVRenderer extends Object implements ILcdVVRenderer
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:
  • 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 is true 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 either 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.
      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.
      Returns true if tracing is enabled for this class.
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • setVerticalCursorColor

      public void setVerticalCursorColor(Color aColor)
      Sets the Paint to use for painting the vertical-cursor.
      Parameters:
      aColor -
    • getVerticalCursorColor

      public Color 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 interface ILcdVVRenderer
      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 - 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.
    • setProfileColor

      public void setProfileColor(Color aColor)
      Sets the color for painting the main-profile.
      Parameters:
      aColor -
    • setProfileColorArray

      public void setProfileColorArray(Color[] aColorArray)
      Parameters:
      aColorArray - an array that holds for each segment of the profile a color
    • getProfileColorArray

      public Color[] getProfileColorArray()
      Returns:
      an array that holds for each segment of the main profile a color
    • getProfileColor

      public Color getProfileColor()
      See Also:
    • setSubProfileColor

      public void setSubProfileColor(Color aColor)
      Configures the visualization 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.
    • setSubProfileColorArray

      public void setSubProfileColorArray(Color[] aColorArray)
      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 default setSubProfileColor(java.awt.Color) is used.
    • setMainProfileLabelArray

      public void setMainProfileLabelArray(String[] aLabelArray)
      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

      public Format 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

      public void setPointFormat(Format aPointFormat)
      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 currently set labels.
      Parameters:
      aPointFormat - the format to display labels for the points.
      See Also:
    • getSubProfileColor

      public Color getSubProfileColor()
      See Also:
    • getSubProfileColorArray

      public Color[] getSubProfileColorArray()
      See Also:
    • setPointIcon

      public void setPointIcon(ILcdIcon aIcon)
      Sets the default ILcdIcon 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 in ILcdVVRenderer
    • 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 in ILcdVVRenderer
    • 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 in ILcdVVRenderer
    • getPointIcon

      public ILcdIcon getPointIcon(int aPointIndex)
    • 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 - if true, uses anti-aliasing when painting
      See Also:
    • getPointIconDimension

      public Dimension getPointIconDimension(int aIndex)
      Specified by:
      getPointIconDimension in interface ILcdVVRenderer
      Parameters:
      aIndex - the point index within the main profile.
      Returns:
      The dimension of the icon, null if no icon is available
    • subprofilesPaintEpilogue

      public void subprofilesPaintEpilogue(Graphics aGraphics)
      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 interface ILcdVVRenderer
      Parameters:
      aGraphics - The Graphics on which the sub profiles will be painted
    • subprofilesPaintPrologue

      public void subprofilesPaintPrologue(Graphics aGraphics)
      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 interface ILcdVVRenderer
      Parameters:
      aGraphics - The Graphics on which the sub profiles will be painted
    • getRenderingMode

      public int getRenderingMode()
      Specified by:
      getRenderingMode in interface ILcdVVRenderer
      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 interface ILcdVVRenderer
      Parameters:
      aGraphics - the graphics to paint the line on.
      aVV - the source object of this call.
      aState - Not used yet
      aSegmentIndex - 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 interface ILcdVVRenderer
      Parameters:
      aGraphics - the graphics to paint on
      aVV - the source of this call
      aPointIndex - the point index of the main profile
      aX - the X position on the screen
      aBounds - 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.
    • getSubProfileRenderingMode

      public int getSubProfileRenderingMode(int aSubProfileIndex)
      Specified by:
      getSubProfileRenderingMode in interface ILcdVVRenderer
      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 interface ILcdVVRenderer
      Parameters:
      aGraphics - the graphics to paint the line of the profile on.
      aState - Not used yet
      aRenderingMode - See constants defined in this interface
      aSubProfileStepIndex - 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.
    • 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 interface ILcdVVRenderer
      Parameters:
      aGraphics - the graphics to paint on.
      aState - Not used yet
      aRenderingMode - See constants defined in this interface
      aSubProfileStepIndex - 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.
    • 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 interface ILcdVVRenderer
      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 interface ILcdVVRenderer
      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.