01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: /*
09: * Created on 17.03.2005
10: */
11: package de.uka.ilkd.key.gui.notification.actions;
12:
13: import java.awt.Component;
14:
15: import javax.swing.JOptionPane;
16:
17: import de.uka.ilkd.key.gui.notification.events.NotificationEvent;
18: import de.uka.ilkd.key.gui.notification.events.ProofClosedNotificationEvent;
19: import de.uka.ilkd.key.proof.Proof;
20:
21: /**
22: * Displays a JOptionPane informing about a closed proof
23: * and gives some statistics.
24: * @author bubel
25: */
26: public class ProofClosedJTextPaneDisplay extends ShowDisplayPane {
27:
28: public ProofClosedJTextPaneDisplay(Component parentComponent) {
29: super (parentComponent);
30: }
31:
32: /**
33: * Displays a JOptionPane informing the user about a closed proof.
34: * If available some statistics are displayed as well.
35: */
36: public boolean execute(NotificationEvent pcne) {
37: if (pcne instanceof ProofClosedNotificationEvent) {
38: Proof proof = ((ProofClosedNotificationEvent) pcne)
39: .getProof();
40: if (proof != null) {
41: setMessage("Proved.\nStatistics:\n"
42: + proof.statistics());
43: }
44: } else {
45: setMessage("Proof Closed. No statistics available.");
46: }
47: JOptionPane.showMessageDialog(parentComponent, getMessage(),
48: "Proof closed", JOptionPane.INFORMATION_MESSAGE);
49: return true;
50: }
51:
52: }
|