- Timestamp:
- 2003-09-23T14:58:18+12:00 (21 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Dictionary.java
r5497 r5527 311 311 SwingUtilities.invokeLater(task); 312 312 } 313 313 // Register if necessary 314 314 if(!already_registered) { 315 315 put(component, args); … … 320 320 public void register(JDialog component, String[] args, boolean already_registered) { 321 321 if(component != null) { 322 322 // Determine the key 323 323 String key = ""; 324 324 if(!already_registered) { … … 328 328 key = args[args.length - 1]; 329 329 } 330 330 // Update the component using the AWTEvent queue 331 331 String value = get(key, args); 332 332 ChangeTask task = new JDialogChangeTask(component, key, value); 333 333 SwingUtilities.invokeLater(task); 334 334 // Register as necessary 335 335 if(!already_registered) { 336 336 args = ArrayTools.add(args, key); … … 342 342 public void register(JFrame component, String[] args, boolean already_registered) { 343 343 if(component != null) { 344 344 // Determine the key 345 345 String key = ""; 346 346 if(!already_registered) { … … 350 350 key = args[args.length - 1]; 351 351 } 352 352 // Update the component using the AWTEvent queue 353 353 String value = get(key, args); 354 354 ChangeTask task = new JFrameChangeTask(component, key, value); 355 355 SwingUtilities.invokeLater(task); 356 356 // Register as necessary 357 357 if(!already_registered) { 358 358 args = ArrayTools.add(args, key); … … 364 364 public void register(JLabel component, String[] args, boolean already_registered) { 365 365 if(component != null) { 366 366 // Determine the key 367 367 String key = ""; 368 368 if(!already_registered) { … … 372 372 key = args[args.length - 1]; 373 373 } 374 374 // Update the component using the AWTEvent queue 375 375 String value = get(key, args); 376 376 ChangeTask task = new JLabelChangeTask(component, key, value); 377 377 SwingUtilities.invokeLater(task); 378 378 // Register as necessary 379 379 if(!already_registered) { 380 380 args = ArrayTools.add(args, key); … … 386 386 public void register(JTabbedPane component, String[] args, boolean already_registered) { 387 387 if(component != null) { 388 388 // If not already registered then args will be null. 389 389 if(!already_registered) { 390 390 args = new String[component.getTabCount()]; 391 391 } 392 392 // Iterate through the tabbed panes tabs, updating values and recording the original key of each item in args. 393 393 for(int i = 0; i < args.length; i++) { 394 if (args[i] == null) {394 if (args[i] == null) { 395 395 args[i] = component.getTitleAt(i); 396 396 } … … 400 400 SwingUtilities.invokeLater(task); 401 401 } 402 // Register if necessary 403 if(!already_registered) { 404 put(component, args); 405 } 406 } 407 } 402 // Register if necessary 403 if(!already_registered) { 404 put(component, args); 405 } 406 } 407 } 408 408 409 /** Register a text component. */ 409 public void register(JTextComponent component, String[] args, boolean already_registered) { 410 if(component != null) { 411 // Determine the key 410 public void register(JTextComponent component, String[] args, boolean already_registered) 411 { 412 if (component != null) { 413 // Determine the key 412 414 String key = ""; 413 if (!already_registered) {415 if (!already_registered) { 414 416 key = component.getText(); 415 417 } … … 417 419 key = args[args.length - 1]; 418 420 } 419 // Update the component using the AWTEvent queue 421 422 // Update the component using the AWTEvent queue 420 423 String value = get(key, args); 421 424 String tooltip = get(key + "_Tooltip", (String[])null); 422 425 ChangeTask task = new JTextComponentChangeTask(component, key, value, tooltip); 423 426 SwingUtilities.invokeLater(task); 424 425 if (!already_registered) {427 // Register as necessary 428 if (!already_registered) { 426 429 args = ArrayTools.add(args, key); 427 430 put(component, args); … … 429 432 } 430 433 } 434 431 435 /** Register a tree component. */ 432 436 public void register(JTree component, String[] args, boolean already_registered) { 433 437 if(component != null) { 434 438 // Retrieve the tooltip using the components name 435 439 String key = component.getName(); 436 440 String tooltip = get(key + "_Tooltip", (String[])null); 437 441 ChangeTask task = new JTreeChangeTask(component, key, tooltip); 438 442 SwingUtilities.invokeLater(task); 439 443 // A tree can never be previously registered. In otherwords the keys are harvested each time. Thus for a tree to remain consistant its up to the implementer to implement DictionaryTreeNode for the tree nodes! 440 444 ArrayList nodes = new ArrayList(); 441 445 nodes.add(component.getModel().getRoot()); … … 456 460 public void register(TitledBorder component, String[] args, boolean already_registered) { 457 461 if(component != null) { 458 462 // Determine the key 459 463 String key = ""; 460 464 if(!already_registered) { … … 464 468 key = args[args.length - 1]; 465 469 } 466 470 // Update the component using the AWTEvent queue 467 471 String value = get(key, args); 468 472 ChangeTask task = new TitledBorderChangeTask(component, key, value); 469 473 SwingUtilities.invokeLater(task); 470 474 // Register as necessary 471 475 if(!already_registered) { 472 476 args = ArrayTools.add(args, key); -
trunk/gli/src/org/greenstone/gatherer/Message.java
r4675 r5527 114 114 break; 115 115 case BROWSER: 116 source_str = gatherer.dictionary.get(" Source.Browser");116 source_str = gatherer.dictionary.get("GUI.Hunt"); 117 117 break; 118 118 case MIRRORING: 119 source_str = gatherer.dictionary.get(" Source.Mirroring");119 source_str = gatherer.dictionary.get("GUI.Mirror"); 120 120 break; 121 121 case COLLECT: 122 source_str = gatherer.dictionary.get(" Source.Collect");122 source_str = gatherer.dictionary.get("GUI.Gather"); 123 123 break; 124 124 case METAEDIT: 125 source_str = gatherer.dictionary.get(" Source.MetaEdit");125 source_str = gatherer.dictionary.get("GUI.Enrich"); 126 126 break; 127 127 case BUILDING: -
trunk/gli/src/org/greenstone/gatherer/cdm/ArgumentConfiguration.java
r5342 r5527 89 89 setSize(SIZE); 90 90 setTitle(get("CDM.ArgumentConfiguration.Title")); 91 setJMenuBar(new SimpleMenuBar(" 7.0")); // can we tell whether we are doing a classifier or plugin, to make the help more specific??91 setJMenuBar(new SimpleMenuBar("designingacollection")); // can we tell whether we are doing a classifier or plugin, to make the help more specific?? 92 92 JPanel button_pane = new JPanel(); 93 93 cancel = new JButton(get("General.Cancel")); -
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r5373 r5527 51 51 import org.greenstone.gatherer.file.FileSystemModel; 52 52 import org.greenstone.gatherer.gui.LockFileDialog; 53 import org.greenstone.gatherer.gui.MetaEditPane;54 53 import org.greenstone.gatherer.gui.NewCollectionMetadataPrompt; 55 54 import org.greenstone.gatherer.msm.ElementWrapper; -
trunk/gli/src/org/greenstone/gatherer/gui/EditorDialog.java
r4675 r5527 82 82 setSize(SIZE); 83 83 setTitle(Gatherer.dictionary.get("General.Edit")); 84 setJMenuBar(new SimpleMenuBar(" 6.1"));84 setJMenuBar(new SimpleMenuBar("theenrichview")); 85 85 // Create 86 86 cancel = new JButton(Gatherer.dictionary.get("General.Cancel")); -
trunk/gli/src/org/greenstone/gatherer/gui/FileAssociationDialog.java
r5347 r5527 96 96 setSize(SIZE); 97 97 setTitle(get("FileAssociationDialog.Title")); 98 setJMenuBar(new SimpleMenuBar(" 0"));// need to find an appropriate help page98 setJMenuBar(new SimpleMenuBar("fileassociations")); 99 99 JPanel content_pane = (JPanel) getContentPane(); 100 100 content_pane.setBackground(Gatherer.config.getColor("coloring.collection_heading_background", false)); -
trunk/gli/src/org/greenstone/gatherer/gui/Filter.java
r5355 r5527 54 54 /** The other filters in this run of filters, used to ensure they all show the same thing. */ 55 55 private ArrayList others = null; 56 /** Is this the fi lterfilter of this run of filters created (later filters will share the same information). */56 /** Is this the first filter of this run of filters created (later filters will share the same information). */ 57 57 private boolean first = true; 58 58 /** Prevent any changes we make in the class from causing events which we then process causing events... */ … … 60 60 /** A reference to ourselves so inner classes can refer to us. */ 61 61 private Filter this_filter = null; 62 /** The check box to enable d/diable filter. */62 /** The check box to enable/disable filter. */ 63 63 private JCheckBox checkbox = null; 64 64 /** The editable combobox where you either choose a predefined filter, or type a new pseudo-regular expression. */ … … 74 74 /** Constructor. 75 75 * @param tree A reference to the <strong>JTree</strong> being affected. 76 76 */ 77 77 public Filter(DragTree tree) { 78 78 this(tree, null); 79 79 } 80 80 /** Constructor. 81 82 83 81 * @param tree A reference to the <strong>JTree</strong> being affected. 82 * @param others An <strong>ArrayList</strong> of the other Filters already in this run. 83 */ 84 84 public Filter(DragTree tree, ArrayList others) { 85 85 super(); … … 119 119 } 120 120 /** Retrieve the combobox associated with this filter. 121 122 121 * @return A <strong>GComboBox</strong>. 122 */ 123 123 public GComboBox getComboBox() { 124 124 return combobox; … … 126 126 127 127 /** Change the background color of the filter. 128 129 128 * @param color The new background <strong>Color</strong>. 129 */ 130 130 public void setBackground(Color color) { 131 131 super.setBackground(color); … … 133 133 134 134 /** Used to restore the filter state to enabled, the normal state during collection editing. 135 136 135 * @param state The new state for the filter. <i>true</i> for enabled, <i>false</i> otherwise. 136 */ 137 137 public void setEnabled(boolean state) { 138 138 ignore = true; … … 142 142 } 143 143 /** Set the combobox model for this filter. 144 145 144 * @param model The new <strong>ComboBoxModel</strong> to use. 145 */ 146 146 public void setComboBoxModel(ComboBoxModel model) { 147 147 combobox.setModel(model); 148 148 } 149 149 /** Ensure that a certain entry is selected from the combobox. 150 151 150 * @param selection The <strong>Entry</strong> that should be selected. 151 */ 152 152 public void setComboBoxSelection(Entry selection) { 153 153 ignore = true; … … 156 156 } 157 157 /** Set to signify that this filter is the first in a new run of filters. 158 159 158 * @param first <i>true</i> if this is the first filter in a run, <i>false</i> if it will just be added to the current run. 159 */ 160 160 public void setFirst(boolean first) { 161 161 this.first = first; 162 162 } 163 163 /** Spawn produces a copy of this filter, which has new controls, but shares listeners wih this filter, and vice versa. Thus we can have two synchronized, but differing sets of controls. 164 165 166 164 * @param tree_spawn The <strong>JTree</strong> this filter will affect. 165 * @return A new <strong>Filter</strong> which is in the same run as this filter. 166 */ 167 167 public Filter spawn(DragTree tree_spawn) { 168 168 Filter filter = new Filter(tree_spawn, others); … … 173 173 } 174 174 /** Retrieve a phrase from the dictionary. 175 176 175 * @param key The unique identification <strong>String</strong> of a phrase from the dictionary. 176 */ 177 177 private String get(String key) { 178 178 return get(key, null); 179 179 } 180 180 /** Retrieve a phrase from the dictionary, augmenting with the given text fragments 181 182 183 184 185 181 * @param key The unique identification <strong>String</strong> of a phrase from the dictionary. 182 * @param args A <strong>String[]</strong> of arguments to be used to fill out parameter fields in the phrase returned. 183 * @see org.greenstone.gatherer.Dictionary 184 * @see org.greenstone.gatherer.Gatherer 185 */ 186 186 private String get(String key, String args[]) { 187 187 if(key.indexOf(".") == -1) { … … 191 191 } 192 192 /** Encode an expression in pseudo-regular expression into regular expression. 193 194 195 193 * @param raw The pseudo-regular expression <strong>String</strong> which includes several characters which differ in meaning from regular expression queries. 194 * @return A proper regular expression as a <strong>String</strong>. 195 */ 196 196 private String encode(String raw) { 197 197 StringBuffer working = new StringBuffer(); … … 234 234 private class ComboBoxListener 235 235 implements ActionListener { 236 /** Called when a new item is selected from the filter combobox, we treat the new entry as a pseudo-regular expression, compile it and then apply it to the tree.236 /** Called when a new item is selected from the filter combobox, we treat the new entry as a pseudo-regular expression, compile it and then apply it to the tree. 237 237 * @param event An <strong>ActionEvent</strong> containing more information about the change performed. 238 238 * @see org.greenstone.gatherer.gui.Filter.Entry … … 297 297 } 298 298 /** Constructor. 299 300 301 299 * @param name The name of this entry as a <strong>String</strong>. 300 * @param pattern The compiled regular expression as a <strong>Pattern</strong>. 301 */ 302 302 public Entry(String name, Pattern pattern) { 303 303 this.name = name; … … 305 305 } 306 306 /** Compare two Entrys for ordering. 307 308 309 307 * @param object The other Entry to compare to, as an <strong>Object</strong>. 308 * @return An <i>int</i> indicating the respective ordering, as defined in java.lang.String#compareTo 309 */ 310 310 public int compareTo(Object object) { 311 311 return toString().compareTo(object.toString()); 312 312 } 313 313 /** Retrieve the pattern associated with this entry. 314 315 314 * @return The <strong>Pattern</strong>. 315 */ 316 316 public Pattern getPattern() { 317 317 return pattern; 318 318 } 319 319 /** Translate this entry into a textual representation. 320 321 320 * @return A <strong>String</strong> containing the representation. 321 */ 322 322 public String toString() { 323 323 String result = null; -
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r5522 r5527 105 105 /** The metaedit pane is used to assign, edit and remove metadata from files within the collection. */ 106 106 public MetaEditPane metaedit_pane = null; 107 /** The mirror pane contains controls for mirroring inter ent sites. */107 /** The mirror pane contains controls for mirroring internet sites. */ 108 108 public MirrorPane mirror_pane = null; 109 109 /** The preview pane contains a preview of your build collection. */ … … 413 413 browser_pane = new BrowsingPane(); 414 414 if(Gatherer.config.get("workflow.browse", true)) { 415 tab_pane.addTab( get("Browser"), Utility.getImage("browsing.gif"), browser_pane);415 tab_pane.addTab("GUI.Hunt", Utility.getImage("browsing.gif"), browser_pane); 416 416 tab_pane.setEnabledAt(tab_pane.indexOfComponent(browser_pane), Gatherer.config.get("workflow.browse", false)); 417 417 } … … 419 419 mirror_pane = new MirrorPane(); 420 420 if(Gatherer.config.get("workflow.mirror", true)) { 421 tab_pane.addTab( get("Mirroring"), Utility.getImage("mirroring.gif"), mirror_pane);421 tab_pane.addTab("GUI.Mirror", Utility.getImage("mirroring.gif"), mirror_pane); 422 422 tab_pane.setEnabledAt(tab_pane.indexOfComponent(mirror_pane), Gatherer.config.get("workflow.mirror", false)); 423 423 } … … 426 426 collection_pane.display(); 427 427 if(Gatherer.config.get("workflow.gather", true)) { 428 tab_pane.addTab( get("Collection"), Utility.getImage("collection.gif"), collection_pane);428 tab_pane.addTab("GUI.Gather", Utility.getImage("collection.gif"), collection_pane); 429 429 tab_pane.setEnabledAt(tab_pane.indexOfComponent(collection_pane), Gatherer.config.get("workflow.gather", false)); 430 430 } … … 433 433 metaedit_pane.display(); 434 434 if(Gatherer.config.get("workflow.enrich", true)) { 435 tab_pane.addTab( get("MetaEdit"), Utility.getImage("metaedit.gif"), metaedit_pane);435 tab_pane.addTab("GUI.Enrich", Utility.getImage("metaedit.gif"), metaedit_pane); 436 436 tab_pane.setEnabledAt(tab_pane.indexOfComponent(metaedit_pane), false); 437 437 } … … 440 440 config_pane.display(); 441 441 if(Gatherer.config.get("workflow.design", true)) { 442 tab_pane.addTab( get("Build"), Utility.getImage("build.gif"), config_pane);442 tab_pane.addTab("GUI.Design", Utility.getImage("build.gif"), config_pane); 443 443 tab_pane.setEnabledAt(tab_pane.indexOfComponent(config_pane), false); 444 444 } 445 445 446 446 if(Gatherer.config.get("workflow.export", true)) { 447 tab_pane.addTab( get("Export"), Utility.getImage("export.gif"), export_pane);447 tab_pane.addTab("GUI.Export", Utility.getImage("export.gif"), export_pane); 448 448 tab_pane.setEnabledAt(tab_pane.indexOfComponent(export_pane), false); 449 449 } … … 452 452 create_pane.display(); 453 453 if(Gatherer.config.get("workflow.create", true)) { 454 tab_pane.addTab( get("Create"), Utility.getImage("build session.gif"), create_pane);454 tab_pane.addTab("GUI.Create", Utility.getImage("build session.gif"), create_pane); 455 455 tab_pane.setEnabledAt(tab_pane.indexOfComponent(create_pane), false); 456 456 } … … 459 459 preview_pane.display(); 460 460 if(Gatherer.config.get("workflow.preview", true)) { 461 tab_pane.addTab( get("Preview"), Utility.getImage("final.gif"), preview_pane);461 tab_pane.addTab("GUI.Preview", Utility.getImage("final.gif"), preview_pane); 462 462 tab_pane.setEnabledAt(tab_pane.indexOfComponent(preview_pane), false); 463 463 } … … 472 472 } 473 473 474 Gatherer.dictionary.register(tab_pane, null, false); 474 475 content_pane.add(tab_pane, BorderLayout.CENTER); 475 476 // Drive a sessionReady event to update all controls to reflect current collection status. … … 499 500 public Filter getFilter(DragTree tree) { 500 501 Filter filter = (Filter) filters.get(tree.getModel()); 501 if (filter == null) {502 if (filter == null) { 502 503 filter = new Filter(tree, null); 503 504 filters.put(tree.getModel(), filter); … … 534 535 535 536 /** Allows the system to programatically set the selected tab. 536 537 537 * @param component The view you wish to make visable in the tab pane as a <strong>Component</strong>. 538 */ 538 539 public void setSelectedView(Component component) { 539 540 tab_pane.setSelectedComponent(component); … … 558 559 tab_pane.setEnabledAt(index, state); 559 560 } 560 561 // If this was the currently selected tab and it is now disabled, change the view to the first enabled tab. 561 562 if(tab_pane.getSelectedIndex() == index && !state) { 562 563 boolean found = false; … … 580 581 581 582 /** When the edit metadata option is choosen from the menu, this method is called to ensure we only edit the metadata if there is metadata loaded. 582 583 */ 583 584 public void showEditMetadataBox() { 584 585 if(Gatherer.c_man.getCollection() != null) { … … 587 588 } 588 589 /** When the load collection option is choosen this method is called to produce the modal file load prompt. 589 590 */ 590 591 public boolean showLoadCollectionBox() { 591 592 boolean result = false; … … 638 639 } 639 640 /** When called this method causes the Log class in Gatherer to display a nice dialog box which contains the log. 640 641 */ 641 642 public void showLogBox() { 642 643 Gatherer.log.display(); 643 644 } 644 645 /** When called this method causes the MetaAuditBox class in CollectionManager to display a nice dialog box which contains all the metadata assigned in the collection. 645 646 */ 646 647 public void showMetaAuditBox() { 647 648 wait(true); … … 718 719 719 720 /** This method is used to open the options box on the screen. 720 721 */ 721 722 public void showOptionsBox() { 722 723 new OptionsBox(); 723 724 } 724 725 /** This method is used to open the save collection box/prompt on the screen. 725 726 726 * @return A <i>boolean</i> which is <i>true</i> if the collection was saved successfully, <i>false</i> otherwise. 727 */ 727 728 public boolean showSaveCollectionBox(boolean close_after, boolean exit_after) { 728 729 //SaveCollectionBox save_collection_box = new SaveCollectionBox(); … … 762 763 } 763 764 /** Any implementation of ChangeListener must include this method so we can be informed when the state of one of the registered objects changes. In this case we are listening to view changes within the tabbed pane. 764 765 765 * @param event A ChangeEvent containing information about the event that fired this call. 766 */ 766 767 public void stateChanged(ChangeEvent event) { 767 768 if(previous_pane != null) { … … 825 826 826 827 /** Retrieves a phrase from the Dictionary based on the key. 827 828 829 830 828 * @param key A <strong>String</strong> uniquely identifying a phrase from the Dictionary. 829 * @return The desired phrase as a <strong>String</strong>. 830 * @see org.greenstone.gatherer.Dictionary 831 */ 831 832 private String get(String key) { 832 833 return get(key, null); 833 834 } 834 835 /** Retrieves a phrase from the Dictionary based on the key and including the arguments. 835 836 837 838 839 836 * @param key A <strong>String</strong> uniquely identifying a phrase from the Dictionary. 837 * @param args A <strong>String[]</strong> of arguments available to be inserted into the phrase. 838 * @return The desired phrase as a <strong>String</strong>. 839 * @see org.greenstone.gatherer.Dictionary 840 */ 840 841 private String get(String key, String args[]) { 841 842 if(key.indexOf('.') == -1) { … … 862 863 863 864 /**Overridden from JFrame so we can exit safely when window is closed (or destroyed). 864 * @param event A <strong>WindowEvent</strong> containing information about the event that fred this call.865 865 * @param event A <strong>WindowEvent</strong> containing information about the event that fired this call. 866 */ 866 867 protected void processWindowEvent(WindowEvent event) { 867 868 if(event.getID() == WindowEvent.WINDOW_CLOSING) { … … 870 871 } 871 872 /** Listens to actions upon the menu bar, and if it detects a click over the help menu brings the help window to the front if it has become hidden. 872 873 */ 873 874 private class MenuListenerImpl 874 875 implements MenuListener { 875 876 /** Called whenever a popup menu is hidden, but we don't care. 876 877 * @param e Some <strong>MenuEvent</strong> that we could care less about. 877 878 */ 878 879 public void menuCanceled(MenuEvent e) { 879 880 } 880 881 /** Called whenever a menu header (ie button) becomes unselected, but we don't care. 881 882 882 * @param e Some <strong>MenuEvent</strong> that we could care less about. 883 */ 883 884 public void menuDeselected(MenuEvent e) { 884 885 } 885 886 /** This method, when a menu is first opened, is the only one we respond to by bringing the help window to the front if possible, but only if there is a help window and the help menu is the one opening. 886 887 887 * @param e The <strong>MenuEvent</strong> whose source is checked. 888 */ 888 889 public void menuSelected(MenuEvent e) { 889 890 if(e.getSource() == menu_bar.help) { -
trunk/gli/src/org/greenstone/gatherer/gui/LockFileDialog.java
r5349 r5527 34 34 super(parent, get("LockFileDialog.Title"), true); 35 35 setSize(SIZE); 36 setJMenuBar(new SimpleMenuBar(" 2.3"));36 setJMenuBar(new SimpleMenuBar("openingacollection")); 37 37 this.self = this; 38 38 // Parse the lock file, but do so quietly so that if the XML is poorly formed it doesn't show exception. -
trunk/gli/src/org/greenstone/gatherer/gui/MenuBar.java
r5356 r5527 225 225 help_about.addActionListener(Gatherer.g_man); 226 226 227 help_browse = new JMenuItem(get("GUI. Browser"), Utility.BLANK_ICON);227 help_browse = new JMenuItem(get("GUI.Hunt"), Utility.BLANK_ICON); 228 228 help_browse.addActionListener(Gatherer.g_man); 229 229 … … 231 231 help_build.addActionListener(Gatherer.g_man); 232 232 233 help_collect = new JMenuItem(get("GUI. Collection"), Utility.BLANK_ICON);233 help_collect = new JMenuItem(get("GUI.Gather"), Utility.BLANK_ICON); 234 234 help_collect.addActionListener(Gatherer.g_man); 235 235 236 help_design = new JMenuItem(get("GUI. Build"), Utility.BLANK_ICON);236 help_design = new JMenuItem(get("GUI.Design"), Utility.BLANK_ICON); 237 237 help_design.addActionListener(Gatherer.g_man); 238 238 … … 243 243 help_general.addActionListener(Gatherer.g_man); 244 244 245 help_metaedit = new JMenuItem(get("GUI. MetaEdit"), Utility.BLANK_ICON);245 help_metaedit = new JMenuItem(get("GUI.Enrich"), Utility.BLANK_ICON); 246 246 help_metaedit.addActionListener(Gatherer.g_man); 247 247 248 help_mirror = new JMenuItem(get("GUI.Mirror ing"), Utility.BLANK_ICON);248 help_mirror = new JMenuItem(get("GUI.Mirror"), Utility.BLANK_ICON); 249 249 help_mirror.addActionListener(Gatherer.g_man); 250 250 … … 325 325 326 326 /** In order to provide context aware help advice we keep track of which 327 328 329 330 327 * tab the user has open, and then highlight that help menu item with 328 * separators. 329 * @param tab_index The index of the selected tab (0-7). 330 */ 331 331 public void tabSelected(int tab_index) { 332 332 JMenuItem selected; … … 347 347 348 348 /** Retrieves a key from the Dictionary, using no extra arguments. 349 350 351 352 349 * @param key A String which maps to a certain phrase from the Dictionary. 350 * @return The String the matches the key or an error String if no match 351 * found. 352 */ 353 353 private String get(String key) { 354 return get(key, null); 354 // return get(key, null); 355 return Gatherer.dictionary.get(key, (String[]) null); 355 356 } 356 357 357 358 /** Retrieves a key from the Dictionary, providing extra arguments to 358 359 360 361 362 363 364 365 366 private String get(String key, String args[]) {359 * be inserted using a String array. 360 * @param key A String which maps to a certain phrase from the Dictionary. 361 * @param args A String array containing further arguments (such as 362 * formatting instructions and variable values) to be taken into account 363 * when Dictionary creates the return String. 364 * @return The String the matches the key or an error String if no match 365 * found. 366 */ 367 /* private String get(String key, String args[]) { 367 368 if(key.indexOf('.') == -1) { 368 369 key = "Menu." + key; 369 370 } 370 371 return Gatherer.dictionary.get(key, args); 371 } 372 } */ 372 373 373 374 public class MagicMenuItem -
trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPane.java
r5372 r5527 128 128 129 129 /** Constructor. 130 * @param tree_sync The <strong>TreeSynchronizer</strong> to be used on the collection tree .130 * @param tree_sync The <strong>TreeSynchronizer</strong> to be used on the collection tree 131 131 * @see org.greenstone.gatherer.Configuration 132 132 * @see org.greenstone.gatherer.gui.table.GTable 133 133 * @see org.greenstone.gatherer.valuetree.GValueTree 134 134 */ 135 public MetaEditPane(TreeSynchronizer tree_sync) { 135 public MetaEditPane(TreeSynchronizer tree_sync) 136 { 136 137 this.tree = null; 137 138 this.tree_sync = tree_sync; 138 139 add = new JButton( get("MetaEditPrompt.Accumulate"));139 140 add = new JButton("MetaEdit.Accumulate"); 140 141 add.addActionListener(this); 141 142 add.setEnabled(false); … … 143 144 add.setPreferredSize(BUTTON_SIZE); 144 145 145 update = new JButton( get("MetaEditPrompt.Overwrite"));146 update = new JButton("MetaEdit.Overwrite"); 146 147 update.addActionListener(this); 147 148 update.setEnabled(false); … … 149 150 update.setPreferredSize(BUTTON_SIZE); 150 151 151 remove = new JButton( get("MetaEditPrompt.Remove"));152 remove = new JButton("MetaEdit.Remove"); 152 153 remove.addActionListener(this); 153 154 remove.setEnabled(false); … … 155 156 remove.setPreferredSize(BUTTON_SIZE); 156 157 157 expand = new JButton( get("General.Expand"));158 expand = new JButton("MetaEdit.Expand"); 158 159 expand.addActionListener(this); 159 160 expand.setEnabled(true); … … 162 163 163 164 tree = new GValueTree(CONTROL_SIZE.width, CONTROL_SIZE.height); 164 } 165 166 // Dictionary registration 167 Gatherer.dictionary.register(add, null, false); 168 Gatherer.dictionary.register(update, null, false); 169 Gatherer.dictionary.register(remove, null, false); 170 Gatherer.dictionary.register(expand, null, false); 171 } 172 165 173 166 174 /** Called whenever an action occurs on one of our registered buttons. … … 175 183 public void actionPerformed(ActionEvent event) { 176 184 Object esrc = event.getSource(); 177 if (esrc == add) {185 if (esrc == add) { 178 186 (new AppendMetadataTask()).start(); 179 187 } 180 else if (esrc == update) {188 else if (esrc == update) { 181 189 (new UpdateMetadataTask()).start(); 182 190 } 183 else if (esrc == remove) {191 else if (esrc == remove) { 184 192 (new RemoveMetadataTask()).start(); 185 193 } 186 else if (esrc == expand) {194 else if (esrc == expand) { 187 195 EditorDialog ed = new EditorDialog(); 188 196 String temp = ed.display(tree.getSelectedValue()); 189 if (temp != null) {197 if (temp != null) { 190 198 tree.setSelectedValue(temp); 191 199 } … … 408 416 JPanel table_title_pane = new JPanel(); 409 417 410 ///atherer.println("\tCreating metadata_label"); 411 table_label = new JTextField(get("MetaEdit.No_File")); 418 table_label = new JTextField("MetaEdit.No_File"); 412 419 table_label.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 413 420 table_label.setEditable(false); … … 419 426 JPanel table_pane_zero = new JPanel(); 420 427 table_pane_zero.setOpaque(false); 421 428 422 429 JPanel table_pane_two = new JPanel(); 423 430 table_pane_two.setOpaque(false); 424 431 425 JLabel no_file_message = new JLabel( get("MetaEdit.No_File"));432 JLabel no_file_message = new JLabel("MetaEdit.No_File"); 426 433 no_file_message.setHorizontalAlignment(JLabel.CENTER); 427 434 no_file_message.setOpaque(false); 428 435 no_file_message.setVerticalAlignment(JLabel.CENTER); 429 430 JLabel no_metadata_message = new JLabel( get("MetaEdit.No_Metadata"));436 437 JLabel no_metadata_message = new JLabel("MetaEdit.No_Metadata"); 431 438 no_metadata_message.setHorizontalAlignment(JLabel.CENTER); 432 439 no_metadata_message.setOpaque(false); … … 476 483 JPanel tools_off_pane = new JPanel(); 477 484 478 JLabel tools_off_label = new JLabel( get("MetaEdit.No_Metadata_Element"));485 JLabel tools_off_label = new JLabel("MetaEdit.No_Metadata_Element"); 479 486 tools_off_label.setHorizontalAlignment(JLabel.CENTER); 480 487 tools_off_label.setOpaque(false); … … 531 538 this.setLayout(new BorderLayout()); 532 539 this.add(external_split, BorderLayout.CENTER); 540 541 // Dictionary registration 542 Gatherer.dictionary.register(table_label, null, false); 543 Gatherer.dictionary.register(no_file_message, null, false); 544 Gatherer.dictionary.register(no_metadata_message, null, false); 545 Gatherer.dictionary.register(tools_off_label, null, false); 533 546 } 534 547 … … 1006 1019 1007 1020 1008 public GValueTree(int width, int height) { 1021 public GValueTree(int width, int height) 1022 { 1009 1023 super(); 1010 1024 … … 1015 1029 1016 1030 JPanel value_pane = new JPanel(); 1017 JLabel value_label = new JLabel( get("MetaEdit.Value"));1031 JLabel value_label = new JLabel("MetaEdit.Value"); 1018 1032 value_label.setPreferredSize(VALUE_LABEL_SIZE); 1019 1033 1020 1034 JPanel value_field_pane = new JPanel(); 1021 value = new JTextField( );1035 value = new JTextField("MetaEdit.Value_Field"); 1022 1036 value.setBackground(Gatherer.config.getColor("coloring.editable_background", false)); 1023 1037 value.setForeground(Gatherer.config.getColor("coloring.editable_foreground", false)); … … 1030 1044 1031 1045 JPanel tree_pane = new JPanel(); 1032 JLabel tree_label = new JLabel( get("MetaEdit.Tree"));1046 JLabel tree_label = new JLabel("MetaEdit.Tree"); 1033 1047 1034 1048 tree = new JTree(new GValueModel()); … … 1048 1062 1049 1063 // Layout 1050 1051 1064 value_field_pane.setBorder(BorderFactory.createEmptyBorder(0,0,0,5)); 1052 1065 value_field_pane.setLayout(new BorderLayout(0, 0)); … … 1083 1096 this.add(extracted_pane, NONE); 1084 1097 card_showing = TREE; 1098 1099 // Dictionary registration 1100 Gatherer.dictionary.register(value_label, null, false); 1101 Gatherer.dictionary.register(value, null, false); 1102 Gatherer.dictionary.register(tree_label, null, false); 1085 1103 } 1086 1104 … … 1174 1192 1175 1193 1176 private String get(String key) {1177 return get(key, null);1178 }1179 1180 1194 private String get(String key, String args[]) { 1181 if (key.indexOf('.') == -1) {1182 key = "MetaEdit." + key;1183 }1184 1195 return Gatherer.dictionary.get(key, args); 1185 1196 } -
trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPrompt.java
r5359 r5527 30 30 import java.io.File; 31 31 import javax.swing.*; 32 import org.greenstone.gatherer.Configuration;33 32 import org.greenstone.gatherer.Gatherer; 34 33 import org.greenstone.gatherer.gui.TextFieldLabel; 35 import org.greenstone.gatherer.util.Utility;36 34 import org.greenstone.gatherer.gui.SimpleMenuBar; 37 35 import org.greenstone.gatherer.gui.ModalDialog; 36 import org.greenstone.gatherer.util.Utility; 38 37 39 38 /** Displays a dynamic prompt to allow the user to choose how metadata is to be added, updated or removed from target FileNodes. The prompt changes depending on the action requested, the file nodes encountered and the number of file nodes in the selection. */ … … 75 74 public MetaEditPrompt(String type, boolean multiple_selection, File file, String element, String current_value, String new_value) { 76 75 super(Gatherer.g_man, true); // Needed for modal response! 77 76 78 77 // Setup 79 78 this.setSize(SIZE); 80 this.setTitle(get("MetaEditPrompt.Title")); 81 this.setJMenuBar(new SimpleMenuBar("6.3")); 79 this.setTitle("MetaEditPrompt.Title"); 80 81 if (type.equals(ADD_PROMPT)) { 82 this.setJMenuBar(new SimpleMenuBar("appendingmetadata")); 83 } 84 else if (type.equals(UPDATE_PROMPT)) { 85 this.setJMenuBar(new SimpleMenuBar("updatingmetadata")); 86 } 87 else if (type.equals(REMOVE_PROMPT)) { 88 this.setJMenuBar(new SimpleMenuBar("removingmetadata")); 89 } 90 82 91 // Creation 83 92 JPanel content_pane = (JPanel)this.getContentPane(); 84 JLabel title_label = new JLabel( get("MetaEditPrompt." + type));93 JLabel title_label = new JLabel(type); 85 94 86 95 JPanel details_pane = new JPanel(); 87 96 JPanel filename_panel = new JPanel(); 88 JLabel filename_label = new JLabel( get("MetaEditPrompt.File"));97 JLabel filename_label = new JLabel("MetaEditPrompt.File"); 89 98 filename_label.setPreferredSize(LABEL_SIZE); 90 99 TextFieldLabel filename_field = new TextFieldLabel(Utility.trimCenter(file.getAbsolutePath(), 120)); … … 92 101 filename_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 93 102 JPanel element_panel = new JPanel(); 94 JLabel element_label = new JLabel( get("MetaEditPrompt.Element"));103 JLabel element_label = new JLabel("MetaEditPrompt.Element"); 95 104 element_label.setPreferredSize(LABEL_SIZE); 96 105 TextFieldLabel element_field = new TextFieldLabel(element); 97 106 element_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 98 107 JPanel current_value_panel = new JPanel(); 99 JLabel current_value_label = new JLabel( get("MetaEditPrompt.Current_Value"));108 JLabel current_value_label = new JLabel("MetaEditPrompt.Current_Value"); 100 109 current_value_label.setPreferredSize(LABEL_SIZE); 101 110 TextFieldLabel current_value_field = new TextFieldLabel(current_value); 102 111 current_value_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 103 112 JPanel new_value_panel = new JPanel(); 104 JLabel new_value_label = new JLabel( get("MetaEditPrompt.New_Value"));113 JLabel new_value_label = new JLabel("MetaEditPrompt.New_Value"); 105 114 new_value_label.setPreferredSize(LABEL_SIZE); 106 115 TextFieldLabel new_value_field = new TextFieldLabel(new_value, (type == ADD_PROMPT || type == UPDATE_PROMPT)); 107 116 new_value_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 108 117 JPanel buttons_pane = new JPanel(); 109 accumulate = new JButton(get("MetaEditPrompt.Accumulate")); 118 119 accumulate = new JButton("MetaEditPrompt.Accumulate"); 110 120 accumulate.setEnabled(type == ADD_PROMPT); 111 121 accumulate.setMnemonic(KeyEvent.VK_A); 112 accumulate_all = new JButton(get("MetaEditPrompt.Accumulate_All")); 122 123 accumulate_all = new JButton("MetaEditPrompt.Accumulate_All"); 113 124 accumulate_all.setEnabled(type == ADD_PROMPT && multiple_selection); 114 125 accumulate_all.setMnemonic(KeyEvent.VK_L); 115 cancel = new JButton(get("MetaEditPrompt.Cancel")); 116 cancel.setMnemonic(KeyEvent.VK_C); 117 skip = new JButton(get("MetaEditPrompt.Skip")); 126 127 overwrite = new JButton("MetaEditPrompt.Overwrite"); 128 overwrite.setEnabled(type == UPDATE_PROMPT); 129 overwrite.setMnemonic(KeyEvent.VK_R); 130 131 overwrite_all = new JButton("MetaEditPrompt.Overwrite_All"); 132 overwrite_all.setEnabled(type == UPDATE_PROMPT && multiple_selection); 133 overwrite_all.setMnemonic(KeyEvent.VK_P); 134 135 remove = new JButton("MetaEditPrompt.Remove"); 136 remove.setEnabled(type == REMOVE_PROMPT); 137 remove.setMnemonic(KeyEvent.VK_R); 138 139 remove_all = new JButton("MetaEditPrompt.Remove_All"); 140 remove_all.setEnabled(type == REMOVE_PROMPT && multiple_selection); 141 remove_all.setMnemonic(KeyEvent.VK_A); 142 143 skip = new JButton("MetaEditPrompt.Skip"); 118 144 skip.setEnabled(multiple_selection); 119 145 skip.setMnemonic(KeyEvent.VK_S); 120 overwrite = new JButton(get("MetaEditPrompt.Overwrite")); 121 overwrite.setEnabled(type == UPDATE_PROMPT); 122 overwrite.setMnemonic(KeyEvent.VK_R); 123 overwrite_all = new JButton(get("MetaEditPrompt.Overwrite_All")); 124 overwrite_all.setEnabled(type == UPDATE_PROMPT && multiple_selection); 125 overwrite_all.setMnemonic(KeyEvent.VK_P); 126 remove = new JButton(get("MetaEditPrompt.Remove")); 127 remove.setEnabled(type == REMOVE_PROMPT); 128 remove.setMnemonic(KeyEvent.VK_R); 129 remove_all = new JButton(get("MetaEditPrompt.Remove_All")); 130 remove_all.setEnabled(type == REMOVE_PROMPT && multiple_selection); 131 remove_all.setMnemonic(KeyEvent.VK_A); 146 147 cancel = new JButton("MetaEditPrompt.Cancel"); 148 cancel.setMnemonic(KeyEvent.VK_C); 132 149 133 150 // Connection … … 187 204 Rectangle frame_bounds = Gatherer.g_man.getBounds(); 188 205 this.setLocation(frame_bounds.x + ((frame_bounds.width - SIZE.width) / 2), frame_bounds.y + ((frame_bounds.height - SIZE.height) / 2)); 206 207 // Dictionary registration 208 Gatherer.dictionary.register(title_label, null, false); 209 Gatherer.dictionary.register(filename_label, null, false); 210 Gatherer.dictionary.register(element_label, null, false); 211 Gatherer.dictionary.register(current_value_label, null, false); 212 Gatherer.dictionary.register(new_value_label, null, false); 213 214 Gatherer.dictionary.register(accumulate, null, false); 215 Gatherer.dictionary.register(accumulate_all, null, false); 216 Gatherer.dictionary.register(cancel, null, false); 217 Gatherer.dictionary.register(skip, null, false); 218 Gatherer.dictionary.register(overwrite, null, false); 219 Gatherer.dictionary.register(overwrite_all, null, false); 220 Gatherer.dictionary.register(remove, null, false); 221 Gatherer.dictionary.register(remove_all, null, false); 189 222 } 190 223 … … 222 255 return value; 223 256 } 224 225 private String get(String key) {226 return Gatherer.dictionary.get(key);227 }228 257 } -
trunk/gli/src/org/greenstone/gatherer/gui/NewCollectionDetailsPrompt.java
r5349 r5527 43 43 this.self = this; 44 44 // Setup 45 setJMenuBar(new SimpleMenuBar(" 2.1"));45 setJMenuBar(new SimpleMenuBar("creatingacollection")); 46 46 setSize(size); 47 47 setTitle(get("NewCollectionPrompt.Title")); -
trunk/gli/src/org/greenstone/gatherer/gui/NewCollectionMetadataPrompt.java
r5355 r5527 32 32 super(Gatherer.g_man, true); 33 33 this.self = this; 34 setJMenuBar(new SimpleMenuBar(" 2.1"));34 setJMenuBar(new SimpleMenuBar("creatingacollection")); 35 35 setModal(true); 36 36 setSize(size); -
trunk/gli/src/org/greenstone/gatherer/gui/Preferences.java
r5370 r5527 62 62 setSize(SIZE); 63 63 setTitle("Preferences"); 64 setJMenuBar(new SimpleMenuBar(" 10.2"));64 setJMenuBar(new SimpleMenuBar("preferences")); 65 65 // Creation 66 66 JPanel content_pane = (JPanel) getContentPane(); -
trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/AutofilterDialog.java
r5348 r5527 106 106 setSize(SIZE); 107 107 setTitle(get("Autofilter.Title")); 108 setJMenuBar(new SimpleMenuBar(" 6.7"));108 setJMenuBar(new SimpleMenuBar("reviewingmetadata")); 109 109 // Creation 110 110 JPanel content_pane = (JPanel) getContentPane(); -
trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/MetaAuditFrame.java
r5363 r5527 108 108 setSize(SIZE); 109 109 setTitle(get("MetaAudit.Title")); 110 setJMenuBar(new SimpleMenuBar(" 6.7"));110 setJMenuBar(new SimpleMenuBar("reviewingmetadata")); 111 111 JPanel content_pane = (JPanel) getContentPane(); 112 112 JPanel button_pane = new JPanel(); -
trunk/gli/src/org/greenstone/gatherer/mem/MetadataEditorManager.java
r5349 r5527 149 149 setSize(SIZE); 150 150 setTitle(get("MEM.Title")); 151 setJMenuBar(new SimpleMenuBar(" 11.1"));151 setJMenuBar(new SimpleMenuBar("editingmetadatasets")); 152 152 JPanel content_pane = (JPanel) getContentPane(); 153 153 content_pane.setBackground(Gatherer.config.getColor("coloring.collection_heading_background", false)); -
trunk/gli/src/org/greenstone/gatherer/msm/MSMPrompt.java
r5349 r5527 195 195 * @return An object, which is either an Integer specifying what further action should be undertaken, if any, or if the action was replace, returns an Element, which is the attribute Element to replace with the new one 196 196 */ 197 public Object mDEPrompt(Element mde_cur, Element []atts_cur, Element mde_new, Element att_new) {197 public Object mDEPrompt(Element mde_cur, Element[] atts_cur, Element mde_new, Element att_new) { 198 198 action = Declarations.NO_ACTION; 199 199 // Construction and configuration … … 202 202 dialog.setSize(MDE_SIZE); 203 203 dialog.setTitle(get("MSMPrompt.Merge_MDE")); 204 dialog.setJMenuBar(new SimpleMenuBar(" 6.8"));204 dialog.setJMenuBar(new SimpleMenuBar("importingpreviouslyassignedmetadata")); 205 205 JPanel content_pane = (JPanel)dialog.getContentPane(); 206 206 … … 305 305 dialog.setSize(MDS_SIZE); 306 306 dialog.setTitle(get("MSMPrompt.Merge_MDS")); 307 dialog.setJMenuBar(new SimpleMenuBar(" 6.8"));307 dialog.setJMenuBar(new SimpleMenuBar("importingpreviouslyassignedmetadata")); 308 308 JPanel content_pane = (JPanel)dialog.getContentPane(); 309 309 if(mde_cur != null) { … … 440 440 dialog.setSize(RENAME_SIZE); 441 441 dialog.setTitle(get("MSMPrompt.Rename")); 442 dialog.setJMenuBar(new SimpleMenuBar(" 6.8"));442 dialog.setJMenuBar(new SimpleMenuBar("importingpreviouslyassignedmetadata")); 443 443 JLabel old_name_label = new JLabel(get("MSMPrompt.Old_Name")); 444 444 old_name_label.setPreferredSize(RENAME_LABEL_SIZE); … … 551 551 dialog.setSize(SELECT_SIZE); 552 552 dialog.setTitle(get("MSMPrompt.Select")); 553 dialog.setJMenuBar(new SimpleMenuBar(" 6.8"));553 dialog.setJMenuBar(new SimpleMenuBar("importingpreviouslyassignedmetadata")); 554 554 555 555 JButton ok = new JButton(get("General.OK")); … … 627 627 dialog.setSize(SELECT_ELEMENT_SIZE); 628 628 dialog.setTitle(get("MSMPrompt.Select_Element_Title")); 629 dialog.setJMenuBar(new SimpleMenuBar(" 6.8"));629 dialog.setJMenuBar(new SimpleMenuBar("importingpreviouslyassignedmetadata")); 630 630 JPanel content_pane = (JPanel) dialog.getContentPane(); 631 631 JPanel control_pane = new JPanel(); … … 812 812 dialog.setSize(SELECT_SET_SIZE); 813 813 dialog.setTitle(get("MSMPrompt.Select_Set_Title")); 814 dialog.setJMenuBar(new SimpleMenuBar(" 6.8"));814 dialog.setJMenuBar(new SimpleMenuBar("importingpreviouslyassignedmetadata")); 815 815 JPanel content_pane = (JPanel) dialog.getContentPane(); 816 816 JPanel control_pane = new JPanel(); -
trunk/gli/src/org/greenstone/gatherer/sarm/SearchAndReplace.java
r5354 r5527 54 54 import org.greenstone.gatherer.valuetree.GValueModel; 55 55 import org.greenstone.gatherer.valuetree.GValueNode; 56 import org.greenstone.gatherer.gui.SimpleMenuBar;57 56 import org.greenstone.gatherer.gui.ModalDialog; 58 57 /** Provides a convenient class which searches through all of the various data attached to a collection, globally searching and replacing values as necessary, and firing the relevant events to have the gui update properly. … … 138 137 setSize(SIZE); 139 138 setTitle(get("SearchAndReplace.Title")); 140 setJMenuBar(new SimpleMenuBar("10.1"));141 139 JPanel content_pane = (JPanel) getContentPane(); 142 140
Note:
See TracChangeset
for help on using the changeset viewer.