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
.
AttributeTreeBrowser
,
AttributeTreeRecord
Constructor and Description |
---|
AttributeTree(AttributeList list)
Construct an entire tree of attributes from an attribute list.
|
Modifier and Type | Method and 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) |
public AttributeTree(AttributeList list) throws DicomException
Construct an entire tree of attributes from an attribute list.
list
- the list whose attributes to addDicomException
- if error in DICOM encodingpublic void addTreeModelListener(TreeModelListener tml)
addTreeModelListener
in interface TreeModel
public int getChildCount(Object parent)
getChildCount
in interface TreeModel
public int getIndexOfChild(Object parent, Object child)
getIndexOfChild
in interface TreeModel
public void removeTreeModelListener(TreeModelListener tml)
removeTreeModelListener
in interface TreeModel
public void setSortByName(boolean sortByName)
Set the sort order to be alphabetical by attribute name, or numerical by group and element tag.
sortByName
- true if sort alphabetically by attribute namepublic String toString()
Walk the entire tree and dump as a string.
public void valueForPathChanged(TreePath path, Object newValue)
valueForPathChanged
in interface TreeModel