public class GroupedNodePlacer extends Object implements INodePlacer
INodePlacer places the children of a local root in groups.
The groups are determined by the grouping of the edges that connect the children to its root. The placement of the
groups is specified by a INodePlacer which will consider grouped children as one child. The children within a
group are placed by another INodePlacer.
There are three edge groups whose target nodes are placed above each other
| Constructor and Description |
|---|
GroupedNodePlacer(INodePlacer groupPlacer,
INodePlacer childPlacer)
Creates a new
GroupedNodePlacer instance. |
| Modifier and Type | Method and Description |
|---|---|
IProcessor |
createProcessor(TreeLayout layouter,
LayoutGraph graph,
Node currentRoot)
Creates a
IProcessor that prepares the graph for edge grouping. |
void |
determineChildConnectors(Node localRoot,
IDataMap connectorMap)
Delegates to the
INodePlacer responsible for arranging the nodes in one group. |
TreeLayout.SubtreeShape |
placeSubtree(IDataProvider nodeShapeProvider,
IDataProvider subtreeShapeProvider,
LayoutGraph graph,
Node localRoot,
ParentConnectorDirection parentConnectorDirection)
Places the groups of
TreeLayout.SubtreeShapes according to their group IDs. |
public GroupedNodePlacer(INodePlacer groupPlacer, INodePlacer childPlacer)
GroupedNodePlacer instance.groupPlacer - the INodePlacer which places the child groupschildPlacer - the INodePlacer which places the children within their grouppublic IProcessor createProcessor(TreeLayout layouter, LayoutGraph graph, Node currentRoot)
IProcessor that prepares the graph for edge grouping.
In a pre-processing step, the IProcessor inserts a dummy node for each edge group and connects it to the local
root and the edges of the according group. The child node placer is assigned to those dummy nodes and will arrange them
during the layout calculation.
The changes to the graph are restored in a post-processing step.
createProcessor in interface INodePlacerlayouter - the current TreeLayout instancegraph - the input graphcurrentRoot - the root node handled by this INodePlacerIProcessor responsible for preparing the graphPortConstraintKeys.SOURCE_GROUP_ID_DPKEY,
PortConstraintKeys.TARGET_GROUP_ID_DPKEYpublic void determineChildConnectors(Node localRoot, IDataMap connectorMap)
INodePlacer responsible for arranging the nodes in one group.determineChildConnectors in interface INodePlacerlocalRoot - the local root nodeconnectorMap - the map used for storing the direction specifiers of the child nodespublic TreeLayout.SubtreeShape placeSubtree(IDataProvider nodeShapeProvider, IDataProvider subtreeShapeProvider, LayoutGraph graph, Node localRoot, ParentConnectorDirection parentConnectorDirection)
TreeLayout.SubtreeShapes according to their group IDs.placeSubtree in interface INodePlacernodeShapeProvider - 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 nodeTreeLayout.SubtreeShapes of the local root and its childrenPortConstraintKeys.SOURCE_GROUP_ID_DPKEY,
PortConstraintKeys.TARGET_GROUP_ID_DPKEY