Ignore:
Timestamp:
2003-10-07T15:35:23+13:00 (21 years ago)
Author:
mdewsnip
Message:

Changed calls to the Dictionary.

File:
1 edited

Legend:

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

    r5571 r5593  
    229229
    230230
    231     static public String newget(String key)
    232     {
    233     return self.get(key);
    234     }
    235 
    236 
    237     static public String newget(String key, String arg)
     231    static public String get(String key)
     232    {
     233    return self.oldget(key);
     234    }
     235
     236
     237    static public String get(String key, String arg)
    238238    {
    239239    String[] args = new String[1];
    240240    args[0] = arg;
    241     return self.get(key, args);
    242     }
    243 
    244 
    245     static public String newget(String key, String[] args)
    246     {
    247     return self.get(key, args);
     241    return self.oldget(key, args);
     242    }
     243
     244
     245    static public String get(String key, String[] args)
     246    {
     247    return self.oldget(key, args);
    248248    }
    249249
     
    255255     * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.
    256256     */
    257     public String get(String key) {
    258     return get(key, (String[])null);
    259     }
     257    public String oldget(String key) {
     258    return oldget(key, (String[])null);
     259    }
     260
    260261    /**
    261262     * @deprecated
    262263     * Convienence method with transforms the second string argument into a string array. */
    263     public String get(String key, String arg) {
     264    public String oldget(String key, String arg) {
    264265    String[] args = new String[1];
    265266    args[0] = arg;
    266     return get(key, args);
     267    return oldget(key, args);
    267268    }
    268269
     
    273274     * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.
    274275     */
    275     public String get(String key, String args[]) {
     276    public String oldget(String key, String args[]) {
    276277    if(key_list != null) {
    277278        synchronized(this) {
     
    310311            f_subargs[0] = "Arial";
    311312            }
    312             complete = complete + get("Farg" + arg_num, f_subargs);
     313            complete = complete + oldget("Farg" + arg_num, f_subargs);
    313314        }
    314315        }
     
    452453
    453454        if (details.has_text) {
    454         text = self.get(details.text_key, details.text_args);
     455        text = self.oldget(details.text_key, details.text_args);
    455456        }
    456457        if (details.has_tooltip) {
    457         tooltip = self.get(details.tooltip_key, (String[]) null);
     458        tooltip = self.oldget(details.tooltip_key, (String[]) null);
    458459        }
    459460    }
     
    496497
    497498    /**
    498      * @deprecated
    499      * Register a tab pane component. */
     499     * Register a tab pane component. This will be deprecated eventually. */
    500500    static public void register(JTabbedPane component)
    501501    {
    502     if(component != null) {
     502    if (component != null) {
    503503        String[] args = new String[component.getTabCount()];
    504504
    505505        // Iterate through the tabbed panes tabs, updating values and recording the original key of each item in args.
    506         for(int i = 0; i < args.length; i++) {
     506        for (int i = 0; i < args.length; i++) {
    507507        if (args[i] == null) {
    508508            args[i] = component.getTitleAt(i);
    509509        }
    510         String value = self.get(args[i], (String[])null);
    511         String tooltip = self.get(args[i] + "_Tooltip", (String[])null);
    512         JTabbedPaneChangeTask task = new JTabbedPaneChangeTask(component, args[i], i, value, tooltip);
     510        String value = self.oldget(args[i], (String[]) null);
     511        String tooltip = self.oldget(args[i] + "_Tooltip", (String[]) null);
     512        JTabbedPaneChangeTask task = new JTabbedPaneChangeTask(component, i, value, tooltip);
    513513        SwingUtilities.invokeLater(task);
    514514        }
     
    520520    static private class JTabbedPaneChangeTask
    521521    implements Runnable {
    522     protected String key;
    523     protected String value;
     522
     523    private JTabbedPane component;
    524524    private int index;
    525     private JTabbedPane component;
     525    private String value;
    526526    private String tooltip;
    527527
    528     public JTabbedPaneChangeTask(JTabbedPane component, String key, int index, String value, String tooltip) {
    529         this.key = key;
    530         this.value = value;
     528    public JTabbedPaneChangeTask(JTabbedPane component, int index, String value, String tooltip) {
    531529        this.component = component;
    532530        this.index = index;
     531        this.value = value;
    533532        this.tooltip = tooltip;
    534533    }
     534
    535535    public void run() {
    536536        component.setTitleAt(index, value);
    537         if(!tooltip.equals(key+"_Tooltip")) {
    538         component.setToolTipTextAt(index, tooltip);
    539         }
    540         else {
    541         component.setToolTipTextAt(index, null);
    542         }
     537        component.setToolTipTextAt(index, tooltip);
    543538    }
    544539    }
Note: See TracChangeset for help on using the changeset viewer.