Class TLcdCollectedLabelInfo
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThis key is used to store if the label with this Object, label and sublabel index is an interactive label (seeTLcdGXYInteractiveLabelsController).static final StringThis key is used to store if the label with this Object, label and sublabel index was painted previously.static final StringThis key is used to store the label anchor offset of a label.static final StringThis key is used to store the dimension of a label that still needs to be placed.static final StringThis key is used to store a prototypeTLcdLabelLocation.static final StringThis key is used to store a reference to the parent label of this label.static final StringThis key is used to store the previous label placement of this label.static final StringThis key is used to store a priority. -
Constructor Summary
ConstructorsConstructorDescriptionTLcdCollectedLabelInfo(TLcdCollectedLabeledObjectInfo aLabeledObject, int aLabelIndex, int aSubLabelIndex) Creates a new label info object for the given Object, label index and sublabel index. -
Method Summary
Modifier and TypeMethodDescriptionReturns the label anchor offset set in this label placement.Returns the label dimension set in this label placement.Returns the labeled object info object of this label.Returns the label identifier of this label.Returns the label location prototype set in this label info object.Returns the parent label set in this label info object.Returns the previous label placement set in this label info object.Returns the priority set in this label info object.Returns a map that can be used to store and retrieve info properties using a String key.Returns if this label is an interactive label.Checks if the label was previously painted.voidsetInteractiveLabel(Boolean aIsInteractiveLabel) Sets if this label is an interactive label.voidsetLabelAnchorOffset(Point aLabelAnchorOffset) Sets the label anchor offset of this label placement.voidsetLabelDimension(Dimension aLabelDimension) Sets the label dimension in this label placement.voidsetLabelLocationPrototype(TLcdLabelLocation aLabelLocationPrototype) Sets the label location prototype of this label.voidsetParentLabelIdentifier(TLcdLabelIdentifier aParentLabelIdentifier) Sets the parent label of this label.voidsetPreviousLabelPlacement(TLcdLabelPlacement aPreviousLabelPlacement) Sets the previous placement of this label.voidsetPreviousPainted(Boolean aWasPainted) Sets if this label was previously painted.voidsetPriority(Integer aPriority) Sets the priority of this label.
-
Field Details
-
PREVIOUS_LABEL_PLACEMENT_KEY
This key is used to store the previous label placement of this label. The returned Object is aTLcdLabelPlacementthat points to thisTLcdCollectedLabelInfo.- See Also:
-
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 aBoolean.- See Also:
-
PRIORITY_KEY
This key is used to store a priority. The returned object is anInteger.- See Also:
-
LABEL_LOCATION_PROTOTYPE_KEY
This key is used to store a prototypeTLcdLabelLocation. This object can be used to create a valid label location for this label during labeling. the returned object is aTLcdLabelLocation.- See Also:
-
PARENT_LABEL_IDENTIFIER_KEY
This key is used to store a reference to the parent label of this label. This parent is retrieved fromTLcdLabelLocation.getParentLabel(). The returned object is aTLcdLabelIdentifier.- See Also:
-
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 (seeTLcdLabelLocation.getLocationIndex()). The returned Object is aDimension.- See Also:
-
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 (seeTLcdLabelLocation.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 aPoint.- See Also:
-
IS_INTERACTIVE_LABEL
This key is used to store if the label with this Object, label and sublabel index is an interactive label (seeTLcdGXYInteractiveLabelsController). The returned Object is aBoolean.- 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
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
Returns the labeled object info object of this label.- Returns:
- the labeled object info object of this label.
-
getLabelIdentifier
Returns the label identifier of this label.- Returns:
- the label identifier of this label.
-
getPreviousLabelPlacement
Returns the previous label placement set in this label info object.This method is a convenience method. It uses
getProperties()internally withPREVIOUS_LABEL_PLACEMENT_KEYas key.- Returns:
- the previous label placement set in this label info object, or
nullif it does not exist.
-
setPreviousLabelPlacement
Sets the previous placement of this label.This method is a convenience method. It uses
getProperties()internally withPREVIOUS_LABEL_PLACEMENT_KEYas key.- Parameters:
aPreviousLabelPlacement- the previous placement of this label.
-
isPreviousPainted
Checks if the label was previously painted.This method is a convenience method. It uses
getProperties()internally withIS_PREVIOUS_PAINTED_KEYas key.- Returns:
Boolean.TRUEif the label was previously painted, andBoolean.FALSEotherwise.
-
setPreviousPainted
Sets if this label was previously painted.This method is a convenience method. It uses
getProperties()internally withIS_PREVIOUS_PAINTED_KEYas key.- Parameters:
aWasPainted-trueif this label was previously painted, andfalseotherwise.
-
getPriority
Returns the priority set in this label info object.This method is a convenience method. It uses
getProperties()internally withPRIORITY_KEYas key.- Returns:
- the priority set in this label info object, or
nullif it does not exist.
-
setPriority
Sets the priority of this label.This method is a convenience method. It uses
getProperties()internally withPRIORITY_KEYas key.- Parameters:
aPriority- the priority of this label.
-
getLabelLocationPrototype
Returns the label location prototype set in this label info object.This method is a convenience method. It uses
getProperties()internally withLABEL_LOCATION_PROTOTYPE_KEYas key.- Returns:
- the label location prototype set in this label info object, or
nullif it does not exist.
-
setLabelLocationPrototype
Sets the label location prototype of this label.This method is a convenience method. It uses
getProperties()internally withLABEL_LOCATION_PROTOTYPE_KEYas key.- Parameters:
aLabelLocationPrototype- the label location prototype of this label.
-
getParentLabelIdentifier
Returns the parent label set in this label info object.This method is a convenience method. It uses
getProperties()internally withPARENT_LABEL_IDENTIFIER_KEYas key.- Returns:
- the parent label set in this label info object, or
nullif it does not exist, or if the label has no parent.
-
setParentLabelIdentifier
Sets the parent label of this label.This method is a convenience method. It uses
getProperties()internally withPARENT_LABEL_IDENTIFIER_KEYas key.- Parameters:
aParentLabelIdentifier- the parent label of this label.
-
getLabelDimension
Returns the label dimension set in this label placement.This method is a convenience method. It uses
getProperties()internally withLABEL_DIMENSION_KEYas key.- Returns:
- the label size set in this label placement, or
nullif it does not exist.
-
setLabelDimension
Sets the label dimension in this label placement.This method is a convenience method. It uses
getProperties()internally withLABEL_DIMENSION_KEYas key.- Parameters:
aLabelDimension- the label dimension in this label placement.
-
getLabelAnchorOffset
Returns the label anchor offset set in this label placement.This method is a convenience method. It uses
getProperties()internally withLABEL_ANCHOR_OFFSET_KEYas key.- Returns:
- the label anchor offset set in this label placement, or
nullif it does not exist.
-
setLabelAnchorOffset
Sets the label anchor offset of this label placement.This method is a convenience method. It uses
getProperties()internally withLABEL_ANCHOR_OFFSET_KEYas key.- Parameters:
aLabelAnchorOffset- the label anchor offset of this label placement.
-
isInteractiveLabel
Returns if this label is an interactive label.This method is a convenience method. It uses
getProperties()internally withIS_INTERACTIVE_LABELas key.- Returns:
trueif this label is an interactive label andfalseotherwise.
-
setInteractiveLabel
Sets if this label is an interactive label.This method is a convenience method. It uses
getProperties()internally withIS_INTERACTIVE_LABELas key.- Parameters:
aIsInteractiveLabel-trueto mark this label as interactive label andfalseotherwise.
-