com.extentech.ExtenBean.swing
Class ExtenBeanTreeModel

java.lang.Object
  extended by javax.swing.tree.DefaultTreeModel
      extended by com.extentech.ExtenBean.swing.ExtenBeanTreeModel
All Implemented Interfaces:
Serializable, TreeModel

public class ExtenBeanTreeModel
extends DefaultTreeModel

TreeModel backed by a DataObject

Author:
John McMahon
See Also:
Serialized Form

Field Summary
 int NODETYPE
           
 ExtenBeanTreeNode thisNode
           
 
Constructor Summary
ExtenBeanTreeModel(JTree t)
          Superclass constructor.
ExtenBeanTreeModel(TreeNode root, JTree t)
          Default Constructor.
ExtenBeanTreeModel(TreeNode root, JTree t, boolean asksAllowsChildren)
          Superclass constructor.
 
Method Summary
 void addListener(ExtenBeanTreeChangeListener t)
          Sets the tree model's container application to provide a handle to display and action methods outside of the tree itself.
 ExtenBeanTreeNode addObject(ExtenBeanTreeNode parent, Object child)
           
 ExtenBeanTreeNode addObject(ExtenBeanTreeNode parent, Object child, boolean shouldBeVisible)
          You can either add ExtenBeanTreeNodes or DataObjects to this TreeModel
 ExtenBeanTreeNode addObject(Object child)
          Add child to the currently selected node.
 TreeNode checkNodeMatch(String chk, TreeNode nd)
           
 void clear()
          Remove all nodes except the root node.
 TreeNode getNodeByName(String nm)
           
 TreeNode getRootNode()
          returns the root node
 void init(JTree t)
          Initialize this TreeModel.
 void notifyNodeListeners(ExtenBeanTreeNode n, TreeSelectionEvent e)
           
 void removeCurrentNode()
          Remove the currently selected node.
 void scrollToNode(ExtenBeanTreeNode nd)
           
 void scrollToNode(String nd)
           
 void setTopNode(ExtenBeanTreeNode t)
          Set a handle to the root of the tree.
 void setTree(JTree t)
          Set a handle to the tree controlled by this model.
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thisNode

public ExtenBeanTreeNode thisNode

NODETYPE

public int NODETYPE
Constructor Detail

ExtenBeanTreeModel

public ExtenBeanTreeModel(TreeNode root,
                          JTree t)
Default Constructor.


ExtenBeanTreeModel

public ExtenBeanTreeModel(JTree t)
Superclass constructor. You will still need to set the tree and init this model to use it.


ExtenBeanTreeModel

public ExtenBeanTreeModel(TreeNode root,
                          JTree t,
                          boolean asksAllowsChildren)
Superclass constructor. You will still need to set the tree and init this model to use it.

Method Detail

getRootNode

public TreeNode getRootNode()
returns the root node


addListener

public void addListener(ExtenBeanTreeChangeListener t)
Sets the tree model's container application to provide a handle to display and action methods outside of the tree itself. This class implements the ExtenBeanTreeChangedListener interface.


scrollToNode

public void scrollToNode(String nd)

scrollToNode

public void scrollToNode(ExtenBeanTreeNode nd)

getNodeByName

public TreeNode getNodeByName(String nm)

checkNodeMatch

public TreeNode checkNodeMatch(String chk,
                               TreeNode nd)

notifyNodeListeners

public void notifyNodeListeners(ExtenBeanTreeNode n,
                                TreeSelectionEvent e)

setTree

public void setTree(JTree t)
Set a handle to the tree controlled by this model.


setTopNode

public void setTopNode(ExtenBeanTreeNode t)
Set a handle to the root of the tree.


init

public void init(JTree t)
Initialize this TreeModel.


clear

public void clear()
Remove all nodes except the root node.


removeCurrentNode

public void removeCurrentNode()
Remove the currently selected node.


addObject

public ExtenBeanTreeNode addObject(Object child)
Add child to the currently selected node.


addObject

public ExtenBeanTreeNode addObject(ExtenBeanTreeNode parent,
                                   Object child)

addObject

public ExtenBeanTreeNode addObject(ExtenBeanTreeNode parent,
                                   Object child,
                                   boolean shouldBeVisible)
You can either add ExtenBeanTreeNodes or DataObjects to this TreeModel



Copyright © 2011 Extentech Inc. All Rights Reserved.