- Timestamp:
- 2009-02-23T15:16:20+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/cdm/SubcollectionManager.java
r18412 r18587 128 128 * @param mode the new mode as an int 129 129 */ 130 public void modeChanged(int mode) { 131 if(controls != null) { 132 ((SubcollectionControl)controls).modeChanged(mode); 133 } 134 } 130 public void modeChanged(int mode) { 131 } 135 132 136 133 /** Method to remove the given subcollection. … … 157 154 implements Control, ChangeListener 158 155 { 159 private CardLayout card_layout;160 156 private JButton add_button; 161 157 private JButton remove_button; … … 163 159 private JComboBox source_combobox; 164 160 private JList subcollection_list; 165 private JPanel border_pane;166 161 private JTabbedPane tabbed_pane; 167 162 private JTextField flags_field; … … 176 171 JPanel header_pane = new DesignPaneHeader("CDM.GUI.Subcollections", "partitionindexes"); 177 172 178 border_pane = new JPanel();179 card_layout = new CardLayout();180 border_pane.setComponentOrientation(Dictionary.getOrientation());181 182 183 173 tabbed_pane = new JTabbedPane(); 184 174 tabbed_pane.addChangeListener(this); … … 258 248 JLabel subcollection_list_label = new JLabel(Dictionary.get("CDM.SubcollectionManager.Assigned")); 259 249 subcollection_list_label.setComponentOrientation(Dictionary.getOrientation()); 260 // Create a message pane which explains why these controls are not currently active261 JPanel message_pane = new JPanel();262 message_pane.setComponentOrientation(Dictionary.getOrientation());263 264 String args[] = new String[3];265 args[0] = Configuration.getModeAsString();266 args[1] = Dictionary.get("Preferences.Mode.Systems");267 args[2] = Dictionary.get("Preferences.Mode.Expert");268 JTextArea message_textarea = new JTextArea(Dictionary.get("CDM.SubcollectionManager.Partitions_Disabled", args));269 message_textarea.setComponentOrientation(Dictionary.getOrientation());270 271 message_textarea.setEditable(false);272 message_textarea.setHighlighter(null); // Prevent highlighting273 message_textarea.setLineWrap(true);274 message_textarea.setOpaque(false); // Make it transparent275 message_textarea.setWrapStyleWord(true);276 250 277 251 // Add listeners … … 329 303 tabbed_pane.addTab(Dictionary.get("CDM.SubcollectionManager.Subindex_Controls"), (JPanel) CollectionDesignManager.subcollectionindex_manager.getControls()); 330 304 tabbed_pane.addTab(Dictionary.get("CDM.SubcollectionManager.Language_Controls"), (JPanel) CollectionDesignManager.language_manager.getControls()); 331 JPanel tmp ;332 message_pane.setBorder(BorderFactory.createEmptyBorder(0,5,5,5));333 message_pane.setLayout(new GridLayout(3,1,0,0));334 tmp =new JPanel();335 tmp.setComponentOrientation(Dictionary.getOrientation());336 message_pane.add(tmp);337 message_pane.add(message_textarea);338 tmp = new JPanel();339 tmp.setComponentOrientation(Dictionary.getOrientation());340 message_pane.add(tmp);341 342 border_pane.setLayout(card_layout);343 if(Configuration.getMode() > Configuration.LIBRARIAN_MODE) {344 border_pane.add(tabbed_pane, ENABLED_CONTROLS);345 border_pane.add(message_pane, DISABLED_CONTROLS);346 }347 else {348 border_pane.add(message_pane, DISABLED_CONTROLS);349 border_pane.add(tabbed_pane, ENABLED_CONTROLS);350 }351 305 352 306 setBorder(BorderFactory.createEmptyBorder(0,5,0,0)); 353 307 setLayout(new BorderLayout()); 354 308 add(header_pane, BorderLayout.NORTH); 355 add( border_pane, BorderLayout.CENTER);309 add(tabbed_pane, BorderLayout.CENTER); 356 310 } 357 311 … … 372 326 } 373 327 374 /** Called when the detail mode has changed which in turn controls if any of the partition controls are visible, or if they are instead replaced with a message explaining why they are not.375 * @param mode the new mode as an int376 */377 public void modeChanged(int mode) {378 if(mode > Configuration.LIBRARIAN_MODE) {379 card_layout.show(border_pane, ENABLED_CONTROLS);380 }381 else {382 card_layout.show(border_pane, DISABLED_CONTROLS);383 }384 }385 386 328 public void stateChanged(ChangeEvent event) 387 329 {
Note:
See TracChangeset
for help on using the changeset viewer.