summaryrefslogtreecommitdiff
path: root/NET/worlds/console/LocationDialog.java
blob: 6057afbfa1f9bccd41b0dd5bd24899b104c7eaf3 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*     */ package NET.worlds.console;
/*     */ 
/*     */ import java.awt.Button;
/*     */ import java.awt.Color;
/*     */ import java.awt.Event;
/*     */ import java.awt.Font;
/*     */ import java.awt.GridBagConstraints;
/*     */ import java.awt.GridBagLayout;
/*     */ import java.awt.Label;
/*     */ import java.awt.Panel;
/*     */ import java.awt.TextField;
/*     */ import java.awt.Window;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class LocationDialog
/*     */   extends PolledDialog
/*     */ {
/*     */   private static final long serialVersionUID = -6550771504344935484L;
/*  29 */   private Button okButton = new Button(Console.message("OK"));
/*  30 */   private Button cancelButton = new Button(Console.message("Cancel"));
/*  31 */   private Label label = new Label(Console.message("New-URL"));
/*  32 */   private static Font font = new Font(Console.message("ButtonFont"), 
/*  33 */     0, 12);
/*  34 */   private static Font gfont = new Font(Console.message("GammaTextFont"), 
/*  35 */     0, 12);
/*     */   
/*     */ 
/*     */ 
/*     */   private TextField locationField;
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public LocationDialog(Window parent, DialogReceiver receiver, String title, String location)
/*     */   {
/*  46 */     super(parent, receiver, title, true);
/*     */     
/*  48 */     this.locationField = new TextField(location, 40);
/*  49 */     this.locationField.setFont(gfont);
/*     */     
/*  51 */     ready();
/*     */   }
/*     */   
/*     */   public String getLocationURL()
/*     */   {
/*  56 */     return this.locationField.getText();
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   protected void build()
/*     */   {
/*  65 */     setBackground(Color.white);
/*     */     
/*  67 */     GridBagLayout gbag = new GridBagLayout();
/*  68 */     setLayout(gbag);
/*  69 */     GridBagConstraints c = new GridBagConstraints();
/*  70 */     c.weightx = 0.0D;
/*  71 */     c.weighty = 0.0D;
/*  72 */     c.gridheight = 1;
/*  73 */     c.fill = 0;
/*  74 */     c.anchor = 13;
/*  75 */     c.gridwidth = 1;
/*  76 */     this.label.setFont(font);
/*  77 */     add(gbag, this.label, c);
/*     */     
/*  79 */     c.weightx = 1.0D;
/*  80 */     c.weighty = 0.0D;
/*  81 */     c.gridwidth = 0;
/*  82 */     c.fill = 2;
/*  83 */     c.anchor = 17;
/*  84 */     this.locationField.setFont(gfont);
/*  85 */     add(gbag, this.locationField, c);
/*     */     
/*  87 */     Panel buttons = new Panel();
/*  88 */     this.okButton.setFont(font);
/*  89 */     this.cancelButton.setFont(font);
/*  90 */     buttons.add(this.okButton);
/*  91 */     buttons.add(this.cancelButton);
/*  92 */     c.gridwidth = 0;
/*  93 */     c.anchor = 10;
/*  94 */     c.fill = 0;
/*  95 */     add(gbag, buttons, c);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   public void setVisible(boolean visible)
/*     */   {
/* 102 */     super.setVisible(visible);
/* 103 */     if (visible) {
/* 104 */       this.locationField.requestFocus();
/*     */     }
/*     */   }
/*     */   
/*     */   @Deprecated
/*     */   public boolean handleEvent(Event event)
/*     */   {
/* 111 */     if (event.id == 201)
/* 112 */       return done(false);
/* 113 */     return super.handleEvent(event);
/*     */   }
/*     */   
/*     */   @Deprecated
/*     */   public boolean action(Event event, Object what)
/*     */   {
/* 119 */     Object target = event.target;
/* 120 */     if (target == this.cancelButton)
/* 121 */       return done(false);
/* 122 */     if (target == this.okButton)
/* 123 */       return done(true);
/* 124 */     return false;
/*     */   }
/*     */   
/*     */   @Deprecated
/*     */   public boolean keyDown(Event event, int key)
/*     */   {
/* 130 */     if (key == 27)
/* 131 */       return done(false);
/* 132 */     if (key == 10)
/* 133 */       return done(true);
/* 134 */     return super.keyDown(event, key);
/*     */   }
/*     */ }


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