home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / awt / event / InvocationEvent.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.6 KB  |  68 lines

  1. package java.awt.event;
  2.  
  3. import java.awt.AWTEvent;
  4. import java.awt.ActiveEvent;
  5.  
  6. public class InvocationEvent extends AWTEvent implements ActiveEvent {
  7.    public static final int INVOCATION_FIRST = 1200;
  8.    public static final int INVOCATION_DEFAULT = 1200;
  9.    public static final int INVOCATION_LAST = 1200;
  10.    protected Runnable runnable;
  11.    protected Object notifier;
  12.    protected boolean catchExceptions;
  13.    private Exception exception;
  14.  
  15.    public InvocationEvent(Object var1, Runnable var2) {
  16.       this(var1, var2, (Object)null, false);
  17.    }
  18.  
  19.    public InvocationEvent(Object var1, Runnable var2, Object var3, boolean var4) {
  20.       this(var1, 1200, var2, var3, var4);
  21.    }
  22.  
  23.    protected InvocationEvent(Object var1, int var2, Runnable var3, Object var4, boolean var5) {
  24.       super(var1, var2);
  25.       this.exception = null;
  26.       this.runnable = var3;
  27.       this.notifier = var4;
  28.       this.catchExceptions = var5;
  29.    }
  30.  
  31.    public void dispatch() {
  32.       if (this.catchExceptions) {
  33.          try {
  34.             this.runnable.run();
  35.          } catch (Exception var4) {
  36.             this.exception = var4;
  37.          }
  38.       } else {
  39.          this.runnable.run();
  40.       }
  41.  
  42.       if (this.notifier != null) {
  43.          Object var1 = this.notifier;
  44.          synchronized(var1) {
  45.             this.notifier.notifyAll();
  46.          }
  47.       }
  48.  
  49.    }
  50.  
  51.    public Exception getException() {
  52.       return this.catchExceptions ? this.exception : null;
  53.    }
  54.  
  55.    public String paramString() {
  56.       String var1;
  57.       switch (super.id) {
  58.          case 1200:
  59.             var1 = "INVOCATION_DEFAULT";
  60.             break;
  61.          default:
  62.             var1 = "unknown type";
  63.       }
  64.  
  65.       return var1 + ",runnable=" + this.runnable + ",notifier=" + this.notifier + ",catchExceptions=" + this.catchExceptions;
  66.    }
  67. }
  68.