|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.LabelCandidate
public class LabelCandidate
Base class for candidate positions for labels.
Constructor Summary | |
---|---|
LabelCandidate(OrientedRectangle labelBox,
Object param,
LabelLayout owner)
Returns a new instance of LabelCandidate. |
|
LabelCandidate(OrientedRectangle labelBox,
Object param,
LabelLayout owner,
boolean internal)
Returns a new instance of LabelCandidate. |
|
LabelCandidate(YPoint pos,
YDimension size,
Object param,
LabelLayout owner)
Returns a new instance of LabelCandidate. |
|
LabelCandidate(YPoint pos,
YDimension size,
Object param,
LabelLayout owner,
boolean internal)
Returns a new instance of LabelCandidate. |
Method Summary | |
---|---|
YRectangle |
getBoundingBox()
Returns the bounding box of this label candidate. |
OrientedRectangle |
getBox()
Returns the real bounds of this label candidate. |
double |
getCustomProfit()
Returns the custom profit for this label candidate. |
double |
getEdgeOverlapPenalty()
Returns the penalty value for a candidate position that overlaps the path of an edge. |
double |
getHeight()
Returns the height of the label candidate bounds. |
YPoint |
getLocation()
Returns the upper left corner of the label candidate bounds. |
Object |
getModelParameter()
Returns the model parameter that was used by the underlying model to generate this label candidate. |
double |
getNodeOverlapPenalty()
Returns the penalty for a candidate position that overlaps the bounds of a node. |
double |
getOverlapPenalty()
Returns the sum of node overlap penalty and edge overlap penalty. |
LabelLayout |
getOwner()
Returns the LabelLayout to which this candidate box belongs. |
Object |
getParameter()
Returns the model parameter that was used by the underlying model to generate this label candidate. |
YDimension |
getSize()
Returns the width and height of the label candidate bounds. |
double |
getWidth()
Returns the width of the label candidate bounds. |
double |
getX()
Returns the minimal x-coordinate of the label candidate bounds. |
double |
getY()
Returns the minimal y-coordinate of the label candidate bounds. |
boolean |
isInternal()
Returns whether this candidate is an internal node label, i.e. an label which resides inside the boundaries of a node. |
boolean |
isPropagated()
Returns if this box had been chosen by the labeling algorithm. |
void |
propagate()
Sets the model parameters of the owner of this label candidate to the model parameters of this candidate box. |
void |
setCustomProfit(double customProfit)
Specifies the custom profit for this label candidate. |
void |
setEdgeOverlapPenalty(double pen)
Sets the penalty value for a candidate position that overlaps the path of an edge. |
void |
setNodeOverlapPenalty(double pen)
Sets the penalty for a candidate position that overlaps the bounds of a node. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LabelCandidate(YPoint pos, YDimension size, Object param, LabelLayout owner)
pos
- the location of the upper
left corner of the candidate.size
- the size of the candidate.param
- the parameters of the labeling model
associated with this candidate.owner
- the label associated to the candidate.public LabelCandidate(YPoint pos, YDimension size, Object param, LabelLayout owner, boolean internal)
pos
- the location of the upper
left corner of the candidate.size
- the size of the candidate.param
- the parameters of the labeling model
with this candidate.owner
- the label associated to the candidate.internal
- flag whether the candidate is
allowed to overlap its own feature.public LabelCandidate(OrientedRectangle labelBox, Object param, LabelLayout owner, boolean internal)
labelBox
- the box that specifies the candidate's size and position.param
- the parameters of the labeling model
with this candidate.owner
- the label associated to the candidate.internal
- flag whether the candidate is
allowed to overlap its own feature.public LabelCandidate(OrientedRectangle labelBox, Object param, LabelLayout owner)
labelBox
- the box that specifies the candidate's size and position.param
- the parameters of the labeling model
with this candidate.owner
- the label associated to the candidate.Method Detail |
---|
public double getCustomProfit()
MISLabelingAlgorithm.setOptimizationStrategy(byte)
).
setCustomProfit(double)
public void setCustomProfit(double customProfit)
MISLabelingAlgorithm.setOptimizationStrategy(byte)
).
IllegalArgumentException
- if the value lies not in the interval [0,1].customProfit
- the custom profit for this label candidate.public Object getModelParameter()
public YPoint getLocation()
public YDimension getSize()
public double getX()
public double getY()
public double getWidth()
public double getHeight()
public YRectangle getBoundingBox()
getBoundingBox
in interface PlaneObject
public OrientedRectangle getBox()
public LabelLayout getOwner()
public boolean isInternal()
public void propagate()
public void setNodeOverlapPenalty(double pen)
public void setEdgeOverlapPenalty(double pen)
public double getNodeOverlapPenalty()
public double getEdgeOverlapPenalty()
public double getOverlapPenalty()
getEdgeOverlapPenalty()
,
getNodeOverlapPenalty()
public Object getParameter()
public boolean isPropagated()
public String toString()
toString
in class Object
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |