Packagecom.yworks.yfiles.layout
Classpublic class LayoutMultiplexer
InheritanceLayoutMultiplexer Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object

This class delegates its layout calls to a core layout algorithm that is dynamically chosen at runtime by inspecting the nodes of the input graph.

If a data provider is registered with the given graph using the look-up key LAYOUTER_DPKEY it is used to retrieve the com.yworks.yfiles.layout.Layouter objects that are stored for the graph's nodes. If no such data provider is registered, this layout stage's core layouter (if any) is used for layout calculation of all nodes. Note that the first non-null Layouter retrieved from the data provider is used for all nodes.

The main purpose of this class is to enable the use of individual layout algorithms for components (when used as the core layouter of class com.yworks.yfiles.layout.ComponentLayouter) or for the contents of group nodes (when used as the core layouter of class com.yworks.yfiles.layout.grouping.RecursiveGroupLayouter).

See also

LAYOUTER_DPKEY
com.yworks.yfiles.layout.Layouter
com.yworks.yfiles.layout.ComponentLayouter
com.yworks.yfiles.layout.grouping.RecursiveGroupLayouter


Public Properties
 PropertyDefined By
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
Public Methods
 MethodDefined By
  
LayoutMultiplexer(init:Boolean = true)
LayoutMultiplexer
  
canLayout(graph:LayoutGraph):Boolean
[override]
LayoutMultiplexer
  
doLayout(graph:LayoutGraph):void
[override]
LayoutMultiplexer
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
LayoutMultiplexer
 Inherited
hashCode():int
YObject
  
[static]
LayoutMultiplexer
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
  
Returns the core layout algorithm associated with the nodes contained in the given graph.
LayoutMultiplexer
 Inherited
AbstractLayoutStage
 Inherited
AbstractLayoutStage
  
LayoutMultiplexer
Public Constants
 ConstantDefined By
  LAYOUTER_DPKEY : Object = y.layout.LayoutMultiplexer.LAYOUTER_DPKEY
[static] Look-up key used to register a com.yworks.yfiles.base.DataProvider that provides a com.yworks.yfiles.layout.Layouter object for each node of a graph.
LayoutMultiplexer
Constructor Detail
LayoutMultiplexer()Constructor
public function LayoutMultiplexer(init:Boolean = true)



Parameters
init:Boolean (default = true)
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

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

Returns
Class
getCoreLayouter()method 
protected function getCoreLayouter(graph:LayoutGraph):Layouter

Returns the core layout algorithm associated with the nodes contained in the given graph. The default implementation looks up the layout algorithm in the data provider registered with the key LAYOUTER_DPKEY .

Parameters

graph:LayoutGraph

Returns
Layouter

See also

initLayoutMultiplexer()method 
protected final function initLayoutMultiplexer():void

newLayoutMultiplexer()method 
public static function newLayoutMultiplexer():LayoutMultiplexer

Returns
LayoutMultiplexer
Constant Detail
LAYOUTER_DPKEYConstant
public static const LAYOUTER_DPKEY:Object = y.layout.LayoutMultiplexer.LAYOUTER_DPKEY

Look-up key used to register a com.yworks.yfiles.base.DataProvider that provides a com.yworks.yfiles.layout.Layouter object for each node of a graph.

See also