Packagecom.yworks.yfiles.layout
Classpublic class NormalizingGraphElementOrderStage
InheritanceNormalizingGraphElementOrderStage Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object

Layout stage that can be used to normalize the order of the elements within a graph. Amongst other factors, the results produced by layout algorithms usually depend on the order of the nodes and edges within a graph. Unfortunately, useful operations such as hiding or unhiding elements from a graph or simply invoking layout algorithms on a graph will have the potential side effect of changing that order. With this layout stage it is possible to establish a predefined order of nodes and edges within a graph to avoid non-deterministic layout behavior. Defining the order of nodes and edges is done by associating each node or edge in the graph with a Comparable value using DataProviders registered with the key COMPARABLE_NODE_DPKEY, or COMPARABLE_EDGE_DPKEY respectively. the DataProvider key

See also

COMPARABLE_NODE_DPKEY
COMPARABLE_EDGE_DPKEY


Public Properties
 PropertyDefined By
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
Public Methods
 MethodDefined By
  
NormalizingGraphElementOrderStage
  
canLayout(graph:LayoutGraph):Boolean
[override]
NormalizingGraphElementOrderStage
  
doLayout(graph:LayoutGraph):void
[override]
NormalizingGraphElementOrderStage
 Inherited
equals(o:Object):Boolean
YObject
  
fillComparableMapFromGraph(graph:Graph, comparableNodeMap:DataMap, comparableEdgeMap:DataMap):void
[static] Convenience method that assigns comparable values for each node and edge.
NormalizingGraphElementOrderStage
  
getClass():Class
[override]
NormalizingGraphElementOrderStage
 Inherited
hashCode():int
YObject
  
[static]
NormalizingGraphElementOrderStage
  
[static]
NormalizingGraphElementOrderStage
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.
NormalizingGraphElementOrderStage
  
Initializes this object.
NormalizingGraphElementOrderStage
Public Constants
 ConstantDefined By
  COMPARABLE_EDGE_DPKEY : Object = y.layout.NormalizingGraphElementOrderStage.COMPARABLE_EDGE_DPKEY
[static] The DataProvider registered with this key must return a com.yworks.bridge.util.Comparable object for each edge thereby inducing a (global) order for edges.
NormalizingGraphElementOrderStage
  COMPARABLE_NODE_DPKEY : Object = y.layout.NormalizingGraphElementOrderStage.COMPARABLE_NODE_DPKEY
[static] The DataProvider registered with this key must return a com.yworks.bridge.util.Comparable object for each node thereby inducing a (global) order for nodes.
NormalizingGraphElementOrderStage
Constructor Detail
NormalizingGraphElementOrderStage()Constructor
public function NormalizingGraphElementOrderStage(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

fillComparableMapFromGraph()method 
public static function fillComparableMapFromGraph(graph:Graph, comparableNodeMap:DataMap, comparableEdgeMap:DataMap):void

Convenience method that assigns comparable values for each node and edge. The compared values are induced from the current ordering of the nodes and edges within the given graph.

Parameters

graph:Graph
 
comparableNodeMap:DataMap
 
comparableEdgeMap:DataMap

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

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

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

See also

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

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

Parameters

coreLayouter:Layouter

See also

newNormalizingGraphElementOrderStage1()method 
public static function newNormalizingGraphElementOrderStage1():NormalizingGraphElementOrderStage

Returns
NormalizingGraphElementOrderStage
newNormalizingGraphElementOrderStage2()method 
public static function newNormalizingGraphElementOrderStage2(coreLayouter:Layouter):NormalizingGraphElementOrderStage

Parameters

coreLayouter:Layouter

Returns
NormalizingGraphElementOrderStage
Constant Detail
COMPARABLE_EDGE_DPKEYConstant
public static const COMPARABLE_EDGE_DPKEY:Object = y.layout.NormalizingGraphElementOrderStage.COMPARABLE_EDGE_DPKEY

The DataProvider registered with this key must return a com.yworks.bridge.util.Comparable object for each edge thereby inducing a (global) order for edges.

See also

COMPARABLE_NODE_DPKEYConstant 
public static const COMPARABLE_NODE_DPKEY:Object = y.layout.NormalizingGraphElementOrderStage.COMPARABLE_NODE_DPKEY

The DataProvider registered with this key must return a com.yworks.bridge.util.Comparable object for each node thereby inducing a (global) order for nodes.

See also