com.mindprod.common15
Class Laf

java.lang.Object
  extended by com.mindprod.common15.Laf

public final class Laf
extends java.lang.Object

Methods for selecting Look and Feel.

Since:
2010-03-22
Version:
1.0 2010-03-22 initial version
Author:
Roedy Green, Canadian Mind Products

Constructor Summary
Laf()
           
 
Method Summary
static javax.swing.JMenu buildLookAndFeelMenu()
          build JMenu to allow user to choose a L&F.
static javax.swing.UIManager.LookAndFeelInfo getCurrentLookAndFeel()
          get current L&F
static javax.swing.UIManager.LookAndFeelInfo getPersistedLookAndFeel()
          fetch the persisted L&F the user has selected previously
static javax.swing.UIManager.LookAndFeelInfo getPreferredLookAndFeel()
          Get the preferred LookAndFeel, default before the user has expressed a preference.
static boolean isLookAndFeelSupported(javax.swing.UIManager.LookAndFeelInfo laf)
          is this L&F supported
static void main(java.lang.String[] args)
          test harness
static void persistLookAndFeel(javax.swing.UIManager.LookAndFeelInfo laf)
          save L&F using the persistence mechanism
static void propagateLookAndFeelChange()
          make sure all Frames and Windows are repainted with the new Look and Feel.
static void setLookAndFeel(java.lang.String lookAndFeelClassName)
          change the current look and feel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Laf

public Laf()
Method Detail

buildLookAndFeelMenu

public static javax.swing.JMenu buildLookAndFeelMenu()
build JMenu to allow user to choose a L&F. It must be installed in a JMenuBar. USE REQUIRES APPLET TO BE SIGNED. We set system property and persist the chosen LAF.

Returns:
the JMenu containing all the supported Look and Feels

getCurrentLookAndFeel

public static javax.swing.UIManager.LookAndFeelInfo getCurrentLookAndFeel()
get current L&F

Returns:
L&F currently in effect

getPersistedLookAndFeel

public static javax.swing.UIManager.LookAndFeelInfo getPersistedLookAndFeel()
fetch the persisted L&F the user has selected previously

Returns:
L&F user chose last time, null if none.

getPreferredLookAndFeel

public static javax.swing.UIManager.LookAndFeelInfo getPreferredLookAndFeel()
Get the preferred LookAndFeel, default before the user has expressed a preference.

Returns:
look and feel, null if none of desirable ones are supported.

isLookAndFeelSupported

public static boolean isLookAndFeelSupported(javax.swing.UIManager.LookAndFeelInfo laf)
is this L&F supported

Parameters:
laf - to check if is supported
Returns:
true laf is supported.

persistLookAndFeel

public static void persistLookAndFeel(javax.swing.UIManager.LookAndFeelInfo laf)
save L&F using the persistence mechanism

Parameters:
laf - L&F to persist

propagateLookAndFeelChange

public static void propagateLookAndFeelChange()
make sure all Frames and Windows are repainted with the new Look and Feel.


setLookAndFeel

public static void setLookAndFeel(java.lang.String lookAndFeelClassName)
change the current look and feel. If the class is invalid, the command is ignored.

Parameters:
lookAndFeelClassName - name of Look and Feel class

main

public static void main(java.lang.String[] args)
test harness

Parameters:
args - not used