Package | com.yworks.yfiles.layout |
Class | public class RotatedDiscreteEdgeLabelLayoutModel |
Inheritance | RotatedDiscreteEdgeLabelLayoutModel YObject Object |
Implements | EdgeLabelModel |
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.
Property | Defined 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 |
Method | Defined By | ||
---|---|---|---|
RotatedDiscreteEdgeLabelLayoutModel(init:Boolean = true)
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 | ||
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 | ||
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 | ||
newRotatedDiscreteEdgeLabelLayoutModel2(candidateMask:int):RotatedDiscreteEdgeLabelLayoutModel [static]
Returns a new instance of RotatedDiscreteEdgeLabelModel. | RotatedDiscreteEdgeLabelLayoutModel |
Method | Defined 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 | ||
initRotatedDiscreteEdgeLabelLayoutModel2(candidateMask:int):void
Initializes this object. | RotatedDiscreteEdgeLabelLayoutModel |
Constant | Defined 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 |
angle | property |
angle:Number
Specifies the angle (measured in radians) of the label model. The angle is applied in clockwise direction.
public function get angle():Number
public function set angle(value:Number):void
autoFlippingEnabled | property |
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.
public function get autoFlippingEnabled():Boolean
public function set autoFlippingEnabled(value:Boolean):void
autoRotationEnabled | property |
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.
public function get autoRotationEnabled():Boolean
public function set autoRotationEnabled(value:Boolean):void
candidateMask | property |
candidateMask:int
[read-only] Returns the bit mask specifying the valid positions for edge labels.
Defaults to SIX_POS.
public function get candidateMask():int
See also
defaultParameter | property |
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): public function get defaultParameter():Object
See also
distance | property |
distance:Number
Specifies the distance between the label's box and the edge's path.
public function get distance():Number
public function set distance(value:Number):void
positionRelativeToSegment | property |
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.
public function get positionRelativeToSegment():Boolean
public function set positionRelativeToSegment(value:Boolean):void
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.
Parametersinit: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
createModelParameter | () | method |
public function createModelParameter(labelBounds:YOrientedRectangle, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout):Object
Parameters
labelBounds:YOrientedRectangle | |
edgeLayout:EdgeLayout | |
sourceNode:NodeLayout | |
targetNode:NodeLayout |
Object |
createPositionParameter | () | method |
public static function createPositionParameter(position:int):Object
Returns a model parameter that encodes the specified position.
Parameters
position:int — one of
|
Object — a model parameter that encodes the specified position.
|
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
ReturnsClass |
getLabelCandidates | () | method |
public function getLabelCandidates(label:EdgeLabelLayout, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout):YList
Parameters
label:EdgeLabelLayout | |
edgeLayout:EdgeLayout | |
sourceNode:NodeLayout | |
targetNode:NodeLayout |
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 |
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.
|
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.
|
int — the symbolic position specifier that is encoded by the specified model parameter.
|
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.
|
Boolean — true 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.
ReturnsRotatedDiscreteEdgeLabelLayoutModel |
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.
|
RotatedDiscreteEdgeLabelLayoutModel |
CENTER | Constant |
public static const CENTER:int = 128
Symbolic position specifier. Places the label near the middle of an edge directly on its path.
CENTERED | Constant |
public static const CENTERED:int = 128
Position mask that constrains allowed positions to CENTER.
See also
HEAD | Constant |
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
SCENTER | Constant |
public static const SCENTER:int = 64
Symbolic position specifier. Places the label near the source node directly on the edge path.
SHEAD | Constant |
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_POS | Constant |
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
STAIL | Constant |
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
TAIL | Constant |
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
TCENTER | Constant |
public static const TCENTER:int = 256
Symbolic position specifier. Places the label near the target node directly on the edge path.
THEAD | Constant |
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_CENTER | Constant |
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
TTAIL | Constant |
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_POS | Constant |
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