Changeset 8807


Ignore:
Timestamp:
2004-12-14T17:05:01+13:00 (19 years ago)
Author:
mdewsnip
Message:

Now uses standard font for everything, including tooltips. The standard font looks nicer and supports more of Unicode (including Russian, oops!).

File:
1 edited

Legend:

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

    r8680 r8807  
    280280        }
    281281
    282         // Set default font
    283         setUIFont(Configuration.getFont("general.font", true), Configuration.getFont("general.tooltip_font", true));
     282        // Set the default font for all Swing components.
     283        FontUIResource default_font = Configuration.getFont("general.font", true);
     284        Enumeration keys = UIManager.getDefaults().keys();
     285        while (keys.hasMoreElements()) {
     286        Object key = keys.nextElement();
     287        Object value = UIManager.get(key);
     288        if (value instanceof FontUIResource) {
     289            UIManager.put(key, default_font);
     290        }
     291        }
     292
    284293        // Set up proxy
    285294        setProxy();
     
    604613    }
    605614
    606     /** Set all the default fonts of the program to a choosen font, except the tooltip font which should be some fixed width font.
    607      * @param f The default font to use in the Gatherer as a <strong>FontUIResource</strong>.
    608      * @param ttf The tooltip font to use also as a <strong>FontUIResource</strong>.
    609      * @see java.util.Enumeration
    610      * @see javax.swing.UIManager
    611      */
    612     static private void setUIFont(FontUIResource f, FontUIResource ttf) {
    613     // sets the default font for all Swing components.
    614     // ex.
    615     //  setUIFont (new FontUIResource("Serif",Font.ITALIC,12));
    616     //
    617     Enumeration keys = UIManager.getDefaults().keys();
    618     while (keys.hasMoreElements()) {
    619         Object key = keys.nextElement();
    620         Object value = UIManager.get (key);
    621         if (value instanceof FontUIResource)
    622         UIManager.put (key, f);
    623     }
    624     // Now set the tooltip font to some fixed width font
    625     UIManager.put("ToolTip.font", ttf);
    626     }
    627615
    628616    /** Loads the configuration file if one exists. Otherwise it creates a new one. Currently uses serialization.
Note: See TracChangeset for help on using the changeset viewer.