y.layout
Class LabelCandidate

java.lang.Object
  |
  +--y.layout.LabelCandidate
All Implemented Interfaces:
PlaneObject
Direct Known Subclasses:
EdgeLabelCandidate, NodeLabelCandidate

public class LabelCandidate
extends Object
implements PlaneObject

Base class for candidate positions for labels.


Constructor Summary
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.
 double getEdgeOverlapPenalty()
           
 double getHeight()
           
 YPoint getLocation()
           
 Object getModelParameter()
           
 double getNodeOverlapPenalty()
           
 double getOverlapPenalty()
           
 LabelLayout getOwner()
          Returns the LabelLayout to which this candidate box belongs.
 Object getParameter()
           
 YDimension getSize()
           
 double getWidth()
           
 double getX()
           
 double getY()
           
 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 choosen by the labeling algorithm.
 void propagate()
          Sets the model paramteres of the owner of this label candidate to the model parameters of this candidate box.
 void setEdgeOverlapPenalty(double pen)
           
 void setNodeOverlapPenalty(double pen)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LabelCandidate

public LabelCandidate(YPoint pos,
                      YDimension size,
                      Object param,
                      LabelLayout owner)
Returns a new instance of LabelCandidate.

Parameters:
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.

LabelCandidate

public LabelCandidate(YPoint pos,
                      YDimension size,
                      Object param,
                      LabelLayout owner,
                      boolean internal)
Returns a new instance of LabelCandidate.

Parameters:
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.
Method Detail

getModelParameter

public Object getModelParameter()

getLocation

public YPoint getLocation()

getSize

public YDimension getSize()

getX

public double getX()

getY

public double getY()

getWidth

public double getWidth()

getHeight

public double getHeight()

getBoundingBox

public YRectangle getBoundingBox()
Returns the bounding box of this label candidate.

Specified by:
getBoundingBox in interface PlaneObject

getOwner

public LabelLayout getOwner()
Returns the LabelLayout to which this candidate box belongs.


isInternal

public boolean isInternal()
Returns whether this candidate is an internal node label, i.e. an label which resides inside the boundaries of a node.


propagate

public void propagate()
Sets the model paramteres of the owner of this label candidate to the model parameters of this candidate box.


setNodeOverlapPenalty

public void setNodeOverlapPenalty(double pen)

setEdgeOverlapPenalty

public void setEdgeOverlapPenalty(double pen)

getNodeOverlapPenalty

public double getNodeOverlapPenalty()

getEdgeOverlapPenalty

public double getEdgeOverlapPenalty()

getOverlapPenalty

public double getOverlapPenalty()

getParameter

public Object getParameter()

isPropagated

public boolean isPropagated()
Returns if this box had been choosen by the labeling algorithm.


toString

public String toString()
Overrides:
toString in class Object

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003