public interface INodePlacer
INodePlacer
is responsible for the arrangement of a local root node and all of its subtrees.
Subtrees are represented as
SubtreeShape
s with a connecting edge to the root of the subtree.
Implementations of this interface have to:
SubtreeShapes
and the root node (only the relative position matters, shapes
can be placed at any absolute location, TreeLayout
will perform the final alignment).
SubtreeShapes
SubtreeShapes
and the shape of the root node as well as any
added edges
SubtreeShape
for the subtree including the local rootModifier and Type | Method and Description |
---|---|
IProcessor |
createProcessor(TreeLayout layouter,
LayoutGraph graph,
Node currentRoot)
Creates an optional
IProcessor for pre- and post-processing. |
void |
determineChildConnectors(Node localRoot,
IDataMap connectorMap)
Provides the direction of the connector to the
SubtreeShape for each child node. |
TreeLayout.SubtreeShape |
placeSubtree(IDataProvider nodeShapeProvider,
IDataProvider subtreeShapeProvider,
LayoutGraph graph,
Node localRoot,
ParentConnectorDirection parentConnectorDirection)
Arranges the
SubtreeShapes of the local root and its children and routes the edges that
connect them. |
IProcessor createProcessor(TreeLayout layouter, LayoutGraph graph, Node currentRoot)
IProcessor
for pre- and post-processing.
This method is called by TreeLayout
before arranging the SubtreeShapes
. If no
pre- or post-processing is needed, this method may return null
.
layouter
- the current TreeLayout
instancegraph
- the input graphcurrentRoot
- the root node handled by this INodePlacer
IProcessor
instance or null
void determineChildConnectors(Node localRoot, IDataMap connectorMap)
SubtreeShape
for each child node.
This method is called by TreeLayout
before the SubtreeShapes
for the children of
the local root node are calculated. The direction specifiers are stored in the given map for all child nodes of the
local root.
localRoot
- the local root nodeconnectorMap
- the map that must be used for storing the direction specifiers of the child nodesTreeLayout.SubtreeShape placeSubtree(IDataProvider nodeShapeProvider, IDataProvider subtreeShapeProvider, LayoutGraph graph, Node localRoot, ParentConnectorDirection parentConnectorDirection)
SubtreeShapes
of the local root and its children and routes the edges that
connect them.
This method is the main method of the tree layout algorithm. It is called by TreeLayout
in each recursion step
to place the local root in relation to its children. Their shapes will be merged into one
SubtreeShape
, which is returned by this method.
The SubtreeShape
for the local root can be obtained from the nodeShapeProvider
.
subtreeShapeProvider
contains the SubtreeShapes
assigned to the child
nodes.
Due to the order in which the tree nodes are processed, it is guaranteed that at the time of the invocation of this
method the SubtreeShape
of every descendant node has already been calculated.
nodeShapeProvider
- the IDataProvider
for obtaining an initial shape of the root nodesubtreeShapeProvider
- the IDataProvider
for accessing the pre-calculated shapes of the subtreesgraph
- the input graphlocalRoot
- the root of the subtree that should be arranged by this methodparentConnectorDirection
- the direction specifier for the connector of the local root node to its parent node