Packagecom.yworks.yfiles.layout.tree
Classpublic class AbstractNodePlacer
InheritanceAbstractNodePlacer Inheritance YObject Inheritance Object
Implements NodePlacer, Clonable
Subclasses ARNodePlacer, DefaultNodePlacer, TreeDrawer_HierarchicTreePlacer

Utility class that serves as a basis for implementations of the com.yworks.yfiles.layout.tree.NodePlacer interface. It provides convenience methods for often used sub tasks during a layout. Subclasses need to override the two abstract methods only.

See also

com.yworks.yfiles.layout.tree.NodePlacer


Protected Properties
 PropertyDefined By
  graph : LayoutGraph
The graph instance this class is working on
AbstractNodePlacer
Public Methods
 MethodDefined By
  
AbstractNodePlacer(init:Boolean = true)
Creates a new instance of AbstractNodePlacer
AbstractNodePlacer
  
clone():Object
Overwritten to support cloning.
AbstractNodePlacer
  
Creates an optional Processor for pre- and post-processing.
AbstractNodePlacer
  
determineChildConnectors(localRoot:Node, connectorMap:DataMap):void
This method initializes internal data structures and then uses the abstract method to determine the child node connector directions.
AbstractNodePlacer
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
AbstractNodePlacer
 Inherited
hashCode():int
YObject
  
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.
AbstractNodePlacer
Protected Methods
 MethodDefined By
  
cloneImpl(o:Object):void
AbstractNodePlacer
  
This method must be implemented by subclasses.
AbstractNodePlacer
  
Convenience method that queries the DataProvider for the shape of a single node as a SubtreeShape instance.
AbstractNodePlacer
  
Convenience method that queries the DataProvider for a SubtreeShape.
AbstractNodePlacer
  
AbstractNodePlacer
  
placeSubtreeCore(localRoot:Node, parentConnectorDirection:int):GenericTreeLayouter_SubtreeShape
The main placeSubtree method that must be implemented by subclasses.
AbstractNodePlacer
Property Detail
graphproperty
protected var graph:LayoutGraph

The graph instance this class is working on

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

Creates a new instance of AbstractNodePlacer

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
clone()method
public function clone():Object

Overwritten to support cloning.

Returns
Object — an exact copy of this instance
cloneImpl()method 
protected function cloneImpl(o:Object):void

Parameters

o:Object

createProcessor()method 
public function createProcessor(layouter:GenericTreeLayouter, graph:LayoutGraph, currentRoot:Node):Processor

Creates an optional Processor for pre- and post-processing.

Parameters

layouter:GenericTreeLayouter
 
graph:LayoutGraph — the actual graph
 
currentRoot:Node — the actual root node for this node placer

Returns
Processor — a Processor or null
determineChildConnector()method 
protected function determineChildConnector(child:Node):int

This method must be implemented by subclasses. It assigns a connector shape direction to each child.

Parameters

child:Node — the child node

Returns
int — a byte constant as defined in the com.yworks.yfiles.layout.tree.NodePlacer interface

See also

determineChildConnectors()method 
public function determineChildConnectors(localRoot:Node, connectorMap:DataMap):void

This method initializes internal data structures and then uses the abstract method to determine the child node connector directions.

Parameters

localRoot:Node — the local root node
 
connectorMap:DataMap — the map that will be used to store the values

See also

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

Returns
Class
getNodeShape()method 
protected function getNodeShape(node:Node):GenericTreeLayouter_SubtreeShape

Convenience method that queries the DataProvider for the shape of a single node as a SubtreeShape instance. This instance can be used to modify it and return it in the main placeSubtree method. This method can be called during the execution of placeSubtreeCore()

Parameters

node:Node — the node whose shape will be returned in the form of a SubtreeShape instance

Returns
GenericTreeLayouter_SubtreeShape — an instance that can be modified

See also

getSubtreeShape()method 
protected function getSubtreeShape(node:Node):GenericTreeLayouter_SubtreeShape

Convenience method that queries the DataProvider for a SubtreeShape. This method can be called during the execution of placeSubtreeCore()

Parameters

node:Node — the root node whose subtree shape will be returned in the form of a SubtreeShape instance

Returns
GenericTreeLayouter_SubtreeShape — an instance that can be modified

See also

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

placeSubtree()method 
public function 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.

Parameters

nodeShapeProvider:DataProvider
 
subtreeShapeProvider:DataProvider
 
graph:LayoutGraph
 
localRoot:Node
 
parentConnectorDirection:int

Returns
GenericTreeLayouter_SubtreeShape

See also

placeSubtreeCore()method 
protected function placeSubtreeCore(localRoot:Node, parentConnectorDirection:int):GenericTreeLayouter_SubtreeShape

The main placeSubtree method that must be implemented by subclasses.

Parameters

localRoot:Node — the local root node
 
parentConnectorDirection:int — the direction of the connector shape

Returns
GenericTreeLayouter_SubtreeShape — a SubtreeShape instance that describes the shape of the whole subtree