com.pixelmed.query
Class QueryTreeModel

java.lang.Object
  extended by com.pixelmed.query.QueryTreeModel
All Implemented Interfaces:
TreeModel

public class QueryTreeModel
extends Object
implements TreeModel

The QueryTreeModel class implements a TreeModel to abstract the contents of a query response as a tree in order to provide support for a QueryTreeBrowser.

See Also:
TreeModel

Constructor Summary
QueryTreeModel(QueryInformationModel q, AttributeList filter, int debugLevel)
          Construct a tree model with a root node on top.
 
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)
           
 String toString()
          Dump the entire tree to 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

QueryTreeModel

public QueryTreeModel(QueryInformationModel q,
                      AttributeList filter,
                      int debugLevel)
               throws DicomException

Construct a tree model with a root node on top.

The root node is the name of the called AET in the query information model.

The contents are added as required by actually performing queries as nodes are expanded.

Parameters:
q - the query information model to build the tree from
filter - the query request identifier as a list of DICOM attributes
debugLevel - 0 is no debugging (silent), > 0 more verbose levels of debugging
Throws:
DicomException - thrown if there are problems building the tree
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()

Dump the entire tree to a string.

Performs a top-down traversal.

Overrides:
toString in class Object
Returns:
a multiline string with one line per node in the tree
See Also:
QueryTreeRecord.toString()