public class JnumberField extends JentryField
javax.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 java.lang.String |
allowedChars |
static int |
DEFAULT_COLS |
private boolean |
limited |
private int |
maxSize |
private int |
minSize |
private java.lang.Integer |
oldvalue |
private boolean |
processingCallback |
private java.lang.Integer |
replacementValue |
private boolean |
replacingValue |
(package private) static TranslationService |
ts
TranslationService object for handling string localization in the
Ganymede client.
|
allowCallback, debug, loadingText, my_parent, notifieraccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
JnumberField()
Constructor which uses default everything.
|
JnumberField(int width)
Constructor which uses takes a number of columns, and everything
else default.
|
JnumberField(int columns,
boolean iseditable,
boolean islimited,
int minsize,
int maxsize)
Base constructor for JnumberField
|
JnumberField(int columns,
boolean iseditable,
boolean islimited,
int minsize,
int maxsize,
JsetValueCallback parent)
Constructor that allows for the creation of a JnumberField
that knows about its parent and can invoke a callback method.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxValue()
returns the maximum value in the range of valid values for this
JnumberField
|
int |
getMinValue()
returns the minimum value in the range of valid values for this
JnumberField
|
java.lang.Integer |
getValue()
returns the value of this JnumberField as an Integer object
If this field is empty, will return null.
|
boolean |
isAllowed(char c)
returns true if
|
boolean |
isLimited()
returns true if there is a bound on the range of values that
can be entered into this JnumberField
|
private void |
reportError(java.lang.String errorString)
This private helper method relays a descriptive error message to
our callback interface.
|
int |
sendCallback()
overrides JentryField.sendCallback().
|
void |
setLimited(boolean bool)
Sets the limited/non-limited status of this JnumberField
If setLimited is given a true value as a parameter, then
certain bounds will be imposed on the range of possible
values.
|
void |
setMaxValue(int n)
sets the maximum value in the range of possible values.
|
void |
setMinValue(int n)
sets the minimum value in the range of possible values.
|
void |
setValue(int num)
sets the value of this JnumberField to num
This method does not trigger a callback to our container.. we
only callback as a result of loss-of-focus brought on by the
user.
|
void |
setValue(java.lang.Integer num)
sets the value of this JnumberField using an Integer object.
|
void |
substituteValueByCallBack(JsetValueCallback callback,
java.lang.Integer replacementValue)
This method is intended to be called if the setValuePerformed()
callback that we call out to decides that it wants to substitute
a replacement value for the value that we asked to have
validated.
|
actionPerformed, focusGained, focusLost, getLength, getMaxStringSize, isLoading, setCallback, setEnterHandleractionPropertyChanged, addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setDocument, 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, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, restoreComposedText, saveComposedText, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setEditable, 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, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, 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, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, 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, hide, 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, processFocusEvent, 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, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclestatic final TranslationService ts
public static int DEFAULT_COLS
public static java.lang.String allowedChars
private java.lang.Integer oldvalue
private boolean limited
private boolean processingCallback
private int maxSize
private int minSize
private boolean replacingValue
private java.lang.Integer replacementValue
public JnumberField(int columns,
boolean iseditable,
boolean islimited,
int minsize,
int maxsize)
columns - number of colums in the JnumberFieldiseditable - true if this JnumberField is editableislimited - true if there is a restriction on the range of valuesminsize - the minimum limit on the range of valuesmaxsize - the maximum limit on the range of valuespublic JnumberField(int width)
public JnumberField()
public JnumberField(int columns,
boolean iseditable,
boolean islimited,
int minsize,
int maxsize,
JsetValueCallback parent)
columns - number of colums in the JnumberFieldiseditable - true if this JnumberField is editableislimited - true if there is a restriction on the range of valuesminsize - the minimum limit on the range of valuesmaxsize - the maximum limit on the range of valuesparent - the container within which this JnumberField is contained
(This container will implement an interface that will utilize the
data contained within this JnumberField.)public boolean isAllowed(char c)
isAllowed in class JentryFieldc - the character to checkpublic java.lang.Integer getValue()
throws java.lang.NumberFormatException
java.lang.NumberFormatExceptionpublic void setValue(int num)
num - the number to usepublic void setValue(java.lang.Integer num)
num - the Integer object to usepublic void setLimited(boolean bool)
bool - true if a limit is to be set on the range of valuespublic void setMaxValue(int n)
n - the number to use when setting the maximum valuepublic void setMinValue(int n)
n - the number to use when setting the minimum valuepublic boolean isLimited()
public int getMaxValue()
public int getMinValue()
public int sendCallback()
sendCallback in class JentryFieldprivate void reportError(java.lang.String errorString)
This private helper method relays a descriptive error message to our callback interface.
public void substituteValueByCallBack(JsetValueCallback callback, java.lang.Integer replacementValue)