kaos.kpat.applet
Class SortableTreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by kaos.kpat.applet.SortableTreeNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class SortableTreeNode
extends javax.swing.tree.DefaultMutableTreeNode

This class is used to keep the items in the JTree sorted. It relies on the 'compareTo' method in ModelObject. Based on code found at java.sun.com by:

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
SortableTreeNode(java.lang.Object userObject)
           
 
Method Summary
 void add(SortableTreeNode newChild)
           
 void insert(SortableTreeNode newChild, int childIndex)
           
 void remove()
           
 void sort()
           
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SortableTreeNode

public SortableTreeNode(java.lang.Object userObject)
Method Detail

add

public void add(SortableTreeNode newChild)

insert

public void insert(SortableTreeNode newChild,
                   int childIndex)

remove

public void remove()

sort

public void sort()