org.jgraph.layout
Class OrderedTreeLayoutAlgorithm
java.lang.Object
org.jgraph.layout.JGraphLayoutAlgorithm
org.jgraph.layout.TreeLayoutAlgorithm
org.jgraph.layout.OrderedTreeLayoutAlgorithm
- public class OrderedTreeLayoutAlgorithm
- extends TreeLayoutAlgorithm
This class is similar to the TreeLayoutAlgorithm but it will sort
the different levels of the graph using the default comparator
or a custom comparator that you supply.
Method Summary |
java.util.List |
getChildren(CellView view)
Gets the children of the given cell view and sorts
it using a supplied comparator or the default comparator if
none is specified |
java.util.Comparator |
getComparator()
|
void |
setComparator(java.util.Comparator comparator)
|
java.lang.String |
toString()
Returns the name of this algorithm in human
readable form. |
Methods inherited from class org.jgraph.layout.TreeLayoutAlgorithm |
buildTree, buildTrees, createSettings, distance, getAlignment, getHint, getLeftMostX, getLevelDistance, getNodeDistance, getOrientation, getRightMostX, getTreeNode, isCenterRoot, isCombineLevelNodes, join, layout, layoutTrees, merge, run, setAlignment, setCenterRoot, setCombineLevelNodes, setLevelDistance, setLevelHeights, setNodeDistance, setOrientation, setPosition |
Methods inherited from class org.jgraph.layout.JGraphLayoutAlgorithm |
applyLayout, applyLayout, createDialog, createDialog, getMaximumProgress, getProgress, isAllowedToRun, populateDialog, run, setAllowedToRun, setMaximumProgress, setProgress |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OrderedTreeLayoutAlgorithm
public OrderedTreeLayoutAlgorithm(java.util.Comparator comparator)
- Constructor
- Parameters:
comparator
- use to sort the cells
OrderedTreeLayoutAlgorithm
public OrderedTreeLayoutAlgorithm()
- Constructor (will use the default comparator)
toString
public java.lang.String toString()
- Returns the name of this algorithm in human
readable form.
- Overrides:
toString
in class TreeLayoutAlgorithm
setComparator
public void setComparator(java.util.Comparator comparator)
getComparator
public java.util.Comparator getComparator()
- Returns:
- the cell comparator
getChildren
public java.util.List getChildren(CellView view)
- Gets the children of the given cell view and sorts
it using a supplied comparator or the default comparator if
none is specified
- Overrides:
getChildren
in class TreeLayoutAlgorithm