public class DoubleLineNodePlacer extends AbstractRotatableNodePlacer
DoubleLineNodePlacer
arranges the children of a local root alternating in two lines.
INodePlacer
arranges nodes from top to bottom. It places the subtrees in two
horizontal lines below the root. They are distributed in an alternating fashion, i.e., adjacent subtrees are in
different lines.
This node placer is especially useful for leaves with a large width.
AbstractRotatableNodePlacer.Matrix, AbstractRotatableNodePlacer.RootAlignment
createdChildren, graph, nodeShapeProvider, subtreeShapeProvider
Constructor and Description |
---|
DoubleLineNodePlacer()
Creates a new
DoubleLineNodePlacer instance with the default settings. |
DoubleLineNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
Creates a new
DoubleLineNodePlacer instance whose direction is specified by the given modification matrix. |
Modifier and Type | Method and Description |
---|---|
protected ParentConnectorDirection |
determineChildConnector(Node child)
Returns
ParentConnectorDirection.NORTH for every given child node. |
double |
getDoubleLineSpacingRatio()
Gets the ratio of the
spacing between the root and the children
in the upper line and the spacing between the two lines of subtrees. |
AbstractRotatableNodePlacer.RootAlignment |
getRootAlignment()
Gets the
RootAlginment that defines how the root node is aligned with
its children and their shapes. |
protected RotatedSubtreeShape |
placeSubtree(Node localRoot,
ParentConnectorDirection parentConnectorDirection)
Places the children of the given local root alternating in two horizontal lines.
|
void |
setDoubleLineSpacingRatio(double value)
Sets the ratio of the
spacing between the root and the children
in the upper line and the spacing between the two lines of subtrees. |
void |
setRootAlignment(AbstractRotatableNodePlacer.RootAlignment value)
Sets the
RootAlginment that defines how the root node is aligned with
its children and their shapes. |
createComparator, createFromSketchComparator, createProcessor, determineChildConnectors, getModificationMatrix, getNodeShape, getPortConstraint, getSourcePointAbs, getSpacing, getSubtreeShape, placeSubtree, setSpacing, translateDirectionToModel, translateDirectionToReal, translatePoint
public DoubleLineNodePlacer()
DoubleLineNodePlacer
instance with the default settings.public DoubleLineNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
DoubleLineNodePlacer
instance whose direction is specified by the given modification matrix.modificationMatrix
- the transformation matrix for this AbstractRotatableNodePlacer
protected ParentConnectorDirection determineChildConnector(Node child)
ParentConnectorDirection.NORTH
for every given child node.
Edges always connect to the top of the child nodes.
determineChildConnector
in class AbstractRotatableNodePlacer
child
- the child nodeParentConnectorDirection.NORTH
public double getDoubleLineSpacingRatio()
spacing
between the root and the children
in the upper line and the spacing between the two lines of subtrees.setDoubleLineSpacingRatio(double)
public AbstractRotatableNodePlacer.RootAlignment getRootAlignment()
RootAlginment
that defines how the root node is aligned with
its children and their shapes.AbstractRotatableNodePlacer.RootAlignment.CENTER
AbstractRotatableNodePlacer.RootAlignment
instance specifying the location relative to the subtreessetRootAlignment(AbstractRotatableNodePlacer.RootAlignment)
protected RotatedSubtreeShape placeSubtree(Node localRoot, ParentConnectorDirection parentConnectorDirection)
placeSubtree
in class AbstractRotatableNodePlacer
localRoot
- the local root nodeparentConnectorDirection
- the direction specifier for the connector of the local root node to its parent nodepublic void setDoubleLineSpacingRatio(double value)
spacing
between the root and the children
in the upper line and the spacing between the two lines of subtrees.value
- the ratio to determine the spacing between the two lines of subtreesgetDoubleLineSpacingRatio()
public void setRootAlignment(AbstractRotatableNodePlacer.RootAlignment value)
RootAlginment
that defines how the root node is aligned with
its children and their shapes.AbstractRotatableNodePlacer.RootAlignment.CENTER
value
- the AbstractRotatableNodePlacer.RootAlignment
instance specifying the location relative to the subtreesgetRootAlignment()