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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
|
/* */ package NET.worlds.console;
/* */
/* */ import NET.worlds.core.IniFile;
/* */ import NET.worlds.scape.Pilot;
/* */ import java.awt.BorderLayout;
/* */ import java.awt.Color;
/* */ import java.awt.Event;
/* */ import java.awt.Panel;
/* */ import java.awt.TextField;
/* */ import java.awt.Window;
/* */ import java.io.PrintStream;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class WhisperDialog
/* */ extends PolledDialog
/* */ {
/* */ private static final long serialVersionUID = -5767168735798633258L;
/* */ protected static Window parent;
/* */ protected boolean building;
/* */
/* */ static void setParent(Window p)
/* */ {
/* 74 */ parent = p;
/* */ }
/* */
/* */ static void sendTalkMessage(String msg) {
/* 78 */ Main.register(new MainCallback() {
/* */ public void mainCallback() {
/* 80 */ System.out.println("Sending a Text Message: " + WhisperDialog.this);
/* 81 */ Pilot.sendText(WhisperDialog.this);
/* 82 */ Main.unregister(this);
/* */ }
/* */ });
/* */ }
/* */
/* 87 */ protected boolean isTrading = false;
/* */ protected WhisperPart whisperPart;
/* */ protected String partner;
/* */ protected boolean isBroadcast;
/* */ protected boolean built;
/* 92 */ protected static int counter = 0;
/* */ protected static final int OFFSET = 20;
/* */ protected static final int OFF_TOT = 6;
/* */
/* */ protected WhisperDialog(Window parent, String partner)
/* */ {
/* 98 */ super(parent, null, Console.message("Whisper-to-from2") + Console.parseExtended(partner), false);
/* */
/* 100 */ this.partner = partner;
/* 101 */ this.isBroadcast = true;
/* 102 */ if (partner.equals("room")) {
/* 103 */ setTitle(Console.message("Broadcast-Users"));
/* 104 */ } else if (partner.equals("world")) {
/* 105 */ setTitle(Console.message("Broadcast-All"));
/* */ } else
/* 107 */ this.isBroadcast = false;
/* 108 */ this.whisperPart = new WhisperPart(partner);
/* 109 */ Console active = Console.getActive();
/* 110 */ if (active != null) {
/* 111 */ active.addPart(this.whisperPart);
/* */ }
/* */
/* */
/* */
/* 116 */ int tier = counter / 6;
/* 117 */ int pos = counter % 6;
/* 118 */ setAlignment(1, ((pos + tier) % 12 - 5) *
/* 119 */ 20, (pos % 6 - 5) * 20);
/* 120 */ counter += 1;
/* */ }
/* */
/* */ protected void takeFocus() {
/* 124 */ this.whisperPart.forceTakeFocus();
/* */ }
/* */
/* */
/* */
/* */
/* */ public void setVisible(boolean visible)
/* */ {
/* 132 */ super.setVisible(visible);
/* */
/* 134 */ if (visible)
/* */ {
/* */
/* */
/* */
/* 139 */ this.whisperPart.scrollToBottom();
/* */
/* */
/* */
/* 143 */ int toFront = IniFile.override().getIniInt("whispersToFront", 0);
/* 144 */ if (toFront != 0) {
/* 145 */ toFront();
/* */ }
/* */ }
/* */ }
/* */
/* */ protected void send(String msg) {
/* 151 */ this.whisperPart.println("< " + msg);
/* */ }
/* */
/* */ protected synchronized void print(String msg) {
/* 155 */ this.whisperPart.println("> " + msg);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ protected synchronized void build()
/* */ {
/* 166 */ this.building = false;
/* */
/* 168 */ if (this.built) {
/* 169 */ removeAll();
/* */ }
/* 171 */ this.built = true;
/* */
/* */
/* */
/* 175 */ Color bg1 = new Color(0, 0, 0);
/* 176 */ Color bg2 = new Color(0, 192, 192);
/* */
/* 178 */ Color fg1 = new Color(255, 255, 255);
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 189 */ setBackground(fg1);
/* 190 */ setForeground(bg1);
/* */
/* */
/* */
/* 194 */ this.whisperPart.line.setBackground(this.isTrading ? bg2 : fg1);
/* 195 */ this.whisperPart.listen.setBackground(fg1);
/* */
/* 197 */ Panel insListen = new InsetPanel(new BorderLayout(), 3, 1, 1, 1);
/* 198 */ insListen.setBackground(Color.lightGray);
/* 199 */ insListen.add("Center", this.whisperPart.listen.getComponent());
/* 200 */ add("Center", insListen);
/* 201 */ Panel insLine = new InsetPanel(new BorderLayout(), 2, 1, 2, 1);
/* 202 */ insLine.setBackground(Color.lightGray);
/* 203 */ insLine.add("Center", this.whisperPart.line);
/* 204 */ add("South", insLine);
/* */
/* 206 */ validate();
/* */ }
/* */
/* */ protected boolean setValue() {
/* 210 */ return true;
/* */ }
/* */
/* */ @Deprecated
/* */ public synchronized boolean keyDown(Event event, int key)
/* */ {
/* 216 */ this.whisperPart.line.requestFocus();
/* */
/* 218 */ if (key == 10) {
/* 219 */ this.whisperPart.trigger();
/* 220 */ return true;
/* */ }
/* 222 */ return false;
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\WhisperDialog.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|