Packagecom.yworks.yfiles.layout
Classpublic class PreferredPlacementDescriptor
InheritancePreferredPlacementDescriptor Inheritance YObject Inheritance Object

A descriptor that holds preferred placement information for automatic edge labeling.

It provides methods to specify

See also

com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_AT_SOURCE
com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_AT_CENTER
com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_AT_TARGET
com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE
com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_ON_EDGE
com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE
SIDE_IS_RELATIVE_TO_EDGE_FLOW
SIDE_IS_ABSOLUTE_WITH_LEFT_IN_NORTH
SIDE_IS_ABSOLUTE_WITH_RIGHT_IN_NORTH
ANGLE_IS_ABSOLUTE
ANGLE_IS_RELATIVE_TO_EDGE_FLOW
ANGLE_ON_RIGHT_SIDE_CO_ROTATING
ANGLE_ON_RIGHT_SIDE_COUNTER_ROTATING
ANGLE_OFFSET_ON_RIGHT_SIDE_0
ANGLE_OFFSET_ON_RIGHT_SIDE_180


Public Properties
 PropertyDefined By
  angle : Number
Specifies the angle (in radians) for the label rotation.
PreferredPlacementDescriptor
  angleAbsolute : Boolean
[read-only] Returns if one of the angle interpretations is to interpret the angle absolute.
PreferredPlacementDescriptor
  angleOffsetOnRightSide : int
Specifies the angle offset for labels that are placed on the right side of the edge.
PreferredPlacementDescriptor
  angleOffsetOnRightSide0 : Boolean
[read-only] Returns if one of the angle interpretations is to add no additional angle offset to labels that are right of the edge.
PreferredPlacementDescriptor
  angleOffsetOnRightSide180 : Boolean
[read-only] Returns if one of the angle interpretations is to add an additional angle offset of 180 degree to labels that are right of the edge.
PreferredPlacementDescriptor
  angleOnRightSideCoRotating : Boolean
[read-only] Returns if one of the angle interpretations is to interpret the angle of labels that are right of the edge as co-rotating with the labels left of or centered on edge, i.e.
PreferredPlacementDescriptor
  angleOnRightSideCounterRotating : Boolean
[read-only] Returns if one of the angle interpretations is to interpret the angle of labels that are right of the edge as counter-rotating with the labels left of or centered on edge, i.e.
PreferredPlacementDescriptor
  angleReference : int
Specifies the reference of the angle given by com.yworks.yfiles.layout.PreferredPlacementDescriptor.angle.
PreferredPlacementDescriptor
  angleRelativeToEdgeFlow : Boolean
[read-only] Returns if one of the angle interpretations is to interpret the angle relative to the edge slope.
PreferredPlacementDescriptor
  angleRotationOnRightSide : int
Specifies how the angle is applied to labels on the right side in respect of the labels of the left side of the edge.
PreferredPlacementDescriptor
  atCenter : Boolean
[read-only] Returns if one of the preferred placements for this label is at center.
PreferredPlacementDescriptor
  atSource : Boolean
[read-only] Returns if one of the preferred placements for this label is at source.
PreferredPlacementDescriptor
  atTarget : Boolean
[read-only] Returns if one of the preferred placements for this label is at target.
PreferredPlacementDescriptor
  distanceToEdge : Number
Specifies the preferred distance between a label and the corresponding edge segment.
PreferredPlacementDescriptor
  frozen : Boolean
[read-only] Returns whether or not this is an immutable descriptor instance.
PreferredPlacementDescriptor
  leftOfEdge : Boolean
[read-only] Returns if one of the preferred sides for this label is left of the edge.
PreferredPlacementDescriptor
  onEdge : Boolean
[read-only] Returns if one of the preferred sides for this label is on the edge.
PreferredPlacementDescriptor
  placeAlongEdge : int
Specifies the preferred placement along the edge.
PreferredPlacementDescriptor
  rightOfEdge : Boolean
[read-only] Returns if one of the preferred sides for this label is right of the edge.
PreferredPlacementDescriptor
  sideAbsoluteWithLeftInNorth : Boolean
[read-only] Returns if the preferred side specified by com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE and com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE is interpreted absolute and on horizontal segments, labels with preferred side com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE are placed above the segment.
PreferredPlacementDescriptor
  sideAbsoluteWithRightInNorth : Boolean
[read-only] Returns if the preferred side specified by com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE and com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE is interpreted absolute and on horizontal segments, labels with preferred side com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE are placed above the segment.
PreferredPlacementDescriptor
  sideOfEdge : int
Specifies the preferred side of the edge.
PreferredPlacementDescriptor
  sideReference : int
Getter: Specifies how to interpret the preferred side as given by com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE and com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE.
PreferredPlacementDescriptor
  sideRelativeToEdgeFlow : Boolean
[read-only] Returns if the preferred side specified by com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE and com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE is interpreted relative to the edge flow.
PreferredPlacementDescriptor
Public Methods
 MethodDefined By
  
PreferredPlacementDescriptor(init:Boolean = true)
Creates a mutable instance of this descriptor.
PreferredPlacementDescriptor
  
equals(o:Object):Boolean
[override]
PreferredPlacementDescriptor
  
freeze():void
Makes this instance immutable.
PreferredPlacementDescriptor
  
getClass():Class
[override]
PreferredPlacementDescriptor
  
hashCode():int
[override]
PreferredPlacementDescriptor
  
[static] Creates a mutable instance of this descriptor.
PreferredPlacementDescriptor
  
[static] Creates a mutable copy of the given PreferredPlacementDescriptor.
PreferredPlacementDescriptor
  
[static] Returns an immutable descriptor instance for the specified placement.
PreferredPlacementDescriptor
  
toString():String
PreferredPlacementDescriptor
Protected Methods
 MethodDefined By
  
Initializes this object.
PreferredPlacementDescriptor
  
Initializes this object.
PreferredPlacementDescriptor
Public Constants
 ConstantDefined By
  ANGLE_IS_ABSOLUTE : int = 0x01
[static] Angle interpretation specifier for edge labels.
PreferredPlacementDescriptor
  ANGLE_IS_RELATIVE_TO_EDGE_FLOW : int = 0x02
[static] Angle interpretation specifier for edge labels.
PreferredPlacementDescriptor
  ANGLE_OFFSET_ON_RIGHT_SIDE_0 : int = 0x01
[static] Angle offset specifier for edge labels whose descriptor rightOfEdge.
PreferredPlacementDescriptor
  ANGLE_OFFSET_ON_RIGHT_SIDE_180 : int = 0x02
[static] Angle offset specifier for edge labels whose descriptor rightOfEdge.
PreferredPlacementDescriptor
  ANGLE_ON_RIGHT_SIDE_CO_ROTATING : int = 0x01
[static] Angle interpretation specifier for edge labels whose descriptor rightOfEdge.
PreferredPlacementDescriptor
  ANGLE_ON_RIGHT_SIDE_COUNTER_ROTATING : int = 0x02
[static] Angle interpretation specifier for edge labels whose descriptor rightOfEdge.
PreferredPlacementDescriptor
  SIDE_IS_ABSOLUTE_WITH_LEFT_IN_NORTH : int = 0x02
[static] Side placement specifier for edge labels.
PreferredPlacementDescriptor
  SIDE_IS_ABSOLUTE_WITH_RIGHT_IN_NORTH : int = 0x04
[static] Side placement specifier for edge labels.
PreferredPlacementDescriptor
  SIDE_IS_RELATIVE_TO_EDGE_FLOW : int = 0x01
[static] Side placement specifier for edge labels.
PreferredPlacementDescriptor
Property Detail
angleproperty
angle:Number

Specifies the angle (in radians) for the label rotation. How this angle is applied is specified by angleReference, angleRotationOnRightSide and angleOffsetOnRightSide . Default is 0.


Implementation
    public function get angle():Number
    public function set angle(value:Number):void

Throws
Error — if this instance is immutable (frozen).

See also

angleAbsoluteproperty 
angleAbsolute:Boolean  [read-only]

Returns if one of the angle interpretations is to interpret the angle absolute.


Implementation
    public function get angleAbsolute():Boolean
angleOffsetOnRightSideproperty 
angleOffsetOnRightSide:int

Specifies the angle offset for labels that are placed on the right side of the edge. Default is ANGLE_OFFSET_ON_RIGHT_SIDE_0.


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

Throws
Error — if this instance is immutable (frozen).
 
IllegalArgumentException — if the specified value has not at least one of the required bits set.

See also

angleOffsetOnRightSide0property 
angleOffsetOnRightSide0:Boolean  [read-only]

Returns if one of the angle interpretations is to add no additional angle offset to labels that are right of the edge.


Implementation
    public function get angleOffsetOnRightSide0():Boolean

See also

angleOffsetOnRightSide180property 
angleOffsetOnRightSide180:Boolean  [read-only]

Returns if one of the angle interpretations is to add an additional angle offset of 180 degree to labels that are right of the edge.


Implementation
    public function get angleOffsetOnRightSide180():Boolean

See also

angleOnRightSideCoRotatingproperty 
angleOnRightSideCoRotating:Boolean  [read-only]

Returns if one of the angle interpretations is to interpret the angle of labels that are right of the edge as co-rotating with the labels left of or centered on edge, i.e. the angle of all labels is interpreted clockwise.


Implementation
    public function get angleOnRightSideCoRotating():Boolean

See also

angleOnRightSideCounterRotatingproperty 
angleOnRightSideCounterRotating:Boolean  [read-only]

Returns if one of the angle interpretations is to interpret the angle of labels that are right of the edge as counter-rotating with the labels left of or centered on edge, i.e. the angle of labels left or centered on edge is interpreted clockwise while the angle of labels right of edge is interpreted counter-clockwise.


Implementation
    public function get angleOnRightSideCounterRotating():Boolean

See also

angleReferenceproperty 
angleReference:int

Specifies the reference of the angle given by com.yworks.yfiles.layout.PreferredPlacementDescriptor.angle. Default is ANGLE_IS_ABSOLUTE.


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

Throws
Error — if this instance is immutable (frozen).
 
IllegalArgumentException — if the specified value has not at least one of the required bits set.

See also

angleRelativeToEdgeFlowproperty 
angleRelativeToEdgeFlow:Boolean  [read-only]

Returns if one of the angle interpretations is to interpret the angle relative to the edge slope.


Implementation
    public function get angleRelativeToEdgeFlow():Boolean
angleRotationOnRightSideproperty 
angleRotationOnRightSide:int

Specifies how the angle is applied to labels on the right side in respect of the labels of the left side of the edge. Default is ANGLE_ON_RIGHT_SIDE_CO_ROTATING.


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

Throws
Error — if this instance is immutable (frozen).
 
IllegalArgumentException — if the specified value has not at least one of the required bits set.

See also

atCenterproperty 
atCenter:Boolean  [read-only]

Returns if one of the preferred placements for this label is at center.


Implementation
    public function get atCenter():Boolean
atSourceproperty 
atSource:Boolean  [read-only]

Returns if one of the preferred placements for this label is at source.


Implementation
    public function get atSource():Boolean
atTargetproperty 
atTarget:Boolean  [read-only]

Returns if one of the preferred placements for this label is at target.


Implementation
    public function get atTarget():Boolean
distanceToEdgeproperty 
distanceToEdge:Number

Specifies the preferred distance between a label and the corresponding edge segment. If the given distance is < 0, the distance is not fixed, i.e., it is chosen by the automatic labeling algorithm. Default is -1.


Implementation
    public function get distanceToEdge():Number
    public function set distanceToEdge(value:Number):void

Throws
IllegalArgumentException — if the specified value is infinite or NaN.
 
Error — if this instance is immutable (frozen).

See also

frozenproperty 
frozen:Boolean  [read-only]

Returns whether or not this is an immutable descriptor instance. If this instance is immutable, all set methods will throw an Error when invoked.


Implementation
    public function get frozen():Boolean

See also

leftOfEdgeproperty 
leftOfEdge:Boolean  [read-only]

Returns if one of the preferred sides for this label is left of the edge.


Implementation
    public function get leftOfEdge():Boolean
onEdgeproperty 
onEdge:Boolean  [read-only]

Returns if one of the preferred sides for this label is on the edge.


Implementation
    public function get onEdge():Boolean
placeAlongEdgeproperty 
placeAlongEdge:int

Specifies the preferred placement along the edge. Default is com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_AT_CENTER.


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

Throws
Error — if this instance is immutable (frozen).

See also

rightOfEdgeproperty 
rightOfEdge:Boolean  [read-only]

Returns if one of the preferred sides for this label is right of the edge.


Implementation
    public function get rightOfEdge():Boolean
sideAbsoluteWithLeftInNorthproperty 
sideAbsoluteWithLeftInNorth:Boolean  [read-only]

Returns if the preferred side specified by com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE and com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE is interpreted absolute and on horizontal segments, labels with preferred side com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE are placed above the segment.


Implementation
    public function get sideAbsoluteWithLeftInNorth():Boolean

See also

sideAbsoluteWithRightInNorthproperty 
sideAbsoluteWithRightInNorth:Boolean  [read-only]

Returns if the preferred side specified by com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE and com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE is interpreted absolute and on horizontal segments, labels with preferred side com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE are placed above the segment.


Implementation
    public function get sideAbsoluteWithRightInNorth():Boolean

See also

sideOfEdgeproperty 
sideOfEdge:int

Specifies the preferred side of the edge. Default is com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_ON_EDGE.


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

Throws
Error — if this instance is immutable (frozen).

See also

sideReferenceproperty 
sideReference:int

Getter: Specifies how to interpret the preferred side as given by com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE and com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE. Default is SIDE_IS_RELATIVE_TO_EDGE_FLOW.

Setter: Specifies how to interpret the preferred side as given by com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE and com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE.


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

Throws
Error — if this instance is immutable (frozen).
 
IllegalArgumentException — if the specified value has not at least one of the required bits set.

See also

sideRelativeToEdgeFlowproperty 
sideRelativeToEdgeFlow:Boolean  [read-only]

Returns if the preferred side specified by com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE and com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE is interpreted relative to the edge flow.


Implementation
    public function get sideRelativeToEdgeFlow():Boolean

See also

Constructor Detail
PreferredPlacementDescriptor()Constructor
public function PreferredPlacementDescriptor(init:Boolean = true)

Creates a mutable instance of this descriptor.

Parameters
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.
Method Detail
equals()method
override public function equals(o:Object):Boolean

Parameters

o:Object

Returns
Boolean
freeze()method 
public function freeze():void

Makes this instance immutable. If this instance is immutable, all set methods will throw an Error when invoked.

See also

frozen
Error
getClass()method 
override public function getClass():Class

Returns
Class
hashCode()method 
override public function hashCode():int

Returns
int
initPreferredPlacementDescriptor1()method 
protected final function initPreferredPlacementDescriptor1():void

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

See also

initPreferredPlacementDescriptor2()method 
protected final function initPreferredPlacementDescriptor2(descriptor:PreferredPlacementDescriptor):void

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

Parameters

descriptor:PreferredPlacementDescriptor

See also

newPreferredPlacementDescriptor1()method 
public static function newPreferredPlacementDescriptor1():PreferredPlacementDescriptor

Creates a mutable instance of this descriptor.

Returns
PreferredPlacementDescriptor
newPreferredPlacementDescriptor2()method 
public static function newPreferredPlacementDescriptor2(descriptor:PreferredPlacementDescriptor):PreferredPlacementDescriptor

Creates a mutable copy of the given PreferredPlacementDescriptor.

Parameters

descriptor:PreferredPlacementDescriptor — PreferredPlacementDescriptor to make a copy from

Returns
PreferredPlacementDescriptor
newSharedInstance()method 
public static function newSharedInstance(placement:int):PreferredPlacementDescriptor

Returns an immutable descriptor instance for the specified placement. Descriptor instances returned by this method will use default values for all properties but placement along edge (placeAlongEdge) and side of edge (sideOfEdge).

Parameters

placement:int — an ORed combination of com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_ANYWHERE, com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_AT_SOURCE, com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_AT_TARGET, or com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_AT_CENTER and com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE, com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE, or com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_ON_EDGE.

Returns
PreferredPlacementDescriptor — an immutable descriptor instance for the specified placement.

See also

toString()method 
public function toString():String

Returns
String
Constant Detail
ANGLE_IS_ABSOLUTEConstant
public static const ANGLE_IS_ABSOLUTE:int = 0x01

Angle interpretation specifier for edge labels. Expresses that the angle should be interpreted absolute and not relative to the edge slope.

See also

ANGLE_IS_RELATIVE_TO_EDGE_FLOWConstant 
public static const ANGLE_IS_RELATIVE_TO_EDGE_FLOW:int = 0x02

Angle interpretation specifier for edge labels. Expresses that the angle should be interpreted relative to the edge slope.

See also

ANGLE_OFFSET_ON_RIGHT_SIDE_0Constant 
public static const ANGLE_OFFSET_ON_RIGHT_SIDE_0:int = 0x01

Angle offset specifier for edge labels whose descriptor rightOfEdge. Expresses that for labels right of edge no additional offset should be added to the angle offset.

See also

ANGLE_OFFSET_ON_RIGHT_SIDE_180Constant 
public static const ANGLE_OFFSET_ON_RIGHT_SIDE_180:int = 0x02

Angle offset specifier for edge labels whose descriptor rightOfEdge. Expresses that for labels right of edge an additional offset of 180 degree should be added to the angle offset so that point symmetric label placements left and right of the edge can be attained.

See also

ANGLE_ON_RIGHT_SIDE_CO_ROTATINGConstant 
public static const ANGLE_ON_RIGHT_SIDE_CO_ROTATING:int = 0x01

Angle interpretation specifier for edge labels whose descriptor rightOfEdge. Expresses that the angle should be interpreted as clockwise and therefore as co-rotating with the angle of labels that are left of or centered on edge.

See also

ANGLE_ON_RIGHT_SIDE_COUNTER_ROTATINGConstant 
public static const ANGLE_ON_RIGHT_SIDE_COUNTER_ROTATING:int = 0x02

Angle interpretation specifier for edge labels whose descriptor rightOfEdge. Expresses that the angle should be interpreted as counter-clockwise and therefore as counter-rotating with the angle of labels that are left of or centered on edge.

See also

SIDE_IS_ABSOLUTE_WITH_LEFT_IN_NORTHConstant 
public static const SIDE_IS_ABSOLUTE_WITH_LEFT_IN_NORTH:int = 0x02

Side placement specifier for edge labels. Expresses that the preferred side (as specified by com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE and com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE) is interpreted absolute. On horizontal segments labels with preferred side com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE are placed above the segment.

See also

SIDE_IS_ABSOLUTE_WITH_RIGHT_IN_NORTHConstant 
public static const SIDE_IS_ABSOLUTE_WITH_RIGHT_IN_NORTH:int = 0x04

Side placement specifier for edge labels. Expresses that the preferred side (as specified by com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE and com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE) is interpreted absolute. On horizontal segments labels with preferred side com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE are placed above the segment.

See also

SIDE_IS_RELATIVE_TO_EDGE_FLOWConstant 
public static const SIDE_IS_RELATIVE_TO_EDGE_FLOW:int = 0x01

Side placement specifier for edge labels. Expresses that the preferred side (as specified by com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_LEFT_OF_EDGE and com.yworks.yfiles.layout.LabelLayoutConstants.PLACE_RIGHT_OF_EDGE) is interpreted relative to the edge flow.

See also