Watcher.v2_1
Class Node

java.lang.Object
  |
  +--javax.swing.tree.DefaultMutableTreeNode
        |
        +--Watcher.v2_1.Node
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode

public class Node
extends javax.swing.tree.DefaultMutableTreeNode

A Node contains data which is shown in an instance of JTree. A Node can be of different types; Grouping (the root node), Actor or RoleSession nodes.

Version:
December 2001
Author:
Lars Erik Liljebäck
See Also:
Serialized Form

Inner classes inherited from class javax.swing.tree.DefaultMutableTreeNode
javax.swing.tree.DefaultMutableTreeNode.BreadthFirstEnumeration, javax.swing.tree.DefaultMutableTreeNode.PathBetweenNodesEnumeration, javax.swing.tree.DefaultMutableTreeNode.PostorderEnumeration, javax.swing.tree.DefaultMutableTreeNode.PreorderEnumeration
 
Field Summary
private  java.lang.String gai
          The node's GAI which uniquely defines it.
private  java.lang.String label
          The node's label.
private  int nodetype
          Specifies which type of node this is.
static int NODETYPE_ACTOR
           
static int NODETYPE_GROUPING
           
static int NODETYPE_ROLESESSION
           
private  WatcherWindow window
          Reference to the WatcherWindow used for debugging
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
Node(WatcherWindow ww, int type, java.lang.String label, java.lang.String gai)
          Creates a new node with the specified nodetype, label and GAI.
 
Method Summary
 boolean containsGAI(java.lang.String tmpGAI)
          Returns True if the node's GAI matches the specified GAI, else it returns False.
private  void dbg(java.lang.String dbg)
          Writes debug-information to the DebugView via WatcherWindow's debug().
 java.lang.String getGAI()
          Returns the node's GAI as a string.
 java.lang.String getLabel()
          Returns the node's label.
 int getNodetype()
          Returns the nodetype of this Node.
 java.lang.String toString()
          This method is a redefinition of the toString method inherited from Object.
 
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, readObject, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, writeObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

NODETYPE_GROUPING

public static final int NODETYPE_GROUPING

NODETYPE_ACTOR

public static final int NODETYPE_ACTOR

NODETYPE_ROLESESSION

public static final int NODETYPE_ROLESESSION

window

private WatcherWindow window
Reference to the WatcherWindow used for debugging

nodetype

private int nodetype
Specifies which type of node this is.

label

private java.lang.String label
The node's label.

gai

private java.lang.String gai
The node's GAI which uniquely defines it.
Constructor Detail

Node

public Node(WatcherWindow ww,
            int type,
            java.lang.String label,
            java.lang.String gai)
Creates a new node with the specified nodetype, label and GAI.
Parameters:
ww - Reference to WatcherWindow.
type - The type of node created.
label - The label of the node.
gai - The node's GAI as a string.
Method Detail

containsGAI

public boolean containsGAI(java.lang.String tmpGAI)
Returns True if the node's GAI matches the specified GAI, else it returns False.
Parameters:
tmpGAI - The GAI which is matched against this node's GAI.
Returns:
Wether the node's GAI mathces the specified GAI or not.

getGAI

public java.lang.String getGAI()
Returns the node's GAI as a string.
Returns:
The GAI.

getLabel

public java.lang.String getLabel()
Returns the node's label.
Returns:
The label.

getNodetype

public int getNodetype()
Returns the nodetype of this Node.
Returns:
The nodetype.

toString

public java.lang.String toString()
This method is a redefinition of the toString method inherited from Object. It is called when the node is drawn in the JTree. It returns the node's label for Actor nodes and GAI for RoleSession nodes. For nodes with an undefined nodetype it returns the node's label.
Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode
Returns:
A string representation of the node.

dbg

private void dbg(java.lang.String dbg)
Writes debug-information to the DebugView via WatcherWindow's debug().
Parameters:
dbg - The debug-information.