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
Modifier and TypeFieldDescriptionstatic final String
This key is used to store if the label with this Object, label and sublabel index is an interactive label (seeTLcdGXYInteractiveLabelsController
).static final String
This key is used to store if the label with this Object, label and sublabel index was painted previously.static final String
This key is used to store the label anchor offset of a label.static final String
This key is used to store the dimension of a label that still needs to be placed.static final String
This key is used to store a prototypeTLcdLabelLocation
.static final String
This key is used to store a reference to the parent label of this label.static final String
This key is used to store the previous label placement of this label.static final String
This key is used to store a priority. -
Constructor Summary
ConstructorDescriptionTLcdCollectedLabelInfo
(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.void
setInteractiveLabel
(Boolean aIsInteractiveLabel) Sets if this label is an interactive label.void
setLabelAnchorOffset
(Point aLabelAnchorOffset) Sets the label anchor offset of this label placement.void
setLabelDimension
(Dimension aLabelDimension) Sets the label dimension in this label placement.void
setLabelLocationPrototype
(TLcdLabelLocation aLabelLocationPrototype) Sets the label location prototype of this label.void
setParentLabelIdentifier
(TLcdLabelIdentifier aParentLabelIdentifier) Sets the parent label of this label.void
setPreviousLabelPlacement
(TLcdLabelPlacement aPreviousLabelPlacement) Sets the previous placement of this label.void
setPreviousPainted
(Boolean aWasPainted) Sets if this label was previously painted.void
setPriority
(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 aTLcdLabelPlacement
that 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_KEY
as key.- Returns:
- the previous label placement set in this label info object, or
null
if 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_KEY
as 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_KEY
as key.- Returns:
Boolean.TRUE
if the label was previously painted, andBoolean.FALSE
otherwise.
-
setPreviousPainted
Sets if this label was previously painted.This method is a convenience method. It uses
getProperties()
internally withIS_PREVIOUS_PAINTED_KEY
as key.- Parameters:
aWasPainted
-true
if this label was previously painted, andfalse
otherwise.
-
getPriority
Returns the priority set in this label info object.This method is a convenience method. It uses
getProperties()
internally withPRIORITY_KEY
as key.- Returns:
- the priority set in this label info object, or
null
if it does not exist.
-
setPriority
Sets the priority of this label.This method is a convenience method. It uses
getProperties()
internally withPRIORITY_KEY
as 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_KEY
as key.- Returns:
- the label location prototype set in this label info object, or
null
if 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_KEY
as 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_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
Sets the parent label of this label.This method is a convenience method. It uses
getProperties()
internally withPARENT_LABEL_IDENTIFIER_KEY
as 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_KEY
as key.- Returns:
- the label size set in this label placement, or
null
if 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_KEY
as 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_KEY
as key.- Returns:
- the label anchor offset set in this label placement, or
null
if 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_KEY
as 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_LABEL
as key.- Returns:
true
if this label is an interactive label andfalse
otherwise.
-
setInteractiveLabel
Sets if this label is an interactive label.This method is a convenience method. It uses
getProperties()
internally withIS_INTERACTIVE_LABEL
as key.- Parameters:
aIsInteractiveLabel
-true
to mark this label as interactive label andfalse
otherwise.
-