Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.crosswire.common.swing
Class LookAndFeelUtil

    java.lang.Object
      org.crosswire.common.swing.LookAndFeelUtil

    public final class LookAndFeelUtil

extends Object

LookAndFeelUtil declares the Choices and actions needed to dynamically change the look and feel (PLAF) and to add new PLAFs without needing to restart.

Author:
  Joe Walker, Mark Goodwin, DM Smith, Willie Thean
See Also:
  `The GNU General Public License for details.`

Field Summary
`private static Class<LookAndFeel>` | `currentLAF` The current PLAF
`private static Class<?>` | `defaultLAF` The default PLAF (and the default value)
`private static String` | `font` The font to be used for the application

Constructor Summary
`private` | `LookAndFeelUtil()` Prevent instantiation

Method Summary
`private static void` | `customizeBDLookandFeel()`
`static String` | `getFont()` Accessor for the stylesheet we are transforming using
`static Class<?>` | `getLookAndFeel()` The Options customization
`static void` | `initialize()` Establish the system look and feel
`static void` | `setFont(String font)` Accessor for the stylesheet we are transforming using
`static void` | `setLookAndFeel(Class<LookAndFeel> newLaFClass)` Set the look and feel to a new class.
`static void` | `setUIFont(FontUIResource f)` Set the default font for all Swing components.
`static FontUIResource` | `toFontUIResource()` Converts the font spec to something useful.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### currentLAF

    private static Class<LookAndFeel> currentLAF

  The current PLAF

### defaultLAF

    private static Class<?> defaultLAF

  The default PLAF (and the default value)

### font

    private static String font

  The font to be used for the application

Constructor Detail

### LookAndFeelUtil

    private LookAndFeelUtil()

  Prevent instantiation

Method Detail

### initialize

    public static void initialize()

  Establish the system look and feel

### getLookAndFeel

    public static Class<?> getLookAndFeel()

  The Options customization

### setLookAndFeel

    public static void setLookAndFeel(Class<LookAndFeel> newLaFClass)
                               throws InstantiationException,
                                      IllegalAccessException,
                                      UnsupportedLookAndFeelException

  Set the look and feel to a new class.

  Throws:
    `InstantiationException`
    `IllegalAccessException`
    `UnsupportedLookAndFeelException`

### getFont

    public static String getFont()

  Accessor for the stylesheet we are transforming using

### toFontUIResource

    public static FontUIResource toFontUIResource()

  Converts the font spec to something useful.

### setFont

    public static void setFont(String font)

  Accessor for the stylesheet we are transforming using

### setUIFont

    public static void setUIFont(FontUIResource f)

  Set the default font for all Swing components. E.g. `setUIFont(new FontUIResource("Serif", Font.ITALIC, 12));`
  Note: a single resources can be changed with: `UIManager.put("Label.font", new Font("Serif", Font.ITALIC, 12));`

  Parameters:
    `f` - the font to use

### customizeBDLookandFeel

    private static void customizeBDLookandFeel()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¨ 2003-2015
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD