agentland.debug
Class MethodTreeModel

java.lang.Object
  |
  +--agentland.debug.MethodTreeModel
All Implemented Interfaces:
TreeModel

public class MethodTreeModel
extends Object
implements TreeModel

Handles the data representation for method trees, so that we don't have to build our own DefaultTreeModel instead. We can do this lazily, without having to descend through all the methods at startup time -- we just look at them as we go. Created: Tue Jan 22 14:27:48 2002


Constructor Summary
MethodTreeModel(String ifaceName)
           
 
Method Summary
 void addTreeModelListener(TreeModelListener l)
          Adds a listener for changes to this model.
protected  void fireTreeUpdate(boolean inserted, TreePath parent, List nodes)
          Tell all the listeners about added or removed method nodes.
 Object getChild(Object parent, int index)
          Returns the child of parent at index index in the parent's child array.
 int getChildCount(Object parent)
          Returns the number of children of parent.
 int getIndexOfChild(Object parent, Object child)
          Returns the index of child in parent.
 Object getRoot()
          Returns the root of the tree.
 boolean isLeaf(Object node)
          Returns true if node is a leaf.
 void removeTreeModelListener(TreeModelListener l)
          Removes a listener previously added with addTreeModelListener().
 void toggleMethods(TreePath path)
           
 void valueForPathChanged(TreePath path, Object newValue)
          Messaged when the user has altered the value for the item identified by path to newValue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodTreeModel

public MethodTreeModel(String ifaceName)
                throws ClassNotFoundException
Method Detail

toggleMethods

public void toggleMethods(TreePath path)

fireTreeUpdate

protected void fireTreeUpdate(boolean inserted,
                              TreePath parent,
                              List nodes)
Tell all the listeners about added or removed method nodes.

getChild

public Object getChild(Object parent,
                       int index)
Returns the child of parent at index index in the parent's child array. If methods are being shown for this guy, we display them.
Specified by:
getChild in interface TreeModel

getChildCount

public int getChildCount(Object parent)
Returns the number of children of parent.
Specified by:
getChildCount in interface TreeModel

getIndexOfChild

public int getIndexOfChild(Object parent,
                           Object child)
Returns the index of child in parent.
Specified by:
getIndexOfChild in interface TreeModel

getRoot

public Object getRoot()
Returns the root of the tree.
Specified by:
getRoot in interface TreeModel

isLeaf

public boolean isLeaf(Object node)
Returns true if node is a leaf.
Specified by:
isLeaf in interface TreeModel

addTreeModelListener

public void addTreeModelListener(TreeModelListener l)
Adds a listener for changes to this model.
Specified by:
addTreeModelListener in interface TreeModel

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener l)
Removes a listener previously added with addTreeModelListener().
Specified by:
removeTreeModelListener in interface TreeModel

valueForPathChanged

public void valueForPathChanged(TreePath path,
                                Object newValue)
Messaged when the user has altered the value for the item identified by path to newValue. Not used by this model.
Specified by:
valueForPathChanged in interface TreeModel