Package com.pixelmed.dicom

## Class AttributeTree

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

- All Implemented Interfaces:
    `javax.swing.tree.TreeModel`

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

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

- - ### Constructor Detail

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

    - #### getChild

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

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

    - #### getIndexOfChild

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

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

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

    - #### isLeaf

          public boolean isLeaf​(java.lang.Object node)

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

    - #### valueForPathChanged

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

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

    - #### addTreeModelListener

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

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

    - #### removeTreeModelListener

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

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

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

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