Packagecom.yworks.yfiles.layout.grouping
Classpublic class RecursiveGroupLayouter
InheritanceRecursiveGroupLayouter Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object

Recursively traverses a hierarchically organized graph in a bottom-up fashion and applies the given layout algorithm (i.e. the core layouter) to the contents (direct children) of each group node. The size of the group nodes can be further determined by setting a customized GroupBoundsCalculator implementation.

Note that this class can be run without a core layouter instance. In this case no layout is calculated, instead the group node bounds are merely adjusted to fit their respective contents. There are two alternatives for applying different layout styles to the contents of group nodes: 1. Map each group node to the corresponding layouter using data provider key GROUP_NODE_LAYOUTER_DPKEY. The content of the hierarchy root is laid out with the core layouter. 2. Alternatively you can use a com.yworks.yfiles.layout.LayoutMultiplexer as core layouter.

See also

GROUP_NODE_LAYOUTER_DPKEY
com.yworks.yfiles.layout.LayoutMultiplexer


Public Properties
 PropertyDefined By
  autoAssignPortCandidates : Boolean
Specifies whether or not temporary port candidates should be inserted for edges without such candidates.
RecursiveGroupLayouter
  considerEmptyGroups : Boolean
Specifies whether or not group nodes without children are handled the same way as group nodes with children.
RecursiveGroupLayouter
  considerSketch : Boolean
Specifies whether or not to consider the initial coordinates of the graph elements.
RecursiveGroupLayouter
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
  groupBoundsCalculator : GroupBoundsCalculator
Getter: Returns the currently installed GroupBoundsCalculator instance.
RecursiveGroupLayouter
  interEdgeRouter : Layouter
Specifies the current edge router used to layout inter-edges.
RecursiveGroupLayouter
  interEdgesDpKey : Object
Specifies the key that is used to mark the inter-edges to be routed.
RecursiveGroupLayouter
  replacePortConstraints : Boolean
Specifies whether or not port constraints should be temporarily replaced by port candidates.
RecursiveGroupLayouter
Public Methods
 MethodDefined By
  
RecursiveGroupLayouter(init:Boolean = true)
Creates a new instance of RecursiveGroupLayouter.
RecursiveGroupLayouter
  
canLayout(graph:LayoutGraph):Boolean
[override]
RecursiveGroupLayouter
  
doLayout(graph:LayoutGraph):void
[override]
RecursiveGroupLayouter
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
RecursiveGroupLayouter
 Inherited
hashCode():int
YObject
  
[static] Creates a new instance of RecursiveGroupLayouter.
RecursiveGroupLayouter
  
[static] Creates a new instance of RecursiveGroupLayouter using the given layout algorithm.
RecursiveGroupLayouter
  
[static] Creates a new instance of RecursiveGroupLayouter using the given layout algorithm and GroupBoundsCalculator implementation.
RecursiveGroupLayouter
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.
RecursiveGroupLayouter
  
Initializes this object.
RecursiveGroupLayouter
  
Initializes this object.
RecursiveGroupLayouter
  
routeInterEdges(graph:LayoutGraph, interEdges:EdgeList):void
This method is called after calculating the overall layout and reroutes the inter-edges, i.e., edges which traverse the boundary of a group node.
RecursiveGroupLayouter
Public Constants
 ConstantDefined By
  GROUP_NODE_LAYOUTER_DPKEY : Object = y.layout.grouping.RecursiveGroupLayouter.GROUP_NODE_LAYOUTER_DPKEY
[static] com.yworks.yfiles.base.DataProvider key used to retrieve a com.yworks.yfiles.layout.Layouter instance for each group node.
RecursiveGroupLayouter
  NULL_LAYOUTER : Layouter
[static] A constant that represents a layouter implementation that does nothing.
RecursiveGroupLayouter
Property Detail
autoAssignPortCandidatesproperty
autoAssignPortCandidates:Boolean

Specifies whether or not temporary port candidates should be inserted for edges without such candidates. If we do not insert such port candidates, inter-edges (edges which traverse the boundary of a group node) always end at the border/center of the corresponding group node and, thus, are routed straight-line (see routeInterEdges()). Hence, enabling this option may produce more suitable edge routes if the layout algorithm applied to the content of a group node can handle port candidates. The default value is false. Note: predefined port candidates are always satisfied, even if this option is disabled (only if the applied layouter supports them).


Implementation
    public function get autoAssignPortCandidates():Boolean
    public function set autoAssignPortCandidates(value:Boolean):void

See also

considerEmptyGroupsproperty 
considerEmptyGroups:Boolean

Specifies whether or not group nodes without children are handled the same way as group nodes with children. Defaults to true.


Implementation
    public function get considerEmptyGroups():Boolean
    public function set considerEmptyGroups(value:Boolean):void

See also

considerSketchproperty 
considerSketch:Boolean

Specifies whether or not to consider the initial coordinates of the graph elements. This option should be enabled if the recursive group layouter uses a layouter that runs in "from sketch mode". If it is enabled, the recursive group layouter sets the coordinates of the node elements to their initial position before the corresponding layouter is called. By default this option is disabled.


Implementation
    public function get considerSketch():Boolean
    public function set considerSketch(value:Boolean):void
groupBoundsCalculatorproperty 
groupBoundsCalculator:GroupBoundsCalculator

Getter: Returns the currently installed GroupBoundsCalculator instance.

Setter: Sets a new GroupBoundsCalculator instance that applies to all encountered group nodes.


Implementation
    public function get groupBoundsCalculator():GroupBoundsCalculator
    public function set groupBoundsCalculator(value:GroupBoundsCalculator):void
interEdgeRouterproperty 
interEdgeRouter:Layouter

Specifies the current edge router used to layout inter-edges. During layout edges that connect from outside a group node to the content inside (inter-edges) are temporarily connected to the group node itself. Hence, they are routed when the original graph structure is restored using this edge router.

It is required that a suitable selection key (interEdgesDpKey) is specified. The same selection key must be used to set the sphere of action for the edge router.

By default, no edge router is specified.


Implementation
    public function get interEdgeRouter():Layouter
    public function set interEdgeRouter(value:Layouter):void

See also

interEdgesDpKeyproperty 
interEdgesDpKey:Object

Specifies the key that is used to mark the inter-edges to be routed. Note that this layouter automatically marks these edges and registers the DataProvider using the specified key. The key should be used by the specified inter-edge router to obtain the edges to be routed.

By default, com.yworks.yfiles.layout.LayouterKeys.SELECTED_EDGES is used.


Implementation
    public function get interEdgesDpKey():Object
    public function set interEdgesDpKey(value:Object):void

Throws
IllegalArgumentException — if the specified key is null.

See also

replacePortConstraintsproperty 
replacePortConstraints:Boolean

Specifies whether or not port constraints should be temporarily replaced by port candidates. If port constraints are not replaced by port candidates, inter-edges (edges which traverse the boundary of a group node) always end at the border/center of the corresponding group node (even if those edges have port constraints) and, thus, are routed straight-line (see routeInterEdges()) without considering the constraint. Port candidates are automatically redirected to their original location. Hence, enabling this option may produce more suitable edge routes if the layout algorithm applied to the content of a group node can handle port candidates. The default value is true.


Implementation
    public function get replacePortConstraints():Boolean
    public function set replacePortConstraints(value:Boolean):void

See also

Constructor Detail
RecursiveGroupLayouter()Constructor
public function RecursiveGroupLayouter(init:Boolean = true)

Creates a new instance of RecursiveGroupLayouter.

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

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

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

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

See also

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

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

Parameters

core:Layouter

See also

initRecursiveGroupLayouter3()method 
protected final function initRecursiveGroupLayouter3(core:Layouter, gbc:GroupBoundsCalculator):void

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

Parameters

core:Layouter
 
gbc:GroupBoundsCalculator

See also

newRecursiveGroupLayouter1()method 
public static function newRecursiveGroupLayouter1():RecursiveGroupLayouter

Creates a new instance of RecursiveGroupLayouter.

Returns
RecursiveGroupLayouter
newRecursiveGroupLayouter2()method 
public static function newRecursiveGroupLayouter2(core:Layouter):RecursiveGroupLayouter

Creates a new instance of RecursiveGroupLayouter using the given layout algorithm.

Parameters

core:Layouter

Returns
RecursiveGroupLayouter
newRecursiveGroupLayouter3()method 
public static function newRecursiveGroupLayouter3(core:Layouter, gbc:GroupBoundsCalculator):RecursiveGroupLayouter

Creates a new instance of RecursiveGroupLayouter using the given layout algorithm and GroupBoundsCalculator implementation.

Parameters

core:Layouter
 
gbc:GroupBoundsCalculator

Returns
RecursiveGroupLayouter
routeInterEdges()method 
protected function routeInterEdges(graph:LayoutGraph, interEdges:EdgeList):void

This method is called after calculating the overall layout and reroutes the inter-edges, i.e., edges which traverse the boundary of a group node. More precisely, if those edges do not have port candidates or the applied layout algorithm does not support this kind of constraints, the route of inter-edges always ends at the border/center of the corresponding group node. This method identifies such edges and routes them using the specified edge router. By default, these edges are routed straight-line.

Parameters

graph:LayoutGraph — the input graph.
 
interEdges:EdgeList — the edges which traverse the boundary of a group node.

See also

Constant Detail
GROUP_NODE_LAYOUTER_DPKEYConstant
public static const GROUP_NODE_LAYOUTER_DPKEY:Object = y.layout.grouping.RecursiveGroupLayouter.GROUP_NODE_LAYOUTER_DPKEY

com.yworks.yfiles.base.DataProvider key used to retrieve a com.yworks.yfiles.layout.Layouter instance for each group node. The specified layouter instance is applied to the content of the group node. For the top level elements the core layouter is used. If the data provider returns "null" the corresponding group node is handled non-recursive, i.e., the group node and its content is laid out with the com.yworks.yfiles.layout.Layouter instance specified by the nearest predecessor of the group node (with respect to the grouping hierarchy) which is associated with a layouter. If the content of a group node should not be changed, the group node can be associated with a "null" layouter, e.g., constant NULL_LAYOUTER.

See also

NULL_LAYOUTERConstant 
public static const NULL_LAYOUTER:Layouter

A constant that represents a layouter implementation that does nothing.