Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / swingjs / j2s / javax / swing / JFormattedTextField.js
index ba378dd..7c83965 100644 (file)
-Clazz.declarePackage ("javax.swing");\r
-Clazz.load (["javax.swing.JTextField", "javax.swing.event.DocumentListener", "javax.swing.text.TextAction"], "javax.swing.JFormattedTextField", ["java.lang.Boolean", "$.IllegalArgumentException", "$.Number", "java.util.Date", "java.text.DateFormat", "$.DecimalFormat", "$.Format", "$.NumberFormat", "javax.swing.ActionMap", "javax.swing.plaf.UIResource", "javax.swing.text.DateFormatter", "$.DefaultFormatter", "$.DefaultFormatterFactory", "$.DocumentFilter", "$.InternationalFormatter", "$.JSMinimalAbstractDocument", "$.NumberFormatter", "swingjs.JSToolkit"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.factory = null;\r
-this.format = null;\r
-this.value = null;\r
-this.editValid = false;\r
-this.focusLostBehavior = 0;\r
-this.edited = false;\r
-this.documentListener = null;\r
-this.textFormatterActionMap = null;\r
-this.focusLostHandler = null;\r
-if (!Clazz.isClassDefined ("javax.swing.JFormattedTextField.FocusLostHandler")) {\r
-javax.swing.JFormattedTextField.$JFormattedTextField$FocusLostHandler$ ();\r
-}\r
-if (!Clazz.isClassDefined ("javax.swing.JFormattedTextField.DocumentHandler")) {\r
-javax.swing.JFormattedTextField.$JFormattedTextField$DocumentHandler$ ();\r
-}\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing, "JFormattedTextField", javax.swing.JTextField);\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-Clazz.superConstructor (this, javax.swing.JFormattedTextField);\r
-this.enableEvents (4);\r
-this.setFocusLostBehavior (1);\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (value) {\r
-this.construct ();\r
-this.setValue (value);\r
-}, "~O");\r
-Clazz.makeConstructor (c$, \r
-function (format) {\r
-this.construct ();\r
-this.setFormatterFactory (this.getDefaultFormatterFactory (format));\r
-}, "java.text.Format");\r
-Clazz.makeConstructor (c$, \r
-function (formatter) {\r
-this.construct ( new javax.swing.text.DefaultFormatterFactory (formatter));\r
-}, "javax.swing.JFormattedTextField.AbstractFormatter");\r
-Clazz.makeConstructor (c$, \r
-function (factory) {\r
-this.construct ();\r
-this.setFormatterFactory (factory);\r
-}, "javax.swing.JFormattedTextField.AbstractFormatterFactory");\r
-Clazz.makeConstructor (c$, \r
-function (factory, currentValue) {\r
-this.construct (currentValue);\r
-this.setFormatterFactory (factory);\r
-}, "javax.swing.JFormattedTextField.AbstractFormatterFactory,~O");\r
-Clazz.defineMethod (c$, "setFocusLostBehavior", \r
-function (behavior) {\r
-if (behavior != 0 && behavior != 1 && behavior != 3 && behavior != 2) {\r
-throw  new IllegalArgumentException ("setFocusLostBehavior must be one of: JFormattedTextField.COMMIT, JFormattedTextField.COMMIT_OR_REVERT, JFormattedTextField.PERSIST or JFormattedTextField.REVERT");\r
-}this.focusLostBehavior = behavior;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getFocusLostBehavior", \r
-function () {\r
-return this.focusLostBehavior;\r
-});\r
-Clazz.defineMethod (c$, "setFormatterFactory", \r
-function (tf) {\r
-var oldFactory = this.factory = tf;\r
-this.firePropertyChangeObject ("formatterFactory", oldFactory, tf);\r
-this.setValue (this.getValue (), true, false);\r
-}, "javax.swing.JFormattedTextField.AbstractFormatterFactory");\r
-Clazz.defineMethod (c$, "getFormatterFactory", \r
-function () {\r
-return this.factory;\r
-});\r
-Clazz.defineMethod (c$, "setFormatter", \r
-function (format) {\r
-var oldFormat = this.format;\r
-if (oldFormat != null) {\r
-oldFormat.uninstall ();\r
-}this.setEditValid (true);\r
-this.format = format;\r
-if (format != null) {\r
-format.install (this);\r
-}this.setEdited (false);\r
-this.firePropertyChangeObject ("textFormatter", oldFormat, format);\r
-}, "javax.swing.JFormattedTextField.AbstractFormatter");\r
-Clazz.defineMethod (c$, "getFormatter", \r
-function () {\r
-return this.format;\r
-});\r
-Clazz.defineMethod (c$, "setValue", \r
-function (value) {\r
-if (value != null && this.getFormatterFactory () == null) {\r
-this.setFormatterFactory (this.getDefaultFormatterFactory (value));\r
-}this.setValue (value, true, true);\r
-}, "~O");\r
-Clazz.defineMethod (c$, "getValue", \r
-function () {\r
-return this.value;\r
-});\r
-Clazz.defineMethod (c$, "commitEdit", \r
-function () {\r
-var format = this.getFormatter ();\r
-if (format != null) {\r
-this.setValue (format.stringToValue (this.getText ()), false, true);\r
-}});\r
-Clazz.defineMethod (c$, "setEditValid", \r
- function (isValid) {\r
-if (isValid != this.editValid) {\r
-this.editValid = isValid;\r
-this.firePropertyChangeObject ("editValid", Boolean.$valueOf (!isValid), Boolean.$valueOf (isValid));\r
-}}, "~B");\r
-Clazz.defineMethod (c$, "isEditValid", \r
-function () {\r
-return this.editValid;\r
-});\r
-Clazz.defineMethod (c$, "invalidEdit", \r
-function () {\r
-});\r
-Clazz.defineMethod (c$, "processFocusEvent", \r
-function (e) {\r
-Clazz.superCall (this, javax.swing.JFormattedTextField, "processFocusEvent", [e]);\r
-if (e.isTemporary ()) {\r
-return;\r
-}if (this.isEdited () && e.getID () == 1005) {\r
-if (this.focusLostHandler == null) {\r
-this.focusLostHandler = Clazz.innerTypeInstance (javax.swing.JFormattedTextField.FocusLostHandler, this, null);\r
-}this.focusLostHandler.run ();\r
-} else if (!this.isEdited ()) {\r
-this.setValue (this.getValue (), true, true);\r
-}}, "java.awt.event.FocusEvent");\r
-Clazz.defineMethod (c$, "getActions", \r
-function () {\r
-return javax.swing.text.TextAction.augmentList (Clazz.superCall (this, javax.swing.JFormattedTextField, "getActions", []), javax.swing.JFormattedTextField.$defaultActions);\r
-});\r
-Clazz.overrideMethod (c$, "getUIClassID", \r
-function () {\r
-return "FormattedTextFieldUI";\r
-});\r
-Clazz.defineMethod (c$, "setDocument", \r
-function (doc) {\r
-if (this.documentListener != null && this.getDocument () != null) {\r
-this.getDocument ().removeDocumentListener (this.documentListener);\r
-}Clazz.superCall (this, javax.swing.JFormattedTextField, "setDocument", [doc]);\r
-if (this.documentListener == null) {\r
-this.documentListener = Clazz.innerTypeInstance (javax.swing.JFormattedTextField.DocumentHandler, this, null);\r
-}doc.addDocumentListener (this.documentListener);\r
-}, "javax.swing.text.Document");\r
-Clazz.defineMethod (c$, "setFormatterActions", \r
- function (actions) {\r
-if (actions == null) {\r
-if (this.textFormatterActionMap != null) {\r
-this.textFormatterActionMap.clear ();\r
-}} else {\r
-if (this.textFormatterActionMap == null) {\r
-var map = this.getActionMap ();\r
-this.textFormatterActionMap =  new javax.swing.ActionMap ();\r
-while (map != null) {\r
-var parent = map.getParent ();\r
-if (Clazz.instanceOf (parent, javax.swing.plaf.UIResource) || parent == null) {\r
-map.setParent (this.textFormatterActionMap);\r
-this.textFormatterActionMap.setParent (parent);\r
-break;\r
-}map = parent;\r
-}\r
-}for (var counter = actions.length - 1; counter >= 0; counter--) {\r
-var key = actions[counter].getValue ("Name");\r
-if (key != null) {\r
-this.textFormatterActionMap.put (key, actions[counter]);\r
-}}\r
-}}, "~A");\r
-Clazz.defineMethod (c$, "setValue", \r
- function (value, createFormat, firePC) {\r
-var oldValue = this.value;\r
-this.value = value;\r
-if (createFormat) {\r
-var factory = this.getFormatterFactory ();\r
-var atf;\r
-if (factory != null) {\r
-atf = factory.getFormatter (this);\r
-} else {\r
-atf = null;\r
-}this.setFormatter (atf);\r
-} else {\r
-this.setEditValid (true);\r
-}this.setEdited (false);\r
-if (firePC) {\r
-this.firePropertyChangeObject ("value", oldValue, value);\r
-}}, "~O,~B,~B");\r
-Clazz.defineMethod (c$, "setEdited", \r
- function (edited) {\r
-this.edited = edited;\r
-}, "~B");\r
-Clazz.defineMethod (c$, "isEdited", \r
- function () {\r
-return this.edited;\r
-});\r
-Clazz.defineMethod (c$, "getDefaultFormatterFactory", \r
- function (type) {\r
-if (Clazz.instanceOf (type, java.text.DateFormat)) {\r
-swingjs.JSToolkit.notImplemented (null);\r
-return null;\r
-}if (Clazz.instanceOf (type, java.text.NumberFormat)) {\r
-return  new javax.swing.text.DefaultFormatterFactory ( new javax.swing.text.NumberFormatter (type));\r
-}if (Clazz.instanceOf (type, java.text.Format)) {\r
-return  new javax.swing.text.DefaultFormatterFactory ( new javax.swing.text.InternationalFormatter (type));\r
-}if (Clazz.instanceOf (type, java.util.Date)) {\r
-return  new javax.swing.text.DefaultFormatterFactory ( new javax.swing.text.DateFormatter ());\r
-}if (Clazz.instanceOf (type, Number)) {\r
-var displayFormatter =  new javax.swing.text.NumberFormatter ();\r
-(displayFormatter).setValueClass (type.getClass ());\r
-var editFormatter =  new javax.swing.text.NumberFormatter ( new java.text.DecimalFormat ("#.#"));\r
-(editFormatter).setValueClass (type.getClass ());\r
-return  new javax.swing.text.DefaultFormatterFactory (displayFormatter, displayFormatter, editFormatter);\r
-}return  new javax.swing.text.DefaultFormatterFactory ( new javax.swing.text.DefaultFormatter ());\r
-}, "~O");\r
-c$.$JFormattedTextField$FocusLostHandler$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing.JFormattedTextField, "FocusLostHandler", null, Runnable);\r
-Clazz.overrideMethod (c$, "run", \r
-function () {\r
-var a = this.b$["javax.swing.JFormattedTextField"].getFocusLostBehavior ();\r
-if (a == 0 || a == 1) {\r
-try {\r
-this.b$["javax.swing.JFormattedTextField"].commitEdit ();\r
-this.b$["javax.swing.JFormattedTextField"].setValue (this.b$["javax.swing.JFormattedTextField"].getValue (), true, true);\r
-} catch (pe) {\r
-if (Clazz.exceptionOf (pe, java.text.ParseException)) {\r
-if (a == 1) {\r
-this.b$["javax.swing.JFormattedTextField"].setValue (this.b$["javax.swing.JFormattedTextField"].getValue (), true, true);\r
-}} else {\r
-throw pe;\r
-}\r
-}\r
-} else if (a == 2) {\r
-this.b$["javax.swing.JFormattedTextField"].setValue (this.b$["javax.swing.JFormattedTextField"].getValue (), true, true);\r
-}});\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$JFormattedTextField$DocumentHandler$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing.JFormattedTextField, "DocumentHandler", null, javax.swing.event.DocumentListener);\r
-Clazz.overrideMethod (c$, "insertUpdate", \r
-function (a) {\r
-this.b$["javax.swing.JFormattedTextField"].setEdited (true);\r
-}, "javax.swing.event.DocumentEvent");\r
-Clazz.overrideMethod (c$, "removeUpdate", \r
-function (a) {\r
-this.b$["javax.swing.JFormattedTextField"].setEdited (true);\r
-}, "javax.swing.event.DocumentEvent");\r
-Clazz.overrideMethod (c$, "changedUpdate", \r
-function (a) {\r
-}, "javax.swing.event.DocumentEvent");\r
-c$ = Clazz.p0p ();\r
-};\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareType (javax.swing.JFormattedTextField, "AbstractFormatterFactory");\r
-c$ = Clazz.p0p ();\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.ftf = null;\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing.JFormattedTextField, "AbstractFormatter");\r
-Clazz.defineMethod (c$, "install", \r
-function (a) {\r
-if (this.ftf != null) {\r
-this.uninstall ();\r
-}this.ftf = a;\r
-if (a != null) {\r
-try {\r
-a.setText (this.valueToString (a.getValue ()));\r
-} catch (pe) {\r
-if (Clazz.exceptionOf (pe, java.text.ParseException)) {\r
-a.setText ("");\r
-this.setEditValid (false);\r
-} else {\r
-throw pe;\r
-}\r
-}\r
-this.installDocumentFilter (this.getDocumentFilter ());\r
-a.setFormatterActions (this.getActions ());\r
-}}, "javax.swing.JFormattedTextField");\r
-Clazz.defineMethod (c$, "uninstall", \r
-function () {\r
-if (this.ftf != null) {\r
-this.installDocumentFilter (null);\r
-this.ftf.setFormatterActions (null);\r
-}});\r
-Clazz.defineMethod (c$, "getFormattedTextField", \r
-function () {\r
-return this.ftf;\r
-});\r
-Clazz.defineMethod (c$, "invalidEdit", \r
-function () {\r
-var a = this.getFormattedTextField ();\r
-if (a != null) {\r
-a.invalidEdit ();\r
-}});\r
-Clazz.defineMethod (c$, "setEditValid", \r
-function (a) {\r
-var b = this.getFormattedTextField ();\r
-if (b != null) {\r
-b.setEditValid (a);\r
-}}, "~B");\r
-Clazz.defineMethod (c$, "getActions", \r
-function () {\r
-return null;\r
-});\r
-Clazz.defineMethod (c$, "getDocumentFilter", \r
-function () {\r
-return null;\r
-});\r
-Clazz.defineMethod (c$, "getNavigationFilter", \r
-function () {\r
-return null;\r
-});\r
-Clazz.defineMethod (c$, "clone", \r
-function () {\r
-var a = Clazz.superCall (this, javax.swing.JFormattedTextField.AbstractFormatter, "clone", []);\r
-a.ftf = null;\r
-return a;\r
-});\r
-Clazz.defineMethod (c$, "installDocumentFilter", \r
- function (a) {\r
-var b = this.getFormattedTextField ();\r
-if (b != null) {\r
-var c = b.getDocument ();\r
-if (Clazz.instanceOf (c, javax.swing.text.JSMinimalAbstractDocument)) {\r
-(c).setDocumentFilter (a);\r
-}c.putProperty (javax.swing.text.DocumentFilter, null);\r
-}}, "javax.swing.text.DocumentFilter");\r
-c$ = Clazz.p0p ();\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareType (javax.swing.JFormattedTextField, "CommitAction", javax.swing.JTextField.NotifyAction);\r
-Clazz.defineMethod (c$, "actionPerformed", \r
-function (a) {\r
-var b = this.getFocusedComponent ();\r
-if (Clazz.instanceOf (b, javax.swing.JFormattedTextField)) {\r
-try {\r
-(b).commitEdit ();\r
-} catch (pe) {\r
-if (Clazz.exceptionOf (pe, java.text.ParseException)) {\r
-(b).invalidEdit ();\r
-return;\r
-} else {\r
-throw pe;\r
-}\r
-}\r
-}Clazz.superCall (this, javax.swing.JFormattedTextField.CommitAction, "actionPerformed", [a]);\r
-}, "java.awt.event.ActionEvent");\r
-Clazz.defineMethod (c$, "isEnabled", \r
-function () {\r
-var a = this.getFocusedComponent ();\r
-if (Clazz.instanceOf (a, javax.swing.JFormattedTextField)) {\r
-var b = a;\r
-if (!b.isEdited ()) {\r
-return false;\r
-}return true;\r
-}return Clazz.superCall (this, javax.swing.JFormattedTextField.CommitAction, "isEnabled", []);\r
-});\r
-c$ = Clazz.p0p ();\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.declareType (javax.swing.JFormattedTextField, "CancelAction", javax.swing.text.TextAction);\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-Clazz.superConstructor (this, javax.swing.JFormattedTextField.CancelAction, ["reset-field-edit"]);\r
-});\r
-Clazz.overrideMethod (c$, "actionPerformed", \r
-function (a) {\r
-var b = this.getFocusedComponent ();\r
-if (Clazz.instanceOf (b, javax.swing.JFormattedTextField)) {\r
-var c = b;\r
-c.setValue (c.getValue ());\r
-}}, "java.awt.event.ActionEvent");\r
-Clazz.defineMethod (c$, "isEnabled", \r
-function () {\r
-var a = this.getFocusedComponent ();\r
-if (Clazz.instanceOf (a, javax.swing.JFormattedTextField)) {\r
-var b = a;\r
-if (!b.isEdited ()) {\r
-return false;\r
-}return true;\r
-}return Clazz.superCall (this, javax.swing.JFormattedTextField.CancelAction, "isEnabled", []);\r
-});\r
-c$ = Clazz.p0p ();\r
-Clazz.defineStatics (c$,\r
-"$$uiClassID", "FormattedTextFieldUI");\r
-c$.$defaultActions = c$.prototype.$defaultActions =  Clazz.newArray (-1, [ new javax.swing.JFormattedTextField.CommitAction (),  new javax.swing.JFormattedTextField.CancelAction ()]);\r
-Clazz.defineStatics (c$,\r
-"COMMIT", 0,\r
-"COMMIT_OR_REVERT", 1,\r
-"REVERT", 2,\r
-"PERSIST", 3);\r
-});\r
+Clazz.declarePackage ("javax.swing");
+Clazz.load (["javax.swing.JTextField", "javax.swing.event.DocumentListener", "javax.swing.text.TextAction"], "javax.swing.JFormattedTextField", ["java.lang.Boolean", "$.IllegalArgumentException", "$.Number", "java.util.Date", "java.text.DateFormat", "$.DecimalFormat", "$.Format", "$.NumberFormat", "javax.swing.ActionMap", "javax.swing.plaf.UIResource", "javax.swing.text.DateFormatter", "$.DefaultFormatter", "$.DefaultFormatterFactory", "$.DocumentFilter", "$.InternationalFormatter", "$.JSMinimalAbstractDocument", "$.NumberFormatter", "swingjs.JSToolkit"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.factory = null;
+this.format = null;
+this.value = null;
+this.editValid = false;
+this.focusLostBehavior = 0;
+this.edited = false;
+this.documentListener = null;
+this.textFormatterActionMap = null;
+this.focusLostHandler = null;
+if (!Clazz.isClassDefined ("javax.swing.JFormattedTextField.FocusLostHandler")) {
+javax.swing.JFormattedTextField.$JFormattedTextField$FocusLostHandler$ ();
+}
+if (!Clazz.isClassDefined ("javax.swing.JFormattedTextField.DocumentHandler")) {
+javax.swing.JFormattedTextField.$JFormattedTextField$DocumentHandler$ ();
+}
+Clazz.instantialize (this, arguments);
+}, javax.swing, "JFormattedTextField", javax.swing.JTextField);
+Clazz.makeConstructor (c$, 
+function () {
+Clazz.superConstructor (this, javax.swing.JFormattedTextField);
+this.enableEvents (4);
+this.setFocusLostBehavior (1);
+});
+Clazz.makeConstructor (c$, 
+function (value) {
+this.construct ();
+this.setValue (value);
+}, "~O");
+Clazz.makeConstructor (c$, 
+function (format) {
+this.construct ();
+this.setFormatterFactory (this.getDefaultFormatterFactory (format));
+}, "java.text.Format");
+Clazz.makeConstructor (c$, 
+function (formatter) {
+this.construct ( new javax.swing.text.DefaultFormatterFactory (formatter));
+}, "javax.swing.JFormattedTextField.AbstractFormatter");
+Clazz.makeConstructor (c$, 
+function (factory) {
+this.construct ();
+this.setFormatterFactory (factory);
+}, "javax.swing.JFormattedTextField.AbstractFormatterFactory");
+Clazz.makeConstructor (c$, 
+function (factory, currentValue) {
+this.construct (currentValue);
+this.setFormatterFactory (factory);
+}, "javax.swing.JFormattedTextField.AbstractFormatterFactory,~O");
+Clazz.defineMethod (c$, "setFocusLostBehavior", 
+function (behavior) {
+if (behavior != 0 && behavior != 1 && behavior != 3 && behavior != 2) {
+throw  new IllegalArgumentException ("setFocusLostBehavior must be one of: JFormattedTextField.COMMIT, JFormattedTextField.COMMIT_OR_REVERT, JFormattedTextField.PERSIST or JFormattedTextField.REVERT");
+}this.focusLostBehavior = behavior;
+}, "~N");
+Clazz.defineMethod (c$, "getFocusLostBehavior", 
+function () {
+return this.focusLostBehavior;
+});
+Clazz.defineMethod (c$, "setFormatterFactory", 
+function (tf) {
+var oldFactory = this.factory = tf;
+this.firePropertyChangeObject ("formatterFactory", oldFactory, tf);
+this.setValue (this.getValue (), true, false);
+}, "javax.swing.JFormattedTextField.AbstractFormatterFactory");
+Clazz.defineMethod (c$, "getFormatterFactory", 
+function () {
+return this.factory;
+});
+Clazz.defineMethod (c$, "setFormatter", 
+function (format) {
+var oldFormat = this.format;
+if (oldFormat != null) {
+oldFormat.uninstall ();
+}this.setEditValid (true);
+this.format = format;
+if (format != null) {
+format.install (this);
+}this.setEdited (false);
+this.firePropertyChangeObject ("textFormatter", oldFormat, format);
+}, "javax.swing.JFormattedTextField.AbstractFormatter");
+Clazz.defineMethod (c$, "getFormatter", 
+function () {
+return this.format;
+});
+Clazz.defineMethod (c$, "setValue", 
+function (value) {
+if (value != null && this.getFormatterFactory () == null) {
+this.setFormatterFactory (this.getDefaultFormatterFactory (value));
+}this.setValue (value, true, true);
+}, "~O");
+Clazz.defineMethod (c$, "getValue", 
+function () {
+return this.value;
+});
+Clazz.defineMethod (c$, "commitEdit", 
+function () {
+var format = this.getFormatter ();
+if (format != null) {
+this.setValue (format.stringToValue (this.getText ()), false, true);
+}});
+Clazz.defineMethod (c$, "setEditValid", 
+ function (isValid) {
+if (isValid != this.editValid) {
+this.editValid = isValid;
+this.firePropertyChangeObject ("editValid", Boolean.$valueOf (!isValid), Boolean.$valueOf (isValid));
+}}, "~B");
+Clazz.defineMethod (c$, "isEditValid", 
+function () {
+return this.editValid;
+});
+Clazz.defineMethod (c$, "invalidEdit", 
+function () {
+});
+Clazz.defineMethod (c$, "processFocusEvent", 
+function (e) {
+Clazz.superCall (this, javax.swing.JFormattedTextField, "processFocusEvent", [e]);
+if (e.isTemporary ()) {
+return;
+}if (this.isEdited () && e.getID () == 1005) {
+if (this.focusLostHandler == null) {
+this.focusLostHandler = Clazz.innerTypeInstance (javax.swing.JFormattedTextField.FocusLostHandler, this, null);
+}this.focusLostHandler.run ();
+} else if (!this.isEdited ()) {
+this.setValue (this.getValue (), true, true);
+}}, "java.awt.event.FocusEvent");
+Clazz.defineMethod (c$, "getActions", 
+function () {
+return javax.swing.text.TextAction.augmentList (Clazz.superCall (this, javax.swing.JFormattedTextField, "getActions", []), javax.swing.JFormattedTextField.$defaultActions);
+});
+Clazz.overrideMethod (c$, "getUIClassID", 
+function () {
+return "FormattedTextFieldUI";
+});
+Clazz.defineMethod (c$, "setDocument", 
+function (doc) {
+if (this.documentListener != null && this.getDocument () != null) {
+this.getDocument ().removeDocumentListener (this.documentListener);
+}Clazz.superCall (this, javax.swing.JFormattedTextField, "setDocument", [doc]);
+if (this.documentListener == null) {
+this.documentListener = Clazz.innerTypeInstance (javax.swing.JFormattedTextField.DocumentHandler, this, null);
+}doc.addDocumentListener (this.documentListener);
+}, "javax.swing.text.Document");
+Clazz.defineMethod (c$, "setFormatterActions", 
+ function (actions) {
+if (actions == null) {
+if (this.textFormatterActionMap != null) {
+this.textFormatterActionMap.clear ();
+}} else {
+if (this.textFormatterActionMap == null) {
+var map = this.getActionMap ();
+this.textFormatterActionMap =  new javax.swing.ActionMap ();
+while (map != null) {
+var parent = map.getParent ();
+if (Clazz.instanceOf (parent, javax.swing.plaf.UIResource) || parent == null) {
+map.setParent (this.textFormatterActionMap);
+this.textFormatterActionMap.setParent (parent);
+break;
+}map = parent;
+}
+}for (var counter = actions.length - 1; counter >= 0; counter--) {
+var key = actions[counter].getValue ("Name");
+if (key != null) {
+this.textFormatterActionMap.put (key, actions[counter]);
+}}
+}}, "~A");
+Clazz.defineMethod (c$, "setValue", 
+ function (value, createFormat, firePC) {
+var oldValue = this.value;
+this.value = value;
+if (createFormat) {
+var factory = this.getFormatterFactory ();
+var atf;
+if (factory != null) {
+atf = factory.getFormatter (this);
+} else {
+atf = null;
+}this.setFormatter (atf);
+} else {
+this.setEditValid (true);
+}this.setEdited (false);
+if (firePC) {
+this.firePropertyChangeObject ("value", oldValue, value);
+}}, "~O,~B,~B");
+Clazz.defineMethod (c$, "setEdited", 
+ function (edited) {
+this.edited = edited;
+}, "~B");
+Clazz.defineMethod (c$, "isEdited", 
+ function () {
+return this.edited;
+});
+Clazz.defineMethod (c$, "getDefaultFormatterFactory", 
+ function (type) {
+if (Clazz.instanceOf (type, java.text.DateFormat)) {
+swingjs.JSToolkit.notImplemented (null);
+return null;
+}if (Clazz.instanceOf (type, java.text.NumberFormat)) {
+return  new javax.swing.text.DefaultFormatterFactory ( new javax.swing.text.NumberFormatter (type));
+}if (Clazz.instanceOf (type, java.text.Format)) {
+return  new javax.swing.text.DefaultFormatterFactory ( new javax.swing.text.InternationalFormatter (type));
+}if (Clazz.instanceOf (type, java.util.Date)) {
+return  new javax.swing.text.DefaultFormatterFactory ( new javax.swing.text.DateFormatter ());
+}if (Clazz.instanceOf (type, Number)) {
+var displayFormatter =  new javax.swing.text.NumberFormatter ();
+(displayFormatter).setValueClass (type.getClass ());
+var editFormatter =  new javax.swing.text.NumberFormatter ( new java.text.DecimalFormat ("#.#"));
+(editFormatter).setValueClass (type.getClass ());
+return  new javax.swing.text.DefaultFormatterFactory (displayFormatter, displayFormatter, editFormatter);
+}return  new javax.swing.text.DefaultFormatterFactory ( new javax.swing.text.DefaultFormatter ());
+}, "~O");
+c$.$JFormattedTextField$FocusLostHandler$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+Clazz.instantialize (this, arguments);
+}, javax.swing.JFormattedTextField, "FocusLostHandler", null, Runnable);
+Clazz.overrideMethod (c$, "run", 
+function () {
+var a = this.b$["javax.swing.JFormattedTextField"].getFocusLostBehavior ();
+if (a == 0 || a == 1) {
+try {
+this.b$["javax.swing.JFormattedTextField"].commitEdit ();
+this.b$["javax.swing.JFormattedTextField"].setValue (this.b$["javax.swing.JFormattedTextField"].getValue (), true, true);
+} catch (pe) {
+if (Clazz.exceptionOf (pe, java.text.ParseException)) {
+if (a == 1) {
+this.b$["javax.swing.JFormattedTextField"].setValue (this.b$["javax.swing.JFormattedTextField"].getValue (), true, true);
+}} else {
+throw pe;
+}
+}
+} else if (a == 2) {
+this.b$["javax.swing.JFormattedTextField"].setValue (this.b$["javax.swing.JFormattedTextField"].getValue (), true, true);
+}});
+c$ = Clazz.p0p ();
+};
+c$.$JFormattedTextField$DocumentHandler$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+Clazz.instantialize (this, arguments);
+}, javax.swing.JFormattedTextField, "DocumentHandler", null, javax.swing.event.DocumentListener);
+Clazz.overrideMethod (c$, "insertUpdate", 
+function (a) {
+this.b$["javax.swing.JFormattedTextField"].setEdited (true);
+}, "javax.swing.event.DocumentEvent");
+Clazz.overrideMethod (c$, "removeUpdate", 
+function (a) {
+this.b$["javax.swing.JFormattedTextField"].setEdited (true);
+}, "javax.swing.event.DocumentEvent");
+Clazz.overrideMethod (c$, "changedUpdate", 
+function (a) {
+}, "javax.swing.event.DocumentEvent");
+c$ = Clazz.p0p ();
+};
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareType (javax.swing.JFormattedTextField, "AbstractFormatterFactory");
+c$ = Clazz.p0p ();
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+this.ftf = null;
+Clazz.instantialize (this, arguments);
+}, javax.swing.JFormattedTextField, "AbstractFormatter");
+Clazz.defineMethod (c$, "install", 
+function (a) {
+if (this.ftf != null) {
+this.uninstall ();
+}this.ftf = a;
+if (a != null) {
+try {
+a.setText (this.valueToString (a.getValue ()));
+} catch (pe) {
+if (Clazz.exceptionOf (pe, java.text.ParseException)) {
+a.setText ("");
+this.setEditValid (false);
+} else {
+throw pe;
+}
+}
+this.installDocumentFilter (this.getDocumentFilter ());
+a.setFormatterActions (this.getActions ());
+}}, "javax.swing.JFormattedTextField");
+Clazz.defineMethod (c$, "uninstall", 
+function () {
+if (this.ftf != null) {
+this.installDocumentFilter (null);
+this.ftf.setFormatterActions (null);
+}});
+Clazz.defineMethod (c$, "getFormattedTextField", 
+function () {
+return this.ftf;
+});
+Clazz.defineMethod (c$, "invalidEdit", 
+function () {
+var a = this.getFormattedTextField ();
+if (a != null) {
+a.invalidEdit ();
+}});
+Clazz.defineMethod (c$, "setEditValid", 
+function (a) {
+var b = this.getFormattedTextField ();
+if (b != null) {
+b.setEditValid (a);
+}}, "~B");
+Clazz.defineMethod (c$, "getActions", 
+function () {
+return null;
+});
+Clazz.defineMethod (c$, "getDocumentFilter", 
+function () {
+return null;
+});
+Clazz.defineMethod (c$, "getNavigationFilter", 
+function () {
+return null;
+});
+Clazz.defineMethod (c$, "clone", 
+function () {
+var a = Clazz.superCall (this, javax.swing.JFormattedTextField.AbstractFormatter, "clone", []);
+a.ftf = null;
+return a;
+});
+Clazz.defineMethod (c$, "installDocumentFilter", 
+ function (a) {
+var b = this.getFormattedTextField ();
+if (b != null) {
+var c = b.getDocument ();
+if (Clazz.instanceOf (c, javax.swing.text.JSMinimalAbstractDocument)) {
+(c).setDocumentFilter (a);
+}c.putProperty (javax.swing.text.DocumentFilter, null);
+}}, "javax.swing.text.DocumentFilter");
+c$ = Clazz.p0p ();
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareType (javax.swing.JFormattedTextField, "CommitAction", javax.swing.JTextField.NotifyAction);
+Clazz.defineMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getFocusedComponent ();
+if (Clazz.instanceOf (b, javax.swing.JFormattedTextField)) {
+try {
+(b).commitEdit ();
+} catch (pe) {
+if (Clazz.exceptionOf (pe, java.text.ParseException)) {
+(b).invalidEdit ();
+return;
+} else {
+throw pe;
+}
+}
+}Clazz.superCall (this, javax.swing.JFormattedTextField.CommitAction, "actionPerformed", [a]);
+}, "java.awt.event.ActionEvent");
+Clazz.defineMethod (c$, "isEnabled", 
+function () {
+var a = this.getFocusedComponent ();
+if (Clazz.instanceOf (a, javax.swing.JFormattedTextField)) {
+var b = a;
+if (!b.isEdited ()) {
+return false;
+}return true;
+}return Clazz.superCall (this, javax.swing.JFormattedTextField.CommitAction, "isEnabled", []);
+});
+c$ = Clazz.p0p ();
+Clazz.pu$h(self.c$);
+c$ = Clazz.declareType (javax.swing.JFormattedTextField, "CancelAction", javax.swing.text.TextAction);
+Clazz.makeConstructor (c$, 
+function () {
+Clazz.superConstructor (this, javax.swing.JFormattedTextField.CancelAction, ["reset-field-edit"]);
+});
+Clazz.overrideMethod (c$, "actionPerformed", 
+function (a) {
+var b = this.getFocusedComponent ();
+if (Clazz.instanceOf (b, javax.swing.JFormattedTextField)) {
+var c = b;
+c.setValue (c.getValue ());
+}}, "java.awt.event.ActionEvent");
+Clazz.defineMethod (c$, "isEnabled", 
+function () {
+var a = this.getFocusedComponent ();
+if (Clazz.instanceOf (a, javax.swing.JFormattedTextField)) {
+var b = a;
+if (!b.isEdited ()) {
+return false;
+}return true;
+}return Clazz.superCall (this, javax.swing.JFormattedTextField.CancelAction, "isEnabled", []);
+});
+c$ = Clazz.p0p ();
+Clazz.defineStatics (c$,
+"$$uiClassID", "FormattedTextFieldUI");
+c$.$defaultActions = c$.prototype.$defaultActions =  Clazz.newArray (-1, [ new javax.swing.JFormattedTextField.CommitAction (),  new javax.swing.JFormattedTextField.CancelAction ()]);
+Clazz.defineStatics (c$,
+"COMMIT", 0,
+"COMMIT_OR_REVERT", 1,
+"REVERT", 2,
+"PERSIST", 3);
+});