Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / swingjs / j2s / java / beans / ChangeListenerMap.js
index 03a33ff..e0ae102 100644 (file)
-Clazz.declarePackage ("java.beans");\r
-Clazz.load (null, "java.beans.ChangeListenerMap", ["java.util.ArrayList", "$.Collections", "$.EventListenerProxy", "$.HashMap"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.map = null;\r
-Clazz.instantialize (this, arguments);\r
-}, java.beans, "ChangeListenerMap");\r
-Clazz.defineMethod (c$, "add", \r
-function (name, listener) {\r
-if (this.map == null) {\r
-this.map =  new java.util.HashMap ();\r
-}var array = this.map.get (name);\r
-var size = (array != null) ? array.length : 0;\r
-var clone = this.newArray (size + 1);\r
-clone[size] = listener;\r
-if (array != null) {\r
-System.arraycopy (array, 0, clone, 0, size);\r
-}this.map.put (name, clone);\r
-}, "~S,~O");\r
-Clazz.defineMethod (c$, "remove", \r
-function (name, listener) {\r
-if (this.map != null) {\r
-var array = this.map.get (name);\r
-if (array != null) {\r
-for (var i = 0; i < array.length; i++) {\r
-if (listener.equals (array[i])) {\r
-var size = array.length - 1;\r
-if (size > 0) {\r
-var clone = this.newArray (size);\r
-System.arraycopy (array, 0, clone, 0, i);\r
-System.arraycopy (array, i + 1, clone, i, size - i);\r
-this.map.put (name, clone);\r
-} else {\r
-this.map.remove (name);\r
-if (this.map.isEmpty ()) {\r
-this.map = null;\r
-}}break;\r
-}}\r
-}}}, "~S,~O");\r
-Clazz.defineMethod (c$, "get", \r
-function (name) {\r
-return (this.map != null) ? this.map.get (name) : null;\r
-}, "~S");\r
-Clazz.defineMethod (c$, "set", \r
-function (name, listeners) {\r
-if (listeners != null) {\r
-if (this.map == null) {\r
-this.map =  new java.util.HashMap ();\r
-}this.map.put (name, listeners);\r
-} else if (this.map != null) {\r
-this.map.remove (name);\r
-if (this.map.isEmpty ()) {\r
-this.map = null;\r
-}}}, "~S,~A");\r
-Clazz.defineMethod (c$, "getListeners", \r
-function () {\r
-if (this.map == null) {\r
-return this.newArray (0);\r
-}var list =  new java.util.ArrayList ();\r
-var listeners = this.map.get (null);\r
-if (listeners != null) {\r
-for (var listener, $listener = 0, $$listener = listeners; $listener < $$listener.length && ((listener = $$listener[$listener]) || true); $listener++) {\r
-list.add (listener);\r
-}\r
-}for (var entry, $entry = this.map.entrySet ().iterator (); $entry.hasNext () && ((entry = $entry.next ()) || true);) {\r
-var name = entry.getKey ();\r
-if (name != null) {\r
-for (var listener, $listener = 0, $$listener = entry.getValue (); $listener < $$listener.length && ((listener = $$listener[$listener]) || true); $listener++) {\r
-list.add (this.newProxy (name, listener));\r
-}\r
-}}\r
-return list.toArray (this.newArray (list.size ()));\r
-});\r
-Clazz.defineMethod (c$, "getListeners", \r
-function (name) {\r
-if (name != null) {\r
-var listeners = this.get (name);\r
-if (listeners != null) {\r
-return listeners.clone ();\r
-}}return this.newArray (0);\r
-}, "~S");\r
-Clazz.defineMethod (c$, "hasListeners", \r
-function (name) {\r
-if (this.map == null) {\r
-return false;\r
-}var array = this.map.get (null);\r
-return (array != null) || ((name != null) && (null != this.map.get (name)));\r
-}, "~S");\r
-Clazz.defineMethod (c$, "getEntries", \r
-function () {\r
-return (this.map != null) ? this.map.entrySet () : java.util.Collections.emptySet ();\r
-});\r
-Clazz.defineMethod (c$, "extract", \r
-function (listener) {\r
-while (Clazz.instanceOf (listener, java.util.EventListenerProxy)) {\r
-var proxy = listener;\r
-listener = proxy.getListener ();\r
-}\r
-return listener;\r
-}, "~O");\r
-});\r
+Clazz.declarePackage ("java.beans");
+Clazz.load (null, "java.beans.ChangeListenerMap", ["java.util.ArrayList", "$.Collections", "$.EventListenerProxy", "$.HashMap"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.map = null;
+Clazz.instantialize (this, arguments);
+}, java.beans, "ChangeListenerMap");
+Clazz.defineMethod (c$, "add", 
+function (name, listener) {
+if (this.map == null) {
+this.map =  new java.util.HashMap ();
+}var array = this.map.get (name);
+var size = (array != null) ? array.length : 0;
+var clone = this.newArray (size + 1);
+clone[size] = listener;
+if (array != null) {
+System.arraycopy (array, 0, clone, 0, size);
+}this.map.put (name, clone);
+}, "~S,~O");
+Clazz.defineMethod (c$, "remove", 
+function (name, listener) {
+if (this.map != null) {
+var array = this.map.get (name);
+if (array != null) {
+for (var i = 0; i < array.length; i++) {
+if (listener.equals (array[i])) {
+var size = array.length - 1;
+if (size > 0) {
+var clone = this.newArray (size);
+System.arraycopy (array, 0, clone, 0, i);
+System.arraycopy (array, i + 1, clone, i, size - i);
+this.map.put (name, clone);
+} else {
+this.map.remove (name);
+if (this.map.isEmpty ()) {
+this.map = null;
+}}break;
+}}
+}}}, "~S,~O");
+Clazz.defineMethod (c$, "get", 
+function (name) {
+return (this.map != null) ? this.map.get (name) : null;
+}, "~S");
+Clazz.defineMethod (c$, "set", 
+function (name, listeners) {
+if (listeners != null) {
+if (this.map == null) {
+this.map =  new java.util.HashMap ();
+}this.map.put (name, listeners);
+} else if (this.map != null) {
+this.map.remove (name);
+if (this.map.isEmpty ()) {
+this.map = null;
+}}}, "~S,~A");
+Clazz.defineMethod (c$, "getListeners", 
+function () {
+if (this.map == null) {
+return this.newArray (0);
+}var list =  new java.util.ArrayList ();
+var listeners = this.map.get (null);
+if (listeners != null) {
+for (var listener, $listener = 0, $$listener = listeners; $listener < $$listener.length && ((listener = $$listener[$listener]) || true); $listener++) {
+list.add (listener);
+}
+}for (var entry, $entry = this.map.entrySet ().iterator (); $entry.hasNext () && ((entry = $entry.next ()) || true);) {
+var name = entry.getKey ();
+if (name != null) {
+for (var listener, $listener = 0, $$listener = entry.getValue (); $listener < $$listener.length && ((listener = $$listener[$listener]) || true); $listener++) {
+list.add (this.newProxy (name, listener));
+}
+}}
+return list.toArray (this.newArray (list.size ()));
+});
+Clazz.defineMethod (c$, "getListeners", 
+function (name) {
+if (name != null) {
+var listeners = this.get (name);
+if (listeners != null) {
+return listeners.clone ();
+}}return this.newArray (0);
+}, "~S");
+Clazz.defineMethod (c$, "hasListeners", 
+function (name) {
+if (this.map == null) {
+return false;
+}var array = this.map.get (null);
+return (array != null) || ((name != null) && (null != this.map.get (name)));
+}, "~S");
+Clazz.defineMethod (c$, "getEntries", 
+function () {
+return (this.map != null) ? this.map.entrySet () : java.util.Collections.emptySet ();
+});
+Clazz.defineMethod (c$, "extract", 
+function (listener) {
+while (Clazz.instanceOf (listener, java.util.EventListenerProxy)) {
+var proxy = listener;
+listener = proxy.getListener ();
+}
+return listener;
+}, "~O");
+});