|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.layout.LabelLayoutData
This class encapsulates layout data for a label. The data is used
by clients to inform label aware layouters about labeling constraints like label size and
preferred placement. Label aware layouters like HierarchicLayouter
on the other hand return the calculated label positions by assigning the
corresponding bounds to the passed in label layout data.
Data providers are being used to associate an array of LabelLayoutData with either
the nodes or the edges of a layout graph. The dataproviders must be registered with the
input graph by using one of the keys defined in LabelLayoutKeys
.
Field Summary |
Fields inherited from interface y.layout.LabelLayoutConstants |
PLACE_ANYWHERE, PLACE_AT_CENTER, PLACE_AT_SOURCE, PLACE_AT_TARGET, PLACE_LEFT_OF_EDGE, PLACE_ON_EDGE, PLACE_RIGHT_OF_EDGE, PLACEMENT_ALONG_EDGE_MASK, PLACEMENT_ON_SIDE_OF_EDGE_MASK |
Fields inherited from interface y.layout.LabelLayoutKeys |
EDGE_LABEL_LAYOUT_KEY |
Constructor Summary | |
LabelLayoutData(double width,
double height)
Creates a new instance of LabelLayoutData. |
|
LabelLayoutData(double width,
double height,
byte preferredPlacement)
Creates a new instance of LabelLayoutData. |
Method Summary | |
YRectangle |
getBounds()
Retruns the bounds of the label. |
double |
getHeight()
Returns the height of the label. |
byte |
getPreferredPlacement()
Returns the preferred placement for this label. |
double |
getWidth()
Returns the width of the label. |
double |
getX()
Returns the x-coordinate of the upper-left label location. |
double |
getY()
Returns the y-coordinate of the upper-left label location. |
void |
setBounds(YRectangle bounds)
Sets the bounds of the label. |
void |
setLocation(double x,
double y)
Sets the coordinate of the upper left corner of the label. |
void |
setPreferredPlacement(byte placement)
Sets the preferred placement for this label. |
void |
setSize(double width,
double height)
Sets the size of the label. |
String |
toString()
Returns a string representation of this object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LabelLayoutData(double width, double height)
LabelLayoutConstants.PLACE_ANYWHERE
is used
as preferred placement specifier.
width
- the width of the labelheight
- the height of the labelpublic LabelLayoutData(double width, double height, byte preferredPlacement)
width
- the width of the labelheight
- the height of the labelpreferredPlacement
- a preferred placement specifierLabelLayoutConstants
,
LabelLayoutData.setPreferredPlacement(byte)
Method Detail |
public void setBounds(YRectangle bounds)
public YRectangle getBounds()
public void setSize(double width, double height)
public double getWidth()
public double getHeight()
public void setLocation(double x, double y)
public double getX()
public double getY()
public void setPreferredPlacement(byte placement)
placement
- one of LabelLayoutConstants.PLACE_ANYWHERE
, LabelLayoutConstants.PLACE_AT_SOURCE
,
LabelLayoutConstants.PLACE_AT_TARGET
or LabelLayoutConstants.PLACE_AT_CENTER
.LabelLayoutConstants
public byte getPreferredPlacement()
LabelLayoutConstants.PLACE_ANYWHERE
, LabelLayoutConstants.PLACE_AT_SOURCE
,
LabelLayoutConstants.PLACE_AT_TARGET
or LabelLayoutConstants.PLACE_AT_CENTER
.LabelLayoutConstants
public String toString()
toString
in class Object
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |