Interface ILcdGXYLabelPainter

All Superinterfaces:
Cloneable, Serializable
All Known Subinterfaces:
ILcdGXYLabelPainter2, ILcdGXYMultiLabelPainter
All Known Implementing Classes:
ALcdGXYLabelPainter, ALcdSLDFeatureTypeStylePainter, ALcdSLDRulePainter, TLcdAIXM51AirspaceLabelPainter, TLcdAIXM51NavaidLabelPainter, TLcdAIXM51XPathLabelPainter, TLcdGXYCompositeLabelPainter, TLcdGXYCurvedPathLabelPainter, TLcdGXYDataObjectLabelPainter, TLcdGXYDataObjectPolygonLabelPainter, TLcdGXYDataObjectPolylineLabelPainter, TLcdGXYEditableLabelPainter, TLcdGXYFeaturedLabelPainter, TLcdGXYFeaturedPolygonLabelPainter, TLcdGXYFeaturedPolylineLabelPainter, TLcdGXYHaloLabelPainter, TLcdGXYHaloLabelPainter2, TLcdGXYLabelPainter, TLcdGXYLabelPainterAdapter, TLcdGXYMultiFontLabelPainter, TLcdGXYOffsetIconPainter, TLcdGXYOutlinePolylineLabelPainter, TLcdGXYPolygonLabelPainter, TLcdGXYPolygonStampLabelPainter, TLcdGXYPolylineLabelPainter, TLcdGXYPolylineStampLabelPainter, TLcdGXYProcedureTrajectoryLegLabelPainter, TLcdGXYStampLabelPainter, TLcdICAOAirspaceDetailedLabelPainter, TLcdICAOAirspaceLabelPainter, TLcdICAOAreaMinimumAltitudeLabelPainter, TLcdICAODMELabelPainter, TLcdICAONavaidLabelPainter, TLcdICAONDBLabelPainter, TLcdICAOTACANLabelPainter, TLcdICAOVORLabelPainter, TLcdMagneticNorthGXYLabelPainter, TLcdSLDFeatureTypeStylePainter, TLcdSLDRulePainter, TLcdUTMZonePainter

public interface ILcdGXYLabelPainter extends Serializable, Cloneable
A label painter allows to paint and query the view bounds of a domain object's label representation. It provides a number of possible locations for the label.

Usage

This interface requires to set an object and a location before the paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext) and labelBoundsSFCT(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext, java.awt.Rectangle) methods can be used.

Note that, if you implement this interface, it is recommended to also implement ILcdGXYLabelPainter2.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The default label representation of an Object.
    static final int
    The label representation of an Object when it is selected.
  • Method Summary

    Modifier and Type
    Method
    Description
    Redefines Object.clone to make it public.
    int
    Gets the index of location where to paint the label(s) of the set Object.
    Gets the Object this ILcdGXYLabelPainter can label.
    int
    Returns the number of possible locations where this ILcdGXYLabelPainter can paint/draw the labels of the set domain Object.
    double
    labelBoundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Rectangle aRectangleSFCT)
    Calculates the bounds of the label that can be painted.
    void
    paintLabel(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
    Paints the label of the set Object on aGraphics.
    void
    setLocationIndex(int aLocationIndex)
    Sets the index of location where to paint the label(s) of the set Object.
    void
    setObject(Object aObject)
    Sets the Object to be labeled by this ILcdGXYLabelPainter.
  • Field Details

    • DEFAULT

      static final int DEFAULT
      The default label representation of an Object.
      See Also:
    • SELECTED

      static final int SELECTED
      The label representation of an Object when it is selected. This is typically painted on top of the default label representation of the same object.
      See Also:
  • Method Details

    • setObject

      void setObject(Object aObject)
      Sets the Object to be labeled by this ILcdGXYLabelPainter.
      Parameters:
      aObject - The object to be labeled.
      See Also:
    • getObject

      Object getObject()
      Gets the Object this ILcdGXYLabelPainter can label.
      Returns:
      the Object this ILcdGXYLabelPainter can label.
      See Also:
    • setLocationIndex

      void setLocationIndex(int aLocationIndex)
      Sets the index of location where to paint the label(s) of the set Object.
      Parameters:
      aLocationIndex - the index of the location. Must be between 0 and getPossibleLocationCount() - 1.
      See Also:
    • getLocationIndex

      int getLocationIndex()
      Gets the index of location where to paint the label(s) of the set Object.
      Returns:
      the index of the position. Must be between 0 and getPossibleLocationCount() - 1.
      See Also:
    • paintLabel

      void paintLabel(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)

      Paints the label of the set Object on aGraphics. aGXYContext should contain the ILcdGXYView for which the label is painted and ILcdGXYLayer to which the object belongs

      The implementation of this method shall define how to paint the label of the set Object in the given mode, considering aGXYContext and the possible locations aLocationIndex (of multiple alternatives).

      The domain Object of the label to be painted and the location index should be set before calling this method using the setObject and setLocationIndex methods respectively.

      Parameters:
      aGraphics - the Graphics instance on which to paint.
      aMode - a combination of ILcdGXYLabelPainter.DEFAULT and ILcdGXYLabelPainter.SELECTED.
      aGXYContext - the ILcdGXYContext in which the label painting has to be performed.
      See Also:
    • getPossibleLocationCount

      int getPossibleLocationCount(Graphics aGraphics)
      Returns the number of possible locations where this ILcdGXYLabelPainter can paint/draw the labels of the set domain Object.

      The domain Object for which the location count is retrieved should be set before calling this method using the setObject(java.lang.Object) method.

      Parameters:
      aGraphics - the Graphics the label will be painted on.
      Returns:
      the number of possible locations where this ILcdGXYLabelPainter can paint/draw the labels of the set Object.
      See Also:
    • labelBoundsSFCT

      double labelBoundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Rectangle aRectangleSFCT) throws TLcdNoBoundsException

      Calculates the bounds of the label that can be painted. The bounds are set as a side effect in aRectangleSFCT, the orientation of aRectangleSFCT is returned as an angle.

      The bounds represent the upper left point of the label, and a width and a height. The rotation value represents the rotation of the label bounds around the upper left point.

      The object for which the bounds are retrieved and the location index of the label should be set before calling this method using the setObject(java.lang.Object) and setLocationIndex(int) methods respectively.

      Parameters:
      aGraphics - the aGraphics to consider.
      aMode - the representation mode of the label.
      aGXYContext - the ILcdGXYContext the drawing depends on.
      aRectangleSFCT - the Rectangle containing the bounds of the label in view / graphics coordinates as side effect.
      Returns:
      the angle orientation of the rectangle around the labels in RADIANs, clockwise, 0 at 3 o'clock.
      Throws:
      TLcdNoBoundsException - if the Object doesn't have any valid bounds, e.g. if it is always invisible in the current projection.
      See Also:
    • clone

      Object clone()
      Redefines Object.clone to make it public.