y.layout.tree
Class LeafPlacer
java.lang.Object
y.layout.tree.LeafPlacer
- All Implemented Interfaces:
- NodePlacer
public class LeafPlacer
- extends Object
- implements NodePlacer
This implementation can be used to "place" leafs.
It only routes the first incoming edge.
-
-
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LeafPlacer
public LeafPlacer()
createProcessor
public Processor createProcessor(GenericTreeLayouter layouter,
LayoutGraph graph,
Node currentRoot)
- Description copied from interface:
NodePlacer
- Creates an optional Processor for pre- and post-processing.
- Specified by:
createProcessor in interface NodePlacer
graph - the actual graphcurrentRoot - the actual root node for this node placer
- Returns:
- a Processor or null
determineChildConnectors
public void determineChildConnectors(Node localRoot,
DataMap connectorMap)
- Description copied from interface:
NodePlacer
- This method is called by GenericTreeLayouter before the subtree shapes of
this local root node's children are calculated.
This method must provide for each child node a byte constant indicating
the preferred direction of the connector to the subtree shape.
- Specified by:
determineChildConnectors in interface NodePlacer
- Parameters:
localRoot - the local root node whose child nodes will be provided with
a byte constant indicating the direction of the connectorconnectorMap - the map that should be used for storing the byte constant
with the child nodes.
placeSubtree
public GenericTreeLayouter.SubtreeShape placeSubtree(DataProvider nodeShapeProvider,
DataProvider subtreeShapeProvider,
LayoutGraph graph,
Node localRoot,
byte parentConnectorDirection)
- Description copied from interface:
NodePlacer
- The main method of the tree layout algorithm. This method arranges the
SubtreeShapes and the shape of the local root, routes the edges to the
SubtreeShapes, calculates the resulting SubtreeShape and returns it.
- Specified by:
placeSubtree in interface NodePlacer
- Parameters:
nodeShapeProvider - this instance can be used to obtain an initial shape
of the root node. This shape can then be merged with all the subtrees' shapes
and finally be returned by this method.subtreeShapeProvider - provides access to the pre-calculated shapes of
the subtrees. It is guaranteed that at the time of the invocation of this
method for every child node the subtree shape has already been calculatedgraph - the graph which is to be laid outlocalRoot - the root of the subtree that should be laid out by this methodparentConnectorDirection - the direction byte constant as it is defined
in this interface, that must be used for initializing the connector of the
localRoot node to the parent node of the localRoot node
- Returns:
- the shape of the whole subtree