public class DendrogramNodePlacer extends Object implements IFromSketchNodePlacer
DendrogramNodePlacer arranges subtrees as dendrograms.
INodePlacer arranges nodes from top to bottom. It arranges subtrees in such a way
that all subtrees of a single local root are aligned with their bottom border.
Note: This implementation does not support PortConstraints.
| Constructor and Description |
|---|
DendrogramNodePlacer()
Creates a new
DendrogramNodePlacer instance with default settings. |
| Modifier and Type | Method and Description |
|---|---|
Comparator<Object> |
createComparator()
Creates a
Comparator that sorts outgoing edges according to the x-coordinate of their target nodes. |
Comparator<Object> |
createFromSketchComparator()
Creates a
Comparator for the edges which takes the initial x-coordinates of the nodes into account. |
IProcessor |
createProcessor(TreeLayout layouter,
LayoutGraph graph,
Node currentRoot)
Creates an optional
IProcessor for pre- and post-processing. |
void |
determineChildConnectors(Node localRoot,
IDataMap connectorMap)
Provides
ParentConnectorDirection.NORTH for all children. |
double |
getMinimumRootDistance()
Gets the minimum distance between the
TreeLayout.SubtreeShape of a root node and the bus connecting to all of
its children. |
double |
getMinimumSubtreeDistance()
Gets the minimum horizontal distance between adjacent
SubtreeShapes. |
TreeLayout.SubtreeShape |
placeSubtree(IDataProvider nodeShapeProvider,
IDataProvider subtreeShapeProvider,
LayoutGraph graph,
Node localRoot,
ParentConnectorDirection parentConnectorDirection)
Arranges the
SubtreeShapes of the local root and its children as a dendrogram. |
void |
setMinimumRootDistance(double value)
Sets the minimum distance between the
TreeLayout.SubtreeShape of a root node and the bus connecting to all of
its children. |
void |
setMinimumSubtreeDistance(double value)
Sets the minimum horizontal distance between adjacent
SubtreeShapes. |
public DendrogramNodePlacer()
DendrogramNodePlacer instance with default settings.public Comparator<Object> createComparator()
Comparator that sorts outgoing edges according to the x-coordinate of their target nodes.
This Comparator can be used for achieving a From Sketch layout.
ComparatorcreateFromSketchComparator()public Comparator<Object> createFromSketchComparator()
Comparator for the edges which takes the initial x-coordinates of the nodes into account.
This implementation delegates to createComparator().
createFromSketchComparator in interface IFromSketchNodePlacerComparator for the edgescreateComparator()public IProcessor createProcessor(TreeLayout layouter, LayoutGraph graph, Node currentRoot)
IProcessor for pre- and post-processing.
This implementation returns null. Hence, no pre- or post-processing is done.
createProcessor in interface INodePlacerlayouter - the current TreeLayout instancegraph - the input graphcurrentRoot - the root node handled by this INodePlacernullpublic void determineChildConnectors(Node localRoot, IDataMap connectorMap)
ParentConnectorDirection.NORTH for all children.
Edges will always connect to the top of the child nodes.
determineChildConnectors in interface INodePlacerlocalRoot - the local root nodeconnectorMap - the map that is used for storing the direction specifiers of the child nodespublic double getMinimumRootDistance()
TreeLayout.SubtreeShape of a root node and the bus connecting to all of
its children.
The distance needs to be non-negative.
IllegalArgumentException - if the specified distance is negativesetMinimumRootDistance(double)public double getMinimumSubtreeDistance()
SubtreeShapes.
The distance needs to be non-negative.
IllegalArgumentException - if the specified distance is negativeTreeLayout.SubtreeShapessetMinimumSubtreeDistance(double)public TreeLayout.SubtreeShape placeSubtree(IDataProvider nodeShapeProvider, IDataProvider subtreeShapeProvider, LayoutGraph graph, Node localRoot, ParentConnectorDirection parentConnectorDirection)
SubtreeShapes of the local root and its children as a dendrogram.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 nodepublic void setMinimumRootDistance(double value)
TreeLayout.SubtreeShape of a root node and the bus connecting to all of
its children.
The distance needs to be non-negative.
IllegalArgumentException - if the specified distance is negativevalue - the minimum distance between the root and the busgetMinimumRootDistance()public void setMinimumSubtreeDistance(double value)
SubtreeShapes.
The distance needs to be non-negative.
IllegalArgumentException - if the specified distance is negativevalue - the minimum distance between two adjacent TreeLayout.SubtreeShapesgetMinimumSubtreeDistance()