Java DTV API 1.3
18-Nov-2009

com.sun.dtv.lwuit
Class Calendar

java.lang.Object
  extended by com.sun.dtv.lwuit.Component
      extended by com.sun.dtv.lwuit.Container
          extended by com.sun.dtv.lwuit.Calendar
All Implemented Interfaces:
Animation, StyleListener, Animated, MatteEnabled

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...


Field Summary
 
Fields inherited from class com.sun.dtv.lwuit.Component
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP
 
Fields inherited from interface com.sun.dtv.ui.Animated
ALTERNATING, LOOP, REPEATING
 
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.
 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.dtv.lwuit.Container
addComponent, addComponent, addComponent, contains, doLayout, getComponentAt, getComponentAt, getComponentCount, getComponentIndex, getLayout, getLayoutHeight, getLayoutWidth, getMatte, invalidate, isScrollableX, isScrollableY, layoutContainer, pointerPressed, removeAll, removeComponent, replace, revalidate, scrollComponentToVisible, setCellRenderer, setLayout, setMatte, setScrollable, setScrollableX, setScrollableY
 
Methods inherited from class com.sun.dtv.lwuit.Component
addFocusListener, animate, calcPreferredSize, contains, deinitialize, getAbsoluteX, getAbsoluteY, getAnimationMode, getBaseline, getBaselineResizeBehavior, getBottomGap, getBounds, getClientProperty, getComponentForm, getDelay, getHeight, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPosition, getPreferredSize, getRepetitionMode, getScrollAnimationSpeed, getScrollX, getScrollY, getSideGap, getStyle, getUIID, getWidth, getX, getY, handlesInput, hasFocus, initialize, isEnabled, isFocusable, isFocusPainted, isInitialized, isRunning, isScrollVisible, isSmoothScrolling, isVisible, jumpTo, keyPressed, keyReleased, keyRepeated, longKeyPress, paintBackgrounds, paintComponent, paintComponent, pointerDragged, pointerReleased, putClientProperty, removeFocusListener, repaint, repaint, requestFocus, scrollRectToVisible, setAnimationMode, setDelay, setEnabled, setFocus, setFocusable, setFocusPainted, setHandlesInput, setHeight, setInitialized, setIsScrollVisible, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredSize, setRepetitionMode, setScrollAnimationSpeed, setScrollX, setScrollY, setShouldCalcPreferredSize, setSize, setSmoothScrolling, setUIID, setVisible, setWidth, setX, setY, start, stop, styleChanged, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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.

Method Detail

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 Animation
Overrides:
paint in class Container
Parameters:
g - the component graphics

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.dtv.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.dtv.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.dtv.lwuit.events.ActionListener)

Java DTV API 1.3
18-Nov-2009

Copyright © 2008-2009 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.