Packagecom.yworks.yfiles.layout.tree
Classpublic class ARTreeLayouter
InheritanceARTreeLayouter Inheritance CanonicMultiStageLayouter Inheritance YObject Inheritance Object

This tree layouter tries to generate compact tree layouts with a certain aspect ratio. The ratio can be specified for each subtree.

Here is a sample layout output (using an aspect ratio of 1 by 2)



Public Properties
 PropertyDefined By
  aspectRatio : Number
Specifies the preferred aspect ratio for this ARTreeLayouter.
ARTreeLayouter
  bendDistance : Number
Specifies the preferred distance between any two bends of an edge.
ARTreeLayouter
  comparator : Comparator
Specifies the java.util.Comparator that will be used to sort the outgoing edges (com.yworks.yfiles.base.Node.sortOutEdges()) of each local root in the tree before they are being arranged.
ARTreeLayouter
 InheritedcomponentLayouter : LayoutStage
Specifies the LayoutStage responsible for laying out the connected components of the graph.
CanonicMultiStageLayouter
 InheritedcomponentLayouterEnabled : Boolean
Getter: Returns whether or not ComponentLayouter is enabled.
CanonicMultiStageLayouter
 InheritedgroupNodeHider : LayoutStage
Specifies the LayoutStage that is responsible for hiding away grouping information for the layout algorithm.
CanonicMultiStageLayouter
 InheritedhideGroupNodes : Boolean
Specifies whether or not to hide away group nodes before the layout begins.
CanonicMultiStageLayouter
  horizontalSpace : Number
Specifies the horizontal distance between adjacent nodes.
ARTreeLayouter
 InheritedlabelLayouter : LayoutStage
Getter: Returns the algorithm used for placing labels.
CanonicMultiStageLayouter
 InheritedlabelLayouterEnabled : Boolean
Getter: Returns whether or not LabelLayouter is enabled.
CanonicMultiStageLayouter
 InheritedlayoutOrientation : int
Specifies the main layout orientation.
CanonicMultiStageLayouter
 InheritedorientationLayouter : LayoutStage
Specifies the LayoutStage that is responsible for changing the orientation of the computed layout.
CanonicMultiStageLayouter
 InheritedorientationLayouterEnabled : Boolean
Getter: Returns whether or not the OrientationLayouter is enabled.
CanonicMultiStageLayouter
 InheritedparallelEdgeLayouter : LayoutStage
Getter: Returns the LayoutStage responsible for routing parallel edges.
CanonicMultiStageLayouter
 InheritedparallelEdgeLayouterEnabled : Boolean
Getter: Returns whether or not the ParallelEdgeLayouter is enabled.
CanonicMultiStageLayouter
  rootPlacement : Object
Getter: Returns the desired placement of the tree's root node.
ARTreeLayouter
  routingPolicy : Object
Specifies the routing policy used by this ARTreeLayouter.
ARTreeLayouter
 InheritedselfLoopLayouter : LayoutStage
Getter: Returns the LayoutStage used for routing Self-loops.
CanonicMultiStageLayouter
 InheritedselfLoopLayouterEnabled : Boolean
Getter: Returns whether or not the SelfLoopLayouter is enabled.
CanonicMultiStageLayouter
 InheritedsubgraphLayouter : LayoutStage
Specifies the LayoutStage that is responsible for constraining the layout process to a subgraph of the target graph.
CanonicMultiStageLayouter
 InheritedsubgraphLayouterEnabled : Boolean
Getter: Returns whether or not the SubgraphLayouter is enabled.
CanonicMultiStageLayouter
  verticalSpace : Number
Specifies the vertical distance between adjacent nodes.
ARTreeLayouter
Protected Properties
 PropertyDefined By
  graph : LayoutGraph
ARTreeLayouter
Public Methods
 MethodDefined By
  
ARTreeLayouter(init:Boolean = true)
ARTreeLayouter
 Inherited
Appends a stage to the layout pipeline.
CanonicMultiStageLayouter
 Inherited
Returns a layout for the given layout graph.
CanonicMultiStageLayouter
 Inherited
Returns a layout for the given graph interface and layout.
CanonicMultiStageLayouter
 Inherited
canLayout(graph:LayoutGraph):Boolean
Tests whether or not the given graph can be laid out by this layouter.
CanonicMultiStageLayouter
  
canLayoutCore(graph:LayoutGraph):Boolean
[override] The core layouter can layout trees.
ARTreeLayouter
 Inherited
doLayout(layoutGraph:LayoutGraph):void
Calculates a layout for the given graph.
CanonicMultiStageLayouter
 Inherited
Calculates a layout for the given graph interface and layout.
CanonicMultiStageLayouter
  
[override] Core layout routine.
ARTreeLayouter
 Inherited
Disables all layout stages and performs only the core layouter.
CanonicMultiStageLayouter
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
ARTreeLayouter
 Inherited
hashCode():int
YObject
  
[static]
ARTreeLayouter
 Inherited
Prepends a stage to the layout pipeline.
CanonicMultiStageLayouter
 Inherited
Removes a LayoutStage that has been previously added by the methods appendStage() or prependStage().
CanonicMultiStageLayouter
Protected Methods
 MethodDefined By
 Inherited
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
 Inherited
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
  
createBends(el:EdgeLayout, root:Node, child:Node, rootPlacement:Object, routingPolicy:Object):void
ARTreeLayouter
  
Returns the aspectRatio that should be used for the subtree starting at the given node.
ARTreeLayouter
  
getRootPlacement(root:Object):Object
Returns the desired placement for the given subtree root.
ARTreeLayouter
  
getRoutingPolicy(root:Object):Object
Returns the routing policy used by this ARTreeLayouter for the given subtree root.
ARTreeLayouter
  
ARTreeLayouter
  
Initializes this object.
ARTreeLayouter
 Inherited
CanonicMultiStageLayouter
Public Constants
 ConstantDefined By
  PLACEMENT_CORNER : Object = y.layout.tree.ARTreeLayouter.PLACEMENT_CORNER
[static] A constant value to describe the placement of the root of a subtree.
ARTreeLayouter
  PLACEMENT_CORNER_SIDE : Object = y.layout.tree.ARTreeLayouter.PLACEMENT_CORNER_SIDE
[static] A constant value to describe the placement of the root of a subtree.
ARTreeLayouter
  PLACEMENT_CORNER_TOP : Object = y.layout.tree.ARTreeLayouter.PLACEMENT_CORNER_TOP
[static] A constant value to describe the placement of the root of a subtree.
ARTreeLayouter
  PLACEMENT_TOP : Object = y.layout.tree.ARTreeLayouter.PLACEMENT_TOP
[static] A constant value to describe the placement of the root of a subtree.
ARTreeLayouter
  RATIO : Object = y.layout.tree.ARTreeLayouter.RATIO
[static] The data provider key used to specify a target aspect ratio for each subtree individually.
ARTreeLayouter
  ROOT_PLACEMENT : Object = y.layout.tree.ARTreeLayouter.ROOT_PLACEMENT
[static] The data provider key used to specify the placement of each subtree root individually.
ARTreeLayouter
  ROUTING_HORIZONTAL : Object = y.layout.tree.ARTreeLayouter.ROUTING_HORIZONTAL
[static] A constant value to describe the routing for each subtree root.
ARTreeLayouter
  ROUTING_POLICY : Object = y.layout.tree.ARTreeLayouter.ROUTING_POLICY
[static] The data provider key used to specify the routing policy of each subtree root individually.
ARTreeLayouter
  ROUTING_VERTICAL : Object = y.layout.tree.ARTreeLayouter.ROUTING_VERTICAL
[static] A constant value to describe the routing for each subtree root.
ARTreeLayouter
Property Detail
aspectRatioproperty
aspectRatio:Number

Specifies the preferred aspect ratio for this ARTreeLayouter.


Implementation
    public function get aspectRatio():Number
    public function set aspectRatio(value:Number):void
bendDistanceproperty 
bendDistance:Number

Specifies the preferred distance between any two bends of an edge. Additionally, the preferred bend distance governs the distance between the first and last edges and the corresponding ports.


Implementation
    public function get bendDistance():Number
    public function set bendDistance(value:Number):void
comparatorproperty 
comparator:Comparator

Specifies the java.util.Comparator that will be used to sort the outgoing edges (com.yworks.yfiles.base.Node.sortOutEdges()) of each local root in the tree before they are being arranged. Note that the algorithm will only use the order induced by the comparator, if the nodes (or better their whole subtrees) have equal size. The default value is null which indicates that the algorithm should use its built-in logic, only.


Implementation
    public function get comparator():Comparator
    public function set comparator(value:Comparator):void

See also

java.util.Comparator
outgoing edges
graphproperty 
protected var graph:LayoutGraph

horizontalSpaceproperty 
horizontalSpace:Number

Specifies the horizontal distance between adjacent nodes. By default a value of 10 is set.


Implementation
    public function get horizontalSpace():Number
    public function set horizontalSpace(value:Number):void
rootPlacementproperty 
rootPlacement:Object

Getter: Returns the desired placement of the tree's root node. Should be one of

By default, PLACEMENT_CORNER is used.

Setter: Specifies the desired placement of the tree's root node. By default, PLACEMENT_CORNER is used.


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

See also

routingPolicyproperty 
routingPolicy:Object

Specifies the routing policy used by this ARTreeLayouter. Should be one of


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

See also

verticalSpaceproperty 
verticalSpace:Number

Specifies the vertical distance between adjacent nodes. By default a value of 10 is set.


Implementation
    public function get verticalSpace():Number
    public function set verticalSpace(value:Number):void
Constructor Detail
ARTreeLayouter()Constructor
public function ARTreeLayouter(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
canLayoutCore()method
override public function canLayoutCore(graph:LayoutGraph):Boolean

The core layouter can layout trees.

Parameters

graph:LayoutGraph

Returns
Boolean
createBends()method 
protected function createBends(el:EdgeLayout, root:Node, child:Node, rootPlacement:Object, routingPolicy:Object):void

Parameters

el:EdgeLayout
 
root:Node
 
child:Node
 
rootPlacement:Object
 
routingPolicy:Object

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

Core layout routine.

Parameters

graph:LayoutGraph

getAspectRatio()method 
protected function getAspectRatio(v:Node):Number

Returns the aspectRatio that should be used for the subtree starting at the given node.

Parameters

v:Node

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

Returns
Class
getRootPlacement()method 
protected function getRootPlacement(root:Object):Object

Returns the desired placement for the given subtree root. Should be one of

Parameters

root:Object — the subtree root.

Returns
Object — a symbolic constant representing the desired placement for the given subtree root.

See also

getRoutingPolicy()method 
protected function getRoutingPolicy(root:Object):Object

Returns the routing policy used by this ARTreeLayouter for the given subtree root. Should be one of

Parameters

root:Object — the subtree root.

Returns
Object — the routing policy used for the given subtree root.

See also

getSuccessors()method 
protected function getSuccessors(localRoot:Node):NodeCursor

Parameters

localRoot:Node

Returns
NodeCursor
initARTreeLayouter()method 
protected final function initARTreeLayouter():void

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

See also

newARTreeLayouter()method 
public static function newARTreeLayouter():ARTreeLayouter

Returns
ARTreeLayouter
Constant Detail
PLACEMENT_CORNERConstant
public static const PLACEMENT_CORNER:Object = y.layout.tree.ARTreeLayouter.PLACEMENT_CORNER

A constant value to describe the placement of the root of a subtree. When this placement is used, a subtree's root is placed in the upper left corner of the subtree bounds regarding the layout orientation (layoutOrientation).

If the root is placed entirely beside the subtree with no horizontal overlaps or entirely above the node without vertical overlaps will be determined by the layout of the subtree. The layouter tries minimize the bounds of the subtree.

See also

PLACEMENT_CORNER_SIDEConstant 
public static const PLACEMENT_CORNER_SIDE:Object = y.layout.tree.ARTreeLayouter.PLACEMENT_CORNER_SIDE

A constant value to describe the placement of the root of a subtree. When this placement is used, a subtree's root is placed in the upper left corner of the subtree bounds regarding the layout orientation (layoutOrientation).

The root is placed entirely beside the subtree with no horizontal overlaps. This might by important if the root's height is very large while its width is small.

See also

PLACEMENT_CORNER_TOPConstant 
public static const PLACEMENT_CORNER_TOP:Object = y.layout.tree.ARTreeLayouter.PLACEMENT_CORNER_TOP

A constant value to describe the placement of the root of a subtree. When this placement is used, a subtree's root is placed in the upper left corner of the subtree bounds regarding the layout orientation (layoutOrientation).

The root is placed entirely above the subtree with no vertical overlaps. This might by important if the root's width is very large while its height is small.

See also

PLACEMENT_TOPConstant 
public static const PLACEMENT_TOP:Object = y.layout.tree.ARTreeLayouter.PLACEMENT_TOP

A constant value to describe the placement of the root of a subtree. When this placement is used, a subtree's root is placed above its children in relation to the layout orientation (layoutOrientation).

See also

RATIOConstant 
public static const RATIO:Object = y.layout.tree.ARTreeLayouter.RATIO

The data provider key used to specify a target aspect ratio for each subtree individually.

The aspect ratio needs to be greater than 0:

If no specific ratio is defined for a subtree, the layouter uses the default aspect ratio (aspectRatio).

See also

ROOT_PLACEMENTConstant 
public static const ROOT_PLACEMENT:Object = y.layout.tree.ARTreeLayouter.ROOT_PLACEMENT

The data provider key used to specify the placement of each subtree root individually. If no root placement is specified for one of the subtree roots, the layouter uses the default route placement (rootPlacement).

See also

ROUTING_HORIZONTALConstant 
public static const ROUTING_HORIZONTAL:Object = y.layout.tree.ARTreeLayouter.ROUTING_HORIZONTAL

A constant value to describe the routing for each subtree root. When this routing is applied to a subtree, the children will be placed next to each other in direction of the layout orientation (layoutOrientation) with the edges connecting to in flow direction.

See also

ROUTING_POLICYConstant 
public static const ROUTING_POLICY:Object = y.layout.tree.ARTreeLayouter.ROUTING_POLICY

The data provider key used to specify the routing policy of each subtree root individually. The children in a subtree are arranged either horizontal or vertical. The edges are routed to the top of the child nodes or at the side, respectively. Directions depend on the layout orientation (layoutOrientation) and refer to com.yworks.yfiles.layout.LayoutOrientation.TOP_TO_BOTTOM in this case.

If no specific routing policy is specified for a subtree root, the default routing policy (routingPolicy) is used.

See also

ROUTING_VERTICALConstant 
public static const ROUTING_VERTICAL:Object = y.layout.tree.ARTreeLayouter.ROUTING_VERTICAL

A constant value to describe the routing for each subtree root. When this routing is applied to a subtree, the children will be placed above each other in direction of the layout orientation (layoutOrientation) with the edges connecting orthogonal to the flow direction.

See also