public abstract static class AbstractRotatableNodePlacer.RootAlignment extends Object
RootAlignment describes how a local root node is arranged in relation to its children.
The actual placement depends on the orientation of the subtree rooted at the current local root node. All descriptions
of the provided alignments refer to the top-to-bottom orientation described by
AbstractRotatableNodePlacer.Matrix.DEFAULT. In this case, the subtrees are placed below the local root and the local root is aligned
horizontally above them.
| Modifier and Type | Field and Description |
|---|---|
static AbstractRotatableNodePlacer.RootAlignment[] |
ALL
An array containing all supported
RootAlignments. |
static AbstractRotatableNodePlacer.RootAlignment |
CENTER
Horizontal
RootAlignment at the center of the subtrees. |
static AbstractRotatableNodePlacer.RootAlignment |
CENTER_OVER_CHILDREN
Horizontal alignment at the center of the children.
|
static AbstractRotatableNodePlacer.RootAlignment |
LEADING
Horizontal
RootAlignment left of the children. |
static AbstractRotatableNodePlacer.RootAlignment |
LEFT
Horizontal
RootAlignment at the left side. |
static AbstractRotatableNodePlacer.RootAlignment |
MEDIAN
Horizontal
RootAlignment at the median child node. |
static AbstractRotatableNodePlacer.RootAlignment |
RIGHT
Horizontal
RootAlignment at the right side. |
static AbstractRotatableNodePlacer.RootAlignment |
TRAILING
Horizontal
RootAlignment right of the children. |
| Constructor and Description |
|---|
RootAlignment() |
| Modifier and Type | Method and Description |
|---|---|
protected static Rectangle2D |
getBounds(List<Object> shapes)
Calculates the common bounds of the given subtree shapes.
|
protected abstract void |
placeParentHorizontal(RotatedSubtreeShape rootShape,
List<Object> shapes,
Rectangle2D shapeBounds,
double spacing)
Moves the shape of the local root to a suitable position relative to the children's shapes.
|
public static final AbstractRotatableNodePlacer.RootAlignment[] ALL
RootAlignments.public static final AbstractRotatableNodePlacer.RootAlignment CENTER
RootAlignment at the center of the subtrees.
The root node is placed centered above its whole subgraph. To determine the alignment, only
INodeLayouts are considered. Node labels are not included although they are also
contained in TreeLayout.SubtreeShapes.
public static final AbstractRotatableNodePlacer.RootAlignment CENTER_OVER_CHILDREN
The root node is placed centered over its direct children. To determine the alignment, only
INodeLayouts are considered. Node labels are not included although they are also
contained in TreeLayout.SubtreeShapes.
public static final AbstractRotatableNodePlacer.RootAlignment LEADING
RootAlignment left of the children.
The local root node leaves a distance specified by the given spacing to the leftmost child. To determine the alignment,
only INodeLayouts are considered. Node labels are not included although they are also
contained in TreeLayout.SubtreeShapes.
public static final AbstractRotatableNodePlacer.RootAlignment LEFT
RootAlignment at the left side.
The root node is placed left aligned with its leftmost child. To determine the alignment, only
INodeLayouts are considered. Node labels are not included although they are also
contained in TreeLayout.SubtreeShapes.
public static final AbstractRotatableNodePlacer.RootAlignment MEDIAN
RootAlignment at the median child node.
The root node is placed above the median of its children. To determine the alignment, only
INodeLayouts are considered. Node labels are not included although they are also
contained in TreeLayout.SubtreeShapes.
public static final AbstractRotatableNodePlacer.RootAlignment RIGHT
RootAlignment at the right side.
The root node is placed right aligned with its rightmost child. To determine the alignment, only
INodeLayouts are considered. Node labels are not included although they are also
contained in TreeLayout.SubtreeShapes.
public static final AbstractRotatableNodePlacer.RootAlignment TRAILING
RootAlignment right of the children.
The root node leaves a distance specified by the given spacing to the rightmost child. To determine the alignment, only
INodeLayouts are considered. Node labels are not included although they are also
contained in TreeLayout.SubtreeShapes.
protected static final Rectangle2D getBounds(List<Object> shapes)
This method can be used when placing the local root above its subtrees in method
RootAlignment#placeParentHorizontal(RotatedSubtreeShape, List, Rectangle2D, double).
shapes - a list of rotated subtree shapesprotected abstract void placeParentHorizontal(RotatedSubtreeShape rootShape, List<Object> shapes, Rectangle2D shapeBounds, double spacing)
The movement should only be done on the x-axis (horizontally).
This method is called by AbstractRotatableNodePlacers when they
place the subtrees.
rootShape - the shape of the local root node that will be movedshapes - a list of rotated subtree shapes, representing the shapes of the child nodesshapeBounds - accumulated bounds of the shapes of all child nodesspacing - the spacing value that should be used