Changeset 11603
- Timestamp:
- 2006-04-06T15:29:42+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java
r11601 r11603 71 71 public class GatherPane 72 72 extends JPanel 73 implements ActionListener, FocusListener { 73 implements ActionListener 74 { 74 75 /** The group encompassing all of the components available as drop targets for drag and drop actions. Required so that only one component renders the ghost and higlights itself as a target, which the other members are restored to their original, pristine, condition. */ 75 76 private DragGroup group = null; … … 226 227 workspace_tree = new WorkspaceTree(Utility.WORKSPACE_TREE); 227 228 group.add(workspace_tree); 228 workspace_tree.addFocusListener(this);229 229 workspace_tree.addMouseListener(mouse_listener); 230 230 workspace_tree.addMouseListener(Gatherer.g_man.foa_listener); … … 257 257 collection_tree.setEnabled(Gatherer.c_man.getCollectionTreeModel() != null); 258 258 group.add(collection_tree); 259 collection_tree.addFocusListener(this);260 259 collection_tree.addMouseListener(mouse_listener); 261 260 collection_tree.addMouseListener(Gatherer.g_man.foa_listener); … … 346 345 return collection_tree.getRowBounds(collection_tree.getRowForPath(path)); 347 346 } 348 /** 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). 349 * @param event A <strong>FocusEvent</strong> containing details about the focus action performed. 350 */ 351 public void focusGained(FocusEvent event) { 352 DefaultTreeCellRenderer def = new DefaultTreeCellRenderer(); 353 DefaultTreeCellRenderer w = (DefaultTreeCellRenderer)workspace_tree.getCellRenderer(); 354 DefaultTreeCellRenderer c = (DefaultTreeCellRenderer)collection_tree.getCellRenderer(); 355 if(event.getSource() == workspace_tree) { 356 w.setBackgroundSelectionColor(def.getBackgroundSelectionColor()); 357 c.setBackgroundSelectionColor(Color.lightGray); 358 } 359 else if(event.getSource() == collection_tree) { 360 c.setBackgroundSelectionColor(def.getBackgroundSelectionColor()); 361 w.setBackgroundSelectionColor(Color.lightGray); 362 } 363 repaint(); 364 } 365 /** Implementation side-effect, not used in any way. 366 * @param event A <strong>FocusEvent</strong> containing details about the focus action performed. 367 */ 368 public void focusLost(FocusEvent event) { 369 } 347 370 348 371 349 /** 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.