Ignore:
Timestamp:
2003-10-06T17:55:00+13:00 (21 years ago)
Author:
mdewsnip
Message:

Nearly finished adding tooltips (and thank goodness for that).

Location:
trunk/gli/src/org/greenstone/gatherer/mem
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/mem/Attribute.java

    r4365 r5589  
    3535 *########################################################################
    3636 */
    37 
    38  
    39 
    40 
    41 
    42 
    4337package org.greenstone.gatherer.mem;
    4438
  • trunk/gli/src/org/greenstone/gatherer/mem/AttributeTableModel.java

    r4535 r5589  
    1 package org.greenstone.gatherer.mem;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.mem;
     38
    3839import java.awt.*;
    3940import java.util.*;
  • trunk/gli/src/org/greenstone/gatherer/mem/MEMModel.java

    r4501 r5589  
    1 package org.greenstone.gatherer.mem;
    21/**
    32 *#########################################################################
     
    3635 *########################################################################
    3736 */
     37package org.greenstone.gatherer.mem;
     38
    3839import javax.swing.tree.DefaultTreeModel;
    3940import org.greenstone.gatherer.Gatherer;
    4041import org.greenstone.gatherer.mem.MEMNode;
    41 import org.greenstone.gatherer.msm.MetadataSet;
    4242import org.greenstone.gatherer.util.SynchronizedTreeModelTools;
    4343/**
  • trunk/gli/src/org/greenstone/gatherer/mem/MetadataEditorManager.java

    r5564 r5589  
    4444import javax.swing.text.*;
    4545import javax.swing.tree.*;
     46import org.greenstone.gatherer.Dictionary;
    4647import org.greenstone.gatherer.Gatherer;
    4748import org.greenstone.gatherer.cdm.LanguageListCellRenderer;
     
    5152import org.greenstone.gatherer.gui.SmarterTable;
    5253import org.greenstone.gatherer.gui.SmarterTree;
     54import org.greenstone.gatherer.gui.SimpleMenuBar;
     55import org.greenstone.gatherer.gui.ModalDialog;
    5356import org.greenstone.gatherer.mem.Attribute;
    5457import org.greenstone.gatherer.mem.AttributeTableModel;
     
    6063import org.greenstone.gatherer.valuetree.GValueNode;
    6164import org.w3c.dom.*;
    62 import org.greenstone.gatherer.gui.SimpleMenuBar;
    63 import org.greenstone.gatherer.gui.ModalDialog;
    6465
    6566/** Provides a GUI and relevant suite of tools for the editing of the metadata set associated with this collection. Again I have tried to capture a file manager type feel, with a tree showing the various set-element relations to the left of the dialog, and the right side showing details on the current tree selection. When a set is selected these details include a list of attributes, while when an element is selected this list is joined by another showing assigned values. In order for the editor to be stable and consistant with the rest of the tool, care must be taken for fire appropriate events whenever the sets are changed. There is also the addded complexity of determining what actions have to occur in order for a users edit of an assigned value to be completed, i.e. if the user chooses to remove a value then a call must be made to record_set.root.removeMetadata() to ensure all such values are actually removed, so it is not enough just to remove the value from the value model.
     
    143144    this.self = this;
    144145
    145     dialog_options[0] = Gatherer.dictionary.get("General.OK");
    146     dialog_options[1] = Gatherer.dictionary.get("General.Cancel");
     146    dialog_options[0] = Dictionary.newget("General.OK");
     147    dialog_options[1] = Dictionary.newget("General.Cancel");
     148
    147149    // Creation
    148150    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    149151    setModal(true);
    150152    setSize(SIZE);
    151     setTitle(get("MEM.Title"));
    152153    setJMenuBar(new SimpleMenuBar("editingmetadatasets"));
     154    Dictionary.setText(this, "MEM.Title");
     155
    153156    JPanel content_pane = (JPanel) getContentPane();
    154157    content_pane.setBackground(Gatherer.config.getColor("coloring.collection_heading_background", false));
     
    179182    JPanel set_name_pane = new JPanel();
    180183    set_name_pane.setOpaque(false);
    181     JLabel set_name_label = new JLabel(get("MEM.Name"));
     184    JLabel set_name_label = new JLabel();
    182185    set_name_label.setOpaque(false);
    183186    set_name_label.setPreferredSize(LABEL_SIZE);
     187    Dictionary.setText(set_name_label, "MEM.Name");
    184188    set_name = new JLabel();
    185189    set_name.setBorder(BorderFactory.createLoweredBevelBorder());
     
    207211    JPanel element_name_pane = new JPanel();
    208212    element_name_pane.setOpaque(false);
    209     JLabel element_name_label = new JLabel(get("MEM.Name"));
     213    JLabel element_name_label = new JLabel();
    210214    element_name_label.setOpaque(false);
    211215    element_name_label.setPreferredSize(LABEL_SIZE);
     216    Dictionary.setText(element_name_label, "MEM.Name");
    212217    element_name = new JLabel();
    213218    element_name.setBorder(BorderFactory.createLoweredBevelBorder());
     
    243248
    244249    JPanel element_novalues_pane = new JPanel();
    245        
     250
    246251    keep_root_expanded_listener = new KeepTreeRootExpandedListener();
    247252
     
    250255    JPanel profile_name_pane = new JPanel();
    251256    profile_name_pane.setOpaque(false);
    252     JLabel profile_name_label = new JLabel(get("MEM.Name"));
     257    JLabel profile_name_label = new JLabel();
    253258    profile_name_label.setOpaque(false);
    254259    profile_name_label.setPreferredSize(LABEL_SIZE);
     260    Dictionary.setText(profile_name_label, "MEM.Name");
    255261    profile_name = new JLabel();
    256262    profile_name.setBorder(BorderFactory.createLoweredBevelBorder());
    257263    profile_name.setOpaque(false);
    258          
     264
    259265    JPanel profile_attributes_pane = new JPanel();
    260266    profile_attributes_pane.setOpaque(false);
     
    277283    JPanel button_label_pane = new JPanel();
    278284    button_label_pane.setOpaque(false);
    279     JLabel attribute_label = new JLabel(get("MEM.Attribute"));
     285
     286    JLabel attribute_label = new JLabel();
    280287    attribute_label.setOpaque(false);
    281     //attribute_label.setHorizontalAlignment(JLabel.CENTER);
    282288    attribute_label.setPreferredSize(LABEL_SIZE);
    283     JLabel element_label = new JLabel(get("MEM.Element"));
     289    Dictionary.setText(attribute_label, "MEM.Attribute");
     290
     291    JLabel element_label = new JLabel();
    284292    element_label.setOpaque(false);
    285     //element_label.setHorizontalAlignment(JLabel.CENTER);
    286293    element_label.setPreferredSize(LABEL_SIZE);
    287     JLabel file_label = new JLabel(get("MEM.File"));
     294    Dictionary.setText(element_label, "MEM.Element");
     295
     296    JLabel file_label = new JLabel();
    288297    file_label.setOpaque(false);
    289     //element_label.setHorizontalAlignment(JLabel.CENTER);
    290298    file_label.setPreferredSize(LABEL_SIZE);
    291     JLabel set_label = new JLabel(get("MEM.Set"));
     299    Dictionary.setText(file_label, "MEM.File");
     300
     301    JLabel set_label = new JLabel();
    292302    set_label.setOpaque(false);
    293     //set_label.setHorizontalAlignment(JLabel.CENTER);
    294303    set_label.setPreferredSize(LABEL_SIZE);
    295     JLabel value_label = new JLabel(get("MEM.Value"));
     304    Dictionary.setText(set_label, "MEM.Set");
     305
     306    JLabel value_label = new JLabel();
    296307    value_label.setOpaque(false);
    297     //value_label.setHorizontalAlignment(JLabel.CENTER);
    298308    value_label.setPreferredSize(LABEL_SIZE);
     309    Dictionary.setText(value_label, "MEM.Value");
    299310
    300311    JPanel inner_button_pane = new JPanel();
    301312    inner_button_pane.setOpaque(false);
    302     add_attribute = new JButton(get("MEM.Add"));
    303     add_element = new JButton(get("MEM.Add"));
    304     add_file = new JButton(get("MEM.Add"));
    305     add_set = new JButton(get("MEM.Add"));
    306     add_value = new JButton(get("MEM.Add"));
    307     edit_attribute = new JButton(get("MEM.Edit"));
    308     edit_value = new JButton(get("MEM.Edit"));
    309     remove_attribute = new JButton(get("MEM.Remove"));
    310     remove_element = new JButton(get("MEM.Remove"));
    311     remove_file = new JButton(get("MEM.Remove"));
    312     remove_set = new JButton(get("MEM.Remove"));
    313     remove_value = new JButton(get("MEM.Remove"));
     313    add_attribute = new JButton();
     314    Dictionary.setBoth(add_attribute, "MEM.Add", "MEM.Add_Attribute_Tooltip");
     315    add_element = new JButton();
     316    Dictionary.setBoth(add_element, "MEM.Add", "MEM.Add_Element_Tooltip");
     317    add_file = new JButton();
     318    Dictionary.setBoth(add_file, "MEM.Add", "MEM.Add_File_Tooltip");
     319    add_set = new JButton();
     320    Dictionary.setBoth(add_set, "MEM.Add", "MEM.Add_Set_Tooltip");
     321    add_value = new JButton();
     322    Dictionary.setBoth(add_value, "MEM.Add", "MEM.Add_Value_Tooltip");
     323
     324    edit_attribute = new JButton();
     325    Dictionary.setBoth(edit_attribute, "MEM.Edit", "MEM.Edit_Attribute_Tooltip");
     326    edit_value = new JButton();
     327    Dictionary.setBoth(edit_value, "MEM.Edit", "MEM.Edit_Value_Tooltip");
     328
     329    remove_attribute = new JButton();
     330    Dictionary.setBoth(remove_attribute, "MEM.Remove", "MEM.Remove_Attribute_Tooltip");
     331    remove_element = new JButton();
     332    Dictionary.setBoth(remove_element, "MEM.Remove", "MEM.Remove_Element_Tooltip");
     333    remove_file = new JButton();
     334    Dictionary.setBoth(remove_file, "MEM.Remove", "MEM.Remove_File_Tooltip");
     335    remove_set = new JButton();
     336    Dictionary.setBoth(remove_set, "MEM.Remove", "MEM.Remove_Set_Tooltip");
     337    remove_value = new JButton();
     338    Dictionary.setBoth(remove_value, "MEM.Remove", "MEM.Remove_Value_Tooltip");
    314339    setControls(false, false, false, false, false, false, false, false, false, false, false, false);
    315340
    316     close = new JButton(get("General.Close"));
     341    close = new JButton();
     342    Dictionary.setBoth(close, "General.Close", "General.Close_Tooltip");
    317343
    318344    add_element_action_listener = new AddElementActionListener();
     
    331357    JPanel edit_set_pane = new JPanel();
    332358    edit_set_pane.setOpaque(false);
     359
    333360    // Connection
    334 
    335361    add_attribute.addActionListener(add_or_edit_attribute_action_listener);
    336362    add_element.addActionListener(add_element_action_listener);
     
    361387    set_attributes_scroll.setViewportView(set_attributes);
    362388
    363     set_attributes_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Attributes")), BorderFactory.createEmptyBorder(2,2,2,2)));
     389    set_attributes_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Attributes")), BorderFactory.createEmptyBorder(2,2,2,2)));
    364390    set_attributes_pane.setLayout(new BorderLayout());
    365391    set_attributes_pane.add(set_attributes_scroll, BorderLayout.CENTER);
    366392       
    367     set_details_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Set_Details")), BorderFactory.createEmptyBorder(2,2,2,2)));
     393    set_details_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Set_Details")), BorderFactory.createEmptyBorder(2,2,2,2)));
    368394    set_details_pane.setLayout(new BorderLayout());
    369395    //set_details_pane.add(set_name_pane, BorderLayout.NORTH);
    370396    set_details_pane.add(set_attributes_pane, BorderLayout.CENTER);
    371          
     397
    372398    element_name_pane.setLayout(new BorderLayout());
    373399    element_name_pane.add(element_name_label, BorderLayout.WEST);
     
    376402    element_attributes_scroll.setViewportView(element_attributes);
    377403
    378     element_attributes_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Attributes")), BorderFactory.createEmptyBorder(2,2,2,2)));
     404    element_attributes_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Attributes")), BorderFactory.createEmptyBorder(2,2,2,2)));
    379405    element_attributes_pane.setLayout(new BorderLayout());
    380406    element_attributes_pane.add(element_attributes_scroll, BorderLayout.CENTER);
    381407         
    382     element_values_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Values")), BorderFactory.createEmptyBorder(2,2,2,2)));
     408    element_values_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Values")), BorderFactory.createEmptyBorder(2,2,2,2)));
    383409    //element_values_pane.setLayout(new BorderLayout());
    384410    //element_values_pane.add(new JScrollPane(element_values), BorderLayout.CENTER);
     
    386412    element_values_pane.add(element_novalues_pane, BLANK);
    387413    element_values_pane.add(new JScrollPane(element_values), VALUES);
    388          
     414
    389415    element_inner_pane.setLayout(new GridLayout(2,1));
    390416    element_inner_pane.add(element_attributes_pane);
    391417    element_inner_pane.add(element_values_pane);
    392418         
    393     element_details_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Element_Details")), BorderFactory.createEmptyBorder(2,2,2,2)));
     419    element_details_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Element_Details")), BorderFactory.createEmptyBorder(2,2,2,2)));
    394420    element_details_pane.setLayout(new BorderLayout());
    395421    //element_details_pane.add(element_name_pane, BorderLayout.NORTH);
     
    399425    profile_name_pane.add(profile_name_label, BorderLayout.WEST);
    400426    profile_name_pane.add(profile_name, BorderLayout.CENTER);
    401                
     427
    402428    profile_attributes_scroll.setViewportView(profile_attributes);
    403429
    404     profile_attributes_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Profiles")), BorderFactory.createEmptyBorder(2,2,2,2)));
     430    profile_attributes_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Profiles")), BorderFactory.createEmptyBorder(2,2,2,2)));
    405431    profile_attributes_pane.setLayout(new BorderLayout());
    406432    profile_attributes_pane.add(profile_attributes_scroll, BorderLayout.CENTER);
    407        
    408     profile_details_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(get("MEM.Profile_Details")), BorderFactory.createEmptyBorder(2,2,2,2)));
     433
     434    profile_details_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("MEM.Profile_Details")), BorderFactory.createEmptyBorder(2,2,2,2)));
    409435    profile_details_pane.setLayout(new BorderLayout());
    410436    //profile_details_pane.add(profile_name_pane, BorderLayout.NORTH);
    411437    profile_details_pane.add(profile_attributes_pane, BorderLayout.CENTER);
    412          
     438
    413439    details_pane.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
    414440    details_pane.setLayout(card_layout);
     
    488514    mds_tree = null;
    489515    target = null;
     516
    490517    // Dispose of inner dialogs
    491     if(add_element_action_listener != null) {
     518    if (add_element_action_listener != null) {
    492519        add_element_action_listener.dispose();
    493520        add_element_action_listener = null;
    494521    }
    495     if(add_or_edit_attribute_action_listener != null) {
     522    if (add_or_edit_attribute_action_listener != null) {
    496523        add_or_edit_attribute_action_listener.dispose();
    497524        add_or_edit_attribute_action_listener = null;
    498525    }
    499     if(add_or_edit_value_action_listener != null) {
     526    if (add_or_edit_value_action_listener != null) {
    500527        add_or_edit_value_action_listener.dispose();
    501528        add_or_edit_value_action_listener = null;
    502529    }
    503     ///ystem.err.println("Dispose MetadataEditorManager.");
    504530    super.dispose();
    505531    }
    506532
    507     private String get(String key) {
    508     return get(key, (String[])null);
    509     }
    510      
    511     private String get(String key, String arg) {
    512     String[] args = new String[1];
    513     args[0] = arg;
    514     return get(key, args);
    515     }
    516 
    517     private String get(String key, String[] args) {
    518     if(key.indexOf(".") == -1) {
    519         key = "MEM." + key;
    520     }
    521     return Gatherer.dictionary.get(key, args);
    522     }
    523533     
    524534    private void setControls(boolean a_s, boolean r_s, boolean a_f, boolean r_f, boolean a_e, boolean r_e, boolean a_a, boolean e_a, boolean r_a, boolean a_v, boolean e_v, boolean r_v) {
     
    554564        setSize(ADD_OR_EDIT_ATTRIBUTE_SIZE);
    555565        name_to_values = new HashMap();
     566
    556567        // Creation
    557568        JPanel content_pane = (JPanel) getContentPane();
     
    562573        JPanel target_pane = new JPanel();
    563574        target_pane.setOpaque(false);
    564         JLabel target_label = new JLabel(get("MEM.Target"));
     575        JLabel target_label = new JLabel();
    565576        target_label.setOpaque(false);
    566577        target_label.setPreferredSize(LABEL_SIZE);
     578        Dictionary.setText(target_label, "MEM.Target");
    567579        target = new JLabel();
    568580        target.setOpaque(false);
    569581
    570 
    571582        JPanel name_pane = new JPanel();
    572583        name_pane.setOpaque(false);
    573         JLabel name_label = new JLabel(get("MEM.Name"));
     584        JLabel name_label = new JLabel();
    574585        name_label.setOpaque(false);
    575586        name_label.setPreferredSize(LABEL_SIZE);
     587        Dictionary.setText(name_label, "MEM.Name");
    576588        name = new GComboBox();
    577589        name.setEditable(true);
     590        Dictionary.setTooltip(name, "MEM.Attribute_Name_Tooltip");
    578591
    579592        JPanel language_pane = new JPanel();
    580593        language_pane.setOpaque(false);
    581         JLabel language_label = new JLabel(get("MEM.Language"));
     594        JLabel language_label = new JLabel();
    582595        language_label.setOpaque(false);
    583596        language_label.setPreferredSize(LABEL_SIZE);
     597        Dictionary.setText(language_label, "MEM.Language");
    584598        language_box = new JComboBox(Gatherer.g_man.config_pane.getLanguageCodes().toArray());
    585599        language_box.setRenderer(new LanguageListCellRenderer());
     600        Dictionary.setTooltip(language_box, "MEM.Attribute_Language_Tooltip");
    586601
    587602        JPanel center_pane = new JPanel();
    588603        center_pane.setOpaque(false);
    589         value = new ComboArea(get("MEM.Values"), LABEL_SIZE);
     604        value = new ComboArea(Dictionary.newget("MEM.Values"), LABEL_SIZE);
    590605        value.setOpaque(false);
     606
    591607        JTextArea v_text_area = (JTextArea) value.getTextComponent();
    592608        v_text_area.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    594610        v_text_area.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    595611        v_text_area.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     612        Dictionary.setTooltip(v_text_area, "MEM.Attribute_Value_Tooltip");
     613
    596614        JPanel button_pane = new JPanel();
    597615        button_pane.setOpaque(false);
    598         ok_button = new JButton(get("General.OK"));
    599         cancel_button = new JButton(get("General.Cancel"));
    600                 // Connection
     616        ok_button = new JButton();
     617        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
     618        cancel_button = new JButton();
     619        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
     620
     621        // Connection
    601622        TextFieldEnabler ok_button_enabler = new TextFieldEnabler(ok_button);
    602623        cancel_button.addActionListener(this);
     
    604625        ok_button.addActionListener(this);
    605626        ok_button_enabler.add((JTextComponent)name.getEditor()); // Assuming the default editor is a JTextField!
    606                 // Layout
     627
     628        // Layout
    607629        target_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
    608630        target_pane.setLayout(new BorderLayout());
    609631        target_pane.add(target_label, BorderLayout.WEST);
    610632        target_pane.add(target, BorderLayout.CENTER);
    611                
     633
    612634        language_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
    613635        language_pane.setLayout(new BorderLayout());
     
    784806        if(source == add_attribute) {
    785807            add_type = true;
    786             setTitle(get("MEM.AddAttribute"));
     808            Dictionary.setText(this, "MEM.AddAttribute");
    787809            if(current_collection_file != null) {
    788810            // Name is empty in this one, however values must be the current elements in the collection.   
     
    809831            }
    810832            add_type = false;
    811             setTitle(get("MEM.EditAttribute"));
     833            Dictionary.setText(this, "MEM.EditAttribute");
    812834            String name_str = (String) model.getValueAt(current_attribute, 0);
    813835            String value_str = (String) model.getValueAt(current_attribute, model.getColumnCount() - 1);
     
    864886        else {
    865887        cont = false;
    866         JOptionPane.showMessageDialog(self, get("MEM.Attribute_Already_Exists"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     888        JOptionPane.showMessageDialog(self, Dictionary.newget("MEM.Attribute_Already_Exists"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    867889        }
    868890
     
    896918        else {
    897919        cont = false;
    898         JOptionPane.showMessageDialog(self, get("MEM.Attribute_Already_Exists"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     920        JOptionPane.showMessageDialog(self, Dictionary.newget("MEM.Attribute_Already_Exists"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    899921        }
    900922
     
    963985        JPanel center_pane = new JPanel();
    964986        center_pane.setOpaque(false);
     987
    965988        JPanel set_pane = new JPanel();
    966989        set_pane.setOpaque(false);
    967         JLabel set_label = new JLabel(get("MEM.Set"));
     990        JLabel set_label = new JLabel();
    968991        set_label.setOpaque(false);
    969992        set_label.setPreferredSize(LABEL_SIZE);
     993        Dictionary.setText(set_label, "MEM.Set");
    970994        set_field = new JLabel();
    971995        set_field.setOpaque(false);
     996
    972997        JPanel name_pane = new JPanel();
    973998        name_pane.setOpaque(false);
    974         JLabel name_label = new JLabel(get("MEM.Name"));
     999        JLabel name_label = new JLabel();
    9751000        name_label.setOpaque(false);
    9761001        name_label.setPreferredSize(LABEL_SIZE);
     1002        Dictionary.setText(name_label, "MEM.Name");
    9771003        name_field = new JTextField();
    9781004        name_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    9801006        name_field.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    9811007        name_field.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     1008        Dictionary.setTooltip(name_field, "MEM.Element_Name_Tooltip");
     1009
    9821010        JPanel button_pane = new JPanel();
    9831011        button_pane.setOpaque(false);
    984         ok_button = new JButton(get("General.OK"));
    985         cancel_button = new JButton(get("General.Cancel"));
     1012
     1013        ok_button = new JButton();
     1014        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
     1015        cancel_button = new JButton();
     1016        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
     1017
    9861018        TextFieldEnabler ok_button_enabler = new TextFieldEnabler(ok_button);
    987                 // Connection
     1019
     1020        // Connection
    9881021        cancel_button.addActionListener(this);
    9891022        ok_button.addActionListener(this);
    9901023        ok_button_enabler.add(name_field);
    991                 // Layout
     1024
     1025        // Layout
    9921026        set_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
    9931027        set_pane.setLayout(new BorderLayout());
     
    10151049        setLocation((Gatherer.config.screen_size.width - ADD_ELEMENT_SIZE.width) / 2, (Gatherer.config.screen_size.height - ADD_ELEMENT_SIZE.height) / 2);
    10161050    }
     1051
    10171052    /** Any implementation of ActionListener must include this method so that we can be informed when an action as occured on our registered component, allowing us to
    10181053     * @param event An <strong>ActionEvent</strong> containing information about the event.
     
    10391074        // Otherwise show an error message and do not proceed.
    10401075        else {
    1041             JOptionPane.showMessageDialog(self, get("MEM.Element_Already_Exists"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     1076            JOptionPane.showMessageDialog(self, Dictionary.newget("MEM.Element_Already_Exists"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    10421077        }
    10431078        name_str = null;
     
    10461081        // Dispose
    10471082        setVisible(false);
    1048        
    10491083        }
    10501084        else {
     
    10591093            // Warn the user that they can't do that dave.
    10601094            else {
    1061             JOptionPane.showMessageDialog(self, get("MEM.Cannot_Add_Elements_To_Greenstone_MDS"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     1095            JOptionPane.showMessageDialog(self, Dictionary.newget("MEM.Cannot_Add_Elements_To_Greenstone_MDS"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    10621096            }
    10631097        }
     
    10861120        setModal(true);
    10871121        setSize(ADD_FILE_SIZE);
    1088                 // Creation
     1122        // Creation
    10891123        JPanel content_pane = (JPanel) getContentPane();
    10901124        content_pane.setBackground(Gatherer.config.getColor("coloring.collection_heading_background", false));
     
    10931127        JPanel profile_pane = new JPanel();
    10941128        profile_pane.setOpaque(false);
    1095         JLabel profile_label = new JLabel(get("MEM.Profile"));
     1129        JLabel profile_label = new JLabel();
    10961130        profile_label.setOpaque(false);
    10971131        profile_label.setPreferredSize(LABEL_SIZE);
     1132        Dictionary.setText(profile_label, "MEM.Profile");
     1133
    10981134        JPanel name_pane = new JPanel();
    10991135        name_pane.setOpaque(false);
    1100         JLabel name_label = new JLabel(get("MEM.Name"));
     1136        JLabel name_label = new JLabel();
    11011137        name_label.setOpaque(false);
    11021138        name_label.setPreferredSize(LABEL_SIZE);
     1139        Dictionary.setText(name_label, "MEM.Name");
    11031140        name_field = new JTextField();
    11041141        name_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    11061143        name_field.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    11071144        name_field.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     1145        Dictionary.setTooltip(name_field, "MEM.Profile_Name_Tooltip");
     1146
    11081147        JPanel button_pane = new JPanel();
    11091148        button_pane.setOpaque(false);
    1110         ok_button = new JButton(get("General.OK"));
    1111         cancel_button = new JButton(get("General.Cancel"));
     1149
     1150        ok_button = new JButton();
     1151        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
     1152        cancel_button = new JButton();
     1153        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
     1154
    11121155        TextFieldEnabler ok_button_enabler = new TextFieldEnabler(ok_button);
    1113                 // Connection
     1156
     1157        // Connection
    11141158        cancel_button.addActionListener(this);
    11151159        ok_button.addActionListener(this);
    11161160        ok_button_enabler.add(name_field);
    1117                 // Layout
     1161
     1162        // Layout
    11181163        profile_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
    11191164        profile_pane.setLayout(new BorderLayout());
     
    11571202        // Otherwise warn the user and don't hide the prompt.
    11581203        else {
    1159             JOptionPane.showMessageDialog(self, get("MEM.File_Already_Exists"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     1204            JOptionPane.showMessageDialog(self, Dictionary.newget("MEM.File_Already_Exists"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    11601205        }
    11611206        name_str = null;
     
    11631208        else if(source == cancel_button) {
    11641209        setVisible(false);
    1165 
    11661210        }
    11671211        else {
     
    11921236        setModal(true);
    11931237        setSize(ADD_SET_SIZE);
    1194         setTitle(get("MEM.AddSet"));
    1195                 // Creation
     1238        Dictionary.setText(this, "MEM.AddSet");
     1239
     1240        // Creation
    11961241        JPanel content_pane = (JPanel) getContentPane();
    11971242        content_pane.setBackground(Gatherer.config.getColor("coloring.collection_heading_background", false));
     
    12011246        JPanel namespace_pane = new JPanel();
    12021247        namespace_pane.setOpaque(false);
    1203         JLabel namespace_label = new JLabel(get("MEM.Namespace"));
     1248        JLabel namespace_label = new JLabel();
    12041249        namespace_label.setOpaque(false);
    12051250        namespace_label.setPreferredSize(LABEL_SIZE);
     1251        Dictionary.setText(namespace_label, "MEM.Namespace");
    12061252        namespace_field = new JTextField();
    12071253        namespace_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    12091255        namespace_field.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    12101256        namespace_field.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     1257        Dictionary.setTooltip(namespace_field, "MEM.Set_Namespace_Tooltip");
    12111258
    12121259        JPanel name_pane = new JPanel();
    12131260        name_pane.setOpaque(false);
    1214         JLabel name_label = new JLabel(get("MEM.Name"));
     1261        JLabel name_label = new JLabel();
    12151262        name_label.setOpaque(false);
    12161263        name_label.setPreferredSize(LABEL_SIZE);
     1264        Dictionary.setText(name_label, "MEM.Name");
    12171265        name_field = new JTextField();
    12181266        name_field.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    12201268        name_field.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    12211269        name_field.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     1270        Dictionary.setTooltip(name_field, "MEM.Set_Name_Tooltip");
    12221271
    12231272        JPanel button_pane = new JPanel();
    12241273        button_pane.setOpaque(false);
    1225         ok_button = new JButton(get("General.OK"));
    1226         ok_button.setEnabled(false);
    1227         cancel_button = new JButton(get("General.Cancel"));
     1274
     1275        ok_button = new JButton();
     1276        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
     1277        cancel_button = new JButton();
     1278        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    12281279        TextFieldEnabler ok_button_enabler = new TextFieldEnabler(ok_button);
    1229                 // Connection
     1280
     1281        // Connection
    12301282        cancel_button.addActionListener(this);
    12311283        ok_button.addActionListener(this);
    12321284        ok_button_enabler.add(name_field);
    12331285        ok_button_enabler.add(namespace_field);
    1234                 // Layout
     1286
     1287        // Layout
    12351288        namespace_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
    12361289        namespace_pane.setLayout(new BorderLayout());
     
    12771330        // Otherwise show a warning.
    12781331        else {
    1279             JOptionPane.showMessageDialog(self, get("MEM.Set_Already_Exists"), get("General.Error"), JOptionPane.ERROR_MESSAGE);
     1332            JOptionPane.showMessageDialog(self, Dictionary.newget("MEM.Set_Already_Exists"), Dictionary.newget("General.Error"), JOptionPane.ERROR_MESSAGE);
    12801333        }
    12811334        name_str = null;
     
    13171370        this.setModal(true);
    13181371        this.setSize(ADD_OR_EDIT_VALUE_SIZE);
     1372
    13191373        // Create
    13201374        JPanel content_pane = (JPanel) getContentPane();
     
    13261380        JPanel subject_tree_pane = new JPanel();
    13271381        subject_tree_pane.setOpaque(false);
    1328         JLabel subject_tree_label = new JLabel(get("MEM.Subject"));
     1382        JLabel subject_tree_label = new JLabel();
    13291383        subject_tree_label.setOpaque(false);
     1384        Dictionary.setText(subject_tree_label, "MEM.Subject");
    13301385        subject_tree = new SmarterTree();
    13311386        subject_tree.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    13351390        JPanel value_pane = new JPanel();
    13361391        value_pane.setOpaque(false);
    1337         JLabel value_label = new JLabel(get("MEM.Value"));
     1392        JLabel value_label = new JLabel();
    13381393        value_label.setOpaque(false);
     1394        Dictionary.setText(value_label, "MEM.Value");
    13391395        value = new JTextArea();
    13401396        value.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    13421398        value.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    13431399        value.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     1400        Dictionary.setTooltip(value, "MEM.Value_Tooltip");
     1401
    13441402        JPanel alias_pane = new JPanel();
    13451403        alias_pane.setOpaque(false);
    1346         JLabel alias_label = new JLabel(get("MEM.Alias"));
     1404        JLabel alias_label = new JLabel();
    13471405        alias_label.setOpaque(false);
    13481406        alias_label.setPreferredSize(LABEL_SIZE);
     1407        Dictionary.setText(alias_label, "MEM.Alias");
     1408
    13491409        alias = new JTextField();
    13501410        alias.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false));
     
    13521412        alias.setSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    13531413        alias.setSelectedTextColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
     1414        Dictionary.setText(alias, "MEM.Alias_Tooltip");
     1415
    13541416        JPanel button_pane = new JPanel();
    13551417        button_pane.setOpaque(false);
    1356         ok_button = new JButton(get("General.OK"));
     1418
     1419        ok_button = new JButton();
    13571420        ok_button.setEnabled(false);
     1421        Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip");
     1422        cancel_button = new JButton();
     1423        Dictionary.setBoth(cancel_button, "General.Cancel", "General.Pure_Cancel_Tooltip");
    13581424        TextFieldEnabler ok_button_enabler = new TextFieldEnabler(ok_button);
    1359         cancel_button = new JButton(get("General.Cancel"));
     1425
    13601426        // Connect
    13611427        ok_button_enabler.add(value);
     
    13631429        ok_button.addActionListener(this);
    13641430        subject_tree.addTreeSelectionListener(this);
     1431
    13651432        // Layout
    13661433        subject_tree_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
     
    14851552            value.setText("");
    14861553            alias.setText("");
    1487             setTitle(get("MEM.AddValue"));
     1554            Dictionary.setText(this, "MEM.AddValue");
    14881555        }
    14891556        else {
     
    14971564            value.setText(current_value_node.toString());
    14981565            alias.setText(current_value_node.getAlias());
    1499             setTitle(get("MEM.EditValue"));
     1566            Dictionary.setText(this, "MEM.EditValue");
    15001567        }
    15011568        model = null;
     
    15531620        // I don't know why this is causing a problem even after the dialog has been disposed, but it is.
    15541621        GValueModel value_model = Gatherer.c_man.msm.getValueTree(current_element);
    1555         if(value_model != null) {
     1622        if (value_model != null) {
    15561623        value_model.removeTreeModelListener(keep_root_expanded_listener);
    15571624        }
     
    15861653    public void actionPerformed(ActionEvent event) {
    15871654        if(current_attribute != -1) {
    1588         int result = JOptionPane.showOptionDialog(self, get("MEM.Confirm_Removal", get("MEM.Attribute")), get("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
     1655        int result = JOptionPane.showOptionDialog(self, Dictionary.newget("MEM.Confirm_Removal", Dictionary.newget("MEM.Attribute")), Dictionary.newget("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
    15891656        // Remove this attribute
    15901657        if(result == 0) {
     
    16341701    public void actionPerformed(ActionEvent event) {
    16351702        if(current_element != null) {
    1636         int result = JOptionPane.showOptionDialog(self, get("MEM.Confirm_Removal", get("MEM.Element")), get("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
     1703        int result = JOptionPane.showOptionDialog(self, Dictionary.newget("MEM.Confirm_Removal", Dictionary.newget("MEM.Element")), Dictionary.newget("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
    16371704        // Remove this attribute
    16381705        if(result == 0) {
     
    16621729    public void actionPerformed(ActionEvent event) {
    16631730        if(current_collection_file != null) {
    1664         int result = JOptionPane.showOptionDialog(self, get("MEM.Confirm_Removal", get("MEM.File")), get("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
     1731        int result = JOptionPane.showOptionDialog(self, Dictionary.newget("MEM.Confirm_Removal", Dictionary.newget("MEM.File")), Dictionary.newget("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
    16651732        // Remove the current collection file profile from the profiler.
    16661733        if(result == 0) {
     
    16871754    public void actionPerformed(ActionEvent event) {
    16881755        if(current_set != null) {
    1689         int result = JOptionPane.showOptionDialog(self, get("MEM.Confirm_Removal", get("MEM.Set")), get("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
     1756        int result = JOptionPane.showOptionDialog(self, Dictionary.newget("MEM.Confirm_Removal", Dictionary.newget("MEM.Set")), Dictionary.newget("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
    16901757        // Remove the currently selected set
    16911758        if(result == 0) {
     
    17121779    public void actionPerformed(ActionEvent event) {
    17131780        if(current_value_node != null) {                 
    1714         int result = JOptionPane.showOptionDialog(self, get("MEM.Confirm_Removal", get("MEM.Value")), get("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
     1781        int result = JOptionPane.showOptionDialog(self, Dictionary.newget("MEM.Confirm_Removal", Dictionary.newget("MEM.Value")), Dictionary.newget("MEM.Confirm_Removal_Title"), JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, dialog_options, dialog_options[0]);
    17151782        // Remove the current selected value
    17161783        if(result == 0) {
     
    18421909                String source = (String) sources.get(i);
    18431910                String action = Gatherer.c_man.msm.profiler.getAction(current_collection_file, source);
    1844                 if(action == null) {
    1845                 action = get("MEM.Ignore");
     1911                if (action == null) {
     1912                action = Dictionary.newget("MEM.Ignore");
    18461913                }
    18471914                attributes.add(new Attribute(source, action));
    18481915            }
    1849             atm = new AttributeTableModel(attributes, get("MEM.Source"), get("MEM.Target"), get("MEM.Ignore"));
     1916            atm = new AttributeTableModel(attributes, Dictionary.newget("MEM.Source"), Dictionary.newget("MEM.Target"), Dictionary.newget("MEM.Ignore"));
    18501917            //current_node.setModel(atm);
    18511918            }
     
    18611928            atm = current_node.getModel();
    18621929            if(atm == null) {
    1863             atm = new AttributeTableModel(current_element.getAttributes(), get("MEM.Name"), get("MEM.Language_Code"), get("MEM.Value"), "");
     1930            atm = new AttributeTableModel(current_element.getAttributes(), Dictionary.newget("MEM.Name"), Dictionary.newget("MEM.Language_Code"), Dictionary.newget("MEM.Value"), "");
    18641931            //current_node.setModel(atm);
    18651932            }
     
    18991966                attribute = null;
    19001967            }
    1901             atm = new AttributeTableModel(attributes, get("MEM.Name"), get("MEM.Value"), "");
     1968            atm = new AttributeTableModel(attributes, Dictionary.newget("MEM.Name"), Dictionary.newget("MEM.Value"), "");
    19021969            //current_node.setModel(atm);
    19031970            temp = null;
Note: See TracChangeset for help on using the changeset viewer.