com.pixelmed.dicom
Class AttributeTree

java.lang.Object
  extended by 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
AttributeTree(AttributeList list)
          Construct an entire tree of attributes from an attribute list.
 
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)
           
 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, finalize, 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
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

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