Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / javax / swing / SpinnerDateModel.js
index 3fe3451..5980b05 100644 (file)
-Clazz.declarePackage ("javax.swing");\r
-Clazz.load (["javax.swing.AbstractSpinnerModel"], "javax.swing.SpinnerDateModel", ["java.lang.IllegalArgumentException", "java.util.Calendar", "$.Date"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.start = null;\r
-this.end = null;\r
-this.value = null;\r
-this.calendarField = 0;\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing, "SpinnerDateModel", javax.swing.AbstractSpinnerModel);\r
-Clazz.defineMethod (c$, "calendarFieldOK", \r
- function (calendarField) {\r
-switch (calendarField) {\r
-case 0:\r
-case 1:\r
-case 2:\r
-case 3:\r
-case 4:\r
-case 5:\r
-case 6:\r
-case 7:\r
-case 8:\r
-case 9:\r
-case 10:\r
-case 11:\r
-case 12:\r
-case 13:\r
-case 14:\r
-return true;\r
-default:\r
-return false;\r
-}\r
-}, "~N");\r
-Clazz.makeConstructor (c$, \r
-function (value, start, end, calendarField) {\r
-Clazz.superConstructor (this, javax.swing.SpinnerDateModel, []);\r
-if (value == null) {\r
-throw  new IllegalArgumentException ("value is null");\r
-}if (!this.calendarFieldOK (calendarField)) {\r
-throw  new IllegalArgumentException ("invalid calendarField");\r
-}if (!(((start == null) || (start.compareTo (value) <= 0)) && ((end == null) || (end.compareTo (value) >= 0)))) {\r
-throw  new IllegalArgumentException ("(start <= value <= end) is false");\r
-}this.value = java.util.Calendar.getInstance ();\r
-this.start = start;\r
-this.end = end;\r
-this.calendarField = calendarField;\r
-this.value.setTime (value);\r
-}, "java.util.Date,Comparable,Comparable,~N");\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-this.construct ( new java.util.Date (), null, null, 5);\r
-});\r
-Clazz.defineMethod (c$, "setStart", \r
-function (start) {\r
-if ((start == null) ? (this.start != null) : !start.equals (this.start)) {\r
-this.start = start;\r
-this.fireStateChanged ();\r
-}}, "Comparable");\r
-Clazz.defineMethod (c$, "getStart", \r
-function () {\r
-return this.start;\r
-});\r
-Clazz.defineMethod (c$, "setEnd", \r
-function (end) {\r
-if ((end == null) ? (this.end != null) : !end.equals (this.end)) {\r
-this.end = end;\r
-this.fireStateChanged ();\r
-}}, "Comparable");\r
-Clazz.defineMethod (c$, "getEnd", \r
-function () {\r
-return this.end;\r
-});\r
-Clazz.defineMethod (c$, "setCalendarField", \r
-function (calendarField) {\r
-if (!this.calendarFieldOK (calendarField)) {\r
-throw  new IllegalArgumentException ("invalid calendarField");\r
-}if (calendarField != this.calendarField) {\r
-this.calendarField = calendarField;\r
-this.fireStateChanged ();\r
-}}, "~N");\r
-Clazz.defineMethod (c$, "getCalendarField", \r
-function () {\r
-return this.calendarField;\r
-});\r
-Clazz.overrideMethod (c$, "getNextValue", \r
-function () {\r
-var cal = java.util.Calendar.getInstance ();\r
-cal.setTime (this.value.getTime ());\r
-cal.add (this.calendarField, 1);\r
-var next = cal.getTime ();\r
-return ((this.end == null) || (this.end.compareTo (next) >= 0)) ? next : null;\r
-});\r
-Clazz.overrideMethod (c$, "getPreviousValue", \r
-function () {\r
-var cal = java.util.Calendar.getInstance ();\r
-cal.setTime (this.value.getTime ());\r
-cal.add (this.calendarField, -1);\r
-var prev = cal.getTime ();\r
-return ((this.start == null) || (this.start.compareTo (prev) <= 0)) ? prev : null;\r
-});\r
-Clazz.defineMethod (c$, "getDate", \r
-function () {\r
-return this.value.getTime ();\r
-});\r
-Clazz.overrideMethod (c$, "getValue", \r
-function () {\r
-return this.value.getTime ();\r
-});\r
-Clazz.overrideMethod (c$, "setValue", \r
-function (value) {\r
-if ((value == null) || !(Clazz.instanceOf (value, java.util.Date))) {\r
-throw  new IllegalArgumentException ("illegal value");\r
-}if (!value.equals (this.value.getTime ())) {\r
-this.value.setTime (value);\r
-this.fireStateChanged ();\r
-}}, "~O");\r
-});\r
+Clazz.declarePackage ("javax.swing");
+Clazz.load (["javax.swing.AbstractSpinnerModel"], "javax.swing.SpinnerDateModel", ["java.lang.IllegalArgumentException", "java.util.Calendar", "$.Date"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.start = null;
+this.end = null;
+this.value = null;
+this.calendarField = 0;
+Clazz.instantialize (this, arguments);
+}, javax.swing, "SpinnerDateModel", javax.swing.AbstractSpinnerModel);
+Clazz.defineMethod (c$, "calendarFieldOK", 
+ function (calendarField) {
+switch (calendarField) {
+case 0:
+case 1:
+case 2:
+case 3:
+case 4:
+case 5:
+case 6:
+case 7:
+case 8:
+case 9:
+case 10:
+case 11:
+case 12:
+case 13:
+case 14:
+return true;
+default:
+return false;
+}
+}, "~N");
+Clazz.makeConstructor (c$, 
+function (value, start, end, calendarField) {
+Clazz.superConstructor (this, javax.swing.SpinnerDateModel, []);
+if (value == null) {
+throw  new IllegalArgumentException ("value is null");
+}if (!this.calendarFieldOK (calendarField)) {
+throw  new IllegalArgumentException ("invalid calendarField");
+}if (!(((start == null) || (start.compareTo (value) <= 0)) && ((end == null) || (end.compareTo (value) >= 0)))) {
+throw  new IllegalArgumentException ("(start <= value <= end) is false");
+}this.value = java.util.Calendar.getInstance ();
+this.start = start;
+this.end = end;
+this.calendarField = calendarField;
+this.value.setTime (value);
+}, "java.util.Date,Comparable,Comparable,~N");
+Clazz.makeConstructor (c$, 
+function () {
+this.construct ( new java.util.Date (), null, null, 5);
+});
+Clazz.defineMethod (c$, "setStart", 
+function (start) {
+if ((start == null) ? (this.start != null) : !start.equals (this.start)) {
+this.start = start;
+this.fireStateChanged ();
+}}, "Comparable");
+Clazz.defineMethod (c$, "getStart", 
+function () {
+return this.start;
+});
+Clazz.defineMethod (c$, "setEnd", 
+function (end) {
+if ((end == null) ? (this.end != null) : !end.equals (this.end)) {
+this.end = end;
+this.fireStateChanged ();
+}}, "Comparable");
+Clazz.defineMethod (c$, "getEnd", 
+function () {
+return this.end;
+});
+Clazz.defineMethod (c$, "setCalendarField", 
+function (calendarField) {
+if (!this.calendarFieldOK (calendarField)) {
+throw  new IllegalArgumentException ("invalid calendarField");
+}if (calendarField != this.calendarField) {
+this.calendarField = calendarField;
+this.fireStateChanged ();
+}}, "~N");
+Clazz.defineMethod (c$, "getCalendarField", 
+function () {
+return this.calendarField;
+});
+Clazz.overrideMethod (c$, "getNextValue", 
+function () {
+var cal = java.util.Calendar.getInstance ();
+cal.setTime (this.value.getTime ());
+cal.add (this.calendarField, 1);
+var next = cal.getTime ();
+return ((this.end == null) || (this.end.compareTo (next) >= 0)) ? next : null;
+});
+Clazz.overrideMethod (c$, "getPreviousValue", 
+function () {
+var cal = java.util.Calendar.getInstance ();
+cal.setTime (this.value.getTime ());
+cal.add (this.calendarField, -1);
+var prev = cal.getTime ();
+return ((this.start == null) || (this.start.compareTo (prev) <= 0)) ? prev : null;
+});
+Clazz.defineMethod (c$, "getDate", 
+function () {
+return this.value.getTime ();
+});
+Clazz.overrideMethod (c$, "getValue", 
+function () {
+return this.value.getTime ();
+});
+Clazz.overrideMethod (c$, "setValue", 
+function (value) {
+if ((value == null) || !(Clazz.instanceOf (value, java.util.Date))) {
+throw  new IllegalArgumentException ("illegal value");
+}if (!value.equals (this.value.getTime ())) {
+this.value.setTime (value);
+this.fireStateChanged ();
+}}, "~O");
+});