Changeset 10012


Ignore:
Timestamp:
2005-06-03T15:36:09+12:00 (19 years ago)
Author:
mdewsnip
Message:

Removed the last of the graphical functions from the Utility class -- meaning that it can now be used by server-side programs for the GLI applet.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
5 edited

Legend:

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

    r10006 r10012  
    475475
    476476        // Help menu. Is not used! --Matthew
    477         help = new JMenu();
    478         help.setIcon(Utility.HELP_ICON);
    479         Dictionary.setText(help, "Menu.Help");
     477        // help = new JMenu();
     478        // help.setIcon(JarTools.getImage("help.gif"));
     479        // Dictionary.setText(help, "Menu.Help");
    480480
    481481        help_help = new JMenuItem();
  • trunk/gli/src/org/greenstone/gatherer/gui/MenuBar.java

    r9243 r10012  
    4444import org.greenstone.gatherer.Dictionary;
    4545import org.greenstone.gatherer.Gatherer;
     46import org.greenstone.gatherer.util.JarTools;
    4647import org.greenstone.gatherer.util.Utility;
    4748
     
    5152 */
    5253public class MenuBar
    53     extends JMenuBar {
     54    extends JMenuBar
     55{
     56    static public ImageIcon BLANK_ICON = JarTools.getImage("blank.gif");
     57    static public ImageIcon HELP_ICON = JarTools.getImage("help.gif");
     58
    5459    /** The icon to be displayed alongside the context choosen help file. */
    5560    private int current_tab          = -1;
     
    180185    // Help menu
    181186    help = new JMenu();
    182     help.setIcon(Utility.HELP_ICON);
     187    help.setIcon(HELP_ICON);
    183188    Dictionary.setText(help, "Menu.Help");
    184189
     
    187192    Dictionary.registerText(help_general, "Source.General");
    188193
    189     help_download = new JMenuItem(Utility.BLANK_ICON);
     194    help_download = new JMenuItem(BLANK_ICON);
    190195    help_download.addActionListener(Gatherer.g_man);
    191196    Dictionary.registerText(help_download, "GUI.Download");
    192197
    193     help_gather = new JMenuItem(Utility.BLANK_ICON);
     198    help_gather = new JMenuItem(BLANK_ICON);
    194199    help_gather.addActionListener(Gatherer.g_man);
    195200    Dictionary.registerText(help_gather, "GUI.Gather");
    196201
    197     help_enrich = new JMenuItem(Utility.BLANK_ICON);
     202    help_enrich = new JMenuItem(BLANK_ICON);
    198203    help_enrich.addActionListener(Gatherer.g_man);
    199204    Dictionary.registerText(help_enrich, "GUI.Enrich");
    200205
    201     help_design = new JMenuItem(Utility.BLANK_ICON);
     206    help_design = new JMenuItem(BLANK_ICON);
    202207    help_design.addActionListener(Gatherer.g_man);
    203208    Dictionary.registerText(help_design, "GUI.Design");
    204209
    205     help_create = new JMenuItem(Utility.BLANK_ICON);
     210    help_create = new JMenuItem(BLANK_ICON);
    206211    help_create.addActionListener(Gatherer.g_man);
    207212    Dictionary.registerText(help_create, "GUI.Create");
     
    265270        selected = help.getItem(current_tab);
    266271        if(selected != null) {
    267         selected.setIcon(Utility.BLANK_ICON);
     272        selected.setIcon(BLANK_ICON);
    268273        }
    269274    }
     
    271276    selected = help.getItem(current_tab);
    272277    if(selected != null) {
    273         selected.setIcon(Utility.HELP_ICON);
     278        selected.setIcon(HELP_ICON);
    274279    }
    275280    selected = null;
  • trunk/gli/src/org/greenstone/gatherer/gui/SimpleMenuBar.java

    r8579 r10012  
    55import javax.swing.*;
    66import org.greenstone.gatherer.Dictionary;
    7 import org.greenstone.gatherer.util.Utility;
     7import org.greenstone.gatherer.util.JarTools;
    88
    99public class SimpleMenuBar
     
    1616    this.page_name = page_name;
    1717    JMenu help = new JMenu();
    18     help.setIcon(Utility.HELP_ICON);
     18    help.setIcon(JarTools.getImage("help.gif"));
    1919    Dictionary.setText(help, "Menu.Help");
    2020
  • trunk/gli/src/org/greenstone/gatherer/util/JarTools.java

    r10011 r10012  
    3535public class JarTools
    3636{
    37     static public ImageIcon ERROR_ICON = null;
     37    static private ImageIcon ERROR_ICON = null;
    3838    // static public Class base = null;
     39
     40
     41    static public void initialise()
     42    {
     43    ERROR_ICON = getImage("error.gif");
     44    }
    3945
    4046
  • trunk/gli/src/org/greenstone/gatherer/util/Utility.java

    r10011 r10012  
    3737package org.greenstone.gatherer.util;
    3838
    39 import java.awt.*;
     39// Don't even think about adding import java.awt.* here!
     40// The functions in this class should not use any graphical classes. Put your function somewhere else buster!
    4041import java.io.*;
    4142import java.net.*;
    4243import java.util.*;
    4344import java.util.zip.*;
    44 import javax.swing.*;
    45 import javax.swing.tree.*;
     45// Don't even think about adding import javax.swing.* here!
     46// The functions in this class should not use any graphical classes. Put your function somewhere else buster!
    4647import org.apache.xerces.parsers.*;
    4748import org.apache.xerces.dom.DocumentImpl;
     
    5556import org.w3c.dom.*;
    5657import org.xml.sax.*;
     58
    5759
    5860/** To provide a library of common methods, in a static context, for use in the Gatherer.
     
    122124    static protected File gli_user_folder = null;
    123125
    124     // These are out of alphabetic order to avoid forward reference error.
    125126    /** The default icon to produce a 'help-icon' sized blank space before a menu entry. */
    126127    static public Class base = null;
    127     static public ImageIcon BLANK_ICON = null;
    128     /** The default error icon image. */
    129     static public ImageIcon ERROR_ICON = null;
    130     static public ImageIcon HELP_ICON = null;
    131128   
    132129
     
    853850    {
    854851    base = base_object.getClass();
    855 
    856     BLANK_ICON = new ImageIcon(base.getResource("/images/blank.gif"));
    857     ERROR_ICON = new ImageIcon(base.getResource("/images/error.gif"));
    858     HELP_ICON  = new ImageIcon(base.getResource("/images/help.gif"));
    859852    }
    860853
Note: See TracChangeset for help on using the changeset viewer.