Search this API

y.layout.tree
Class SimpleNodePlacer

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

public class SimpleNodePlacer
extends AbstractRotatableNodePlacer

This is a "default" NodePlacer. It arranges its children simply in one row.


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
SimpleNodePlacer()
          Default constructor that creates an instance with the modification matrix AbstractRotatableNodePlacer.Matrix.DEFAULT
SimpleNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
          Constructor that creates an instance with the given modification matrix.
SimpleNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix, AbstractRotatableNodePlacer.RootAlignment rootAlignment)
          Constructor that creates an instance with the given modification matrix and the horizontal root alignment
 
Method Summary
protected  byte determineChildConnector(Node child)
          Returns NodePlacer.DIRECTION_NORTH.
 AbstractRotatableNodePlacer.RootAlignment getRootAlignment()
          Returns the horizontal alignment of the root node.
 boolean isCreateBus()
          Returns whether a bus should be created between the parent and its children.
protected  y.layout.tree.SubtreeShapeRotated placeSubtree(Node localRoot, byte parentConnectorDirection)
          Places the children in a single row.
 void setCreateBus(boolean createBus)
          Specifies whether a bus should be created between the parent and its children.
 void setRootAlignment(AbstractRotatableNodePlacer.RootAlignment rootAlignment)
          Sets the horizontal alignment of the root node.
 
Methods inherited from class y.layout.tree.AbstractRotatableNodePlacer
createComparator, createFromSketchComparator, createProcessor, 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

SimpleNodePlacer

public SimpleNodePlacer()
Default constructor that creates an instance with the modification matrix AbstractRotatableNodePlacer.Matrix.DEFAULT


SimpleNodePlacer

public SimpleNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
Constructor that creates an instance with the given modification matrix.


SimpleNodePlacer

public SimpleNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix,
                        AbstractRotatableNodePlacer.RootAlignment rootAlignment)
Constructor that creates an instance with the given modification matrix and the horizontal root alignment

Method Detail

getRootAlignment

public AbstractRotatableNodePlacer.RootAlignment getRootAlignment()
Returns the horizontal alignment of the root node.

Returns:
the horizontal alignment of the root node.

setRootAlignment

public void setRootAlignment(AbstractRotatableNodePlacer.RootAlignment rootAlignment)
Sets the horizontal alignment of the root node.


determineChildConnector

protected byte determineChildConnector(Node child)
Returns NodePlacer.DIRECTION_NORTH.

Specified by:
determineChildConnector in class AbstractRotatableNodePlacer
Parameters:
child - the child node
Returns:
NodePlacer.DIRECTION_NORTH.

isCreateBus

public boolean isCreateBus()
Returns whether a bus should be created between the parent and its children.

Returns:
whether a bus should be created between the parent and its children.

setCreateBus

public void setCreateBus(boolean createBus)
Specifies whether a bus should be created between the parent and its children.


placeSubtree

protected y.layout.tree.SubtreeShapeRotated placeSubtree(Node localRoot,
                                                         byte parentConnectorDirection)
Places the children in a single row.

Specified by:
placeSubtree in class AbstractRotatableNodePlacer
Parameters:
localRoot - the local root node
parentConnectorDirection - the direction of the connector shape
Returns:
a SubtreeShape instance that describes the shape of the whole subtree

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