javax.swing.plaf.basic
Class BasicLookAndFeel

java.lang.Object
  extended by javax.swing.LookAndFeel
      extended by javax.swing.plaf.basic.BasicLookAndFeel
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MetalLookAndFeel, SynthLookAndFeel

public abstract class BasicLookAndFeel
extends LookAndFeel
implements Serializable

A basic implementation of Swing's Look and Feel framework. This can serve as a base for custom look and feel implementations.

See Also:
Serialized Form

Constructor Summary
BasicLookAndFeel()
          Creates a new instance of the Basic look and feel.
 
Method Summary
protected  Action createAudioAction(Object key)
          Creates an Action that can play an auditory cue specified by the key.
protected  ActionMap getAudioActionMap()
          Returns the ActionMap that stores all the actions that are responsibly for rendering auditory cues.
 UIDefaults getDefaults()
          Creates and returns a new instance of the default resources for this look and feel.
protected  void initClassDefaults(UIDefaults defaults)
          Populates the defaults table with mappings between class IDs and fully qualified class names for the UI delegates.
protected  void initComponentDefaults(UIDefaults defaults)
          Populates the defaults table with UI default values for colors, fonts, keybindings and much more.
 void initialize()
          Initializes the Look and Feel.
protected  void initSystemColorDefaults(UIDefaults defaults)
          Populates the defaults table with system color defaults.
protected  void loadSystemColors(UIDefaults defaults, String[] systemColors, boolean useNative)
          Populates the defaults table with the system colors.
protected  void playSound(Action audioAction)
          Plays the sound of the action if it is listed in AuditoryCues.playList.
 void uninitialize()
          Uninitializes the Look and Feel.
 
Methods inherited from class javax.swing.LookAndFeel
getDescription, getDesktopPropertyValue, getID, getName, getSupportsWindowDecorations, installBorder, installColors, installColorsAndFont, installProperty, isNativeLookAndFeel, isSupportedLookAndFeel, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, provideErrorFeedback, toString, uninstallBorder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicLookAndFeel

public BasicLookAndFeel()
Creates a new instance of the Basic look and feel.

Method Detail

getDefaults

public UIDefaults getDefaults()
Creates and returns a new instance of the default resources for this look and feel.

Overrides:
getDefaults in class LookAndFeel
Returns:
The UI defaults.

initClassDefaults

protected void initClassDefaults(UIDefaults defaults)
Populates the defaults table with mappings between class IDs and fully qualified class names for the UI delegates.

Parameters:
defaults - the defaults table (null not permitted).

initSystemColorDefaults

protected void initSystemColorDefaults(UIDefaults defaults)
Populates the defaults table with system color defaults. This sets up a couple of default values and passes them to loadSystemColors(UIDefaults, String[], boolean). If the look and feel is a native look and feel, these defaults may be overridden by the corresponding SystemColor constants.

Parameters:
defaults - the defaults table (null not permitted).

loadSystemColors

protected void loadSystemColors(UIDefaults defaults,
                                String[] systemColors,
                                boolean useNative)
Populates the defaults table with the system colors. If useNative is true, the table is populated with the constants in SystemColor, otherwise the systemColors parameter is decoded into the defaults table. The system colors array is made up of pairs, where the first entry is the name of the system color, and the second entry is a string denoting an RGB color value like "#C0C0C0", which is decoded using Color.decode(String).

Parameters:
defaults - the defaults table (null not permitted).
systemColors - defaults to use when useNative is false
useNative - when true, installs the values of the SystemColor constants, when false, install the values from systemColors

initComponentDefaults

protected void initComponentDefaults(UIDefaults defaults)
Populates the defaults table with UI default values for colors, fonts, keybindings and much more.

Parameters:
defaults - the defaults table (null not permitted).

getAudioActionMap

protected ActionMap getAudioActionMap()
Returns the ActionMap that stores all the actions that are responsibly for rendering auditory cues.

Returns:
the action map that stores all the actions that are responsibly for rendering auditory cues
Since:
1.4
See Also:
createAudioAction(java.lang.Object), playSound(javax.swing.Action)

createAudioAction

protected Action createAudioAction(Object key)
Creates an Action that can play an auditory cue specified by the key. The UIDefaults value for the key is normally a String that points to an audio file relative to the current package.

Parameters:
key - a UIDefaults key that specifies the sound
Returns:
an action that can play the sound
Since:
1.4
See Also:
playSound(javax.swing.Action)

playSound

protected void playSound(Action audioAction)
Plays the sound of the action if it is listed in AuditoryCues.playList.

Parameters:
audioAction - the audio action to play
Since:
1.4

initialize

public void initialize()
Initializes the Look and Feel.

Overrides:
initialize in class LookAndFeel

uninitialize

public void uninitialize()
Uninitializes the Look and Feel.

Overrides:
uninitialize in class LookAndFeel