source: trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java@ 6003

Last change on this file since 6003 was 6003, checked in by jmt12, 20 years ago

Added functionality (even though I wasn't meant to - shhh) by providing buttons for the user to click on and browse for about page and home icons. Once an image is selected, GLI copies it to the images folder as necessary, then constructs the _httpcollection_ relative path to the icon

  • Property svn:keywords set to Author Date Id Revision
File size: 24.1 KB
Line 
1/**
2 *#########################################################################
3 *
4 * A component of the Gatherer application, part of the Greenstone digital
5 * library suite from the New Zealand Digital Library Project at the
6 * University of Waikato, New Zealand.
7 *
8 * Author: John Thompson, Greenstone Digital Library, University of Waikato
9 *
10 * Copyright (C) 1999 New Zealand Digital Library Project
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 *########################################################################
26 */
27package org.greenstone.gatherer.cdm;
28
29import java.awt.*;
30import java.awt.event.*;
31import java.io.*;
32import java.util.regex.*;
33import javax.swing.*;
34import javax.swing.filechooser.*;
35import javax.swing.event.*;
36import javax.swing.tree.*;
37import org.greenstone.gatherer.Configuration;
38import org.greenstone.gatherer.Dictionary;
39import org.greenstone.gatherer.Gatherer;
40import org.greenstone.gatherer.cdm.CollectionConfiguration;
41import org.greenstone.gatherer.cdm.CollectionDesignManager;
42import org.greenstone.gatherer.cdm.Control;
43import org.greenstone.gatherer.gui.EmailField;
44import org.greenstone.gatherer.gui.OpenCollectionDialog;
45import org.greenstone.gatherer.util.StaticStrings;
46import org.greenstone.gatherer.util.Utility;
47
48/** This class is responsible for generating the necessary GUI components. It does this by calling the getEditControls() method of the appropriate class (i.e. IndexManager for index related edits). It also is in charge of correctly adding (and removing) listeners, using phrases from the <strong>Dictionary</strong> rather than the text keys inserted in the component classes, and several other aspects of the design page, including the config file section tree.
49* @author John Thompson, Greenstone Digital Library, University of Waikato
50* @version 2.3d
51*/
52public class GeneralManager
53 extends JPanel {
54 /** The available subscreens. */
55 static final private String CONTENTS[] = { "CDM.GUI.General", "CDM.GUI.Plugins", "CDM.GUI.SearchTypes", "CDM.GUI.Indexes", "CDM.GUI.Subcollections", "CDM.GUI.SuperCollection", "CDM.GUI.Classifiers", "CDM.GUI.Formats", "CDM.GUI.Translation", "CDM.GUI.MetadataSets" };
56 /** The preferred size of the collection design module screen real-estate. */
57 static final private Dimension SIZE = new Dimension(760, 500);
58 /** The preferred size of the contents tree. */
59 static final private Dimension TREE_SIZE = new Dimension(200, 500);
60 /** The preferred size of label. */
61 static final private Dimension LABEL_SIZE = new Dimension(200,25);
62 /** The controls used to modify the general options. */
63 private Control controls;
64 /** The panel apon which is rendered the currently selected section screen. */
65 private Control view = null;
66 /** A tree to serve as a 'table of contents' for this design tool. We decided on a tree rather than a list, as it allows us to break sections into subsections if they become to complicated. */
67 private DesignTree tree;
68 /** Constructor. */
69 public GeneralManager() {
70 super();
71 Gatherer.println("GeneralManager: Main GUI components created.");
72 // Assignments
73 this.controls = new GeneralControl();
74
75 // Creation
76 JPanel tree_pane = new JPanel();
77 JLabel title = new JLabel();
78 Dictionary.registerText(title, "CDM.GUI.Design_Topics");
79 tree = new DesignTree();
80 view = controls;
81
82 // Connect
83 tree.addTreeSelectionListener(new TreeListener());
84
85 // Layout
86 tree_pane.setLayout(new BorderLayout());
87 tree_pane.setPreferredSize(TREE_SIZE);
88 tree_pane.add(title, BorderLayout.NORTH);
89 tree_pane.add(new JScrollPane(tree), BorderLayout.CENTER);
90
91 setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
92 setLayout(new BorderLayout());
93 add(tree_pane, BorderLayout.WEST);
94 add((JPanel)view, BorderLayout.CENTER);
95 }
96
97 /** Destructor. */
98 public void destroy() {
99 controls.destroy();
100 controls = null;
101 tree = null;
102 view = null;
103 }
104
105 /** Force the display to show a certain pane of controls.
106 * @param type a String giving the name of the information manager or view we wish to display
107 */
108 public void setSelectedView(String type) {
109 tree.setSelectedView(type);
110 }
111
112 /** Refresh the values on our controls that could be stale due to changes in other components. */
113 public void gainFocus() {
114 if (view != null) {
115 view.gainFocus();
116 }
117 }
118
119 /** Saves the state of the controls in the current view. */
120 public void loseFocus() {
121 if (view != null) {
122 view.loseFocus();
123 }
124 }
125
126 /** This class is resposible for generating the controls for the editing of general options.
127 * @return the Control for editing the general options
128 */
129 private Control getControls() {
130 return controls;
131 }
132
133 /** This class represents the visual component of the general options stored in the CollectionDesignManager. */
134 private class GeneralControl
135 extends JPanel
136 implements Control {
137 private boolean ready = false;
138 private CollectionMeta beta_collectionmeta;
139 private CollectionMeta collection_extra_collectionmeta;
140 private CollectionMeta collection_name_collectionmeta;
141 private CollectionMeta creator_collectionmeta;
142 private CollectionMeta icon_collection_collectionmeta;
143 private CollectionMeta icon_collection_small_collectionmeta;
144 private CollectionMeta maintainer_collectionmeta;
145 private CollectionMeta public_collectionmeta;
146 /** The creators email. */
147 private EmailField creator_emailfield;
148 /** The maintainers email. */
149 private EmailField maintainer_emailfield;
150 /** Button to browse for the collection about page icon. */
151 private JButton browse_about_icon_button;
152 /** Button to browse for the collection home page icon. */
153 private JButton browse_home_icon_button;
154 /** The checkbox controlling the state of the collection. */
155 private JCheckBox beta_checkbox;
156 /** The checkbox controlling public access to the collection. */
157 private JCheckBox public_checkbox;
158 private JLabel creator_label;
159 private JLabel description_label;
160 private JLabel icon_label;
161 private JLabel maintainer_label;
162 private JLabel name_label;
163 private JLabel small_icon_label;
164 private JLabel title_label;
165 /** The text field used to edit the file name of the collections icon. */
166 private JTextField icon_textfield;
167 /** The text field used to edit the collections title. */
168 private JTextField name_textfield;
169 /** The text field used to edit the file name of the collections small icon. */
170 private JTextField small_icon_textfield;
171 /** A text area used to modify the collection description. */
172 private JTextArea description_textarea;
173 private JTextArea instructions_textarea;
174 /** Constructor. */
175 public GeneralControl() {
176 super();
177 // Retrieve some of the model elements, those we know aren't language dependant
178 beta_collectionmeta = new CollectionMeta(CollectionDesignManager.collect_config.getBeta());
179 public_collectionmeta = new CollectionMeta(CollectionDesignManager.collect_config.getPublic());
180
181 // Creation
182 JPanel instruction_panel = new JPanel();
183 title_label = new JLabel();
184 title_label.setHorizontalAlignment(JLabel.CENTER);
185 Dictionary.registerText(title_label, "CDM.General.Title");
186
187 instructions_textarea = new JTextArea();
188 instructions_textarea.setCaretPosition(0);
189 instructions_textarea.setEditable(false);
190 instructions_textarea.setLineWrap(true);
191 instructions_textarea.setRows(6);
192 instructions_textarea.setWrapStyleWord(true);
193 Dictionary.registerText(instructions_textarea, "CDM.General.Instructions");
194
195 JPanel all_details_panel = new JPanel();
196 JPanel details_panel = new JPanel();
197 JPanel creator_panel = new JPanel();
198 creator_label = new JLabel();
199 creator_label.setPreferredSize(LABEL_SIZE);
200 Dictionary.registerText(creator_label, "CDM.General.Email.Creator");
201
202 creator_emailfield = new EmailField(Gatherer.config.getColor("coloring.error_background", false));
203 Dictionary.registerTooltip(creator_emailfield, "CDM.General.Email.Creator_Tooltip");
204
205 JPanel maintainer_panel = new JPanel();
206 maintainer_label = new JLabel();
207 maintainer_label.setPreferredSize(LABEL_SIZE);
208 Dictionary.registerText(maintainer_label, "CDM.General.Email.Maintainer");
209
210 maintainer_emailfield = new EmailField(Gatherer.config.getColor("coloring.error_background", false));
211 Dictionary.registerTooltip(maintainer_emailfield, "CDM.General.Email.Maintainer_Tooltip");
212 public_checkbox = new JCheckBox("", public_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR));
213 Dictionary.registerText(public_checkbox, "CDM.General.Access");
214 beta_checkbox = new JCheckBox("", beta_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR));
215 Dictionary.registerText(beta_checkbox, "CDM.General.Beta");
216 JPanel name_panel = new JPanel();
217 name_label = new JLabel();
218 name_label.setPreferredSize(LABEL_SIZE);
219 Dictionary.registerText(name_label, "CDM.General.Collection_Name");
220 name_textfield = new JTextField("CDM.General.Collection_Name");
221 Dictionary.registerTooltip(name_textfield, "CDM.General.Collection_Name_Tooltip");
222 JPanel icon_panel = new JPanel();
223 icon_label = new JLabel();
224 icon_label.setPreferredSize(LABEL_SIZE);
225 Dictionary.registerText(icon_label, "CDM.General.Icon_Collection");
226 icon_textfield = new JTextField("CDM.General.Icon_Collection");
227 Dictionary.registerTooltip(icon_textfield, "CDM.General.Icon_Collection_Tooltip");
228 browse_about_icon_button = new JButton();
229 Dictionary.registerText(browse_about_icon_button, "General.Browse");
230 JPanel small_icon_panel = new JPanel();
231 small_icon_label = new JLabel("CDM.General.Icon_Collection_Small");
232 small_icon_label.setPreferredSize(LABEL_SIZE);
233 Dictionary.registerText(small_icon_label, "CDM.General.Icon_Collection_Small");
234 small_icon_textfield = new JTextField("CDM.General.Icon_Collection_Small");
235 Dictionary.registerTooltip(small_icon_textfield, "CDM.General.Icon_Collection_Small_Tooltip");
236 browse_home_icon_button = new JButton();
237 Dictionary.registerText(browse_home_icon_button, "General.Browse");
238 JPanel description_panel = new JPanel();
239 description_label = new JLabel();
240 description_label.setPreferredSize(LABEL_SIZE);
241 Dictionary.registerText(description_label, "CDM.General.Collection_Extra");
242 description_textarea = new JTextArea();
243 description_textarea.setBackground(Gatherer.config.getColor("coloring.editable_background", false));
244 Dictionary.registerTooltip(description_textarea, "CDM.General.Collection_Extra_Tooltip");
245 // Connection
246 beta_checkbox.addActionListener(CollectionDesignManager.change_listener);
247 ActionListener browse_listener = new BrowseListener();
248 browse_about_icon_button.addActionListener(browse_listener);
249 browse_home_icon_button.addActionListener(browse_listener);
250 browse_listener = null;
251 public_checkbox.addActionListener(CollectionDesignManager.change_listener);
252 creator_emailfield.getDocument().addDocumentListener(CollectionDesignManager.change_listener);
253 description_textarea.getDocument().addDocumentListener(CollectionDesignManager.change_listener);
254 icon_textfield.getDocument().addDocumentListener(CollectionDesignManager.change_listener);
255 maintainer_emailfield.getDocument().addDocumentListener(CollectionDesignManager.change_listener);
256 name_textfield.getDocument().addDocumentListener(CollectionDesignManager.change_listener);
257 small_icon_textfield.getDocument().addDocumentListener(CollectionDesignManager.change_listener);
258
259 // Layout
260 instruction_panel.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
261 instruction_panel.setLayout(new BorderLayout());
262 instruction_panel.add(title_label, BorderLayout.NORTH);
263 instruction_panel.add(new JScrollPane(instructions_textarea), BorderLayout.CENTER);
264
265 creator_panel.setLayout(new BorderLayout());
266 creator_panel.add(creator_label, BorderLayout.WEST);
267 creator_panel.add(creator_emailfield, BorderLayout.CENTER);
268
269 maintainer_panel.setLayout(new BorderLayout());
270 maintainer_panel.add(maintainer_label, BorderLayout.WEST);
271 maintainer_panel.add(maintainer_emailfield, BorderLayout.CENTER);
272
273 name_panel.setLayout(new BorderLayout());
274 name_panel.add(name_label, BorderLayout.WEST);
275 name_panel.add(name_textfield, BorderLayout.CENTER);
276
277 icon_panel.setLayout(new BorderLayout());
278 icon_panel.add(icon_label, BorderLayout.WEST);
279 icon_panel.add(icon_textfield, BorderLayout.CENTER);
280 icon_panel.add(browse_about_icon_button, BorderLayout.EAST);
281
282 small_icon_panel.setLayout(new BorderLayout());
283 small_icon_panel.add(small_icon_label, BorderLayout.WEST);
284 small_icon_panel.add(small_icon_textfield, BorderLayout.CENTER);
285 small_icon_panel.add(browse_home_icon_button, BorderLayout.EAST);
286
287 details_panel.setLayout(new GridLayout(7,1,5,0));
288 details_panel.add(creator_panel);
289 details_panel.add(maintainer_panel);
290 details_panel.add(public_checkbox);
291 details_panel.add(beta_checkbox);
292 details_panel.add(name_panel);
293 details_panel.add(icon_panel);
294 details_panel.add(small_icon_panel);
295
296 description_panel.setLayout(new BorderLayout());
297 description_panel.add(description_label, BorderLayout.NORTH);
298 description_panel.add(new JScrollPane(description_textarea), BorderLayout.CENTER);
299
300 all_details_panel.setLayout(new BorderLayout());
301 all_details_panel.add(details_panel, BorderLayout.NORTH);
302 all_details_panel.add(description_panel, BorderLayout.CENTER);
303
304 setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
305 setLayout(new BorderLayout());
306 add(instruction_panel, BorderLayout.NORTH);
307 add(all_details_panel, BorderLayout.CENTER);
308 }
309
310 /** Destructor. */
311 public void destroy() {
312 }
313
314 /** Called to refresh the components. */
315 public void gainFocus() {
316 // Retrieve all of the elements that are dependant on default language.
317 collection_extra_collectionmeta = CollectionDesignManager.collectionmeta_manager.getMetadatum(CollectionConfiguration.COLLECTIONMETADATA_COLLECTIONEXTRA_STR);
318 collection_name_collectionmeta = CollectionDesignManager.collectionmeta_manager.getMetadatum(CollectionConfiguration.COLLECTIONMETADATA_COLLECTIONNAME_STR);
319 creator_collectionmeta = new CollectionMeta(CollectionDesignManager.collect_config.getCreator());
320 icon_collection_collectionmeta = CollectionDesignManager.collectionmeta_manager.getMetadatum(CollectionConfiguration.COLLECTIONMETADATA_ICONCOLLECTION_STR);
321 icon_collection_small_collectionmeta = CollectionDesignManager.collectionmeta_manager.getMetadatum(CollectionConfiguration.COLLECTIONMETADATA_ICONCOLLECTIONSMALL_STR);
322 maintainer_collectionmeta = new CollectionMeta(CollectionDesignManager.collect_config.getMaintainer());
323 // Make sure the components are up to date
324 creator_emailfield.setText(creator_collectionmeta.getValue(CollectionMeta.TEXT));
325 creator_emailfield.setCaretPosition(0);
326 description_textarea.setText(collection_extra_collectionmeta.getValue(CollectionMeta.TEXT));
327 description_textarea.setCaretPosition(0);
328 icon_textfield.setText(icon_collection_collectionmeta.getValue(CollectionMeta.TEXT));
329 icon_textfield.setCaretPosition(0);
330 maintainer_emailfield.setText(maintainer_collectionmeta.getValue(CollectionMeta.TEXT));
331 maintainer_emailfield.setCaretPosition(0);
332 name_textfield.setText(collection_name_collectionmeta.getValue(CollectionMeta.TEXT));
333 name_textfield.setCaretPosition(0);
334 small_icon_textfield.setText(icon_collection_small_collectionmeta.getValue(CollectionMeta.TEXT));
335 small_icon_textfield.setCaretPosition(0);
336 ready = true;
337 }
338 /** Called to store the current value of the components. */
339 public void loseFocus() {
340 // String values. Have to test if this component has actually ever recieved focus anyway.
341 if(ready) {
342 // Boolean values
343 beta_collectionmeta.setValue((beta_checkbox.isSelected() ? CollectionConfiguration.TRUE_STR : CollectionConfiguration.FALSE_STR));
344 public_collectionmeta.setValue((public_checkbox.isSelected() ? CollectionConfiguration.TRUE_STR : CollectionConfiguration.FALSE_STR));
345 creator_collectionmeta.setValue(creator_emailfield.getText());
346 collection_extra_collectionmeta.setValue(description_textarea.getText());
347 icon_collection_collectionmeta.setValue(icon_textfield.getText());
348 maintainer_collectionmeta.setValue(maintainer_emailfield.getText());
349 collection_name_collectionmeta.setValue(name_textfield.getText());
350 icon_collection_small_collectionmeta.setValue(small_icon_textfield.getText());
351 ready = false;
352 }
353 }
354
355 /** Listens for a click on either browse button, and when detected opens a file browser window initially pointed at the images folder of the collection. Once a user has selected a path, does it's best to construct the best address to the resource, such as _httpcollection_/images/about.gif */
356 private class BrowseListener
357 implements ActionListener {
358
359 public void actionPerformed(ActionEvent event) {
360 // Open an almost standard file browser to the images folder of the current collection
361 File images_folder = new File(Gatherer.c_man.getCollectionImages());
362 // If images isn't already there, create it
363 if(!images_folder.exists()) {
364 images_folder.mkdirs();
365 }
366 JFileChooser file_chooser = new JFileChooser(images_folder);
367 file_chooser.setAcceptAllFileFilterUsed(false);
368 file_chooser.setDialogTitle(Dictionary.get("CDM.General.Browser_Title"));
369 file_chooser.setFileFilter(new ImageFilter());
370 file_chooser.setSize(400,300);
371 OpenCollectionDialog.disableRename(file_chooser);
372 int value = file_chooser.showOpenDialog(Gatherer.g_man);
373 // If the user hasn't cancelled, retrieve the file path selected
374 if(value == JFileChooser.APPROVE_OPTION) {
375 // If the file isn't in the images folder, then ask the user if they want to copy it there
376 File file = file_chooser.getSelectedFile();
377 if(!file.getParentFile().equals(images_folder)) {
378 if(JOptionPane.showConfirmDialog(Gatherer.g_man, Dictionary.get("CDM.General.Copy_Image"), Dictionary.get("General.Warning"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
379 // Copy the file
380 try {
381 Gatherer.f_man.getQueue().copyFile(file, new File(images_folder, file.getName()), null);
382 }
383 catch(Exception exception) {
384 Gatherer.printStackTrace(exception);
385 // Show warning
386 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.General.Image_Copy_Failed"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
387 // Nothing else we can do.
388 return;
389 }
390 }
391 else {
392 // Nothing we can safely do
393 return;
394 }
395 }
396 // Create the path starting _httpcollection_/images/<filename>
397 String path = StaticStrings.IMAGES_PATH_PREFIX + file.getName();
398 if(event.getSource() == browse_about_icon_button) {
399 icon_textfield.setText(path);
400 }
401 else {
402 small_icon_textfield.setText(path);
403 }
404 path = null;
405 }
406 }
407
408 /** ImageFilter.java is a 1.4 example used by FileChooserDemo2.java. */
409 private class ImageFilter
410 extends javax.swing.filechooser.FileFilter {
411
412 private Pattern pattern = null;
413
414 public ImageFilter() {
415 pattern = Pattern.compile(".*\\.(gif|png|jpe?g)");
416 }
417
418 // Accept all directories and all .col files
419 public boolean accept(File f) {
420 String filename = f.getName().toLowerCase();
421 Matcher matcher = pattern.matcher(filename);
422 return f.isDirectory() || matcher.matches();
423 }
424
425 // The description of this filter
426 public String getDescription() {
427 return Dictionary.get("CDM.General.Image_Filter");
428 }
429 }
430 }
431 }
432
433 /** This tree provides a 'table of contents' for the various components of the design process (collection configuration in more technical terms). */
434 private class DesignTree
435 extends JTree {
436 private DesignNode root = null;
437 /** Constructor. Automatically generates all of the nodes, in the order of CONTENTS. */
438 public DesignTree() {
439 super();
440 root = new DesignNode("CDM.GUI.Root");
441 this.setModel(new DefaultTreeModel(root));
442 // Now add the design categories.
443 for(int i = 0; i < CONTENTS.length; i++) {
444 root.add(new DesignNode(CONTENTS[i]));
445 }
446 expandRow(0);
447 setRootVisible(false);
448 setSelectionRow(0);
449 }
450 /** Set the current view to the one specified.
451 * @param type the name of the desired view as a String
452 */
453 public void setSelectedView(String type) {
454 type = Dictionary.get(type);
455 for(int i = 0; i < root.getChildCount(); i++) {
456 DesignNode child = (DesignNode) root.getChildAt(i);
457 if(child.toString().equals(type)) {
458 TreePath path = new TreePath(child.getPath());
459 setSelectionPath(path);
460 }
461 }
462 }
463 }
464 /** A tree node that retains a reference to one of the possible design sub-views relating to the different sub-managers. */
465 private class DesignNode
466 extends DefaultMutableTreeNode {
467 /** Constructor.
468 * @param object The <strong>Object</strong> assigned to this node.
469 */
470 public DesignNode(String object) {
471 super(object);
472 }
473 /** Retrieve a textual representation of the object.
474 * @return a String
475 */
476 public String toString() {
477 // return Dictionary.get("CDM.GUI." + (String)getUserObject());
478 return Dictionary.get((String) getUserObject());
479 }
480 }
481 /** Listens for selection changes in the 'contents' tree, and switches to the appropriate view. */
482 private class TreeListener
483 implements TreeSelectionListener {
484 /** Called whenever the selection changes, we must update the view so it matches the node selected.
485 * @param event A <strong>TreeSelectionEvent</strong> containing more information about the tree selection.
486 * @see org.greenstone.gatherer.cdm.ClassifierManager
487 * @see org.greenstone.gatherer.cdm.CollectionDesignManager
488 * @see org.greenstone.gatherer.cdm.CollectionMetaManager
489 * @see org.greenstone.gatherer.cdm.FormatManager
490 * @see org.greenstone.gatherer.cdm.LanguageManager
491 * @see org.greenstone.gatherer.cdm.MetadataSetManager
492 * @see org.greenstone.gatherer.cdm.SubcollectionManager
493 * @see org.greenstone.gatherer.cdm.PlugInManager
494 */
495 public void valueChanged(TreeSelectionEvent event) {
496 if(!tree.isSelectionEmpty()) {
497 TreePath path = tree.getSelectionPath();
498 DesignNode node = (DesignNode)path.getLastPathComponent();
499 String type = (String)node.getUserObject();
500 // Wait begins
501 Gatherer.g_man.wait(true);
502 // Save information in current view
503 view.loseFocus();
504 remove((JPanel)view);
505 // Change panes.
506 if(type == CONTENTS[0]) {
507 view = getControls();
508 }
509 else if(type == CONTENTS[1]) {
510 view = CollectionDesignManager.plugin_manager.getControls();
511 }
512 else if(type == CONTENTS[2]) {
513 view = CollectionDesignManager.searchtype_manager.getControls();
514 }
515 else if(type == CONTENTS[3]) {
516 view = CollectionDesignManager.index_manager.getControls();
517 }
518 else if(type == CONTENTS[4]) {
519 view = CollectionDesignManager.subcollection_manager.getControls();
520 }
521 else if(type == CONTENTS[5]) {
522 view = CollectionDesignManager.supercollection_manager.getControls();
523 }
524 else if(type == CONTENTS[6]) {
525 view = CollectionDesignManager.classifier_manager.getControls();
526 }
527 else if(type == CONTENTS[7]) {
528 view = CollectionDesignManager.format_manager.getControls();
529 }
530 else if(type == CONTENTS[8]) {
531 view = CollectionDesignManager.translation_view.getControls();
532 }
533 else if(type == CONTENTS[9]) {
534 view = CollectionDesignManager.metadataset_view.getControls();
535 }
536 add((JPanel)view, BorderLayout.CENTER);
537 // Update information on visible pane
538 view.gainFocus();
539 repaint();
540 // Wait ends
541 Gatherer.g_man.wait(false);
542 }
543 }
544 }
545}
Note: See TracBrowser for help on using the repository browser.