Packagecom.yworks.yfiles.layout
Classpublic class LabelLayoutData
InheritanceLabelLayoutData Inheritance YObject Inheritance Object

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 com.yworks.yfiles.layout.hierarchic.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 data providers must be registered with the input graph by using one of the keys defined in com.yworks.yfiles.layout.LabelLayoutKeys.

See also

com.yworks.yfiles.layout.hierarchic.HierarchicLayouter
com.yworks.yfiles.layout.LabelLayoutKeys


Public Properties
 PropertyDefined By
  bounds : YOrientedRectangle
Specifies the oriented bounds (com.yworks.yfiles.geom.YOrientedRectangle) of the label.
LabelLayoutData
  height : Number
[read-only] Returns the height of the label.
LabelLayoutData
  preferredPlacement : int
Specifies the preferred placement for this label.
LabelLayoutData
  preferredPlacementDescriptor : PreferredPlacementDescriptor
Specifies the preferred placement for this label.
LabelLayoutData
  width : Number
[read-only] Returns the width of the label.
LabelLayoutData
  x : Number
[read-only] Returns the x-coordinate of the label's upper-left corner of the bounding box.
LabelLayoutData
  y : Number
[read-only] Returns the y-coordinate of the label's upper-left corner of the bounding box.
LabelLayoutData
Public Methods
 MethodDefined By
  
LabelLayoutData(bounds:YOrientedRectangle, init:Boolean = true)
Creates a new instance of LabelLayoutData.
LabelLayoutData
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
LabelLayoutData
 Inherited
hashCode():int
YObject
  
[static] Creates a new instance of LabelLayoutData.
LabelLayoutData
  
newLabelLayoutData2(width:Number, height:Number):LabelLayoutData
[static] Creates a new instance of LabelLayoutData.
LabelLayoutData
  
[static] Creates a new instance of LabelLayoutData.
LabelLayoutData
  
newLabelLayoutData4(width:Number, height:Number, preferredPlacement:int):LabelLayoutData
[static] Creates a new instance of LabelLayoutData.
LabelLayoutData
  
[static] Creates a new instance of LabelLayoutData.
LabelLayoutData
  
setLocation(x:Number, y:Number):void
Sets the coordinates of the upper-left corner of the bounding box of the label.
LabelLayoutData
  
setSize(width:Number, height:Number):void
Sets the width (com.yworks.yfiles.geom.YOrientedRectangle.width) and height (com.yworks.yfiles.geom.YOrientedRectangle.height) of the oriented bounds (bounds) of this label.
LabelLayoutData
  
toString():String
Returns a string representation of this object.
LabelLayoutData
Protected Methods
 MethodDefined By
  
Initializes this object.
LabelLayoutData
  
initLabelLayoutData2(width:Number, height:Number):void
Initializes this object.
LabelLayoutData
  
initLabelLayoutData3(bounds:YOrientedRectangle, preferredPlacement:int):void
Initializes this object.
LabelLayoutData
  
initLabelLayoutData4(width:Number, height:Number, preferredPlacement:int):void
Initializes this object.
LabelLayoutData
  
Initializes this object.
LabelLayoutData
Property Detail
boundsproperty
bounds:YOrientedRectangle

Specifies the oriented bounds (com.yworks.yfiles.geom.YOrientedRectangle) of the label.


Implementation
    public function get bounds():YOrientedRectangle
    public function set bounds(value:YOrientedRectangle):void

See also

heightproperty 
height:Number  [read-only]

Returns the height of the label.


Implementation
    public function get height():Number
preferredPlacementproperty 
preferredPlacement:int

Specifies the preferred placement for this label.


Implementation
    public function get preferredPlacement():int
    public function set preferredPlacement(value:int):void

See also

preferredPlacementDescriptorproperty 
preferredPlacementDescriptor:PreferredPlacementDescriptor

Specifies the preferred placement for this label.


Implementation
    public function get preferredPlacementDescriptor():PreferredPlacementDescriptor
    public function set preferredPlacementDescriptor(value:PreferredPlacementDescriptor):void

Throws
IllegalArgumentException — if the specified descriptor is null.

See also

widthproperty 
width:Number  [read-only]

Returns the width of the label.


Implementation
    public function get width():Number
xproperty 
x:Number  [read-only]

Returns the x-coordinate of the label's upper-left corner of the bounding box.


Implementation
    public function get x():Number
yproperty 
y:Number  [read-only]

Returns the y-coordinate of the label's upper-left corner of the bounding box.


Implementation
    public function get y():Number
Constructor Detail
LabelLayoutData()Constructor
public function LabelLayoutData(bounds:YOrientedRectangle, init:Boolean = true)

Creates a new instance of LabelLayoutData.

Parameters
bounds:YOrientedRectangle — the oriented bounds (com.yworks.yfiles.geom.YOrientedRectangle) of the label
 
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods. This parameter can safely be ignored/omitted when calling the constructor.

See also

Method Detail
getClass()method
override public function getClass():Class

Returns
Class
initLabelLayoutData1()method 
protected final function initLabelLayoutData1(bounds:YOrientedRectangle):void

Initializes this object. See the documentation of the corresponding factory method newLabelLayoutData1() for details.

Parameters

bounds:YOrientedRectangle

See also

initLabelLayoutData2()method 
protected final function initLabelLayoutData2(width:Number, height:Number):void

Initializes this object. See the documentation of the corresponding factory method newLabelLayoutData2() for details.

Parameters

width:Number
 
height:Number

See also

initLabelLayoutData3()method 
protected final function initLabelLayoutData3(bounds:YOrientedRectangle, preferredPlacement:int):void

Initializes this object. See the documentation of the corresponding factory method newLabelLayoutData3() for details.

Parameters

bounds:YOrientedRectangle
 
preferredPlacement:int

See also

initLabelLayoutData4()method 
protected final function initLabelLayoutData4(width:Number, height:Number, preferredPlacement:int):void

Initializes this object. See the documentation of the corresponding factory method newLabelLayoutData4() for details.

Parameters

width:Number
 
height:Number
 
preferredPlacement:int

See also

initLabelLayoutData5()method 
protected final function initLabelLayoutData5(bounds:YOrientedRectangle, preferredPlacement:PreferredPlacementDescriptor):void

Initializes this object. See the documentation of the corresponding factory method newLabelLayoutData5() for details.

Parameters

bounds:YOrientedRectangle
 
preferredPlacement:PreferredPlacementDescriptor

See also

newLabelLayoutData1()method 
public static function newLabelLayoutData1(bounds:YOrientedRectangle):LabelLayoutData

Creates a new instance of LabelLayoutData.

Parameters

bounds:YOrientedRectangle — the oriented bounds (com.yworks.yfiles.geom.YOrientedRectangle) of the label

Returns
LabelLayoutData

See also

newLabelLayoutData2()method 
public static function newLabelLayoutData2(width:Number, height:Number):LabelLayoutData

Creates a new instance of LabelLayoutData. com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_ANYWHERE is used as preferred placement specifier.

Parameters

width:Number — the width of the label
 
height:Number — the height of the label

Returns
LabelLayoutData

See also

newLabelLayoutData3()method 
public static function newLabelLayoutData3(bounds:YOrientedRectangle, preferredPlacement:int):LabelLayoutData

Creates a new instance of LabelLayoutData.

Parameters

bounds:YOrientedRectangle — the oriented bounds (com.yworks.yfiles.geom.YOrientedRectangle) of the label
 
preferredPlacement:int — a preferred placement specifier

Returns
LabelLayoutData

See also

newLabelLayoutData4()method 
public static function newLabelLayoutData4(width:Number, height:Number, preferredPlacement:int):LabelLayoutData

Creates a new instance of LabelLayoutData.

Parameters

width:Number — the width of the label
 
height:Number — the height of the label
 
preferredPlacement:int — a preferred placement specifier

Returns
LabelLayoutData

See also

newLabelLayoutData5()method 
public static function newLabelLayoutData5(bounds:YOrientedRectangle, preferredPlacement:PreferredPlacementDescriptor):LabelLayoutData

Creates a new instance of LabelLayoutData.

Parameters

bounds:YOrientedRectangle — the oriented bounds (com.yworks.yfiles.geom.YOrientedRectangle) of the label
 
preferredPlacement:PreferredPlacementDescriptor — a preferred placement specifier

Returns
LabelLayoutData

Throws
IllegalArgumentException — if the specified descriptor is null.

See also

setLocation()method 
public function setLocation(x:Number, y:Number):void

Sets the coordinates of the upper-left corner of the bounding box of the label.

Parameters

x:Number
 
y:Number

setSize()method 
public function setSize(width:Number, height:Number):void

Sets the width (com.yworks.yfiles.geom.YOrientedRectangle.width) and height (com.yworks.yfiles.geom.YOrientedRectangle.height) of the oriented bounds (bounds) of this label. Note that width and height 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.

Parameters

width:Number
 
height:Number

See also

toString()method 
public function toString():String

Returns a string representation of this object.

Returns
String