JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / java / awt / event / ContainerEvent.js
1 Clazz.declarePackage ("java.awt.event");\r
2 Clazz.load (["java.awt.event.ComponentEvent"], "java.awt.event.ContainerEvent", ["java.awt.Container"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.child = null;\r
5 Clazz.instantialize (this, arguments);\r
6 }, java.awt.event, "ContainerEvent", java.awt.event.ComponentEvent);\r
7 Clazz.makeConstructor (c$, \r
8 function (source, id, child) {\r
9 Clazz.superConstructor (this, java.awt.event.ContainerEvent, [source, id]);\r
10 this.child = child;\r
11 }, "java.awt.Component,~N,java.awt.Component");\r
12 Clazz.defineMethod (c$, "getContainer", \r
13 function () {\r
14 return (Clazz.instanceOf (this.source, java.awt.Container)) ? this.source : null;\r
15 });\r
16 Clazz.defineMethod (c$, "getChild", \r
17 function () {\r
18 return this.child;\r
19 });\r
20 Clazz.overrideMethod (c$, "paramString", \r
21 function () {\r
22 var typeStr;\r
23 switch (this.id) {\r
24 case 300:\r
25 typeStr = "COMPONENT_ADDED";\r
26 break;\r
27 case 301:\r
28 typeStr = "COMPONENT_REMOVED";\r
29 break;\r
30 default:\r
31 typeStr = "unknown type";\r
32 }\r
33 return typeStr + ",child=" + this.child.getName ();\r
34 });\r
35 Clazz.defineStatics (c$,\r
36 "CONTAINER_FIRST", 300,\r
37 "CONTAINER_LAST", 301,\r
38 "COMPONENT_ADDED", 300,\r
39 "COMPONENT_REMOVED", 301);\r
40 });\r