public class LabelCandidateDescriptor extends Object implements ILabelCandidateDescriptor
ILabelCandidateDescriptor
interface.
All properties are read/write in this implementation.
Modifier and Type | Field and Description |
---|---|
static ILabelCandidateDescriptor |
EXTERNAL_DESCRIPTOR
A sharable immutable implementation of the
ILabelCandidateDescriptor interface that has penalties of 1.0d
and a profit of 1.0d and yields true for the ExternalCandidate
property. |
static ILabelCandidateDescriptor |
INTERNAL_DESCRIPTOR
A sharable immutable implementation of the
ILabelCandidateDescriptor interface that has penalties of 1.0d
and a profit of 1.0d and yields false for the ExternalCandidate
property. |
Constructor and Description |
---|
LabelCandidateDescriptor() |
Modifier and Type | Method and Description |
---|---|
double |
getEdgeOverlapPenalty()
Gets a penalty value that is used by labeling algorithms to judge the severity if this candidate overlaps with an edge
path.
|
double |
getNodeOverlapPenalty()
Gets a penalty value that is used by labeling algorithms to judge the severity if this label candidate overlaps with a
node's bounds.
|
double |
getProfit()
Gets a profit value that is used by labeling algorithms to judge how good this label candidate is.
|
boolean |
isExternalCandidate()
Gets a value indicating whether this candidate is deemed an external candidate.
|
void |
setEdgeOverlapPenalty(double value)
Sets a penalty value that is used by labeling algorithms to judge the severity if this candidate overlaps with an edge
path.
|
void |
setExternalCandidate(boolean value)
Sets a value indicating whether this candidate is deemed an external candidate.
|
void |
setNodeOverlapPenalty(double value)
Sets a penalty value that is used by labeling algorithms to judge the severity if this label candidate overlaps with a
node's bounds.
|
void |
setProfit(double value)
Sets a profit value that is used by labeling algorithms to judge how good this label candidate is.
|
public static final ILabelCandidateDescriptor EXTERNAL_DESCRIPTOR
ILabelCandidateDescriptor
interface that has penalties of 1.0d
and a profit of 1.0d
and yields true
for the ExternalCandidate
property.public static final ILabelCandidateDescriptor INTERNAL_DESCRIPTOR
ILabelCandidateDescriptor
interface that has penalties of 1.0d
and a profit of 1.0d
and yields false
for the ExternalCandidate
property.public final double getEdgeOverlapPenalty()
ILabelCandidateDescriptor
This value must be between 0 and 1 (inclusive). A value of 0 means that an overlap is considered not important, while a value of 1 means that an overlap is considered severe.
getEdgeOverlapPenalty
in interface ILabelCandidateDescriptor
public final double getNodeOverlapPenalty()
ILabelCandidateDescriptor
This value must be between 0 and 1 (inclusive). A value of 0 means that an overlap is considered not important, while a value of 1 means that an overlap is considered severe.
getNodeOverlapPenalty
in interface ILabelCandidateDescriptor
public final double getProfit()
ILabelCandidateDescriptor
This value must be between 0 and 1 (inclusive). Higher profit means better candidates. Hence, there is a higher probability that the candidate is chosen by a labeling algorithm.
getProfit
in interface ILabelCandidateDescriptor
public final boolean isExternalCandidate()
ILabelCandidateDescriptor
This is mainly for INode
labels that are a visual part of the node's internals. It could
be used for edge labels, too, if the edge occupies significant amounts of visual space.
isExternalCandidate
in interface ILabelCandidateDescriptor
true
if this describes an external candidate; false
otherwise.public final void setEdgeOverlapPenalty(double value)
This value must be between 0 and 1 (inclusive). A value of 0 means that an overlap is considered not important, while a value of 1 means that an overlap is considered severe.
value
- The edge overlap penalty.getEdgeOverlapPenalty()
public final void setExternalCandidate(boolean value)
This is mainly for INode
labels that are a visual part of the node's internals. It could
be used for edge labels, too, if the edge occupies significant amounts of visual space.
value
- true
if this describes an external candidate; false
otherwise.isExternalCandidate()
public final void setNodeOverlapPenalty(double value)
This value must be between 0 and 1 (inclusive). A value of 0 means that an overlap is considered not important, while a value of 1 means that an overlap is considered severe.
value
- The node overlap penalty.getNodeOverlapPenalty()
public final void setProfit(double value)
This value must be between 0 and 1 (inclusive). Higher profit means better candidates. Hence, there is a higher probability that the candidate is chosen by a labeling algorithm.
value
- The profit to be used by labeling algorithms.getProfit()