org.concord.biologica.ui
Class TreeViewModel

java.lang.Object
  |
  +--javax.swing.tree.DefaultTreeModel
        |
        +--org.concord.biologica.ui.TreeViewModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.tree.TreeModel

public final class TreeViewModel
extends javax.swing.tree.DefaultTreeModel

TreeViewModel extends JTreeModel to extends valueForPathChanged. This method is called as a result of the user editing a value in the tree. If you allow editing in your tree, are using TreeNodes and the user object of the TreeNodes is not a String, then you're going to have to subclass JTreeModel as this example does.

Version:
$Revision: 1.1.1.1 $ $Date: 2001/04/28 00:39:21 $
Author:
$Author: ed $
See Also:
Serialized Form

Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
TreeViewModel(javax.swing.tree.TreeNode newRoot)
          Creates a new instance of TreeViewModel with newRoot set to the root of this model.
 
Method Summary
 void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
          Subclassed to message setString() to the changed path item.
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeViewModel

public TreeViewModel(javax.swing.tree.TreeNode newRoot)
Creates a new instance of TreeViewModel with newRoot set to the root of this model.
Method Detail

valueForPathChanged

public void valueForPathChanged(javax.swing.tree.TreePath path,
                                java.lang.Object newValue)
Subclassed to message setString() to the changed path item.
Overrides:
valueForPathChanged in class javax.swing.tree.DefaultTreeModel