Changeset 12058
- Timestamp:
- 2006-07-07T11:04:40+12:00 (18 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer/gui
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/DesignPane.java
r10556 r12058 37 37 package org.greenstone.gatherer.gui; 38 38 39 import java.awt.*;40 import java.io.*;41 import java.util.*;42 import javax.swing.*;43 import org.greenstone.gatherer.Gatherer;44 39 import org.greenstone.gatherer.cdm.CollectionDesignManager; 45 /** This serves as the Collection configuration pane and came in two flavors.<BR> 46 * The lower tech version has now been made redundant.<BR> 47 * The higher tech, and finally implemented, version uses a tree to allow a user to navigate through the various regions of the config file and further allows them to interactively design and modify such gsdl elements as classifiers and plugins. 48 * @author John Thompson, Greenstone Digital Library, University of Waikato 49 * @version 2.2 50 */ 40 import org.greenstone.gatherer.cdm.Control; 51 41 public class DesignPane 52 extends JPanel { 53 /** The collection manager is responsible for parsing in, and allowing the editing of, a single collections configuration file. */ 54 private CollectionDesignManager cdm = null; 42 extends BaseConfigPane { 55 43 56 44 /** The constructor. */ 57 45 public DesignPane() { 46 super(); 47 contents = new String [] { "CDM.GUI.Plugins", "CDM.GUI.Indexes", "CDM.GUI.Subcollections", "CDM.GUI.Classifiers", "CDM.GUI.MetadataSets" }; 48 58 49 } 59 50 60 /** Called to cause the components to lay themselves out and be displayed. 61 */ 62 public void display() { 63 // Layout 64 this.setLayout(new BorderLayout()); 51 protected Control getSubControls(String type) { 52 if(type.equals("CDM.GUI.Plugins")) { 53 return CollectionDesignManager.plugin_manager.getControls(); 54 } 55 if(type.equals("CDM.GUI.Indexes")) { 56 return CollectionDesignManager.index_manager.getControls(); 57 } 58 if(type.equals("CDM.GUI.Subcollections")) { 59 return CollectionDesignManager.subcollection_manager.getControls(); 60 } 61 if(type.equals("CDM.GUI.Classifiers")) { 62 return CollectionDesignManager.classifier_manager.getControls(); 63 } 64 if(type.equals("CDM.GUI.MetadataSets")) { 65 return CollectionDesignManager.metadataset_view.getControls(); 66 } 67 return null; 65 68 } 66 69 67 public void gainFocus() {68 if (cdm == null && Gatherer.c_man.ready()) {69 // Retrieve the new config manager.70 cdm = Gatherer.c_man.getCollection().cdm;71 // Display it.72 cdm.display(this);73 }74 if (cdm != null) {75 cdm.gainFocus();76 }77 }78 79 public ArrayList getLanguageCodes() {80 return cdm.language_manager.getLanguageCodes();81 }82 83 public boolean canSave() {84 return cdm.canSave();85 }86 87 public void loseFocus() {88 if (cdm != null) {89 cdm.save(false);90 }91 }92 93 /** Called whenever the detail mode changes to ensure the filters are at an appropriate level (ie only editable by those that understand regular expression matching)94 * @param mode the mode level as an int95 */96 public void modeChanged(int mode) {97 if (cdm != null) {98 cdm.modeChanged(mode);99 }100 }101 102 /** This method is called whenever the state of the current collection changes.103 */104 public void refresh(int refresh_reason, boolean ready)105 {106 if (ready) {107 // Retrieve the new config manager.108 cdm = Gatherer.c_man.getCollection().cdm;109 // Display it.110 cdm.display(this);111 }112 else {113 if (cdm != null) {114 cdm.destroy();115 cdm = null;116 }117 }118 }119 120 public void saveConfiguration() {121 if (cdm != null) {122 cdm.save(true);123 }124 }125 70 }
Note:
See TracChangeset
for help on using the changeset viewer.