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