story.dbcore.gui
Class Forest

java.lang.Object
  extended by story.dbcore.gui.Forest

public class Forest
extends java.lang.Object

Forest is a container for several trees with which a JTree can be easily populated. This class essentially loads the hierarchies of nodes in the db-core into trees of ForestNodes and returns the roots of each tree (one for each node type).

Take care to ask it to reload its data whenever there is a change to the db-core state. (Perhaps this should be detected automatically?)


Constructor Summary
Forest(CoreBrowser browser, DBCoreInterface dbci, DetailBox details, boolean showAllRepTab, TreeView treeView)
          Constructor.
 
Method Summary
 javax.swing.JComponent getRepositoriesPane()
          Get a tabbed pane of nodeTypesTabbedPane where each tab represents a repository, plus one for "All Repositories."
 javax.swing.JTabbedPane getRepositoriesTabbedPane()
          Get a tabbed pane of nodeTypesTabbedPane where each tab represents a repository, plus one for "All Repositories."
 NodeAddress getSelectedNode()
           
 TreeType getSelectedTree()
          Return the selected tree among the Forest, including the repository ID and the node type
 void populateAllTrees()
          Go through the hierarchy, retrieve all trees, and (re-)populate them by running actual queries to find real data
 javax.swing.JComponent reconstruct(boolean showAllRepTab)
          Create new JFrames, tree models, etc.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Forest

public Forest(CoreBrowser browser,
              DBCoreInterface dbci,
              DetailBox details,
              boolean showAllRepTab,
              TreeView treeView)
       throws Scheherexception
Constructor.

Throws:
Scheherexception
Method Detail

reconstruct

public javax.swing.JComponent reconstruct(boolean showAllRepTab)
                                   throws Scheherexception
Create new JFrames, tree models, etc. Needs to be called whenever there is a change to the repository list (e.g., new repository, close document, open document). Returns the JTabbedPane for the forest.

Throws:
Scheherexception

populateAllTrees

public void populateAllTrees()
                      throws Scheherexception
Go through the hierarchy, retrieve all trees, and (re-)populate them by running actual queries to find real data

Throws:
Scheherexception

getRepositoriesTabbedPane

public javax.swing.JTabbedPane getRepositoriesTabbedPane()
Get a tabbed pane of nodeTypesTabbedPane where each tab represents a repository, plus one for "All Repositories." Does not include the ScrollPane wrapper, so do not display this to the user -- use it for internal access only.


getRepositoriesPane

public javax.swing.JComponent getRepositoriesPane()
                                           throws Scheherexception
Get a tabbed pane of nodeTypesTabbedPane where each tab represents a repository, plus one for "All Repositories." Wraps in a ScrollPane.

Throws:
Scheherexception

getSelectedTree

public TreeType getSelectedTree()
                         throws Scheherexception
Return the selected tree among the Forest, including the repository ID and the node type

Throws:
Scheherexception

getSelectedNode

public NodeAddress getSelectedNode()


Copyright © 2011 David K. Elson. All Rights Reserved.