javax.swing.plaf.basic

Class BasicLookAndFeel

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.
Constructor Summary
BasicLookAndFeel()
Creates a new instance of the Basic look and feel.
Method Summary
protected ActioncreateAudioAction(Object key)
Creates an Action that can play an auditory cue specified by the key.
protected ActionMapgetAudioActionMap()
Returns the ActionMap that stores all the actions that are responsibly for rendering auditory cues.
UIDefaultsgetDefaults()
Creates and returns a new instance of the default resources for this look and feel.
protected voidinitClassDefaults(UIDefaults defaults)
Populates the defaults table with mappings between class IDs and fully qualified class names for the UI delegates.
protected voidinitComponentDefaults(UIDefaults defaults)
Populates the defaults table with UI default values for colors, fonts, keybindings and much more.
voidinitialize()
Initializes the Look and Feel.
protected voidinitSystemColorDefaults(UIDefaults defaults)
Populates the defaults table with system color defaults.
protected voidloadSystemColors(UIDefaults defaults, String[] systemColors, boolean useNative)
Populates the defaults table with the system colors.
protected voidplaySound(Action audioAction)
Plays the sound of the action if it is listed in AuditoryCues.playList.
voiduninitialize()
Uninitializes the Look and Feel.

Constructor Detail

BasicLookAndFeel

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

Method Detail

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: BasicLookAndFeel

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: BasicLookAndFeel BasicLookAndFeel

getDefaults

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

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).

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).

initialize

public void initialize()
Initializes the Look and Feel.

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 {@link #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 {@link 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 {@link 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

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

uninitialize

public void uninitialize()
Uninitializes the Look and Feel.