Class ALspStampLabelLocationProvider

java.lang.Object
com.luciad.view.lightspeed.label.algorithm.ALspLabelLocationProvider
com.luciad.view.lightspeed.label.algorithm.ALspStampLabelLocationProvider
Direct Known Subclasses:
TLspLabelLocationProvider

public abstract class ALspStampLabelLocationProvider extends ALspLabelLocationProvider
This class provides methods to retrieve label locations based on stamp label location. It provides a method that can be used to easily calculate the label location. This abstract class will create a label placement based on these label locations.

Note: extensions should also override the following methods:

Since:
2012.0
  • Constructor Details

  • Method Details

    • getLocation

      public final TLspLabelPlacement getLocation(TLspLabelID aLabel, int aLocationIndex, ALspLabelLocations aCurrentLabelLocations, TLspPaintState aPaintState, ILspLabelingAlgorithm.LabelContext aLabelContext, ILspView aView)
      Description copied from class: ALspLabelLocationProvider
      This method returns a location for the given label using the given location index. Override this method to create custom locations for a label.
      Specified by:
      getLocation in class ALspLabelLocationProvider
      Parameters:
      aLabel - a label.
      aLocationIndex - the location index.
      aCurrentLabelLocations - an ALspLabelLocations object containing locations for the currently placed labels.
      aPaintState - the paint state
      aLabelContext - provides context information, such as priorities, PaintState, ...
      aView - the view.
      Returns:
      the label location for the given label and index, or null if no location could be calculated.
    • isValidLocation

      public final boolean isValidLocation(TLspLabelPlacement aLocation, ALspLabelLocations aCurrentLabelLocations, TLspPaintState aPaintState, ILspLabelingAlgorithm.LabelContext aLabelContext, ILspView aView)
      Checks if the given location is a valid location. This check should be used if this label location provider is capable of producing the given location. Labeling algorithms may use this method for previous label locations. I.e. when using a previous label locations, this method can be used to verify if the previous label location can be used.

      By default, this method returns true.

      This method calls isValidLocation.

      Overrides:
      isValidLocation in class ALspLabelLocationProvider
      Parameters:
      aLocation - the location to check.
      aCurrentLabelLocations - an ALspLabelLocations object containing locations for the currently placed labels.
      aPaintState - the paint state.
      aLabelContext - provides context information, such as priorities, PaintState, ...
      aView - the view.
      Returns:
      if the given location is a valid location.
    • calculateLocation

      public abstract double calculateLocation(int aLocationIndex, TLspLabelID aLabel, ILcdPoint aObjectAnchorPoint, Dimension2D aDimension, TLspContext aContext, ILcd3DEditablePoint aUpperLeftPointSFCT) throws TLcdNoBoundsException
      Returns the rotation and calculates the upper left corner of the bounds for the given domain object and sublabel ID, given the dimension.
      Parameters:
      aLocationIndex - the location index, can be a number from 0 to getMaxLocationCount.
      aLabel - the label for which a location should be calculated.
      aObjectAnchorPoint - the object anchor point for the given label, in view coordinates.
      aDimension - the dimension of the label.
      aContext - the context.
      aUpperLeftPointSFCT - the point in which the upper left corner of the label bounds should be stored. The upper left corner of the label should be specified in view coordinates.
      Returns:
      the rotation of the label in radians, clockwise, 0 radians at 3 o'clock. The rotation is relative to the view rotation.
      Throws:
      TLcdNoBoundsException - when the rotation or upper left corner could not be calculated.
    • isValidLocation

      protected boolean isValidLocation(TLspLabelID aLabelID, ILcdPoint aObjectAnchorPoint, Dimension2D aDimension, TLspContext aContext, ILcdPoint aUpperLeftPoint, double aRotation)
      Checks if the given upper left point and rotation are valid. This check should be used if the calculateLocation method is capable of producing the given point and rotation. Labeling algorithms may use this method for previous label locations. I.e. when using a previous label locations, this method can be used to verify if the previous label location can be used.

      By default, this method returns true.

      Parameters:
      aLabelID - the label
      aObjectAnchorPoint - the object anchor point for the given label, in view coordinates.
      aDimension - the dimension of the label.
      aContext - the context.
      aUpperLeftPoint - the upper left corner of the label
      aRotation - the rotation
      Returns:
      if the given upper left point and rotation are valid.
    • equals

      public boolean equals(Object aObject)
      An object is considered equal to this shape if it has the same class. Extensions should refine this comparison, based on their properties.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      The hash code of this shape is the hash code of its class, in order to be consistent with the equals(Object) method. Extensions should refine this implementation, based on their properties.
      Overrides:
      hashCode in class Object