Class StrictNumberFormatter

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    @Deprecated
    class StrictNumberFormatter
    extends javax.swing.text.NumberFormatter
    Deprecated.
    (pre-1.6.2) moved to text package
    Experiment to work around Issue #1183-swingx: NumberEditorExt throws exception on getCellValue. Remaining issue: no visual error feedback if the expected number type exceeds its range.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.math.BigDecimal maxAsBig
      Deprecated.
       
      private java.math.BigDecimal minAsBig
      Deprecated.
       
    • Constructor Summary

      Constructors 
      Constructor Description
      StrictNumberFormatter​(java.text.NumberFormat format)
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      private java.lang.Object convertValueToValueClass​(java.lang.Object value, java.lang.Class<?> valueClass)
      Deprecated.
      Converts the passed in value to the passed in class.
      private java.lang.Comparable<java.math.BigDecimal> getMaximumAsBig()
      Deprecated.
       
      private java.lang.Comparable<java.math.BigDecimal> getMinimumAsBig()
      Deprecated.
       
      private java.lang.Object getParsedValue​(java.lang.String text, java.text.Format f)
      Deprecated.
      Invokes parseObject on f, returning its value.
      private boolean isValueInRange​(java.lang.Object orgValue, boolean wantsCCE)
      Deprecated.
      Returns true if value is between the min/max.
      void setMaximum​(java.lang.Comparable max)
      Deprecated.
       
      void setMinimum​(java.lang.Comparable minimum)
      Deprecated.
       
      void setValueClass​(java.lang.Class<?> valueClass)
      Deprecated.
      java.lang.Object stringToValue​(java.lang.String text)
      Deprecated.
      Returns the Object representation of the String text, may be null.
      private void updateMinMax()
      Deprecated.
       
      • Methods inherited from class javax.swing.text.NumberFormatter

        setFormat
      • Methods inherited from class javax.swing.text.InternationalFormatter

        clone, getActions, getFields, getFormat, getMaximum, getMinimum, install, valueToString
      • Methods inherited from class javax.swing.text.DefaultFormatter

        getAllowsInvalid, getCommitsOnValidEdit, getDocumentFilter, getNavigationFilter, getOverwriteMode, getValueClass, setAllowsInvalid, setCommitsOnValidEdit, setOverwriteMode
      • Methods inherited from class javax.swing.JFormattedTextField.AbstractFormatter

        getFormattedTextField, invalidEdit, setEditValid, uninstall
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • maxAsBig

        private java.math.BigDecimal maxAsBig
        Deprecated.
      • minAsBig

        private java.math.BigDecimal minAsBig
        Deprecated.
    • Constructor Detail

      • StrictNumberFormatter

        public StrictNumberFormatter​(java.text.NumberFormat format)
        Deprecated.
        Parameters:
        format -
    • Method Detail

      • setValueClass

        public void setValueClass​(java.lang.Class<?> valueClass)
        Deprecated.

        Overridden to automatically set the minimum/maximum to the boundaries of the Number type if it corresponds to a raw type, or null if not.

        Overrides:
        setValueClass in class javax.swing.text.DefaultFormatter
      • updateMinMax

        private void updateMinMax()
        Deprecated.
      • setMaximum

        public void setMaximum​(java.lang.Comparable max)
        Deprecated.
        Overrides:
        setMaximum in class javax.swing.text.InternationalFormatter
      • setMinimum

        public void setMinimum​(java.lang.Comparable minimum)
        Deprecated.
        Overrides:
        setMinimum in class javax.swing.text.InternationalFormatter
      • stringToValue

        public java.lang.Object stringToValue​(java.lang.String text)
                                       throws java.text.ParseException
        Deprecated.
        Returns the Object representation of the String text, may be null.
        Overrides:
        stringToValue in class javax.swing.text.InternationalFormatter
        Parameters:
        text - String to convert
        Returns:
        Object representation of text
        Throws:
        java.text.ParseException - if there is an error in the conversion
      • convertValueToValueClass

        private java.lang.Object convertValueToValueClass​(java.lang.Object value,
                                                          java.lang.Class<?> valueClass)
        Deprecated.
        Converts the passed in value to the passed in class. This only works if valueClass is one of Integer, Long, Float, Double, Byte or Short and value is an instanceof Number.
      • getParsedValue

        private java.lang.Object getParsedValue​(java.lang.String text,
                                                java.text.Format f)
                                         throws java.text.ParseException
        Deprecated.
        Invokes parseObject on f, returning its value.
        Throws:
        java.text.ParseException
      • isValueInRange

        private boolean isValueInRange​(java.lang.Object orgValue,
                                       boolean wantsCCE)
        Deprecated.
        Returns true if value is between the min/max.
        Parameters:
        wantsCCE - If false, and a ClassCastException is thrown in comparing the values, the exception is consumed and false is returned.
      • getMinimumAsBig

        private java.lang.Comparable<java.math.BigDecimal> getMinimumAsBig()
        Deprecated.
      • getMaximumAsBig

        private java.lang.Comparable<java.math.BigDecimal> getMaximumAsBig()
        Deprecated.