Packagecom.yworks.yfiles.layout.tree
Classpublic class AbstractRotatableNodePlacer
InheritanceAbstractRotatableNodePlacer Inheritance YObject Inheritance Object
Implements FromSketchNodePlacer
Subclasses AssistantPlacer, BusPlacer, DelegatingNodePlacer, DoubleLinePlacer, FreePlacer, GridNodePlacer, LayeredNodePlacer, LeftRightPlacer, SimpleNodePlacer

This is an abstract base class for NodePlacers that supports rotations. "Supporting rotation" means that the NodePlacers only implement the default direction (e.g. bottom-down). The other directions are calculated using the modification matrix within the constructor. But take care! Using rotatable NodePlacers contains some pitfalls. Especially calculations must be aware of that. Especially operations on com.yworks.yfiles.geom.BorderLine s should not be called directly (e.g. mergeWithMin, mergeWithMax). Use the corresponding methods on AbstractRotatableNodePlacer instead.

See also

com.yworks.yfiles.geom.BorderLine


Public Properties
 PropertyDefined By
  modificationMatrix : AbstractRotatableNodePlacer_Matrix
[read-only] The actual modification matrix
AbstractRotatableNodePlacer
  spacing : Number
Specifies the spacing between subtrees this NodePlacer is arranging.
AbstractRotatableNodePlacer
Protected Properties
 PropertyDefined By
  createdChildren : List
List containing the created children
AbstractRotatableNodePlacer
  graph : LayoutGraph
The graph instance this class is working on
AbstractRotatableNodePlacer
  nodeShapeProvider : DataProvider
The actual node shape provider
AbstractRotatableNodePlacer
  _spacing : Number
This is the "default" spacing for the different move operations.
AbstractRotatableNodePlacer
  subtreeShapeProvider : DataProvider
The actual subtree shape provider
AbstractRotatableNodePlacer
Public Methods
 MethodDefined By
  
AbstractRotatableNodePlacer(modificationMatrix:AbstractRotatableNodePlacer_Matrix, init:Boolean = true)
Default constructor.
AbstractRotatableNodePlacer
  
AbstractRotatableNodePlacer
  
AbstractRotatableNodePlacer
  
Creates an optional Processor for pre- and post-processing.
AbstractRotatableNodePlacer
  
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]
AbstractRotatableNodePlacer
 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.
AbstractRotatableNodePlacer
  
[static] Translates a "real world point" to a "model point"
AbstractRotatableNodePlacer
Protected Methods
 MethodDefined By
  
createRootNodeShape(node:Node):SubtreeShapeRotated
Convenience method that queries the DataProvider for the shape of a single node as a SubtreeShape instance.
AbstractRotatableNodePlacer
  
createSubtreeShape(node:Node):SubtreeShapeRotated
Convenience method that queries the DataProvider for a SubtreeShape.
AbstractRotatableNodePlacer
  
This method must be implemented by subclasses.
AbstractRotatableNodePlacer
  
Lookup method to get the PortConstraint for the local root translated.
AbstractRotatableNodePlacer
  
Translates the absolute source point of the given edge to the "view coordinates" (translated by the modification matrix)
AbstractRotatableNodePlacer
  
AbstractRotatableNodePlacer
  
placeSubtreeCore(localRoot:Node, parentConnectorDirection:int):SubtreeShapeRotated
This method must be implemented by subclasses.
AbstractRotatableNodePlacer
  
translateDirectionToModel(realDirection:int):int
Translates a "real" direction into a directionModel direction
AbstractRotatableNodePlacer
  
translateDirectionToReal(modelDirection:int):int
Translates a modelDirectionModel into the "real" directionModel
AbstractRotatableNodePlacer
Property Detail
_spacingproperty
protected var _spacing:Number

This is the "default" spacing for the different move operations.

createdChildrenproperty 
protected var createdChildren:List

List containing the created children

graphproperty 
protected var graph:LayoutGraph

The graph instance this class is working on

modificationMatrixproperty 
modificationMatrix:AbstractRotatableNodePlacer_Matrix  [read-only]

The actual modification matrix


Implementation
    public function get modificationMatrix():AbstractRotatableNodePlacer_Matrix
nodeShapeProviderproperty 
protected var nodeShapeProvider:DataProvider

The actual node shape provider

spacingproperty 
spacing:Number

Specifies the spacing between subtrees this NodePlacer is arranging.


Implementation
    public function get spacing():Number
    public function set spacing(value:Number):void
subtreeShapeProviderproperty 
protected var subtreeShapeProvider:DataProvider

The actual subtree shape provider

Constructor Detail
AbstractRotatableNodePlacer()Constructor
public function AbstractRotatableNodePlacer(modificationMatrix:AbstractRotatableNodePlacer_Matrix, init:Boolean = true)

Default constructor. Instantiates a new instance with the given modification matrix.

Parameters
modificationMatrix:AbstractRotatableNodePlacer_Matrix — the translation for the NodePlacer
 
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
createComparator()method
public function createComparator():Comparator

Returns
Comparator
createFromSketchComparator()method 
public function createFromSketchComparator():Comparator

Returns
Comparator
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
createRootNodeShape()method 
protected function createRootNodeShape(node:Node):SubtreeShapeRotated

Convenience method that queries the DataProvider for the shape of a single node as a SubtreeShape instance. This instance can be used to modify and return it in the main placeSubtree method. This method can only 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
SubtreeShapeRotated — an instance that can be modified

See also

createSubtreeShape()method 
protected function createSubtreeShape(node:Node):SubtreeShapeRotated

Convenience method that queries the DataProvider for a SubtreeShape. This method can only 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
SubtreeShapeRotated — an instance that can be modified

See also

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

This method must be implemented by subclasses. It is used to 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, then uses the abstract method determineChildConnector() 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
getPortConstraint()method 
protected function getPortConstraint(localRoot:Node):PortConstraint

Lookup method to get the PortConstraint for the local root translated.

Parameters

localRoot:Node — the local root

Returns
PortConstraint — the PortConstraint for the local root. The PortConstraint is translated based on the actual modification matrix.
getSourcePointAbs()method 
protected function getSourcePointAbs(edge:Edge):YPoint

Translates the absolute source point of the given edge to the "view coordinates" (translated by the modification matrix)

Parameters

edge:Edge — the source point for is returned

Returns
YPoint — the translated absolute source point for the given edge and the actual modification matrix
initAbstractRotatableNodePlacer()method 
protected final function initAbstractRotatableNodePlacer(modificationMatrix:AbstractRotatableNodePlacer_Matrix):void

Parameters

modificationMatrix:AbstractRotatableNodePlacer_Matrix

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):SubtreeShapeRotated

This method must be implemented by subclasses.

Parameters

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

Returns
SubtreeShapeRotated — a SubtreeShape instance that describes the shape of the whole subtree
translateDirectionToModel()method 
protected function translateDirectionToModel(realDirection:int):int

Translates a "real" direction into a directionModel direction

Parameters

realDirection:int — the "real" direction

Returns
int — the translated direction
translateDirectionToReal()method 
protected function translateDirectionToReal(modelDirection:int):int

Translates a modelDirectionModel into the "real" directionModel

Parameters

modelDirection:int — the model direction

Returns
int — the translated model direction
translatePoint()method 
public static function translatePoint(modificationMatrix:AbstractRotatableNodePlacer_Matrix, realWorldPoint:YPoint):YPoint

Translates a "real world point" to a "model point"

Parameters

modificationMatrix:AbstractRotatableNodePlacer_Matrix — the matrix to apply
 
realWorldPoint:YPoint — the point with the coordinates from the real world

Returns
YPoint — the model point