org.jgraph.layout
Class OrderedTreeLayoutAlgorithm

java.lang.Object
  extended byorg.jgraph.layout.JGraphLayoutAlgorithm
      extended byorg.jgraph.layout.TreeLayoutAlgorithm
          extended byorg.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.


Nested Class Summary
 class OrderedTreeLayoutAlgorithm.DefaultComparator
           
 
Nested classes inherited from class org.jgraph.layout.TreeLayoutAlgorithm
TreeLayoutAlgorithm.PolyLine, TreeLayoutAlgorithm.TreeNode
 
Field Summary
 
Fields inherited from class org.jgraph.layout.TreeLayoutAlgorithm
alignment, cell2node, centerRoot, combineLevelNodes, graph, levelDistance, nodeDistance, orientation
 
Fields inherited from class org.jgraph.layout.JGraphLayoutAlgorithm
LAYOUT_ATTRIBUTES
 
Constructor Summary
OrderedTreeLayoutAlgorithm()
          Constructor (will use the default comparator)
OrderedTreeLayoutAlgorithm(java.util.Comparator comparator)
          Constructor
 
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
 

Constructor Detail

OrderedTreeLayoutAlgorithm

public OrderedTreeLayoutAlgorithm(java.util.Comparator comparator)
Constructor

Parameters:
comparator - use to sort the cells

OrderedTreeLayoutAlgorithm

public OrderedTreeLayoutAlgorithm()
Constructor (will use the default comparator)

Method Detail

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