com.sun.lwuit
Class Calendar
java.lang.Object
com.sun.lwuit.Component
com.sun.lwuit.Container
com.sun.lwuit.Calendar
- All Implemented Interfaces:
- Animated, MatteEnabled, StyleListener
- public class Calendar
- extends Container
Date widget for selecting a date/time value.
To localize strings for month names
use the values "Calendar.Month" in the resource localization e.g. "Calendar.Jan", "Calendar.Feb" etc...
Constructor Summary |
Calendar()
Constructs a calendar with the current date and time. |
Calendar(long time)
Creates a new instance of Calendar set to the given date based on time
since epoch (the java.util.Date convention). |
Method Summary |
void |
addActionListener(ActionListener l)
Fires when a change is made to the month view of this component. |
Date |
getDate()
Return the date object matching the current selection. |
Style |
getMonthViewStyle()
Sets the style of the month view component within the calendar. |
long |
getSelectedDay()
Returns the time for the current calendar. |
protected String |
getUIID()
Unique identifier for a component, must be overriden for a component so
a style can be applied to the component. |
void |
paint(Graphics g)
This method paints the Component on the screen, it should be overriden
by subclasses to perform custom drawing or invoke the UI API's to let
the PLAF perform the rendering. |
void |
refreshTheme()
Makes sure the component is up to date with the current style object. |
void |
removeActionListener(ActionListener l)
Fires when a change is made to the month view of this component. |
void |
setMonthViewStyle(Style s)
Sets the style of the month view component within the calendar. |
void |
setStyle(Style s)
Changes the Component Style by replacing the Component Style with the given Style. |
Methods inherited from class com.sun.lwuit.Container |
addComponent, addComponent, addComponent, calcPreferredSize, contains, doLayout, getComponentAt, getComponentAt, getComponentCount, getComponentIndex, getLayout, getLayoutHeight, getLayoutWidth, getMatte, invalidate, isScrollableX, isScrollableY, layoutContainer, paramString, pointerPressed, removeAll, removeComponent, replace, revalidate, scrollComponentToVisible, setCellRenderer, setLayout, setMatte, setScrollable, setScrollableX, setScrollableY, setShouldCalcPreferredSize |
Methods inherited from class com.sun.lwuit.Component |
addFocusListener, animate, contains, deinitialize, fireClicked, getAbsoluteX, getAbsoluteY, getAnimationMode, getBaseline, getBaselineResizeBehavior, getBorder, getBottomGap, getBounds, getClientProperty, getComponentForm, getDelay, getHeight, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPosition, getPreferredSize, getRepetitionMode, getScrollAnimationSpeed, getScrollX, getScrollY, getSideGap, getStyle, getWidth, getX, getY, handlesInput, hasFocus, initComponent, isEnabled, isFocusable, isFocusPainted, isInitialized, isRunning, isScrollable, isScrollVisible, isSelectableInteraction, isSmoothScrolling, isVisible, jumpTo, keyPressed, keyReleased, keyRepeated, longKeyPress, paintBackground, paintBackgrounds, paintBorder, paintComponent, paintComponent, paintScrollbars, paintScrollbarX, paintScrollbarY, pointerDragged, pointerReleased, putClientProperty, refreshTheme, removeFocusListener, repaint, repaint, requestFocus, scrollRectToVisible, setAnimationMode, setDelay, setEnabled, setFocus, setFocusable, setFocusPainted, setHandlesInput, setHeight, setInitialized, setIsScrollVisible, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredSize, setRepetitionMode, setScrollAnimationSpeed, setScrollX, setScrollY, setSize, setSmoothScrolling, setVisible, setWidth, setX, setY, start, stop, styleChanged, toString |
month
protected Label month
- The month.
year
protected Label year
- The year.
Calendar
public Calendar(long time)
- Creates a new instance of Calendar set to the given date based on time
since epoch (the java.util.Date convention).
- Parameters:
time
- time since epoch
Calendar
public Calendar()
- Constructs a calendar with the current date and time.
getUIID
protected String getUIID()
- Description copied from class:
Component
- Unique identifier for a component, must be overriden for a component so
a style can be applied to the component.
- Overrides:
getUIID
in class Container
getSelectedDay
public long getSelectedDay()
- Returns the time for the current calendar.
- Returns:
- the time for the current calendar.
getDate
public Date getDate()
- Return the date object matching the current selection.
- Returns:
- the date object matching the current selection
paint
public void paint(Graphics g)
- Description copied from class:
Component
- This method paints the Component on the screen, it should be overriden
by subclasses to perform custom drawing or invoke the UI API's to let
the PLAF perform the rendering.
- Specified by:
paint
in interface Animated
- Overrides:
paint
in class Container
refreshTheme
public void refreshTheme()
- Description copied from class:
Component
- Makes sure the component is up to date with the current style object.
- Overrides:
refreshTheme
in class Container
setStyle
public void setStyle(Style s)
- Description copied from class:
Component
- Changes the Component Style by replacing the Component Style with the given Style.
- Overrides:
setStyle
in class Component
- Parameters:
s
- the component Style object- See Also:
Component.getStyle()
setMonthViewStyle
public void setMonthViewStyle(Style s)
- Sets the style of the month view component within the calendar.
- Parameters:
s
- a Style object specifying the month view style value- See Also:
getMonthViewStyle()
getMonthViewStyle
public Style getMonthViewStyle()
- Sets the style of the month view component within the calendar.
- Returns:
- a Style object representing the month view style value
- See Also:
setMonthViewStyle(com.sun.lwuit.plaf.Style)
addActionListener
public void addActionListener(ActionListener l)
- Fires when a change is made to the month view of this component.
- Parameters:
l
- an ActionListener object- See Also:
removeActionListener(com.sun.lwuit.events.ActionListener)
removeActionListener
public void removeActionListener(ActionListener l)
- Fires when a change is made to the month view of this component.
- Parameters:
l
- an ActionListener object- See Also:
addActionListener(com.sun.lwuit.events.ActionListener)
Copyright © 2008 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.
U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.
DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
Use of this document is subject to license terms.