net.openai.ai.nn.gui.widgets
Class AbstractTreeModel

java.lang.Object
  |
  +--javax.swing.tree.DefaultTreeModel
        |
        +--net.openai.ai.nn.gui.widgets.AbstractTreeModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.tree.TreeModel
Direct Known Subclasses:
AITreeModel, ScriptTreeModel

public abstract class AbstractTreeModel
extends javax.swing.tree.DefaultTreeModel

Generic TreeModel that uses AITreeNodes

Version:
$Id: AbstractTreeModel.java,v 1.3 2002/02/19 22:10:50 tweber Exp $ History:
$Log: AbstractTreeModel.java,v $
Revision 1.3 2002/02/19 22:10:50 tweber
Fixed ID's from 'int' to 'long'

Revision 1.2 2002/02/14 23:24:12 gleo
Jindent run through.

Revision 1.1 2002/02/13 09:18:19 tweber
Initial release
Author:
Thomas Weber
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
AbstractTreeModel()
          Constructs a new model with a root-node
AbstractTreeModel(AITreeNode root)
          Construct a new model with the given root
 
Method Summary
abstract  void BuildTree()
          Must be overwriten in the Implementation.
 AITreeNode getNode(java.lang.Class NodeClass, AITreeNode searchroot, long lID)
          Find a node with the given ID and the given subclass
 AITreeNode getNode(java.lang.Class NodeClass, AITreeNode searchroot, java.lang.String Name)
          Find a node with the given name and the given subclass
 AITreeNode getNode(long lID)
          Find the first node with the given ID
 AITreeNode getNode(java.lang.String Name)
          Find the first node with the given name
 javax.swing.tree.TreePath getPath(javax.swing.tree.TreeNode nd)
          Returns the path of a Node
 java.util.Vector ScanNodes(AITreeNode ndParent)
          Returns a vector containing all (sub-)childs of the given parent
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTreeModel

public AbstractTreeModel()
Constructs a new model with a root-node


AbstractTreeModel

public AbstractTreeModel(AITreeNode root)
Construct a new model with the given root

Parameters:
root - Root-node of the new TreeModel
Method Detail

BuildTree

public abstract void BuildTree()
Must be overwriten in the Implementation. This Method has to fill the tree


ScanNodes

public java.util.Vector ScanNodes(AITreeNode ndParent)
Returns a vector containing all (sub-)childs of the given parent

Parameters:
ndParent - Parent to scan for childs
Returns:
Vector with all (sub-)childs of ndParent

getPath

public javax.swing.tree.TreePath getPath(javax.swing.tree.TreeNode nd)
Returns the path of a Node


getNode

public AITreeNode getNode(java.lang.String Name)
Find the first node with the given name

Parameters:
Name - Nodename to be found
Returns:
Node with the given name

getNode

public AITreeNode getNode(long lID)
Find the first node with the given ID

Parameters:
lID - ID to be found
Returns:
Node with the given ID

getNode

public AITreeNode getNode(java.lang.Class NodeClass,
                          AITreeNode searchroot,
                          java.lang.String Name)
Find a node with the given name and the given subclass

Parameters:
NodeClass - Class of the node to be found
searchroot - Node where the search starts
Name - Nodename to be found
Returns:
Node of specified class and given name

getNode

public AITreeNode getNode(java.lang.Class NodeClass,
                          AITreeNode searchroot,
                          long lID)
Find a node with the given ID and the given subclass

Parameters:
NodeClass - Class of the node to be found
searchroot - Node where the search starts
Returns:
Node of specified class and given ID


Copyright - 2001 OpenAI Labs. All Rights Reserved.