|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.LabelLayoutData
public class 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.
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, NODE_LABEL_LAYOUT_KEY |
Constructor Summary | |
---|---|
LabelLayoutData(double width,
double height)
Creates a new instance of LabelLayoutData. |
|
LabelLayoutData(double width,
double height,
byte preferredPlacement)
Deprecated. |
|
LabelLayoutData(OrientedRectangle bounds)
Creates a new instance of LabelLayoutData. |
|
LabelLayoutData(OrientedRectangle bounds,
byte preferredPlacement)
Deprecated. |
|
LabelLayoutData(OrientedRectangle bounds,
PreferredPlacementDescriptor preferredPlacement)
Creates a new instance of LabelLayoutData. |
Method Summary | |
---|---|
OrientedRectangle |
getBounds()
Returns the oriented bounds of the label. |
double |
getHeight()
Returns the height of the label. |
byte |
getPreferredPlacement()
Deprecated. use getPreferredPlacementDescriptor() instead. |
PreferredPlacementDescriptor |
getPreferredPlacementDescriptor()
Returns the preferred placement for this label. |
double |
getWidth()
Returns the width of the label. |
double |
getX()
Returns the x-coordinate of the label's upper-left corner of the bounding box. |
double |
getY()
Returns the y-coordinate of the label's upper-left corner of the bounding box. |
void |
setBounds(OrientedRectangle bounds)
Sets the oriented bounds of the label. |
void |
setLocation(double x,
double y)
Sets the coordinates of the upper-left corner of the bounding box of the label. |
void |
setPreferredPlacement(byte placement)
Deprecated. use setPreferredPlacementDescriptor(PreferredPlacementDescriptor) instead. |
void |
setPreferredPlacementDescriptor(PreferredPlacementDescriptor placement)
Sets the preferred placement for this label. |
void |
setSize(double width,
double height)
Sets the width and height
of the oriented bounds of this 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
,
setPreferredPlacement(byte)
public LabelLayoutData(OrientedRectangle bounds)
bounds
- the oriented bounds
of the labelLabelLayoutConstants
public LabelLayoutData(OrientedRectangle bounds, byte preferredPlacement)
bounds
- the oriented bounds
of the labelpreferredPlacement
- a preferred placement specifierLabelLayoutConstants
,
setPreferredPlacement(byte)
public LabelLayoutData(OrientedRectangle bounds, PreferredPlacementDescriptor preferredPlacement)
IllegalArgumentException
- if the specified descriptor is
null
.bounds
- the oriented bounds
of the labelpreferredPlacement
- a preferred placement specifierLabelLayoutConstants
,
setPreferredPlacementDescriptor(PreferredPlacementDescriptor)
Method Detail |
---|
public void setBounds(OrientedRectangle bounds)
oriented bounds
of the label.
public OrientedRectangle getBounds()
oriented bounds
of the label.
public void setSize(double width, double height)
width
and height
of the oriented bounds
of this label.
Note that getWidth()
and getHeight()
in contrast yield the width and height of the bounding
box of the oriented bounds, which only coincide with the size of the oriented bounds in the case where the
oriented bounds are not rotated.
public double getWidth()
public double getHeight()
public void setLocation(double x, double y)
public double getX()
public double getY()
public void setPreferredPlacement(byte placement)
setPreferredPlacementDescriptor(PreferredPlacementDescriptor)
instead.
placement
- one of LabelLayoutConstants.PLACE_ANYWHERE
, LabelLayoutConstants.PLACE_AT_SOURCE
,
LabelLayoutConstants.PLACE_AT_TARGET
, or LabelLayoutConstants.PLACE_AT_CENTER
.LabelLayoutConstants
public byte getPreferredPlacement()
getPreferredPlacementDescriptor()
instead.
LabelLayoutConstants.PLACE_ANYWHERE
, LabelLayoutConstants.PLACE_AT_SOURCE
,
LabelLayoutConstants.PLACE_AT_TARGET
, or LabelLayoutConstants.PLACE_AT_CENTER
.LabelLayoutConstants
public void setPreferredPlacementDescriptor(PreferredPlacementDescriptor placement)
IllegalArgumentException
- if the specified descriptor is
null
.placement
- the descriptor that specifies preferred placements and orientations for this label.PreferredPlacementDescriptor
,
LabelLayoutConstants
public PreferredPlacementDescriptor getPreferredPlacementDescriptor()
PreferredPlacementDescriptor
,
LabelLayoutConstants
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 |