de.grogra.util
Class Tree

java.lang.Object
  extended by de.grogra.util.TreeModelSupport
      extended by de.grogra.util.Tree
All Implemented Interfaces:
javax.swing.tree.TreeModel
Direct Known Subclasses:
MutableTree

public class Tree
extends TreeModelSupport
implements javax.swing.tree.TreeModel


Nested Class Summary
static class Tree.Node
           
 
Field Summary
protected  Tree.Node root
           
 
Fields inherited from class de.grogra.util.TreeModelSupport
NODES_CHANGED, NODES_INSERTED, NODES_REMOVED, STRUCTURE_CHANGED
 
Constructor Summary
Tree(Tree.Node root)
           
 
Method Summary
static java.lang.Object findFirst(javax.swing.tree.TreeModel tree, java.lang.Object root, ObjectToBoolean filter)
           
static java.lang.Object findMax(javax.swing.tree.TreeModel tree, java.lang.Object root, java.util.Comparator comparator)
           
static java.lang.Object findMax(javax.swing.tree.TreeModel tree, java.lang.Object root, java.util.Comparator comparator, java.lang.Object max)
           
 java.lang.Object getChild(java.lang.Object parent, int index)
           
 int getChildCount(java.lang.Object parent)
           
 int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
           
 int getIndexOfChild(Tree.Node child)
           
 java.lang.Object getParent(java.lang.Object child)
           
 java.lang.Object getRoot()
           
 boolean hasValidPath(Tree.Node leaf)
           
 boolean isLeaf(java.lang.Object node)
           
 boolean nodesEqual(Tree.Node a, Tree.Node b)
           
 void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
           
 
Methods inherited from class de.grogra.util.TreeModelSupport
addTreeModelListener, allListenersRemoved, clearListeners, fireTreeModelEvent, fireTreeModelEvent, fireTreeModelEvent, fireTreeModelEvent, firstListenerAdded, hasListeners, removeTreeModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.tree.TreeModel
addTreeModelListener, removeTreeModelListener
 

Field Detail

root

protected Tree.Node root
Constructor Detail

Tree

public Tree(Tree.Node root)
Method Detail

findFirst

public static java.lang.Object findFirst(javax.swing.tree.TreeModel tree,
                                         java.lang.Object root,
                                         ObjectToBoolean filter)

findMax

public static java.lang.Object findMax(javax.swing.tree.TreeModel tree,
                                       java.lang.Object root,
                                       java.util.Comparator comparator)

findMax

public static java.lang.Object findMax(javax.swing.tree.TreeModel tree,
                                       java.lang.Object root,
                                       java.util.Comparator comparator,
                                       java.lang.Object max)

getChild

public java.lang.Object getChild(java.lang.Object parent,
                                 int index)
Specified by:
getChild in interface javax.swing.tree.TreeModel

getChildCount

public int getChildCount(java.lang.Object parent)
Specified by:
getChildCount in interface javax.swing.tree.TreeModel

getIndexOfChild

public int getIndexOfChild(java.lang.Object parent,
                           java.lang.Object child)
Specified by:
getIndexOfChild in interface javax.swing.tree.TreeModel

getIndexOfChild

public final int getIndexOfChild(Tree.Node child)

getParent

public java.lang.Object getParent(java.lang.Object child)

getRoot

public java.lang.Object getRoot()
Specified by:
getRoot in interface javax.swing.tree.TreeModel

hasValidPath

public boolean hasValidPath(Tree.Node leaf)

isLeaf

public boolean isLeaf(java.lang.Object node)
Specified by:
isLeaf in interface javax.swing.tree.TreeModel

nodesEqual

public boolean nodesEqual(Tree.Node a,
                          Tree.Node b)

valueForPathChanged

public void valueForPathChanged(javax.swing.tree.TreePath path,
                                java.lang.Object newValue)
Specified by:
valueForPathChanged in interface javax.swing.tree.TreeModel