summaryrefslogtreecommitdiff
path: root/NET/worlds/console/BlockingDialog.java
blob: 7de11dd1ef0e2322f04c8a32c8faf4aeb83d33bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*    */ package NET.worlds.console;
/*    */ 
/*    */ import java.awt.Dialog;
/*    */ import java.awt.Frame;
/*    */ import java.awt.event.ActionEvent;
/*    */ import java.awt.event.ActionListener;
/*    */ import java.awt.event.WindowAdapter;
/*    */ import java.awt.event.WindowEvent;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class BlockingDialog
/*    */   extends Dialog
/*    */   implements ActionListener
/*    */ {
/*    */   private static final long serialVersionUID = 8379457384966170912L;
/* 29 */   boolean stillWaiting = true;
/*    */   
/*    */   public BlockingDialog(Frame parent, String title, boolean modal) {
/* 32 */     super(parent, title, modal);
/* 33 */     addWindowListener(new WindowAdapter()
/*    */     {
/*    */       public void windowClosing(WindowEvent e) {
/* 36 */         BlockingDialog.this.finish();
/*    */       }
/*    */     });
/*    */   }
/*    */   
/*    */   public void actionPerformed(ActionEvent e) {
/* 42 */     finish();
/*    */   }
/*    */   
/*    */   public void finish() {
/* 46 */     responded();
/* 47 */     setVisible(false);
/*    */   }
/*    */   
/*    */   public synchronized void waitForResponse() {
/*    */     try {
/* 52 */       while (this.stillWaiting) {
/* 53 */         wait();
/*    */       }
/*    */     } catch (Exception localException) {}
/*    */   }
/*    */   
/*    */   public synchronized void responded() {
/* 59 */     this.stillWaiting = false;
/* 60 */     notifyAll();
/*    */   }
/*    */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\BlockingDialog.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */