Interface ILspLabelPainter

All Superinterfaces:
ILspPainter, ILspPaintGroupsChangeListener
All Known Subinterfaces:
ILspPathLocationLabelPainter, ILspStampLocationLabelPainter
All Known Implementing Classes:
TLspLabelPainter

public interface ILspLabelPainter extends ILspPainter
This ILspPainter paints and locates a label for an object in a view. Labels can be any visual item that is drawn in view space rather than world space. The labelAnchorPointSFCT and labelBoundsSFCT methods give an indication of where the visual representation of an object will be painted. These methods return information in view coordinates.
Since:
2012.0
See Also:
  • Method Details

    • getLabelIDs

      Iterable<TLspLabelID> getLabelIDs(Object aObject, TLspPaintRepresentationState aPaintRepresentationState, TLspContext aContext)
      Enumerates all the desired labels associated with a domain object.
      Parameters:
      aObject - the domain object
      aPaintRepresentationState - the paint representation
      aContext - the context
      Returns:
      the label identifiers associated with the given domain object.
    • labelBoundsSFCT

      double labelBoundsSFCT(TLspLabelID aLabel, ALspLabelLocation aLabelLocation, ALspLabelLocations aLocations, TLspPaintState aPaintState, TLspContext aContext, ILcd3DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException

      Calculates the bounds of the given label for the given label location.

      This method returns the axis aligned bounds using aBoundsSFCT and returns a rotation. This rotation rotates the bounds around its origin. The rotation of the bounds is defined in radians, clockwise, with 0 at 3 'o clock.

      It is possible that the bounds of this label depends on the location of an other label. In that case, it is possible to use the given view locations to retrieve an other location. Note that the given ALspLabelLocations should not be modified in this method.

      Parameters:
      aLabel - the label for which to calculate the bounds.
      aLabelLocation - the location of the label.
      aLocations - possible context information. This object can for example be used when these bounds depend on bounds of an other label.
      aPaintState - the paint state.
      aContext - the context.
      aBoundsSFCT - the object in which to store the axis aligned bounds.
      Returns:
      the rotation of the bounds in radians, clockwise, with 0 at 3 'o clock.
      Throws:
      TLcdNoBoundsException - when the bounds could not be calculated.
    • labelAnchorPointSFCT

      void labelAnchorPointSFCT(TLspLabelID aLabel, ALspLabelLocation aLabelLocation, ALspLabelLocations aLabelLocations, TLspPaintState aPaintState, TLspContext aContext, ILcd3DEditablePoint aAnchorPointSFCT) throws TLcdNoBoundsException
      Retrieves the anchor point of the given label. This point is usually a point on the label, e.g. in the middle of the bounds.
      Parameters:
      aLabel - the label for which to calculate the bounds.
      aLabelLocation - the location of the label.
      aLabelLocations - possible context information. This object can for example be used when these bounds depend on bounds of an other label.
      aPaintState - the paint state.
      aContext - the context.
      aAnchorPointSFCT - the point in which to store the anchor point.
      Throws:
      TLcdNoBoundsException - when the anchor point could not be calculated.
    • getAnchorObject

      Object getAnchorObject(TLspLabelID aLabel, TLspPaintState aPaintState, TLspContext aContext) throws TLcdNoBoundsException
      Returns the anchor object of the given label. This can either be an other TLspLabelID, an ILcdShape, and ALspStyleTargetProvider or null. In the latter case, the painter interprets the anchor itself, i.e. by using the focus point of the domain object. In the latter case, the domain object must be an ILcdShape or it must have a shape.

      The various labeling algorithms use this anchor object to determine the label's location.

      You can specify this anchor object using a ALspLabelStyler:

      Parameters:
      aLabel - the label.
      aPaintState - the paint state.
      aContext - the context.
      Returns:
      the anchor object of the given label.
      Throws:
      TLcdNoBoundsException - if there is no anchor object for the given label.