ucar.unidata.idv.ui
Class DataTreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by ucar.unidata.idv.ui.DataTreeNode
All Implemented Interfaces:
Serializable, Cloneable, MutableTreeNode, TreeNode

public class DataTreeNode
extends DefaultMutableTreeNode

This class is the node used in the DataTree and holds an object which may be a DataSource, DataCategory or DataChoice

Version:
$Revision: 1.17 $Date: 2007/04/11 15:58:21 $
Author:
IDV development team
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
DataTreeNode(DataTree dataTree, String label)
          Create a new tree node with the given label
DataTreeNode(DataTree dataTree, String label, Object object)
          Create a new tree node with the given label and data object
 
Method Summary
 void checkExpansion(DataTree dataTree)
          Expand if needed
 boolean getIsDerived()
          Does this node hold a DerivedDataChoice
 Object getObject()
          Return the object this node holds
 void setIsDerived(boolean b)
          Set if this node hold a DerivedDataChoice
 void setLabel(String label)
          Set the label to be used for display
 
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, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataTreeNode

public DataTreeNode(DataTree dataTree,
                    String label)
Create a new tree node with the given label

Parameters:
dataTree - My data tree
label - The node's label

DataTreeNode

public DataTreeNode(DataTree dataTree,
                    String label,
                    Object object)
Create a new tree node with the given label and data object

Parameters:
dataTree - My data tree
label - The node's label
object - The data object
Method Detail

checkExpansion

public void checkExpansion(DataTree dataTree)
Expand if needed

Parameters:
dataTree - The tree

getIsDerived

public boolean getIsDerived()
Does this node hold a DerivedDataChoice

Returns:
Holds a DerivedDataChoice

setIsDerived

public void setIsDerived(boolean b)
Set if this node hold a DerivedDataChoice

Parameters:
b - Does it hold a DDC

setLabel

public void setLabel(String label)
Set the label to be used for display

Parameters:
label - The display label

getObject

public Object getObject()
Return the object this node holds

Returns:
The data object