N
- The node classE
- The edge classpublic class TierArrangement<N,E> extends FocusArrangement<N> implements GraphArrangement<N,E>, TreeArrangement<N>
Arrangement class which will arrange the nodes in a hierarchical layout. The nodes are arranged with the focusNode as the root on the top (lowest Y value). The Arrangement will attempt to make the best decision about how to arrange the nodes. If there is no specified root, an ArrangementException is thrown.
The nodes are arranged in tiers, and the arrangement attempts to fit the nodes within each level in the best way it can. The levels will be arranged in such a way that the nodes at each layer are spaced evenly.
Constructor and Description |
---|
TierArrangement() |
Modifier and Type | Method and Description |
---|---|
void |
arrange(Graph<N,E> graph)
Arranges the graph starting at the focus node.
|
void |
arrange(Tree<N> tree)
Arranges the tree starting at the root node.
|
focusOnMostConnected, getFocusNode, setFocusNode
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(Graph<N,E> graph) throws ArrangementException
arrange
in interface GraphArrangement<N,E>
graph
- the graph to be arrangedArrangementException
- if the graph does not contain a tree
structurepublic void arrange(Tree<N> tree)
arrange
in interface TreeArrangement<N>
tree
- the tree to be arranged