home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 June / CHIPHEFT062001.ISO / browser / nc32lyc / comm.z / java40.jar / sun / awt / Modality.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-08-15  |  1001 b   |  44 lines

  1. package sun.awt;
  2.  
  3. import java.awt.EventDispatchThread;
  4.  
  5. public class Modality {
  6.    private boolean m_isOnEventDispatchThread;
  7.    private EventDispatchThread.EventPump m_eventPump;
  8.  
  9.    public void enter() throws InterruptedException {
  10.       if (Thread.currentThread() instanceof EventDispatchThread) {
  11.          EventDispatchThread var1 = (EventDispatchThread)Thread.currentThread();
  12.          var1.getClass();
  13.          this.m_eventPump = new EventDispatchThread.EventPump(var1);
  14.          this.m_isOnEventDispatchThread = true;
  15.          this.m_eventPump.dispatchEvents();
  16.       } else {
  17.          this.m_isOnEventDispatchThread = false;
  18.          synchronized(this){}
  19.  
  20.          try {
  21.             this.wait();
  22.          } catch (Throwable var3) {
  23.             throw var3;
  24.          }
  25.  
  26.       }
  27.    }
  28.  
  29.    public void exit() {
  30.       if (this.m_isOnEventDispatchThread) {
  31.          this.m_eventPump.stopDispatching();
  32.       } else {
  33.          synchronized(this){}
  34.  
  35.          try {
  36.             this.notify();
  37.          } catch (Throwable var3) {
  38.             throw var3;
  39.          }
  40.  
  41.       }
  42.    }
  43. }
  44.