Class QueryTreeBrowser
- Direct Known Subclasses:
DicomCleaner.OurQueryTreeBrowser
,DoseUtility.OurQueryTreeBrowser
,DownloadOrTransmit.OurQueryTreeBrowser
The QueryTreeBrowser
class implements a Swing graphical user interface
to browse the contents of QueryTreeModel
.
The browser is rendered as a tree view of the returned query identifier and a one row tabular representation of the contents of any level that the user selects in the tree. Constructors are provided to either add the browser to a frame and creating the tree and table, or to make use of a pair of existing scrolling panes.
Though a functional browser can be built using this class, to add application-specific behavior
to be applied when a user selects from the tree, a sub-class inheriting
from this class should be constructed that overrides the
buildTreeSelectionListenerToDoSomethingWithSelectedLevel
method The default implementation is as follows:
protected TreeSelectionListener buildTreeSelectionListenerToDoSomethingWithSelectedLevel() { return new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent tse) { TreePath tp = tse.getNewLeadSelectionPath(); if (tp != null) { Object lastPathComponent = tp.getLastPathComponent(); if (lastPathComponent instanceof QueryTreeRecord) { QueryTreeRecord r = (QueryTreeRecord)lastPathComponent; System.err.println("TreeSelectionListener.valueChanged: "+r.getUniqueKeys()); } } } }; }
-
Constructor Summary
ConstructorsConstructorDescriptionQueryTreeBrowser
(QueryInformationModel q, QueryTreeModel m, Container content) Build and display a graphical user interface view of a database information model.QueryTreeBrowser
(QueryInformationModel q, QueryTreeModel m, JFrame frame) Build and display a graphical user interface view of a database information model.QueryTreeBrowser
(QueryInformationModel q, QueryTreeModel m, JScrollPane treeBrowserScrollPane, JScrollPane attributeBrowserScrollPane) Build and display a graphical user interface view of a database information model. -
Method Summary
Modifier and TypeMethodDescriptionprotected TreeSelectionListener
buildTreeSelectionListenerToDisplayAttributesOfSelectedRecord
(JScrollPane attributeBrowserScrollPane) By default this method populates the tabular attribute browser when an entity is selected in the tree browser.protected TreeSelectionListener
Override this method to perform application-specific behavior when an entity is selected in the tree browser.Return the records currently selected.
-
Constructor Details
-
QueryTreeBrowser
public QueryTreeBrowser(QueryInformationModel q, QueryTreeModel m, JScrollPane treeBrowserScrollPane, JScrollPane attributeBrowserScrollPane) throws DicomException Build and display a graphical user interface view of a database information model.
- Parameters:
q
- the query information modelm
- the query tree model (i.e. the results returned from an actual query)treeBrowserScrollPane
- the scrolling pane in which the tree view of the query results will be renderedattributeBrowserScrollPane
- the scrolling pane in which the tabular view of the currently selected level will be rendered- Throws:
DicomException
- thrown if the information cannot be extracted
-
QueryTreeBrowser
public QueryTreeBrowser(QueryInformationModel q, QueryTreeModel m, Container content) throws DicomException Build and display a graphical user interface view of a database information model.
- Parameters:
q
- the query information modelm
- the query tree model (i.e. the results returned from an actual query)content
- content pane will to add scrolling panes containing tree and tabular selection views- Throws:
DicomException
- thrown if the information cannot be extracted
-
QueryTreeBrowser
public QueryTreeBrowser(QueryInformationModel q, QueryTreeModel m, JFrame frame) throws DicomException Build and display a graphical user interface view of a database information model.
- Parameters:
q
- the query information modelm
- the query tree model (i.e. the results returned from an actual query)frame
- a frame to whose content pane will be added scrolling panes containing tree and tabular selection views- Throws:
DicomException
- thrown if the information cannot be extracted
-
-
Method Details
-
getSelectionPaths
Return the records currently selected.
- Returns:
- the records currently selected
-
buildTreeSelectionListenerToDoSomethingWithSelectedLevel
Override this method to perform application-specific behavior when an entity is selected in the tree browser.
By default this method dumps the string values of the unique keys to the console for level selection, which is pretty useless.
-
buildTreeSelectionListenerToDisplayAttributesOfSelectedRecord
protected TreeSelectionListener buildTreeSelectionListenerToDisplayAttributesOfSelectedRecord(JScrollPane attributeBrowserScrollPane) By default this method populates the tabular attribute browser when an entity is selected in the tree browser.
Override this method to perform application-specific behavior, perhaps if not all attributes in the query identifer for the selected level are to be displayed, or their values are to be rendered specially. The default implementation renders everything as strings.
- Parameters:
attributeBrowserScrollPane
- the tabular attribute browser
-