Changeset 6219


Ignore:
Timestamp:
2003-12-10T17:10:28+13:00 (20 years ago)
Author:
jmt12
Message:

The stop button is now registered with the file queue

File:
1 edited

Legend:

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

    r6051 r6219  
    126126    static private Dimension TREE_SIZE   = new Dimension(400, 430);
    127127
    128     /* Constructor.
    129     * @param tree_sync Ensures that expansion events between like trees are synchronized.
    130     * @see org.greenstone.gatherer.file.FileManager
    131     * @see org.greenstone.gatherer.file.FileQueue
    132     */
    133     public CollectionPane(TreeSynchronizer workspace_tree_sync, TreeSynchronizer collection_tree_sync) {
     128    /* Constructor.
     129    * @param tree_sync Ensures that expansion events between like trees are synchronized.
     130    * @see org.greenstone.gatherer.file.FileManager
     131    * @see org.greenstone.gatherer.file.FileQueue
     132    */
     133    public CollectionPane(TreeSynchronizer workspace_tree_sync, TreeSynchronizer collection_tree_sync) {
    134134    this.group = new DragGroup();
    135135    this.file_queue = Gatherer.f_man.getQueue();
    136136    this.collection_tree_sync = collection_tree_sync;
    137137    this.workspace_tree_sync = workspace_tree_sync;
    138 
     138   
    139139    // Create components.
    140140    stop_action = new JButton();
    141141    stop_action.addActionListener(this);
    142142    stop_action.setEnabled(false);
     143    file_queue.registerStopButton(stop_action);
    143144    Dictionary.registerBoth(stop_action, "Collection.Stop", "Collection.Stop_Tooltip");
    144 
     145   
    145146    new_folder = new JButton(Utility.getImage("folder.gif"));
    146147    new_folder.addActionListener(this);
     
    149150    new_folder.setPreferredSize(MIN_SIZE);
    150151    Dictionary.registerTooltip(new_folder, "Collection.New_Folder_Tooltip");
    151     }
     152    }
    152153
    153154    /** Any implementation of ActionListener requires this method so that when an action is performed the appropriate effect can occur. In this case there are three valid possibilities. If the action occured on the recycle bin, then delete the current selection from the collection tree. If the action instead occured on the new folder button, then create a new folder under the current (single) selection in the collection tree. And finally if the cancel button was pressed, cancel the current, and remaining, jobs on the file queue. */
     
    249250    // Enable or disable the control buttons
    250251    bin_button.setEnabled(ready);
    251     stop_action.setEnabled(ready);
    252252    new_folder.setEnabled(ready);
    253253    }
     
    436436    return collection_tree.getRowBounds(collection_tree.getRowForPath(path));
    437437    }
    438     /** Called whenever this pane gains focus, this method ensures that the various tree renderers are correctly colouring the tree (as these settings sometimes get lost).
    439     * @param event A <strong>FocusEvent</strong> containing details about the focus action performed.
    440     */
    441     public void focusGained(FocusEvent event) {
     438    /** Called whenever this pane gains focus, this method ensures that the various tree renderers are correctly colouring the tree (as these settings sometimes get lost).
     439    * @param event A <strong>FocusEvent</strong> containing details about the focus action performed.
     440    */
     441    public void focusGained(FocusEvent event) {
    442442    DefaultTreeCellRenderer def = new DefaultTreeCellRenderer();
    443443    DefaultTreeCellRenderer w = (DefaultTreeCellRenderer)workspace_tree.getCellRenderer();
    444444    DefaultTreeCellRenderer c = (DefaultTreeCellRenderer)collection_tree.getCellRenderer();
    445445    if(event.getSource() == workspace_tree) {
    446         w.setBackgroundSelectionColor(def.getBackgroundSelectionColor());
    447         c.setBackgroundSelectionColor(Color.lightGray);
     446        w.setBackgroundSelectionColor(def.getBackgroundSelectionColor());
     447        c.setBackgroundSelectionColor(Color.lightGray);
    448448    }
    449449    else if(event.getSource() == collection_tree) {
    450         c.setBackgroundSelectionColor(def.getBackgroundSelectionColor());
    451         w.setBackgroundSelectionColor(Color.lightGray);
     450        c.setBackgroundSelectionColor(def.getBackgroundSelectionColor());
     451        w.setBackgroundSelectionColor(Color.lightGray);
    452452    }
    453453    repaint();
    454     }
    455     /** Implementation side-effect, not used in any way.
    456     * @param event A <strong>FocusEvent</strong> containing details about the focus action performed.
    457     */
    458     public void focusLost(FocusEvent event) {
    459     }
     454    }
     455    /** Implementation side-effect, not used in any way.
     456    * @param event A <strong>FocusEvent</strong> containing details about the focus action performed.
     457    */
     458    public void focusLost(FocusEvent event) {
     459    }
    460460
    461461    /** Called to inform this control panel that it has just gained focus as an effect of the user clicking on its tab.
Note: See TracChangeset for help on using the changeset viewer.