com.pixelmed.scpecg

## Class SCPTree

- java.lang.Object
- - com.pixelmed.scpecg.SCPTree

All Implemented Interfaces:
  javax.swing.tree.TreeModel

    public class SCPTree
    extends java.lang.Object
    implements javax.swing.tree.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

Constructors
Constructor and Description
`SCPTree(SCPECG scpecg)` Construct an entire tree of attributes from an SCP-ECG instance.

### Method Summary

Methods
`void` `addTreeModelListener(javax.swing.event.TreeModelListener tml)`
`java.lang.Object` `getChild(java.lang.Object node, int index)`
`int` `getChildCount(java.lang.Object parent)`
`int` `getIndexOfChild(java.lang.Object parent, java.lang.Object child)`
`java.lang.Object` `getRoot()`
`boolean` `isLeaf(java.lang.Object node)`
`void` `removeTreeModelListener(javax.swing.event.TreeModelListener tml)`
`java.lang.String` `toString()` Walk the entire tree and dump as a string.
`void` `valueForPathChanged(javax.swing.tree.TreePath path, java.lang.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 java.lang.Exception

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

Parameters:
  `scpecg` - an SCP-ECG instance
Throws:
  `java.lang.Exception`

### Method Detail

#### getChild

    public java.lang.Object getChild(java.lang.Object node,
                            int index)

Specified by:
  `getChild` in interface `javax.swing.tree.TreeModel`
Parameters:
  `node` -
  `index` -

#### getIndexOfChild

    public int getIndexOfChild(java.lang.Object parent,
                      java.lang.Object child)

Specified by:
  `getIndexOfChild` in interface `javax.swing.tree.TreeModel`
Parameters:
  `parent` -
  `child` -

#### getRoot

    public java.lang.Object getRoot()

Specified by:
  `getRoot` in interface `javax.swing.tree.TreeModel`

#### getChildCount

    public int getChildCount(java.lang.Object parent)

Specified by:
  `getChildCount` in interface `javax.swing.tree.TreeModel`
Parameters:
  `parent` -

#### isLeaf

    public boolean isLeaf(java.lang.Object node)

Specified by:
  `isLeaf` in interface `javax.swing.tree.TreeModel`
Parameters:
  `node` -

#### valueForPathChanged

    public void valueForPathChanged(javax.swing.tree.TreePath path,
                           java.lang.Object newValue)

Specified by:
  `valueForPathChanged` in interface `javax.swing.tree.TreeModel`
Parameters:
  `path` -
  `newValue` -

#### addTreeModelListener

    public void addTreeModelListener(javax.swing.event.TreeModelListener tml)

Specified by:
  `addTreeModelListener` in interface `javax.swing.tree.TreeModel`
Parameters:
  `tml` -

#### removeTreeModelListener

    public void removeTreeModelListener(javax.swing.event.TreeModelListener tml)

Specified by:
  `removeTreeModelListener` in interface `javax.swing.tree.TreeModel`
Parameters:
  `tml` -

#### toString

    public java.lang.String toString()

Walk the entire tree and dump as a string.

Overrides:
  `toString` in class `java.lang.Object`
Returns:
  the attributes in the tree as a string