byucc.jhdl.apps.Viewers.NewTreeBrowser
Class TreeBrowserNode

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended bybyucc.jhdl.apps.Viewers.NewTreeBrowser.TreeBrowserNode
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode

public class TreeBrowserNode
extends javax.swing.tree.DefaultMutableTreeNode

Wraps a Cell for use as a node in a TreeBrowserNode.

Author:
Tyler Anderson
See Also:
Serialized Form

Field Summary
protected  boolean _expanded
           
protected  TreeBrowserModel _model
           
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
TreeBrowserNode(Nameable usrObj, boolean expandAll, boolean haveWiresAsChildren, TreeBrowserModel model)
          Builds a TreeBrowserNode.
TreeBrowserNode(Nameable usrObj, TreeBrowserModel model)
           
 
Method Summary
 java.lang.Object addSetProperty(java.lang.String property, java.lang.Object value)
           
 void expand()
           
 void expand(boolean haveWiresAsChildren)
           
 Cell getCell()
          Casts the encapsulated object as a Cell.
 java.lang.String getFullName()
          Gets the name associated with this node.
 java.lang.String getName()
          Gets the name associated with this node.
 java.lang.Object getProperty(java.lang.String property)
           
 Wire getWire()
          Casts the encapsulated object as a Wire.
 boolean hasChildren(Nameable usrObj)
           
 boolean isCell()
          Tests whether this node encapsulates a Cell object.
 boolean isExpanded()
           
 boolean isWire()
          Tests whether this node encapsulates a Wire object.
 void sortChildren()
           
 java.lang.String toString()
          returns the name of the cell.
 
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
 

Field Detail

_expanded

protected boolean _expanded

_model

protected TreeBrowserModel _model
Constructor Detail

TreeBrowserNode

public TreeBrowserNode(Nameable usrObj,
                       TreeBrowserModel model)

TreeBrowserNode

public TreeBrowserNode(Nameable usrObj,
                       boolean expandAll,
                       boolean haveWiresAsChildren,
                       TreeBrowserModel model)
Builds a TreeBrowserNode. This private constructor exists for only this class to use to create new nodes. The only node that needs to be created by classes outside of this class is the root node.

Method Detail

hasChildren

public boolean hasChildren(Nameable usrObj)

expand

public void expand()

expand

public void expand(boolean haveWiresAsChildren)

addSetProperty

public java.lang.Object addSetProperty(java.lang.String property,
                                       java.lang.Object value)

getProperty

public java.lang.Object getProperty(java.lang.String property)

isCell

public boolean isCell()
Tests whether this node encapsulates a Cell object.

Returns:
true if this node encapsulates a Cell

isWire

public boolean isWire()
Tests whether this node encapsulates a Wire object.

Returns:
true if this node encapsulates a Wire

getCell

public Cell getCell()
Casts the encapsulated object as a Cell. Function does NOT test whether this is valid; caller is responsible to call isCell to determine whether this is a valid cast.

Returns:
The encapsulated Cell

getWire

public Wire getWire()
Casts the encapsulated object as a Wire. Function does NOT test whether this is valid; caller is responsible to call isWire to determine whether this is a valid cast.

Returns:
The Encapsulated Wire

sortChildren

public void sortChildren()

getName

public java.lang.String getName()
Gets the name associated with this node. Will be the leaf name of the JHDL object


getFullName

public java.lang.String getFullName()
Gets the name associated with this node. Will be the full name of the JHDL object


isExpanded

public boolean isExpanded()

toString

public java.lang.String toString()
returns the name of the cell.



Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.