Changeset 11627


Ignore:
Timestamp:
2006-04-07T16:56:05+12:00 (18 years ago)
Author:
mdewsnip
Message:

The collection tree object is now created and owned by CollectionManager.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r11625 r11627  
    9191    /** The collection this manager is managing! */
    9292    static private Collection collection = null;
    93     /** The collection_model. */
    94     private CollectionTreeModel collection_model = null;
     93    /** The collection tree (used in both Gather and Enrich panes). */
     94    static private CollectionTree collection_tree = null;
     95    /** The collection tree model. */
     96    private CollectionTreeModel collection_tree_model = null;
    9597    /** An inner class listener responsible for noting tree changes and resetting saved when they occur. */
    9698    private FMTreeModelListener fm_tree_model_listener = null;
     
    237239
    238240    collection = null;
    239     collection_model = null;
     241    collection_tree_model = null;
    240242    Configuration.setCollectionConfiguration(null);
    241243    Gatherer.refresh(Gatherer.COLLECTION_CLOSED);
     
    643645
    644646
     647    public CollectionTree getCollectionTree()
     648    {
     649    if (collection_tree == null) {
     650        collection_tree = new CollectionTree(collection_tree_model, true);
     651    }
     652
     653    return collection_tree;
     654    }
     655
     656
    645657    /** Retrieve the tree model associated with the current collection. */
    646658    public CollectionTreeModel getCollectionTreeModel()
    647659    {
    648     if (collection_model == null && collection != null) {
     660    if (collection_tree_model == null && collection != null) {
    649661        // Use the import directory to generate a new CollectionTreeModel
    650         collection_model = new CollectionTreeModel(new CollectionTreeNode(new File(getCollectionImportDirectoryPath())));
     662        collection_tree_model = new CollectionTreeModel(new CollectionTreeNode(new File(getCollectionImportDirectoryPath())));
    651663        // Ensure that the manager is a change listener for the tree.
    652664        if (fm_tree_model_listener == null) {
    653665        fm_tree_model_listener = new FMTreeModelListener();
    654666        }
    655         collection_model.addTreeModelListener(fm_tree_model_listener);
    656     }
    657     return collection_model;
     667        collection_tree_model.addTreeModelListener(fm_tree_model_listener);
     668    }
     669    return collection_tree_model;
    658670    }
    659671
  • trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java

    r11626 r11627  
    131131
    132132    DragGroup group = new DragGroup();
    133     collection_tree = Gatherer.g_man.gather_pane.collection_tree;
     133    collection_tree = Gatherer.c_man.getCollectionTree();
    134134    group.add(collection_tree);
    135135    collection_tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
  • trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java

    r11626 r11627  
    7676    private DragGroup group               =  null;
    7777    /** The tree showing the files within the collection. */
    78     public CollectionTree collection_tree = null;
     78    private CollectionTree collection_tree = null;
    7979    /** The threaded queue that handles the actually movement of files, so that the gui remains responsive. */
    8080    private FileQueue file_queue          =  null;
     
    234234    Dictionary.registerText(collection_label, "Collection.No_Collection");
    235235
    236     collection_tree = new CollectionTree(Gatherer.c_man.getCollectionTreeModel(), true);
     236    collection_tree = Gatherer.c_man.getCollectionTree();
    237237    collection_tree.setEnabled(Gatherer.c_man.getCollectionTreeModel() != null);
    238238    group.add(collection_tree);
Note: See TracChangeset for help on using the changeset viewer.