Packagecom.yworks.yfiles.layout
Classpublic class SliderEdgeLabelLayoutModel
InheritanceSliderEdgeLabelLayoutModel Inheritance YObject Inheritance Object
Implements EdgeLabelModel

An edge label model that allows placement of labels at a set of continuous positions along both sides of an edge or directly on the edge path.

The set of positions can be influenced by specifying the density value that controls the spacing between adjacent label positions. Furthermore, it's possible to specify distance values that control the distance between label and edge and between label and nodes.



Public Properties
 PropertyDefined By
  defaultParameter : Object
[read-only] Returns a model parameter that encodes the default position of this model's allowed edge label positions.
SliderEdgeLabelLayoutModel
  density : Number
Specifies the density to generate label candidate positions.
SliderEdgeLabelLayoutModel
  maximumDistance : Number
Specifies the maximum distance between the label's bounding box and the edge's path.
SliderEdgeLabelLayoutModel
  minimumDistance : Number
Specifies the minimum distance between the label's bounding box and the edge's path.
SliderEdgeLabelLayoutModel
  mode : int
[read-only] Returns the model's slider mode.
SliderEdgeLabelLayoutModel
  nodeBorderDistance : Number
Specifies the minimal distance between the label's bounding box and a node's borders.
SliderEdgeLabelLayoutModel
Public Methods
 MethodDefined By
  
SliderEdgeLabelLayoutModel(mode:int, init:Boolean = true)
Initializes a new instance of SliderEdgeLabelModel.
SliderEdgeLabelLayoutModel
  
createModelParameter(labelBounds:YOrientedRectangle, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout):Object
SliderEdgeLabelLayoutModel
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
SliderEdgeLabelLayoutModel
  
getLabelCandidates(label:EdgeLabelLayout, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout):YList
Returns a list of candidate positions for the given edge label.
SliderEdgeLabelLayoutModel
  
getLabelPlacement(labelSize:YDimension, edgeLayout:EdgeLayout, sourceNode:NodeLayout, targetNode:NodeLayout, para:Object):YOrientedRectangle
SliderEdgeLabelLayoutModel
  
getOffsetVec(dx:Number, dy:Number, width:Number, height:Number, labelPosition:int):YVector
Returns the offset vector for a given edge label and a given edge segment.
SliderEdgeLabelLayoutModel
 Inherited
hashCode():int
YObject
  
[static] Initializes a new instance of SliderEdgeLabelModel.
SliderEdgeLabelLayoutModel
  
setDistances(minDistance:Number, maxDistance:Number):void
Sets the minimum and maximum distances between the label's bounding box and the edge's path.
SliderEdgeLabelLayoutModel
Protected Methods
 MethodDefined By
  
Initializes this object.
SliderEdgeLabelLayoutModel
Public Constants
 ConstantDefined By
  CENTER_RATIO : int = 0
[static] Symbolic ratio specifier.
SliderEdgeLabelLayoutModel
  CENTER_SLIDER : int = 0
[static] Symbolic slider mode specifier.
SliderEdgeLabelLayoutModel
  HEAD_RATIO : int = 2
[static] Symbolic ratio specifier.
SliderEdgeLabelLayoutModel
  LEFT_RATIO : int = 3
[static] Symbolic ratio specifier.
SliderEdgeLabelLayoutModel
  RIGHT_RATIO : int = 4
[static] Symbolic ratio specifier.
SliderEdgeLabelLayoutModel
  SIDE_SLIDER : int = 1
[static] Symbolic slider mode specifier.
SliderEdgeLabelLayoutModel
  TAIL_RATIO : int = 1
[static] Symbolic ratio specifier.
SliderEdgeLabelLayoutModel
Property Detail
defaultParameterproperty
defaultParameter:Object  [read-only]

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

The default positions for both slider edge label models are relative to the first edge segment, either at the beginning of the segment ( SIDE_SLIDER model) or at its middle ( CENTER_SLIDER model).


Implementation
    public function get defaultParameter():Object

See also

densityproperty 
density:Number

Specifies the density to generate label candidate positions.

A density value of 1.0 (which is the default) generates the most possible candidate positions without overlap.


Implementation
    public function get density():Number
    public function set density(value:Number):void
maximumDistanceproperty 
maximumDistance:Number

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

By default, a maximum distance of 1.0 is set.


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

See also

minimumDistanceproperty 
minimumDistance:Number

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

By default, a minimum distance of 1.0 is set.


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

See also

modeproperty 
mode:int  [read-only]

Returns the model's slider mode.


Implementation
    public function get mode():int
nodeBorderDistanceproperty 
nodeBorderDistance:Number

Specifies the minimal distance between the label's bounding box and a node's borders.


Implementation
    public function get nodeBorderDistance():Number
    public function set nodeBorderDistance(value:Number):void
Constructor Detail
SliderEdgeLabelLayoutModel()Constructor
public function SliderEdgeLabelLayoutModel(mode:int, init:Boolean = true)

Initializes a new instance of SliderEdgeLabelModel.

Parameters
mode:int — Determines which slider mode to use. Possible values are either CENTER_SLIDER or SIDE_SLIDER .
 
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
getClass()method 
override public function getClass():Class

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

Returns a list of candidate positions for the given edge label. The number of candidates and their respective locations are computed depending on the geometries of both label and edge.

Parameters

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

Returns
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

Returns
YOrientedRectangle
getOffsetVec()method 
public function getOffsetVec(dx:Number, dy:Number, width:Number, height:Number, labelPosition:int):YVector

Returns the offset vector for a given edge label and a given edge segment. The offset vector describes where to move a label candidate such that it keeps a certain distance to the edge's path.

Parameters

dx:Number — x-coordinates delta for an edge segment.
 
dy:Number — y-coordinates delta for an edge segment.
 
width:Number — The label's width.
 
height:Number — The label's height.
 
labelPosition:int — One of the symbolic ratio specifiers CENTER_RATIO, LEFT_RATIO, or RIGHT_RATIO .

Returns
YVector — An offset vector.

See also

initSliderEdgeLabelLayoutModel()method 
protected final function initSliderEdgeLabelLayoutModel(mode:int):void

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

Parameters

mode:int

See also

newSliderEdgeLabelLayoutModel()method 
public static function newSliderEdgeLabelLayoutModel(mode:int):SliderEdgeLabelLayoutModel

Initializes a new instance of SliderEdgeLabelModel.

Parameters

mode:int — Determines which slider mode to use. Possible values are either CENTER_SLIDER or SIDE_SLIDER .

Returns
SliderEdgeLabelLayoutModel

See also

setDistances()method 
public function setDistances(minDistance:Number, maxDistance:Number):void

Sets the minimum and maximum distances between the label's bounding box and the edge's path.

Parameters

minDistance:Number — The minimal distance between label and edge.
 
maxDistance:Number — The maximal distance between label and edge.

See also

Constant Detail
CENTER_RATIOConstant
public static const CENTER_RATIO:int = 0

Symbolic ratio specifier. Valid only in conjunction with slider mode CENTER_SLIDER.

See also

CENTER_SLIDERConstant 
public static const CENTER_SLIDER:int = 0

Symbolic slider mode specifier. Chooses continuous label positions directly on the edge path.

HEAD_RATIOConstant 
public static const HEAD_RATIO:int = 2

Symbolic ratio specifier. Valid only in conjunction with slider mode SIDE_SLIDER. Determines a label to be left of or above the edge's path.

See also

LEFT_RATIOConstant 
public static const LEFT_RATIO:int = 3

Symbolic ratio specifier. Valid only in conjunction with slider mode SIDE_SLIDER. Determines a label to be left of the edge's path.

See also

RIGHT_RATIOConstant 
public static const RIGHT_RATIO:int = 4

Symbolic ratio specifier. Valid only in conjunction with slider mode SIDE_SLIDER. Determines a label to be right of the edge's path.

See also

SIDE_SLIDERConstant 
public static const SIDE_SLIDER:int = 1

Symbolic slider mode specifier. Chooses continuous label positions along the sides of the edge path.

TAIL_RATIOConstant 
public static const TAIL_RATIO:int = 1

Symbolic ratio specifier. Valid only in conjunction with slider mode SIDE_SLIDER. Determines a label to be right of or below the edge's path.

See also