org.pf.joi
Class SpyTreeNode

java.lang.Object
  extended by org.pf.joi.SpyTreeNode
All Implemented Interfaces:
javax.swing.tree.TreeNode
Direct Known Subclasses:
ElementSpyTreeNode, ObjectSpyTreeNode

public abstract class SpyTreeNode
extends java.lang.Object
implements javax.swing.tree.TreeNode

This is the abstract superclass for all types of tree nodes in a JavaSpy.

Since:
JDK 1.2
Version:
1.0
Author:
Manfred Duchrow

Constructor Summary
SpyTreeNode()
          Initialize the new instance with default values.
 
Method Summary
 void add(SpyTreeNode node)
          Adds the given tree node to the receiver's children.
 java.util.Enumeration children()
          Returns the children of the receiver as an enumeration.
 boolean getAllowsChildren()
          Returns true if the receiver allows children.
 javax.swing.tree.TreeNode getChildAt(int childIndex)
          Returns the child TreeNode at index childIndex.
 int getChildCount()
          Returns the number of children TreeNodes the receiver contains.
 java.util.Vector getChildren()
           
 int getIndex(javax.swing.tree.TreeNode node)
          Returns the index of node in the receivers children.
abstract  Spy getModel()
          Returns the receiver's underlying model object.
 javax.swing.tree.TreeNode getParent()
           
 boolean isLeaf()
          Returns true if the receiver is a leaf.
 void setParent(javax.swing.tree.TreeNode newValue)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpyTreeNode

public SpyTreeNode()
Initialize the new instance with default values.

Method Detail

getParent

public javax.swing.tree.TreeNode getParent()
Specified by:
getParent in interface javax.swing.tree.TreeNode

setParent

public void setParent(javax.swing.tree.TreeNode newValue)

getChildren

public java.util.Vector getChildren()

getModel

public abstract Spy getModel()
Returns the receiver's underlying model object.


add

public void add(SpyTreeNode node)
Adds the given tree node to the receiver's children.


children

public java.util.Enumeration children()
Returns the children of the receiver as an enumeration.

Specified by:
children in interface javax.swing.tree.TreeNode

getChildCount

public int getChildCount()
Returns the number of children TreeNodes the receiver contains.

Specified by:
getChildCount in interface javax.swing.tree.TreeNode

getAllowsChildren

public boolean getAllowsChildren()
Returns true if the receiver allows children.

Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode

isLeaf

public boolean isLeaf()
Returns true if the receiver is a leaf.

Specified by:
isLeaf in interface javax.swing.tree.TreeNode

getChildAt

public javax.swing.tree.TreeNode getChildAt(int childIndex)
Returns the child TreeNode at index childIndex.

Specified by:
getChildAt in interface javax.swing.tree.TreeNode

getIndex

public int getIndex(javax.swing.tree.TreeNode node)
Returns the index of node in the receivers children.
If the receiver does not contain node, -1 will be returned.

Specified by:
getIndex in interface javax.swing.tree.TreeNode