Each of the ComponentUI
s provided by BasicLookAndFeel
derives its behavior from the defaults
table. Unless otherwise noted each of the ComponentUI
implementations in this package document the set of defaults they
use. Unless otherwise noted the defaults are installed at the time
installUI
is invoked, and follow the recommendations
outlined in LookAndFeel
for installing defaults.
Warning
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans
package.
Please see java.
.
Modifier and Type | Class and Description |
---|---|
private class | BasicLookAndFeel.
Pass the name String to the super constructor. |
pack-priv class | BasicLookAndFeel.
This class contains listener that watches for all the mouse events that can possibly invoke popup on the component |
Modifier and Type | Field and Description |
---|---|
private transient Object | audioLock
Lock used when manipulating clipPlaying. |
private Clip | clipPlaying
The Clip that is currently playing (set in AudioAction). |
private PropertyChangeListener | |
pack-priv BasicLookAndFeel. | |
pack-priv static boolean | needsEventHelper
Whether or not the developer has created a JPopupMenu. |
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
protected Action | Returns: anAction used to play the source, or null
if key is null the key identifying the audio action key)Creates and returns an |
protected ActionMap | Returns: an ActionMap containingActions
responsible for playing auditory cuesReturns an |
public UIDefaults | Returns: the look and feel defaultsOverrides javax. |
pack-priv static int | |
pack-priv static Object | getUIOfType(ComponentUI ui, Class<?> klass)
Returns the ui that is of type |
protected void | initClassDefaults(UIDefaults
the table)UIDefaults instance the entries are
added toPopulates |
protected void | initComponentDefaults(UIDefaults
the table)UIDefaults to add the values toPopulates |
public void | |
private void | initResourceBundle(UIDefaults table)
Initialize the defaults table with the name of the ResourceBundle used for getting localized defaults. |
protected void | initSystemColorDefaults(UIDefaults
the table)UIDefaults object the values are added toPopulates |
pack-priv static void | installAudioActionMap(ActionMap map)
Sets the parent of the passed in ActionMap to be the audio action map. |
pack-priv void | |
private byte[] | Returns: A byte[] with audio data or nullthe name of the audio file to be retrieved
from disk soundFile)Utility method that loads audio bits for the specified
|
protected void | loadSystemColors(UIDefaults
the table, String[] UIDefaults object the values are added toarray of systemColors, boolean name-color pairs as described
in initSystemColorDefaults(UIDefaults) whether the color is obtained from useNative)SystemColor
or Color.decode Populates |
protected void | |
pack-priv static void | playSound(JComponent
JComponent to play the sound for. c, Object Key for the sound. actionKey)Helper method to play a named sound. |
public void |
audioLock | back to summary |
---|---|
private transient Object audioLock Lock used when manipulating clipPlaying. |
clipPlaying | back to summary |
---|---|
private Clip clipPlaying The Clip that is currently playing (set in AudioAction). |
disposer | back to summary |
---|---|
private PropertyChangeListener disposer |
invocator | back to summary |
---|---|
pack-priv BasicLookAndFeel. |
needsEventHelper | back to summary |
---|---|
pack-priv static boolean needsEventHelper Whether or not the developer has created a JPopupMenu. |
BasicLookAndFeel | back to summary |
---|---|
protected BasicLookAndFeel() Constructor for subclasses to call. |
createAudioAction | back to summary |
---|---|
protected Action createAudioAction(Object key) Creates and returns an
If
|
getAudioActionMap | back to summary |
---|---|
protected ActionMap getAudioActionMap() Returns an
The returned
At the appropriate time,
the
This method first looks up the
If the value is
If the value of the default
|
getDefaults | back to summary |
---|---|
public UIDefaults getDefaults() Overrides javax. Returns the look and feel defaults. The returned
While this method is public, it should only be invoked by the
|
getFocusAcceleratorKeyMask | back to summary |
---|---|
pack-priv static int getFocusAcceleratorKeyMask() |
getUIOfType | back to summary |
---|---|
pack-priv static Object getUIOfType(ComponentUI ui, Class<?> klass) Returns the ui that is of type |
initClassDefaults | back to summary |
---|---|
protected void initClassDefaults(UIDefaults table) Populates
|
initComponentDefaults | back to summary |
---|---|
protected void initComponentDefaults(UIDefaults table) Populates
|
initialize | back to summary |
---|---|
public void initialize() Overrides javax. Doc from javax. Initializes the look and feel. While this method is public,
it should only be invoked by the |
initResourceBundle | back to summary |
---|---|
private void initResourceBundle(UIDefaults table) Initialize the defaults table with the name of the ResourceBundle used for getting localized defaults. Also initialize the default locale used when no locale is passed into UIDefaults.get(). The default locale should generally not be relied upon. It is here for compatibility with releases prior to 1.4. |
initSystemColorDefaults | back to summary |
---|---|
protected void initSystemColorDefaults(UIDefaults table) Populates
The name is a
The
The following shows two of the String[] nameColorPairs = new String[] { "desktop", "#005C5C", "activeCaption", "#000080" }; loadSystemColors(table, nameColorPairs, isNativeLookAndFeel());As previously stated, this invokes loadSystemColors
with the supplied table and name-color pair
array. The last argument to loadSystemColors indicates
whether the value of the field in SystemColor should be
used. This method passes the value of isNativeLookAndFeel() as the last argument to loadSystemColors .
|
installAudioActionMap | back to summary |
---|---|
pack-priv static void installAudioActionMap(ActionMap map) Sets the parent of the passed in ActionMap to be the audio action map. |
installAWTEventListener | back to summary |
---|---|
pack-priv void installAWTEventListener() |
loadAudioData | back to summary |
---|---|
private byte[] loadAudioData(final String soundFile) Utility method that loads audio bits for the specified
|
loadSystemColors | back to summary |
---|---|
protected void loadSystemColors(UIDefaults table, String[] systemColors, boolean useNative) Populates
An entry is added to
The value of the entry corresponds to the
If
If
|
playSound | back to summary |
---|---|
protected void playSound(Action audioAction) If necessary, invokes
|
playSound | back to summary |
---|---|
pack-priv static void playSound(JComponent c, Object actionKey) Helper method to play a named sound.
|
uninitialize | back to summary |
---|---|
public void uninitialize() Overrides javax. Doc from javax. Uninitializes the look and feel. While this method is public,
it should only be invoked by the Subclasses may choose to free up some resources here.
|
Modifier and Type | Field and Description |
---|---|
private byte[] | |
private String |
Access | Constructor and Description |
---|---|
public | AudioAction(String name, String resource)
The String is the name of the Action and points to the audio resource. |
Modifier and Type | Method and Description |
---|---|
public void | actionPerformed(ActionEvent
the event to be processed e)Implements java. |
private void | cancelCurrentSound(Clip clip)
If the parameter is null, or equal to the currently playing sound, then cancel the currently playing sound. |
public void | update(LineEvent
a line event that describes the change event)Implements javax. |
audioBuffer | back to summary |
---|---|
private byte[] audioBuffer |
audioResource | back to summary |
---|---|
private String audioResource |
AudioAction | back to summary |
---|---|
public AudioAction(String name, String resource) The String is the name of the Action and points to the audio resource. The byte[] is a buffer of the audio bits. |
actionPerformed | back to summary |
---|---|
public void actionPerformed(ActionEvent e) Implements java. Doc from java. Invoked when an action occurs.
|
cancelCurrentSound | back to summary |
---|---|
private void cancelCurrentSound(Clip clip) If the parameter is null, or equal to the currently playing sound, then cancel the currently playing sound. |
update | back to summary |
---|---|
public void update(LineEvent event) Implements javax. Doc from javax. Informs the listener that a line's state has changed. The listener can
then invoke
|
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public void | eventDispatched(AWTEvent
the event to be processed ev)Implements java. |
public Object |
AWTEventHelper | back to summary |
---|---|
pack-priv AWTEventHelper()
|
eventDispatched | back to summary |
---|---|
public void eventDispatched(AWTEvent ev) Implements java. Doc from java. Invoked when an event is dispatched in the AWT.
|
run | back to summary |
---|---|
public Object run() Implements java. Doc from java. Performs the computation. This method will be called by
|