public class PMINumericTextField extends BaseFormattedTextField
javax.swing.JFormattedTextField.AbstractFormatter, javax.swing.JFormattedTextField.AbstractFormatterFactoryjavax.swing.JTextField.AccessibleJTextFieldjavax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.DropLocation, javax.swing.text.JTextComponent.KeyBindingjavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
static int |
MODE_DOUBLE |
static int |
MODE_FLOAT |
static int |
MODE_INT |
static int |
MODE_LONG |
commitOnFocusLost, context, cursorCode, editableBackground, nonEditableBackground, protectedMode, rejectUpdatesDuringEdit, touchscreenModeCOMMIT, COMMIT_OR_REVERT, PERSIST, REVERTlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTRESERVED_SET_KEYCOMPONENT_LOCKED, COMPONENT_PERMISSIONS, COMPONENT_SECURITY, COMPONENT_TRANSLATIONSCOMPONENT_RUNNINGDISABLED_BY_PERMISSIONS| Constructor and Description |
|---|
PMINumericTextField() |
| Modifier and Type | Method and Description |
|---|---|
void |
commitEdit()
Don't call this method outside of the Event Dispatch thread because commitsPossible is assumed to be checked
serially on the event dispatch thread.
|
java.lang.String |
getDecimalFormat() |
double |
getDoubleValue()
If getValue() is outside the range of a double, TypeUtilities will display an error and we'll show 0 as the
value.
|
float |
getFloatValue()
If we're in float mode or in the range of a float, try to display the float value, throwing an error if it can't
be evaluated as a float.
|
int |
getIntValue()
If we're in int mode or in the range of a int, try to display the int value, throwing an error if it can't
be evaluated as a int.
|
long |
getLongValue()
If we're in long mode or in the range of a long, try to display the long value, throwing an error if it can't
be evaluated as a long.
|
double |
getMaximum() |
double |
getMinimum() |
int |
getMode() |
java.lang.Class |
getModeType() |
java.lang.String |
getOutOfBoundsMessage() |
java.lang.String |
getSuffix() |
java.lang.String |
getTouchscreenPropertyName()
The javabeans-style name of the property to modify.
|
TouchscreenMouseListener.KeyboardStyle |
getTouchscreenStyle() |
double |
getTouchscreenValue() |
boolean |
isDeferUpdates() |
boolean |
isErrorOnOutOfBounds() |
boolean |
isUseBounds() |
protected javax.swing.JFormattedTextField.AbstractFormatterFactory |
newFormatterFactory()
Subclasses must implement this to create the formatter factory of the type they want to use
|
protected void |
onStartup()
Subclasses should override this to provide startup logic.
|
void |
setDecimalFormat(java.lang.String decimalFormat) |
void |
setDeferUpdates(boolean deferUpdates) |
void |
setDoubleValue(double doubleValue) |
void |
setErrorOnOutOfBounds(boolean errorOnOutOfBounds) |
void |
setFloatValue(float floatValue) |
void |
setIntValue(int intValue) |
void |
setLongValue(long longValue) |
void |
setMaximum(double maximum) |
void |
setMinimum(double minimum) |
void |
setMode(int mode) |
void |
setOutOfBoundsMessage(java.lang.String outOfBoundsMessage) |
void |
setSuffix(java.lang.String suffix) |
void |
setTouchscreenValue(double value) |
void |
setUseBounds(boolean useBounds) |
void |
setValue(java.lang.Object obj) |
java.lang.String |
toString() |
_setEditable, evaluateEnabled, getAppContext, getCursorCode, getDataQuality, getDynamicProps, getEditableBackground, getNonEditableBackground, getProperties, getPropertyValue, getQuality, getSelectedText, getStyles, getToolTipText, getTouchscreenMode, isCommitOnFocusLost, isComponentEnabled, isEditing, isPropertyDefined, isProtectedMode, isRejectUpdatesDuringEdit, isTouchscreenEditAllowed, localeChanged, onShutdown, paintChildren, setAntialias, setCommitOnFocusLost, setComponentEnabled, setCursorCode, setDataQuality, setDynamicProps, setEditable, setEditableBackground, setName, setNonEditableBackground, setPropertyValue, setProtectedMode, setQuality, setRejectUpdatesDuringEdit, setStyles, setToolTipText, setTouchscreenMode, setValueDirect, setVisible, shutdownComponent, startupComponent, updateQualitygetActions, getFocusLostBehavior, getFormatter, getFormatterFactory, getUIClassID, getValue, invalidEdit, isEditValid, processFocusEvent, processInputMethodEvent, setDocument, setFocusLostBehavior, setFormatter, setFormatterFactoryactionPropertyChanged, addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setFont, setHorizontalAlignment, setScrollOffsetaddCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, print, print, print, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, restoreComposedText, saveComposedText, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, writeaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final int MODE_INT
public static final int MODE_LONG
public static final int MODE_FLOAT
public static final int MODE_DOUBLE
public boolean isErrorOnOutOfBounds()
public void setErrorOnOutOfBounds(boolean errorOnOutOfBounds)
public java.lang.String getOutOfBoundsMessage()
public boolean isDeferUpdates()
public void setDeferUpdates(boolean deferUpdates)
public void setOutOfBoundsMessage(java.lang.String outOfBoundsMessage)
protected javax.swing.JFormattedTextField.AbstractFormatterFactory newFormatterFactory()
BaseFormattedTextFieldnewFormatterFactory in class BaseFormattedTextFieldpublic java.lang.String toString()
toString in class java.awt.Componentpublic java.lang.Class getModeType()
public java.lang.String getTouchscreenPropertyName()
TouchscreenMouseListener.TouchscreenEnabledComponentpublic TouchscreenMouseListener.KeyboardStyle getTouchscreenStyle()
getTouchscreenStyle in interface TouchscreenMouseListener.TouchscreenEnabledComponentgetTouchscreenStyle in class BaseFormattedTextFieldpublic double getTouchscreenValue()
public void setTouchscreenValue(double value)
public int getMode()
public void setMode(int mode)
public void commitEdit()
throws java.text.ParseException
commitEdit in class javax.swing.JFormattedTextFieldjava.text.ParseExceptionpublic double getMaximum()
public void setMaximum(double maximum)
public double getMinimum()
public void setMinimum(double minimum)
public boolean isUseBounds()
public void setUseBounds(boolean useBounds)
public double getDoubleValue()
public void setDoubleValue(double doubleValue)
public float getFloatValue()
Pre 7.7.7, values outside of float range would return the overflowed value, potentially altering the underlying value.
public void setFloatValue(float floatValue)
public int getIntValue()
Pre 7.7.7, values outside of int range would return the overflowed value, potentially altering the underlying value.
public void setIntValue(int intValue)
public long getLongValue()
Pre 7.7.7, values outside of long range would return the overflowed value, potentially altering the underlying value.
public void setLongValue(long longValue)
public void setValue(java.lang.Object obj)
setValue in class BaseFormattedTextFieldpublic java.lang.String getDecimalFormat()
public void setDecimalFormat(java.lang.String decimalFormat)
protected void onStartup()
BaseFormattedTextFieldonStartup in class BaseFormattedTextFieldpublic java.lang.String getSuffix()
public void setSuffix(java.lang.String suffix)