Packagecom.yworks.yfiles.layout.tree
Classpublic class GridNodePlacer
InheritanceGridNodePlacer Inheritance AbstractRotatableNodePlacer Inheritance YObject Inheritance Object

This NodePlacer arranges nodes into a grid. The grid consists of a number of columns. Rows are filled automatically by the placer. Each row is filled from left to right. When all columns in a row are filled, the next row is created.



Public Properties
 PropertyDefined By
 InheritedmodificationMatrix : AbstractRotatableNodePlacer_Matrix
[read-only] The actual modification matrix
AbstractRotatableNodePlacer
  rootAlignment : AbstractRotatableNodePlacer_RootAlignment
Specifies the horizontal alignment of the root node.
GridNodePlacer
 Inheritedspacing : Number
Specifies the spacing between subtrees this NodePlacer is arranging.
AbstractRotatableNodePlacer
Protected Properties
 PropertyDefined By
 InheritedcreatedChildren : List
List containing the created children
AbstractRotatableNodePlacer
 Inheritedgraph : LayoutGraph
The graph instance this class is working on
AbstractRotatableNodePlacer
 InheritednodeShapeProvider : DataProvider
The actual node shape provider
AbstractRotatableNodePlacer
 Inherited_spacing : Number
This is the "default" spacing for the different move operations.
AbstractRotatableNodePlacer
 InheritedsubtreeShapeProvider : DataProvider
The actual subtree shape provider
AbstractRotatableNodePlacer
Public Methods
 MethodDefined By
  
GridNodePlacer(init:Boolean = true)
Creates a grid placer with the modification matrix com.yworks.yfiles.layout.tree.AbstractRotatableNodePlacer_Matrix.DEFAULT
GridNodePlacer
 Inherited
AbstractRotatableNodePlacer
  
[override] Creates a comparator that uses the positions of the target nodes to order edges.
GridNodePlacer
 Inherited
Creates an optional Processor for pre- and post-processing.
AbstractRotatableNodePlacer
 Inherited
determineChildConnectors(localRoot:Node, connectorMap:DataMap):void
This method initializes internal data structures, then uses the abstract method determineChildConnector() to determine the child node connector directions.
AbstractRotatableNodePlacer
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
GridNodePlacer
 Inherited
hashCode():int
YObject
  
[static] Creates a grid placer with the modification matrix com.yworks.yfiles.layout.tree.AbstractRotatableNodePlacer_Matrix.DEFAULT
GridNodePlacer
  
[static] Creates grid placer with a given modification matrix.
GridNodePlacer
  
[static] Creates grid placer with a given modification matrix and the horizontal alignment of the root.
GridNodePlacer
 Inherited
placeSubtree(nodeShapeProvider:DataProvider, subtreeShapeProvider:DataProvider, graph:LayoutGraph, localRoot:Node, parentConnectorDirection:int):GenericTreeLayouter_SubtreeShape
This method initializes the local data structures and then delegates the work to the abstract variant.
AbstractRotatableNodePlacer
 Inherited
[static] Translates a "real world point" to a "model point"
AbstractRotatableNodePlacer
Protected Methods
 MethodDefined By
 Inherited
createRootNodeShape(node:Node):SubtreeShapeRotated
Convenience method that queries the DataProvider for the shape of a single node as a SubtreeShape instance.
AbstractRotatableNodePlacer
 Inherited
createSubtreeShape(node:Node):SubtreeShapeRotated
Convenience method that queries the DataProvider for a SubtreeShape.
AbstractRotatableNodePlacer
  
[override] Returns com.yworks.yfiles.layout.tree.NodePlacerCompanion.DIRECTION_NORTH.
GridNodePlacer
 Inherited
Lookup method to get the PortConstraint for the local root translated.
AbstractRotatableNodePlacer
 Inherited
Translates the absolute source point of the given edge to the "view coordinates" (translated by the modification matrix)
AbstractRotatableNodePlacer
 Inherited
AbstractRotatableNodePlacer
  
Initializes this object.
GridNodePlacer
  
Initializes this object.
GridNodePlacer
  
Initializes this object.
GridNodePlacer
  
placeSubtreeCore(localRoot:Node, parentConnectorDirection:int):SubtreeShapeRotated
[override] Places the children in a grid.
GridNodePlacer
 Inherited
translateDirectionToModel(realDirection:int):int
Translates a "real" direction into a directionModel direction
AbstractRotatableNodePlacer
 Inherited
translateDirectionToReal(modelDirection:int):int
Translates a modelDirectionModel into the "real" directionModel
AbstractRotatableNodePlacer
Public Constants
 ConstantDefined By
  GRID_DPKEY : Object = y.layout.tree.GridNodePlacer.GRID_DPKEY
[static] Key which can be used to register a data provider that tells the placer in which row a given node should be put into.
GridNodePlacer
Property Detail
rootAlignmentproperty
rootAlignment:AbstractRotatableNodePlacer_RootAlignment

Specifies the horizontal alignment of the root node.


Implementation
    public function get rootAlignment():AbstractRotatableNodePlacer_RootAlignment
    public function set rootAlignment(value:AbstractRotatableNodePlacer_RootAlignment):void
Constructor Detail
GridNodePlacer()Constructor
public function GridNodePlacer(init:Boolean = true)

Creates a grid placer with the modification matrix com.yworks.yfiles.layout.tree.AbstractRotatableNodePlacer_Matrix.DEFAULT

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.

See also

Method Detail
createFromSketchComparator()method
override public function createFromSketchComparator():Comparator

Creates a comparator that uses the positions of the target nodes to order edges. For two edges e1=(s,t1) and e2=(s,t2), e1 is considered to be less than e2, if t1's row is less than t2's row. If both t1 and t2 lie in the same row, then the nodes' x-coordinates are compared.

Returns
Comparator — a comparator that orders edges lexicographically by row and x-coordinate of their target nodes.

See also

determineChildConnector()method 
override protected function determineChildConnector(child:Node):int

Returns com.yworks.yfiles.layout.tree.NodePlacerCompanion.DIRECTION_NORTH.

Parameters

child:Node

Returns
int — com.yworks.yfiles.layout.tree.NodePlacerCompanion.DIRECTION_NORTH.

See also

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

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

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

See also

initGridNodePlacer2()method 
protected final function initGridNodePlacer2(modificationMatrix:AbstractRotatableNodePlacer_Matrix):void

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

Parameters

modificationMatrix:AbstractRotatableNodePlacer_Matrix

See also

initGridNodePlacer3()method 
protected final function initGridNodePlacer3(modificationMatrix:AbstractRotatableNodePlacer_Matrix, rootAlignment:AbstractRotatableNodePlacer_RootAlignment):void

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

Parameters

modificationMatrix:AbstractRotatableNodePlacer_Matrix
 
rootAlignment:AbstractRotatableNodePlacer_RootAlignment

See also

newGridNodePlacer1()method 
public static function newGridNodePlacer1():GridNodePlacer

Creates a grid placer with the modification matrix com.yworks.yfiles.layout.tree.AbstractRotatableNodePlacer_Matrix.DEFAULT

Returns
GridNodePlacer

See also

newGridNodePlacer2()method 
public static function newGridNodePlacer2(modificationMatrix:AbstractRotatableNodePlacer_Matrix):GridNodePlacer

Creates grid placer with a given modification matrix.

Parameters

modificationMatrix:AbstractRotatableNodePlacer_Matrix

Returns
GridNodePlacer
newGridNodePlacer3()method 
public static function newGridNodePlacer3(modificationMatrix:AbstractRotatableNodePlacer_Matrix, rootAlignment:AbstractRotatableNodePlacer_RootAlignment):GridNodePlacer

Creates grid placer with a given modification matrix and the horizontal alignment of the root.

Parameters

modificationMatrix:AbstractRotatableNodePlacer_Matrix
 
rootAlignment:AbstractRotatableNodePlacer_RootAlignment

Returns
GridNodePlacer
placeSubtreeCore()method 
override protected function placeSubtreeCore(localRoot:Node, parentConnectorDirection:int):SubtreeShapeRotated

Places the children in a grid.

Parameters

localRoot:Node
 
parentConnectorDirection:int

Returns
SubtreeShapeRotated
Constant Detail
GRID_DPKEYConstant
public static const GRID_DPKEY:Object = y.layout.tree.GridNodePlacer.GRID_DPKEY

Key which can be used to register a data provider that tells the placer in which row a given node should be put into. For each node, the row is determined using the data provider's getInt (com.yworks.yfiles.base.DataProvider.getInt()) method. If no provider is specified, all nodes will be placed in one row.

See also