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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
|
/* */ package NET.worlds.console;
/* */
/* */ import NET.worlds.core.IniFile;
/* */ import java.awt.Dimension;
/* */ import java.awt.Point;
/* */ import java.awt.Rectangle;
/* */ import java.io.IOException;
/* */ import java.util.Enumeration;
/* */ import java.util.Stack;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class WebBrowser
/* */ {
/* 80 */ private static Stack<WebBrowser> browsers = new Stack();
/* */
/* */
/* 83 */ private static boolean disabled = IniFile.gamma().getIniInt("DISABLEIE", 0) != 0;
/* */
/* */
/* */
/* */
/* */ private static boolean everWorked;
/* */
/* */
/* */
/* */
/* */ private int nativeBrowserPointer;
/* */
/* */
/* */
/* */
/* */ private InternetExplorer _activeX;
/* */
/* */
/* */
/* */
/* */
/* */ public static WebBrowser reuseOrMake(String url, String postData)
/* */ throws IOException
/* */ {
/* 107 */ return reuseOrMake(url, postData, defaultPlacement());
/* */ }
/* */
/* */
/* */
/* */
/* 113 */ private static boolean toolbarON = true;
/* */
/* */ public static void useToolbar() {
/* 116 */ toolbarON = true;
/* */ }
/* */
/* */ public static void dontUseToolbar() {
/* 120 */ toolbarON = false;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* 127 */ private static boolean windowFrameON = true;
/* */
/* */ public static void useWindowFrame() {
/* 130 */ windowFrameON = true;
/* */ }
/* */
/* */ public static void dontUseWindowFrame() {
/* 134 */ windowFrameON = false;
/* */ }
/* */
/* */
/* */
/* */
/* 140 */ private static boolean _stayMinimized = false;
/* */
/* */ public static void forceMinimized(boolean force) {
/* 143 */ _stayMinimized = force;
/* */ }
/* */
/* */
/* */
/* */ public static WebBrowser findTag(String tag)
/* */ {
/* 150 */ for (Enumeration<WebBrowser> e = browsers.elements(); e.hasMoreElements();) {
/* 151 */ WebBrowser browser = (WebBrowser)e.nextElement();
/* 152 */ if (tag != null) {
/* 153 */ if (tag.equals(browser.getTag())) {
/* 154 */ return browser;
/* */ }
/* */ }
/* 157 */ else if (browser.getTag() == null) {
/* 158 */ return browser;
/* */ }
/* */ }
/* 161 */ return null;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static WebBrowser reuseOrMake(String url, String postData, Rectangle placement)
/* */ throws IOException
/* */ {
/* 173 */ for (Enumeration<WebBrowser> e = browsers.elements(); e.hasMoreElements();) {
/* 174 */ WebBrowser browser = (WebBrowser)e.nextElement();
/* */
/* 176 */ if (browser.getTag() == null) {
/* */ try {
/* 178 */ browser.browse(url, postData, null);
/* 179 */ return browser;
/* */ }
/* */ catch (IOException localIOException) {}
/* */ }
/* */ }
/* */
/* */
/* */
/* 187 */ return new WebBrowser(url, postData, placement);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 196 */ private String browserTag = null;
/* */
/* */ private String getTag() {
/* 199 */ return this.browserTag;
/* */ }
/* */
/* */
/* */
/* */
/* */ public static WebBrowser reuseOrMake(String url, String postData, Rectangle placement, String tag)
/* */ throws IOException
/* */ {
/* 208 */ for (Enumeration<WebBrowser> e = browsers.elements(); e.hasMoreElements();) {
/* 209 */ WebBrowser browser = (WebBrowser)e.nextElement();
/* */
/* 211 */ if (tag.equals(browser.getTag())) {
/* */ try {
/* 213 */ browser.browse(url, postData, null);
/* 214 */ return browser;
/* */ }
/* */ catch (IOException localIOException) {}
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* 223 */ return new WebBrowser(url, postData, placement, tag);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public static Rectangle defaultPlacement()
/* */ {
/* 232 */ Console c = Console.getActive();
/* 233 */ if ((c instanceof DefaultConsole))
/* 234 */ return ((DefaultConsole)c).getBrowserPlacement();
/* 235 */ return new Rectangle(0, 0, 200, 200);
/* */ }
/* */
/* */ public static boolean isDisabled()
/* */ {
/* 240 */ return disabled;
/* */ }
/* */
/* */ public static void setDisabled(boolean be)
/* */ {
/* 245 */ IniFile.gamma().setIniInt("DISABLEIE", be ? 1 : 0);
/* 246 */ disabled = be;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public WebBrowser(String url, String postData)
/* */ throws IOException
/* */ {
/* 256 */ this(url, postData, defaultPlacement());
/* */ }
/* */
/* */ public WebBrowser(String url, String postData, Rectangle placement) throws IOException
/* */ {
/* 261 */ this(url, postData, placement, null);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public WebBrowser(String url, String postData, Rectangle placement, String tag)
/* */ throws IOException
/* */ {
/* 271 */ if (!disabled)
/* */ {
/* */
/* 274 */ this._activeX = new InternetExplorer(this);
/* */ try {
/* 276 */ this.nativeBrowserPointer = openBrowser();
/* */ }
/* */ catch (IOException ioe)
/* */ {
/* */ try {
/* 281 */ this._activeX.Release();
/* */ } catch (OLEInvalidObjectException e) {
/* 283 */ if (!$assertionsDisabled) throw new AssertionError();
/* */ }
/* 285 */ this._activeX = null;
/* */
/* */
/* */
/* */
/* 290 */ disabled = true;
/* 291 */ throw ioe;
/* */ }
/* */
/* */
/* */
/* 296 */ browsers.push(this);
/* */
/* */
/* */
/* 300 */ if (tag != null) {
/* 301 */ this.browserTag = tag;
/* */ }
/* */
/* */ try
/* */ {
/* 306 */ browse(url, postData, placement);
/* */
/* */
/* 309 */ everWorked = true;
/* */
/* */ }
/* */ catch (IOException ioe)
/* */ {
/* */
/* 315 */ if (!everWorked)
/* 316 */ disabled = true;
/* 317 */ throw ioe;
/* */ }
/* */ } else {
/* 320 */ throw new IOException();
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void browse(String url, String postData, Rectangle placement)
/* */ throws IOException
/* */ {
/* 334 */ if (this.nativeBrowserPointer != 0) {
/* 335 */ int x = -1;
/* 336 */ int y = -1;
/* 337 */ int w = -1;
/* 338 */ int h = -1;
/* 339 */ if (placement != null) {
/* 340 */ x = placement.x;
/* 341 */ y = placement.y;
/* 342 */ w = placement.width;
/* 343 */ h = placement.height;
/* */ }
/* */ try {
/* 346 */ browse(url, postData, x, y, w, h, this.nativeBrowserPointer);
/* */ } catch (IOException ioe) {
/* 348 */ close();
/* 349 */ throw ioe;
/* */ }
/* */ } else {
/* 352 */ throw new IOException();
/* */ }
/* */ }
/* */
/* */
/* */
/* */ public void close()
/* */ {
/* 360 */ if (this.nativeBrowserPointer != 0) {
/* 361 */ closeBrowser(this.nativeBrowserPointer);
/* 362 */ this.nativeBrowserPointer = 0;
/* */ try {
/* 364 */ this._activeX.Release();
/* */ } catch (OLEInvalidObjectException e) {
/* 366 */ if (!$assertionsDisabled) throw new AssertionError();
/* */ }
/* 368 */ this._activeX = null;
/* 369 */ browsers.removeElement(this);
/* */ }
/* */ }
/* */
/* */
/* */
/* */ private static native void browse(String paramString1, String paramString2, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5)
/* */ throws IOException;
/* */
/* */
/* */ private static native int openBrowser()
/* */ throws IOException;
/* */
/* */
/* */ private static native void closeBrowser(int paramInt);
/* */
/* */
/* */ public static Rectangle getMapPartPlacement()
/* */ {
/* 388 */ Rectangle placement = null;
/* */
/* 390 */ Console c = Console.getActive();
/* 391 */ if (c != null) {
/* 392 */ MapPart ap = null;
/* 393 */ for (Enumeration<FramePart> e = c.getParts(); e.hasMoreElements();) {
/* 394 */ Object o = e.nextElement();
/* 395 */ if ((o instanceof MapPart)) {
/* 396 */ ap = (MapPart)o;
/* 397 */ break;
/* */ }
/* */ }
/* 400 */ if (ap != null) {
/* 401 */ placement = new Rectangle(ap.getLocationOnScreen(),
/* 402 */ ap.getSize());
/* 403 */ placement.grow(0, 10);
/* 404 */ placement.translate(0, -9);
/* */ }
/* */ }
/* 407 */ return placement;
/* */ }
/* */
/* */
/* */
/* */
/* */ public static Rectangle getAdPartPlacement()
/* */ {
/* 415 */ Rectangle placement = null;
/* */
/* 417 */ Console c = Console.getActive();
/* 418 */ if (c != null) {
/* 419 */ AdPart ap = null;
/* 420 */ for (Enumeration<FramePart> e = c.getParts(); e.hasMoreElements();) {
/* 421 */ Object o = e.nextElement();
/* 422 */ if ((o instanceof AdPart)) {
/* 423 */ ap = (AdPart)o;
/* 424 */ break;
/* */ }
/* */ }
/* 427 */ if (ap != null) {
/* 428 */ placement = new Rectangle(ap.getLocationOnScreen(),
/* 429 */ ap.getSize());
/* 430 */ placement.grow(0, 10);
/* 431 */ placement.translate(0, -9);
/* */ }
/* */ }
/* 434 */ return placement;
/* */ }
/* */
/* */
/* */
/* */
/* */ public static Rectangle getRenderPartPlacement()
/* */ {
/* 442 */ Rectangle placement = null;
/* */
/* 444 */ Console c = Console.getActive();
/* 445 */ if (c != null) {
/* 446 */ RenderCanvas ap = null;
/* 447 */ for (Enumeration<FramePart> e = c.getParts(); e.hasMoreElements();) {
/* 448 */ Object o = e.nextElement();
/* 449 */ if ((o instanceof RenderCanvas)) {
/* 450 */ ap = (RenderCanvas)o;
/* 451 */ break;
/* */ }
/* */ }
/* 454 */ if (ap != null) {
/* 455 */ placement = new Rectangle(ap.getLocationOnScreen(),
/* 456 */ ap.getSize());
/* 457 */ placement.grow(2, 10);
/* 458 */ placement.translate(-1, 7);
/* */ }
/* */ }
/* 461 */ return placement;
/* */ }
/* */
/* */
/* */
/* */
/* */ public static Rectangle getLeftRenderPartPlacement()
/* */ {
/* 469 */ Rectangle placement = null;
/* */
/* 471 */ Console c = Console.getActive();
/* 472 */ if (c != null) {
/* 473 */ RenderCanvas ap = null;
/* 474 */ for (Enumeration<FramePart> e = c.getParts(); e.hasMoreElements();) {
/* 475 */ Object o = e.nextElement();
/* 476 */ if ((o instanceof RenderCanvas)) {
/* 477 */ ap = (RenderCanvas)o;
/* 478 */ break;
/* */ }
/* */ }
/* 481 */ if (ap != null) {
/* 482 */ placement = new Rectangle(ap.getLocationOnScreen(),
/* 483 */ ap.getSize());
/* */
/* 485 */ placement.grow(2, 10);
/* 486 */ placement.translate(-1, 7);
/* 487 */ Dimension d = placement.getSize();
/* 488 */ placement.setSize(d.width / 2, d.height);
/* */ }
/* */ }
/* 491 */ return placement;
/* */ }
/* */
/* */
/* */
/* */ public static Rectangle getOutsidePlacement()
/* */ {
/* 498 */ Rectangle placement = null;
/* */
/* 500 */ Console c = Console.getActive();
/* 501 */ if (c != null) {
/* 502 */ RenderCanvas ap = null;
/* 503 */ for (Enumeration<FramePart> e = c.getParts(); e.hasMoreElements();) {
/* 504 */ Object o = e.nextElement();
/* 505 */ if ((o instanceof RenderCanvas)) {
/* 506 */ ap = (RenderCanvas)o;
/* 507 */ break;
/* */ }
/* */ }
/* 510 */ if (ap != null) {
/* 511 */ Point ploc = ap.getLocationOnScreen();
/* 512 */ Dimension d = new Dimension(250, 500);
/* 513 */ Point bloc = new Point(0, ploc.y);
/* */
/* 515 */ if (ploc.x > 254) {
/* 516 */ ploc.x -= 254;
/* */ } else {
/* 518 */ bloc.x = 0;
/* */ }
/* */
/* 521 */ placement = new Rectangle(bloc, d);
/* */ }
/* */ }
/* 524 */ return placement;
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\WebBrowser.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|