javax.swing
Class JSpinner.NumberEditorFormatter

java.lang.Object
  extended byjavax.swing.JFormattedTextField.AbstractFormatter
      extended byjavax.swing.text.DefaultFormatter
          extended byjavax.swing.text.InternationalFormatter
              extended byjavax.swing.text.NumberFormatter
                  extended byjavax.swing.JSpinner.NumberEditorFormatter
All Implemented Interfaces:
Cloneable, Serializable
Enclosing class:
JSpinner

private static class JSpinner.NumberEditorFormatter
extends NumberFormatter

This subclass of javax.swing.NumberFormatter maps the minimum/maximum properties to a SpinnerNumberModel and initializes the valueClass of the NumberFormatter to match the type of the initial models value.


Nested Class Summary
 
Nested classes inherited from class javax.swing.text.InternationalFormatter
 
Nested classes inherited from class javax.swing.text.DefaultFormatter
 
Field Summary
private  SpinnerNumberModel model
           
 
Fields inherited from class javax.swing.text.NumberFormatter
 
Fields inherited from class javax.swing.text.InternationalFormatter
 
Fields inherited from class javax.swing.text.DefaultFormatter
 
Fields inherited from class javax.swing.JFormattedTextField.AbstractFormatter
 
Constructor Summary
(package private) JSpinner.NumberEditorFormatter(SpinnerNumberModel model, NumberFormat format)
           
 
Method Summary
 Comparable getMaximum()
          Returns the maximum permissible value.
 Comparable getMinimum()
          Returns the minimum permissible value.
 void setMaximum(Comparable max)
          Sets the maximum permissible value.
 void setMinimum(Comparable min)
          Sets the minimum permissible value.
 
Methods inherited from class javax.swing.text.NumberFormatter
setFormat
 
Methods inherited from class javax.swing.text.InternationalFormatter
clone, getActions, getFields, getFormat, install, stringToValue, valueToString
 
Methods inherited from class javax.swing.text.DefaultFormatter
getAllowsInvalid, getCommitsOnValidEdit, getDocumentFilter, getNavigationFilter, getOverwriteMode, getValueClass, setAllowsInvalid, setCommitsOnValidEdit, setOverwriteMode, setValueClass
 
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

model

private final SpinnerNumberModel model
Constructor Detail

JSpinner.NumberEditorFormatter

JSpinner.NumberEditorFormatter(SpinnerNumberModel model,
                               NumberFormat format)
Method Detail

setMinimum

public void setMinimum(Comparable min)
Description copied from class: InternationalFormatter
Sets the minimum permissible value. If the valueClass has not been specified, and minimum is non null, the valueClass will be set to that of the class of minimum.

Overrides:
setMinimum in class InternationalFormatter
Parameters:
min - Minimum legal value that can be input
See Also:
DefaultFormatter.setValueClass(java.lang.Class)

getMinimum

public Comparable getMinimum()
Description copied from class: InternationalFormatter
Returns the minimum permissible value.

Overrides:
getMinimum in class InternationalFormatter
Returns:
Minimum legal value that can be input

setMaximum

public void setMaximum(Comparable max)
Description copied from class: InternationalFormatter
Sets the maximum permissible value. If the valueClass has not been specified, and max is non null, the valueClass will be set to that of the class of max.

Overrides:
setMaximum in class InternationalFormatter
Parameters:
max - Maximum legal value that can be input
See Also:
DefaultFormatter.setValueClass(java.lang.Class)

getMaximum

public Comparable getMaximum()
Description copied from class: InternationalFormatter
Returns the maximum permissible value.

Overrides:
getMaximum in class InternationalFormatter
Returns:
Maximum legal value that can be input