N
- The node data type for the treepublic class OrthoTreeArrangement<N> extends AbstractArrangement<N> implements TreeArrangement<N>
Arrangement class which will arrange the nodes in a hierarchical layout. The nodes are arranged with the root on the top (lowest Y value). If the nodes are TreeNodes, the hierarchy is used. Otherwise, the Arrangement will attempt to make the best decision about how to arrange the nodes. If there is no obvious root, an ArrangementException is thrown.
The nodes are arranged by alternating the arrangement direction between horizontal and vertical arrangements. The children nodes are arranged as regularly as possible, and tries to fill the arrangement space. For strict hierarchies, it attempts to group the nodes below their parents. For other graphs, the levels will be arranged in such a way that the nodes at each layer are spaced evenly.
Constructor and Description |
---|
OrthoTreeArrangement() |
Modifier and Type | Method and Description |
---|---|
void |
arrange(Tree<N> root)
Arranges the graph starting at the specified node.
|
boolean |
isHorizontal()
Returns whether the arrangement is oriented horizontally or vertically
|
void |
setHorizontal(boolean horizontalFlag)
Sets the initial direction for arrangement.
|
void |
setMaxSiblings(int max)
sets the maximum siblings arranged in a row or column for a particular
set of siblings.
|
getMargin, getNodeLocation, getSize, invalidate, setMargin, setNodeLocation, setSize, setSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNodeLocation, getSize, setMargin, setSize, setSize
public void arrange(Tree<N> root) throws ArrangementException
arrange
in interface TreeArrangement<N>
root
- the node to start from in the arrangementArrangementException
- if the node is not within a tree structurepublic boolean isHorizontal()
public void setHorizontal(boolean horizontalFlag)
horizontalFlag
- whether to arrange horizontally or vertically.public void setMaxSiblings(int max)
max
- the maxim number of child nodes arranged on the same layer.
Must be at least 2.