public class TLcdCollectedLabelInfo extends Object
TLcdLabelIdentifier
and a TLcdCollectedLabeledObjectInfo
object.
It can also be used to store custom information using getProperties()
. This information
is typically gathered in ILcdGXYLabelingAlgorithm.collectLabelInfo
.Modifier and Type | Field and Description |
---|---|
static 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 ). |
static String |
IS_PREVIOUS_PAINTED_KEY
This key is used to store if the label with this Object, label and sublabel index was
painted previously.
|
static String |
LABEL_ANCHOR_OFFSET_KEY
This key is used to store the label anchor offset of a label.
|
static String |
LABEL_DIMENSION_KEY
This key is used to store the dimension of a label that still needs to be placed.
|
static String |
LABEL_LOCATION_PROTOTYPE_KEY
This key is used to store a prototype
TLcdLabelLocation . |
static String |
PARENT_LABEL_IDENTIFIER_KEY
This key is used to store a reference to the parent label of this label.
|
static String |
PREVIOUS_LABEL_PLACEMENT_KEY
This key is used to store the previous label placement of this label.
|
static String |
PRIORITY_KEY
This key is used to store a priority.
|
Constructor and Description |
---|
TLcdCollectedLabelInfo(TLcdCollectedLabeledObjectInfo aLabeledObject,
int aLabelIndex,
int aSubLabelIndex)
Creates a new label info object for the given Object, label index and sublabel index.
|
Modifier and Type | Method and Description |
---|---|
Point |
getLabelAnchorOffset()
Returns the label anchor offset set in this label placement.
|
Dimension |
getLabelDimension()
Returns the label dimension set in this label placement.
|
TLcdCollectedLabeledObjectInfo |
getLabeledObject()
Returns the labeled object info object of this label.
|
TLcdLabelIdentifier |
getLabelIdentifier()
Returns the label identifier of this label.
|
TLcdLabelLocation |
getLabelLocationPrototype()
Returns the label location prototype set in this label info object.
|
TLcdLabelIdentifier |
getParentLabelIdentifier()
Returns the parent label set in this label info object.
|
TLcdLabelPlacement |
getPreviousLabelPlacement()
Returns the previous label placement set in this label info object.
|
Integer |
getPriority()
Returns the priority set in this label info object.
|
Map<String,Object> |
getProperties()
Returns a map that can be used to store and retrieve info properties using a String key.
|
Boolean |
isInteractiveLabel()
Returns if this label is an interactive label.
|
Boolean |
isPreviousPainted()
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.
|
public static final String PREVIOUS_LABEL_PLACEMENT_KEY
TLcdLabelPlacement
that points to this TLcdCollectedLabelInfo
.public static final String IS_PREVIOUS_PAINTED_KEY
Boolean
.public static final String PRIORITY_KEY
Integer
.public static final String LABEL_LOCATION_PROTOTYPE_KEY
TLcdLabelLocation
. This object can be
used to create a valid label location for this label during labeling. the returned object
is a TLcdLabelLocation
.public static final String PARENT_LABEL_IDENTIFIER_KEY
TLcdLabelLocation.getParentLabel()
. The returned
object is a TLcdLabelIdentifier
.public static final String LABEL_DIMENSION_KEY
TLcdLabelLocation.getLocationIndex()
). The returned Object
is a Dimension
.public static final String LABEL_ANCHOR_OFFSET_KEY
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
.public static final String IS_INTERACTIVE_LABEL
TLcdGXYInteractiveLabelsController
). The returned
Object is a Boolean
.public TLcdCollectedLabelInfo(TLcdCollectedLabeledObjectInfo aLabeledObject, int aLabelIndex, int aSubLabelIndex)
aLabeledObject
- the labeled object.aLabelIndex
- the label index.aSubLabelIndex
- the sublabel index.public Map<String,Object> getProperties()
public TLcdCollectedLabeledObjectInfo getLabeledObject()
public TLcdLabelIdentifier getLabelIdentifier()
public TLcdLabelPlacement getPreviousLabelPlacement()
This method is a convenience method. It uses getProperties()
internally with
PREVIOUS_LABEL_PLACEMENT_KEY
as key.
null
if it
does not exist.public void setPreviousLabelPlacement(TLcdLabelPlacement aPreviousLabelPlacement)
This method is a convenience method. It uses getProperties()
internally with
PREVIOUS_LABEL_PLACEMENT_KEY
as key.
aPreviousLabelPlacement
- the previous placement of this label.public Boolean isPreviousPainted()
This method is a convenience method. It uses getProperties()
internally with
IS_PREVIOUS_PAINTED_KEY
as key.
Boolean.TRUE
if the label was previously painted,
and Boolean.FALSE
otherwise.public void setPreviousPainted(Boolean aWasPainted)
This method is a convenience method. It uses getProperties()
internally with
IS_PREVIOUS_PAINTED_KEY
as key.
aWasPainted
- true
if this label was previously painted, and false
otherwise.public Integer getPriority()
This method is a convenience method. It uses getProperties()
internally with
PRIORITY_KEY
as key.
null
if it
does not exist.public void setPriority(Integer aPriority)
This method is a convenience method. It uses getProperties()
internally with
PRIORITY_KEY
as key.
aPriority
- the priority of this label.public TLcdLabelLocation getLabelLocationPrototype()
This method is a convenience method. It uses getProperties()
internally with
LABEL_LOCATION_PROTOTYPE_KEY
as key.
null
if it
does not exist.public void setLabelLocationPrototype(TLcdLabelLocation aLabelLocationPrototype)
This method is a convenience method. It uses getProperties()
internally with
LABEL_LOCATION_PROTOTYPE_KEY
as key.
aLabelLocationPrototype
- the label location prototype of this label.public TLcdLabelIdentifier getParentLabelIdentifier()
This method is a convenience method. It uses getProperties()
internally with
PARENT_LABEL_IDENTIFIER_KEY
as key.
null
if it
does not exist, or if the label has no parent.public void setParentLabelIdentifier(TLcdLabelIdentifier aParentLabelIdentifier)
This method is a convenience method. It uses getProperties()
internally with
PARENT_LABEL_IDENTIFIER_KEY
as key.
aParentLabelIdentifier
- the parent label of this label.public Dimension getLabelDimension()
This method is a convenience method. It uses getProperties()
internally with
LABEL_DIMENSION_KEY
as key.
null
if it
does not exist.public void setLabelDimension(Dimension aLabelDimension)
This method is a convenience method. It uses getProperties()
internally with
LABEL_DIMENSION_KEY
as key.
aLabelDimension
- the label dimension in this label placement.public Point getLabelAnchorOffset()
This method is a convenience method. It uses getProperties()
internally with
LABEL_ANCHOR_OFFSET_KEY
as key.
null
if it does not exist.public void setLabelAnchorOffset(Point aLabelAnchorOffset)
This method is a convenience method. It uses getProperties()
internally with
LABEL_ANCHOR_OFFSET_KEY
as key.
aLabelAnchorOffset
- the label anchor offset of this label placement.public Boolean isInteractiveLabel()
This method is a convenience method. It uses getProperties()
internally with
IS_INTERACTIVE_LABEL
as key.
true
if this label is an interactive label and false
otherwise.public void setInteractiveLabel(Boolean aIsInteractiveLabel)
This method is a convenience method. It uses getProperties()
internally with
IS_INTERACTIVE_LABEL
as key.
aIsInteractiveLabel
- true
to mark this label as interactive label and
false
otherwise.