Search this API

y.layout.tree
Class BusPlacer

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

public class BusPlacer
extends AbstractRotatableNodePlacer

The BusPlacer is a special NodePlacer that creates a bus where all child nodes and the root node are connected to.
The BusPlacer is rotatable using the constructor BusPlacer(AbstractRotatableNodePlacer.Matrix).


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
BusPlacer()
          Initializes a new instance with the Default matrix.
BusPlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
          Initializes a new BusPlacer with the given modification matrix.
 
Method Summary
 Comparator createComparator()
           
protected  byte determineChildConnector(Node child)
          This method must be implemented by subclasses.
 void determineChildConnectors(Node localRoot, DataMap connectorMap)
          This method initializes internal data structures, then uses the abstract method determineChildConnector(y.base.Node) to determine the child node connector directions.
protected  y.layout.tree.SubtreeShapeRotated placeSubtree(Node localRoot, byte parentConnectorDirection)
          Places the root node and its children
 
Methods inherited from class y.layout.tree.AbstractRotatableNodePlacer
createFromSketchComparator, createProcessor, createRootNodeShape, createSubtreeShape, 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

BusPlacer

public BusPlacer()
Initializes a new instance with the Default matrix.


BusPlacer

public BusPlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
Initializes a new BusPlacer with the given modification matrix.

Parameters:
modificationMatrix -
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_SOUTH

determineChildConnectors

public void determineChildConnectors(Node localRoot,
                                     DataMap connectorMap)
This method initializes internal data structures, then uses the abstract method determineChildConnector(y.base.Node) to determine the child node connector directions.

Specified by:
determineChildConnectors in interface NodePlacer
Overrides:
determineChildConnectors in class AbstractRotatableNodePlacer
Parameters:
localRoot - the local root node
connectorMap - the map that will be used to store the values
See Also:
determineChildConnector(y.base.Node)

placeSubtree

protected y.layout.tree.SubtreeShapeRotated placeSubtree(Node localRoot,
                                                         byte parentConnectorDirection)
Places the root node and its children

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

createComparator

public Comparator createComparator()
Overrides:
createComparator in class AbstractRotatableNodePlacer

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