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
.
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(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) |
public AttributeTree(AttributeList list) throws DicomException
Construct an entire tree of attributes from an attribute list.
list
- the list whose attributes to addDicomException
public java.lang.Object getChild(java.lang.Object node, int index)
getChild
in interface javax.swing.tree.TreeModel
node
- index
- public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
getIndexOfChild
in interface javax.swing.tree.TreeModel
parent
- child
- public java.lang.Object getRoot()
getRoot
in interface javax.swing.tree.TreeModel
public int getChildCount(java.lang.Object parent)
getChildCount
in interface javax.swing.tree.TreeModel
parent
- public boolean isLeaf(java.lang.Object node)
isLeaf
in interface javax.swing.tree.TreeModel
node
- public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
valueForPathChanged
in interface javax.swing.tree.TreeModel
path
- newValue
- public void addTreeModelListener(javax.swing.event.TreeModelListener tml)
addTreeModelListener
in interface javax.swing.tree.TreeModel
tml
- public void removeTreeModelListener(javax.swing.event.TreeModelListener tml)
removeTreeModelListener
in interface javax.swing.tree.TreeModel
tml
- public java.lang.String toString()
Walk the entire tree and dump as a string.
toString
in class java.lang.Object
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 name