Changeset 11616


Ignore:
Timestamp:
2006-04-07T09:45:18+12:00 (18 years ago)
Author:
mdewsnip
Message:

Rearranged some code to reduce duplication and for better object orientation.

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

Legend:

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

    r11608 r11616  
    77 * Author: Michael Dewsnip, NZDL Project, University of Waikato, NZ
    88 *
    9  * Copyright (C) 2004 New Zealand Digital Library Project
     9 * Copyright (C) 2006 New Zealand Digital Library Project
    1010 *
    1111 * This program is free software; you can redistribute it and/or modify
     
    3434import org.greenstone.gatherer.gui.tree.DragTree;
    3535import org.greenstone.gatherer.gui.tree.DragTreeCellRenderer;
     36import org.greenstone.gatherer.Configuration;
    3637import org.greenstone.gatherer.Dictionary;
    3738import org.greenstone.gatherer.Gatherer;
     
    4546    {
    4647    super(name, collection_tree_model, mixed_selection);
     48    addMouseListener(this);
     49
    4750    setCellRenderer(new CollectionTreeCellRenderer());
    48     addMouseListener(this);
     51    setBackgroundNonSelectionColor(Configuration.getColor("coloring.collection_tree_background", false));
     52    setBackgroundSelectionColor(Configuration.getColor("coloring.collection_selection_background", false));
     53    setTextNonSelectionColor(Configuration.getColor("coloring.collection_tree_foreground", false));
     54    setTextSelectionColor(Configuration.getColor("coloring.collection_selection_foreground", false));
    4955    }
    5056
  • trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTree.java

    r11613 r11616  
    77 * Author: Michael Dewsnip, NZDL Project, University of Waikato, NZ
    88 *
    9  * Copyright (C) 2004 New Zealand Digital Library Project
     9 * Copyright (C) 2006 New Zealand Digital Library Project
    1010 *
    1111 * This program is free software; you can redistribute it and/or modify
     
    5454    super(name, WorkspaceTreeModel.getWorkspaceTreeModel(), true);
    5555    addMouseListener(this);
     56
     57    setBackgroundNonSelectionColor(Configuration.getColor("coloring.workspace_tree_background", false));
     58    setBackgroundSelectionColor(Configuration.getColor("coloring.workspace_selection_background", false));
     59    setTextNonSelectionColor(Configuration.getColor("coloring.workspace_tree_foreground", false));
     60    setTextSelectionColor(Configuration.getColor("coloring.workspace_selection_foreground", false));
    5661    }
    5762
  • trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java

    r11614 r11616  
    131131    collection_tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
    132132    collection_tree.addTreeSelectionListener(this);
    133     collection_tree.setBackgroundNonSelectionColor(Configuration.getColor("coloring.collection_tree_background", false));
    134     collection_tree.setTextNonSelectionColor(Configuration.getColor("coloring.collection_tree_foreground", false));
    135     collection_tree.setBackgroundSelectionColor(Configuration.getColor("coloring.collection_selection_background", false));
    136     collection_tree.setTextSelectionColor(Configuration.getColor("coloring.collection_selection_foreground", false));
    137     collection_tree.setRootVisible(false);
    138133
    139134    JScrollPane collection_scroll = new JScrollPane(collection_tree);
  • trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java

    r11614 r11616  
    221221    workspace_tree = new WorkspaceTree(Utility.WORKSPACE_TREE);
    222222    group.add(workspace_tree);
    223     workspace_tree.setBackgroundNonSelectionColor(Configuration.getColor("coloring.workspace_tree_background", false));
    224     workspace_tree.setTextNonSelectionColor(Configuration.getColor("coloring.workspace_tree_foreground", false));
    225     workspace_tree.setBackgroundSelectionColor(Configuration.getColor("coloring.workspace_selection_background", false));
    226     workspace_tree.setTextSelectionColor(Configuration.getColor("coloring.workspace_selection_foreground", false));
    227     workspace_tree.setRootVisible(false);
    228223
    229224    workspace_scroll = new JScrollPane(workspace_tree);
     
    247242    collection_tree.setEnabled(Gatherer.c_man.getCollectionTreeModel() != null);
    248243    group.add(collection_tree);
    249     collection_tree.setBackgroundNonSelectionColor(Configuration.getColor("coloring.collection_tree_background", false));
    250     collection_tree.setTextNonSelectionColor(Configuration.getColor("coloring.collection_tree_foreground", false));
    251     collection_tree.setBackgroundSelectionColor(Configuration.getColor("coloring.collection_selection_background", false));
    252     collection_tree.setTextSelectionColor(Configuration.getColor("coloring.collection_selection_foreground", false));
    253     collection_tree.setRootVisible(false);
    254244
    255245    collection_scroll = new JScrollPane(collection_tree);
  • trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTree.java

    r11614 r11616  
    9595    this.setLargeModel(true);
    9696    this.setOpaque(true);
     97    this.setRootVisible(false);
    9798    this.setSelectionModel(new DragTreeSelectionModel(this, mixed_selection));
    9899    this.setShowsRootHandles(true);
Note: See TracChangeset for help on using the changeset viewer.