Search this API

y.layout.tree
Class FreePlacer

java.lang.Object
  extended by y.layout.tree.AbstractRotatableNodePlacer
      extended by y.layout.tree.FreePlacer
All Implemented Interfaces:
FromSketchNodePlacer, NodePlacer

public class FreePlacer
extends AbstractRotatableNodePlacer

Placer that can be used as simple "pseudo"-placer. May be useful if the localRoot does not have any children or you want to place them manually.


Nested Class Summary
 
Nested classes/interfaces inherited from class y.layout.tree.AbstractRotatableNodePlacer
AbstractRotatableNodePlacer.Matrix, AbstractRotatableNodePlacer.RootAlignment
 
Field Summary
 
Fields inherited from class y.layout.tree.AbstractRotatableNodePlacer
createdChildren, graph, modificationMatrix, nodeShapeProvider, spacing, subtreeShapeProvider
 
Fields inherited from interface y.layout.tree.NodePlacer
DIRECTION_ANY, DIRECTION_EAST, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_SOUTH, DIRECTION_WEST
 
Constructor Summary
FreePlacer()
          Creates a new instance with the default matrix.
 
Method Summary
 Processor createProcessor(GenericTreeLayouter layouter, LayoutGraph graph, Node currentRoot)
          Creates a processor suitable to the FreePlacer.
protected  byte determineChildConnector(Node child)
          This method must be implemented by subclasses.
protected  y.layout.tree.SubtreeShapeRotated placeSubtree(Node localRoot, byte parentConnectorDirection)
          Creates the subtree shape
 
Methods inherited from class y.layout.tree.AbstractRotatableNodePlacer
createComparator, createFromSketchComparator, createRootNodeShape, createSubtreeShape, determineChildConnectors, getModificationMatrix, getPortConstraint, getSourcePointAbs, getSpacing, placeSubtree, setSpacing, translateDirectionToModel, translateDirectionToReal, translatePoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FreePlacer

public FreePlacer()
Creates a new instance with the default matrix.

Method Detail

determineChildConnector

protected byte determineChildConnector(Node child)
Description copied from class: AbstractRotatableNodePlacer
This method must be implemented by subclasses. It is used to assigns a connector shape direction to each child.

Specified by:
determineChildConnector in class AbstractRotatableNodePlacer
Parameters:
child -
Returns:
NodePlacer.DIRECTION_NONE

placeSubtree

protected y.layout.tree.SubtreeShapeRotated placeSubtree(Node localRoot,
                                                         byte parentConnectorDirection)
Creates the subtree shape

Specified by:
placeSubtree in class AbstractRotatableNodePlacer
Parameters:
localRoot -
parentConnectorDirection -
Returns:
the created subtree shape

createProcessor

public Processor createProcessor(GenericTreeLayouter layouter,
                                 LayoutGraph graph,
                                 Node currentRoot)
Creates a processor suitable to the FreePlacer.
This processor will change all descendants node placers to FreePlacer.

Specified by:
createProcessor in interface NodePlacer
Overrides:
createProcessor in class AbstractRotatableNodePlacer
Parameters:
layouter -
graph -
currentRoot -
Returns:
a Processor or null

© Copyright 2000-2013,
yWorks GmbH.
All rights reserved.