edu.northwestern.at.utils.swing
Class Fonts

java.lang.Object
  extended by edu.northwestern.at.utils.swing.Fonts

public class Fonts
extends java.lang.Object

Fonts information.

This class centralizes font handling.


Field Summary
static java.lang.String dialog
          Dialog font name.
static java.lang.String dialogInput
          DialogInput font name.
static java.lang.String monospaced
          Monospace font name.
static java.lang.String sansSerif
          SansSerif font name.
static java.lang.String serif
          Serif font name.
 
Method Summary
static void enableSystemFontSettings(boolean doEnable)
          Enable or disable use of built-in desktop properties.
static void recursivelySetFonts(java.awt.Component component, java.awt.Font font)
          Set font for a component and its children.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

monospaced

public static java.lang.String monospaced
Monospace font name.


serif

public static java.lang.String serif
Serif font name.


sansSerif

public static java.lang.String sansSerif
SansSerif font name.


dialog

public static java.lang.String dialog
Dialog font name.


dialogInput

public static java.lang.String dialogInput
DialogInput font name.

Method Detail

enableSystemFontSettings

public static void enableSystemFontSettings(boolean doEnable)
Enable or disable use of built-in desktop properties.

Parameters:
doEnable - True to enable use of built-in desktop properties for fonts, etc. False otherwise.

When running the Windows look and feel under Windows, in Java v1.4 or later, the runtime environment by default ignores the font mappings present in the font.properties file and retrieves these from the Windows operating system. Since the default Windows fonts for various types of controls are incredibly ugly, this results in an unattractive display. To fix this, call this method with "doEnable" set false.


recursivelySetFonts

public static void recursivelySetFonts(java.awt.Component component,
                                       java.awt.Font font)
Set font for a component and its children.

Parameters:
component - The component whose font is to be set.
font - The font to set the child components to use.

If component is a container, all of its subcomponents will also have the font changed to "font".