Packagecom.yworks.yfiles.layout
Classpublic class EdgeReversalStage
InheritanceEdgeReversalStage Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object

A layout stage that can be used to (selectively) reverse edges in a graph while keeping the layout and label positions of the reversed edges as close to the pre-reversal layout and positions as possible.



Public Properties
 PropertyDefined By
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
Public Methods
 MethodDefined By
  
EdgeReversalStage(init:Boolean = true)
EdgeReversalStage
  
canLayout(graph:LayoutGraph):Boolean
[override]
EdgeReversalStage
  
doLayout(graph:LayoutGraph):void
[override]
EdgeReversalStage
 Inherited
equals(o:Object):Boolean
YObject
  
findReversedTreeEdges(graph:LayoutGraph, root:Node, reversedEdges:DataAcceptor):void
[static] Marks edges in a tree-structured graph component that need to be reversed to make the specified node the root of the tree component.
EdgeReversalStage
  
getClass():Class
[override]
EdgeReversalStage
 Inherited
hashCode():int
YObject
  
[static]
EdgeReversalStage
  
[static]
EdgeReversalStage
  
reverseEdge(graph:LayoutGraph, edge:Edge):void
Reverse the specified edge in the specified graph.
EdgeReversalStage
  
Reverses selected edges in the specified graph.
EdgeReversalStage
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
 Inherited
AbstractLayoutStage
 Inherited
AbstractLayoutStage
  
Initializes this object.
EdgeReversalStage
  
Initializes this object.
EdgeReversalStage
Public Constants
 ConstantDefined By
  REVERSE_EDGES_DPKEY : Object = y.layout.EdgeReversalStage.REVERSE_EDGES_DPKEY
[static] This key can be used to select specific edges for reversal.
EdgeReversalStage
Constructor Detail
EdgeReversalStage()Constructor
public function EdgeReversalStage(init:Boolean = true)

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

findReversedTreeEdges()method 
public static function findReversedTreeEdges(graph:LayoutGraph, root:Node, reversedEdges:DataAcceptor):void

Marks edges in a tree-structured graph component that need to be reversed to make the specified node the root of the tree component. Only edges in the graph component to which the specified node belongs will be marked. Edges are marked with a boolean true flag.

Parameters

graph:LayoutGraph — the graph to which the specified node belongs.
 
root:Node — the node to be considered the root of its tree component.
 
reversedEdges:DataAcceptor — a data acceptor that is used to mark edges for reversal.


Throws
IllegalArgumentException — if the specified node does not belong to the specified graph.

See also

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

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

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

See also

initEdgeReversalStage2()method 
protected final function initEdgeReversalStage2(core:Layouter):void

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

Parameters

core:Layouter

See also

newEdgeReversalStage1()method 
public static function newEdgeReversalStage1():EdgeReversalStage

Returns
EdgeReversalStage
newEdgeReversalStage2()method 
public static function newEdgeReversalStage2(core:Layouter):EdgeReversalStage

Parameters

core:Layouter

Returns
EdgeReversalStage
reverseEdge()method 
public function reverseEdge(graph:LayoutGraph, edge:Edge):void

Reverse the specified edge in the specified graph. The layout of the specified edge is reversed as specified in com.yworks.yfiles.layout.LayoutTool.reverseEdgeLayout(). Moreover, the positions of all labels associated to the specified edge are adjusted to match the pre-reversal position as closely as possible. (Depending on a label's model it might not always be possible to achieve an exact match.)

Parameters

graph:LayoutGraph — the graph to which the specified edge belongs.
 
edge:Edge — the edge to be reversed.

See also

reverseEdges()method 
public function reverseEdges(graph:LayoutGraph):void

Reverses selected edges in the specified graph. An edge is considered selected in this context according to the criteria described for REVERSE_EDGES_DPKEY.

Implementation detail: This method calls reverseEdge() in order to reverse a selected edge.

Parameters

graph:LayoutGraph — the graph in which to reverse edges.

See also

Constant Detail
REVERSE_EDGES_DPKEYConstant
public static const REVERSE_EDGES_DPKEY:Object = y.layout.EdgeReversalStage.REVERSE_EDGES_DPKEY

This key can be used to select specific edges for reversal. An edge is considered selected in this context, if the corresponding DataProvider returns true for said edge.

Note: If there is no DataProvider for this key, all edges are considered selected.