Skip to content

Commit

Permalink
* fixed sound play in bytecode and webstart version
Browse files Browse the repository at this point in the history
* updated README file with supported set of SMT solvers
  • Loading branch information
Richard Bubel authored and Richard Bubel committed Nov 30, 2007
1 parent b3bc476 commit 0723d1d
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 39 deletions.
4 changes: 2 additions & 2 deletions README.install.bytecode
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Needed additional Libraries:
antlr.jar Version >= 2.7.2: parser generator
dresden-ocl-demo.jar: ocl parser
xerces.jar version 1.4.4: used by tudresden.jar
recoder.jar version 0.75_KeY_TypeResolutionInMethodFrameFixed:
recoder.jar version 0.75_KeY_TypeResolutionInMethodFrameFixed:
a transformation framework for java patched by the KeY group
jargs.jar
log4j.jar
Expand All @@ -29,7 +29,7 @@ Needed additional Libraries:
Optionally, KeY can make use of the following binaries:
Grammatical Framework
ESC Java's decision procedure `Simplify�
SMT-LIB provers: bindings exist currently for Yices, CVSLite and SVC
SMT-LIB provers: bindings exist currently for Yices, CVCLite, CVC3 and SVC
(export to SMT input file possible)

(2) Contents of the KeY-Distribution
Expand Down
2 changes: 1 addition & 1 deletion README.install.source
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Needed additional Libraries:
Optionally, KeY can make use of the following binaries:
Grammatical Framework
ESC Java's decision procedure `Simplify�
SMT-LIB provers: bindings exist currently for Yices, CVSLite and SVC
SMT-LIB provers: bindings exist currently for Yices, CVCLite, CVC3 and SVC
(export to SMT input file possible)

(2) Contents of the KeY-Distribution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public void setDefaultNotification(boolean sound) {
new GeneralInformationNotification();
final AbandonNotification an = new AbandonNotification();
final ExitKeYNotification en = new ExitKeYNotification();

if (sound) {
pcn.addNotificationAction(new ProofClosedSoundPlay());
gfn.addNotificationAction(new GeneralFailureSoundPlay());
Expand All @@ -78,7 +79,7 @@ public void setDefaultNotification(boolean sound) {
gfn.addNotificationAction(new GeneralFailureJTextPaneDisplay(mediator.mainFrame()));
gin.addNotificationAction(new GeneralInformationJTextPaneDisplay(mediator.mainFrame()));
pcn.addNotificationAction(new ProofClosedJTextPaneDisplay(mediator.mainFrame()));

addNotificationTask(pcn);
addNotificationTask(gfn);
addNotificationTask(gin);
Expand Down
20 changes: 10 additions & 10 deletions system/de/uka/ilkd/key/gui/notification/NotificationTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ public void execute(NotificationEvent event,
}
// notify thread safe
if (SwingUtilities.isEventDispatchThread()) {
executeImpl(event, manager);
} else {
final NotificationEvent eventObject = event;
final NotificationManager notManager = manager;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
executeImpl(eventObject, notManager);
}
});
}
executeImpl(event, manager);
} else {
final NotificationEvent eventObject = event;
final NotificationManager notManager = manager;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
executeImpl(eventObject, notManager);
}
});
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/
package de.uka.ilkd.key.gui.notification.actions;

import java.io.File;
import java.net.URL;

import de.uka.ilkd.key.gui.notification.NotificationTask;
Expand All @@ -29,7 +28,7 @@ public AbandonTaskSoundPlay() {
KeYResourceManager.getManager().getResourceFile
(NotificationTask.class, "sounds/abandon.wav");
if (internalSoundFile != null) {
setSoundFile(new File(internalSoundFile.getFile()));
setSoundURL(internalSoundFile);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/
package de.uka.ilkd.key.gui.notification.actions;

import java.io.File;
import java.net.URL;

import de.uka.ilkd.key.gui.notification.NotificationTask;
Expand All @@ -30,7 +29,7 @@ public ExitKeYSoundPlay() {
KeYResourceManager.getManager().getResourceFile
(NotificationTask.class, "sounds/exit.wav");
if (internalSoundFile != null) {
setSoundFile(new File(internalSoundFile.getFile()));
setSoundURL(internalSoundFile);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/
package de.uka.ilkd.key.gui.notification.actions;

import java.io.File;
import java.net.URL;

import de.uka.ilkd.key.gui.notification.NotificationTask;
Expand All @@ -31,7 +30,7 @@ public GeneralFailureSoundPlay() {
KeYResourceManager.getManager().getResourceFile
(NotificationTask.class, "sounds/error.wav");
if (internalSoundFile != null) {
setSoundFile(new File(internalSoundFile.getFile()));
setSoundURL(internalSoundFile);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/
package de.uka.ilkd.key.gui.notification.actions;

import java.io.File;
import java.net.URL;

import de.uka.ilkd.key.gui.notification.NotificationTask;
Expand All @@ -31,7 +30,7 @@ public GeneralInformationSoundPlay() {
KeYResourceManager.getManager().getResourceFile
(NotificationTask.class, "sounds/information.wav");
if (internalSoundFile != null) {
setSoundFile(new File(internalSoundFile.getFile()));
setSoundURL(internalSoundFile);
}
}

Expand Down
24 changes: 9 additions & 15 deletions system/de/uka/ilkd/key/gui/notification/actions/PlaySound.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
*/
package de.uka.ilkd.key.gui.notification.actions;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;

import de.uka.ilkd.key.gui.notification.NotificationAction;
import de.uka.ilkd.key.gui.notification.events.NotificationEvent;
Expand All @@ -23,32 +22,27 @@
*/
public class PlaySound implements NotificationAction {

/** the file where the sound to play is stored */
private File soundFile;
/** the URL where to find the sound file to play */
private URL soundURL;

public PlaySound() {
}

/**
* sets the file to be played
* @param file the File to be played
* sets the URL pointing to the location of the sound to be played
* @param url the URL refering to the sound to be played
*/
public void setSoundFile(File file) {
this.soundFile = file;
public void setSoundURL(URL url) {
this.soundURL = url;
}

/**
* plays the sound
* @see de.uka.ilkd.key.gui.notification.NotificationAction#execute(NotificationEvent)
*/
public boolean execute(NotificationEvent event) {
if (soundFile != null) {
try {
java.applet.Applet.newAudioClip(soundFile.toURL()).play();
} catch (MalformedURLException mue) {
Debug.out("Failure playing soundfile ", mue);
return false;
}
if (soundURL != null) {
java.applet.Applet.newAudioClip(soundURL).play();
return true;
}
Debug.out("No sound file found.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/
package de.uka.ilkd.key.gui.notification.actions;

import java.io.File;
import java.net.URL;

import de.uka.ilkd.key.gui.notification.NotificationTask;
Expand All @@ -32,7 +31,7 @@ public ProofClosedSoundPlay() {
KeYResourceManager.getManager().getResourceFile
(NotificationTask.class, "sounds/trumpet.wav");
if (internalSoundFile != null) {
setSoundFile(new File(internalSoundFile.getFile()));
setSoundURL(internalSoundFile);
}
}
}

0 comments on commit 0723d1d

Please sign in to comment.