com.pixelmed.scpecg
Class SCPTree

java.lang.Object
  extended by com.pixelmed.scpecg.SCPTree
All Implemented Interfaces:
TreeModel

public class SCPTree
extends Object
implements TreeModel

The SCPTree class implements a TreeModel to abstract the contents of a list of attributes as a tree in order to provide support for a SCPTreeBrowser.

For details of some of the methods implemented here see javax.swing.tree.TreeModel.

See Also:
SCPTreeBrowser, SCPTreeRecord

Constructor Summary
SCPTree(SCPECG scpecg)
          Construct an entire tree of attributes from an SCP-ECG instance.
 
Method Summary
 void addTreeModelListener(TreeModelListener tml)
           
 Object getChild(Object node, int index)
           
 int getChildCount(Object parent)
           
 int getIndexOfChild(Object parent, Object child)
           
 Object getRoot()
           
 boolean isLeaf(Object node)
           
 void removeTreeModelListener(TreeModelListener tml)
           
 String toString()
          Walk the entire tree and dump as a string.
 void valueForPathChanged(TreePath path, Object newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SCPTree

public SCPTree(SCPECG scpecg)
        throws Exception

Construct an entire tree of attributes from an SCP-ECG instance.

Parameters:
scpecg - an SCP-ECG instance
Throws:
Exception
Method Detail

getChild

public Object getChild(Object node,
                       int index)
Specified by:
getChild in interface TreeModel
Parameters:
node -
index -

getIndexOfChild

public int getIndexOfChild(Object parent,
                           Object child)
Specified by:
getIndexOfChild in interface TreeModel
Parameters:
parent -
child -

getRoot

public Object getRoot()
Specified by:
getRoot in interface TreeModel

getChildCount

public int getChildCount(Object parent)
Specified by:
getChildCount in interface TreeModel
Parameters:
parent -

isLeaf

public boolean isLeaf(Object node)
Specified by:
isLeaf in interface TreeModel
Parameters:
node -

valueForPathChanged

public void valueForPathChanged(TreePath path,
                                Object newValue)
Specified by:
valueForPathChanged in interface TreeModel
Parameters:
path -
newValue -

addTreeModelListener

public void addTreeModelListener(TreeModelListener tml)
Specified by:
addTreeModelListener in interface TreeModel
Parameters:
tml -

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener tml)
Specified by:
removeTreeModelListener in interface TreeModel
Parameters:
tml -

toString

public String toString()

Walk the entire tree and dump as a string.

Overrides:
toString in class Object
Returns:
the attributes in the tree as a string