public class DatabaseTreeModel extends Object implements TreeModel
The DatabaseTreeModel
class implements a
TreeModel
to abstract the contents of a database as
a tree in order to provide support for a DatabaseTreeBrowser
.
For details of some of the methods implemented here see javax.swing.tree.TreeModel
.
Constructor and Description |
---|
DatabaseTreeModel(DatabaseInformationModel d)
Construct a tree model of the supplied database.
|
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) |
String |
toString()
Dump the entire tree to a string.
|
void |
valueForPathChanged(TreePath path,
Object newValue) |
public DatabaseTreeModel(DatabaseInformationModel d) throws DicomException
Construct a tree model of the supplied database.
d
- the database information model to build the tree fromDicomException
- thrown if there are problems accessing the databasepublic void addTreeModelListener(TreeModelListener tml)
addTreeModelListener
in interface TreeModel
tml
- public int getChildCount(Object parent)
getChildCount
in interface TreeModel
parent
- public int getIndexOfChild(Object parent, Object child)
getIndexOfChild
in interface TreeModel
parent
- child
- public boolean isLeaf(Object node)
public void removeTreeModelListener(TreeModelListener tml)
removeTreeModelListener
in interface TreeModel
tml
- public String toString()
Dump the entire tree to a string.
Performs a top-down traversal.
toString
in class Object
DatabaseTreeRecord.toString()
public void valueForPathChanged(TreePath path, Object newValue)
valueForPathChanged
in interface TreeModel
path
- newValue
-