JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / java / awt / event / FocusEvent.js
1 Clazz.declarePackage ("java.awt.event");\r
2 Clazz.load (["java.awt.event.ComponentEvent"], "java.awt.event.FocusEvent", ["jssun.awt.AppContext", "$.SunToolkit"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.temporary = false;\r
5 this.opposite = null;\r
6 Clazz.instantialize (this, arguments);\r
7 }, java.awt.event, "FocusEvent", java.awt.event.ComponentEvent);\r
8 Clazz.makeConstructor (c$, \r
9 function (source, id, temporary, opposite) {\r
10 Clazz.superConstructor (this, java.awt.event.FocusEvent, [source, id]);\r
11 this.temporary = temporary;\r
12 this.opposite = opposite;\r
13 }, "java.awt.Component,~N,~B,java.awt.Component");\r
14 Clazz.makeConstructor (c$, \r
15 function (source, id, temporary) {\r
16 this.construct (source, id, temporary, null);\r
17 }, "java.awt.Component,~N,~B");\r
18 Clazz.makeConstructor (c$, \r
19 function (source, id) {\r
20 this.construct (source, id, false);\r
21 }, "java.awt.Component,~N");\r
22 Clazz.defineMethod (c$, "isTemporary", \r
23 function () {\r
24 return this.temporary;\r
25 });\r
26 Clazz.defineMethod (c$, "getOppositeComponent", \r
27 function () {\r
28 if (this.opposite == null) {\r
29 return null;\r
30 }return (jssun.awt.SunToolkit.targetToAppContext (this.opposite) === jssun.awt.AppContext.getAppContext ()) ? this.opposite : null;\r
31 });\r
32 Clazz.overrideMethod (c$, "paramString", \r
33 function () {\r
34 var typeStr;\r
35 switch (this.id) {\r
36 case 1004:\r
37 typeStr = "FOCUS_GAINED";\r
38 break;\r
39 case 1005:\r
40 typeStr = "FOCUS_LOST";\r
41 break;\r
42 default:\r
43 typeStr = "unknown type";\r
44 }\r
45 return typeStr + (this.temporary ? ",temporary" : ",permanent") + ",opposite=" + this.getOppositeComponent ();\r
46 });\r
47 Clazz.defineStatics (c$,\r
48 "FOCUS_FIRST", 1004,\r
49 "FOCUS_LAST", 1005,\r
50 "FOCUS_GAINED", 1004,\r
51 "FOCUS_LOST", 1005);\r
52 });\r