Package | com.yworks.yfiles.layout |
Class | public class DiscreteEdgeLabelLayoutModel |
Inheritance | DiscreteEdgeLabelLayoutModel YObject Object |
Implements | EdgeLabelModel |
It's possible to specify a distance value that controls the distance between 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 | ||
---|---|---|---|
candidateMask : int [read-only]
Returns the bit mask specifying the valid positions for edge labels. | DiscreteEdgeLabelLayoutModel | ||
defaultParameter : Object [read-only]
Returns a model parameter that encodes the default position of this model's allowed edge label positions. | DiscreteEdgeLabelLayoutModel | ||
distance : Number
Specifies the distance between the label's bounding box and the edge's path. | DiscreteEdgeLabelLayoutModel |
Method | Defined By | ||
---|---|---|---|
DiscreteEdgeLabelLayoutModel(init:Boolean = true)
Returns a new instance of DiscreteEdgeLabelModel. | DiscreteEdgeLabelLayoutModel | ||
createModelParameter(labelBounds:YOrientedRectangle, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout):Object | DiscreteEdgeLabelLayoutModel | ||
createPositionParameter(position:int):Object [static]
Returns a model parameter that encodes the specified position. | DiscreteEdgeLabelLayoutModel | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | DiscreteEdgeLabelLayoutModel | ||
getLabelCandidates(label:EdgeLabelLayout, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout):YList | DiscreteEdgeLabelLayoutModel | ||
getLabelPlacement(labelSize:YDimension, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout, para:Object):YOrientedRectangle | DiscreteEdgeLabelLayoutModel | ||
hashCode():int | YObject | ||
isParameterValid(parameter:Object):Boolean
Checks if the given model parameter encodes an edge label position that is valid in this model. | DiscreteEdgeLabelLayoutModel | ||
[static]
Returns a new instance of DiscreteEdgeLabelModel. | DiscreteEdgeLabelLayoutModel | ||
newDiscreteEdgeLabelLayoutModel2(candidateMask:int):DiscreteEdgeLabelLayoutModel [static]
Returns a new instance of DiscreteEdgeLabelModel. | DiscreteEdgeLabelLayoutModel |
Method | Defined By | ||
---|---|---|---|
getLabelPlacementForParameter(labelSize:YDimension, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout, pos:int):YOrientedRectangle
Returns the coordinates of the upper-left corner of the given label position. | DiscreteEdgeLabelLayoutModel | ||
Initializes this object. | DiscreteEdgeLabelLayoutModel | ||
initDiscreteEdgeLabelLayoutModel2(candidateMask:int):void
Initializes this object. | DiscreteEdgeLabelLayoutModel |
Constant | Defined By | ||
---|---|---|---|
CENTER : int = 128 [static]
Symbolic position specifier. | DiscreteEdgeLabelLayoutModel | ||
CENTERED : int = 128 [static]
Position mask that constrains allowed positions to CENTER. | DiscreteEdgeLabelLayoutModel | ||
HEAD : int = 2 [static]
Symbolic position specifier. | DiscreteEdgeLabelLayoutModel | ||
SCENTER : int = 64 [static]
Symbolic position specifier. | DiscreteEdgeLabelLayoutModel | ||
SHEAD : int = 1 [static]
Symbolic position specifier. | DiscreteEdgeLabelLayoutModel | ||
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. | DiscreteEdgeLabelLayoutModel | ||
STAIL : int = 8 [static]
Symbolic position specifier. | DiscreteEdgeLabelLayoutModel | ||
TAIL : int = 16 [static]
Symbolic position specifier. | DiscreteEdgeLabelLayoutModel | ||
TCENTER : int = 256 [static]
Symbolic position specifier. | DiscreteEdgeLabelLayoutModel | ||
THEAD : int = 4 [static]
Symbolic position specifier. | DiscreteEdgeLabelLayoutModel | ||
THREE_CENTER : int [static]
Position mask that constrains allowed positions to a set of three positions directly on the edge's path. | DiscreteEdgeLabelLayoutModel | ||
TTAIL : int = 32 [static]
Symbolic position specifier. | DiscreteEdgeLabelLayoutModel | ||
TWO_POS : int [static]
Position mask that constrains allowed positions to the two near the edge's end points. | DiscreteEdgeLabelLayoutModel |
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 bounding box and the edge's path.
public function get distance():Number
public function set distance(value:Number):void
DiscreteEdgeLabelLayoutModel | () | Constructor |
public function DiscreteEdgeLabelLayoutModel(init:Boolean = true)
Returns a new instance of DiscreteEdgeLabelModel. 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, para:Object):YOrientedRectangle
Parameters
labelSize:YDimension | |
edgeLayout:EdgeLayout | |
sourceNode:NodeLayout | |
targetNode:NodeLayout | |
para:Object |
YOrientedRectangle |
getLabelPlacementForParameter | () | method |
protected function getLabelPlacementForParameter(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.
|
initDiscreteEdgeLabelLayoutModel1 | () | method |
protected final function initDiscreteEdgeLabelLayoutModel1():void
Initializes this object. See the documentation of the corresponding factory method newDiscreteEdgeLabelLayoutModel1()
for details.
See also
initDiscreteEdgeLabelLayoutModel2 | () | method |
protected final function initDiscreteEdgeLabelLayoutModel2(candidateMask:int):void
Initializes this object. See the documentation of the corresponding factory method newDiscreteEdgeLabelLayoutModel2()
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 |
Boolean — Whether the label position encoded by the given model parameter is among the allowed positions.
|
newDiscreteEdgeLabelLayoutModel1 | () | method |
public static function newDiscreteEdgeLabelLayoutModel1():DiscreteEdgeLabelLayoutModel
Returns a new instance of DiscreteEdgeLabelModel. Position mask SIX_POS is used to define the allowed positions for an edge label.
ReturnsDiscreteEdgeLabelLayoutModel |
See also
newDiscreteEdgeLabelLayoutModel2 | () | method |
public static function newDiscreteEdgeLabelLayoutModel2(candidateMask:int):DiscreteEdgeLabelLayoutModel
Returns a new instance of DiscreteEdgeLabelModel.
Parameters
candidateMask:int — Position mask that defines the allowed positions for an edge label.
|
DiscreteEdgeLabelLayoutModel |
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.
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.
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.
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.
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.
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.
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