Package com.pixelmed.dicom

# Class AttributeTree

java.lang.Object
com.pixelmed.dicom.AttributeTree

All Implemented Interfaces:
  `TreeModel`

public class AttributeTree extends Object implements TreeModel

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

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

See Also:
  - `AttributeTreeBrowser`
  - `AttributeTreeRecord`

## Constructor Summary

Constructors
Constructor
Description
`AttributeTree(AttributeList list)`
Construct an entire tree of attributes from an attribute list.

## Method Summary

Modifier and Type
Method
Description
`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)`
`void`
`setSortByName(boolean sortByName)`
Set the sort order to be alphabetical by attribute name, or numerical by group and element tag.
`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, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### AttributeTree

public AttributeTree(AttributeList list) throws DicomException

Construct an entire tree of attributes from an attribute list.

Parameters:
  `list` - the list whose attributes to add
Throws:
  `DicomException` - if error in DICOM encoding

## Method Details

### getChild

public Object getChild(Object node, int index)

Specified by:
  `getChild` in interface `TreeModel`

### getIndexOfChild

public int getIndexOfChild(Object parent, Object child)

Specified by:
  `getIndexOfChild` in interface `TreeModel`

### getRoot

public Object getRoot()

Specified by:
  `getRoot` in interface `TreeModel`

### getChildCount

public int getChildCount(Object parent)

Specified by:
  `getChildCount` in interface `TreeModel`

### isLeaf

public boolean isLeaf(Object node)

Specified by:
  `isLeaf` in interface `TreeModel`

### valueForPathChanged

public void valueForPathChanged(TreePath path, Object newValue)

Specified by:
  `valueForPathChanged` in interface `TreeModel`

### addTreeModelListener

public void addTreeModelListener(TreeModelListener tml)

Specified by:
  `addTreeModelListener` in interface `TreeModel`

### removeTreeModelListener

public void removeTreeModelListener(TreeModelListener tml)

Specified by:
  `removeTreeModelListener` in interface `TreeModel`

### 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

### setSortByName

public void setSortByName(boolean sortByName)

Set the sort order to be alphabetical by attribute name, or numerical by group and element tag.

Parameters:
  `sortByName` - true if sort alphabetically by attribute name