JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / java / awt / event / ComponentEvent.js
1 Clazz.declarePackage ("java.awt.event");\r
2 Clazz.load (["java.awt.AWTEvent"], "java.awt.event.ComponentEvent", ["java.awt.Component"], function () {\r
3 c$ = Clazz.declareType (java.awt.event, "ComponentEvent", java.awt.AWTEvent);\r
4 Clazz.defineMethod (c$, "getComponent", \r
5 function () {\r
6 return (Clazz.instanceOf (this.source, java.awt.Component)) ? this.source : null;\r
7 });\r
8 Clazz.overrideMethod (c$, "paramString", \r
9 function () {\r
10 var typeStr;\r
11 var b = (this.source != null ? (this.source).getBounds () : null);\r
12 switch (this.id) {\r
13 case 102:\r
14 typeStr = "COMPONENT_SHOWN";\r
15 break;\r
16 case 103:\r
17 typeStr = "COMPONENT_HIDDEN";\r
18 break;\r
19 case 100:\r
20 typeStr = "COMPONENT_MOVED (" + b.x + "," + b.y + " " + b.width + "x" + b.height + ")";\r
21 break;\r
22 case 101:\r
23 typeStr = "COMPONENT_RESIZED (" + b.x + "," + b.y + " " + b.width + "x" + b.height + ")";\r
24 break;\r
25 default:\r
26 typeStr = "unknown type";\r
27 }\r
28 return typeStr;\r
29 });\r
30 Clazz.defineStatics (c$,\r
31 "COMPONENT_FIRST", 100,\r
32 "COMPONENT_LAST", 103,\r
33 "COMPONENT_MOVED", 100,\r
34 "COMPONENT_RESIZED", 101,\r
35 "COMPONENT_SHOWN", 102,\r
36 "COMPONENT_HIDDEN", 103);\r
37 });\r