N
- The node type for the graphE
- The edge type for the graphpublic class DirectedArrangement<N,E> extends AbstractArrangement<N> implements GraphArrangement<N,E>
Arrangement class which will arrange all nodes in a directed fashion, similar to a tree, but with multiple possible roots. This arrangement is designed for work-flow or process diagrams. It relies upon having directed edges within the arrangement.
The arrangement can be set to either arrange left-to-right (the default) or top-to-bottom. Any nodes which have no directed edges are placed at the same level as the lowest level edge they connect to; if none of their neighbors are in the directed portion of the graph, they are set to level zero (the top/left side).
Constructor and Description |
---|
DirectedArrangement() |
Modifier and Type | Method and Description |
---|---|
void |
arrange(Graph<N,E> graph)
Arranges the specified Graph
|
boolean |
getShortFlag()
Returns the value of the shortFlag, which is used to determine how
compact to make the arrangement
|
boolean |
isHorizontal()
Returns whether the arrangement is oriented horizontally or vertically
|
void |
setHorizontal(boolean horizontalFlag)
Sets the direction for the arrangement.
|
void |
setShortFlag(boolean shortFlag)
Sets the ShortFlag.
|
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
- Exception thrown if the graph cannot be
arrangedpublic boolean getShortFlag()
public boolean isHorizontal()
public void setHorizontal(boolean horizontalFlag)
horizontalFlag
- whether to arrange horizontally or vertically.public void setShortFlag(boolean shortFlag)
shortFlag
- whether to use a shortened arrangement