public class SimpleNodePlacer extends AbstractRotatableNodePlacer
AbstractRotatableNodePlacer.Matrix, AbstractRotatableNodePlacer.RootAlignmentcreatedChildren, graph, nodeShapeProvider, subtreeShapeProvider| Constructor and Description |
|---|
SimpleNodePlacer()
Creates a new
SimpleNodePlacer instance with default settings. |
SimpleNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
Creates a new
SimpleNodePlacer instance that uses the given
modification matrix. |
SimpleNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix,
AbstractRotatableNodePlacer.RootAlignment rootAlignment)
|
| Modifier and Type | Method and Description |
|---|---|
protected ParentConnectorDirection |
determineChildConnector(Node child)
Provides
ParentConnectorDirection.NORTH as connector direction for the child nodes. |
AbstractRotatableNodePlacer.RootAlignment |
getRootAlignment()
Gets the
RootAlignment that defines how the root node is aligned with
its children and their shapes. |
double |
getVerticalAlignment()
Gets the relative vertical alignment of nodes with the same parent.
|
boolean |
isBusCreationEnabled()
Gets whether or not a bus is created in the space between the parent and its children.
|
protected RotatedSubtreeShape |
placeSubtree(Node localRoot,
ParentConnectorDirection parentConnectorDirection)
Places the children of the local root node in a single row.
|
void |
setBusCreationEnabled(boolean value)
Sets whether or not a bus is created in the space between the parent and its children.
|
void |
setRootAlignment(AbstractRotatableNodePlacer.RootAlignment value)
Sets the
RootAlignment that defines how the root node is aligned with
its children and their shapes. |
void |
setVerticalAlignment(double value)
Sets the relative vertical alignment of nodes with the same parent.
|
createComparator, createFromSketchComparator, createProcessor, determineChildConnectors, getModificationMatrix, getNodeShape, getPortConstraint, getSourcePointAbs, getSpacing, getSubtreeShape, placeSubtree, setSpacing, translateDirectionToModel, translateDirectionToReal, translatePointpublic SimpleNodePlacer()
SimpleNodePlacer instance with default settings.public SimpleNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
SimpleNodePlacer instance that uses the given
modification matrix.modificationMatrix - the transformation matrix for this AbstractRotatableNodePlacerpublic SimpleNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix, AbstractRotatableNodePlacer.RootAlignment rootAlignment)
modificationMatrix - the transformation matrix for this AbstractRotatableNodePlacerrootAlignment - the alignment for the local root in relation to its subtreesprotected ParentConnectorDirection determineChildConnector(Node child)
ParentConnectorDirection.NORTH as connector direction for the child nodes.determineChildConnector in class AbstractRotatableNodePlacerchild - the child nodeParentConnectorDirection.NORTHpublic AbstractRotatableNodePlacer.RootAlignment getRootAlignment()
RootAlignment that defines how the root node is aligned with
its children and their shapes.AbstractRotatableNodePlacer.RootAlignment.CENTERAbstractRotatableNodePlacer.RootAlignment instance specifying the location relative to the subtreessetRootAlignment(AbstractRotatableNodePlacer.RootAlignment)public double getVerticalAlignment()
All values between 0 and 1 result in a valid alignment.
0 - nodes are top-aligned0.5 - nodes are center-aligned1 - nodes are bottom-aligned
Values outside the interval [0,1] may result in a more compact node placement with unaligned nodes, especially
when labels are considered.
setVerticalAlignment(double)public boolean isBusCreationEnabled()
false. The edges leave the local root on the left or right side.true if the bus is created, false otherwisesetBusCreationEnabled(boolean)protected RotatedSubtreeShape placeSubtree(Node localRoot, ParentConnectorDirection parentConnectorDirection)
placeSubtree in class AbstractRotatableNodePlacerlocalRoot - the local root nodeparentConnectorDirection - the direction specifier for the connector of the local root node to its parent nodepublic void setBusCreationEnabled(boolean value)
false. The edges leave the local root on the left or right side.value - true if the bus is created, false otherwiseisBusCreationEnabled()public void setRootAlignment(AbstractRotatableNodePlacer.RootAlignment value)
RootAlignment that defines how the root node is aligned with
its children and their shapes.AbstractRotatableNodePlacer.RootAlignment.CENTERvalue - the AbstractRotatableNodePlacer.RootAlignment instance specifying the location relative to the subtreesgetRootAlignment()public void setVerticalAlignment(double value)
All values between 0 and 1 result in a valid alignment.
0 - nodes are top-aligned0.5 - nodes are center-aligned1 - nodes are bottom-aligned
Values outside the interval [0,1] may result in a more compact node placement with unaligned nodes, especially
when labels are considered.
value - the relative vertical alignment of nodes that have the same parent nodegetVerticalAlignment()