Class TLcdCollectedLabelInfo

java.lang.Object
com.luciad.view.labeling.algorithm.TLcdCollectedLabelInfo

public class TLcdCollectedLabelInfo extends Object
This class contains all information about a label to be placed. A label is identified by a TLcdLabelIdentifier and a TLcdCollectedLabeledObjectInfo object. It can also be used to store custom information using getProperties(). This information is typically gathered in ILcdGXYLabelingAlgorithm.collectLabelInfo.
Since:
10.1
  • Field Details

    • PREVIOUS_LABEL_PLACEMENT_KEY

      public static final String PREVIOUS_LABEL_PLACEMENT_KEY
      This key is used to store the previous label placement of this label. The returned Object is a TLcdLabelPlacement that points to this TLcdCollectedLabelInfo.
      See Also:
    • IS_PREVIOUS_PAINTED_KEY

      public static final String IS_PREVIOUS_PAINTED_KEY
      This key is used to store if the label with this Object, label and sublabel index was painted previously. The returned Object is a Boolean.
      See Also:
    • PRIORITY_KEY

      public static final String PRIORITY_KEY
      This key is used to store a priority. The returned object is an Integer.
      See Also:
    • LABEL_LOCATION_PROTOTYPE_KEY

      public static final String LABEL_LOCATION_PROTOTYPE_KEY
      This key is used to store a prototype TLcdLabelLocation. This object can be used to create a valid label location for this label during labeling. the returned object is a TLcdLabelLocation.
      See Also:
    • PARENT_LABEL_IDENTIFIER_KEY

      public static final String PARENT_LABEL_IDENTIFIER_KEY
      This key is used to store a reference to the parent label of this label. This parent is retrieved from TLcdLabelLocation.getParentLabel(). The returned object is a TLcdLabelIdentifier.
      See Also:
    • LABEL_DIMENSION_KEY

      public static final String LABEL_DIMENSION_KEY
      This key is used to store the dimension of a label that still needs to be placed. It is typically used when a labeling algorithm uses free placement (see TLcdLabelLocation.getLocationIndex()). The returned Object is a Dimension.
      See Also:
    • LABEL_ANCHOR_OFFSET_KEY

      public static final String LABEL_ANCHOR_OFFSET_KEY
      This key is used to store the label anchor offset of a label. This label anchor offset is defined as the difference of the label anchor point and the upper left corner of the label. It is typically used when a labeling algorithm uses free placement (see TLcdLabelLocation.getLocationIndex()). The offset should be calculated for a label location with zero rotation. when using this value, the offset should be adjusted to the label rotation. The returned Object is a Point.
      See Also:
    • IS_INTERACTIVE_LABEL

      public static final String IS_INTERACTIVE_LABEL
      This key is used to store if the label with this Object, label and sublabel index is an interactive label (see TLcdGXYInteractiveLabelsController). The returned Object is a Boolean.
      See Also:
  • Constructor Details

    • TLcdCollectedLabelInfo

      public TLcdCollectedLabelInfo(TLcdCollectedLabeledObjectInfo aLabeledObject, int aLabelIndex, int aSubLabelIndex)
      Creates a new label info object for the given Object, label index and sublabel index.
      Parameters:
      aLabeledObject - the labeled object.
      aLabelIndex - the label index.
      aSubLabelIndex - the sublabel index.
  • Method Details

    • getProperties

      public Map<String,Object> getProperties()
      Returns a map that can be used to store and retrieve info properties using a String key.
      Returns:
      a map that can be used to store and retrieve info properties using a String key.
    • getLabeledObject

      public TLcdCollectedLabeledObjectInfo getLabeledObject()
      Returns the labeled object info object of this label.
      Returns:
      the labeled object info object of this label.
    • getLabelIdentifier

      public TLcdLabelIdentifier getLabelIdentifier()
      Returns the label identifier of this label.
      Returns:
      the label identifier of this label.
    • getPreviousLabelPlacement

      public TLcdLabelPlacement getPreviousLabelPlacement()
      Returns the previous label placement set in this label info object.

      This method is a convenience method. It uses getProperties() internally with PREVIOUS_LABEL_PLACEMENT_KEY as key.

      Returns:
      the previous label placement set in this label info object, or null if it does not exist.
    • setPreviousLabelPlacement

      public void setPreviousLabelPlacement(TLcdLabelPlacement aPreviousLabelPlacement)
      Sets the previous placement of this label.

      This method is a convenience method. It uses getProperties() internally with PREVIOUS_LABEL_PLACEMENT_KEY as key.

      Parameters:
      aPreviousLabelPlacement - the previous placement of this label.
    • isPreviousPainted

      public Boolean isPreviousPainted()
      Checks if the label was previously painted.

      This method is a convenience method. It uses getProperties() internally with IS_PREVIOUS_PAINTED_KEY as key.

      Returns:
      Boolean.TRUE if the label was previously painted, and Boolean.FALSE otherwise.
    • setPreviousPainted

      public void setPreviousPainted(Boolean aWasPainted)
      Sets if this label was previously painted.

      This method is a convenience method. It uses getProperties() internally with IS_PREVIOUS_PAINTED_KEY as key.

      Parameters:
      aWasPainted - trueif this label was previously painted, and false otherwise.
    • getPriority

      public Integer getPriority()
      Returns the priority set in this label info object.

      This method is a convenience method. It uses getProperties() internally with PRIORITY_KEY as key.

      Returns:
      the priority set in this label info object, or null if it does not exist.
    • setPriority

      public void setPriority(Integer aPriority)
      Sets the priority of this label.

      This method is a convenience method. It uses getProperties() internally with PRIORITY_KEY as key.

      Parameters:
      aPriority - the priority of this label.
    • getLabelLocationPrototype

      public TLcdLabelLocation getLabelLocationPrototype()
      Returns the label location prototype set in this label info object.

      This method is a convenience method. It uses getProperties() internally with LABEL_LOCATION_PROTOTYPE_KEY as key.

      Returns:
      the label location prototype set in this label info object, or null if it does not exist.
    • setLabelLocationPrototype

      public void setLabelLocationPrototype(TLcdLabelLocation aLabelLocationPrototype)
      Sets the label location prototype of this label.

      This method is a convenience method. It uses getProperties() internally with LABEL_LOCATION_PROTOTYPE_KEY as key.

      Parameters:
      aLabelLocationPrototype - the label location prototype of this label.
    • getParentLabelIdentifier

      public TLcdLabelIdentifier getParentLabelIdentifier()
      Returns the parent label set in this label info object.

      This method is a convenience method. It uses getProperties() internally with PARENT_LABEL_IDENTIFIER_KEY as key.

      Returns:
      the parent label set in this label info object, or null if it does not exist, or if the label has no parent.
    • setParentLabelIdentifier

      public void setParentLabelIdentifier(TLcdLabelIdentifier aParentLabelIdentifier)
      Sets the parent label of this label.

      This method is a convenience method. It uses getProperties() internally with PARENT_LABEL_IDENTIFIER_KEY as key.

      Parameters:
      aParentLabelIdentifier - the parent label of this label.
    • getLabelDimension

      public Dimension getLabelDimension()
      Returns the label dimension set in this label placement.

      This method is a convenience method. It uses getProperties() internally with LABEL_DIMENSION_KEY as key.

      Returns:
      the label size set in this label placement, or null if it does not exist.
    • setLabelDimension

      public void setLabelDimension(Dimension aLabelDimension)
      Sets the label dimension in this label placement.

      This method is a convenience method. It uses getProperties() internally with LABEL_DIMENSION_KEY as key.

      Parameters:
      aLabelDimension - the label dimension in this label placement.
    • getLabelAnchorOffset

      public Point getLabelAnchorOffset()
      Returns the label anchor offset set in this label placement.

      This method is a convenience method. It uses getProperties() internally with LABEL_ANCHOR_OFFSET_KEY as key.

      Returns:
      the label anchor offset set in this label placement, or null if it does not exist.
    • setLabelAnchorOffset

      public void setLabelAnchorOffset(Point aLabelAnchorOffset)
      Sets the label anchor offset of this label placement.

      This method is a convenience method. It uses getProperties() internally with LABEL_ANCHOR_OFFSET_KEY as key.

      Parameters:
      aLabelAnchorOffset - the label anchor offset of this label placement.
    • isInteractiveLabel

      public Boolean isInteractiveLabel()
      Returns if this label is an interactive label.

      This method is a convenience method. It uses getProperties() internally with IS_INTERACTIVE_LABEL as key.

      Returns:
      true if this label is an interactive label and false otherwise.
    • setInteractiveLabel

      public void setInteractiveLabel(Boolean aIsInteractiveLabel)
      Sets if this label is an interactive label.

      This method is a convenience method. It uses getProperties() internally with IS_INTERACTIVE_LABEL as key.

      Parameters:
      aIsInteractiveLabel - true to mark this label as interactive label and false otherwise.