bb.gui
Class LookAndFeelUtil

java.lang.Object
  extended by bb.gui.LookAndFeelUtil

public class LookAndFeelUtil
extends Object

This class implements some constants and utilty methods for Swing's Look and Feel functionality.

Like typical Java GUI code, this class is not multithread safe: it expects to only be called by EventQueue's dispatch thread. This threading limitation is checked in every public method.

Author:
Brent Boyer

Field Summary
private static String[] lookAndFeelClassnames
          This array lists all the Look and Feel fully qualified classnames that are available on the current system.
(package private) static String[] lookAndFeels
          This array lists all the Look and Feel names that are available on the current system.
private static Map<String,String> nameToClassname
          This Map correlates lookAndFeels to lookAndFeelClassnames.
 
Constructor Summary
private LookAndFeelUtil()
          This sole private constructor suppresses the default (public) constructor, ensuring non-instantiability outside of this class.
 
Method Summary
static String getClassName(String name)
          Returns the Look And Feel class name that corresponds to the supplied short name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lookAndFeels

static final String[] lookAndFeels
This array lists all the Look and Feel names that are available on the current system.


lookAndFeelClassnames

private static final String[] lookAndFeelClassnames
This array lists all the Look and Feel fully qualified classnames that are available on the current system.


nameToClassname

private static final Map<String,String> nameToClassname
This Map correlates lookAndFeels to lookAndFeelClassnames.

Constructor Detail

LookAndFeelUtil

private LookAndFeelUtil()
This sole private constructor suppresses the default (public) constructor, ensuring non-instantiability outside of this class.

Method Detail

getClassName

public static String getClassName(String name)
                           throws IllegalArgumentException,
                                  IllegalStateException
Returns the Look And Feel class name that corresponds to the supplied short name.

Throws:
IllegalArgumentException - if name is blank, or does not correspond to any known class name
IllegalStateException - if calling thread is not EventQueue's dispatch thread