Packagecom.yworks.yfiles.layout
Classpublic class RotatedDiscreteEdgeLabelLayoutModel
InheritanceRotatedDiscreteEdgeLabelLayoutModel Inheritance YObject Inheritance Object
Implements EdgeLabelModel

An rotated edge label model that allows placement of rotated labels at some positions along an edge.

It's possible to specify a distance value that controls the distance between the label and edge. Furthermore, there's the possibility to mask out* arbitrary edge label candidates. This can either be done by specifying predefined candidate masks or by OR-ing allowed label candidates to a user defined mask.



Public Properties
 PropertyDefined By
  angle : Number
Specifies the angle (measured in radians) of the label model.
RotatedDiscreteEdgeLabelLayoutModel
  autoFlippingEnabled : Boolean
Determines whether or not edge labels get flipped if they would be upside down in their current position.
RotatedDiscreteEdgeLabelLayoutModel
  autoRotationEnabled : Boolean
Specifies whether or not edge labels have to be automatically rotated according to the angle of the corresponding reference edge segment.
RotatedDiscreteEdgeLabelLayoutModel
  candidateMask : int
[read-only] Returns the bit mask specifying the valid positions for edge labels.
RotatedDiscreteEdgeLabelLayoutModel
  defaultParameter : Object
[read-only] Returns a model parameter that encodes the default position of this model's allowed edge label positions.
RotatedDiscreteEdgeLabelLayoutModel
  distance : Number
Specifies the distance between the label's box and the edge's path.
RotatedDiscreteEdgeLabelLayoutModel
  positionRelativeToSegment : Boolean
Specifies whether or not the label position mask should be interpreted relative to the edge segment.
RotatedDiscreteEdgeLabelLayoutModel
Public Methods
 MethodDefined By
  
Returns a new instance of RotatedDiscreteEdgeLabelModel.
RotatedDiscreteEdgeLabelLayoutModel
  
createModelParameter(labelBounds:YOrientedRectangle, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout):Object
RotatedDiscreteEdgeLabelLayoutModel
  
createPositionParameter(position:int):Object
[static] Returns a model parameter that encodes the specified position.
RotatedDiscreteEdgeLabelLayoutModel
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
RotatedDiscreteEdgeLabelLayoutModel
  
getLabelCandidates(label:EdgeLabelLayout, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout):YList
RotatedDiscreteEdgeLabelLayoutModel
  
getLabelPlacement(labelSize:YDimension, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout, param:Object):YOrientedRectangle
RotatedDiscreteEdgeLabelLayoutModel
  
getPosition(parameter:Object):int
[static] Returns the symbolic position specifier that is encoded by the specified model parameter.
RotatedDiscreteEdgeLabelLayoutModel
 Inherited
hashCode():int
YObject
  
isParameterValid(parameter:Object):Boolean
Checks if the given model parameter encodes an edge label position that is valid in this model.
RotatedDiscreteEdgeLabelLayoutModel
  
[static] Returns a new instance of RotatedDiscreteEdgeLabelModel.
RotatedDiscreteEdgeLabelLayoutModel
  
[static] Returns a new instance of RotatedDiscreteEdgeLabelModel.
RotatedDiscreteEdgeLabelLayoutModel
Protected Methods
 MethodDefined By
  
getLabelPlacement2(labelSize:YDimension, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout, pos:int):YOrientedRectangle
Returns the coordinates of the upper-left corner of the given label position.
RotatedDiscreteEdgeLabelLayoutModel
  
Initializes this object.
RotatedDiscreteEdgeLabelLayoutModel
  
Initializes this object.
RotatedDiscreteEdgeLabelLayoutModel
Public Constants
 ConstantDefined By
  CENTER : int = 128
[static] Symbolic position specifier.
RotatedDiscreteEdgeLabelLayoutModel
  CENTERED : int = 128
[static] Position mask that constrains allowed positions to CENTER.
RotatedDiscreteEdgeLabelLayoutModel
  HEAD : int = 2
[static] Symbolic position specifier.
RotatedDiscreteEdgeLabelLayoutModel
  SCENTER : int = 64
[static] Symbolic position specifier.
RotatedDiscreteEdgeLabelLayoutModel
  SHEAD : int = 1
[static] Symbolic position specifier.
RotatedDiscreteEdgeLabelLayoutModel
  SIX_POS : int
[static] Position mask that constrains allowed positions to a set of six positions on the "head" and "tail" sides of an edge.
RotatedDiscreteEdgeLabelLayoutModel
  STAIL : int = 8
[static] Symbolic position specifier.
RotatedDiscreteEdgeLabelLayoutModel
  TAIL : int = 16
[static] Symbolic position specifier.
RotatedDiscreteEdgeLabelLayoutModel
  TCENTER : int = 256
[static] Symbolic position specifier.
RotatedDiscreteEdgeLabelLayoutModel
  THEAD : int = 4
[static] Symbolic position specifier.
RotatedDiscreteEdgeLabelLayoutModel
  THREE_CENTER : int
[static] Position mask that constrains allowed positions to a set of three positions directly on the edge's path.
RotatedDiscreteEdgeLabelLayoutModel
  TTAIL : int = 32
[static] Symbolic position specifier.
RotatedDiscreteEdgeLabelLayoutModel
  TWO_POS : int
[static] Position mask that constrains allowed positions to the two near the edge's end points.
RotatedDiscreteEdgeLabelLayoutModel
Property Detail
angleproperty
angle:Number

Specifies the angle (measured in radians) of the label model. The angle is applied in clockwise direction.


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

Determines whether or not edge labels get flipped if they would be upside down in their current position.

By default, this feature is disabled.


Implementation
    public function get autoFlippingEnabled():Boolean
    public function set autoFlippingEnabled(value:Boolean):void
autoRotationEnabledproperty 
autoRotationEnabled:Boolean

Specifies whether or not edge labels have to be automatically rotated according to the angle of the corresponding reference edge segment.

By default, this feature is enabled.


Implementation
    public function get autoRotationEnabled():Boolean
    public function set autoRotationEnabled(value:Boolean):void
candidateMaskproperty 
candidateMask:int  [read-only]

Returns the bit mask specifying the valid positions for edge labels.

Defaults to SIX_POS.


Implementation
    public function get candidateMask():int

See also

defaultParameterproperty 
defaultParameter:Object  [read-only]

Returns a model parameter that encodes the default position of this model's allowed edge label positions.

Default positions are (in descending order): Descending order means that whenever two or more of the above default positions are part of the allowed positions, then the model parameter encodes the one that is listed first.

Note that the model parameter encodes CENTER when none of the above default positions is part of the allowed positions.


Implementation
    public function get defaultParameter():Object

See also

distanceproperty 
distance:Number

Specifies the distance between the label's box and the edge's path.


Implementation
    public function get distance():Number
    public function set distance(value:Number):void
positionRelativeToSegmentproperty 
positionRelativeToSegment:Boolean

Specifies whether or not the label position mask should be interpreted relative to the edge segment. If this value is set to false (default value), the position mask is interpreted in a geometric sense. Note: this option is only relevant for non-center positions.


Implementation
    public function get positionRelativeToSegment():Boolean
    public function set positionRelativeToSegment(value:Boolean):void
Constructor Detail
RotatedDiscreteEdgeLabelLayoutModel()Constructor
public function RotatedDiscreteEdgeLabelLayoutModel(init:Boolean = true)

Returns a new instance of RotatedDiscreteEdgeLabelModel. Position mask SIX_POS is used to define the allowed positions for an edge label.

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.

See also

Method Detail
createModelParameter()method
public function createModelParameter(labelBounds:YOrientedRectangle, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout):Object

Parameters

labelBounds:YOrientedRectangle
 
edgeLayout:EdgeLayout
 
sourceNode:NodeLayout
 
targetNode:NodeLayout

Returns
Object
createPositionParameter()method 
public static function createPositionParameter(position:int):Object

Returns a model parameter that encodes the specified position.

Parameters

position:int — one of
  • SHEAD,
  • HEAD,
  • THEAD,
  • STAIL,
  • TAIL,
  • TTAIL,
  • SCENTER,
  • CENTER,
  • TCENTER

Returns
Object — a model parameter that encodes the specified position.

Throws
IllegalArgumentException — if the specified position is not one of the symbolic position constants defined in this class.

See also

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

Returns
Class
getLabelCandidates()method 
public function getLabelCandidates(label:EdgeLabelLayout, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout):YList

Parameters

label:EdgeLabelLayout
 
edgeLayout:EdgeLayout
 
sourceNode:NodeLayout
 
targetNode:NodeLayout

Returns
YList
getLabelPlacement()method 
public function getLabelPlacement(labelSize:YDimension, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout, param:Object):YOrientedRectangle

Parameters

labelSize:YDimension
 
edgeLayout:EdgeLayout
 
sourceNode:NodeLayout
 
targetNode:NodeLayout
 
param:Object

Returns
YOrientedRectangle
getLabelPlacement2()method 
protected function getLabelPlacement2(labelSize:YDimension, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout, pos:int):YOrientedRectangle

Returns the coordinates of the upper-left corner of the given label position.

Parameters

labelSize:YDimension — The size of the label that should be placed.
 
edgeLayout:EdgeLayout — The layout of the edge to which the label belongs.
 
sourceNode:NodeLayout — The layout of the source node of the label owning edge.
 
targetNode:NodeLayout — The layout of the target node of the label owning edge.
 
pos:int — A label position (given by a symbolic position specifier) that is valid in this model.

Returns
YOrientedRectangle — The coordinates of the upper-left corner of a label position.
getPosition()method 
public static function getPosition(parameter:Object):int

Returns the symbolic position specifier that is encoded by the specified model parameter.

Parameters

parameter:Object — the model parameter that encodes the position.

Returns
int — the symbolic position specifier that is encoded by the specified model parameter.

Throws
IllegalArgumentException — if the specified model parameter is not valid for this model.
initRotatedDiscreteEdgeLabelLayoutModel1()method 
protected final function initRotatedDiscreteEdgeLabelLayoutModel1():void

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

See also

initRotatedDiscreteEdgeLabelLayoutModel2()method 
protected final function initRotatedDiscreteEdgeLabelLayoutModel2(candidateMask:int):void

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

Parameters

candidateMask:int

See also

isParameterValid()method 
public function isParameterValid(parameter:Object):Boolean

Checks if the given model parameter encodes an edge label position that is valid in this model.

Parameters

parameter:Object — the model parameter to check.

Returns
Booleantrue if the specified object is a valid parameter for this model and encodes a valid position according to this model's candidate mask (candidateMask); false otherwise.

See also

newRotatedDiscreteEdgeLabelLayoutModel1()method 
public static function newRotatedDiscreteEdgeLabelLayoutModel1():RotatedDiscreteEdgeLabelLayoutModel

Returns a new instance of RotatedDiscreteEdgeLabelModel. Position mask SIX_POS is used to define the allowed positions for an edge label.

Returns
RotatedDiscreteEdgeLabelLayoutModel

See also

newRotatedDiscreteEdgeLabelLayoutModel2()method 
public static function newRotatedDiscreteEdgeLabelLayoutModel2(candidateMask:int):RotatedDiscreteEdgeLabelLayoutModel

Returns a new instance of RotatedDiscreteEdgeLabelModel.

Parameters

candidateMask:int — Position mask that defines the allowed positions for an edge label.

Returns
RotatedDiscreteEdgeLabelLayoutModel
Constant Detail
CENTERConstant
public static const CENTER:int = 128

Symbolic position specifier. Places the label near the middle of an edge directly on its path.

CENTEREDConstant 
public static const CENTERED:int = 128

Position mask that constrains allowed positions to CENTER.

See also

HEADConstant 
public static const HEAD:int = 2

Symbolic position specifier. Places the label near the middle of the edge's path. The label's position is to the left of or above the edge's path.

See also

SCENTERConstant 
public static const SCENTER:int = 64

Symbolic position specifier. Places the label near the source node directly on the edge path.

SHEADConstant 
public static const SHEAD:int = 1

Symbolic position specifier. Places the label near the source node. The label's position is to the left of or above the edge's path.

See also

SIX_POSConstant 
public static const SIX_POS:int

Position mask that constrains allowed positions to a set of six positions on the "head" and "tail" sides of an edge. Namely, these are SHEAD, HEAD, THEAD, STAIL, TAIL, and TTAIL.

See also

STAILConstant 
public static const STAIL:int = 8

Symbolic position specifier. Places the label near the source node. The label's position is to the right of or below the edge's path.

See also

TAILConstant 
public static const TAIL:int = 16

Symbolic position specifier. Places the label near the middle of the edge's path. The label's position is to the right of or below the edge's path.

See also

TCENTERConstant 
public static const TCENTER:int = 256

Symbolic position specifier. Places the label near the target node directly on the edge path.

THEADConstant 
public static const THEAD:int = 4

Symbolic position specifier. Places the label near the target node. The label's position is to the left of or above the edge's path. Places the label near the target node on the "head" side of the edge.

See also

THREE_CENTERConstant 
public static const THREE_CENTER:int

Position mask that constrains allowed positions to a set of three positions directly on the edge's path. Namely, these are SCENTER, CENTER, and TCENTER.

See also

TTAILConstant 
public static const TTAIL:int = 32

Symbolic position specifier. Places the label near the target node. The label's position is to the right of or below the edge's path.

See also

TWO_POSConstant 
public static const TWO_POS:int

Position mask that constrains allowed positions to the two near the edge's end points. Namely, these are HEAD and TAIL.

See also