Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / javax / swing / DefaultBoundedRangeModel.js
index cb93f77..bdaae50 100644 (file)
-Clazz.declarePackage ("javax.swing");\r
-Clazz.load (["javax.swing.BoundedRangeModel", "javax.swing.event.EventListenerList"], "javax.swing.DefaultBoundedRangeModel", ["java.lang.IllegalArgumentException", "javax.swing.event.ChangeEvent", "$.ChangeListener"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.changeEvent = null;\r
-this.listenerList = null;\r
-this.value = 0;\r
-this.extent = 0;\r
-this.min = 0;\r
-this.max = 100;\r
-this.isAdjusting = false;\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing, "DefaultBoundedRangeModel", null, javax.swing.BoundedRangeModel);\r
-Clazz.prepareFields (c$, function () {\r
-this.listenerList =  new javax.swing.event.EventListenerList ();\r
-});\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (value, extent, min, max) {\r
-if ((max >= min) && (value >= min) && ((value + extent) >= value) && ((value + extent) <= max)) {\r
-this.value = value;\r
-this.extent = extent;\r
-this.min = min;\r
-this.max = max;\r
-} else {\r
-throw  new IllegalArgumentException ("invalid range properties");\r
-}}, "~N,~N,~N,~N");\r
-Clazz.overrideMethod (c$, "getValue", \r
-function () {\r
-return this.value;\r
-});\r
-Clazz.overrideMethod (c$, "getExtent", \r
-function () {\r
-return this.extent;\r
-});\r
-Clazz.overrideMethod (c$, "getMinimum", \r
-function () {\r
-return this.min;\r
-});\r
-Clazz.overrideMethod (c$, "getMaximum", \r
-function () {\r
-return this.max;\r
-});\r
-Clazz.overrideMethod (c$, "setValue", \r
-function (n) {\r
-n = Math.min (n, 2147483647 - this.extent);\r
-var newValue = Math.max (n, this.min);\r
-if (newValue + this.extent > this.max) {\r
-newValue = this.max - this.extent;\r
-}this.setRangeProperties (newValue, this.extent, this.min, this.max, this.isAdjusting);\r
-}, "~N");\r
-Clazz.overrideMethod (c$, "setExtent", \r
-function (n) {\r
-var newExtent = Math.max (0, n);\r
-if (this.value + newExtent > this.max) {\r
-newExtent = this.max - this.value;\r
-}this.setRangeProperties (this.value, newExtent, this.min, this.max, this.isAdjusting);\r
-}, "~N");\r
-Clazz.overrideMethod (c$, "setMinimum", \r
-function (n) {\r
-var newMax = Math.max (n, this.max);\r
-var newValue = Math.max (n, this.value);\r
-var newExtent = Math.min (newMax - newValue, this.extent);\r
-this.setRangeProperties (newValue, newExtent, n, newMax, this.isAdjusting);\r
-}, "~N");\r
-Clazz.overrideMethod (c$, "setMaximum", \r
-function (n) {\r
-var newMin = Math.min (n, this.min);\r
-var newExtent = Math.min (n - newMin, this.extent);\r
-var newValue = Math.min (n - newExtent, this.value);\r
-this.setRangeProperties (newValue, newExtent, newMin, n, this.isAdjusting);\r
-}, "~N");\r
-Clazz.overrideMethod (c$, "setValueIsAdjusting", \r
-function (b) {\r
-this.setRangeProperties (this.value, this.extent, this.min, this.max, b);\r
-}, "~B");\r
-Clazz.overrideMethod (c$, "getValueIsAdjusting", \r
-function () {\r
-return this.isAdjusting;\r
-});\r
-Clazz.overrideMethod (c$, "setRangeProperties", \r
-function (newValue, newExtent, newMin, newMax, adjusting) {\r
-if (newMin > newMax) {\r
-newMin = newMax;\r
-}if (newValue > newMax) {\r
-newMax = newValue;\r
-}if (newValue < newMin) {\r
-newMin = newValue;\r
-}if ((newExtent + newValue) > newMax) {\r
-newExtent = newMax - newValue;\r
-}if (newExtent < 0) {\r
-newExtent = 0;\r
-}var isChange = (newValue != this.value) || (newExtent != this.extent) || (newMin != this.min) || (newMax != this.max) || (adjusting != this.isAdjusting);\r
-if (isChange) {\r
-this.value = newValue;\r
-this.extent = newExtent;\r
-this.min = newMin;\r
-this.max = newMax;\r
-this.isAdjusting = adjusting;\r
-this.fireStateChanged ();\r
-}}, "~N,~N,~N,~N,~B");\r
-Clazz.overrideMethod (c$, "addChangeListener", \r
-function (l) {\r
-this.listenerList.add (javax.swing.event.ChangeListener, l);\r
-}, "javax.swing.event.ChangeListener");\r
-Clazz.overrideMethod (c$, "removeChangeListener", \r
-function (l) {\r
-this.listenerList.remove (javax.swing.event.ChangeListener, l);\r
-}, "javax.swing.event.ChangeListener");\r
-Clazz.defineMethod (c$, "getChangeListeners", \r
-function () {\r
-return this.listenerList.getListeners (javax.swing.event.ChangeListener);\r
-});\r
-Clazz.defineMethod (c$, "fireStateChanged", \r
-function () {\r
-var listeners = this.listenerList.getListenerList ();\r
-for (var i = listeners.length - 2; i >= 0; i -= 2) {\r
-if (listeners[i] === javax.swing.event.ChangeListener) {\r
-if (this.changeEvent == null) {\r
-this.changeEvent =  new javax.swing.event.ChangeEvent (this);\r
-}(listeners[i + 1]).stateChanged (this.changeEvent);\r
-}}\r
-});\r
-Clazz.overrideMethod (c$, "toString", \r
-function () {\r
-var modelString = "value=" + this.getValue () + ", " + "extent=" + this.getExtent () + ", " + "min=" + this.getMinimum () + ", " + "max=" + this.getMaximum () + ", " + "adj=" + this.getValueIsAdjusting ();\r
-return this.getClass ().getName () + "[" + modelString + "]";\r
-});\r
-Clazz.defineMethod (c$, "getListeners", \r
-function (listenerType) {\r
-return this.listenerList.getListeners (listenerType);\r
-}, "Class");\r
-});\r
+Clazz.declarePackage ("javax.swing");
+Clazz.load (["javax.swing.BoundedRangeModel", "javax.swing.event.EventListenerList"], "javax.swing.DefaultBoundedRangeModel", ["java.lang.IllegalArgumentException", "javax.swing.event.ChangeEvent", "$.ChangeListener"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.changeEvent = null;
+this.listenerList = null;
+this.value = 0;
+this.extent = 0;
+this.min = 0;
+this.max = 100;
+this.isAdjusting = false;
+Clazz.instantialize (this, arguments);
+}, javax.swing, "DefaultBoundedRangeModel", null, javax.swing.BoundedRangeModel);
+Clazz.prepareFields (c$, function () {
+this.listenerList =  new javax.swing.event.EventListenerList ();
+});
+Clazz.makeConstructor (c$, 
+function () {
+});
+Clazz.makeConstructor (c$, 
+function (value, extent, min, max) {
+if ((max >= min) && (value >= min) && ((value + extent) >= value) && ((value + extent) <= max)) {
+this.value = value;
+this.extent = extent;
+this.min = min;
+this.max = max;
+} else {
+throw  new IllegalArgumentException ("invalid range properties");
+}}, "~N,~N,~N,~N");
+Clazz.overrideMethod (c$, "getValue", 
+function () {
+return this.value;
+});
+Clazz.overrideMethod (c$, "getExtent", 
+function () {
+return this.extent;
+});
+Clazz.overrideMethod (c$, "getMinimum", 
+function () {
+return this.min;
+});
+Clazz.overrideMethod (c$, "getMaximum", 
+function () {
+return this.max;
+});
+Clazz.overrideMethod (c$, "setValue", 
+function (n) {
+n = Math.min (n, 2147483647 - this.extent);
+var newValue = Math.max (n, this.min);
+if (newValue + this.extent > this.max) {
+newValue = this.max - this.extent;
+}this.setRangeProperties (newValue, this.extent, this.min, this.max, this.isAdjusting);
+}, "~N");
+Clazz.overrideMethod (c$, "setExtent", 
+function (n) {
+var newExtent = Math.max (0, n);
+if (this.value + newExtent > this.max) {
+newExtent = this.max - this.value;
+}this.setRangeProperties (this.value, newExtent, this.min, this.max, this.isAdjusting);
+}, "~N");
+Clazz.overrideMethod (c$, "setMinimum", 
+function (n) {
+var newMax = Math.max (n, this.max);
+var newValue = Math.max (n, this.value);
+var newExtent = Math.min (newMax - newValue, this.extent);
+this.setRangeProperties (newValue, newExtent, n, newMax, this.isAdjusting);
+}, "~N");
+Clazz.overrideMethod (c$, "setMaximum", 
+function (n) {
+var newMin = Math.min (n, this.min);
+var newExtent = Math.min (n - newMin, this.extent);
+var newValue = Math.min (n - newExtent, this.value);
+this.setRangeProperties (newValue, newExtent, newMin, n, this.isAdjusting);
+}, "~N");
+Clazz.overrideMethod (c$, "setValueIsAdjusting", 
+function (b) {
+this.setRangeProperties (this.value, this.extent, this.min, this.max, b);
+}, "~B");
+Clazz.overrideMethod (c$, "getValueIsAdjusting", 
+function () {
+return this.isAdjusting;
+});
+Clazz.overrideMethod (c$, "setRangeProperties", 
+function (newValue, newExtent, newMin, newMax, adjusting) {
+if (newMin > newMax) {
+newMin = newMax;
+}if (newValue > newMax) {
+newMax = newValue;
+}if (newValue < newMin) {
+newMin = newValue;
+}if ((newExtent + newValue) > newMax) {
+newExtent = newMax - newValue;
+}if (newExtent < 0) {
+newExtent = 0;
+}var isChange = (newValue != this.value) || (newExtent != this.extent) || (newMin != this.min) || (newMax != this.max) || (adjusting != this.isAdjusting);
+if (isChange) {
+this.value = newValue;
+this.extent = newExtent;
+this.min = newMin;
+this.max = newMax;
+this.isAdjusting = adjusting;
+this.fireStateChanged ();
+}}, "~N,~N,~N,~N,~B");
+Clazz.overrideMethod (c$, "addChangeListener", 
+function (l) {
+this.listenerList.add (javax.swing.event.ChangeListener, l);
+}, "javax.swing.event.ChangeListener");
+Clazz.overrideMethod (c$, "removeChangeListener", 
+function (l) {
+this.listenerList.remove (javax.swing.event.ChangeListener, l);
+}, "javax.swing.event.ChangeListener");
+Clazz.defineMethod (c$, "getChangeListeners", 
+function () {
+return this.listenerList.getListeners (javax.swing.event.ChangeListener);
+});
+Clazz.defineMethod (c$, "fireStateChanged", 
+function () {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.ChangeListener) {
+if (this.changeEvent == null) {
+this.changeEvent =  new javax.swing.event.ChangeEvent (this);
+}(listeners[i + 1]).stateChanged (this.changeEvent);
+}}
+});
+Clazz.overrideMethod (c$, "toString", 
+function () {
+var modelString = "value=" + this.getValue () + ", " + "extent=" + this.getExtent () + ", " + "min=" + this.getMinimum () + ", " + "max=" + this.getMaximum () + ", " + "adj=" + this.getValueIsAdjusting ();
+return this.getClass ().getName () + "[" + modelString + "]";
+});
+Clazz.defineMethod (c$, "getListeners", 
+function (listenerType) {
+return this.listenerList.getListeners (listenerType);
+}, "Class");
+});