Packagecom.yworks.yfiles.layout.tree
Classpublic class AssistantPlacer
InheritanceAssistantPlacer Inheritance AbstractRotatableNodePlacer Inheritance YObject Inheritance Object

The assistant placer is a NodePlacer that delegates the node placement to two different node placers depending on the type of the children. The type of a child is recognized using a DataProvider providing boolean values. The data provider is registered using the key ASSISTANT_DPKEY. Assistant placer uses a com.yworks.yfiles.layout.tree.LeftRightPlacer for those nodes the DataProvider returns true (they are understood as "assistants"). Below the assistants the other children are arranged using the childNodePlacer (settable using childNodePlacer).

Assistant placer provides the best results when using a port assignment that starts all edges at the same node. If the ports are distributed at the border, edge crossings may occur.

See also

ASSISTANT_DPKEY
com.yworks.yfiles.layout.tree.LeftRightPlacer
childNodePlacer


Public Properties
 PropertyDefined By
  childNodePlacer : NodePlacer
Getter: Returns the child node placer for the non-assistant children.
AssistantPlacer
 InheritedmodificationMatrix : AbstractRotatableNodePlacer_Matrix
[read-only] The actual modification matrix
AbstractRotatableNodePlacer
  spacing : Number
[override]
AssistantPlacer
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
  
AssistantPlacer(init:Boolean = true)
Creates a default instance with horizontal orientation.
AssistantPlacer
  
[override] Creates a comparator that compares edges of two assistant nodes with the comparator created by com.yworks.yfiles.layout.tree.LeftRightPlacer and all other edges with the sketch comparator created by this placer's childNodePlacer.
AssistantPlacer
  
createCompoundComparator(assistantComparator:Comparator, childComparator:Comparator):Comparator
[static] Creates a comparator that compares edges connecting to assistant nodes with the given assistantComparator and all other edges with the given childComparator.
AssistantPlacer
 Inherited
AbstractRotatableNodePlacer
  
[override] Creates a processor that creates a dummy node and changes the edges for the non-assistant children.
AssistantPlacer
  
determineChildConnectors(localRoot:Node, connectorMap:DataMap):void
[override] Delegates to the the left right placer.
AssistantPlacer
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
AssistantPlacer
 Inherited
hashCode():int
YObject
  
[static] Creates a default instance with horizontal orientation.
AssistantPlacer
  
[static] Creates an AssistantPlacer for the given modification matrix.
AssistantPlacer
  
placeSubtree(nodeShapeProvider:DataProvider, subtreeShapeProvider:DataProvider, graph:LayoutGraph, localRoot:Node, parentConnectorDirection:int):GenericTreeLayouter_SubtreeShape
[override] Places the shapes.
AssistantPlacer
 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]
AssistantPlacer
  
Returns the subtree shape for the given child node.
AssistantPlacer
 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.
AssistantPlacer
  
Initializes this object.
AssistantPlacer
  
placeSubtreeCore(localRoot:Node, parentConnectorDirection:int):SubtreeShapeRotated
[override]
AssistantPlacer
 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
  ASSISTANT_DPKEY : Object = y.layout.tree.AssistantPlacer.ASSISTANT_DPKEY
[static] Contains a boolean for each node whether it is an assistant or not. True: Is assistant False: Is not an assistant
AssistantPlacer
Property Detail
childNodePlacerproperty
childNodePlacer:NodePlacer

Getter: Returns the child node placer for the non-assistant children.

Setter: Sets the child node placer. The child node placer is used to arrange the nodes that are not assistants. ASSISTANT_DPKEY


Implementation
    public function get childNodePlacer():NodePlacer
    public function set childNodePlacer(value:NodePlacer):void

See also

spacingproperty 
spacing:Number[override]


Implementation
    public function get spacing():Number
    public function set spacing(value:Number):void
Constructor Detail
AssistantPlacer()Constructor
public function AssistantPlacer(init:Boolean = true)

Creates a default instance with horizontal orientation. Call to this(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.
Method Detail
createComparator()method
override public function createComparator():Comparator

Creates a comparator that compares edges of two assistant nodes with the comparator created by com.yworks.yfiles.layout.tree.LeftRightPlacer and all other edges with the sketch comparator created by this placer's childNodePlacer.

Returns
Comparator — a comparator to compare two edges.

See also

createCompoundComparator()method 
public static function createCompoundComparator(assistantComparator:Comparator, childComparator:Comparator):Comparator

Creates a comparator that compares edges connecting to assistant nodes with the given assistantComparator and all other edges with the given childComparator.

Parameters

assistantComparator:Comparator — the comparator for assistant edges
 
childComparator:Comparator — the comparator for non-assistants edges

Returns
Comparator — a comparator that compares edges connecting to assistant nodes with the given assistantComparator and all other edges with the given childComparator.
createProcessor()method 
override public function createProcessor(layouter:GenericTreeLayouter, graph:LayoutGraph, currentRoot:Node):Processor

Creates a processor that creates a dummy node and changes the edges for the non-assistant children.

Parameters

layouter:GenericTreeLayouter
 
graph:LayoutGraph
 
currentRoot:Node

Returns
Processor — the processor that changes the graph structure suitable for the AssistantPlacer
determineChildConnector()method 
override protected function determineChildConnector(child:Node):int

Parameters

child:Node

Returns
int — should not be called and throws a IllegalStateException
determineChildConnectors()method 
override public function determineChildConnectors(localRoot:Node, connectorMap:DataMap):void

Delegates to the the left right placer.

Parameters

localRoot:Node
 
connectorMap:DataMap

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

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

Returns the subtree shape for the given child node.

Parameters

node:Node — the child node the subtree shape is returned for.

Returns
GenericTreeLayouter_SubtreeShape — the subtree shape for the given child node.
initAssistantPlacer1()method 
protected final function initAssistantPlacer1():void

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

See also

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

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

Parameters

modificationMatrix:AbstractRotatableNodePlacer_Matrix

See also

newAssistantPlacer1()method 
public static function newAssistantPlacer1():AssistantPlacer

Creates a default instance with horizontal orientation. Call to this(Matrix.DEFAULT)

Returns
AssistantPlacer
newAssistantPlacer2()method 
public static function newAssistantPlacer2(modificationMatrix:AbstractRotatableNodePlacer_Matrix):AssistantPlacer

Creates an AssistantPlacer for the given modification matrix.

Parameters

modificationMatrix:AbstractRotatableNodePlacer_Matrix — the modification matrix that is used as translation matrix.

Returns
AssistantPlacer
placeSubtree()method 
override public function placeSubtree(nodeShapeProvider:DataProvider, subtreeShapeProvider:DataProvider, graph:LayoutGraph, localRoot:Node, parentConnectorDirection:int):GenericTreeLayouter_SubtreeShape

Places the shapes.

Parameters

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

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

Parameters

localRoot:Node
 
parentConnectorDirection:int

Returns
SubtreeShapeRotated — Should not be called - throws IllegalStateException
Constant Detail
ASSISTANT_DPKEYConstant
public static const ASSISTANT_DPKEY:Object = y.layout.tree.AssistantPlacer.ASSISTANT_DPKEY

Contains a boolean for each node whether it is an assistant or not. True: Is assistant False: Is not an assistant