wt.clients.prodmgmt
Class Spinner

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended bysymantec.itools.awt.util.spinner.Spinner
                  extended bysymantec.itools.awt.util.spinner.NumericSpinner
                      extended bywt.clients.prodmgmt.Spinner
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, symantec.itools.awt.Orientation, Serializable

public class Spinner
extends symantec.itools.awt.util.spinner.NumericSpinner

Spinner extends NumericSpinner to allow listening to the contained textfield. This spinner allows decimal values and throws PropertyChangeEvents with the new and old Double values.

Supported API: true

Extendable: false

See Also:
NumericSpinner, Serialized Form

Nested Class Summary
(package private)  class Spinner.SymKey
           
 
Nested classes inherited from class symantec.itools.awt.util.spinner.Spinner
 
Nested classes inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  Spinner.SymKey aSymKey
           
protected  symantec.itools.beans.PropertyChangeSupport changes
           
protected  boolean d_containsDecimalPoint
           
protected  double d_currentDoubleValue
           
protected  char d_decimalCharacter
           
protected  boolean d_isVisible
           
 
Fields inherited from class symantec.itools.awt.util.spinner.NumericSpinner
 
Fields inherited from class symantec.itools.awt.util.spinner.Spinner
action, actionListener, added, current, currentVeto, editable, errors, increment, max, maxVeto, min, minVeto, orientation, ORIENTATION_DEFAULT, text, textWidth, wrappable
 
Fields inherited from class java.awt.Panel
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface symantec.itools.awt.Orientation
ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Spinner()
          Construct a Spinner object.
 
Method Summary
 void addKeyListener(KeyListener keyListener)
          Add a key listener to this component.
 void addNotify()
          Overridden to add a KeyListener for key stroke events in the contained text field.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a listener for all property change events.
 double getCurrentDoubleValue()
          Get the contents of d_currentDoubleValue.
 String getCurrentText()
          Get the current text from the Spinner.
protected  TextField getTextField()
          Get reference to internal TextField object.
(package private)  void qtyListSpinner_keyPressed(KeyEvent event)
          Preprocess key events before they are passed to the TextField.
(package private)  void qtyListSpinner_keyReleased(KeyEvent event)
          Perform post processing of keypress.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a listener for all property change events.
private  void RestoreField(Exception e)
           
protected  void scrollDown()
          Decrements the spinner's value and handles wrapping as needed.
protected  void scrollUp()
          Increments the spinner's value and handles wrapping as needed.
 void setCurrentDoubleValue(double value)
          Sets the current double value.
 
Methods inherited from class symantec.itools.awt.util.spinner.NumericSpinner
addVetoableChangeListener, getIncrement, removeVetoableChangeListener, setIncrement, setMax, setMin, validateText
 
Methods inherited from class symantec.itools.awt.util.spinner.Spinner
addActionListener, addCurrentListener, addCurrentListener, addMaxListener, addMaxListener, addMinListener, addMinListener, getCurrent, getDelay, getEditable, getEntryFieldText, getMax, getMin, getMinimumSize, getNotifyWhilePressed, getOrientation, getPreferredSize, getWrappable, isEditable, isNotifyWhilePressed, isValidCurrentValue, isValidMaxValue, isValidMinValue, isWrappable, removeActionListener, removeCurrentListener, removeCurrentListener, removeMaxListener, removeMaxListener, removeMinListener, removeMinListener, removeNotify, setCurrent, setDelay, setEditable, setEnabled, setLayout, setNotifyWhilePressed, setOrientation, setWrappable, sourceActionEvent, updateButtonStatus, updateText
 
Methods inherited from class java.awt.Panel
getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

aSymKey

protected Spinner.SymKey aSymKey

d_currentDoubleValue

protected double d_currentDoubleValue

d_containsDecimalPoint

protected boolean d_containsDecimalPoint

d_decimalCharacter

protected char d_decimalCharacter

d_isVisible

protected boolean d_isVisible

changes

protected symantec.itools.beans.PropertyChangeSupport changes
Constructor Detail

Spinner

public Spinner()
Construct a Spinner object.

Method Detail

addNotify

public void addNotify()
Overridden to add a KeyListener for key stroke events in the contained text field.


getCurrentDoubleValue

public double getCurrentDoubleValue()
Get the contents of d_currentDoubleValue.

Returns:
the current double value.

getCurrentText

public String getCurrentText()
Get the current text from the Spinner.

Returns:
A String containing the text of the currently selected Spinner value

getTextField

protected TextField getTextField()
Get reference to internal TextField object. This method became necessary because the call to updateText() which is used widely in this source file seems to result in the cursor being positioned to the beginning of the text field instead of leaving it where it was.

See Also:
symantec.itools.awt.util.spinner

setCurrentDoubleValue

public void setCurrentDoubleValue(double value)
                           throws PropertyVetoException
Sets the current double value.

Parameters:
value - Value contains the value to set d_currentDoubleValue to.
Throws:
PropertyVetoException - if the new value is greater than the specified maximum value

addKeyListener

public void addKeyListener(KeyListener keyListener)
Add a key listener to this component.

Parameters:
keyListener - a new listener for this component
See Also:
KeyListener

scrollUp

protected void scrollUp()
Increments the spinner's value and handles wrapping as needed.

See Also:
scrollDown(), Spinner.increment

scrollDown

protected void scrollDown()
Decrements the spinner's value and handles wrapping as needed.

See Also:
scrollUp(), Spinner.increment

qtyListSpinner_keyPressed

void qtyListSpinner_keyPressed(KeyEvent event)
Preprocess key events before they are passed to the TextField. Keypress events are passed to this method before being handed to the TextField so that this method can throw away invalid key strokes. This class is a floating point numeric entry spinner class so the only keys that are allowed are numeric (0-9), decimal point (.) BACKSPACE and END keys. The reason the END key is allowed is because the cursor seems to default to the beginning of the field when it is first displayed.


qtyListSpinner_keyReleased

void qtyListSpinner_keyReleased(KeyEvent event)
Perform post processing of keypress. Listen for key released events from the textfield in the spinner and set the value of the spinner to the current value in the text field. When the instruction pointer lands in this method, the text field already contains the new character that the user just entered, assuming it was not filtered out by the above keyPressed() handler.


RestoreField

private void RestoreField(Exception e)

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all property change events.

Parameters:
listener - the listener to add
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all property change events.

Parameters:
listener - the listener to remove
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)