Ignore:
Timestamp:
2004-05-28T13:41:13+12:00 (20 years ago)
Author:
mdewsnip
Message:

Many more improvements to the workspace and collection trees and their refreshing.

Location:
trunk/gli/src/org/greenstone/gatherer/gui/tree
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTree.java

    r6249 r7484  
    5858    static private final int AUTOSCROLL_MARGIN = 12;
    5959
    60     static public int LIBRARY_CONTENTS_CHANGED    = 0;
     60    static public int TREE_DISPLAY_CHANGED        = 0;
    6161    static public int LOADED_COLLECTION_CHANGED   = 1;
    6262    static public int COLLECTION_CONTENTS_CHANGED = 2;
    63     static public int TREE_DISPLAY_CHANGED        = 3;
    6463
    6564
  • trunk/gli/src/org/greenstone/gatherer/gui/tree/WorkspaceTree.java

    r7482 r7484  
    66import org.greenstone.gatherer.Gatherer;
    77import org.greenstone.gatherer.file.FileNode;
    8 import org.greenstone.gatherer.file.FileSystemModel;
    98import org.greenstone.gatherer.file.WorkspaceTreeModel;
    109import org.greenstone.gatherer.util.Utility;
     
    1413    extends DragTree {
    1514
    16     static public int MAPPED_DIRECTORIES_CHANGED = 11;
     15    static public int LIBRARY_CONTENTS_CHANGED = 10;
     16    static public int FOLDER_SHORTCUTS_CHANGED = 11;
    1717
    1818
     
    2727    Gatherer.println("WorkspaceTree::refresh()... ");
    2828
    29     // The collections in the library have changed - refresh the collect directory
    30     if (refresh_reason == DragTree.LIBRARY_CONTENTS_CHANGED) {
    31         Gatherer.println("...Reason: library contents changed.");
    32         String collect_directory_str = Gatherer.config.gsdl_path + Utility.COL_DIR;
    33         refreshEveryNodeShowingFolder(collect_directory_str);
    34         WorkspaceTreeModel.refreshGreenstoneCollectionsMapping();
    35     }
     29    // The method for displaying the tree has changed - redraw the tree
     30    if (refresh_reason == DragTree.TREE_DISPLAY_CHANGED) {
     31        Gatherer.println("...Reason: tree display changed.");
     32        updateUI();
     33    }
    3634
    37     // A collection has been opened/closed - reload the whole shebang
     35    // The loaded collection has changed - currently do nothing
    3836    if (refresh_reason == DragTree.LOADED_COLLECTION_CHANGED) {
    3937        Gatherer.println("...Reason: loaded collection changed.");
    40         setModel(WorkspaceTreeModel.getWorkspaceTreeModel());
    4138    }
    4239
     
    4845    }
    4946
    50     // The method for displaying the tree has changed - redraw the tree
    51     if (refresh_reason == DragTree.TREE_DISPLAY_CHANGED) {
    52         Gatherer.println("...Reason: tree display changed.");
    53         updateUI();
    54     }
     47    // The collections in the library have changed - refresh the collect directory
     48    if (refresh_reason == WorkspaceTree.LIBRARY_CONTENTS_CHANGED) {
     49        Gatherer.println("...Reason: library contents changed.");
     50        String collect_directory_str = Gatherer.config.gsdl_path + Utility.COL_DIR;
     51        refreshEveryNodeShowingFolder(collect_directory_str);
     52        WorkspaceTreeModel.refreshGreenstoneCollectionsMapping();
     53    }
    5554
    56     // The collection specific mapped directories have changed - refresh only them
    57     if (refresh_reason == WorkspaceTree.MAPPED_DIRECTORIES_CHANGED) {
    58         Gatherer.println("...Reason: mapped directories changed.");
    59         WorkspaceTreeModel.refreshWebCacheMappings();
    60         WorkspaceTreeModel.refreshCollectionSpecificMappings();
    61         updateUI();
     55    // The folder shortcuts have changed - refresh only them
     56    if (refresh_reason == WorkspaceTree.FOLDER_SHORTCUTS_CHANGED) {
     57        Gatherer.println("...Reason: folder shortcuts changed.");
     58        WorkspaceTreeModel.refreshFolderShortcuts();
    6259    }
    6360    }
     
    8784        if (tree_node_path_str.equals(folder_path_str)) {
    8885        System.err.println("Must refresh node " + tree_node_path_str + "!");
    89         ((FileSystemModel) getModel()).refresh(expanded_tree_path);
     86        ((WorkspaceTreeModel) getModel()).refresh(expanded_tree_path);
    9087        }
    9188    }
Note: See TracChangeset for help on using the changeset viewer.