Ignore:
Timestamp:
2003-12-19T14:45:12+13:00 (21 years ago)
Author:
jmt12
Message:

Changed JButtons for GLIButtons, which know whether they should paint their background depending on what platform they are run on, and finished keyboard shortcuts

Location:
trunk/gli/src/org/greenstone/gatherer/cdm
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java

    r6087 r6318  
    5252import org.greenstone.gatherer.gui.DoubleImageButton;
    5353import org.greenstone.gatherer.gui.GComboBox;
     54import org.greenstone.gatherer.gui.GLIButton;
    5455import org.greenstone.gatherer.msm.MSMEvent;
    5556import org.greenstone.gatherer.msm.MSMListener;
     
    571572        Collections.sort(library);
    572573        // Create
    573         add = new JButton();
     574        add = new GLIButton();
     575        add.setMnemonic(KeyEvent.VK_A);
    574576        Dictionary.registerBoth(add, "CDM.ClassifierManager.Add", "CDM.ClassifierManager.Add_Tooltip");
    575577        JPanel button_pane = new JPanel();
    576578        JPanel central_pane = new JPanel();
    577         configure = new JButton();
     579        configure = new GLIButton();
    578580        configure.setEnabled(false);
     581        configure.setMnemonic(KeyEvent.VK_C);
    579582        Dictionary.registerBoth(configure, "CDM.ClassifierManager.Configure", "CDM.ClassifierManager.Configure_Tooltip");
    580583        JPanel header_pane = new JPanel();
     
    608611        JPanel classifier_list_pane = new JPanel();
    609612        JPanel classifier_pane = new JPanel();
    610         remove = new JButton();
     613        remove = new GLIButton();
    611614        remove.setEnabled(false);
     615        remove.setMnemonic(KeyEvent.VK_R);
    612616        Dictionary.registerBoth(remove, "CDM.ClassifierManager.Remove", "CDM.ClassifierManager.Remove_Tooltip");
    613617
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java

    r6051 r6318  
    3434import org.greenstone.gatherer.Gatherer;
    3535import org.greenstone.gatherer.cdm.CommandTokenizer;
     36import org.greenstone.gatherer.gui.GLIButton;
    3637import org.greenstone.gatherer.msm.MSMUtils;
    3738import org.greenstone.gatherer.util.DOMTree;
     
    337338    JPanel content_pane = (JPanel) dialog.getContentPane();
    338339    final DOMTree tree = new DOMTree(document);
    339     JButton refresh_button = new JButton("Refresh Tree");
     340    JButton refresh_button = new GLIButton("Refresh Tree");
     341    refresh_button.setMnemonic(KeyEvent.VK_R);
    340342    refresh_button.addActionListener(new ActionListener() {
    341343        public void actionPerformed(ActionEvent event) {
     
    12281230    Element command_element = null;
    12291231    boolean use_metadata_files = false;
    1230     boolean show_progress = false;
    12311232    try {
    12321233        CommandTokenizer tokenizer = new CommandTokenizer(command_str);
     
    12501251            use_metadata_files = true;
    12511252            }
    1252             else if(name.substring(1).equals(SHOW_PROGRESS_ARGUMENT)) {
    1253                show_progress = true;
    1254             }
    12551253            option_element.setAttribute(NAME_ATTRIBUTE, name.substring(1));
    12561254            option_element.setAttribute(ASSIGNED_ATTRIBUTE, TRUE_STR);
     
    12771275        // We must have some RecPlug options: use_metadata_files, and show_progress
    12781276        if (type.equals(RECPLUG_STR)) {
    1279             if (!use_metadata_files) {
     1277            if (!use_metadata_files) {
    12801278            Element option_element = document.createElement(OPTION_ELEMENT);
    12811279            option_element.setAttribute(NAME_ATTRIBUTE, USE_METADATA_FILES_ARGUMENT);
     
    12841282            command_element.appendChild(option_element);
    12851283            option_element = null;
    1286             }
    1287             if(!show_progress) {
    1288                Element option_element = document.createElement(OPTION_ELEMENT);
    1289                option_element.setAttribute(NAME_ATTRIBUTE, SHOW_PROGRESS_ARGUMENT);
    1290                option_element.setAttribute(ASSIGNED_ATTRIBUTE, TRUE_STR);
    1291                option_element.setAttribute(CUSTOM_ATTRIBUTE, TRUE_STR);
    1292                command_element.appendChild(option_element);
    1293                option_element = null;
    1294             }
     1284            }
    12951285        }
    12961286        type = null;
  • trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java

    r5755 r6318  
    4747import org.greenstone.gatherer.cdm.DOMProxyListModel;
    4848import org.greenstone.gatherer.cdm.Format;
     49import org.greenstone.gatherer.gui.GLIButton;
    4950import org.greenstone.gatherer.msm.ElementWrapper;
    5051import org.greenstone.gatherer.util.StaticStrings;
     
    305306        Dictionary.registerText(editor_label, "CDM.FormatManager.Editor");
    306307
    307         //default_button = new JButton();
     308        //default_button = new GLIButton();
    308309        //default_button.setEnabled(false);
    309310        //default_button.setMnemonic(KeyEvent.VK_D);
     
    324325        Dictionary.registerTooltip(variable_combobox, "CDM.FormatManager.Variable_Tooltip");
    325326
    326         insert_button = new JButton();
     327        insert_button = new GLIButton();
    327328        insert_button.setMnemonic(KeyEvent.VK_I);
    328329        Dictionary.registerBoth(insert_button, "CDM.FormatManager.Insert", "CDM.FormatManager.Insert_Tooltip");
     
    333334
    334335        JPanel button_pane = new JPanel();
    335         add_button = new JButton();
     336        add_button = new GLIButton();
    336337        add_button.setEnabled(false);
    337338        add_button.setMnemonic(KeyEvent.VK_A);
    338339        Dictionary.registerBoth(add_button, "CDM.FormatManager.Add", "CDM.FormatManager.Add_Tooltip");
    339         replace_button = new JButton();
     340        replace_button = new GLIButton();
    340341        replace_button.setEnabled(false);
    341342        replace_button.setMnemonic(KeyEvent.VK_C);
    342343        Dictionary.registerBoth(replace_button, "CDM.FormatManager.Replace", "CDM.FormatManager.Replace_Tooltip");
    343         remove_button = new JButton();
     344        remove_button = new GLIButton();
    344345        remove_button.setEnabled(false);
    345346        remove_button.setMnemonic(KeyEvent.VK_R);
  • trunk/gli/src/org/greenstone/gatherer/cdm/IndexManager.java

    r6051 r6318  
    4242import org.greenstone.gatherer.gui.DoubleImageButton;
    4343import org.greenstone.gatherer.gui.GComboBox;
     44import org.greenstone.gatherer.gui.GLIButton;
    4445import org.greenstone.gatherer.msm.ElementWrapper;
    4546import org.greenstone.gatherer.msm.MSMUtils;
     
    596597
    597598        JPanel button_pane = new JPanel();
    598         add_button = new JButton();
     599        add_button = new GLIButton();
    599600        add_button.setEnabled(false);
    600601        add_button.setMnemonic(KeyEvent.VK_A);
    601602        Dictionary.registerBoth(add_button, "CDM.IndexManager.Add_Index", "CDM.IndexManager.Add_Index_Tooltip");
    602         set_default_button = new JButton();
     603        set_default_button = new GLIButton();
    603604        set_default_button.setEnabled(false);
    604605        set_default_button.setMnemonic(KeyEvent.VK_S);
    605606        Dictionary.registerBoth(set_default_button, "CDM.IndexManager.Set_Default", "CDM.IndexManager.Set_Default_Tooltip");
    606         remove_button = new JButton();
     607        remove_button = new GLIButton();
    607608        remove_button.setEnabled(false);
    608609        remove_button.setMnemonic(KeyEvent.VK_R);
     
    981982        JPanel index_button_panel = new JPanel();
    982983
    983         add_index_button = new JButton();
     984        add_index_button = new GLIButton();
    984985        add_index_button.setEnabled(false);
    985986        add_index_button.setMnemonic(KeyEvent.VK_A);
    986987        Dictionary.registerBoth(add_index_button, "CDM.IndexManager.Add_Index", "CDM.IndexManager.Add_Index_Tooltip");
    987988
    988         add_all_button = new JButton();
     989        add_all_button = new GLIButton();
    989990        add_all_button.setEnabled(true);
    990991        add_all_button.setMnemonic(KeyEvent.VK_L);
    991992        Dictionary.registerBoth(add_all_button, "CDM.IndexManager.MGPP.Add_All_Metadata", "CDM.IndexManager.MGPP.Add_All_Metadata_Tooltip");
    992993
    993         replace_button = new JButton();
     994        replace_button = new GLIButton();
    994995        replace_button.setEnabled(false);
    995996        replace_button.setMnemonic(KeyEvent.VK_C);
    996997        Dictionary.registerBoth(replace_button, "CDM.IndexManager.MGPP.Replace_Index", "CDM.IndexManager.MGPP.Replace_Index_Tooltip");
    997998
    998         remove_index_button = new JButton();
     999        remove_index_button = new GLIButton();
    9991000        remove_index_button.setEnabled(false);
    10001001        remove_index_button.setMnemonic(KeyEvent.VK_A);
     
    11151116        JPanel level_button_panel = new JPanel();
    11161117
    1117         add_level_button = new JButton("CDM.IndexManager.MGPP.Add_Level");
     1118        add_level_button = new GLIButton("CDM.IndexManager.MGPP.Add_Level");
    11181119        add_level_button.setEnabled(false);
    11191120        add_level_button.setMnemonic(KeyEvent.VK_A);
    11201121        Dictionary.registerBoth(add_level_button, "CDM.IndexManager.MGPP.Add_Level", "CDM.IndexManager.MGPP.Add_Level_Tooltip");
    11211122
    1122         remove_level_button = new JButton("CDM.IndexManager.MGPP.Remove_Level");
     1123        remove_level_button = new GLIButton("CDM.IndexManager.MGPP.Remove_Level");
    11231124        remove_level_button.setEnabled(false);
    11241125        remove_level_button.setMnemonic(KeyEvent.VK_A);
  • trunk/gli/src/org/greenstone/gatherer/cdm/LanguageManager.java

    r5902 r6318  
    4646import org.greenstone.gatherer.cdm.Language;
    4747import org.greenstone.gatherer.cdm.LanguageListCellRenderer;
     48import org.greenstone.gatherer.gui.GLIButton;
    4849import org.w3c.dom.*;
    4950
     
    294295        JPanel button_panel = new JPanel();
    295296
    296         add_button = new JButton();
     297        add_button = new GLIButton();
    297298        add_button.setMnemonic(KeyEvent.VK_A);
    298299        Dictionary.registerBoth(add_button, "CDM.LanguageManager.Add", "CDM.LanguageManager.Add_Tooltip");
    299300
    300         remove_button = new JButton();
     301        remove_button = new GLIButton();
    301302        remove_button.setMnemonic(KeyEvent.VK_R);
    302303        remove_button.setEnabled(false);
    303304        Dictionary.registerBoth(remove_button, "CDM.LanguageManager.Remove", "CDM.LanguageManager.Remove_Tooltip");
    304305
    305         clear_button = new JButton();
     306        clear_button = new GLIButton();
    306307        clear_button.setMnemonic(KeyEvent.VK_C);
    307308        // If there is a default language, then this is enabled
     
    309310        Dictionary.registerBoth(clear_button, "CDM.LanguageManager.Clear_Default", "CDM.LanguageManager.Clear_Default_Tooltip");
    310311
    311         set_button = new JButton();
     312        set_button = new GLIButton();
    312313        set_button.setMnemonic(KeyEvent.VK_S);
    313314        set_button.setEnabled(false);
  • trunk/gli/src/org/greenstone/gatherer/cdm/PlugInManager.java

    r6254 r6318  
    4646import org.greenstone.gatherer.gui.DoubleImageButton;
    4747import org.greenstone.gatherer.gui.GComboBox;
     48import org.greenstone.gatherer.gui.GLIButton;
    4849import org.greenstone.gatherer.msm.MSMUtils;
    4950import org.greenstone.gatherer.util.StaticStrings;
     
    590591    public PlugInControl() {
    591592        // Create
    592         add = new JButton();
     593        add = new GLIButton();
    593594        add.setMnemonic(KeyEvent.VK_A);
    594595        Dictionary.registerBoth(add, "CDM.PlugInManager.Add", "CDM.PlugInManager.Add_Tooltip");
     
    597598        central_pane = new JPanel();
    598599
    599         configure = new JButton();
     600        configure = new GLIButton();
    600601        configure.setEnabled(false);
    601602        configure.setMnemonic(KeyEvent.VK_C);
     
    662663        plugin_pane = new JPanel();
    663664
    664         remove = new JButton();
     665        remove = new GLIButton();
    665666        remove.setEnabled(false);
    666667        remove.setMnemonic(KeyEvent.VK_R);
  • trunk/gli/src/org/greenstone/gatherer/cdm/SearchTypeManager.java

    r6051 r6318  
    4545import org.greenstone.gatherer.gui.DoubleImageButton;
    4646import org.greenstone.gatherer.gui.GComboBox;
     47import org.greenstone.gatherer.gui.GLIButton;
    4748import org.greenstone.gatherer.msm.MSMUtils;
    4849import org.greenstone.gatherer.util.Utility;
     
    219220
    220221        JPanel button_panel = new JPanel();
    221         add_button = new JButton();
     222        add_button = new GLIButton();
    222223        add_button.setEnabled(false);
    223224        add_button.setMnemonic(KeyEvent.VK_A);
    224225        Dictionary.registerBoth(add_button, "CDM.SearchTypeManager.Add", "CDM.SearchTypeManager.Add_Tooltip");
    225226
    226         remove_button = new JButton();
     227        remove_button = new GLIButton();
    227228        remove_button.setEnabled(false);
    228229        remove_button.setMnemonic(KeyEvent.VK_R);
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndexManager.java

    r5903 r6318  
    4040import org.greenstone.gatherer.cdm.Subcollection;
    4141import org.greenstone.gatherer.cdm.SubcollectionIndex;
     42import org.greenstone.gatherer.gui.GLIButton;
    4243import org.greenstone.gatherer.msm.ElementWrapper;
    4344import org.greenstone.gatherer.util.ExclusiveListSelectionListener;
     
    223224        JPanel button_pane = new JPanel();
    224225
    225         add_index_button = new JButton();
     226        add_index_button = new GLIButton();
    226227        add_index_button.setMnemonic(KeyEvent.VK_A);
    227228        add_index_button.setEnabled(false);
    228229        Dictionary.registerBoth(add_index_button, "CDM.SubcollectionIndexManager.Add_Subindex", "CDM.SubcollectionIndexManager.Add_Subindex_Tooltip");
    229230
    230         clear_default_button = new JButton();
     231        clear_default_button = new GLIButton();
    231232        clear_default_button.setMnemonic(KeyEvent.VK_C);
    232233        clear_default_button.setEnabled(default_index != null);
     
    247248        default_value_field.setEditable(false);
    248249
    249         remove_index_button = new JButton();
     250        remove_index_button = new GLIButton();
    250251        remove_index_button.setMnemonic(KeyEvent.VK_R);
    251252        remove_index_button.setEnabled(false);
    252253        Dictionary.registerBoth(remove_index_button, "CDM.SubcollectionIndexManager.Remove_Subindex", "CDM.SubcollectionIndexManager.Remove_Subindex_Tooltip");
    253254
    254         set_default_button = new JButton();
     255        set_default_button = new GLIButton();
    255256        set_default_button.setMnemonic(KeyEvent.VK_S);
    256257        set_default_button.setEnabled(false);
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionManager.java

    r5785 r6318  
    4343import org.greenstone.gatherer.cdm.DOMProxyListModel;
    4444import org.greenstone.gatherer.cdm.Subcollection;
     45import org.greenstone.gatherer.gui.GLIButton;
    4546import org.greenstone.gatherer.gui.NonWhitespaceField;
    4647import org.greenstone.gatherer.msm.ElementWrapper;
     
    192193
    193194        JPanel button_pane_3 = new JPanel();
    194         add_button = new JButton();
     195        add_button = new GLIButton();
    195196        add_button.setMnemonic(KeyEvent.VK_A);
    196197        add_button.setEnabled(false);
    197198        Dictionary.registerBoth(add_button, "CDM.SubcollectionManager.Add", "CDM.SubcollectionManager.Add_Tooltip");
    198         remove_button = new JButton();
     199        remove_button = new GLIButton();
    199200        remove_button.setMnemonic(KeyEvent.VK_R);
    200201        remove_button.setEnabled(false);
    201202        Dictionary.registerBoth(remove_button, "CDM.SubcollectionManager.Remove", "CDM.SubcollectionManager.Remove_Tooltip");
    202         update_button = new JButton();
     203        update_button = new GLIButton();
    203204        update_button.setMnemonic(KeyEvent.VK_U);
    204205        update_button.setEnabled(false);
  • trunk/gli/src/org/greenstone/gatherer/cdm/TranslationView.java

    r5901 r6318  
    4242import org.greenstone.gatherer.cdm.LanguageListCellRenderer;
    4343import org.greenstone.gatherer.cdm.SubcollectionIndex;
     44import org.greenstone.gatherer.gui.GLIButton;
    4445
    4546/** This class provides a graphical interface to allow a user to quickly and conviently (ie all in one place) translate the text fragments associated with general metadata and indexes into each of the assigned languages in the collection. It should provide clear controls for the editing of these text fragments, plus clear indicate what languages still need further translation, which it will do through a combination of coloring and other visual indicators.
     
    260261
    261262        JPanel button_pane = new JPanel();
    262         add_button = new JButton();
     263        add_button = new GLIButton();
    263264        add_button.setEnabled(false);
    264265        add_button.setMnemonic(KeyEvent.VK_A);
    265266        Dictionary.registerBoth(add_button, "CDM.TranslationManager.Add", "CDM.TranslationManager.Add_Tooltip");
    266         replace_button = new JButton();
     267        replace_button = new GLIButton();
    267268        replace_button.setEnabled(false);
    268269        replace_button.setMnemonic(KeyEvent.VK_C);
    269270        Dictionary.registerBoth(replace_button, "CDM.TranslationManager.Replace", "CDM.TranslationManager.Replace_Tooltip");
    270         remove_button = new JButton();
     271        remove_button = new GLIButton();
    271272        remove_button.setEnabled(false);
    272273        remove_button.setMnemonic(KeyEvent.VK_R);
Note: See TracChangeset for help on using the changeset viewer.