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