Class ALcdGXYLabelStamp

java.lang.Object
com.luciad.view.gxy.ALcdGXYLabelStamp
All Implemented Interfaces:
Cloneable

public abstract class ALcdGXYLabelStamp extends Object implements Cloneable

An ALcdGXYLabelStamp is an object that performs the actual painting of a label. It contains only the logic of what to draw and leaves the decision of where to draw to the client of this class.

Since:
7.0
See Also:
  • Constructor Details

    • ALcdGXYLabelStamp

      public ALcdGXYLabelStamp()
  • Method Details

    • clone

      protected Object clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • dimensionSFCT

      public abstract void dimensionSFCT(Graphics aGraphics, Object aObject, int aLabelIndex, int aSubLabelIndex, int aMode, ILcdGXYContext aContext, Dimension aDimensionSFCT) throws TLcdNoBoundsException

      Adjusts aDimensionSFCT to contain the dimension of the specified label.

      Because this dimension should be independent of the label location and rotation, this information is not passed in as parameter.

      Parameters:
      aGraphics - The Graphics instance on which the label would be painted.
      aObject - The object for which the label bounds are requested.
      aLabelIndex - The index of the label whose bounds are requested.
      aSubLabelIndex - The index of the sublabel whose bounds are requested.
      aMode - The mode for which the label bounds are requested. See ILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext) for more information.
      aContext - The ILcdGXYContext instance containing the contextual information about the label, such as the layer and the view.
      aDimensionSFCT - The Dimension that should be updated with the requested stamp size.
      Throws:
      TLcdNoBoundsException - When the stamp could not determine the bounds for the specified label. For instance, when a certain property is set on the object that specifies the label cannot be drawn, the stamp can throw this exception.
      See Also:
    • paint

      public abstract void paint(Graphics aGraphics, Object aObject, int aLabelIndex, int aSubLabelIndex, int aMode, ILcdGXYContext aContext, int aX, int aY, double aRotation)

      Paints the specified label at the specified location with the specified rotation. The Graphics instance has been rotated or translated to the correct position, ie. this stamp can start painting from (0,0) to the width and height it returned in dimensionSFCT

      This method should only paint in the bounds it returned
      Parameters:
      aGraphics - The Graphics instance on which to paint the label.
      aObject - The domain object for which to paint the label.
      aLabelIndex - The index of the label that should be painted.
      aSubLabelIndex - The index of the sublabel that should be painted.
      aMode - The mode in which the label should be painted. See ILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext) for more information.
      aContext - The ILcdGXYContext instance containing the contextual information about the label, such as the layer and the view.
      aX - The x-coordinate where the label is painted. This is the x-coordinate of the upper left corner. This is information is purely contextual, as the Graphics instance is already configured to take the position into account. It is optional to take this information into account when painting.
      aY - The y-coordinate where the label is painted. This is the y-coordinate of the upper left corner. This is information is purely contextual, as the Graphics instance is already configured to take the position into account. It is optional to take this information into account when painting.
      aRotation - The rotation with which the label should be painted. This is information is purely contextual, as the Graphics instance is already configured to take this rotation into account. It is optional to take this information into account when painting.
      See Also:
    • isTouched

      public boolean isTouched(Graphics aGraphics, Object aObject, int aLabelIndex, int aSubLabelIndex, int aMode, ILcdGXYContext aContext, int aX, int aY, double aRotation)

      Determines whether the label is present at the specified location. The default implementation works for rectangular labels, by using the label dimension.

      This method needs to be redefined for non-rectangular labels. For instance, when the label is circular, the bounds of that label, which, by definition, are rectangular, cover more area than is actually used by the label. This method would then return false for points that fall outside of the circle, and true for those within the circle.

      The location is specified by the getX() and getY() methods of aContext. This location is relative to the Rectangle defined by dimensionSFCT

      Parameters:
      aGraphics - The Graphics instance on which the label is painted.
      aObject - The domain object for which to paint the label.
      aLabelIndex - The index of the label.
      aSubLabelIndex - The index of the sublabel.
      aMode - The mode in which the label should be present or not. See ILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext) for more information.
      aContext - The ILcdGXYContext instance containing the location where we want to know if the label is present. This location can be retrieved with the getX() and getY() methods of this ILcdGXYContext instance. (0,0) is at the top left of the label.
      aX - The x-coordinate where the label is painted. This is the x-coordinate of the upper left corner. This information is needed only when paint takes this parameter into account.
      aY - The y-coordinate where the label is painted. This is the y-coordinate of the upper left corner. This information is needed only when paint takes this parameter into account.
      aRotation - The rotation with which the label should be painted. This information is purely contextual, it is optional to take this information into account when painting.
      Returns:
      true if the label is touched at the specified location, false otherwise.