Packagecom.yworks.yfiles.layout
Classpublic class CanonicMultiStageLayouter
InheritanceCanonicMultiStageLayouter Inheritance YObject Inheritance Object
Implements Layouter
Subclasses ARTreeLayouter, BalloonLayouter, CircularLayouter, DirectedOrthogonalLayouter, FamilyTreeLayouter, GenericTreeLayouter, GraphTransformer, GRIP, HierarchicLayouter, HierarchicLayouterImpl, HVTreeLayouter, IncrementalHierarchicLayouter, OrganicLayouter, OrthogonalGroupLayouter, OrthogonalLayouter, RadialLayouter, RandomLayouter, SeriesParallelLayouter, SingleCycleLayouter, SmartOrganicLayouter, TreeLayouter

An abstract base class for layout algorithms that provides services to simplify and decompose the input graph before it is passed to the core layout routine itself.

Subclass layout algorithms have to provide implementations for the abstract methods doLayoutCore() and canLayoutCore() The maximal number of steps involved before and after the core layout will be invoked are summarized below.
  1. Copy the input graph
  2. Hide all but the induced subgraph
  3. Decompose the graph into it's connected components. On each component perform the steps 3-11
  4. Prepare for an orientation change
  5. Hide parallel edges
  6. Hide self-loops
  7. Invoke core layouter on simplified graph
  8. Unhide and route self-loops
  9. Unhide and route parallel edges
  10. Complete orientation change of layout
  11. Arrange connected components of the graph
  12. Unhide non-induced subgraph
  13. Assign label positions
  14. Copy layout information back to original input graph or pass out layout information separately
Each of the phases above can be subdued if necessary.

See also

doLayoutCore()
canLayoutCore()


Public Properties
 PropertyDefined By
  componentLayouter : LayoutStage
Specifies the LayoutStage responsible for laying out the connected components of the graph.
CanonicMultiStageLayouter
  componentLayouterEnabled : Boolean
Getter: Returns whether or not ComponentLayouter is enabled.
CanonicMultiStageLayouter
  groupNodeHider : LayoutStage
Specifies the LayoutStage that is responsible for hiding away grouping information for the layout algorithm.
CanonicMultiStageLayouter
  hideGroupNodes : Boolean
Specifies whether or not to hide away group nodes before the layout begins.
CanonicMultiStageLayouter
  labelLayouter : LayoutStage
Getter: Returns the algorithm used for placing labels.
CanonicMultiStageLayouter
  labelLayouterEnabled : Boolean
Getter: Returns whether or not LabelLayouter is enabled.
CanonicMultiStageLayouter
  layoutOrientation : int
Specifies the main layout orientation.
CanonicMultiStageLayouter
  orientationLayouter : LayoutStage
Specifies the LayoutStage that is responsible for changing the orientation of the computed layout.
CanonicMultiStageLayouter
  orientationLayouterEnabled : Boolean
Getter: Returns whether or not the OrientationLayouter is enabled.
CanonicMultiStageLayouter
  parallelEdgeLayouter : LayoutStage
Getter: Returns the LayoutStage responsible for routing parallel edges.
CanonicMultiStageLayouter
  parallelEdgeLayouterEnabled : Boolean
Getter: Returns whether or not the ParallelEdgeLayouter is enabled.
CanonicMultiStageLayouter
  selfLoopLayouter : LayoutStage
Getter: Returns the LayoutStage used for routing Self-loops.
CanonicMultiStageLayouter
  selfLoopLayouterEnabled : Boolean
Getter: Returns whether or not the SelfLoopLayouter is enabled.
CanonicMultiStageLayouter
  subgraphLayouter : LayoutStage
Specifies the LayoutStage that is responsible for constraining the layout process to a subgraph of the target graph.
CanonicMultiStageLayouter
  subgraphLayouterEnabled : Boolean
Getter: Returns whether or not the SubgraphLayouter is enabled.
CanonicMultiStageLayouter
Public Methods
 MethodDefined By
  
CanonicMultiStageLayouter(init:Boolean = true)
Constructs a new AbstractLayouter
CanonicMultiStageLayouter
  
Appends a stage to the layout pipeline.
CanonicMultiStageLayouter
  
Returns a layout for the given layout graph.
CanonicMultiStageLayouter
  
Returns a layout for the given graph interface and layout.
CanonicMultiStageLayouter
  
canLayout(graph:LayoutGraph):Boolean
Tests whether or not the given graph can be laid out by this layouter.
CanonicMultiStageLayouter
  
canLayoutCore(graph:LayoutGraph):Boolean
Subclasses have to provide information whether or not they can layout the given graph.
CanonicMultiStageLayouter
  
doLayout(layoutGraph:LayoutGraph):void
Calculates a layout for the given graph.
CanonicMultiStageLayouter
  
Calculates a layout for the given graph interface and layout.
CanonicMultiStageLayouter
  
Subclasses have to provide core layout code in this method.
CanonicMultiStageLayouter
  
Disables all layout stages and performs only the core layouter.
CanonicMultiStageLayouter
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
CanonicMultiStageLayouter
 Inherited
hashCode():int
YObject
  
Prepends a stage to the layout pipeline.
CanonicMultiStageLayouter
  
Removes a LayoutStage that has been previously added by the methods appendStage() or prependStage().
CanonicMultiStageLayouter
Protected Methods
 MethodDefined By
  
checkGroupNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given group node object is zero.
CanonicMultiStageLayouter
  
checkNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given node object is zero.
CanonicMultiStageLayouter
  
CanonicMultiStageLayouter
Property Detail
componentLayouterproperty
componentLayouter:LayoutStage

Specifies the LayoutStage responsible for laying out the connected components of the graph.


Implementation
    public function get componentLayouter():LayoutStage
    public function set componentLayouter(value:LayoutStage):void
componentLayouterEnabledproperty 
componentLayouterEnabled:Boolean

Getter: Returns whether or not ComponentLayouter is enabled.

Setter: Specifies whether or not to enable the ComponentLayouter. By default it is enabled.


Implementation
    public function get componentLayouterEnabled():Boolean
    public function set componentLayouterEnabled(value:Boolean):void
groupNodeHiderproperty 
groupNodeHider:LayoutStage

Specifies the LayoutStage that is responsible for hiding away grouping information for the layout algorithm.


Implementation
    public function get groupNodeHider():LayoutStage
    public function set groupNodeHider(value:LayoutStage):void
hideGroupNodesproperty 
hideGroupNodes:Boolean

Specifies whether or not to hide away group nodes before the layout begins. By default this is enabled for instances that cannot deal with node groupings.


Implementation
    public function get hideGroupNodes():Boolean
    public function set hideGroupNodes(value:Boolean):void
labelLayouterproperty 
labelLayouter:LayoutStage

Getter: Returns the algorithm used for placing labels. By default an instance of class com.yworks.yfiles.layout.labeling.GreedyMISLabeling will be returned.

Setter: Sets the algorithm used for placing labels. Note that assigning a new layout stage will not automatically activate it. To activate this stage use labelLayouterEnabled .


Implementation
    public function get labelLayouter():LayoutStage
    public function set labelLayouter(value:LayoutStage):void

See also

labelLayouterEnabledproperty 
labelLayouterEnabled:Boolean

Getter: Returns whether or not LabelLayouter is enabled.

Setter: Specifies whether or not to enable the labeling algorithm. By default it is disabled.


Implementation
    public function get labelLayouterEnabled():Boolean
    public function set labelLayouterEnabled(value:Boolean):void
layoutOrientationproperty 
layoutOrientation:int

Specifies the main layout orientation. The layouter tries to arrange nodes in such a way that all edges point in the main layout direction.

Note, the documentation for the other layout options assumes that the default layout orientation com.yworks.yfiles.layout.LayoutOrientation.TOP_TO_BOTTOM is being used.


Implementation
    public function get layoutOrientation():int
    public function set layoutOrientation(value:int):void

See also

orientationLayouterproperty 
orientationLayouter:LayoutStage

Specifies the LayoutStage that is responsible for changing the orientation of the computed layout.


Implementation
    public function get orientationLayouter():LayoutStage
    public function set orientationLayouter(value:LayoutStage):void
orientationLayouterEnabledproperty 
orientationLayouterEnabled:Boolean

Getter: Returns whether or not the OrientationLayouter is enabled.

Setter: Specifies whether or not to enable the OrientationLayouter. By default it is activated but does not change orientation of the layout.


Implementation
    public function get orientationLayouterEnabled():Boolean
    public function set orientationLayouterEnabled(value:Boolean):void
parallelEdgeLayouterproperty 
parallelEdgeLayouter:LayoutStage

Getter: Returns the LayoutStage responsible for routing parallel edges. By default an instance of class com.yworks.yfiles.layout.ParallelEdgeLayouter will be returned.

Setter: Sets the ParallelEdgeLayouter responsible for routing parallel edges.


Implementation
    public function get parallelEdgeLayouter():LayoutStage
    public function set parallelEdgeLayouter(value:LayoutStage):void

See also

parallelEdgeLayouterEnabledproperty 
parallelEdgeLayouterEnabled:Boolean

Getter: Returns whether or not the ParallelEdgeLayouter is enabled.

Setter: Specifies whether or not to enable the ParallelEdgeLayouter. By default it is enabled.


Implementation
    public function get parallelEdgeLayouterEnabled():Boolean
    public function set parallelEdgeLayouterEnabled(value:Boolean):void
selfLoopLayouterproperty 
selfLoopLayouter:LayoutStage

Getter: Returns the LayoutStage used for routing Self-loops. By default an instance of class com.yworks.yfiles.layout.SelfLoopLayouter will be returned.

Setter: Sets the LayoutStage responsible for routing Self-loops.


Implementation
    public function get selfLoopLayouter():LayoutStage
    public function set selfLoopLayouter(value:LayoutStage):void

See also

selfLoopLayouterEnabledproperty 
selfLoopLayouterEnabled:Boolean

Getter: Returns whether or not the SelfLoopLayouter is enabled.

Setter: Specifies whether or not to enable the SelfLoopLayouter. By default it is enabled.


Implementation
    public function get selfLoopLayouterEnabled():Boolean
    public function set selfLoopLayouterEnabled(value:Boolean):void
subgraphLayouterproperty 
subgraphLayouter:LayoutStage

Specifies the LayoutStage that is responsible for constraining the layout process to a subgraph of the target graph.


Implementation
    public function get subgraphLayouter():LayoutStage
    public function set subgraphLayouter(value:LayoutStage):void
subgraphLayouterEnabledproperty 
subgraphLayouterEnabled:Boolean

Getter: Returns whether or not the SubgraphLayouter is enabled.

Setter: Specifies whether or not to enable the SubgraphLayouter. By default it is disabled.


Implementation
    public function get subgraphLayouterEnabled():Boolean
    public function set subgraphLayouterEnabled(value:Boolean):void
Constructor Detail
CanonicMultiStageLayouter()Constructor
public function CanonicMultiStageLayouter(init:Boolean = true)

Constructs a new AbstractLayouter

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
appendStage()method
public function appendStage(stage:LayoutStage):void

Appends a stage to the layout pipeline. Stages added with this method will be invoked just before the core layouter will be invoked.

Parameters

stage:LayoutStage

calcLayout()method 
public function calcLayout(layoutGraph:LayoutGraph):GraphLayout

Returns a layout for the given layout graph. The given graph will not be modified by the layout process.

Parameters

layoutGraph:LayoutGraph

Returns
GraphLayout
calcLayout2()method 
public function calcLayout2(graph:GraphInterface, layout:GraphLayout):GraphLayout

Returns a layout for the given graph interface and layout. The given graph and layout will not be modified by the layout process.

Parameters

graph:GraphInterface
 
layout:GraphLayout

Returns
GraphLayout
canLayout()method 
public function canLayout(graph:LayoutGraph):Boolean

Tests whether or not the given graph can be laid out by this layouter. All stage layouters and the core layouter must be able to calculate the layout to make this test successful.

Parameters

graph:LayoutGraph

Returns
Boolean
canLayoutCore()method 
public function canLayoutCore(graph:LayoutGraph):Boolean

Subclasses have to provide information whether or not they can layout the given graph.

Parameters

graph:LayoutGraph

Returns
Boolean
checkGroupNodeSize()method 
protected function checkGroupNodeSize(layout:GraphLayout, node:Object):void

This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given group node object is zero. It is called by the doLayout() method for each group node object in the input graph.

Parameters

layout:GraphLayout — a graph layout object.
 
node:Object — the group node object to test.


Throws
IllegalArgumentException — thrown if the width/height of the group node object is zero.

See also

checkNodeSize()method 
protected function checkNodeSize(layout:GraphLayout, node:Object):void

This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given node object is zero. It is called by the doLayout() method for each node object in the input graph.

Parameters

layout:GraphLayout — a graph layout object.
 
node:Object — the node object to test.


Throws
IllegalArgumentException — thrown if the width/height of the node object is zero.

See also

doLayout()method 
public function doLayout(layoutGraph:LayoutGraph):void

Calculates a layout for the given graph. The given graph will not be copied during the layout process and the layout will be immediately applied to the given graph. This method is not side effect free in the sense that the order of edges or nodes in the input graph may change during the layout process.

Parameters

layoutGraph:LayoutGraph

doLayout2()method 
public function doLayout2(graph:GraphInterface, layout:GraphLayout):void

Calculates a layout for the given graph interface and layout. The calculated layout will be written back to the given layout.

Parameters

graph:GraphInterface
 
layout:GraphLayout

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

Subclasses have to provide core layout code in this method.

Parameters

graph:LayoutGraph

enableOnlyCore()method 
public function enableOnlyCore():void

Disables all layout stages and performs only the core layouter.

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

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

prependStage()method 
public function prependStage(stage:LayoutStage):void

Prepends a stage to the layout pipeline. Stage added with this method will be invoked before any other stages will be invoked.

Parameters

stage:LayoutStage

removeStage()method 
public function removeStage(stage:LayoutStage):void

Removes a LayoutStage that has been previously added by the methods appendStage() or prependStage().

Parameters

stage:LayoutStage

See also