Changeset 11619 for trunk


Ignore:
Timestamp:
2006-04-07T11:51:11+12:00 (18 years ago)
Author:
mdewsnip
Message:

The workspace and collection tree filters are now owned by the trees themselves, rather than the GUIManager.

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

Legend:

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

    r11616 r11619  
    134134    JScrollPane collection_scroll = new JScrollPane(collection_tree);
    135135
    136     collection_filter = Gatherer.g_man.getFilter(collection_tree);
     136    collection_filter = collection_tree.getFilter();
    137137    collection_filter.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
    138138    collection_filter.setEditable(Configuration.getMode() > Configuration.LIBRARIAN_MODE);
  • trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r11316 r11619  
    9191    /** The size of the Gatherer window. */
    9292    private Dimension size = null;
    93     /** The filters used to dynamically filter the trees at user request. */
    94     private HashMap filters = new HashMap();
    9593    /** The panel within the window that other components are placed on. */
    9694    private JPanel content_pane = null;
     
    444442        Gatherer.exit();
    445443    }
    446     }
    447 
    448 
    449     /** Retrieve the filter, or if one already exists, spawn a linked copy. */
    450     public Filter getFilter(DragTree tree) {
    451     Filter filter = (Filter) filters.get(tree.getModel());
    452     if (filter == null) {
    453         filter = new Filter(tree, null);
    454         filters.put(tree.getModel(), filter);
    455         return filter;
    456     }
    457     return filter.spawn(tree);
    458444    }
    459445
  • trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java

    r11618 r11619  
    224224    workspace_scroll = new JScrollPane(workspace_tree);
    225225
    226     workspace_filter = Gatherer.g_man.getFilter(workspace_tree);
     226    workspace_filter = workspace_tree.getFilter();
    227227    workspace_filter.setBackground(Configuration.getColor("coloring.workspace_heading_background", false));
    228228    workspace_filter.setEditable(Configuration.getMode() > Configuration.LIBRARIAN_MODE);
     
    245245    collection_scroll = new JScrollPane(collection_tree);
    246246
    247     collection_filter = Gatherer.g_man.getFilter(collection_tree);
     247    collection_filter = collection_tree.getFilter();
    248248    collection_filter.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
    249249    collection_filter.setEditable(Configuration.getMode() > Configuration.LIBRARIAN_MODE);
  • trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTree.java

    r11616 r11619  
    1717import org.greenstone.gatherer.file.FileNode;
    1818import org.greenstone.gatherer.file.FileSystemModel;
     19import org.greenstone.gatherer.gui.Filter;
    1920import org.greenstone.gatherer.util.DragComponent;
    2021import org.greenstone.gatherer.util.DragGroup;
     
    3132    /** The Group this component belongs to. */
    3233    private DragGroup group;
     34    /** The filter for this tree. */
     35    private Filter filter = null;
    3336    /** The image to use for the disabled background. */
    3437    private ImageIcon disabled_background;
     
    8891    // Init
    8992    this.name = name;
     93    this.filter = new Filter(this, null);
    9094
    9195    // Creation
     
    454458    }
    455459
     460    public Filter getFilter() {
     461    return filter;
     462    }
     463
    456464    public String getSelectionDetails() {
    457465    return ((DragTreeSelectionModel)selectionModel).getDetails();
Note: See TracChangeset for help on using the changeset viewer.