com.ibm.spinner
Class TimeSpinner

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.ibm.spinner.SpinnerGUI
                                |
                                +--com.ibm.spinner.Spinner
                                      |
                                      +--com.ibm.spinner.CalendarSpinner
                                            |
                                            +--com.ibm.spinner.TimeSpinner

public class TimeSpinner
extends CalendarSpinner

A spinner which displays and spins time. The time value can be changed by clicking on different subfields and spinning on them. The user can also type in a time string to set the current value.


Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static java.lang.String FULL
          One kind of date format string.
static java.lang.String LONG
          One kind of date format string.
static java.lang.String MEDIUM
          One kind of date format string.
static java.lang.String SHORT
          One kind of date format string.
 
Fields inherited from class com.ibm.spinner.CalendarSpinner
DATE, FULL, HOUR, LONG, MEDIUM, MINUTE, MONTH, SECOND, SHORT, YEAR
 
Fields inherited from class com.ibm.spinner.SpinnerGUI
SPIN_HORIZONTAL, SPIN_VERTICAL
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
TimeSpinner()
          Default constructor which constructs a DateSpinner with the time zone set to that of the host, and the formatString property set to the default locale's Dateformat.
 
Method Summary
 void setCalendar(java.util.Calendar newCalendar)
          Sets the current calendar's six time fields ,which are year, month, date, hour, minute, second the same with the time fields of another calendar.
 void setCaretPos(int newCaretPos)
          Sets the current caret positon of the text field.
 void setFormatString(java.lang.String newFormatString)
          Set the user defined pattern string for formatting and parsing date in a locale-sensitive manner.
 void setFormattingStyle(int newFormattingStyle)
          Sets the default formatting styles which can be FULL, LONG, MEDIUM, of SHORT.
 void setMaximum(java.util.Calendar newMaximumCalendar)
          Sets the maximum property of calendar.
 void setMinimum(java.util.Calendar newMinimumCalendar)
          Sets the minimum property of calendar.
 
Methods inherited from class com.ibm.spinner.CalendarSpinner
actionPerformed, addDateChangedListener, dateChanged, focusLost, getCalendar, getCaretPos, getDate, getDatePartValue, getDateString, getDay, getFormatString, getFormattingStyle, getHour, getMaximum, getMinimum, getMinute, getMonth, getSecond, getSQLDate, getTimePartValue, getTimeZone, getValue, getYear, isWrapAssociated, keyPressed, keyReleased, mouseReleased, removeDateChangedListener, scrollDown, scrollUp, setDate, setDateByFields, setDatePartValue, setDateString, setDay, setHour, setMinute, setMonth, setSecond, setTimePartValue, setTimeZone, setValue, setWrapAssociated, setYear
 
Methods inherited from class com.ibm.spinner.Spinner
addChangeListener, addSpinnerErrorEventListener, isWrap, removeChangeListener, removeSpinnerErrorEventListener, setWrap
 
Methods inherited from class com.ibm.spinner.SpinnerGUI
focusGained, getColumns, getDecrButtonArrowColor, getIncrButtonArrowColor, getMaximumSize, getMinimumSize, getOrientation, getPreferredSize, isEditable, isEnabled, keyTyped, mouseClicked, mouseEntered, mouseExited, mousePressed, setBackground, setColumns, setDecrButtonArrowColor, setEditable, setEnabled, setFont, setForeground, setIncrButtonArrowColor, setOpaque, setOrientation
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FULL

public static final java.lang.String FULL
One kind of date format string.

LONG

public static final java.lang.String LONG
One kind of date format string.

MEDIUM

public static final java.lang.String MEDIUM
One kind of date format string.

SHORT

public static final java.lang.String SHORT
One kind of date format string.
Constructor Detail

TimeSpinner

public TimeSpinner()
Default constructor which constructs a DateSpinner with the time zone set to that of the host, and the formatString property set to the default locale's Dateformat.
Method Detail

setCaretPos

public void setCaretPos(int newCaretPos)
Sets the current caret positon of the text field.
Parameters:
newCaretPos - the sub-field number of the text
Overrides:
setCaretPos in class CalendarSpinner

setFormatString

public void setFormatString(java.lang.String newFormatString)
Set the user defined pattern string for formatting and parsing date in a locale-sensitive manner.
Parameters:
format - the new formatting string
Overrides:
setFormatString in class CalendarSpinner
See Also:
CalendarSpinner.getFormatString()

setFormattingStyle

public void setFormattingStyle(int newFormattingStyle)
Sets the default formatting styles which can be FULL, LONG, MEDIUM, of SHORT.
Parameters:
newFormattingStyle - the default formatting style.
Overrides:
setFormattingStyle in class CalendarSpinner

setMinimum

public void setMinimum(java.util.Calendar newMinimumCalendar)
Sets the minimum property of calendar.
Parameters:
newMinimum - The minimum as a Calendar.
Overrides:
setMinimum in class CalendarSpinner

setMaximum

public void setMaximum(java.util.Calendar newMaximumCalendar)
Sets the maximum property of calendar.
Parameters:
newMaximumCalendar - The maximum as a Calendar.
Overrides:
setMaximum in class CalendarSpinner

setCalendar

public void setCalendar(java.util.Calendar newCalendar)
Sets the current calendar's six time fields ,which are year, month, date, hour, minute, second the same with the time fields of another calendar. But the timeZone of the current calendar is not changed.
Parameters:
newCalendar - the calendar whose time fields will be used to change the current one.
Throws:
java.lang.IllegalArgumentException - exception
Overrides:
setCalendar in class CalendarSpinner