|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
A spinner which displays and spins date/time. The date/time value can be changed by clicking on different subfields and spinning on them. The user can also type in a date string to set the current value.
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
static int |
DATE
One kind of caret position. |
static java.lang.String |
FULL
One kind of date format string. |
static int |
HOUR
One kind of caret position. |
static java.lang.String |
LONG
One kind of date format string. |
static java.lang.String |
MEDIUM
One kind of date format string. |
static int |
MINUTE
One kind of caret position. |
static int |
MONTH
One kind of caret position. |
static int |
SECOND
One kind of caret position. |
static java.lang.String |
SHORT
One kind of date format string. |
static int |
YEAR
One kind of caret position. |
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 | |
CalendarSpinner()
Default constructor which constructs a CalendarSpinner with the time zone set to that of the host, and the formatString property set to the default locale's Dateformat. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Event mothod of ActionListener. |
void |
addDateChangedListener(DateChangedListener listener)
Adds a DateChangedListener. |
void |
dateChanged(DateChangedEvent e)
Event mothod of DateChangedListener. |
void |
focusLost(java.awt.event.FocusEvent e)
Event mothod of FocusListener. |
java.util.Calendar |
getCalendar()
Gets the current calendar's six time fields (which are year, month, date, hour, minute, second). |
int |
getCaretPos()
Gets the current caret positon of the text field. |
java.util.Date |
getDate()
Gets the current date/time stored in the spinner. |
long |
getDatePartValue()
Gets the current date part(year, month, day). |
java.lang.String |
getDateString()
Gets the current date/time string shown in the entry field. |
int |
getDay()
Gets the current day. |
java.lang.String |
getFormatString()
Gets the current date/time format string. |
int |
getFormattingStyle()
Gets the default formatting styles which can be FULL, LONG, MEDIUM, or SHORT. |
int |
getHour()
Gets the current hour. |
java.util.Calendar |
getMaximum()
Gets the maximum property of calendar. |
java.util.Calendar |
getMinimum()
Gets the minimum property of calendar. |
int |
getMinute()
Gets the current minute. |
int |
getMonth()
Gets the current month. |
int |
getSecond()
Gets the current second. |
java.sql.Date |
getSQLDate()
Returns the spinner's current date as an SQL date. |
long |
getTimePartValue()
Gets the current time part(hour, minute, second). |
java.lang.String |
getTimeZone()
Returns the ID of the spinner's current time zone. |
long |
getValue()
Gets the current date/time value. |
int |
getYear()
Gets the current year. |
boolean |
isWrapAssociated()
Returns true if the spinner's subfields can be wrapped together. |
void |
keyPressed(java.awt.event.KeyEvent e)
|
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
removeDateChangedListener(DateChangedListener listener)
Removes a date-changed listener. |
void |
scrollDown()
Decrements the date/time subfield that the caret points to. |
void |
scrollUp()
Increments the date/time subfield that the caret points to. |
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 |
setDate(java.util.Date date)
Sets the current date/time. |
void |
setDateByFields(int year,
int month,
int day,
int hour,
int minute,
int second)
Sets the current date/time by time fields. |
void |
setDatePartValue(long newValue)
Sets the current date part(year, month, day) by by fields. |
void |
setDateString(java.lang.String str)
Sets the current date/time shown in the entry field. |
void |
setDay(int newDays)
Sets the current date. |
void |
setFormatString(java.lang.String newFormatString)
Sets the user defined pattern string for formatting and parsing date/time in a locale-sensitive manner. |
void |
setFormattingStyle(int newFormattingStyle)
Sets the default formatting styles which can be FULL, LONG, MEDIUM, of SHORT. |
void |
setHour(int newHours)
Sets the current hour. |
void |
setMaximum(java.util.Calendar newMaximumCalendar)
Sets the maximum property of calendar. |
void |
setMinimum(java.util.Calendar newMinimumCalendar)
Sets the minimum property of calendar. |
void |
setMinute(int newMinutes)
Sets the current minute. |
void |
setMonth(int newMonths)
Sets the current month. |
void |
setSecond(int newSeconds)
Sets the current second. |
void |
setTimePartValue(long newValue)
Sets the current time part(hour, minute, second) by fields. |
void |
setTimeZone(java.lang.String id)
Sets the time zone used by the DateFormat class for formatting strings into days. |
void |
setValue(long newValue)
Sets the current date/time value. |
void |
setWrapAssociated(boolean b)
Sets whether the spinner's subfields can be wrapped together or not. |
void |
setYear(int newYears)
Sets the current year. |
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 |
public static java.lang.String FULL
public static java.lang.String LONG
public static java.lang.String MEDIUM
public static java.lang.String SHORT
public static final int YEAR
public static final int MONTH
public static final int DATE
public static final int HOUR
public static final int MINUTE
public static final int SECOND
Constructor Detail |
public CalendarSpinner()
Method Detail |
public void setWrapAssociated(boolean b)
b
- if true, the subfields can be wrapped together.public boolean isWrapAssociated()
public void setTimeZone(java.lang.String id)
id
- A time zone ID. For instance, the time zone ID
for the Pacific Standard Time zone is "PST".public java.lang.String getTimeZone()
public void setCaretPos(int newCaretPos)
newCaretPos
- the sub-field number of the textpublic int getCaretPos()
public void setCalendar(java.util.Calendar newCalendar)
newCalendar
- the calendar whose time fields will be used to
change the current one.public java.util.Calendar getCalendar()
public void setDateString(java.lang.String str)
str
- The new date/time string.public java.lang.String getDateString()
public void setDate(java.util.Date date)
date
- the new date/time.public java.util.Date getDate()
java.util.Date
that represents
the date/time stored by this spinnerpublic void setFormatString(java.lang.String newFormatString)
newFormatString
- the new formatting string.public java.lang.String getFormatString()
public void setFormattingStyle(int newFormattingStyle)
newFormattingStyle
- the default formatting style.public int getFormattingStyle()
public void setYear(int newYears)
newYears
- The year as an int.public int getYear()
public void setMonth(int newMonths)
newMonths
- The month values are 0-11, e.g. 1 for January, 12 for December.public int getMonth()
public void setDay(int newDays)
newDays
- The date as an int.public int getDay()
public void setHour(int newHours)
newHours
- The hour as an int.public int getHour()
public void setMinute(int newMinutes)
newMinutes
- The minute as an int.public int getMinute()
public void setSecond(int newSeconds)
newSeconds
- The second as an int.public int getSecond()
public void setValue(long newValue)
newValue
- The new date/time value as a long.public long getValue()
public void setMinimum(java.util.Calendar newMinimumCalendar)
newMinimum
- The minimum as a Calendar.public java.util.Calendar getMinimum()
public void setMaximum(java.util.Calendar newMaximumCalendar)
newMaximumCalendar
- The maximum as a Calendar.public java.util.Calendar getMaximum()
public java.sql.Date getSQLDate()
java.sql.Date
that represents
the date stored by the spinner.public void setDatePartValue(long newValue)
newValue
- The date part value as a long.public long getDatePartValue()
public void setTimePartValue(long newValue)
newValue
- The time part value as a long.public long getTimePartValue()
public void setDateByFields(int year, int month, int day, int hour, int minute, int second)
year
- The year as an int.month
- The month as an int. Month values are 0-11, e.g. 0 for January, 11 for December.day
- The day as an int.hour
- The hour as an int.minute
- The minute as an int.second
- The second as an int.public void addDateChangedListener(DateChangedListener listener)
listener
- The listener to add.public void removeDateChangedListener(DateChangedListener listener)
listener
- The listener to remove.public void scrollUp()
public void scrollDown()
public void mouseReleased(java.awt.event.MouseEvent e)
public void keyReleased(java.awt.event.KeyEvent e)
public void keyPressed(java.awt.event.KeyEvent e)
public void actionPerformed(java.awt.event.ActionEvent e)
public void focusLost(java.awt.event.FocusEvent e)
public void dateChanged(DateChangedEvent e)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |