vc.gui.client.ui
Class TreeNode

java.lang.Object
  |
  +--javax.swing.tree.DefaultMutableTreeNode
        |
        +--vc.gui.client.ui.TreeNode
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode

public class TreeNode
extends javax.swing.tree.DefaultMutableTreeNode

TreeNode is the model(pattern) class for holding and representing the directory in the project tree. It extends DefaultMutableTreeNode interface to be used as a tree node for Swing's JTee

See Also:
Serialized Form

Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
TreeNode()
          Constructs an empty tree node with no data.
TreeNode(Directory userObject)
          Constructs a tree node from the directory object and it takes the help of super class for its processing.
 
Method Summary
 TreeNode addChildNode(Directory childNode)
          Adds a child node to this node
 void addSubDirectories(ProjectDBManager projectDBManager)
          This is to referesh the children of this node form top to bottom.
 TreeNode getChildNode(java.lang.String directoryID)
          Get a particular child node of this node with a matching directory ID
 java.lang.String toString()
          JTree uses this method for showing the node text in the tree.
 
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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreeNode

public TreeNode(Directory userObject)
Constructs a tree node from the directory object and it takes the help of super class for its processing.
Parameters:
userObject - the actual directory object which is represented by this tree node object

TreeNode

public TreeNode()
Constructs an empty tree node with no data.
Method Detail

toString

public java.lang.String toString()
JTree uses this method for showing the node text in the tree. This class gives the directory name, so that the nodes in the tree will have the directory name as the tree node name.
Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode
Returns:
REturns the name of the directory represented by this node

addSubDirectories

public void addSubDirectories(ProjectDBManager projectDBManager)
                       throws java.lang.Throwable
This is to referesh the children of this node form top to bottom. It will remove all the child nodes and recunstruct the tree under this node.
Parameters:
projectDBManager - projectDBManager is the source of getting the directory structure and data

addChildNode

public TreeNode addChildNode(Directory childNode)
Adds a child node to this node
Parameters:
childNode - the node which is to be added as a child node.

getChildNode

public TreeNode getChildNode(java.lang.String directoryID)
Get a particular child node of this node with a matching directory ID
Parameters:
directoryID - ID of the directory that is to be fetched
Returns:
Returns the child node of this node with a matching directory ID