Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / awt / event / WindowEvent.js
1 Clazz.declarePackage ("java.awt.event");
2 Clazz.load (["java.awt.event.ComponentEvent"], "java.awt.event.WindowEvent", ["java.awt.Window", "jssun.awt.AppContext", "$.SunToolkit"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.opposite = null;
5 this.oldState = 0;
6 this.newState = 0;
7 Clazz.instantialize (this, arguments);
8 }, java.awt.event, "WindowEvent", java.awt.event.ComponentEvent);
9 Clazz.makeConstructor (c$, 
10 function (source, id, opposite, oldState, newState) {
11 Clazz.superConstructor (this, java.awt.event.WindowEvent, [source, id]);
12 this.opposite = opposite;
13 this.oldState = oldState;
14 this.newState = newState;
15 }, "java.awt.Window,~N,java.awt.Window,~N,~N");
16 Clazz.makeConstructor (c$, 
17 function (source, id, opposite) {
18 this.construct (source, id, opposite, 0, 0);
19 }, "java.awt.Window,~N,java.awt.Window");
20 Clazz.makeConstructor (c$, 
21 function (source, id, oldState, newState) {
22 this.construct (source, id, null, oldState, newState);
23 }, "java.awt.Window,~N,~N,~N");
24 Clazz.makeConstructor (c$, 
25 function (source, id) {
26 this.construct (source, id, null, 0, 0);
27 }, "java.awt.Window,~N");
28 Clazz.defineMethod (c$, "getWindow", 
29 function () {
30 return (Clazz.instanceOf (this.source, java.awt.Window)) ? this.source : null;
31 });
32 Clazz.defineMethod (c$, "getOppositeWindow", 
33 function () {
34 if (this.opposite == null) {
35 return null;
36 }return (jssun.awt.SunToolkit.targetToAppContext (this.opposite) === jssun.awt.AppContext.getAppContext ()) ? this.opposite : null;
37 });
38 Clazz.defineMethod (c$, "getOldState", 
39 function () {
40 return this.oldState;
41 });
42 Clazz.defineMethod (c$, "getNewState", 
43 function () {
44 return this.newState;
45 });
46 Clazz.overrideMethod (c$, "paramString", 
47 function () {
48 var typeStr;
49 switch (this.id) {
50 case 200:
51 typeStr = "WINDOW_OPENED";
52 break;
53 case 201:
54 typeStr = "WINDOW_CLOSING";
55 break;
56 case 202:
57 typeStr = "WINDOW_CLOSED";
58 break;
59 case 203:
60 typeStr = "WINDOW_ICONIFIED";
61 break;
62 case 204:
63 typeStr = "WINDOW_DEICONIFIED";
64 break;
65 case 205:
66 typeStr = "WINDOW_ACTIVATED";
67 break;
68 case 206:
69 typeStr = "WINDOW_DEACTIVATED";
70 break;
71 case 207:
72 typeStr = "WINDOW_GAINED_FOCUS";
73 break;
74 case 208:
75 typeStr = "WINDOW_LOST_FOCUS";
76 break;
77 case 209:
78 typeStr = "WINDOW_STATE_CHANGED";
79 break;
80 default:
81 typeStr = "unknown type";
82 }
83 typeStr += ",opposite=" + this.getOppositeWindow () + ",oldState=" + this.oldState + ",newState=" + this.newState;
84 return typeStr;
85 });
86 Clazz.defineStatics (c$,
87 "WINDOW_FIRST", 200,
88 "WINDOW_OPENED", 200,
89 "WINDOW_CLOSING", 201,
90 "WINDOW_CLOSED", 202,
91 "WINDOW_ICONIFIED", 203,
92 "WINDOW_DEICONIFIED", 204,
93 "WINDOW_ACTIVATED", 205,
94 "WINDOW_DEACTIVATED", 206,
95 "WINDOW_GAINED_FOCUS", 207,
96 "WINDOW_LOST_FOCUS", 208,
97 "WINDOW_STATE_CHANGED", 209,
98 "WINDOW_LAST", 209);
99 });