Changeset 6219
- Timestamp:
- 2003-12-10T17:10:28+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/CollectionPane.java
r6051 r6219 126 126 static private Dimension TREE_SIZE = new Dimension(400, 430); 127 127 128 129 130 131 132 133 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) { 134 134 this.group = new DragGroup(); 135 135 this.file_queue = Gatherer.f_man.getQueue(); 136 136 this.collection_tree_sync = collection_tree_sync; 137 137 this.workspace_tree_sync = workspace_tree_sync; 138 138 139 139 // Create components. 140 140 stop_action = new JButton(); 141 141 stop_action.addActionListener(this); 142 142 stop_action.setEnabled(false); 143 file_queue.registerStopButton(stop_action); 143 144 Dictionary.registerBoth(stop_action, "Collection.Stop", "Collection.Stop_Tooltip"); 144 145 145 146 new_folder = new JButton(Utility.getImage("folder.gif")); 146 147 new_folder.addActionListener(this); … … 149 150 new_folder.setPreferredSize(MIN_SIZE); 150 151 Dictionary.registerTooltip(new_folder, "Collection.New_Folder_Tooltip"); 151 152 } 152 153 153 154 /** 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. */ … … 249 250 // Enable or disable the control buttons 250 251 bin_button.setEnabled(ready); 251 stop_action.setEnabled(ready);252 252 new_folder.setEnabled(ready); 253 253 } … … 436 436 return collection_tree.getRowBounds(collection_tree.getRowForPath(path)); 437 437 } 438 439 440 441 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) { 442 442 DefaultTreeCellRenderer def = new DefaultTreeCellRenderer(); 443 443 DefaultTreeCellRenderer w = (DefaultTreeCellRenderer)workspace_tree.getCellRenderer(); 444 444 DefaultTreeCellRenderer c = (DefaultTreeCellRenderer)collection_tree.getCellRenderer(); 445 445 if(event.getSource() == workspace_tree) { 446 447 446 w.setBackgroundSelectionColor(def.getBackgroundSelectionColor()); 447 c.setBackgroundSelectionColor(Color.lightGray); 448 448 } 449 449 else if(event.getSource() == collection_tree) { 450 451 450 c.setBackgroundSelectionColor(def.getBackgroundSelectionColor()); 451 w.setBackgroundSelectionColor(Color.lightGray); 452 452 } 453 453 repaint(); 454 455 456 457 458 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 } 460 460 461 461 /** 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.