Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / javax / swing / text / InternationalFormatter.js
index 0c94b75..e4b56ef 100644 (file)
-Clazz.declarePackage ("javax.swing.text");\r
-Clazz.load (["javax.swing.AbstractAction", "javax.swing.text.DefaultFormatter"], "javax.swing.text.InternationalFormatter", ["java.lang.StringBuffer", "java.util.ArrayList", "$.BitSet", "java.text.AttributedCharacterIterator.Attribute", "java.text.ParseException"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.format = null;\r
-this.max = null;\r
-this.min = null;\r
-this.literalMask = null;\r
-this.iterator = null;\r
-this.validMask = false;\r
-this.string = null;\r
-this.ignoreDocumentMutate = false;\r
-if (!Clazz.isClassDefined ("javax.swing.text.InternationalFormatter.IncrementAction")) {\r
-javax.swing.text.InternationalFormatter.$InternationalFormatter$IncrementAction$ ();\r
-}\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing.text, "InternationalFormatter", javax.swing.text.DefaultFormatter);\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-Clazz.superConstructor (this, javax.swing.text.InternationalFormatter, []);\r
-this.setOverwriteMode (false);\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (format) {\r
-this.construct ();\r
-this.setFormat (format);\r
-}, "java.text.Format");\r
-Clazz.defineMethod (c$, "setFormat", \r
-function (format) {\r
-this.format = format;\r
-}, "java.text.Format");\r
-Clazz.defineMethod (c$, "getFormat", \r
-function () {\r
-return this.format;\r
-});\r
-Clazz.defineMethod (c$, "setMinimum", \r
-function (minimum) {\r
-if (this.getValueClass () == null && minimum != null) {\r
-this.setValueClass (minimum.getClass ());\r
-}this.min = minimum;\r
-}, "Comparable");\r
-Clazz.defineMethod (c$, "getMinimum", \r
-function () {\r
-return this.min;\r
-});\r
-Clazz.defineMethod (c$, "setMaximum", \r
-function (max) {\r
-if (this.getValueClass () == null && max != null) {\r
-this.setValueClass (max.getClass ());\r
-}this.max = max;\r
-}, "Comparable");\r
-Clazz.defineMethod (c$, "getMaximum", \r
-function () {\r
-return this.max;\r
-});\r
-Clazz.defineMethod (c$, "install", \r
-function (ftf) {\r
-Clazz.superCall (this, javax.swing.text.InternationalFormatter, "install", [ftf]);\r
-this.updateMaskIfNecessary ();\r
-this.positionCursorAtInitialLocation ();\r
-}, "javax.swing.JFormattedTextField");\r
-Clazz.overrideMethod (c$, "valueToString", \r
-function (value) {\r
-if (value == null) {\r
-return "";\r
-}var f = this.getFormat ();\r
-if (f == null) {\r
-return value.toString ();\r
-}return f.format (value);\r
-}, "~O");\r
-Clazz.defineMethod (c$, "stringToValue", \r
-function (text) {\r
-var value = this.stringToValueParse (text, this.getFormat ());\r
-if (value != null && this.getValueClass () != null && !this.getValueClass ().isInstance (value)) {\r
-value = Clazz.superCall (this, javax.swing.text.InternationalFormatter, "stringToValue", [value.toString ()]);\r
-}try {\r
-if (!this.isValidValue (value, true)) {\r
-throw  new java.text.ParseException ("Value not within min/max range", 0);\r
-}} catch (cce) {\r
-if (Clazz.exceptionOf (cce, ClassCastException)) {\r
-throw  new java.text.ParseException ("Class cast exception comparing values: " + cce, 0);\r
-} else {\r
-throw cce;\r
-}\r
-}\r
-return value;\r
-}, "~S");\r
-Clazz.defineMethod (c$, "getFields", \r
-function (offset) {\r
-if (this.getAllowsInvalid ()) {\r
-this.updateMask ();\r
-}var attrs = this.getAttributes (offset);\r
-if (attrs != null && attrs.size () > 0) {\r
-var al =  new java.util.ArrayList ();\r
-al.addAll (attrs.keySet ());\r
-return al.toArray (javax.swing.text.InternationalFormatter.EMPTY_FIELD_ARRAY);\r
-}return javax.swing.text.InternationalFormatter.EMPTY_FIELD_ARRAY;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "clone", \r
-function () {\r
-var formatter = Clazz.superCall (this, javax.swing.text.InternationalFormatter, "clone", []);\r
-formatter.literalMask = null;\r
-formatter.iterator = null;\r
-formatter.validMask = false;\r
-formatter.string = null;\r
-return formatter;\r
-});\r
-Clazz.overrideMethod (c$, "getActions", \r
-function () {\r
-if (this.getSupportsIncrement ()) {\r
-return  Clazz.newArray (-1, [Clazz.innerTypeInstance (javax.swing.text.InternationalFormatter.IncrementAction, this, null, "increment", 1), Clazz.innerTypeInstance (javax.swing.text.InternationalFormatter.IncrementAction, this, null, "decrement", -1)]);\r
-}return null;\r
-});\r
-Clazz.defineMethod (c$, "stringToValueParse", \r
-function (text, f) {\r
-if (f == null) {\r
-return text;\r
-}return f.parseObject (text);\r
-}, "~S,java.text.Format");\r
-Clazz.defineMethod (c$, "isValidValue", \r
-function (value, wantsCCE) {\r
-var min = this.getMinimum ();\r
-try {\r
-if (min != null && min.compareTo (value) > 0) {\r
-return false;\r
-}} catch (cce) {\r
-if (Clazz.exceptionOf (cce, ClassCastException)) {\r
-if (wantsCCE) {\r
-throw cce;\r
-}return false;\r
-} else {\r
-throw cce;\r
-}\r
-}\r
-var max = this.getMaximum ();\r
-try {\r
-if (max != null && max.compareTo (value) < 0) {\r
-return false;\r
-}} catch (cce) {\r
-if (Clazz.exceptionOf (cce, ClassCastException)) {\r
-if (wantsCCE) {\r
-throw cce;\r
-}return false;\r
-} else {\r
-throw cce;\r
-}\r
-}\r
-return true;\r
-}, "~O,~B");\r
-Clazz.defineMethod (c$, "getAttributes", \r
-function (index) {\r
-if (this.isValidMask ()) {\r
-var iterator = this.getIterator ();\r
-if (index >= 0 && index <= iterator.getEndIndex ()) {\r
-iterator.setIndex (index);\r
-return iterator.getAttributes ();\r
-}}return null;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getAttributeStart", \r
-function (id) {\r
-if (this.isValidMask ()) {\r
-var iterator = this.getIterator ();\r
-iterator.first ();\r
-while (iterator.current () != '\uffff') {\r
-if (iterator.getAttribute (id) != null) {\r
-return iterator.getIndex ();\r
-}iterator.next ();\r
-}\r
-}return -1;\r
-}, "java.text.AttributedCharacterIterator.Attribute");\r
-Clazz.defineMethod (c$, "getIterator", \r
-function () {\r
-return this.iterator;\r
-});\r
-Clazz.defineMethod (c$, "updateMaskIfNecessary", \r
-function () {\r
-if (!this.getAllowsInvalid () && (this.getFormat () != null)) {\r
-if (!this.isValidMask ()) {\r
-this.updateMask ();\r
-} else {\r
-var newString = this.getFormattedTextField ().getText ();\r
-if (!newString.equals (this.string)) {\r
-this.updateMask ();\r
-}}}});\r
-Clazz.defineMethod (c$, "updateMask", \r
-function () {\r
-if (this.getFormat () != null) {\r
-var doc = this.getFormattedTextField ().getDocument ();\r
-this.validMask = false;\r
-if (doc != null) {\r
-try {\r
-this.string = doc.getText (0, doc.getLength ());\r
-} catch (ble) {\r
-if (Clazz.exceptionOf (ble, javax.swing.text.BadLocationException)) {\r
-this.string = null;\r
-} else {\r
-throw ble;\r
-}\r
-}\r
-if (this.string != null) {\r
-try {\r
-var value = this.stringToValue (this.string);\r
-var iterator = this.getFormat ().formatToCharacterIterator (value);\r
-this.updateMask (iterator);\r
-} catch (e$$) {\r
-if (Clazz.exceptionOf (e$$, java.text.ParseException)) {\r
-var pe = e$$;\r
-{\r
-}\r
-} else if (Clazz.exceptionOf (e$$, IllegalArgumentException)) {\r
-var iae = e$$;\r
-{\r
-}\r
-} else if (Clazz.exceptionOf (e$$, NullPointerException)) {\r
-var npe = e$$;\r
-{\r
-}\r
-} else {\r
-throw e$$;\r
-}\r
-}\r
-}}}});\r
-Clazz.defineMethod (c$, "getLiteralCountTo", \r
-function (index) {\r
-var lCount = 0;\r
-for (var counter = 0; counter < index; counter++) {\r
-if (this.isLiteral (counter)) {\r
-lCount++;\r
-}}\r
-return lCount;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "isLiteral", \r
-function (index) {\r
-if (this.isValidMask () && index < this.string.length) {\r
-return this.literalMask.get (index);\r
-}return false;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getLiteral", \r
-function (index) {\r
-if (this.isValidMask () && this.string != null && index < this.string.length) {\r
-return this.string.charAt (index);\r
-}return String.fromCharCode (0);\r
-}, "~N");\r
-Clazz.overrideMethod (c$, "isNavigatable", \r
-function (offset) {\r
-return !this.isLiteral (offset);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "updateValue", \r
-function (value) {\r
-Clazz.superCall (this, javax.swing.text.InternationalFormatter, "updateValue", [value]);\r
-this.updateMaskIfNecessary ();\r
-}, "~O");\r
-Clazz.defineMethod (c$, "replace", \r
-function (fb, offset, length, text, attrs) {\r
-if (this.ignoreDocumentMutate) {\r
-fb.replace (offset, length, text, attrs);\r
-return;\r
-}Clazz.superCall (this, javax.swing.text.InternationalFormatter, "replace", [fb, offset, length, text, attrs]);\r
-}, "javax.swing.text.DocumentFilter.FilterBypass,~N,~N,~S,javax.swing.text.AttributeSet");\r
-Clazz.defineMethod (c$, "getNextNonliteralIndex", \r
- function (index, direction) {\r
-var max = this.getFormattedTextField ().getDocument ().getLength ();\r
-while (index >= 0 && index < max) {\r
-if (this.isLiteral (index)) {\r
-index += direction;\r
-} else {\r
-return index;\r
-}}\r
-return (direction == -1) ? 0 : max;\r
-}, "~N,~N");\r
-Clazz.defineMethod (c$, "canReplace", \r
-function (rh) {\r
-if (!this.getAllowsInvalid ()) {\r
-var text = rh.text;\r
-var tl = (text != null) ? text.length : 0;\r
-if (tl == 0 && rh.length == 1 && this.getFormattedTextField ().getSelectionStart () != rh.offset) {\r
-rh.offset = this.getNextNonliteralIndex (rh.offset, -1);\r
-}if (this.getOverwriteMode ()) {\r
-var replace = null;\r
-for (var counter = 0, textIndex = 0, max = Math.max (tl, rh.length); counter < max; counter++) {\r
-if (this.isLiteral (rh.offset + counter)) {\r
-if (replace != null) {\r
-replace.append (this.getLiteral (rh.offset + counter));\r
-}if (textIndex < tl && text.charAt (textIndex) == this.getLiteral (rh.offset + counter)) {\r
-textIndex++;\r
-} else if (textIndex == 0) {\r
-rh.offset++;\r
-rh.length--;\r
-counter--;\r
-max--;\r
-} else if (replace == null) {\r
-replace =  new StringBuffer (max);\r
-replace.append (text.substring (0, textIndex));\r
-replace.append (this.getLiteral (rh.offset + counter));\r
-}} else if (textIndex < tl) {\r
-if (replace != null) {\r
-replace.append (text.charAt (textIndex));\r
-}textIndex++;\r
-} else {\r
-if (replace == null) {\r
-replace =  new StringBuffer (max);\r
-if (textIndex > 0) {\r
-replace.append (text.substring (0, textIndex));\r
-}}if (replace != null) {\r
-replace.append (' ');\r
-}}}\r
-if (replace != null) {\r
-rh.text = replace.toString ();\r
-}} else if (tl > 0) {\r
-rh.offset = this.getNextNonliteralIndex (rh.offset, 1);\r
-} else {\r
-rh.offset = this.getNextNonliteralIndex (rh.offset, -1);\r
-}(rh).endOffset = rh.offset;\r
-(rh).endTextLength = (rh.text != null) ? rh.text.length : 0;\r
-} else {\r
-(rh).endOffset = rh.offset;\r
-(rh).endTextLength = (rh.text != null) ? rh.text.length : 0;\r
-}var can = Clazz.superCall (this, javax.swing.text.InternationalFormatter, "canReplace", [rh]);\r
-if (can && !this.getAllowsInvalid ()) {\r
-(rh).resetFromValue (this);\r
-}return can;\r
-}, "javax.swing.text.DefaultFormatter.ReplaceHolder");\r
-Clazz.defineMethod (c$, "replace", \r
-function (rh) {\r
-var start = -1;\r
-var direction = 1;\r
-var literalCount = -1;\r
-if (rh.length > 0 && (rh.text == null || rh.text.length == 0) && (this.getFormattedTextField ().getSelectionStart () != rh.offset || rh.length > 1)) {\r
-direction = -1;\r
-}if (!this.getAllowsInvalid ()) {\r
-if ((rh.text == null || rh.text.length == 0) && rh.length > 0) {\r
-start = this.getFormattedTextField ().getSelectionStart ();\r
-} else {\r
-start = rh.offset;\r
-}literalCount = this.getLiteralCountTo (start);\r
-}if (Clazz.superCall (this, javax.swing.text.InternationalFormatter, "replace", [rh])) {\r
-if (start != -1) {\r
-var end = (rh).endOffset;\r
-end += (rh).endTextLength;\r
-this.repositionCursor (literalCount, end, direction);\r
-} else {\r
-start = (rh).endOffset;\r
-if (direction == 1) {\r
-start += (rh).endTextLength;\r
-}this.repositionCursor (start, direction);\r
-}return true;\r
-}return false;\r
-}, "javax.swing.text.DefaultFormatter.ReplaceHolder");\r
-Clazz.defineMethod (c$, "repositionCursor", \r
- function (startLiteralCount, end, direction) {\r
-var endLiteralCount = this.getLiteralCountTo (end);\r
-if (endLiteralCount != end) {\r
-end -= startLiteralCount;\r
-for (var counter = 0; counter < end; counter++) {\r
-if (this.isLiteral (counter)) {\r
-end++;\r
-}}\r
-}this.repositionCursor (end, 1);\r
-}, "~N,~N,~N");\r
-Clazz.defineMethod (c$, "getBufferedChar", \r
-function (index) {\r
-if (this.isValidMask ()) {\r
-if (this.string != null && index < this.string.length) {\r
-return this.string.charAt (index);\r
-}}return String.fromCharCode (0);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "isValidMask", \r
-function () {\r
-return this.validMask;\r
-});\r
-Clazz.defineMethod (c$, "isLiteral", \r
-function (attributes) {\r
-return ((attributes == null) || attributes.size () == 0);\r
-}, "java.util.Map");\r
-Clazz.defineMethod (c$, "updateMask", \r
- function (iterator) {\r
-if (iterator != null) {\r
-this.validMask = true;\r
-this.iterator = iterator;\r
-if (this.literalMask == null) {\r
-this.literalMask =  new java.util.BitSet ();\r
-} else {\r
-for (var counter = this.literalMask.length () - 1; counter >= 0; counter--) {\r
-this.literalMask.clear (counter);\r
-}\r
-}iterator.first ();\r
-while (iterator.current () != '\uffff') {\r
-var attributes = iterator.getAttributes ();\r
-var set = this.isLiteral (attributes);\r
-var start = iterator.getIndex ();\r
-var end = iterator.getRunLimit ();\r
-while (start < end) {\r
-if (set) {\r
-this.literalMask.set (start);\r
-} else {\r
-this.literalMask.clear (start);\r
-}start++;\r
-}\r
-iterator.setIndex (start);\r
-}\r
-}}, "java.text.AttributedCharacterIterator");\r
-Clazz.defineMethod (c$, "canIncrement", \r
-function (field, cursorPosition) {\r
-return (field != null);\r
-}, "~O,~N");\r
-Clazz.defineMethod (c$, "selectField", \r
-function (f, count) {\r
-var iterator = this.getIterator ();\r
-if (iterator != null && (Clazz.instanceOf (f, java.text.AttributedCharacterIterator.Attribute))) {\r
-var field = f;\r
-iterator.first ();\r
-while (iterator.current () != '\uffff') {\r
-while (iterator.getAttribute (field) == null && iterator.next () != '\uffff') ;\r
-if (iterator.current () != '\uffff') {\r
-var limit = iterator.getRunLimit (field);\r
-if (--count <= 0) {\r
-this.getFormattedTextField ().select (iterator.getIndex (), limit);\r
-break;\r
-}iterator.setIndex (limit);\r
-iterator.next ();\r
-}}\r
-}}, "~O,~N");\r
-Clazz.defineMethod (c$, "getAdjustField", \r
-function (start, attributes) {\r
-return null;\r
-}, "~N,java.util.Map");\r
-Clazz.defineMethod (c$, "getFieldTypeCountTo", \r
- function (f, start) {\r
-var iterator = this.getIterator ();\r
-var count = 0;\r
-if (iterator != null && (Clazz.instanceOf (f, java.text.AttributedCharacterIterator.Attribute))) {\r
-var field = f;\r
-var index = 0;\r
-iterator.first ();\r
-while (iterator.getIndex () < start) {\r
-while (iterator.getAttribute (field) == null && iterator.next () != '\uffff') ;\r
-if (iterator.current () != '\uffff') {\r
-iterator.setIndex (iterator.getRunLimit (field));\r
-iterator.next ();\r
-count++;\r
-} else {\r
-break;\r
-}}\r
-}return count;\r
-}, "~O,~N");\r
-Clazz.defineMethod (c$, "adjustValue", \r
-function (value, attributes, field, direction) {\r
-return null;\r
-}, "~O,java.util.Map,~O,~N");\r
-Clazz.defineMethod (c$, "getSupportsIncrement", \r
-function () {\r
-return false;\r
-});\r
-Clazz.defineMethod (c$, "resetValue", \r
-function (value) {\r
-var doc = this.getFormattedTextField ().getDocument ();\r
-var string = this.valueToString (value);\r
-try {\r
-this.ignoreDocumentMutate = true;\r
-doc.remove (0, doc.getLength ());\r
-doc.insertString (0, string, null);\r
-} finally {\r
-this.ignoreDocumentMutate = false;\r
-}\r
-this.updateValue (value);\r
-}, "~O");\r
-Clazz.defineMethod (c$, "getReplaceHolder", \r
-function (fb, offset, length, text, attrs) {\r
-if (this.replaceHolder == null) {\r
-this.replaceHolder =  new javax.swing.text.InternationalFormatter.ExtendedReplaceHolder ();\r
-}return Clazz.superCall (this, javax.swing.text.InternationalFormatter, "getReplaceHolder", [fb, offset, length, text, attrs]);\r
-}, "javax.swing.text.DocumentFilter.FilterBypass,~N,~N,~S,javax.swing.text.AttributeSet");\r
-c$.$InternationalFormatter$IncrementAction$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-this.direction = 0;\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing.text.InternationalFormatter, "IncrementAction", javax.swing.AbstractAction);\r
-Clazz.makeConstructor (c$, \r
-function (a, b) {\r
-Clazz.superConstructor (this, javax.swing.text.InternationalFormatter.IncrementAction, [a]);\r
-this.direction = b;\r
-}, "~S,~N");\r
-Clazz.overrideMethod (c$, "actionPerformed", \r
-function (a) {\r
-if (this.b$["javax.swing.text.InternationalFormatter"].getFormattedTextField ().isEditable ()) {\r
-if (this.b$["javax.swing.text.InternationalFormatter"].getAllowsInvalid ()) {\r
-this.b$["javax.swing.text.InternationalFormatter"].updateMask ();\r
-}var b = false;\r
-if (this.b$["javax.swing.text.InternationalFormatter"].isValidMask ()) {\r
-var c = this.b$["javax.swing.text.InternationalFormatter"].getFormattedTextField ().getSelectionStart ();\r
-if (c != -1) {\r
-var d = this.b$["javax.swing.text.InternationalFormatter"].getIterator ();\r
-d.setIndex (c);\r
-var e = d.getAttributes ();\r
-var f = this.b$["javax.swing.text.InternationalFormatter"].getAdjustField (c, e);\r
-if (this.b$["javax.swing.text.InternationalFormatter"].canIncrement (f, c)) {\r
-try {\r
-var g = this.b$["javax.swing.text.InternationalFormatter"].stringToValue (this.b$["javax.swing.text.InternationalFormatter"].getFormattedTextField ().getText ());\r
-var h = this.b$["javax.swing.text.InternationalFormatter"].getFieldTypeCountTo (f, c);\r
-g = this.b$["javax.swing.text.InternationalFormatter"].adjustValue (g, e, f, this.direction);\r
-if (g != null && this.b$["javax.swing.text.InternationalFormatter"].isValidValue (g, false)) {\r
-this.b$["javax.swing.text.InternationalFormatter"].resetValue (g);\r
-this.b$["javax.swing.text.InternationalFormatter"].updateMask ();\r
-if (this.b$["javax.swing.text.InternationalFormatter"].isValidMask ()) {\r
-this.b$["javax.swing.text.InternationalFormatter"].selectField (f, h);\r
-}b = true;\r
-}} catch (e$$) {\r
-if (Clazz.exceptionOf (e$$, java.text.ParseException)) {\r
-var pe = e$$;\r
-{\r
-}\r
-} else if (Clazz.exceptionOf (e$$, javax.swing.text.BadLocationException)) {\r
-var ble = e$$;\r
-{\r
-}\r
-} else {\r
-throw e$$;\r
-}\r
-}\r
-}}}if (!b) {\r
-this.b$["javax.swing.text.InternationalFormatter"].invalidEdit ();\r
-}}}, "java.awt.event.ActionEvent");\r
-c$ = Clazz.p0p ();\r
-};\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.endOffset = 0;\r
-this.endTextLength = 0;\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing.text.InternationalFormatter, "ExtendedReplaceHolder", javax.swing.text.DefaultFormatter.ReplaceHolder);\r
-Clazz.defineMethod (c$, "resetFromValue", \r
-function (a) {\r
-this.offset = 0;\r
-try {\r
-this.text = a.valueToString (this.value);\r
-} catch (pe) {\r
-if (Clazz.exceptionOf (pe, java.text.ParseException)) {\r
-this.text = "";\r
-} else {\r
-throw pe;\r
-}\r
-}\r
-this.length = this.fb.getDocument ().getLength ();\r
-}, "javax.swing.text.InternationalFormatter");\r
-c$ = Clazz.p0p ();\r
-c$.EMPTY_FIELD_ARRAY = c$.prototype.EMPTY_FIELD_ARRAY =  new Array (0);\r
-});\r
+Clazz.declarePackage ("javax.swing.text");
+Clazz.load (["javax.swing.AbstractAction", "javax.swing.text.DefaultFormatter"], "javax.swing.text.InternationalFormatter", ["java.lang.StringBuffer", "java.util.ArrayList", "$.BitSet", "java.text.AttributedCharacterIterator.Attribute", "java.text.ParseException"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.format = null;
+this.max = null;
+this.min = null;
+this.literalMask = null;
+this.iterator = null;
+this.validMask = false;
+this.string = null;
+this.ignoreDocumentMutate = false;
+if (!Clazz.isClassDefined ("javax.swing.text.InternationalFormatter.IncrementAction")) {
+javax.swing.text.InternationalFormatter.$InternationalFormatter$IncrementAction$ ();
+}
+Clazz.instantialize (this, arguments);
+}, javax.swing.text, "InternationalFormatter", javax.swing.text.DefaultFormatter);
+Clazz.makeConstructor (c$, 
+function () {
+Clazz.superConstructor (this, javax.swing.text.InternationalFormatter, []);
+this.setOverwriteMode (false);
+});
+Clazz.makeConstructor (c$, 
+function (format) {
+this.construct ();
+this.setFormat (format);
+}, "java.text.Format");
+Clazz.defineMethod (c$, "setFormat", 
+function (format) {
+this.format = format;
+}, "java.text.Format");
+Clazz.defineMethod (c$, "getFormat", 
+function () {
+return this.format;
+});
+Clazz.defineMethod (c$, "setMinimum", 
+function (minimum) {
+if (this.getValueClass () == null && minimum != null) {
+this.setValueClass (minimum.getClass ());
+}this.min = minimum;
+}, "Comparable");
+Clazz.defineMethod (c$, "getMinimum", 
+function () {
+return this.min;
+});
+Clazz.defineMethod (c$, "setMaximum", 
+function (max) {
+if (this.getValueClass () == null && max != null) {
+this.setValueClass (max.getClass ());
+}this.max = max;
+}, "Comparable");
+Clazz.defineMethod (c$, "getMaximum", 
+function () {
+return this.max;
+});
+Clazz.defineMethod (c$, "install", 
+function (ftf) {
+Clazz.superCall (this, javax.swing.text.InternationalFormatter, "install", [ftf]);
+this.updateMaskIfNecessary ();
+this.positionCursorAtInitialLocation ();
+}, "javax.swing.JFormattedTextField");
+Clazz.overrideMethod (c$, "valueToString", 
+function (value) {
+if (value == null) {
+return "";
+}var f = this.getFormat ();
+if (f == null) {
+return value.toString ();
+}return f.format (value);
+}, "~O");
+Clazz.defineMethod (c$, "stringToValue", 
+function (text) {
+var value = this.stringToValueParse (text, this.getFormat ());
+if (value != null && this.getValueClass () != null && !this.getValueClass ().isInstance (value)) {
+value = Clazz.superCall (this, javax.swing.text.InternationalFormatter, "stringToValue", [value.toString ()]);
+}try {
+if (!this.isValidValue (value, true)) {
+throw  new java.text.ParseException ("Value not within min/max range", 0);
+}} catch (cce) {
+if (Clazz.exceptionOf (cce, ClassCastException)) {
+throw  new java.text.ParseException ("Class cast exception comparing values: " + cce, 0);
+} else {
+throw cce;
+}
+}
+return value;
+}, "~S");
+Clazz.defineMethod (c$, "getFields", 
+function (offset) {
+if (this.getAllowsInvalid ()) {
+this.updateMask ();
+}var attrs = this.getAttributes (offset);
+if (attrs != null && attrs.size () > 0) {
+var al =  new java.util.ArrayList ();
+al.addAll (attrs.keySet ());
+return al.toArray (javax.swing.text.InternationalFormatter.EMPTY_FIELD_ARRAY);
+}return javax.swing.text.InternationalFormatter.EMPTY_FIELD_ARRAY;
+}, "~N");
+Clazz.defineMethod (c$, "clone", 
+function () {
+var formatter = Clazz.superCall (this, javax.swing.text.InternationalFormatter, "clone", []);
+formatter.literalMask = null;
+formatter.iterator = null;
+formatter.validMask = false;
+formatter.string = null;
+return formatter;
+});
+Clazz.overrideMethod (c$, "getActions", 
+function () {
+if (this.getSupportsIncrement ()) {
+return  Clazz.newArray (-1, [Clazz.innerTypeInstance (javax.swing.text.InternationalFormatter.IncrementAction, this, null, "increment", 1), Clazz.innerTypeInstance (javax.swing.text.InternationalFormatter.IncrementAction, this, null, "decrement", -1)]);
+}return null;
+});
+Clazz.defineMethod (c$, "stringToValueParse", 
+function (text, f) {
+if (f == null) {
+return text;
+}return f.parseObject (text);
+}, "~S,java.text.Format");
+Clazz.defineMethod (c$, "isValidValue", 
+function (value, wantsCCE) {
+var min = this.getMinimum ();
+try {
+if (min != null && min.compareTo (value) > 0) {
+return false;
+}} catch (cce) {
+if (Clazz.exceptionOf (cce, ClassCastException)) {
+if (wantsCCE) {
+throw cce;
+}return false;
+} else {
+throw cce;
+}
+}
+var max = this.getMaximum ();
+try {
+if (max != null && max.compareTo (value) < 0) {
+return false;
+}} catch (cce) {
+if (Clazz.exceptionOf (cce, ClassCastException)) {
+if (wantsCCE) {
+throw cce;
+}return false;
+} else {
+throw cce;
+}
+}
+return true;
+}, "~O,~B");
+Clazz.defineMethod (c$, "getAttributes", 
+function (index) {
+if (this.isValidMask ()) {
+var iterator = this.getIterator ();
+if (index >= 0 && index <= iterator.getEndIndex ()) {
+iterator.setIndex (index);
+return iterator.getAttributes ();
+}}return null;
+}, "~N");
+Clazz.defineMethod (c$, "getAttributeStart", 
+function (id) {
+if (this.isValidMask ()) {
+var iterator = this.getIterator ();
+iterator.first ();
+while (iterator.current () != '\uffff') {
+if (iterator.getAttribute (id) != null) {
+return iterator.getIndex ();
+}iterator.next ();
+}
+}return -1;
+}, "java.text.AttributedCharacterIterator.Attribute");
+Clazz.defineMethod (c$, "getIterator", 
+function () {
+return this.iterator;
+});
+Clazz.defineMethod (c$, "updateMaskIfNecessary", 
+function () {
+if (!this.getAllowsInvalid () && (this.getFormat () != null)) {
+if (!this.isValidMask ()) {
+this.updateMask ();
+} else {
+var newString = this.getFormattedTextField ().getText ();
+if (!newString.equals (this.string)) {
+this.updateMask ();
+}}}});
+Clazz.defineMethod (c$, "updateMask", 
+function () {
+if (this.getFormat () != null) {
+var doc = this.getFormattedTextField ().getDocument ();
+this.validMask = false;
+if (doc != null) {
+try {
+this.string = doc.getText (0, doc.getLength ());
+} catch (ble) {
+if (Clazz.exceptionOf (ble, javax.swing.text.BadLocationException)) {
+this.string = null;
+} else {
+throw ble;
+}
+}
+if (this.string != null) {
+try {
+var value = this.stringToValue (this.string);
+var iterator = this.getFormat ().formatToCharacterIterator (value);
+this.updateMask (iterator);
+} catch (e$$) {
+if (Clazz.exceptionOf (e$$, java.text.ParseException)) {
+var pe = e$$;
+{
+}
+} else if (Clazz.exceptionOf (e$$, IllegalArgumentException)) {
+var iae = e$$;
+{
+}
+} else if (Clazz.exceptionOf (e$$, NullPointerException)) {
+var npe = e$$;
+{
+}
+} else {
+throw e$$;
+}
+}
+}}}});
+Clazz.defineMethod (c$, "getLiteralCountTo", 
+function (index) {
+var lCount = 0;
+for (var counter = 0; counter < index; counter++) {
+if (this.isLiteral (counter)) {
+lCount++;
+}}
+return lCount;
+}, "~N");
+Clazz.defineMethod (c$, "isLiteral", 
+function (index) {
+if (this.isValidMask () && index < this.string.length) {
+return this.literalMask.get (index);
+}return false;
+}, "~N");
+Clazz.defineMethod (c$, "getLiteral", 
+function (index) {
+if (this.isValidMask () && this.string != null && index < this.string.length) {
+return this.string.charAt (index);
+}return String.fromCharCode (0);
+}, "~N");
+Clazz.overrideMethod (c$, "isNavigatable", 
+function (offset) {
+return !this.isLiteral (offset);
+}, "~N");
+Clazz.defineMethod (c$, "updateValue", 
+function (value) {
+Clazz.superCall (this, javax.swing.text.InternationalFormatter, "updateValue", [value]);
+this.updateMaskIfNecessary ();
+}, "~O");
+Clazz.defineMethod (c$, "replace", 
+function (fb, offset, length, text, attrs) {
+if (this.ignoreDocumentMutate) {
+fb.replace (offset, length, text, attrs);
+return;
+}Clazz.superCall (this, javax.swing.text.InternationalFormatter, "replace", [fb, offset, length, text, attrs]);
+}, "javax.swing.text.DocumentFilter.FilterBypass,~N,~N,~S,javax.swing.text.AttributeSet");
+Clazz.defineMethod (c$, "getNextNonliteralIndex", 
+ function (index, direction) {
+var max = this.getFormattedTextField ().getDocument ().getLength ();
+while (index >= 0 && index < max) {
+if (this.isLiteral (index)) {
+index += direction;
+} else {
+return index;
+}}
+return (direction == -1) ? 0 : max;
+}, "~N,~N");
+Clazz.defineMethod (c$, "canReplace", 
+function (rh) {
+if (!this.getAllowsInvalid ()) {
+var text = rh.text;
+var tl = (text != null) ? text.length : 0;
+if (tl == 0 && rh.length == 1 && this.getFormattedTextField ().getSelectionStart () != rh.offset) {
+rh.offset = this.getNextNonliteralIndex (rh.offset, -1);
+}if (this.getOverwriteMode ()) {
+var replace = null;
+for (var counter = 0, textIndex = 0, max = Math.max (tl, rh.length); counter < max; counter++) {
+if (this.isLiteral (rh.offset + counter)) {
+if (replace != null) {
+replace.append (this.getLiteral (rh.offset + counter));
+}if (textIndex < tl && text.charAt (textIndex) == this.getLiteral (rh.offset + counter)) {
+textIndex++;
+} else if (textIndex == 0) {
+rh.offset++;
+rh.length--;
+counter--;
+max--;
+} else if (replace == null) {
+replace =  new StringBuffer (max);
+replace.append (text.substring (0, textIndex));
+replace.append (this.getLiteral (rh.offset + counter));
+}} else if (textIndex < tl) {
+if (replace != null) {
+replace.append (text.charAt (textIndex));
+}textIndex++;
+} else {
+if (replace == null) {
+replace =  new StringBuffer (max);
+if (textIndex > 0) {
+replace.append (text.substring (0, textIndex));
+}}if (replace != null) {
+replace.append (' ');
+}}}
+if (replace != null) {
+rh.text = replace.toString ();
+}} else if (tl > 0) {
+rh.offset = this.getNextNonliteralIndex (rh.offset, 1);
+} else {
+rh.offset = this.getNextNonliteralIndex (rh.offset, -1);
+}(rh).endOffset = rh.offset;
+(rh).endTextLength = (rh.text != null) ? rh.text.length : 0;
+} else {
+(rh).endOffset = rh.offset;
+(rh).endTextLength = (rh.text != null) ? rh.text.length : 0;
+}var can = Clazz.superCall (this, javax.swing.text.InternationalFormatter, "canReplace", [rh]);
+if (can && !this.getAllowsInvalid ()) {
+(rh).resetFromValue (this);
+}return can;
+}, "javax.swing.text.DefaultFormatter.ReplaceHolder");
+Clazz.defineMethod (c$, "replace", 
+function (rh) {
+var start = -1;
+var direction = 1;
+var literalCount = -1;
+if (rh.length > 0 && (rh.text == null || rh.text.length == 0) && (this.getFormattedTextField ().getSelectionStart () != rh.offset || rh.length > 1)) {
+direction = -1;
+}if (!this.getAllowsInvalid ()) {
+if ((rh.text == null || rh.text.length == 0) && rh.length > 0) {
+start = this.getFormattedTextField ().getSelectionStart ();
+} else {
+start = rh.offset;
+}literalCount = this.getLiteralCountTo (start);
+}if (Clazz.superCall (this, javax.swing.text.InternationalFormatter, "replace", [rh])) {
+if (start != -1) {
+var end = (rh).endOffset;
+end += (rh).endTextLength;
+this.repositionCursor (literalCount, end, direction);
+} else {
+start = (rh).endOffset;
+if (direction == 1) {
+start += (rh).endTextLength;
+}this.repositionCursor (start, direction);
+}return true;
+}return false;
+}, "javax.swing.text.DefaultFormatter.ReplaceHolder");
+Clazz.defineMethod (c$, "repositionCursor", 
+ function (startLiteralCount, end, direction) {
+var endLiteralCount = this.getLiteralCountTo (end);
+if (endLiteralCount != end) {
+end -= startLiteralCount;
+for (var counter = 0; counter < end; counter++) {
+if (this.isLiteral (counter)) {
+end++;
+}}
+}this.repositionCursor (end, 1);
+}, "~N,~N,~N");
+Clazz.defineMethod (c$, "getBufferedChar", 
+function (index) {
+if (this.isValidMask ()) {
+if (this.string != null && index < this.string.length) {
+return this.string.charAt (index);
+}}return String.fromCharCode (0);
+}, "~N");
+Clazz.defineMethod (c$, "isValidMask", 
+function () {
+return this.validMask;
+});
+Clazz.defineMethod (c$, "isLiteral", 
+function (attributes) {
+return ((attributes == null) || attributes.size () == 0);
+}, "java.util.Map");
+Clazz.defineMethod (c$, "updateMask", 
+ function (iterator) {
+if (iterator != null) {
+this.validMask = true;
+this.iterator = iterator;
+if (this.literalMask == null) {
+this.literalMask =  new java.util.BitSet ();
+} else {
+for (var counter = this.literalMask.length () - 1; counter >= 0; counter--) {
+this.literalMask.clear (counter);
+}
+}iterator.first ();
+while (iterator.current () != '\uffff') {
+var attributes = iterator.getAttributes ();
+var set = this.isLiteral (attributes);
+var start = iterator.getIndex ();
+var end = iterator.getRunLimit ();
+while (start < end) {
+if (set) {
+this.literalMask.set (start);
+} else {
+this.literalMask.clear (start);
+}start++;
+}
+iterator.setIndex (start);
+}
+}}, "java.text.AttributedCharacterIterator");
+Clazz.defineMethod (c$, "canIncrement", 
+function (field, cursorPosition) {
+return (field != null);
+}, "~O,~N");
+Clazz.defineMethod (c$, "selectField", 
+function (f, count) {
+var iterator = this.getIterator ();
+if (iterator != null && (Clazz.instanceOf (f, java.text.AttributedCharacterIterator.Attribute))) {
+var field = f;
+iterator.first ();
+while (iterator.current () != '\uffff') {
+while (iterator.getAttribute (field) == null && iterator.next () != '\uffff') ;
+if (iterator.current () != '\uffff') {
+var limit = iterator.getRunLimit (field);
+if (--count <= 0) {
+this.getFormattedTextField ().select (iterator.getIndex (), limit);
+break;
+}iterator.setIndex (limit);
+iterator.next ();
+}}
+}}, "~O,~N");
+Clazz.defineMethod (c$, "getAdjustField", 
+function (start, attributes) {
+return null;
+}, "~N,java.util.Map");
+Clazz.defineMethod (c$, "getFieldTypeCountTo", 
+ function (f, start) {
+var iterator = this.getIterator ();
+var count = 0;
+if (iterator != null && (Clazz.instanceOf (f, java.text.AttributedCharacterIterator.Attribute))) {
+var field = f;
+var index = 0;
+iterator.first ();
+while (iterator.getIndex () < start) {
+while (iterator.getAttribute (field) == null && iterator.next () != '\uffff') ;
+if (iterator.current () != '\uffff') {
+iterator.setIndex (iterator.getRunLimit (field));
+iterator.next ();
+count++;
+} else {
+break;
+}}
+}return count;
+}, "~O,~N");
+Clazz.defineMethod (c$, "adjustValue", 
+function (value, attributes, field, direction) {
+return null;
+}, "~O,java.util.Map,~O,~N");
+Clazz.defineMethod (c$, "getSupportsIncrement", 
+function () {
+return false;
+});
+Clazz.defineMethod (c$, "resetValue", 
+function (value) {
+var doc = this.getFormattedTextField ().getDocument ();
+var string = this.valueToString (value);
+try {
+this.ignoreDocumentMutate = true;
+doc.remove (0, doc.getLength ());
+doc.insertString (0, string, null);
+} finally {
+this.ignoreDocumentMutate = false;
+}
+this.updateValue (value);
+}, "~O");
+Clazz.defineMethod (c$, "getReplaceHolder", 
+function (fb, offset, length, text, attrs) {
+if (this.replaceHolder == null) {
+this.replaceHolder =  new javax.swing.text.InternationalFormatter.ExtendedReplaceHolder ();
+}return Clazz.superCall (this, javax.swing.text.InternationalFormatter, "getReplaceHolder", [fb, offset, length, text, attrs]);
+}, "javax.swing.text.DocumentFilter.FilterBypass,~N,~N,~S,javax.swing.text.AttributeSet");
+c$.$InternationalFormatter$IncrementAction$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+this.direction = 0;
+Clazz.instantialize (this, arguments);
+}, javax.swing.text.InternationalFormatter, "IncrementAction", javax.swing.AbstractAction);
+Clazz.makeConstructor (c$, 
+function (a, b) {
+Clazz.superConstructor (this, javax.swing.text.InternationalFormatter.IncrementAction, [a]);
+this.direction = b;
+}, "~S,~N");
+Clazz.overrideMethod (c$, "actionPerformed", 
+function (a) {
+if (this.b$["javax.swing.text.InternationalFormatter"].getFormattedTextField ().isEditable ()) {
+if (this.b$["javax.swing.text.InternationalFormatter"].getAllowsInvalid ()) {
+this.b$["javax.swing.text.InternationalFormatter"].updateMask ();
+}var b = false;
+if (this.b$["javax.swing.text.InternationalFormatter"].isValidMask ()) {
+var c = this.b$["javax.swing.text.InternationalFormatter"].getFormattedTextField ().getSelectionStart ();
+if (c != -1) {
+var d = this.b$["javax.swing.text.InternationalFormatter"].getIterator ();
+d.setIndex (c);
+var e = d.getAttributes ();
+var f = this.b$["javax.swing.text.InternationalFormatter"].getAdjustField (c, e);
+if (this.b$["javax.swing.text.InternationalFormatter"].canIncrement (f, c)) {
+try {
+var g = this.b$["javax.swing.text.InternationalFormatter"].stringToValue (this.b$["javax.swing.text.InternationalFormatter"].getFormattedTextField ().getText ());
+var h = this.b$["javax.swing.text.InternationalFormatter"].getFieldTypeCountTo (f, c);
+g = this.b$["javax.swing.text.InternationalFormatter"].adjustValue (g, e, f, this.direction);
+if (g != null && this.b$["javax.swing.text.InternationalFormatter"].isValidValue (g, false)) {
+this.b$["javax.swing.text.InternationalFormatter"].resetValue (g);
+this.b$["javax.swing.text.InternationalFormatter"].updateMask ();
+if (this.b$["javax.swing.text.InternationalFormatter"].isValidMask ()) {
+this.b$["javax.swing.text.InternationalFormatter"].selectField (f, h);
+}b = true;
+}} catch (e$$) {
+if (Clazz.exceptionOf (e$$, java.text.ParseException)) {
+var pe = e$$;
+{
+}
+} else if (Clazz.exceptionOf (e$$, javax.swing.text.BadLocationException)) {
+var ble = e$$;
+{
+}
+} else {
+throw e$$;
+}
+}
+}}}if (!b) {
+this.b$["javax.swing.text.InternationalFormatter"].invalidEdit ();
+}}}, "java.awt.event.ActionEvent");
+c$ = Clazz.p0p ();
+};
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+this.endOffset = 0;
+this.endTextLength = 0;
+Clazz.instantialize (this, arguments);
+}, javax.swing.text.InternationalFormatter, "ExtendedReplaceHolder", javax.swing.text.DefaultFormatter.ReplaceHolder);
+Clazz.defineMethod (c$, "resetFromValue", 
+function (a) {
+this.offset = 0;
+try {
+this.text = a.valueToString (this.value);
+} catch (pe) {
+if (Clazz.exceptionOf (pe, java.text.ParseException)) {
+this.text = "";
+} else {
+throw pe;
+}
+}
+this.length = this.fb.getDocument ().getLength ();
+}, "javax.swing.text.InternationalFormatter");
+c$ = Clazz.p0p ();
+c$.EMPTY_FIELD_ARRAY = c$.prototype.EMPTY_FIELD_ARRAY =  new Array (0);
+});