Class TLcdGXYHaloLabelPainter2

java.lang.Object
com.luciad.view.gxy.TLcdGXYHaloLabelPainter
com.luciad.view.gxy.TLcdGXYHaloLabelPainter2
All Implemented Interfaces:
ILcdPropertyChangeSource, ILcdGXYLabelPainter, ILcdGXYLabelPainter2, ILcdGXYLabelPainterProvider, ILcdGXYMultiLabelPainter, Serializable, Cloneable

public class TLcdGXYHaloLabelPainter2 extends TLcdGXYHaloLabelPainter implements ILcdGXYLabelPainter2
An extension of TLcdGXYHaloLabelPainter that supports ILcdGXYLabelPainter2.
Since:
7.0.17
See Also:
  • Constructor Details

    • TLcdGXYHaloLabelPainter2

      public TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainter2 aLabelPainter2)
      Creates a new TLcdGXYHaloLabelPainter2 wrapping the given label painter, with default halo parameters (Color = white, thickness = 1).
      Parameters:
      aLabelPainter2 - the ILcdGXYLabelPainter2 rendering the label.
    • TLcdGXYHaloLabelPainter2

      public TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainter2 aLabelPainter2, Color aHaloColor, int aHaloThickness)
      Creates a new TLcdGXYHaloLabelPainter2 wrapping the given label painter, configured with the given halo color and thickness.
      Parameters:
      aLabelPainter2 - the ILcdGXYLabelPainter2 rendering the label.
      aHaloColor - the halo color
      aHaloThickness - the halo thickness
    • TLcdGXYHaloLabelPainter2

      public TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainterProvider aLabelPainter2Provider)
      Creates a new TLcdGXYHaloLabelPainter2 wrapping the given label painter provider, with default halo parameters (Color = white, thickness = 1).
      Parameters:
      aLabelPainter2Provider - the ILcdGXYLabelPainterProvider returning ILcdGXYLabelPainter2 instances.
    • TLcdGXYHaloLabelPainter2

      public TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainterProvider aLabelPainter2Provider, Color aHaloColor, int aHaloThickness)
      Creates a new TLcdGXYHaloLabelPainter2 wrapping the given label painter provider, configured with the given halo color and thickness.
      Parameters:
      aLabelPainter2Provider - the ILcdGXYLabelPainterProvider returning ILcdGXYLabelPainter2 instances.
      aHaloColor - the halo color
      aHaloThickness - the halo thickness
  • Method Details

    • setDelegateLabelPainter

      public void setDelegateLabelPainter(ILcdGXYLabelPainter aDelegateLabelPainter)
      Sets the ILcdGXYLabelPainter to which the rendering of the labels is to be delegated. The delegate painter must be an instance of ILcdGXYLabelPainter2. If this is not the case, use a TLcdGXYHaloLabelPainter instead.
      Overrides:
      setDelegateLabelPainter in class TLcdGXYHaloLabelPainter
      Parameters:
      aDelegateLabelPainter - the ILcdGXYLabelPainter2 to which the rendering of the labels is delegated.
    • setDelegateLabelPainterProvider

      public void setDelegateLabelPainterProvider(ILcdGXYLabelPainterProvider aDelegateLabelPainterProvider)
      Sets the ILcdGXYLabelPainterProvider to which the rendering of the labels is to be delegated. This delegate must return painters implementing ILcdGXYLabelPainter2. If this is not the case, use a TLcdGXYHaloLabelPainter instead.
      Overrides:
      setDelegateLabelPainterProvider in class TLcdGXYHaloLabelPainter
      Parameters:
      aDelegateLabelPainterProvider - painter provider returning ILcdGXYLabelPainter2 to which the rendering of the labels is delegated.
    • setLabelLocation

      public void setLabelLocation(TLcdLabelLocation aLabelLocation)
      Description copied from interface: ILcdGXYLabelPainter2

      Sets the label location of the label. This label location will be used to determine what the bounds of the label are, where it must be painted, etc.

      Note that aLabelLocation also contains a label location index. This is independent of the ILcdGXYLabelPainter.getLocationIndex() of the super interface. Contrary to the location index returned by getLocationIndex, the location index in aLabelLocation can be less than 0, in which case the labels are freely placed.

      This method has to be called after ILcdGXYLabelPainter2.setObject(java.lang.Object) has been called, as calling setObject clears this label location.

      Specified by:
      setLabelLocation in interface ILcdGXYLabelPainter2
      Parameters:
      aLabelLocation - The TLcdLabelLocation instance containing all the information about the location of the label.
      See Also:
    • getLabelLocation

      public TLcdLabelLocation getLabelLocation()
      Description copied from interface: ILcdGXYLabelPainter2
      Returns the TLcdLabelLocation that was previously set that contains the information on the whereabouts of the label.
      Specified by:
      getLabelLocation in interface ILcdGXYLabelPainter2
      Returns:
      The label location that was previously set.
      See Also:
    • isLabelTouched

      public boolean isLabelTouched(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
      Description copied from interface: ILcdGXYLabelPainter2
      Tests if the label specified by setObject, setLabelIndex and setSubLabelIndex is touched at view location (specified by aGXYContext.getX() and aGXYContext.getY()), considering the mode and the ILcdGXYContext instance.

      Before calling this method, the domain object, the label index, the sublabel index and the location of the label should be set using the respective methods.

      Specified by:
      isLabelTouched in interface ILcdGXYLabelPainter2
      Parameters:
      aGraphics - The Graphics instance on which the label is painted.
      aMode - the mode to consider. This is a bitwise combinations of several constants. See ILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext) for more information.
      aGXYContext - the ILcdGXYContext to consider.
      Returns:
      true if the representation of the Object returned by getObject() is touched, false otherwise
      See Also:
    • labelAnchorPointSFCT

      public void labelAnchorPointSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Point aPointSFCT) throws TLcdNoBoundsException
      Description copied from interface: ILcdGXYLabelPainter2

      Sets aPointSFCT to the anchor point of the label specified by setObject, setLabelIndex and setSubLabelIndex.

      If the location index is less than 0, the label anchor point is unambiguously determined by the label location. The actual label is to be painted somewhere around this anchor point. This method is typically called to compare the result with the label bounds, thus determining the exact relation between the label and its location.

      Before calling this method, the domain object, the label index, the sublabel index and the location of the label should be set using the respective methods.

      Specified by:
      labelAnchorPointSFCT in interface ILcdGXYLabelPainter2
      Parameters:
      aGraphics - The Graphics instance on which the label is painted.
      aMode - The mode to consider. This can be a bitwise combination of several constants. See ILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext) for more information.
      aGXYContext - The ILcdGXYContext that can be used to retrieve extra information.
      aPointSFCT - The point which will be updated to reflect the location of the anchor point.
      Throws:
      TLcdNoBoundsException - if the Object doesn't have any valid anchor point, e.g. if it is always invisible in the current projection.
      See Also:
    • supportLabelSnap

      public boolean supportLabelSnap(Graphics aGraphics, ILcdGXYContext aGXYContext)
      Description copied from interface: ILcdGXYLabelPainter2

      Returns whether this label painter supports snapping for the label specified by setObject, setLabelIndex and setSubLabelIndex, considering the given ILcdGXYContext instance. When the label painter supports snap for the specified label and context, it can return a snap target for this label and context.

      Before calling this method, the domain object, the label index, the sublabel index and the location of the label should be set using the respective methods.

      Specified by:
      supportLabelSnap in interface ILcdGXYLabelPainter2
      Parameters:
      aGraphics - the Graphics on which is worked.
      aGXYContext - the ILcdGXYContext of the snapping.
      Returns:
      true if this label painter supports snapping for the specified label.
      See Also:
    • labelSnapTarget

      public Object labelSnapTarget(Graphics aGraphics, ILcdGXYContext aGXYContext)
      Description copied from interface: ILcdGXYLabelPainter2
      Returns an Object that can be used as snapping target when graphically editing another Object or label than the one this ILcdGXYLabelPainter2 represents. The returned Object can be the Object this ILcdGXYLabelPainter2 represents or any other (e.g. an ILcdPoint if getObject() is an ILcdPointList).
      Specified by:
      labelSnapTarget in interface ILcdGXYLabelPainter2
      Parameters:
      aGraphics - the Graphics on which is worked.
      aGXYContext - the ILcdGXYContext of the snapping.
      Returns:
      an Object that can be used as snapping target when graphically editing another Object or label than the one this ILcdGXYLabelPainter2 represents (returned by getObject()). This object can be null.
    • getLabelCursor

      public Cursor getLabelCursor(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
      Description copied from interface: ILcdGXYLabelPainter2
      Returns a Cursor to indicate the type of editing aMode and aGXYContext.
      Specified by:
      getLabelCursor in interface ILcdGXYLabelPainter2
      Parameters:
      aGraphics - The Graphics instance on which the label is painted.
      aMode - The mode to consider. See ILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, ILcdGXYContext) for more information.
      aGXYContext - The ILcdGXYContext containing extra information, such as the layer, the view and the mouse position.
      Returns:
      a Cursor to indicate the type of editing aMode and aGXYContext. Returns null if no particular Cursor is required.
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface ILcdGXYLabelPainter2
      Returns:
      the display name of this ILcdGXYLabelPainter2