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