|
||||||||
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 |
AM_PM
One kind of caret position. |
static int |
AMPM
One kind of caret position. |
static int |
DATE
One kind of caret position. |
static int |
DAY_OF_MONTH
One kind of caret position. |
static int |
DAY_OF_WEEK
One kind of caret position. |
static int |
DAY_OF_WEEK_IN_MONTH
One kind of caret position. |
static int |
DAY_OF_YEAR
One kind of caret position. |
static int |
ERA
One kind of caret position. |
static int |
HOUR
One kind of caret position. |
static int |
HOUR_OF_DAY
One kind of caret position. |
static int |
MILLISECOND
One kind of caret position. |
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 int |
WEEK_OF_MONTH
One kind of caret position. |
static int |
WEEK_OF_YEAR
One kind of caret position. |
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 |
addDateChangedListener(DateChangedListener listener)
Adds a DateChangedListener. |
void |
changeFormatStyle(int iFormatStyle,
java.lang.String sNewFormatString)
Changes any existed formatting string |
void |
dateChanged(DateChangedEvent e)
Event method of DateChangedListener. |
void |
focusGained(java.awt.event.FocusEvent e)
Invoked when a component gains the keyboard focus |
void |
focusLost(java.awt.event.FocusEvent e)
Invoked when a component loses the keyboard focus |
java.lang.String |
getAboutThisBean()
Returns a special formatted string intended for use by the editor of this property. |
java.awt.Color |
getBackground()
Gets the background color |
java.util.Calendar |
getCalendar()
Gets the current calendar |
int |
getCaretPos()
Gets the current caret positon field of the spinner. |
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.awt.Font |
getFont()
Returns the font |
java.awt.Color |
getForeground()
Returns the textfield foreground color |
java.lang.String |
getFormatString()
Gets the current date/time format string. |
java.lang.String |
getFormatStringByStyle(int iFormatStyle)
Gets date/time format string by its style. |
FormatStrings |
getFormatStrings()
Gets FormatStrings class for the spinner, containing all the format strings This method is intended to be used during Designtime. |
int |
getFormattingStyle()
Gets the default formatting styles which can be FULL, LONG, MEDIUM, or SHORT. |
int |
getHour()
Gets the current hour. |
java.util.Locale |
getLocale()
Overriden from java.awt.Component to catch IllegalComponentStateException. |
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. |
void |
initFormatStyle(int iStyle)
This method is used for initializing the formatting style via IDE. |
void |
initMaximum(java.util.Calendar newMaximumCalendar)
Initializes the maximum property of calendar. |
void |
initMinimum(java.util.Calendar newMinimumCalendar)
Initializes the minimum property of calendar. |
boolean |
isEditable()
Indicates whether or not this text component is editable. |
boolean |
isEnabled()
Determines whether this component is enabled. |
boolean |
isOpaque()
Returns true if this component is completely opaque. |
boolean |
isSpinnable()
Indicates whether or not this text component is spinnable, ineffective in the non-editable mode. |
boolean |
isValidateMonthFirst()
Returns true if the validating of month performing correcting day value. |
boolean |
isWrapAssociated()
Returns true if the spinner's subfields can be wrapped together. |
void |
keyPressed(java.awt.event.KeyEvent e)
Event method of KeyListener. |
void |
keyTyped(java.awt.event.KeyEvent e)
Event method of KeyListener. |
void |
mousePressed(java.awt.event.MouseEvent e)
Event method of MouseListener. |
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 |
setAboutThisBean(java.lang.String aboutThisBean)
Setter method for the aboutThisBean property to be available in the properties list. |
void |
setBackground(java.awt.Color c)
Sets the background color of this component. |
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 |
setEditable(boolean aBoolean)
Sets whether text editing is enabled. |
void |
setEnabled(boolean b)
Enables or disables this component, depending on the value of the parameter b . |
void |
setFont(java.awt.Font f)
Sets the font of this component. |
void |
setForeground(java.awt.Color c)
Sets the foreground color of this component. |
void |
setFormatString(java.lang.String newFormatString)
Sets the user defined pattern string for formatting and parsing date/time in a locale-sensitive manner. |
void |
setFormatStrings(FormatStrings aFS)
Sets the user defined pattern strings for formatting and parsing date/time in a locale-sensitive manner. |
void |
setFormattingStyle(int iNewFormattingStyle)
Sets the default formatting styles which can be FULL, LONG, MEDIUM, of SHORT. |
void |
setHour(int newHours)
Sets the current hour. |
void |
setLocale(java.util.Locale newLocale)
Overriden form java.awt.Component Sets the locale property (java.util.Locale) value. |
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 |
setSpinnable(boolean aBoolean)
Sets whether text spinning is enabled, ineffective in the non-editable mode. |
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 |
setValidateMonthFirst(boolean validateMonthFirst)
Sets whether month or day must be validated first. |
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. |
void |
stateChanged(javax.swing.event.ChangeEvent event)
Event method of ChangedListener |
Methods inherited from class com.ibm.spinner.Spinner |
addChangeListener,
addSpinnerErrorEventListener,
isWrap,
removeChangeListener,
removeSpinnerErrorEventListener,
setWrap |
Methods inherited from class com.ibm.spinner.SpinnerGUI |
getColumns,
getDecrButtonArrowColor,
getEditable,
getIncrButtonArrowColor,
getMaximumSize,
getMinimumSize,
getOrientation,
getPreferredSize,
keyReleased,
mouseClicked,
mouseEntered,
mouseExited,
mouseReleased,
setColumns,
setDecrButtonArrowColor,
setIncrButtonArrowColor,
setOpaque,
setOrientation,
setToolTipText |
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,
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,
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,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFontMetrics,
getInputContext,
getInputMethodRequests,
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,
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 final int ERA
public static final int YEAR
public static final int MONTH
public static final int WEEK_OF_YEAR
public static final int WEEK_OF_MONTH
public static final int DATE
public static final int DAY_OF_MONTH
public static final int DAY_OF_YEAR
public static final int DAY_OF_WEEK
public static final int DAY_OF_WEEK_IN_MONTH
public static final int AMPM
public static final int AM_PM
public static final int HOUR
public static final int HOUR_OF_DAY
public static final int MINUTE
public static final int SECOND
public static final int MILLISECOND
Constructor Detail |
public CalendarSpinner()
Method Detail |
public void addDateChangedListener(DateChangedListener listener)
listener
- The listener to add.public void changeFormatStyle(int iFormatStyle, java.lang.String sNewFormatString)
iFormatStyle
- intsNewFormatString
- java.lang.Stringpublic void dateChanged(DateChangedEvent e)
e
- DateChangedEventpublic void focusGained(java.awt.event.FocusEvent e)
e
- FocusEventpublic void focusLost(java.awt.event.FocusEvent e)
e
- FocusEventpublic java.lang.String getAboutThisBean()
public java.awt.Color getBackground()
public java.util.Calendar getCalendar()
public int getCaretPos()
public java.util.Date getDate()
java.util.Date
that represents
the date/time stored by this spinnerpublic long getDatePartValue()
public java.lang.String getDateString()
public int getDay()
public java.awt.Font getFont()
public java.awt.Color getForeground()
public java.lang.String getFormatString()
public java.lang.String getFormatStringByStyle(int iFormatStyle)
iFormatStyle
- int Style of the format stringpublic FormatStrings getFormatStrings()
public int getFormattingStyle()
public int getHour()
public java.util.Locale getLocale()
setLocale(java.util.Locale)
public java.util.Calendar getMaximum()
public java.util.Calendar getMinimum()
public int getMinute()
public int getMonth()
public int getSecond()
public java.sql.Date getSQLDate()
java.sql.Date
that represents
the date stored by the spinner.public long getTimePartValue()
public java.lang.String getTimeZone()
public long getValue()
public int getYear()
public void initFormatStyle(int iStyle)
iStyle
- intpublic void initMaximum(java.util.Calendar newMaximumCalendar)
newMaximumCalendar
- The maximum as a Calendar.public void initMinimum(java.util.Calendar newMinimumCalendar)
newMinimumCalendar
- The minimum as a Calendar.public boolean isEditable()
true
if this text component is
editable; false
otherwise.setEditable(boolean)
public boolean isEnabled()
setEnabled
method.true
if the component is enabled;
false
otherwise.setEnabled(boolean)
public boolean isOpaque()
An opaque component paints every pixel within its rectangular region. A non-opaque component paints only some of its pixels, allowing the pixels underneath it to "show through". A component that does not fully paint its pixels therefore provides a degree of transparency.
Subclasses that guarantee to always completely paint their contents should override this method and return true.
This method will migrate to java.awt.Component in the next major JDK release
SpinnerGUI.setOpaque(boolean)
public boolean isSpinnable()
true
if this text component is
spinnable; false
otherwise.setSpinnable(boolean)
public boolean isValidateMonthFirst()
setValidateMonthFirst(boolean)
public boolean isWrapAssociated()
public void keyPressed(java.awt.event.KeyEvent e)
e
- KeyEventpublic void keyTyped(java.awt.event.KeyEvent e)
e
- KeyEventpublic void mousePressed(java.awt.event.MouseEvent e)
e
- MouseEventpublic void removeDateChangedListener(DateChangedListener listener)
listener
- The listener to remove.public void scrollDown()
public void scrollUp()
public void setAboutThisBean(java.lang.String aboutThisBean)
newValue
- the special formatted stringpublic void setBackground(java.awt.Color c)
c
- The color to become this component's
background color.getBackground()
public void setCalendar(java.util.Calendar newCalendar)
newCalendar
- the calendar whose time fields will be used to
change the current one.public void setCaretPos(int newCaretPos)
newCaretPos
- the sub-field number of the text. Must be a Calendar constant (i.e. Calendar.YEAR)public void setDate(java.util.Date date)
date
- the new date/time.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 setDatePartValue(long newValue)
newValue
- The date part value as a long.public void setDateString(java.lang.String str)
str
- The new date/time string.public void setDay(int newDays)
newDays
- The date as an int.public void setEditable(boolean aBoolean)
aBoolean
- booleanpublic void setEnabled(boolean b)
b
. An enabled component can respond to user
input and generate events. Components are enabled initially by default.b
- If true
, this component is
enabled; otherwise this component is disabled.isEnabled()
public void setFont(java.awt.Font f)
f
- The font to become this component's font.getFont()
public void setForeground(java.awt.Color c)
c
- The color to become this component's
foreground color.getForeground()
public void setFormatString(java.lang.String newFormatString)
newFormatString
- the new formatting string.public void setFormatStrings(FormatStrings aFS)
aFS
- FormatStrings FormatStrings class, containing formatting strings and active stylepublic void setFormattingStyle(int iNewFormattingStyle)
newFormattingStyle
- the default formatting style.public void setHour(int newHours)
newHours
- The hour as an int.public void setLocale(java.util.Locale newLocale)
locale
- The new value for the property.getLocale()
public void setMaximum(java.util.Calendar newMaximumCalendar)
newMaximumCalendar
- The maximum as a Calendar.public void setMinimum(java.util.Calendar newMinimumCalendar)
newMinimum
- The minimum as a Calendar.public void setMinute(int newMinutes)
newMinutes
- The minute as an int.public void setMonth(int newMonths)
newMonths
- The month values are 0-11, e.g 0 for January, 11 for December.public void setSecond(int newSeconds)
newSeconds
- The second as an int.public void setSpinnable(boolean aBoolean)
aBoolean
- booleanpublic void setTimePartValue(long newValue)
newValue
- The time part value as a long.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 void setValidateMonthFirst(boolean validateMonthFirst)
if
- validateMonthFirst true, month will be validated first.isValidateMonthFirst()
public void setValue(long newValue)
newValue
- The new date/time value as a long.public void setWrapAssociated(boolean b)
b
- if true, the subfields can be wrapped together.public void setYear(int newYears)
newYears
- The year as an int.public void stateChanged(javax.swing.event.ChangeEvent event)
event
- javax.swing.event.ChangeEvent
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |