United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4290988 : Auditory Feedback for Swing Components

Details
Type:
Enhancement
Submit Date:
1999-11-12
Status:
Resolved
Updated Date:
2000-11-17
Project Name:
JDK
Resolved Date:
2000-11-17
Component:
client-libs
OS:
generic
Sub-Component:
javax.swing
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.0
Fixed Versions:
1.4.0 (beta)

Related Reports
Relates:

Sub Tasks

Description
Currently, the Swing components do not provide the same auditory
feedback as the native components on many platforms.  We plan to
extend the basic Swing PLAF module, so that derived look and feel
classes can provide audio feedback by configuring Swing defaults table
entries.  This work, along the "Windows L&F Update" project (4290973)
will help ensure that Swing applications integrate seamlessly with
native applications.


                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
merlin
merlin-beta

FIXED IN:
merlin-beta

INTEGRATED IN:
merlin-beta


                                     
2004-06-14
EVALUATION

Optional package.
david.biagini@Eng 2000-01-20

Name: db100478			Date: 09/08/2000


Committing to merlin release


======================================================================

Here is the spec for the new API:

Add the following to javax.swing.plaf.basic.BasicLookAndFeel
/**
 * Returns an <code>ActionMap</code>.
 * <P>
 * This <code>ActionMap</code> contains <code>Actions</code> that
 * embody the ability to render an auditory cue. These auditory
 * cues map onto user and system activities that may be useful
 * for an end user to know about (such as a dialog box appearing).
 * <P>
 * At the appropriate time in a <code>JComponent</code> UI's lifecycle,
 * the ComponentUI is responsible for getting the appropriate
 * <code>Action</code> out of the <code>ActionMap</code> and passing
 * it on to <code>playSound<code>.
 * <P>
 * The <code>Actions</code> in this <code>ActionMap<code> are
 * created by the <code>createAudioAction</code> method.
 *
 * @return      an ActionMap containing Actions
 *              responsible for rendering auditory cues
 * @see #createActionMap(Object)
 * @see #playSound(Action)
 * @since 1.4
 */
protected ActionMap getAudioActionMap()


/**
 * Returns an <code>Action</code>.
 * <P>
 * This Action contains the information and logic to render an
 * auditory cue. The <code>Object</code> that is passed to this
 * method contains the information needed to render the auditory
 * cue. Normally, this <code>Object</code> is a <code>String</code>
 * that points to an audio file relative to the current package.
 * This <code>Action</code>'s <code>actionPerformed</code> method
 * is fired by the <code>playSound</code> method.
 *
 * @return      an Action which knows how to render the auditory
 *              cue for one particular system or user activity
 * @see #playSound(Action)
 * @since 1.4
 */
protected Action createAudioAction(Object key)


/**
 * Decides whether to fire the <code>Action</code> that is passed into
 * it and, if needed, fires the <code>Action</code>'s
 * <code>actionPerformed</code> method. This has the effect
 * of rendering the audio appropriate for the situation.
 * <P>
 * The set of possible cues to be played are stored in the default
 * table value "AuditoryCues.cueList". The cues that will be played
 * are stored in "AuditoryCues.playList".
 *
 * @param audioAction an Action that knows how to render the audio
 *                    associated with the system or user activity
 *                    that is occurring
 * @since 1.4
 */
protected void playSound(Action audioAction) {


Add the following to javax.swing.plaf.basic.BasicLookAndFeel
/**
 * Returns an <code>Action</code>.
 * <P>
 * This Action contains the information and logic to render an
 * auditory cue. The <code>Object</code> that is passed to this
 * method contains the information needed to render the auditory
 * cue. Normally, this <code>Object</code> is a <code>String</code>
 * that points to a <code>Toolkit</code> <code>desktopProperty</code>.
 * This <code>desktopProperty</code> is resolved by AWT and the
 * Windows OS.
 * <P>
 * This <code>Action</code>'s <code>actionPerformed</code> method
 * is fired by the <code>playSound</code> method.
 *
 * @return      an Action which knows how to render the auditory
 *              cue for one particular system or user activity
 * @see #playSound(Action)
 * @since 1.4
 */
protected Action createAudioAction(Object key)


Add the following to javax.swing.plaf.basic.BasicMenuItemUI
/**
 * Call this method when a menu item is to be activated.
 * This method handles some of the details of menu item activation
 * such as clearing the selected path and messaging the
 * JMenuItem's doClick() method.
 *
 * @param msm  A MenuSelectionManager. The visual feedback and
 *             internal bookkeeping tasks are delegated to
 *             this MenuSelectionManager. If <code>null</code> is
 *             passed as this argument, the
 *             <code>MenuSelectionManager.defaultManager</code> is
 *             used.
 * @see MenuSelectionManager
 * @see JMenuItem#doClick(int)
 * @since 1.4
 */
protected void doClick(MenuSelectionManager msm)


Add the following audio files to javax\swing\plaf\metal\soundsFrameClose.wav
FrameMaximize.wav
FrameMinimize.wav
FrameRestoreDown.wav
FrameRestoreUp.wav
MenuItemCommand.wav
OptionPaneError.wav
OptionPaneInformation.wav
OptionPaneQuestion.wav
OptionPaneWarning.wav
PopupMenuPopup.wav

scott.violet@eng 2000-11-17
                                     
2000-11-17



Hardware and Software, Engineered to Work Together