Changeset 5590
- Timestamp:
- 2003-10-07T14:48:08+13:00 (21 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/ArgumentConfiguration.java
r5527 r5590 31 31 import java.util.*; 32 32 import javax.swing.*; 33 import org.greenstone.gatherer.Dictionary; 33 34 import org.greenstone.gatherer.Gatherer; 34 35 import org.greenstone.gatherer.cdm.Argument; … … 76 77 /** The size used for the dialog. */ 77 78 static final private Dimension SIZE = new Dimension(800, 425); 79 78 80 /** Constructor. 79 81 * @param data The plugin or classifier whose arguments we are configuring, in the form of its supported <strong>ArgumentContainer</strong> interface. … … 84 86 this.data = data; 85 87 this.self = this; 86 String custom_str = data.getCustom(); 88 87 89 // Create 88 90 setModal(true); 89 91 setSize(SIZE); 90 setTitle(get("CDM.ArgumentConfiguration.Title"));91 92 setJMenuBar(new SimpleMenuBar("designingacollection")); // can we tell whether we are doing a classifier or plugin, to make the help more specific?? 92 JPanel button_pane = new JPanel(); 93 cancel = new JButton(get("General.Cancel")); 94 cancel.setMnemonic(KeyEvent.VK_C); 93 Dictionary.setText(this, "CDM.ArgumentConfiguration.Title"); 94 95 95 central_pane = new JPanel(); 96 96 JPanel content_pane = (JPanel) getContentPane(); 97 if(custom_str != null) { 97 98 JPanel custom_pane = new JPanel(); 99 String custom_str = data.getCustom(); 100 if (custom_str != null) { 98 101 custom = new JTextField(custom_str); 99 102 } … … 101 104 custom = new JTextField(); 102 105 } 103 JLabel custom_label = new JLabel( get("CDM.ArgumentConfiguration.Custom"));106 JLabel custom_label = new JLabel(); 104 107 custom_label.setPreferredSize(LABEL_SIZE); 105 JPanel custom_pane = new JPanel(); 108 Dictionary.setText(custom_label, "CDM.ArgumentConfiguration.Custom"); 109 110 JPanel header_pane = new JPanel(); 111 JLabel header = new JLabel(); 112 header.setHorizontalAlignment(JLabel.CENTER); 113 header.setOpaque(true); 106 114 String args[] = new String[1]; 107 115 args[0] = data.getName(); 108 JLabel header = new JLabel(get("CDM.ArgumentConfiguration.Header",args)); 109 args = null; 110 header.setHorizontalAlignment(JLabel.CENTER); 111 header.setOpaque(true); 112 JPanel header_pane = new JPanel(); 113 ok = new JButton(get("General.OK")); 116 Dictionary.setText(header, "CDM.ArgumentConfiguration.Header", args); 117 118 JPanel button_pane = new JPanel(); 119 cancel = new JButton(); 120 cancel.setMnemonic(KeyEvent.VK_C); 121 Dictionary.setBoth(cancel, "General.Cancel", "General.Pure_Cancel_Tooltip"); 122 ok = new JButton(); 114 123 ok.setMnemonic(KeyEvent.VK_O); 124 Dictionary.setBoth(ok, "General.OK", "General.OK_Tooltip"); 125 115 126 // Listeners 116 127 cancel.addActionListener(this); 117 128 ok.addActionListener(this); 129 118 130 // Layout 119 131 custom_pane.setLayout(new BorderLayout()); … … 148 160 screen_size = null; 149 161 } 162 150 163 /** Any implementation of ActionListener must include this method so that we can be informed when an action has occured on one of the controls we are listening to. 151 152 153 154 164 * @param event An <strong>ActionEvent</strong> containing pertinant information about the event that fired this call. 165 * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl 166 * @see org.greenstone.gatherer.cdm.ArgumentContainer 167 */ 155 168 public void actionPerformed(ActionEvent event) { 156 169 boolean cont = true; 157 if (event.getSource() == ok) {170 if (event.getSource() == ok) { 158 171 // Update the details stored in the data objects arguments. 159 172 data.setCustom(custom.getText()); … … 174 187 } 175 188 } 189 176 190 /** Destructor. */ 177 191 public void destroy() { … … 183 197 self = null; 184 198 } 199 185 200 /** Method which actually forces the dialog to be shown on screen. 186 187 201 * @return <i>true</i> if the user completed configuration and pressed ok, <i>false</i> otherwise. 202 */ 188 203 public boolean display() { 189 204 setVisible(true); … … 201 216 header_label.setHorizontalAlignment(JLabel.CENTER); 202 217 header_label.setOpaque(true); 203 // Layout. 218 219 // Layout 204 220 inner_pane.setLayout(new BorderLayout()); 205 221 inner_pane.add(header_label, BorderLayout.CENTER); … … 211 227 212 228 /** Method to iterate through the arguments associated with whatever argument container we are building an argument control view for, creating the appropriate controls for each. 213 214 215 229 * @see org.greenstone.gatherer.cdm.Argument 230 * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl 231 */ 216 232 private void generateControls() { 217 233 ArrayList arguments = data.getArguments(true, false); 218 234 int total_height = 250; 219 int size = arguments.size(); 220 for(int i = 0; i < size; i++) { 235 for(int i = 0; i < arguments.size(); i++) { 221 236 Argument argument = (Argument) arguments.get(i); 222 237 ArgumentControl argument_control = new ArgumentControl(argument); … … 231 246 } 232 247 } 233 /** Method to retrieve a phrase from the dictionary based on a key. 234 * @param key A <strong>String</strong> used to find the correct phrase. 235 * @param args A <strong>String[]</strong> of arguments used in formatting and filling out the phrase. 236 * @return A <strong>String</strong> containing the correct phrase with the correct formatting. 237 */ 238 private String get(String key) { 239 return get(key, null); 240 } 241 /** Method to retrieve a phrase from the dictionary based on a key. 242 * @param key A <strong>String</strong> used to find the correct phrase. 243 * @return A <strong>String</strong> containing the correct phrase with the correct formatting. 244 */ 245 private String get(String key, String args[]) { 246 if(key.indexOf(".") == -1) { 247 key = "CDM.ArgumentConfiguration." + key; 248 } 249 return Gatherer.dictionary.get(key, args); 250 } 248 251 249 /** This class encapsulates all the technical difficulty of creating a specific control based on an Argument. */ 252 250 private class ArgumentControl … … 280 278 String tip = "<html>" + argument.getDescription() + "</html>"; 281 279 tip = Utility.formatHTMLWidth(tip, 60); 280 282 281 // If this is the first control, there is no history. 283 282 if(previous_owner == null) { … … 418 417 model.addElement(values.get(i)); 419 418 } 420 one = new JButton(get("CDM.ArgumentConfiguration.Add")); 419 420 one = new JButton(); 421 421 one.addActionListener(new AddListener((JComboBox)value, list)); 422 two = new JButton(get("CDM.ArgumentConfiguration.Remove")); 422 Dictionary.setBoth(one, "CDM.ArgumentConfiguration.Add", "CDM.ArgumentConfiguration.Add_Tooltip"); 423 two = new JButton(); 423 424 two.addActionListener(new RemoveListener(list)); 425 Dictionary.setBoth(two, "CDM.ArgumentConfiguration.Remove", "CDM.ArgumentConfiguration.Remove_Tooltip"); 426 424 427 if(argument.getValues().size() > 0 || argument.isRequired()) { 425 428 enabled.setSelected(true); … … 537 540 String args[] = new String[1]; 538 541 args[0] = argument.getName(); 539 JOptionPane.showMessageDialog(self, get("CDM.ArgumentConfiguration.Required_Argument", args),get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE);542 JOptionPane.showMessageDialog(self, Dictionary.newget("CDM.ArgumentConfiguration.Required_Argument", args), Dictionary.newget("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE); 540 543 args = null; 541 544 return false; … … 560 563 args[0] = argument.getName(); 561 564 args[1] = result; 562 JOptionPane.showMessageDialog(self, get("CDM.ArgumentConfiguration.Bad_Integer", args),get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE);565 JOptionPane.showMessageDialog(self, Dictionary.newget("CDM.ArgumentConfiguration.Bad_Integer", args), Dictionary.newget("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE); 563 566 args = null; 564 567 return false; … … 570 573 String args[] = new String[1]; 571 574 args[0] = argument.getName(); 572 JOptionPane.showMessageDialog(self, get("CDM.ArgumentConfiguration.Required_Argument", args),get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE);575 JOptionPane.showMessageDialog(self, Dictionary.newget("CDM.ArgumentConfiguration.Required_Argument", args), Dictionary.newget("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE); 573 576 args = null; 574 577 return false; … … 609 612 String args[] = new String[1]; 610 613 args[0] = argument.getName(); 611 JOptionPane.showMessageDialog(self, get("CDM.ArgumentConfiguration.Required_Argument", args),get("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE);614 JOptionPane.showMessageDialog(self, Dictionary.newget("CDM.ArgumentConfiguration.Required_Argument", args), Dictionary.newget("CDM.ArgumentConfiguration.Error_Title"), JOptionPane.ERROR_MESSAGE); 612 615 return false; 613 616 } … … 626 629 } 627 630 /** Method to ensure that a certain value is selected, if it exists within that combobox to begin with. 628 629 630 631 632 631 * @param combobox The <strong>JComboBox</strong> whose selection we are trying to preset. 632 * @param target The desired value of the selection as a <strong>String</strong>. 633 * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl.ListOption 634 * @see org.greenstone.gatherer.msm.ElementWrapper 635 */ 633 636 public void selectValue(JComboBox combobox, String target) { 634 637 for(int i = 0; i < combobox.getItemCount(); i++) { … … 654 657 } 655 658 /** Explicitly sets the value of a JTextField type control to the given String. 656 657 659 * @param value_str The new value of the control as a <strong>String</strong>. 660 */ 658 661 public void setValue(String value_str) { 659 662 ((JTextField)value).setText(value_str); … … 662 665 private class AddListener 663 666 implements ActionListener { 664 667 /** The model behind the target list. */ 665 668 private DefaultListModel model = null; 666 669 /** The source for data to be added to the list. */ 667 670 private JComboBox source = null; 668 671 /** The list to add data to. */ 669 672 private JList target = null; 670 671 672 673 673 /** Constructor. 674 * @param source A <strong>JComboBox</strong> which serves as the source for data. 675 * @param target A <strong>JList</strong> which serves as the target for data. 676 */ 674 677 public AddListener(JComboBox source, JList target) { 675 678 this.model = (DefaultListModel) target.getModel(); … … 677 680 this.target = target; 678 681 } 679 680 681 682 682 /** When the add button is clicked, we attempt to add the selected metadata from the source into the target. 683 * @param event An <strong>ActionEvent</strong> containing information about the event. 684 * @see org.greenstone.gatherer.msm.ElementWrapper 685 */ 683 686 public void actionPerformed(ActionEvent event) { 684 687 ElementWrapper element = (ElementWrapper) source.getSelectedItem(); … … 706 709 private class EnabledListener 707 710 implements ActionListener { 708 711 /** One of two possible buttons that might have their enabled state changed by this listener. */ 709 712 private JButton one = null; 710 713 /** One of two possible buttons that might have their enabled state changed by this listener. */ 711 714 private JButton two = null; 712 715 /** An editor component, such as a JComboBox or JTextField, that might have its enabled state changed by this listener. */ 713 716 private JComponent target = null; 714 717 /** A list which might have its enabled state changed by this listener. */ 715 718 private JList list = null; 716 717 718 719 720 721 719 /** Constructor. 720 * @param one A <strong>JButton</strong> whose enabled state is determined by the listener, or <i>null</i> if no button. 721 * @param two A <strong>JButton</strong> whose enabled state is determined by the listener, or <i>null</i> if no button. 722 * @param list A <strong>JList</strong> whose enabled state is determined by the listener, or <i>null</i> if no list. 723 * @param list A <strong>JComponent</strong> whose enabled state is determined by the listener, or <i>null</i> if no component. 724 */ 722 725 public EnabledListener(JButton one, JButton two, JList list, JComponent target) { 723 726 this.list = list; … … 726 729 this.two = two; 727 730 } 728 729 730 731 /** Any implementation of ActionListener must include this method so that we can be informed when an action has been performed on or registered check box, prompting us to change the state of the other controls as per the users request. 732 * @param event An <strong>ActionEvent</strong> containing information about the click. 733 */ 731 734 public void actionPerformed(ActionEvent event) { 732 735 JCheckBox source = (JCheckBox)event.getSource(); … … 756 759 private class HierarchyListener 757 760 implements ItemListener { 758 759 760 761 762 761 /** Any implementation of ItemListener must include this method so that we can be informed when an item from the list is selected, and generate a predetermined hfile for that selection. 762 * @param event An <strong>ItemEvent</strong> containing information about the selection. 763 * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl 764 * @see org.greenstone.gatherer.valuetree.GValueModel 765 */ 763 766 public void itemStateChanged(ItemEvent event) { 764 767 // Determine if the selected element represents a hierarchy. … … 783 786 /** The maximum length of this String version of this item. */ 784 787 //private int MAX_DESC = 35; 785 788 /** The description of the value for this item. */ 786 789 private String description = null; 787 790 /** A cached value for the text value of this option, as it never changes after the first call to toString(). */ 788 791 private String text = null; 789 792 /** The value for this item. */ 790 793 private String value = null; 791 792 793 794 794 /** Constructor. 795 * @param value The value for this item as a <strong>String</strong>. 796 * @param description The description of the value as a <strong>String</strong>. 797 */ 795 798 public ListOption(String value, String description) { 796 799 this.description = description; 797 800 this.value = value; 798 801 } 799 800 801 802 803 802 /** Compare two possible ListOption objects for ordering. 803 * @param object The <strong>Object</strong> to compare to. 804 * @return An <i>int</i> indicating order as explained in String. 805 * @see java.lang.String#compareTo 806 */ 804 807 public int compareTo(Object object) { 805 808 return toString().compareTo(object.toString()); 806 809 } 807 808 809 810 810 /** Tests two possible ListOption objects for equality. Uses the result from compareTo(). 811 * @param The <strong>Object</strong> which may be equal. 812 * @return <i>true</i> if the objects are equal, <i>false</i> otherwise. 813 */ 811 814 public boolean equals(Object object) { 812 815 return (compareTo(object) == 0); 813 816 } 814 815 816 817 /** Retrieve the description of this list item. 818 * @return The description as a <strong>String</strong>. 819 */ 817 820 public String getDesc() { 818 821 return description; 819 822 } 820 821 822 823 /** Retrieve the value of this list item. 824 * @return The value as a <strong>String</strong>. 825 */ 823 826 public String getValue() { 824 827 return value; 825 828 } 826 827 828 829 /** Convert this object into a nice readable String. 830 * @return A <strong>String</strong> representing this object. 831 */ 829 832 public String toString() { 830 833 if(text == null) { … … 842 845 private class RemoveListener 843 846 implements ActionListener { 844 847 /** The model behind the target list. */ 845 848 private DefaultListModel model = null; 846 849 /** The list to remove data from. */ 847 850 private JList target = null; 848 849 850 851 /** Constructor. 852 * @param target A <strong>JList</strong>. 853 */ 851 854 public RemoveListener(JList target) { 852 855 this.model = (DefaultListModel) target.getModel(); 853 856 this.target = target; 854 857 } 855 856 857 858 /** When the remove button is clicked, we attempt to remove the selected metadata from the target. 859 * @param event An <strong>ActionEvent</strong> containing information about the event. 860 */ 858 861 public void actionPerformed(ActionEvent event) { 859 862 if(!target.isSelectionEmpty()) { … … 866 869 private class ToolTipUpdater 867 870 implements ActionListener { 868 869 870 871 /** Any implementation of an ActionListener must include this method so that we can be informed when the selection in a combobox has changed and update the tooltip accordingly. 872 * @param event An <strong>ActionEvent</strong> containing information about the action that fired this call. 873 */ 871 874 public void actionPerformed(ActionEvent event) { 872 875 JComboBox source = (JComboBox)event.getSource(); -
trunk/gli/src/org/greenstone/gatherer/cdm/ArgumentContainer.java
r4932 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 20/05/02 … … 31 32 **************************************************************************************/ 32 33 import java.util.ArrayList; 34 33 35 /** This class provides an interface to any class that contains a list of Arguments. 34 36 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 55 57 public void setCustom(String custom); 56 58 } 57 58 59 60 61 -
trunk/gli/src/org/greenstone/gatherer/cdm/Classifier.java
r5209 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 01/05/02 … … 42 43 import org.greenstone.gatherer.util.Utility; 43 44 import org.w3c.dom.*; 45 44 46 /** This class is responsible for storing information from a parsed classinfo.pl call in such a way that it allows easy access to parsed details for the purposes of user design and specification of classifiers. 45 47 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 130 132 131 133 /** Constructor. 132 133 134 135 134 * @param name The name of this classifier as a <strong>String</strong>. 135 * @param desc A description of this classifier as a <strong>String</strong>. 136 * @param super_classifier The super class of this classifier, as a <strong>Classifier</strong>. 137 */ 136 138 public Classifier(String name, String description, Classifier super_classifier) { 137 139 super(); … … 142 144 143 145 /** Method to add an argument to this classifier. Only adds the argument if it isn't already present. 144 145 146 * @param argument The <strong>Argument</strong> to add. 147 */ 146 148 public void addArgument(Argument argument) { 147 149 if(element == null && !contains(argument)) { … … 152 154 153 155 /** Method to compare two classifiers for ordering. 154 155 156 157 156 * @param object The classifier we are comparing to, as an <strong>Object</strong>. 157 * @return An <i>int</i> specifying the classifier order, using values as set out in String. 158 * @see java.lang.String#compareTo 159 */ 158 160 public int compareTo(Object object) { 159 161 if(object == null) { … … 205 207 206 208 /** Retrieve all of the arguments available to this base classifier, including its super classifiers arguments. Some complexity is added by allowing the caller to choose whether they want normal arguments, custom arguments, or both. 207 * @return an ArrayList of all of the arguments, starting with those for this classifier and ending with the arguments for basplug or similiar root classifier208 */209 * @return an ArrayList of all of the arguments, starting with those for this classifier and ending with the arguments for basplug or similiar root classifier 210 */ 209 211 public ArrayList getArguments(boolean include_normal, boolean include_custom) { 210 212 ArrayList arguments = new ArrayList(); … … 387 389 388 390 /** Method to print out this classifier as it would appear to the user in the interface 389 390 391 * @return A <strong>String</strong> containing a single classifier command. 392 */ 391 393 public String toString() { 392 394 if(element != null) { -
trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java
r5342 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 01/05/02 … … 39 40 import javax.swing.event.*; 40 41 import org.apache.xerces.parsers.*; 42 import org.greenstone.gatherer.Dictionary; 41 43 import org.greenstone.gatherer.Gatherer; 42 44 import org.greenstone.gatherer.cdm.Argument; … … 56 58 import org.w3c.dom.*; 57 59 import org.xml.sax.*; 60 58 61 /** This class is responsible for keeping track of all the classifiers assigned to this collection, and providing methods for adding and removing them. 59 62 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 197 200 if(index < 0) { 198 201 String args[] = new String[2]; 199 args[0] = get("CDM.ClassifierManager.Classifier");202 args[0] = Dictionary.newget("CDM.ClassifierManager.Classifier"); 200 203 args[1] = classifier.getName(); 201 JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.Move.At_Top", args),get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);204 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.newget("CDM.Move.At_Top", args), Dictionary.newget("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE); 202 205 return; 203 206 } … … 210 213 if(index >= getSize()) { 211 214 String args[] = new String[2]; 212 args[0] = get("CDM.ClassifierManager.Classifier_Str");215 args[0] = Dictionary.newget("CDM.ClassifierManager.Classifier_Str"); 213 216 args[1] = classifier.getName(); 214 JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.Move.At_Bottom", args),get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);217 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.newget("CDM.Move.At_Bottom", args), Dictionary.newget("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE); 215 218 return; 216 219 } … … 223 226 224 227 /** This method removes an assigned classifier. I was tempted to call it unassign, but remove is more consistant. Note that there is no way to remove a classifier from the library. 225 226 227 228 * @param classifier The Classifier to remove 229 * @see org.greenstone.gatherer.cdm.DynamicListModel 230 */ 228 231 public void removeClassifier(Classifier classifier) { 229 232 remove(classifier); … … 243 246 catch (Exception error) { 244 247 } 245 }246 247 /** Retrieve a phrase from the dictionary based on a certain key.248 * @param key The search <strong>String</strong>.249 * @return The matching phrase from the Dictionary.250 */251 private String get(String key) {252 return get(key, (String[])null);253 }254 /** Retrieve a phrase from the dictionary based on a certain key and certain arguments.255 * @param key The search <strong>String</strong>.256 * @param args A <strong>String[]</strong> used to complete and format the returned phrase.257 * @return The matching phrase from the Dictionary.258 * @see org.greenstone.gatherer.Dictionary259 * @see org.greenstone.gatherer.Gatherer260 */261 private String get(String key, String arg) {262 String[] args = null;263 if(arg != null) {264 args = new String[1];265 args[0] = arg;266 }267 return get(key, args);268 }269 270 private String get(String key, String[] args) {271 if(key.indexOf(".") == -1) {272 key = "CDM.ClassifierManager." + key;273 }274 return Gatherer.dictionary.get(key, args);275 248 } 276 249 … … 364 337 String classifier_name = getClassifierName(classifier); 365 338 Gatherer.println("Zero length argument xml detected for: " + classifier_name); 366 JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.ClassifierManager.Classifier_XML_Parse_Failed", classifier_name),get("General.Error"), JOptionPane.ERROR_MESSAGE);339 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.newget("CDM.ClassifierManager.Classifier_XML_Parse_Failed", classifier_name), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE); 367 340 classifier_name = null; 368 341 } … … 397 370 if(files != null) { 398 371 // Create a progress indicator. 399 ParsingProgress progress = new ParsingProgress( get("CDM.ClassifierManager.Parsing.Title"),get("CDM.ClassifierManager.Parsing.Message"), files.length);372 ParsingProgress progress = new ParsingProgress(Dictionary.newget("CDM.ClassifierManager.Parsing.Title"), Dictionary.newget("CDM.ClassifierManager.Parsing.Message"), files.length); 400 373 for(int i = 0; i < files.length; i++) { 401 374 // We only want to check Perl Modules. … … 413 386 414 387 /** Parses a DOM tree model turning it into a Classifier and its associated arguments. 415 416 417 418 388 * @param root The <strong>Node</strong> at the root of the DOM model. 389 * @return A newly created <strong>Classifier</strong> based on the information parsed from the DOM model. 390 * @see org.greenstone.gatherer.cdm.Argument 391 */ 419 392 private Classifier parseXML(Node root) { 420 393 Classifier classifier = new Classifier(); … … 506 479 return null; 507 480 } 481 508 482 /** A class which provides controls for assigned and editing classifiers. */ 509 483 private class ClassifierControl … … 532 506 /** The text area containing instructions on the use of this control. */ 533 507 private JTextArea instructions = null; 508 534 509 /** Constructor. 535 510 * @see org.greenstone.gatherer.cdm.ClassifierManager.Control.AddListener … … 540 515 Collections.sort(library); 541 516 // Create 542 add = new JButton(get("CDM.ClassifierManager.Add")); 517 add = new JButton(); 518 Dictionary.setBoth(add, "CDM.ClassifierManager.Add", "CDM.ClassifierManager.Add_Tooltip"); 543 519 JPanel button_pane = new JPanel(); 544 520 JPanel central_pane = new JPanel(); 545 configure = new JButton( get("CDM.ClassifierManager.Configure"));521 configure = new JButton(); 546 522 configure.setEnabled(false); 523 Dictionary.setBoth(configure, "CDM.ClassifierManager.Configure", "CDM.ClassifierManager.Configure_Tooltip"); 547 524 JPanel header_pane = new JPanel(); 548 instructions = new JTextArea( get("CDM.ClassifierManager.Instructions"));525 instructions = new JTextArea(); 549 526 instructions.setEditable(false); 550 527 instructions.setLineWrap(true); 551 528 instructions.setRows(6); 552 529 instructions.setWrapStyleWord(true); 530 Dictionary.setText(instructions, "CDM.ClassifierManager.Instructions"); 553 531 554 532 classifier = new GComboBox(getAvailable()); … … 559 537 classifier.setTextNonSelectionColor(Gatherer.config.getColor("coloring.workspace_tree_foreground", false)); 560 538 classifier.setTextSelectionColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false)); 561 562 JLabel classifier_label = new JLabel(get("CDM.ClassifierManager.Classifier")); 539 Dictionary.setTooltip(classifier, "CDM.ClassifierManager.Classifier_Tooltip"); 540 541 JLabel classifier_label = new JLabel(); 542 Dictionary.setText(classifier_label, "CDM.ClassifierManager.Classifier"); 563 543 classifier_list = new JList(model); 564 544 classifier_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 565 JLabel classifier_list_label = new JLabel( get("CDM.ClassifierManager.Assigned"));545 JLabel classifier_list_label = new JLabel(); 566 546 classifier_list_label.setHorizontalAlignment(JLabel.CENTER); 567 547 classifier_list_label.setOpaque(true); 548 Dictionary.setText(classifier_list_label, "CDM.ClassifierManager.Assigned"); 568 549 JPanel classifier_list_pane = new JPanel(); 569 550 JPanel classifier_pane = new JPanel(); 570 remove = new JButton( get("CDM.ClassifierManager.Remove"));551 remove = new JButton(); 571 552 remove.setEnabled(false); 572 JLabel title = new JLabel(get("CDM.ClassifierManager.Title")); 553 Dictionary.setBoth(remove, "CDM.ClassifierManager.Remove", "CDM.ClassifierManager.Remove_Tooltip"); 554 555 JLabel title = new JLabel(); 573 556 title.setHorizontalAlignment(JLabel.CENTER); 574 557 title.setOpaque(true); 558 Dictionary.setText(title, "CDM.ClassifierManager.Title"); 559 575 560 JPanel temp = new JPanel(new BorderLayout()); 576 561 577 562 JPanel move_button_pane = new JPanel(); 578 563 579 move_top_button = new DoubleImageButton( get("CDM.Move.Move_Top"), Utility.getImage("arrow-top.gif"), Utility.getImage("arrow-top-disabled.gif"));564 move_top_button = new DoubleImageButton("", Utility.getImage("arrow-top.gif"), Utility.getImage("arrow-top-disabled.gif")); 580 565 move_top_button.setEnabled(false); 581 566 move_top_button.setMnemonic(KeyEvent.VK_T); 582 move_top_button.setDisplayedMnemonicIndex(8); // !! English-centric hack567 // move_top_button.setDisplayedMnemonicIndex(8); // !! English-centric hack 583 568 move_top_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE); 584 585 move_up_button = new DoubleImageButton(get("CDM.Move.Move_Up"), Utility.getImage("arrow-up.gif"), Utility.getImage("arrow-up-disabled.gif")); 569 Dictionary.registerBoth(move_top_button, "CDM.Move.Move_Top", "CDM.Move.Move_Top_Tooltip"); 570 571 move_up_button = new DoubleImageButton("", Utility.getImage("arrow-up.gif"), Utility.getImage("arrow-up-disabled.gif")); 586 572 move_up_button.setEnabled(false); 587 573 move_up_button.setMnemonic(KeyEvent.VK_U); 588 574 move_up_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE); 589 590 move_down_button = new DoubleImageButton(get("CDM.Move.Move_Down"), Utility.getImage("arrow-down.gif"), Utility.getImage("arrow-down-disabled.gif")); 575 Dictionary.registerBoth(move_up_button, "CDM.Move.Move_Up", "CDM.Move.Move_Up_Tooltip"); 576 577 move_down_button = new DoubleImageButton("", Utility.getImage("arrow-down.gif"), Utility.getImage("arrow-down-disabled.gif")); 591 578 move_down_button.setEnabled(false); 592 579 move_down_button.setMnemonic(KeyEvent.VK_D); 593 580 move_down_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE); 594 595 move_bottom_button = new DoubleImageButton(get("CDM.Move.Move_Bottom"), Utility.getImage("arrow-bottom.gif"), Utility.getImage("arrow-bottom-disabled.gif")); 581 Dictionary.registerBoth(move_down_button, "CDM.Move.Move_Down", "CDM.Move.Move_Down_Tooltip"); 582 583 move_bottom_button = new DoubleImageButton("", Utility.getImage("arrow-bottom.gif"), Utility.getImage("arrow-bottom-disabled.gif")); 596 584 move_bottom_button.setEnabled(false); 597 585 move_bottom_button.setMnemonic(KeyEvent.VK_B); 598 586 move_bottom_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE); 587 Dictionary.registerBoth(move_bottom_button, "CDM.Move.Move_Bottom", "CDM.Move.Move_Bottom_Tooltip"); 599 588 600 589 // Listeners … … 610 599 move_top_button.addActionListener(ml); 611 600 move_up_button.addActionListener(ml); 601 612 602 // Layout 613 603 title.setBorder(BorderFactory.createEmptyBorder(0,0,2,0)); … … 645 635 646 636 // Scope these mad bordering skillz. 647 temp.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,0,5,0), BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder( get("CDM.ClassifierManager.Controls")), BorderFactory.createEmptyBorder(2,2,2,2))));637 temp.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,0,5,0), BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("CDM.ClassifierManager.Controls")), BorderFactory.createEmptyBorder(2,2,2,2)))); 648 638 temp.add(classifier_pane, BorderLayout.NORTH); 649 639 temp.add(button_pane, BorderLayout.SOUTH); … … 658 648 add(central_pane, BorderLayout.CENTER); 659 649 } 650 660 651 /** Method which acts like a destructor, tidying up references to persistant objects. 661 652 */ 662 653 public void destroy() { 663 654 add = null; … … 668 659 remove = null; 669 660 } 661 670 662 /** This method is overridden to ensure the instructions are scrolled to top, before the super classes updateUI() is called. 671 663 */ 672 664 public void gainFocus() { 673 665 if(instructions != null) { … … 720 712 } 721 713 else { 722 JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.ClassifierManager.Classifier_Exists"),get("General.Error"), JOptionPane.ERROR_MESSAGE);714 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.newget("CDM.ClassifierManager.Classifier_Exists"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE); 723 715 } 724 716 } … … 728 720 } 729 721 } 722 730 723 /** Listens for double clicks apon the list and react as if the configure button was pushed. */ 731 724 private class ClickListener … … 748 741 } 749 742 } 743 750 744 /** This class listens for actions upon the configure button in the controls, and if detected creates a new ArgumentConfiguration dialog box to allow for configuration. 751 745 */ 752 746 private class ConfigureListener 753 747 implements ActionListener { … … 826 820 827 821 /** This class listens for actions upon the remove button in the controls, and if detected calls the removeClassifier() method. 828 822 */ 829 823 private class RemoveListener 830 824 implements ActionListener { -
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java
r5290 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 import java.awt.*; 29 30 import java.awt.event.*; … … 39 40 import org.greenstone.gatherer.util.Utility; 40 41 import org.w3c.dom.*; 42 41 43 /** This class provides either access to a pseudo-G3 document, or parses a collect.cfg file in such a way as to provide an xml-type view of its content. This later version is useful as it allows the manipulation and free form editing of a legacy collect.cfg file while still allowing the various CDM data managers to base themselves directly on this model (whereas they used to be independant ListModels which clobbered the ordering of unparsed commands). 42 44 * @author John Thompson, Greenstone Digital Library, University of Waikato -
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java
r4967 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 import java.awt.*; 29 30 import java.awt.event.*; … … 42 43 import org.greenstone.gatherer.cdm.SubcollectionManager; 43 44 import org.greenstone.gatherer.cdm.TranslationView; 45 44 46 /** This manager provides access to submanagers, which in turn provide tools for the designing of Greenstone collections via the information stored in etc/collect.cfg. This class acts as a hub for the managers that handle specific parts of the configuration such as classifiers, format strings and language settings. 45 47 * @author John Thompson, Greenstone Digital Library, University of Waikato -
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMeta.java
r5254 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: … … 161 162 162 163 /** Method to print out this class as it would appear within the collection configuration file. 163 164 164 * @return A <strong>String</strong> containing the text value of this class. 165 */ 165 166 public String toString() { 166 167 if(text == null) { … … 170 171 } 171 172 } 172 173 174 175 -
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMetaManager.java
r5564 r5590 40 40 import org.greenstone.gatherer.util.Utility; 41 41 import org.w3c.dom.*; 42 42 43 /** This class is responsible for maintaining a list of assigned collection level metadata, and for allows manipulations on the aforementioned data. 43 44 * @author John Thompson, Greenstone Digital Library, University of Waikato -
trunk/gli/src/org/greenstone/gatherer/cdm/CommandTokenizer.java
r4675 r5590 35 35 *######################################################################## 36 36 */ 37 package org.greenstone.gatherer.cdm; 37 38 38 39 40 41 42 43 /* GPL_HEADER */44 package org.greenstone.gatherer.cdm;45 39 /************************************************************************************** 46 40 * Title: Gatherer … … 51 45 **************************************************************************************/ 52 46 import java.util.StringTokenizer; 47 53 48 /** This class provides an extension to the standard StringTokenizer in that it recognizes quotes (or some form of bracketting) enclose a single token so in something like: <br>format Search '<table><img src=... </table>'<br> the formatting string is parsed as a single token. Unfortunately this makes countTokens() unreliable for exact measurement of tokens remaining, and only useful for determining if there are tokens left to be processed (includes any that have already been read into command buffer). 54 49 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 118 113 return result; 119 114 } 115 120 116 /** Unfortunately the StringBuffer doesn't have a built in endsWith method, so I'll just have to implement my own. 121 117 * @param str The <strong>StringBuffer</strong> we are checking the end of. … … 126 122 String temp = str.toString(); 127 123 if(temp.endsWith(target) != (str.lastIndexOf(target) == str.length() - target.length())) { 128 129 130 124 ///ystem.err.println("Holy error that'll crash the HFile creator if it happens twice, Batman!"); 125 ///ystem.err.println("String = '" + temp + "'"); 126 ///ystem.err.println("Target = '" + target + "'"); 131 127 } 132 128 return str.lastIndexOf(target) == str.length() - target.length(); 133 129 } 134 130 } 135 136 -
trunk/gli/src/org/greenstone/gatherer/cdm/DOMProxyListEntry.java
r4932 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 import org.w3c.dom.*; 30 29 31 public interface DOMProxyListEntry 30 32 extends Comparable { -
trunk/gli/src/org/greenstone/gatherer/cdm/DOMProxyListModel.java
r5207 r5590 248 248 } 249 249 } 250 251 252 -
trunk/gli/src/org/greenstone/gatherer/cdm/DynamicListModel.java
r4675 r5590 35 35 *######################################################################## 36 36 */ 37 package org.greenstone.gatherer.cdm; 37 38 38 39 40 41 42 43 /* GPL_HEADER */44 package org.greenstone.gatherer.cdm;45 39 /************************************************************************************** 46 40 * Title: Gatherer … … 52 46 import javax.swing.ComboBoxModel; 53 47 import javax.swing.DefaultListModel; 48 54 49 /** This class extends the functionality of the DefaultListModel to include simple methods for refreshing the contents of this model if one of its elements changes. 55 50 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 66 61 public void addElement(Object element) { 67 62 if(auto_order) { 68 63 // Insert the object in its alphabetically correct place. 69 64 int position = 0; 70 65 boolean found = false; -
trunk/gli/src/org/greenstone/gatherer/cdm/ElementWrapper.java
r4675 r5590 1 1 package org.greenstone.gatherer.cdm; 2 2 3 import org.greenstone.gatherer.msm.MSMUtils; 3 4 import org.w3c.dom.*; … … 11 12 /** Constructor. 12 13 * @param element The <strong>Node</strong> this object is wrapped around. 13 14 */ 14 15 public ElementWrapper(Node element) { 15 16 this.element = element; 16 17 } 17 18 /** Compare two objects for ordering. 18 19 20 19 * @param object The other <strong>Object</strong> to compare to. 20 * @return An <i>int</i> indicating the ordering as is String.compareTo 21 */ 21 22 public int compareTo(Object object) { 22 23 if(object == null) { … … 26 27 } 27 28 /** Compare two objects for equality. 28 29 30 29 * @param object The <strong>Object</strong> to compare to. 30 * @return <i>true</i> if the objects are equal, <i>false</i> otherwise. 31 */ 31 32 public boolean equals(Object object) { 32 33 if(compareTo(object) == 0) { … … 36 37 } 37 38 /** Retrieve the name of the element. 38 39 40 39 * @return The fully qualified name as a <strong>String</strong>. 40 * @see org.greenstone.gatherer.msm.MSMUtils 41 */ 41 42 public String name() { 42 43 return MSMUtils.getFullName((Element)element); 43 44 } 44 45 /** Retrieve a textual representation of this object. 45 46 47 46 * @return A <strong>String</strong>. 47 * @see org.greenstone.gatherer.msm.MSMUtils 48 */ 48 49 public String toString() { 49 50 return MSMUtils.getIdentifier(element) + ": " + MSMUtils.getDescription(element); -
trunk/gli/src/org/greenstone/gatherer/cdm/Format.java
r5231 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 06/05/02 -
trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java
r5342 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 06/05/02 … … 36 37 import javax.swing.*; 37 38 import javax.swing.event.*; 39 import org.greenstone.gatherer.Dictionary; 38 40 import org.greenstone.gatherer.Gatherer; 39 41 import org.greenstone.gatherer.cdm.Classifier; … … 49 51 import org.greenstone.gatherer.util.Utility; 50 52 import org.w3c.dom.*; 53 51 54 /** This class maintains a list of format statements, and allows the addition and removal of these statements. 52 55 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 78 81 } 79 82 } 83 80 84 /** Method to add a new format to this manager. 81 82 85 * @param format The <strong>Format</strong> to add. 86 */ 83 87 public void addFormat(Format format) { 84 88 if(!contains(format)) { … … 188 192 Collections.sort(variable_model); 189 193 return variable_model; 190 }191 192 /** Overloaded to call get with both a key and an empty argument array.193 * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.194 * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.195 */196 private String get(String key) {197 return get(key, null);198 }199 200 /** Used to retrieve a property value from the Locale specific ResourceBundle, based upon the key and arguments supplied. If the key cannot be found or if some other part of the call fails a default (English) error message is returned. <BR>201 * Here the get recieves a second argument which is an array of Strings used to populate argument fields, denoted {<I>n</I>}, within the value String returned. Note that argument numbers greater than or equal to 32 are automatically mapped to the formatting String named Farg<I>n</I>.202 * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.203 * @param args A <strong>String[]</strong> used to populate argument fields within the complete String.204 * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.205 * @see org.greenstone.gatherer.Gatherer206 * @see org.greenstone.gatherer.Dictionary207 */208 private String get(String key, String args[]) {209 if(key.indexOf('.') == -1) {210 key = "CDM.FormatManager." + key;211 }212 return Gatherer.dictionary.get(key, args);213 194 } 214 195 … … 228 209 private JButton remove_button; 229 210 private JButton replace_button; 230 //private JButton reset_button;231 211 private JCheckBox enabled_checkbox; 232 212 private JComboBox feature_combobox; … … 249 229 // Create 250 230 JPanel instructions_pane = new JPanel(); 251 JLabel title_label = new JLabel( get("CDM.FormatManager.Title"));231 JLabel title_label = new JLabel(); 252 232 title_label.setHorizontalAlignment(JLabel.CENTER); 253 233 title_label.setOpaque(true); 254 instructions_textarea = new JTextArea(get("CDM.FormatManager.Instructions")); 234 Dictionary.registerText(title_label, "CDM.FormatManager.Title"); 235 236 instructions_textarea = new JTextArea(); 255 237 instructions_textarea.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 256 238 instructions_textarea.setEditable(false); … … 258 240 instructions_textarea.setRows(6); 259 241 instructions_textarea.setWrapStyleWord(true); 260 261 JLabel format_label = new JLabel(get("CDM.FormatManager.Assigned_Formats")); 242 Dictionary.registerText(instructions_textarea, "CDM.FormatManager.Instructions"); 243 244 JLabel format_label = new JLabel(); 245 Dictionary.registerText(format_label, "CDM.FormatManager.Assigned_Formats"); 262 246 format_list = new JList(model); 263 247 264 248 selection_pane = new JPanel(); 265 249 JPanel feature_pane = new JPanel(); 266 JLabel feature_label = new JLabel( get("CDM.FormatManager.Feature"));250 JLabel feature_label = new JLabel(); 267 251 feature_label.setPreferredSize(Utility.LABEL_SIZE); 252 Dictionary.registerText(feature_label, "CDM.FormatManager.Feature"); 268 253 feature_combobox = new JComboBox(feature_model.toArray()); 269 254 feature_combobox.setEditable(false); 255 Dictionary.registerTooltip(feature_combobox, "CDM.FormatManager.Feature_Tooltip"); 256 270 257 part_pane = new JPanel(); 271 JLabel part_label = new JLabel( get("CDM.FormatManager.Part"));258 JLabel part_label = new JLabel(); 272 259 part_label.setPreferredSize(Utility.LABEL_SIZE); 260 Dictionary.registerText(part_label, "CDM.FormatManager.Part"); 261 273 262 part_combobox = new JComboBox(part_model.toArray()); 274 263 part_combobox.setEditable(false); 264 Dictionary.registerTooltip(part_combobox, "CDM.FormatManager.Part_Tooltip"); 275 265 276 266 JPanel center_pane = new JPanel(); … … 283 273 JPanel editor_pane = new JPanel(); 284 274 JPanel editor_header_pane = new JPanel(); 285 JLabel editor_label = new JLabel( get("CDM.FormatManager.Editor"));286 //reset_button = new JButton(get("Reset"));287 //reset_button.setMnemonic(KeyEvent.VK_T); 275 JLabel editor_label = new JLabel(); 276 Dictionary.registerText(editor_label, "CDM.FormatManager.Editor"); 277 288 278 editor_textarea = new JTextArea(); 289 279 editor_textarea.setBackground(Gatherer.config.getColor("coloring.editable_background", false)); … … 292 282 editor_textarea.setRows(6); 293 283 editor_textarea.setWrapStyleWord(false); 284 Dictionary.registerTooltip(editor_textarea, "CDM.FormatManager.Editor_Tooltip"); 294 285 295 286 JPanel variable_pane = new JPanel(); 296 JLabel variable_label = new JLabel(get("CDM.FormatManager.Variable")); 287 JLabel variable_label = new JLabel(); 288 Dictionary.registerText(variable_label, "CDM.FormatManager.Variable"); 297 289 variable_combobox = new JComboBox(variable_model.toArray()); 298 insert_button = new JButton(get("CDM.FormatManager.Insert")); 290 Dictionary.registerTooltip(variable_combobox, "CDM.FormatManager.Variable_Tooltip"); 291 292 insert_button = new JButton(); 299 293 insert_button.setMnemonic(KeyEvent.VK_I); 294 Dictionary.registerBoth(insert_button, "CDM.FormatManager.Insert", "CDM.FormatManager.Insert_Tooltip"); 300 295 301 296 JPanel flag_pane = new JPanel(); 302 enabled_checkbox = new JCheckBox(get("CDM.FormatManager.Enabled")); 297 enabled_checkbox = new JCheckBox(); 298 Dictionary.registerText(enabled_checkbox, "CDM.FormatManager.Enabled"); 303 299 304 300 JPanel button_pane = new JPanel(); 305 add_button = new JButton( get("CDM.FormatManager.Add"));301 add_button = new JButton(); 306 302 add_button.setEnabled(false); 307 303 add_button.setMnemonic(KeyEvent.VK_A); 308 replace_button = new JButton(get("CDM.FormatManager.Replace")); 304 Dictionary.registerBoth(add_button, "CDM.FormatManager.Add", "CDM.FormatManager.Add_Tooltip"); 305 replace_button = new JButton(); 309 306 replace_button.setEnabled(false); 310 307 replace_button.setMnemonic(KeyEvent.VK_C); 311 remove_button = new JButton(get("CDM.FormatManager.Remove")); 308 Dictionary.registerBoth(replace_button, "CDM.FormatManager.Replace", "CDM.FormatManager.Replace_Tooltip"); 309 remove_button = new JButton(); 312 310 remove_button.setEnabled(false); 313 311 remove_button.setMnemonic(KeyEvent.VK_R); 312 Dictionary.registerBoth(remove_button, "CDM.FormatManager.Remove", "CDM.FormatManager.Remove_Tooltip"); 314 313 315 314 // Connect … … 318 317 remove_button.addActionListener(new RemoveListener()); 319 318 replace_button.addActionListener(new ReplaceListener()); 320 //reset_button.addActionListener(new ResetListener());321 319 enabled_checkbox.addActionListener(new EnabledListener()); 322 320 feature_combobox.addActionListener(new FeatureListener()); … … 349 347 editor_header_pane.add(editor_label); 350 348 editor_header_pane.add(new JPanel()); 351 //editor_header_pane.add(reset_button);352 349 353 350 variable_pane.setBorder(BorderFactory.createEmptyBorder(2,0,2,0)); … … 372 369 button_pane.add(remove_button); 373 370 374 center_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder( get("CDM.FormatManager.Editing_Controls")), BorderFactory.createEmptyBorder(2,2,2,2)));371 center_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("CDM.FormatManager.Editing_Controls")), BorderFactory.createEmptyBorder(2,2,2,2))); 375 372 center_pane.setLayout(new BorderLayout()); 376 373 center_pane.add(selection_pane, BorderLayout.NORTH); … … 742 739 } 743 740 } 744 745 // private class ResetListener746 // implements ActionListener {747 748 // public void actionPerformed(ActionEvent event) {749 // /** @todo **/750 // }751 // }752 741 } 753 742 -
trunk/gli/src/org/greenstone/gatherer/cdm/Index.java
r5375 r5590 38 38 import org.greenstone.gatherer.util.Utility; 39 39 import org.w3c.dom.*; 40 40 41 /** This class encapsulates a single indexing pair. 41 42 * @author John Thompson, Greenstone Digital Library, University of Waikato -
trunk/gli/src/org/greenstone/gatherer/cdm/IndexManager.java
r5536 r5590 82 82 Gatherer.println(" + " + levels_model.getSize() + " levels parsed."); 83 83 } 84 84 85 /** Method to add a new index. 85 86 * @param index The <strong>Index</strong> to add. … … 570 571 JLabel name_label = new JLabel(); 571 572 name_label.setPreferredSize(Utility.LABEL_SIZE); 572 Dictionary.registerText(name_label, "CDM.IndexManager. Name");573 Dictionary.registerText(name_label, "CDM.IndexManager.Index_Name"); 573 574 name_textfield = new JTextField(); 575 Dictionary.registerTooltip(name_textfield, "CDM.IndexManager.Index_Name_Tooltip"); 574 576 575 577 JPanel source_pane = new JPanel(); … … 578 580 Dictionary.registerText(source_label, "CDM.IndexManager.Source"); 579 581 source_list = new CheckList(new_data, false); 582 Dictionary.registerTooltip(source_list, "CDM.IndexManager.Source_Tooltip"); 580 583 581 584 JPanel level_pane = new JPanel(); … … 588 591 level_combobox.addItem(Dictionary.newget("CDM.IndexManager.Section")); 589 592 level_combobox.setEditable(false); 593 Dictionary.registerTooltip(level_combobox, "CDM.IndexManager.Level_Tooltip"); 590 594 591 595 JPanel button_pane = new JPanel(); … … 593 597 add_button.setEnabled(false); 594 598 add_button.setMnemonic(KeyEvent.VK_A); 595 Dictionary.registerBoth(add_button, "CDM.IndexManager.Add ", "CDM.IndexManager.Add_Tooltip");599 Dictionary.registerBoth(add_button, "CDM.IndexManager.Add_Index", "CDM.IndexManager.Add_Index_Tooltip"); 596 600 set_default_button = new JButton(); 597 601 set_default_button.setEnabled(false); … … 601 605 remove_button.setEnabled(false); 602 606 remove_button.setMnemonic(KeyEvent.VK_R); 603 Dictionary.registerBoth(remove_button, "CDM.IndexManager.Remove ", "CDM.IndexManager.Remove_Tooltip");607 Dictionary.registerBoth(remove_button, "CDM.IndexManager.Remove_Index", "CDM.IndexManager.Remove_Index_Tooltip"); 604 608 605 609 // This class is getting a little crowded, so I'll generate the many mgpp controls in a inner class. … … 954 958 index_name_label = new JLabel(); 955 959 index_name_label.setPreferredSize(LABEL_SIZE); 956 Dictionary.registerText(index_name_label, "CDM.IndexManager. MGPP.Index_Name");960 Dictionary.registerText(index_name_label, "CDM.IndexManager.Index_Name"); 957 961 958 962 index_name_field = new JTextField(); 959 Dictionary.registerTooltip(index_name_field, "CDM.IndexManager. MGPP.Index_Name_Tooltip");963 Dictionary.registerTooltip(index_name_field, "CDM.IndexManager.Index_Name_Tooltip"); 960 964 961 965 JPanel index_panel = new JPanel(); … … 978 982 add_index_button.setEnabled(false); 979 983 add_index_button.setMnemonic(KeyEvent.VK_A); 980 Dictionary.registerBoth(add_index_button, "CDM.IndexManager. MGPP.Add_Index", "CDM.IndexManager.MGPP.Add_Index_Tooltip");984 Dictionary.registerBoth(add_index_button, "CDM.IndexManager.Add_Index", "CDM.IndexManager.Add_Index_Tooltip"); 981 985 982 986 add_all_button = new JButton(); … … 993 997 remove_index_button.setEnabled(false); 994 998 remove_index_button.setMnemonic(KeyEvent.VK_A); 995 Dictionary.registerBoth(remove_index_button, "CDM.IndexManager. MGPP.Remove_Index", "CDM.IndexManager.MGPP.Remove_Index_Tooltip");999 Dictionary.registerBoth(remove_index_button, "CDM.IndexManager.Remove_Index", "CDM.IndexManager.Remove_Index_Tooltip"); 996 1000 997 1001 JPanel index_empty_panel = new JPanel(); … … 1095 1099 JPanel level_panel = new JPanel(); 1096 1100 1097 level_label = new JLabel( "CDM.IndexManager.MGPP.Level");1101 level_label = new JLabel(); 1098 1102 level_label.setPreferredSize(LABEL_SIZE); 1099 1103 Dictionary.registerText(level_label, "CDM.IndexManager.MGPP.Level"); … … 1105 1109 level_combobox.setTextNonSelectionColor(Gatherer.config.getColor("coloring.workspace_tree_foreground", false)); 1106 1110 level_combobox.setTextSelectionColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false)); 1107 Dictionary.registerTooltip(level_combobox, "CDM.IndexManager. MGPP.Level_Tooltip");1111 Dictionary.registerTooltip(level_combobox, "CDM.IndexManager.Level_Tooltip"); 1108 1112 1109 1113 JPanel level_button_panel = new JPanel(); … … 1578 1582 } 1579 1583 } 1580 1581 -
trunk/gli/src/org/greenstone/gatherer/cdm/Language.java
r4932 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 08/05/02 … … 36 37 import org.greenstone.gatherer.msm.MSMUtils; 37 38 import org.w3c.dom.*; 39 38 40 /** A pretty unexciting extension of a two character string, in that it has a field which details if its the default language. 39 41 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 140 142 } 141 143 } 142 143 144 145 146 -
trunk/gli/src/org/greenstone/gatherer/cdm/LanguageListCellRenderer.java
r4932 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 11/07/03 … … 33 34 import javax.swing.*; 34 35 import org.greenstone.gatherer.cdm.CollectionDesignManager; 35 import org.greenstone.gatherer.cdm.LanguageManager; 36 36 37 /** Provides a renderer which transforms a language code (such as en or fr) into its appropriate name (English and French respectively) before generating the rubberstamping component. */ 37 38 public class LanguageListCellRenderer -
trunk/gli/src/org/greenstone/gatherer/cdm/LanguageManager.java
r5342 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 08/05/02 … … 37 38 import javax.swing.*; 38 39 import javax.swing.event.*; 40 import org.greenstone.gatherer.Dictionary; 39 41 import org.greenstone.gatherer.Gatherer; 40 42 import org.greenstone.gatherer.cdm.CollectionConfiguration; … … 45 47 import org.greenstone.gatherer.cdm.LanguageListCellRenderer; 46 48 import org.w3c.dom.*; 49 47 50 /** This class manages the language commands, remembering both a list of languages to build indexes in, plus the default language. 48 51 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 224 227 } 225 228 226 /** Overloaded to call get with both a key and an empty argument array.227 * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.228 * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.229 */230 private String get(String key) {231 if(key.indexOf('.') == -1) {232 key = "CDM.LanguageManager." + key;233 }234 return Gatherer.dictionary.get(key, (String[])null);235 }236 229 237 230 /** This class represents the visual component of the Language Manager. */ … … 269 262 JPanel center_panel = new JPanel(); 270 263 271 JLabel language_list_label = new JLabel( get("CDM.LanguageManager.Assigned_Languages"));272 264 JLabel language_list_label = new JLabel(); 265 Dictionary.registerText(language_list_label, "CDM.LanguageManager.Assigned_Languages"); 273 266 language_list = new JList(model); 274 267 … … 277 270 JPanel default_panel = new JPanel(); 278 271 279 JLabel default_label = new JLabel( get("CDM.LanguageManager.Default_Language"));272 JLabel default_label = new JLabel(); 280 273 default_label.setBorder(BorderFactory.createEmptyBorder(0,0,0,5)); 281 274 default_label.setPreferredSize(LABEL_SIZE); 275 Dictionary.registerText(default_label, "CDM.LanguageManager.Default_Language"); 282 276 283 277 if(default_language == null) { … … 289 283 default_language_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 290 284 default_language_field.setEditable(false); 291 292 285 JPanel control_panel = new JPanel(); 293 286 294 JLabel selector_label = new JLabel( get("CDM.LanguageManager.Selector"));287 JLabel selector_label = new JLabel(); 295 288 selector_label.setPreferredSize(LABEL_SIZE); 289 Dictionary.registerText(selector_label, "CDM.LanguageManager.Selector"); 296 290 297 291 selector_combobox = new JComboBox(getLanguageCodes().toArray()); 298 292 selector_combobox.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 299 293 selector_combobox.setRenderer(new LanguageListCellRenderer()); 294 Dictionary.registerTooltip(selector_combobox, "CDM.LanguageManager.Selector_Tooltip"); 300 295 301 296 JPanel button_panel = new JPanel(); 302 297 303 add_button = new JButton( get("CDM.LanguageManager.Add"));298 add_button = new JButton(); 304 299 add_button.setMnemonic(KeyEvent.VK_A); 305 306 remove_button = new JButton(get("CDM.LanguageManager.Remove")); 300 Dictionary.registerBoth(add_button, "CDM.LanguageManager.Add", "CDM.LanguageManager.Add_Tooltip"); 301 302 remove_button = new JButton(); 307 303 remove_button.setMnemonic(KeyEvent.VK_R); 308 304 remove_button.setEnabled(false); 309 310 clear_button = new JButton(get("CDM.LanguageManager.Clear_Default")); 305 Dictionary.registerBoth(remove_button, "CDM.LanguageManager.Remove", "CDM.LanguageManager.Remove_Tooltip"); 306 307 clear_button = new JButton(); 311 308 clear_button.setMnemonic(KeyEvent.VK_C); 312 309 clear_button.setEnabled(false); 313 314 set_button = new JButton(get("CDM.LanguageManager.Set_Default")); 310 Dictionary.registerBoth(clear_button, "CDM.LanguageManager.Clear_Default", "CDM.LanguageManager.Clear_Default_Tooltip"); 311 312 set_button = new JButton(); 315 313 set_button.setMnemonic(KeyEvent.VK_S); 316 314 set_button.setEnabled(false); 315 Dictionary.registerBoth(set_button, "CDM.LanguageManager.Set_Default", "CDM.LanguageManager.Set_Default_Tooltip"); 317 316 318 317 // Set up and connect listeners. … … 323 322 set_button.addActionListener(new SetDefaultListener()); 324 323 language_list.addListSelectionListener(new ListListener()); 325 // Layout components. 324 325 // Layout components 326 326 default_panel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(), BorderFactory.createEmptyBorder(2,0,2,2))); 327 327 default_panel.setLayout(new BorderLayout()); … … 355 355 add(button_panel, BorderLayout.SOUTH); 356 356 } 357 357 358 /** Destructor. */ 358 359 public void destroy() { … … 466 467 } 467 468 } 468 469 470 471 472 473 474 -
trunk/gli/src/org/greenstone/gatherer/cdm/Level.java
r5255 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 16/07/03 … … 35 36 import org.greenstone.gatherer.cdm.DOMProxyListEntry; 36 37 import org.w3c.dom.*; 38 37 39 /** This class represents a single search type setting which means that, at the moment, it is either based on an Content element containing the string 'plain' or one on the string 'form'. The ordering of these elements within the Level element is important. 38 40 * @author John Thompson, Greenstone Digital Library, University of Waikato -
trunk/gli/src/org/greenstone/gatherer/cdm/MetadataSetView.java
r5350 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 import java.awt.*; 29 30 import java.util.*; 30 31 import javax.swing.*; 31 32 import javax.swing.event.*; 33 import org.greenstone.gatherer.Dictionary; 32 34 import org.greenstone.gatherer.Gatherer; 33 35 import org.greenstone.gatherer.cdm.CollectionDesignManager; … … 39 41 import org.greenstone.gatherer.msm.MSMListener; 40 42 import org.w3c.dom.*; 43 41 44 /** Unlike its namesake in the msm package, this class really only knows how to produce a simple visual representation of the currently imported metadata sets. It is also read-only, so should be fairly straight forward. (It has no namesake any longer as my co-programmers found this far too confusing - however I have now added a CollectionConfiguration to the cdm package just to keep them on their toes!) 42 45 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 51 54 /** A reference to ourselves so our inner classes can refer to us. */ 52 55 private DynamicListModel model = null; 56 53 57 /** Constructor. 54 58 */ … … 61 65 controls = new MetadataSetControl(); 62 66 } 67 63 68 /** Destructor. Remove any references of this class from persistant objects. 64 65 66 67 69 * @see org.greenstone.gatherer.Gatherer 70 * @see org.greenstone.gatherer.collection.CollectionManager 71 * @see org.greenstone.gatherer.msm.MetadataSetManager 72 */ 68 73 public void destroy() { 69 74 controls.destroy(); … … 72 77 model = null; 73 78 } 79 74 80 /** Called when an element is changed within a set in the MSM, prompting us to refresh our list of elements being shown. 75 81 * @param event A <strong>MSMEvent</strong> which encapsulates relevant data about the change. … … 80 86 ((MetadataSetControl)controls).refreshElementList(); 81 87 } 88 82 89 /** A method for retrieve the controls for this manager. 83 90 * @see org.greenstone.gatherer.Dictionary … … 88 95 return controls; 89 96 } 97 90 98 /** Called when a metadata value has undergone significant change. 91 99 * @param event A <strong>MSMEvent</strong> which encapsulates relevant data about the change. … … 94 102 // Couldn't care less. 95 103 } 104 96 105 /** Called when a set is added or removed from the MSM. 97 106 * @param event A <strong>MSMEvent</strong> which encapsulates relevant data about the change. … … 102 111 loadMetadataSets(); 103 112 } 113 104 114 /** Select the selected element, given its name, and return the bounds of the selection. Used during search and replace. 105 115 * @param element The elements fully qualified name as a <strong>String</strong>. … … 110 120 return ((MetadataSetControl)controls).setSelectedElement(element); 111 121 } 122 112 123 /** Prints out the contents of this manager, as they would appear in the collection configuration file. 113 124 * @return A <strong>String</strong> containing a block of commands. … … 123 134 return text; 124 135 } 136 125 137 /** Called when a significant change has occured to a value tree for a certain element, however we take no further action. 126 138 * @param event A <strong>MSMEvent</strong> containing information relevant to the event. … … 128 140 public void valueChanged(MSMEvent event) { 129 141 } 130 /** Method to retrieve a phrase from the dictionary based on a key. 131 * @param key A <strong>String</strong> used to find the correct phrase. 132 * @param args A <strong>String[]</strong> of arguments used in formatting and filling out the phrase. 133 * @return A <strong>String</strong> containing the correct phrase with the correct formatting. 134 */ 135 private String get(String key) { 136 return get(key, null); 137 } 138 /** Method to retrieve a phrase from the dictionary based on a key. 139 * @param key A <strong>String</strong> used to find the correct phrase. 140 * @return A <strong>String</strong> containing the correct phrase with the correct formatting. 141 * @see org.greenstone.gatherer.Dictionary 142 * @see org.greenstone.gatherer.Gatherer 143 */ 144 private String get(String key, String args[]) { 145 if(key.indexOf(".") == -1) { 146 key = "CDM.MetadataSetManager." + key; 147 } 148 return Gatherer.dictionary.get(key, args); 149 } 142 150 143 /** Retrieves the current list of loaded metadata sets, and builds a list model around them. 151 144 * @see org.greenstone.gatherer.Gatherer … … 162 155 } 163 156 } 157 164 158 /** This class creates and lays-out the various controls for reviewing the metadata sets, and their commands as they would appear in the collection configuration file. */ 165 159 private class MetadataSetControl … … 188 182 /** The element model for the currently selected set. */ 189 183 private Vector element_model = null; 184 190 185 /* Constructor. 191 186 * @see org.greenstone.gatherer.Coloring; … … 195 190 */ 196 191 public MetadataSetControl() { 197 192 // Create visual components 198 193 central_pane = new JPanel(); 199 element_label = new JLabel( get("CDM.MetadataSetManager.Elements"));194 element_label = new JLabel(); 200 195 element_label.setHorizontalAlignment(JLabel.CENTER); 201 196 element_label.setOpaque(true); 197 Dictionary.setText(element_label, "CDM.MetadataSetManager.Elements"); 202 198 element_list = new JList(); 203 199 element_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 204 200 element_pane = new JPanel(); 205 201 header_pane = new JPanel(); 206 instructions = new JTextArea( get("CDM.MetadataSetManager.Instructions"));202 instructions = new JTextArea(); 207 203 instructions.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 208 204 instructions.setEditable(false); … … 210 206 instructions.setRows(6); 211 207 instructions.setWrapStyleWord(true); 212 set_label = new JLabel(get("CDM.MetadataSetManager.Sets")); 208 Dictionary.registerText(instructions, "CDM.MetadataSetManager.Instructions"); 209 set_label = new JLabel(); 213 210 set_label.setHorizontalAlignment(JLabel.CENTER); 214 211 set_label.setOpaque(true); 212 Dictionary.registerText(set_label, "CDM.MetadataSetManager.Sets"); 215 213 set_list = new JList(model); 216 214 set_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 217 215 set_pane = new JPanel(); 218 title = new JLabel( get("CDM.MetadataSetManager.Title"));216 title = new JLabel(); 219 217 title.setHorizontalAlignment(JLabel.CENTER); 220 218 title.setOpaque(true); 221 // Add listeners 219 Dictionary.registerText(title, "CDM.MetadataSetManager.Title"); 220 221 // Add listeners 222 222 set_list.addListSelectionListener(new ListListener()); 223 // Layout 223 224 // Layout 224 225 instructions.setBorder(BorderFactory.createEmptyBorder(2,5,2,5)); 225 226 … … 253 254 } 254 255 /** Select the selected element, given its name, and return the bounds of the selection. Used during search and replace. 255 256 257 258 259 256 * @param element The elements fully qualified name as a <strong>String</strong>. 257 * @return The bounds of the selection as a <strong>Rectangle</strong>. 258 * @see org.greenstone.gatherer.cdm.MetadataSetManager.Control 259 * @see org.greenstone.gatherer.cdm.MetadataSetManager.Control.ElementWrapper 260 */ 260 261 public Rectangle setSelectedElement(String element) { 261 262 Rectangle bounds = null; 262 263 // Parse off namespace 263 264 String namespace = element.substring(0, element.indexOf(".")); 264 265 // Force the set list to show the correct entry. 265 266 ListModel s_model = set_list.getModel(); 266 267 for(int i = 0; i < s_model.getSize(); i++) { … … 270 271 } 271 272 } 272 273 // Force the element list to show that name. 273 274 ListModel e_model = element_list.getModel(); 274 275 for(int i = 0; i < e_model.getSize(); i++) { … … 279 280 } 280 281 } 281 282 // Return the bounds of the selected row. 282 283 return bounds; 283 284 } 285 284 286 /** Overriden to ensure the instruction area is scrolled to top. 285 287 */ 286 288 public void gainFocus() { 287 289 if(instructions != null) { … … 309 311 } 310 312 } 313 311 314 /** Provides a convience wrapper around a metadata set, that allows it to appear in the <strong>JList</strong> the same way it would in the collection configuration file. */ 312 315 private class SetWrapper { … … 320 323 public String toString() { 321 324 String namespace = set.getNamespace(); 322 325 // Watch out for the greenstone set, with its namespace of "" 323 326 if(namespace == null || namespace.length() == 0) { 324 327 namespace = "greenstone"; -
trunk/gli/src/org/greenstone/gatherer/cdm/ParsingProgress.java
r4675 r5590 35 35 *######################################################################## 36 36 */ 37 package org.greenstone.gatherer.cdm; 37 38 38 39 40 41 42 43 package org.greenstone.gatherer.cdm;44 39 /************************************************************************************** 45 40 * Title: Gatherer … … 51 46 * 17/11/02 - Commented 52 47 **************************************************************************************/ 53 import java.awt.BorderLayout; 54 import java.awt.Dimension; 55 import java.awt.Toolkit; 56 import javax.swing.BorderFactory; 57 import javax.swing.JDialog; 58 import javax.swing.JLabel; 59 import javax.swing.JPanel; 60 import javax.swing.JProgressBar; 48 import java.awt.*; 49 import javax.swing.*; 50 61 51 /** This class provides a progress bar to be displayed whenever the module must reload the plugin and classifier information, either automatically or if the user indicates a reload is needed. 62 52 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 71 61 /** The default size of the progress dialog. */ 72 62 static final Dimension SIZE = new Dimension(400,75); 63 73 64 /** Constructor. 74 65 * @param title The title to show on the dialog, as a <strong>String</strong>. 75 66 * @param message The message to show on the dialog, as a <strong>String</strong>. 76 67 * @param max The total number of plugins/classifiers that have to be parsed before the progress bar can be disposed of, as an <i>int</i>. 77 68 */ 78 69 public ParsingProgress(String title, String message, int max) { 79 70 super(); … … 81 72 this.setSize(SIZE); 82 73 this.setTitle(title); 74 83 75 // Creation 84 76 this.content_pane = (JPanel) getContentPane(); 85 77 this.progress = new JProgressBar(); 86 78 this.progress.setMaximum(max); 79 87 80 // Layout 88 81 this.content_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); … … 90 83 this.content_pane.add(new JLabel(message), BorderLayout.NORTH); 91 84 this.content_pane.add(progress, BorderLayout.CENTER); 85 92 86 // Center and display 93 87 Dimension screen_size = Toolkit.getDefaultToolkit().getScreenSize(); … … 96 90 show(); 97 91 } 92 98 93 public void destroy() { 99 94 } 95 100 96 /** Method which increments the progress count by one, which should be called after every successful parsing of a classifier or plugin. 101 97 */ 102 98 public void inc() { 103 99 progress.setValue(progress.getValue() + 1); -
trunk/gli/src/org/greenstone/gatherer/cdm/PlugIn.java
r5207 r5590 35 35 import org.greenstone.gatherer.util.StaticStrings; 36 36 import org.w3c.dom.*; 37 37 38 /** This class is responsible for storing information from a parsed pluginfo call in such a way that it allows easy access to parsed details for the purposes of user design and specification of plugins. */ 38 39 public class PlugIn … … 372 373 } 373 374 } 374 375 -
trunk/gli/src/org/greenstone/gatherer/cdm/PlugInManager.java
r5536 r5590 42 42 import org.greenstone.gatherer.cdm.CommandTokenizer; 43 43 import org.greenstone.gatherer.cdm.Control; 44 import org.greenstone.gatherer.cdm.DynamicListModel;45 44 import org.greenstone.gatherer.cdm.PlugIn; 46 45 import org.greenstone.gatherer.gui.DoubleImageButton; … … 75 74 separator = getSeparator(); 76 75 } 76 77 77 /** Method to add a new plugin to the library 78 78 * @param plugin the new base PlugIn … … 388 388 389 389 /** Method to initially load information from the standard plug-ins within the gsdl Perl library. 390 390 */ 391 391 private void loadPlugIns() { 392 392 // Attempt to restore the cached file. … … 407 407 } 408 408 /** Method to load plug-in information from a specified directory. Of course no plug-ins may be found at this location. 409 410 409 * @param directory A <strong>File</strong> indicating the directory to be scanned for plug-ins. 410 */ 411 411 private void loadPlugIns(File directory) { 412 412 File files[] = directory.listFiles(); -
trunk/gli/src/org/greenstone/gatherer/cdm/SearchType.java
r5037 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 16/07/03 … … 35 36 import org.greenstone.gatherer.cdm.DOMProxyListEntry; 36 37 import org.w3c.dom.*; 38 37 39 /** This class represents a single search type setting which means that, at the moment, it is either based on an Content element containing the string 'plain' or one on the string 'form'. The ordering of these elements within the SearchType element is important. 38 40 * @author John Thompson, Greenstone Digital Library, University of Waikato -
trunk/gli/src/org/greenstone/gatherer/cdm/SearchTypeManager.java
r5536 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 16/07/03 … … 47 48 import org.greenstone.gatherer.util.Utility; 48 49 import org.w3c.dom.*; 50 49 51 /** This class maintains an ordered list of the search types available in the collection (MGPP command available in G2.39 or later). Currently only 'form' and 'plain' are valid. 50 52 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 54 56 extends DOMProxyListModel { 55 57 56 static final public String[] SEARCH_TYPES = {"form", "plain"}; 57 58 static final public String[] SEARCH_TYPES = { "form", "plain" }; 58 59 59 60 /** The controls used to edit the search types. */ -
trunk/gli/src/org/greenstone/gatherer/cdm/Subcollection.java
r5235 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 03/05/02 … … 40 41 import org.greenstone.gatherer.util.Troolean; 41 42 import org.w3c.dom.*; 43 42 44 /** This class encapsulates one subcollection entry in the collection configuration file. 43 45 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 258 260 } 259 261 } 260 261 262 263 264 -
trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndex.java
r5255 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 04/07/03 … … 40 41 import org.greenstone.gatherer.util.Utility; 41 42 import org.w3c.dom.*; 43 42 44 /** This class encapsulates a single indexing pair. 43 45 * @author John Thompson, Greenstone Digital Library, University of Waikato -
trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndexManager.java
r5342 r5590 32 32 import javax.swing.*; 33 33 import javax.swing.event.*; 34 import org.greenstone.gatherer.Dictionary; 34 35 import org.greenstone.gatherer.Gatherer; 35 36 import org.greenstone.gatherer.cdm.CollectionConfiguration; … … 147 148 } 148 149 } 150 149 151 /** Method to remove all of the subindexes that contain a certain subcollection. 150 152 * @param sub the Subcollection that has been removed … … 166 168 167 169 /** Method to set the default subcollection index. 168 169 170 171 170 * @param subcollection The <strong>Subcollection</strong> to use as the default index. 171 * @see org.greenstone.gatherer.Gatherer 172 * @see org.greenstone.gatherer.collection.CollectionManager 173 */ 172 174 public void setDefaultSubcollectionIndex(SubcollectionIndex index) { 173 175 if(index != null) { … … 195 197 } 196 198 197 /** Method to retrieve a phrase from the dictionary based on a key.198 * @param key A <strong>String</strong> used to find the correct phrase.199 * @param args A <strong>String[]</strong> of arguments used in formatting and filling out the phrase.200 * @return A <strong>String</strong> containing the correct phrase with the correct formatting.201 */202 private String get(String key) {203 if(key.indexOf(".") == -1) {204 key = "CDM.SubcollectionIndexManager." + key;205 }206 return Gatherer.dictionary.get(key);207 }208 209 199 private class SubcollectionIndexControl 210 200 extends JPanel … … 225 215 JPanel subcollection_panel = new JPanel(); 226 216 JPanel subindex_name_panel = new JPanel(); 227 JLabel subindex_name_label = new JLabel(get("CDM.SubcollectionIndexManager.PartitionName")); 217 JLabel subindex_name_label = new JLabel(); 218 Dictionary.registerText(subindex_name_label, "CDM.SubcollectionIndexManager.PartitionName"); 228 219 subcollectionindex_name_field = new JTextField(); 229 230 add_index_button = new JButton(get("CDM.SubcollectionIndexManager.Add_Subindex")); 220 Dictionary.registerTooltip(subcollectionindex_name_field, "CDM.SubcollectionIndexManager.PartitionName_Tooltip"); 221 222 JPanel button_pane = new JPanel(); 223 224 add_index_button = new JButton(); 231 225 add_index_button.setMnemonic(KeyEvent.VK_A); 232 226 add_index_button.setEnabled(false); 233 234 JPanel button_pane = new JPanel(); 235 236 clear_default_button = new JButton(get("CDM.SubcollectionIndexManager.Clear_Default_Subindex")); 227 Dictionary.registerBoth(add_index_button, "CDM.SubcollectionIndexManager.Add_Subindex", "CDM.SubcollectionIndexManager.Add_Subindex_Tooltip"); 228 229 clear_default_button = new JButton(); 237 230 clear_default_button.setMnemonic(KeyEvent.VK_C); 238 231 clear_default_button.setEnabled(default_index != null); 239 240 JLabel default_label = new JLabel(get("CDM.SubcollectionIndexManager.Default_Subindex")); 232 Dictionary.registerBoth(clear_default_button, "CDM.SubcollectionIndexManager.Clear_Default_Subindex", "CDM.SubcollectionIndexManager.Clear_Default_Subindex_Tooltip"); 233 234 JLabel default_label = new JLabel(); 241 235 default_label.setPreferredSize(Utility.LABEL_SIZE); 236 Dictionary.registerText(default_label, "CDM.SubcollectionIndexManager.Default_Subindex"); 237 242 238 JPanel default_pane = new JPanel(); 243 239 if(default_index == null) { … … 249 245 default_value_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 250 246 default_value_field.setEditable(false); 251 remove_index_button = new JButton(get("CDM.SubcollectionIndexManager.Remove_Subindex")); 247 248 remove_index_button = new JButton(); 252 249 remove_index_button.setMnemonic(KeyEvent.VK_R); 253 250 remove_index_button.setEnabled(false); 254 set_default_button = new JButton(get("CDM.SubcollectionIndexManager.Set_Default_Subindex")); 251 Dictionary.registerBoth(remove_index_button, "CDM.SubcollectionIndexManager.Remove_Subindex", "CDM.SubcollectionIndexManager.Remove_Subindex_Tooltip"); 252 253 set_default_button = new JButton(); 255 254 set_default_button.setMnemonic(KeyEvent.VK_S); 256 255 set_default_button.setEnabled(false); 257 JLabel subcollection_label = new JLabel(get("CDM.SubcollectionIndexManager.Subcollection")); 256 Dictionary.registerBoth(set_default_button, "CDM.SubcollectionIndexManager.Set_Default_Subindex", "CDM.SubcollectionIndexManager.Set_Default_Subindex_Tooltip"); 257 258 JLabel subcollection_label = new JLabel(); 259 Dictionary.registerText(subcollection_label, "CDM.SubcollectionIndexManager.Subcollection"); 258 260 subcollection_list = new JList(CollectionDesignManager.subcollection_manager); 259 261 JPanel list_pane = new JPanel(); 260 JLabel subindexes_label = new JLabel(get("CDM.SubcollectionIndexManager.Subindexes")); 262 JLabel subindexes_label = new JLabel(); 263 Dictionary.registerText(subcollection_label, "CDM.SubcollectionIndexManager.Subindexes"); 261 264 subcollectionindexes_list = new JList(model); 262 265 subcollectionindexes_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); … … 276 279 subcollectionindex_name_field.getDocument().addDocumentListener(new SubcollectionIndexListener()); 277 280 subcollection_list.addListSelectionListener(new SubcollectionIndexListener()); 278 279 JPanel temp_pane = new JPanel();280 281 281 282 // Layout 282 283 283 default_label.setBorder(BorderFactory.createEmptyBorder(0,0,0,5)); 284 284 … … 313 313 //subcollection_panel.add(subindex_name_panel, BorderLayout.NORTH); 314 314 subcollection_panel.add(list_pane, BorderLayout.CENTER); 315 //subcollection_panel.add(button_pane, BorderLayout.SOUTH);316 315 subcollection_panel.add(button_pane, BorderLayout.SOUTH); 317 316 -
trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionManager.java
r5342 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: ??/??/02 … … 35 36 import javax.swing.*; 36 37 import javax.swing.event.*; 38 import org.greenstone.gatherer.Dictionary; 37 39 import org.greenstone.gatherer.Gatherer; 38 40 import org.greenstone.gatherer.cdm.CollectionConfiguration; … … 48 50 import org.greenstone.gatherer.util.Utility; 49 51 import org.w3c.dom.*; 52 50 53 /** This class maintains a list of subcollections within our collection. 51 54 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 153 156 } 154 157 155 /** Method to retrieve a phrase from the dictionary based on a key.156 * @param key A <strong>String</strong> used to find the correct phrase.157 * @param args A <strong>String[]</strong> of arguments used in formatting and filling out the phrase.158 * @return A <strong>String</strong> containing the correct phrase with the correct formatting.159 */160 private String get(String key) {161 if(key.indexOf(".") == -1) {162 key = CLASS_DICTIONARY_NAME + key;163 }164 return Gatherer.dictionary.get(key);165 }166 167 158 /** This class creates a JPanel containing serveral more controls used for editing subcollection information. */ 168 159 private class SubcollectionControl … … 188 179 JPanel border_pane = new JPanel(); 189 180 JPanel header_pane = new JPanel(); 190 instructions_area = new JTextArea( get("CDM.SubcollectionManager.Instructions"));181 instructions_area = new JTextArea(); 191 182 instructions_area.setEditable(false); 192 183 instructions_area.setLineWrap(true); 193 184 instructions_area.setRows(6); 194 185 instructions_area.setWrapStyleWord(true); 186 Dictionary.registerText(instructions_area, "CDM.SubcollectionManager.Instructions"); 187 195 188 tabbed_pane = new JTabbedPane(); 196 JLabel title = new JLabel( get("CDM.SubcollectionManager.Title"));189 JLabel title = new JLabel(); 197 190 title.setHorizontalAlignment(JLabel.CENTER); 198 191 Dictionary.registerText(title, "CDM.SubcollectionManager.Title"); 192 199 193 JPanel button_pane_3 = new JPanel(); 200 add_button = new JButton( get("CDM.SubcollectionManager.Add"));194 add_button = new JButton(); 201 195 add_button.setMnemonic(KeyEvent.VK_A); 202 196 add_button.setEnabled(false); 203 remove_button = new JButton(get("CDM.SubcollectionManager.Remove")); 197 Dictionary.registerBoth(add_button, "CDM.SubcollectionManager.Add", "CDM.SubcollectionManager.Add_Tooltip"); 198 remove_button = new JButton(); 204 199 remove_button.setMnemonic(KeyEvent.VK_R); 205 200 remove_button.setEnabled(false); 206 update_button = new JButton(get("CDM.SubcollectionManager.Replace")); 201 Dictionary.registerBoth(remove_button, "CDM.SubcollectionManager.Remove", "CDM.SubcollectionManager.Remove_Tooltip"); 202 update_button = new JButton(); 207 203 update_button.setMnemonic(KeyEvent.VK_U); 208 204 update_button.setEnabled(false); 205 Dictionary.registerBoth(update_button, "CDM.SubcollectionManager.Replace", "CDM.SubcollectionManager.Replace_Tooltip"); 209 206 210 207 JPanel button_pane = new JPanel(); 211 208 JPanel button_pane_1 = new JPanel(); 212 include_button = new JRadioButton( get("CDM.SubcollectionManager.Include"));209 include_button = new JRadioButton(); 213 210 include_button.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 214 211 include_button.setMnemonic(KeyEvent.VK_I); 215 212 include_button.setOpaque(false); 216 exclude_button = new JRadioButton(get("CDM.SubcollectionManager.Exclude")); 213 Dictionary.registerText(include_button, "CDM.SubcollectionManager.Include"); 214 exclude_button = new JRadioButton(); 217 215 exclude_button.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 218 216 exclude_button.setMnemonic(KeyEvent.VK_X); 219 217 exclude_button.setOpaque(false); 218 Dictionary.registerText(exclude_button, "CDM.SubcollectionManager.Exclude"); 219 220 JLabel flags_label = new JLabel(); 221 Dictionary.registerText(flags_label, "CDM.SubcollectionManager.Flags"); 220 222 flags_field = new NonWhitespaceField(); 221 JLabel flags_label = new JLabel(get("CDM.SubcollectionManager.Flags"));222 JLabel inclusive_label = new JLabel(get("CDM.SubcollectionManager.Inclusive")); 223 Dictionary.registerTooltip(flags_field, "CDM.SubcollectionManager.Flags_Tooltip"); 224 223 225 JPanel inclusive_pane = new JPanel(); 226 JLabel inclusive_label = new JLabel(); 227 Dictionary.registerText(inclusive_label, "CDM.SubcollectionManager.Inclusive"); 228 229 JLabel match_label = new JLabel(); 230 Dictionary.registerText(match_label, "CDM.SubcollectionManager.Match"); 224 231 match_field = new JTextField(); 225 JLabel match_label = new JLabel(get("CDM.SubcollectionManager.Match")); 232 Dictionary.registerTooltip(match_field, "CDM.SubcollectionManager.Match_Tooltip"); 233 234 JLabel name_label = new JLabel(); 235 Dictionary.registerText(name_label, "CDM.SubcollectionManager.Name"); 226 236 name_field = new NonWhitespaceField(); 227 JLabel name_label = new JLabel(get("CDM.SubcollectionManager.Name")); 237 Dictionary.registerTooltip(name_field, "CDM.SubcollectionManager.Name_Tooltip"); 238 239 JLabel source_label = new JLabel(); 240 Dictionary.registerText(source_label, "CDM.SubcollectionManager.Source"); 228 241 Vector source_model = Gatherer.c_man.getCollection().msm.getAssignedElements(); 229 242 source_model.add(0, StaticStrings.FILENAME_STR); 230 243 source_combobox = new JComboBox(source_model); 231 JLabel source_label = new JLabel(get("CDM.SubcollectionManager.Source")); 244 Dictionary.registerTooltip(source_combobox, "CDM.SubcollectionManager.Source_Tooltip"); 245 232 246 subcollection_list = new JList(model); 233 247 subcollection_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); … … 238 252 include_button.setSelected(true); 239 253 JPanel subcollection_list_pane = new JPanel(); 240 JLabel subcollection_list_label = new JLabel(get("CDM.SubcollectionManager.Assigned")); 254 JLabel subcollection_list_label = new JLabel(); 255 Dictionary.registerText(subcollection_list_label, "CDM.SubcollectionManager.Assigned"); 241 256 242 257 // Add listeners … … 296 311 subcollection_pane.add(button_pane, BorderLayout.SOUTH); 297 312 298 tabbed_pane.addTab( get("CDM.SubcollectionManager.Subcollection_Controls"), subcollection_pane);299 tabbed_pane.addTab( get("CDM.SubcollectionManager.Subindex_Controls"), (JPanel) CollectionDesignManager.subcollectionindex_manager.getControls());300 tabbed_pane.addTab( get("CDM.SubcollectionManager.Language_Controls"), (JPanel) CollectionDesignManager.language_manager.getControls());313 tabbed_pane.addTab(Dictionary.newget("CDM.SubcollectionManager.Subcollection_Controls"), subcollection_pane); 314 tabbed_pane.addTab(Dictionary.newget("CDM.SubcollectionManager.Subindex_Controls"), (JPanel) CollectionDesignManager.subcollectionindex_manager.getControls()); 315 tabbed_pane.addTab(Dictionary.newget("CDM.SubcollectionManager.Language_Controls"), (JPanel) CollectionDesignManager.language_manager.getControls()); 301 316 302 317 border_pane.setBorder(BorderFactory.createEmptyBorder(0,5,5,5)); … … 509 524 } 510 525 } 511 512 513 514 515 516 517 518 519 -
trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollection.java
r4932 r5590 26 26 */ 27 27 package org.greenstone.gatherer.cdm; 28 28 29 /************************************************************************************** 29 30 * Written: 02/07/03 -
trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollectionManager.java
r5342 r5590 32 32 import javax.swing.*; 33 33 import javax.swing.event.*; 34 import org.greenstone.gatherer.Configuration;35 34 import org.greenstone.gatherer.Dictionary; 36 35 import org.greenstone.gatherer.Gatherer; … … 42 41 import org.greenstone.gatherer.util.Utility; 43 42 import org.w3c.dom.*; 43 44 44 /** This class contains the information about what supercollection has been specified (if any) and methods for changing this information. Note that there is a major difference between this manager and the others in that its DOM model is never used directly in any list component. It is only used to decide whether a certain entry in the actual checklist is checked. */ 45 45 public class SuperCollectionManager … … 105 105 } 106 106 107 /** Call dictionary get with just a key.108 * @param key A String which is mapped to a initial String within the ResourceBundle.109 * @return A String which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.110 */111 private String get(String key) {112 if(key.indexOf(".") == -1) {113 key = "CDM.SuperCollectionManager." + key;114 }115 return Gatherer.dictionary.get(key);116 }117 118 107 /** Provides controls for altering the SuperCollection settings. */ 119 108 private class SuperCollectionControl … … 123 112 private boolean init = true; 124 113 private CheckList collection_checklist = null; 125 //private JSplitPane center_pane;126 114 127 115 SuperCollectionControl() { … … 132 120 JPanel header_panel = new JPanel(); 133 121 134 JLabel title_label = new JLabel( get("CDM.SuperCollectionManager.Title"));122 JLabel title_label = new JLabel(); 135 123 title_label.setHorizontalAlignment(JLabel.CENTER); 136 124 title_label.setOpaque(true); 137 138 //center_pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); 139 140 JTextArea instructions = new JTextArea(get("CDM.SuperCollectionManager.Instructions")); 125 Dictionary.registerText(title_label, "CDM.SuperCollectionManager.Title"); 126 127 JTextArea instructions = new JTextArea(); 141 128 instructions.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 142 129 instructions.setCaretPosition(0); … … 145 132 instructions.setRows(6); 146 133 instructions.setWrapStyleWord(true); 134 Dictionary.registerText(instructions, "CDM.SuperCollectionManager.Instructions"); 147 135 148 136 collection_checklist = new CheckList(collection_checklist_model, false); 149 137 150 138 // Layout 151 //center_pane.setTopComponent(new JScrollPane(instructions));152 //center_pane.setBottomComponent(new JScrollPane(collection_checklist));153 139 header_panel.setBorder(BorderFactory.createEmptyBorder(0,0,5,0)); 154 140 header_panel.setLayout(new BorderLayout()); -
trunk/gli/src/org/greenstone/gatherer/cdm/TranslationView.java
r5342 r5590 38 38 import org.greenstone.gatherer.cdm.CollectionDesignManager; 39 39 import org.greenstone.gatherer.cdm.CollectionMeta; 40 import org.greenstone.gatherer.cdm.CollectionMetaManager;41 40 import org.greenstone.gatherer.cdm.Control; 42 41 import org.greenstone.gatherer.cdm.Index; 43 42 import org.greenstone.gatherer.cdm.LanguageListCellRenderer; 44 import org.greenstone.gatherer.cdm.LanguageManager;45 43 import org.greenstone.gatherer.cdm.SubcollectionIndex; 46 44 … … 75 73 } 76 74 return controls; 77 }78 79 private String get(String key) {80 if(key.indexOf(".") == -1) {81 key = "CDM.TranslationManager." + key;82 }83 return Gatherer.dictionary.get(key);84 75 } 85 76 … … 201 192 // Creation 202 193 JPanel header_panel = new JPanel(); 203 JLabel title_label = new JLabel( get("CDM.TranslationManager.Title"));194 JLabel title_label = new JLabel(); 204 195 title_label.setHorizontalAlignment(JLabel.CENTER); 205 JTextArea instruction_area = new JTextArea(get("CDM.TranslationManager.Instructions")); 196 Dictionary.registerText(title_label, "CDM.TranslationManager.Title"); 197 198 JTextArea instruction_area = new JTextArea(); 206 199 instruction_area.setEditable(false); 207 200 instruction_area.setLineWrap(true); 208 201 instruction_area.setRows(6); 209 202 instruction_area.setWrapStyleWord(true); 203 Dictionary.registerText(instruction_area, "CDM.TranslationManager.Instructions"); 210 204 211 205 JPanel center_panel = new JPanel(); … … 214 208 215 209 JPanel component_selection_panel = new JPanel(); 216 JLabel component_label = new JLabel(get("CDM.TranslationManager.Affected_Features")); 210 JLabel component_label = new JLabel(); 211 Dictionary.registerText(component_label, "CDM.TranslationManager.Affected_Features"); 217 212 features_list = new JList(getFeaturesList()); 218 213 features_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 219 214 220 215 JPanel fragment_selection_panel = new JPanel(); 221 JLabel fragment_label = new JLabel(get("CDM.TranslationManager.Assigned_Fragments")); 216 JLabel fragment_label = new JLabel(); 217 Dictionary.registerText(fragment_label, "CDM.TranslationManager.Assigned_Fragments"); 222 218 223 219 fragment_table = new JTable(fragment_table_model); … … 237 233 238 234 JPanel language_panel = new JPanel(); 239 JLabel language_label = new JLabel( get("CDM.TranslationManager.Language"));235 JLabel language_label = new JLabel(); 240 236 language_label.setPreferredSize(LABEL_SIZE); 237 Dictionary.registerText(language_label, "CDM.TranslationManager.Language"); 241 238 language_combobox = new JComboBox(CollectionDesignManager.language_manager.getLanguageCodes().toArray()); 242 239 language_combobox.setRenderer(new LanguageListCellRenderer()); 240 Dictionary.registerTooltip(language_combobox, "CDM.TranslationManager.Language_Tooltip"); 243 241 244 242 JPanel default_text_panel = new JPanel(); 245 JLabel default_label = new JLabel(get("CDM.TranslationManager.Default_Text")); 243 JLabel default_label = new JLabel(); 244 Dictionary.registerText(default_label, "CDM.TranslationManager.Default_Text"); 246 245 default_area = new JTextArea(); 247 246 default_area.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); … … 251 250 252 251 JPanel translated_text_panel = new JPanel(); 253 JLabel translation_label = new JLabel(get("CDM.TranslationManager.Translation")); 252 JLabel translation_label = new JLabel(); 253 Dictionary.registerText(translation_label, "CDM.TranslationManager.Translation"); 254 254 translation_area = new JTextArea(); 255 255 translation_area.setBackground(Gatherer.config.getColor("coloring.disabled", false)); … … 257 257 translation_area.setLineWrap(true); 258 258 translation_area.setWrapStyleWord(true); 259 Dictionary.registerTooltip(translation_area, "CDM.TranslationManager.Translation_Tooltip"); 259 260 260 261 JPanel button_pane = new JPanel(); 261 add_button = new JButton( get("CDM.TranslationManager.Add"));262 add_button = new JButton(); 262 263 add_button.setEnabled(false); 263 264 add_button.setMnemonic(KeyEvent.VK_A); 264 replace_button = new JButton(get("CDM.TranslationManager.Replace")); 265 Dictionary.registerBoth(add_button, "CDM.TranslationManager.Add", "CDM.TranslationManager.Add_Tooltip"); 266 replace_button = new JButton(); 265 267 replace_button.setEnabled(false); 266 268 replace_button.setMnemonic(KeyEvent.VK_C); 267 remove_button = new JButton(get("CDM.TranslationManager.Remove")); 269 Dictionary.registerBoth(replace_button, "CDM.TranslationManager.Replace", "CDM.TranslationManager.Replace_Tooltip"); 270 remove_button = new JButton(); 268 271 remove_button.setEnabled(false); 269 272 remove_button.setMnemonic(KeyEvent.VK_R); 273 Dictionary.registerBoth(remove_button, "CDM.TranslationManager.Remove", "CDM.TranslationManager.Remove_Tooltip"); 270 274 271 275 // Connection … … 516 520 } 517 521 public String getColumnName(int column) { 518 return get("CDM.TranslationManager.Column_Name_" + column);522 return Dictionary.newget("CDM.TranslationManager.Column_Name_" + column); 519 523 } 520 524 … … 646 650 } 647 651 } 648 649 652 } 650 651 -
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r5581 r5590 46 46 import org.greenstone.gatherer.Gatherer; 47 47 import org.greenstone.gatherer.cdm.CollectionDesignManager; 48 import org.greenstone.gatherer.cdm.CommandTokenizer;49 48 import org.greenstone.gatherer.collection.Collection; 50 49 import org.greenstone.gatherer.collection.SaveCollectionTask; -
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r5581 r5590 199 199 Gatherer.c_man.saveCollection(false, false); 200 200 } 201 else if(esrc == menu_bar.file_save_as) {202 String name = JOptionPane.showInputDialog(this, "Enter new collection filename.");203 if(name != null) {204 Gatherer.c_man.saveCollectionAs(name);205 }206 }201 // else if(esrc == menu_bar.file_save_as) { 202 // String name = JOptionPane.showInputDialog(this, "Enter new collection filename."); 203 // if(name != null) { 204 // Gatherer.c_man.saveCollectionAs(name); 205 // } 206 // } 207 207 // ************* 208 208 // Edit Options. … … 507 507 } 508 508 /** This method is called when the collection is being built, and is used to disable all controls in all pane which could change the state of the collection. 509 509 */ 510 510 public void lockCollection(boolean import_stage, boolean lock) { 511 511 locked = lock; -
trunk/gli/src/org/greenstone/gatherer/gui/table/TableCellRenderer.java
r5178 r5590 35 35 *######################################################################## 36 36 */ 37 38 39 40 41 42 43 37 package org.greenstone.gatherer.gui.table; 44 38 -
trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTree.java
r5571 r5590 11 11 import javax.swing.event.*; 12 12 import javax.swing.tree.*; 13 import org.greenstone.gatherer.Dictionary; 13 14 import org.greenstone.gatherer.Gatherer; 14 15 import org.greenstone.gatherer.file.FileNode; … … 221 222 } 222 223 else { 223 String title = getSelectionCount() + " files";224 String title = getSelectionCount() + Dictionary.newget("Tree.Files"); 224 225 label = new JLabel(title, ((DefaultTreeCellRenderer)getCellRenderer()).getClosedIcon(), JLabel.CENTER); 225 226 title = null; … … 272 273 pt_last = pt; 273 274 if(!DragSource.isDragImageSupported()) { 274 275 // Erase the last ghost image and cue line 275 276 paintImmediately(ra_ghost.getBounds()); 276 277 // Remember where you are about to draw the new ghost image 277 278 ra_ghost.setRect(pt.x - group.mouse_offset.x, pt.y - group.mouse_offset.y, group.image_ghost.getWidth(), group.image_ghost.getHeight()); 278 279 // Draw the ghost image 279 280 g2.drawImage(group.image_ghost, AffineTransform.getTranslateInstance(ra_ghost.getX(), ra_ghost.getY()), null); 280 281 } … … 282 283 TreePath target_path = this.getPathForLocation(pt.x, pt.y); 283 284 if(previous_path == null || target_path != null && !target_path.equals(previous_path)) { 284 285 // Immediately clear the old cue lines. 285 286 if(upper_cue_line != null && lower_cue_line != null) { 286 287 paintImmediately(upper_cue_line.getBounds()); -
trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTreeCellRenderer.java
r5360 r5590 1 package org.greenstone.gatherer.gui.tree;2 1 /** 3 2 *######################################################################### … … 36 35 *######################################################################## 37 36 */ 37 package org.greenstone.gatherer.gui.tree; 38 38 39 import java.awt.*; 39 40 import javax.swing.*; … … 97 98 } 98 99 } 99 -
trunk/gli/src/org/greenstone/gatherer/mem/MetadataEditorManager.java
r5589 r5590 47 47 import org.greenstone.gatherer.Gatherer; 48 48 import org.greenstone.gatherer.cdm.LanguageListCellRenderer; 49 import org.greenstone.gatherer.cdm.LanguageManager;50 49 import org.greenstone.gatherer.gui.ComboArea; 51 50 import org.greenstone.gatherer.gui.GComboBox;
Note:
See TracChangeset
for help on using the changeset viewer.