Changeset 11780 for trunk/gli/src
- Timestamp:
- 2006-05-09T11:28:19+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java
r11651 r11780 73 73 implements ActionListener 74 74 { 75 private CardLayout card_layout = null; 76 private JPanel card_pane = null; 77 /** The name of the panel containing the "collection loaded" (collection tree) card. */ 78 private String COLLECTION_LOADED_CARD = ""; 79 /** The name of the panel containing the "no collection loaded" placeholder */ 80 private String NO_COLLECTION_LOADED_CARD = "No collection loaded"; 75 81 /** 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. */ 76 82 private DragGroup group = null; … … 217 223 workspace_filter = workspace_tree.getFilter(); 218 224 225 card_layout = new CardLayout(); 226 219 227 // Collection Tree 220 228 collection_pane = new JPanel(); … … 225 233 collection_label = new JLabel(); 226 234 collection_label.setOpaque(true); 227 Dictionary.registerText(collection_label, "Collection. No_Collection");235 Dictionary.registerText(collection_label, "Collection.Collection"); 228 236 229 237 collection_tree = Gatherer.c_man.getCollectionTree(); … … 234 242 tree_pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); 235 243 244 // No collection loaded pane 245 JPanel no_collection_pane = new JPanel(); 246 no_collection_pane.setBackground(Color.lightGray); 247 248 JLabel no_collection_label = new JLabel(); 249 no_collection_label.setBackground(Color.lightGray); 250 no_collection_label.setForeground(Color.black); 251 no_collection_label.setOpaque(true); 252 Dictionary.registerText(no_collection_label, "Collection.Collection"); 253 254 JPanel no_collection_loaded_panel = new JPanel(); 255 no_collection_loaded_panel.setBorder(BorderFactory.createLineBorder(Color.black)); 256 no_collection_loaded_panel.setBackground(Color.lightGray); 257 258 JLabel no_collection_loaded_label = new JLabel(); 259 no_collection_loaded_label.setHorizontalAlignment(JLabel.CENTER); 260 no_collection_loaded_label.setVerticalAlignment(JLabel.CENTER); 261 Dictionary.registerText(no_collection_loaded_label, "Collection.No_Collection_Loaded"); 262 236 263 // Status pane 237 264 control_pane = new JPanel(); … … 240 267 inner_pane.setSize(STATUS_SIZE); 241 268 269 card_pane = new JPanel(); 242 270 JPanel file_pane = new JPanel(); 243 271 JPanel progress_pane = new JPanel(); … … 260 288 workspace_pane.add(workspace_scroll, BorderLayout.CENTER); 261 289 workspace_pane.add(workspace_filter, BorderLayout.SOUTH); 262 290 263 291 collection_pane.setLayout(new BorderLayout()); 264 292 collection_pane.add(collection_label, BorderLayout.NORTH); 265 293 294 no_collection_loaded_panel.setLayout(new BorderLayout()); 295 no_collection_loaded_panel.add(no_collection_loaded_label, BorderLayout.CENTER); 296 297 no_collection_pane.setLayout(new BorderLayout()); 298 no_collection_pane.add(no_collection_label, BorderLayout.NORTH); 299 no_collection_pane.add(no_collection_loaded_panel, BorderLayout.CENTER); 300 301 card_pane.setLayout(card_layout); 302 card_pane.add(no_collection_pane, NO_COLLECTION_LOADED_CARD); 303 card_pane.add(collection_pane, COLLECTION_LOADED_CARD); 304 266 305 tree_pane.add(workspace_pane, JSplitPane.LEFT); 267 tree_pane.add(c ollection_pane, JSplitPane.RIGHT);306 tree_pane.add(card_pane, JSplitPane.RIGHT); 268 307 tree_pane.setDividerLocation(TREE_SIZE.width - 10); 269 308 … … 344 383 { 345 384 if (collection_loaded) { 346 // Update collection label347 Dictionary.registerText(collection_label, "Collection.Collection");348 collection_label.setBackground(Configuration.getColor("coloring.collection_heading_background", false));349 collection_label.setForeground(Configuration.getColor("coloring.collection_heading_foreground", false));350 351 385 // Update collection tree 352 386 if (refresh_reason == Gatherer.COLLECTION_OPENED) { … … 354 388 } 355 389 356 // Update collection filter 357 collection_filter.setBackground(Configuration.getColor("coloring.collection_heading_background", false)); 390 card_layout.show(card_pane, COLLECTION_LOADED_CARD); 358 391 } 359 392 else { 360 // Update collection label361 String[] args = new String[1];362 args[0] = Dictionary.get("Collection.No_Collection");363 Dictionary.registerText(collection_label, "Collection.Collection", args);364 collection_label.setBackground(Color.lightGray);365 collection_label.setForeground(Color.black);366 367 393 // Update collection tree 368 394 collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Error"))); 369 395 370 // Update collection filter 371 collection_filter.setBackground(Color.lightGray); 396 card_layout.show(card_pane, NO_COLLECTION_LOADED_CARD); 372 397 } 373 398 374 399 // Enable or disable the controls 375 workspace_tree.setEnabled(true);376 400 collection_tree.setEnabled(collection_loaded); 377 401 collection_filter.setEnabled(collection_loaded);
Note:
See TracChangeset
for help on using the changeset viewer.