JAL-1807
[jalview.git] / site / j2s / jssun / applet / AppletEventMulticaster.js
1 Clazz.declarePackage ("jssun.applet");
2 Clazz.load (["jssun.applet.AppletListener"], "jssun.applet.AppletEventMulticaster", null, function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.a = null;
5 this.b = null;
6 Clazz.instantialize (this, arguments);
7 }, jssun.applet, "AppletEventMulticaster", null, jssun.applet.AppletListener);
8 Clazz.makeConstructor (c$, 
9 function (a, b) {
10 this.a = a;
11 this.b = b;
12 }, "jssun.applet.AppletListener,jssun.applet.AppletListener");
13 Clazz.defineMethod (c$, "appletStateChanged", 
14 function (e) {
15 this.a.appletStateChanged (e);
16 this.b.appletStateChanged (e);
17 }, "jssun.applet.AppletEvent");
18 c$.add = Clazz.defineMethod (c$, "add", 
19 function (a, b) {
20 return jssun.applet.AppletEventMulticaster.addInternal (a, b);
21 }, "jssun.applet.AppletListener,jssun.applet.AppletListener");
22 c$.remove = Clazz.defineMethod (c$, "remove", 
23 function (l, oldl) {
24 return jssun.applet.AppletEventMulticaster.removeInternal (l, oldl);
25 }, "jssun.applet.AppletListener,jssun.applet.AppletListener");
26 c$.addInternal = Clazz.defineMethod (c$, "addInternal", 
27  function (a, b) {
28 if (a == null) return b;
29 if (b == null) return a;
30 return  new jssun.applet.AppletEventMulticaster (a, b);
31 }, "jssun.applet.AppletListener,jssun.applet.AppletListener");
32 Clazz.defineMethod (c$, "remove", 
33 function (oldl) {
34 if (oldl === this.a) return this.b;
35 if (oldl === this.b) return this.a;
36 var a2 = jssun.applet.AppletEventMulticaster.removeInternal (this.a, oldl);
37 var b2 = jssun.applet.AppletEventMulticaster.removeInternal (this.b, oldl);
38 if (a2 === this.a && b2 === this.b) {
39 return this;
40 }return jssun.applet.AppletEventMulticaster.addInternal (a2, b2);
41 }, "jssun.applet.AppletListener");
42 c$.removeInternal = Clazz.defineMethod (c$, "removeInternal", 
43  function (l, oldl) {
44 if (l === oldl || l == null) {
45 return null;
46 } else if (Clazz.instanceOf (l, jssun.applet.AppletEventMulticaster)) {
47 return (l).remove (oldl);
48 } else {
49 return l;
50 }}, "jssun.applet.AppletListener,jssun.applet.AppletListener");
51 });