Packagecom.yworks.yfiles.layout
Classpublic class ParallelEdgeLayouter
InheritanceParallelEdgeLayouter Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object

A layout algorithm that routes parallel edges (edges that connect the same pair of nodes) of a graph.

A core layout algorithm can be specified for this class. In that case the performed layout process of this class is subdivided into four stages:
  1. Remove parallel edges from the input graph. If there are parallel edges between two nodes v and w than only one of these edges will remain in the graph. The remaining edge is called the leading edge and is the representative of the other edges.
  2. Invoke the core layouter on the now parallel edge free graph.
  3. Reinsert all formerly removed edges of the graph.
  4. Route the parallel edges such that they run in parallel to their leading edge which was routed by the core layouter.



Public Properties
 PropertyDefined By
  absJoinEndDistance : Number
Specifies the absolute distance from the end point of the lines to the first parallel segments if end joining is enabled.
ParallelEdgeLayouter
  adaptiveLineDistances : Boolean
Specifies whether or not the line distances between parallel edges should be determined automatically according to the nodes' bounds.
ParallelEdgeLayouter
  adjustLeadingEdge : Boolean
Specifies whether this layouter will adjust the leading edge to obtain more symmetric results.
ParallelEdgeLayouter
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
  directedMode : Boolean
Specifies whether or not edges should be considered as directed.
ParallelEdgeLayouter
  joinEnds : Boolean
Specifies whether or not to join end points of parallel edges.
ParallelEdgeLayouter
  lineDistance : Number
Specifies the distance between two adjacent paths that run in parallel.
ParallelEdgeLayouter
  parallelEdges : EdgeMap
EdgeMap that associates a hidden edge with the unique parallel edge not hidden from the core layouter.
ParallelEdgeLayouter
  relJoinEndDistance : Number
Specifies the relative distance from the end point of the lines to the first parallel segments if end joining is enabled.
ParallelEdgeLayouter
Protected Properties
 PropertyDefined By
  hiddenEdges : EdgeList
Holds the list of parallel edges that are hidden from the core layouter.
ParallelEdgeLayouter
  _lineDistance : Number
Holds the line distance assigned between parallel edges.
ParallelEdgeLayouter
Public Methods
 MethodDefined By
  
ParallelEdgeLayouter(init:Boolean = true)
Creates a new instance of ParallelEdgeLayouter with no core layouter assigned.
ParallelEdgeLayouter
  
canLayout(graph:LayoutGraph):Boolean
[override]
ParallelEdgeLayouter
  
doLayout(graph:LayoutGraph):void
[override]
ParallelEdgeLayouter
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
ParallelEdgeLayouter
 Inherited
hashCode():int
YObject
  
[static] Creates a new instance of ParallelEdgeLayouter with no core layouter assigned.
ParallelEdgeLayouter
  
[static] Creates a new instance of ParallelEdgeLayouter for the given core layouter.
ParallelEdgeLayouter
Protected Methods
 MethodDefined By
 Inherited
canLayoutCore(graph:LayoutGraph):Boolean
Queries the core layouter whether or not the given graph can be laid out.
AbstractLayoutStage
 Inherited
Invokes the layout routine of the core layouter.
AbstractLayoutStage
  
This method detects parallel edges of the given graph.
ParallelEdgeLayouter
 Inherited
AbstractLayoutStage
 Inherited
AbstractLayoutStage
  
Initializes this object.
ParallelEdgeLayouter
  
Initializes this object.
ParallelEdgeLayouter
  
layoutParallelEdges(graph:LayoutGraph, parallelEdges:EdgeMap):void
This method assigns a layout to parallel edges.
ParallelEdgeLayouter
Public Constants
 ConstantDefined By
  LEADING_EDGE_DPKEY : Object = y.layout.ParallelEdgeLayouter.MASTER_EDGE_DPKEY
[static] A com.yworks.yfiles.base.DataProvider key that can be used to specify which parallel edge should be used as leading edge, i.e., as the edge whose layout is used to obtain the layout of the corresponding parallel edges.
ParallelEdgeLayouter
  SCOPE_DPKEY : Object = y.layout.ParallelEdgeLayouter.SCOPE_DPKEY
[static] A com.yworks.yfiles.base.DataProvider key that can be used to tell the stage whether edges should be included in or excluded from the calculation.
ParallelEdgeLayouter
Property Detail
_lineDistanceproperty
protected var _lineDistance:Number

Holds the line distance assigned between parallel edges.

absJoinEndDistanceproperty 
absJoinEndDistance:Number

Specifies the absolute distance from the end point of the lines to the first parallel segments if end joining is enabled.


Implementation
    public function get absJoinEndDistance():Number
    public function set absJoinEndDistance(value:Number):void
adaptiveLineDistancesproperty 
adaptiveLineDistances:Boolean

Specifies whether or not the line distances between parallel edges should be determined automatically according to the nodes' bounds. If enabled, the line distances are chosen such that all parallel edges can be drawn straight-line and still connect to the nodes' bounds. By default this feature is enabled.


Implementation
    public function get adaptiveLineDistances():Boolean
    public function set adaptiveLineDistances(value:Boolean):void
adjustLeadingEdgeproperty 
adjustLeadingEdge:Boolean

Specifies whether this layouter will adjust the leading edge to obtain more symmetric results. By default, this feature is enabled.


Implementation
    public function get adjustLeadingEdge():Boolean
    public function set adjustLeadingEdge(value:Boolean):void
directedModeproperty 
directedMode:Boolean

Specifies whether or not edges should be considered as directed. In directed mode only edges that have the same source and target node will be routed in parallel (e.g., two edges (v,w) and (w,v) won't be routed in parallel). In undirected mode, all edges connecting the same pair of nodes will be routed in parallel. By default this feature is disabled.


Implementation
    public function get directedMode():Boolean
    public function set directedMode(value:Boolean):void
hiddenEdgesproperty 
protected var hiddenEdges:EdgeList

Holds the list of parallel edges that are hidden from the core layouter.

joinEndsproperty 
joinEnds:Boolean

Specifies whether or not to join end points of parallel edges. If enabled all lines end at the same point. By default, this feature is disabled.


Implementation
    public function get joinEnds():Boolean
    public function set joinEnds(value:Boolean):void
lineDistanceproperty 
lineDistance:Number

Specifies the distance between two adjacent paths that run in parallel. Note: if adaptive line distances are used (see adaptiveLineDistances) the real distance may be less than the given line distance.


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

See also

parallelEdgesproperty 
public var parallelEdges:EdgeMap

EdgeMap that associates a hidden edge with the unique parallel edge not hidden from the core layouter.

relJoinEndDistanceproperty 
relJoinEndDistance:Number

Specifies the relative distance from the end point of the lines to the first parallel segments if end joining is enabled. The length will be relative to the corresponding original segment's length.


Implementation
    public function get relJoinEndDistance():Number
    public function set relJoinEndDistance(value:Number):void
Constructor Detail
ParallelEdgeLayouter()Constructor
public function ParallelEdgeLayouter(init:Boolean = true)

Creates a new instance of ParallelEdgeLayouter with no core layouter assigned.

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
canLayout()method
override public function canLayout(graph:LayoutGraph):Boolean

Parameters

graph:LayoutGraph

Returns
Boolean
doLayout()method 
override public function doLayout(graph:LayoutGraph):void

Parameters

graph:LayoutGraph

findAndHideParallelEdges()method 
protected function findAndHideParallelEdges(graph:Graph):void

This method detects parallel edges of the given graph. From each set of parallel edges it hides all but one edge from the given graph.

Parameters

graph:Graph

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

Returns
Class
initParallelEdgeLayouter1()method 
protected final function initParallelEdgeLayouter1():void

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

See also

initParallelEdgeLayouter2()method 
protected final function initParallelEdgeLayouter2(coreLayouter:Layouter):void

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

Parameters

coreLayouter:Layouter

See also

layoutParallelEdges()method 
protected function layoutParallelEdges(graph:LayoutGraph, parallelEdges:EdgeMap):void

This method assigns a layout to parallel edges. The layout for each parallel edge follows the layout of the one edge not being removed from the core layouter.

Parameters

graph:LayoutGraph
 
parallelEdges:EdgeMap

newParallelEdgeLayouter1()method 
public static function newParallelEdgeLayouter1():ParallelEdgeLayouter

Creates a new instance of ParallelEdgeLayouter with no core layouter assigned.

Returns
ParallelEdgeLayouter
newParallelEdgeLayouter2()method 
public static function newParallelEdgeLayouter2(coreLayouter:Layouter):ParallelEdgeLayouter

Creates a new instance of ParallelEdgeLayouter for the given core layouter.

Parameters

coreLayouter:Layouter

Returns
ParallelEdgeLayouter

See also

Constant Detail
LEADING_EDGE_DPKEYConstant
public static const LEADING_EDGE_DPKEY:Object = y.layout.ParallelEdgeLayouter.MASTER_EDGE_DPKEY

A com.yworks.yfiles.base.DataProvider key that can be used to specify which parallel edge should be used as leading edge, i.e., as the edge whose layout is used to obtain the layout of the corresponding parallel edges. For every com.yworks.yfiles.base.Edge instance the provider should yield boolean (com.yworks.yfiles.base.DataProvider.getBool()) values to indicate whether an edge is a leading edge.

See also

SCOPE_DPKEYConstant 
public static const SCOPE_DPKEY:Object = y.layout.ParallelEdgeLayouter.SCOPE_DPKEY

A com.yworks.yfiles.base.DataProvider key that can be used to tell the stage whether edges should be included in or excluded from the calculation. For every com.yworks.yfiles.base.Edge instance the provider should yield boolean (com.yworks.yfiles.base.DataProvider.getBool()) values to indicate whether an edge should be laid out. If no data provider is registered for the given key, all edges will be laid out.

See also