Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

com::cosylab::gui::components::r2::DateChooser Class Reference

List of all members.

Public Member Functions

 DateChooser ()
Date getDate ()
int getDay ()
int getMonth ()
int getNumberOfYears ()
int getStartingYear ()
int getYear ()
void setDate (Date date)
void setDay (int index)
void setEnabled (boolean how)
void setNumberOfYears (int newNumberOfYears)
void setStartingYear (int newStartingYear)
void setYear (int index)

Static Public Member Functions

void main (String[] args)

Protected Member Functions

void createComponents ()
GridBagConstraints createConstraints (int x, int y, double ratio, int top, int bottom)
void displayDays ()
void setMonth (int index)

Protected Attributes

int startingYear = 2000
JComboBox daySelector = null
JComboBox monthSelector = null
JComboBox yearSelector = null

Private Member Functions

void updateComponents ()

Private Attributes

int numberOfYears = 20
JLabel dayLabel = null
JLabel monthLabel = null
JLabel yearLabel = null
Calendar calendar = null

Detailed Description

This class provides user-friendly entry of dates. The components consists of three combo boxes containing year, month and day values. All values are validated and always display a valid date. This is then provided by getDate and setDate methods. When setting or getting the date from or to java.util.Date class, only YEAR, MONTH and DAY_OF_MONTH properties are set (
See also:
java.util.Calendar). GregorianCalendar class is used to calculate the dates. Since only the number of years is unlimited, it is set to 20 by default, allowing years 2000 through 2019 inclusively to be chosen. This can, however, be modified. Creation date: (2/4/02 9:53:10 AM)
Author:
:


Constructor & Destructor Documentation

com::cosylab::gui::components::r2::DateChooser::DateChooser  )  [inline]
 

Creates a new DateChooser.


Member Function Documentation

void com::cosylab::gui::components::r2::DateChooser::createComponents  )  [inline, protected]
 

Creates and layouts the components that represent this panel. Creation date: (2/4/02 9:56:24 AM)

GridBagConstraints com::cosylab::gui::components::r2::DateChooser::createConstraints int  x,
int  y,
double  ratio,
int  top,
int  bottom
[inline, protected]
 

Internal helper routine returns GridBagConstraints object.

Creation date: (2/4/02 9:57:12 AM)

Returns:
java.awt.GridBagConstraints
Parameters:
x int
y int
ratio double

void com::cosylab::gui::components::r2::DateChooser::displayDays  )  [inline, protected]
 

Internal helper routine updates the correct number of days for the selected month.

Creation date: (2/4/02 10:37:59 AM)

Date com::cosylab::gui::components::r2::DateChooser::getDate  )  [inline]
 

Returns the currently selected date as java.util.Date. Creation date: (2/4/02 12:35:43 PM)

Returns:
java.util.Date

int com::cosylab::gui::components::r2::DateChooser::getDay  )  [inline]
 

Returns number of the selected day in current month, starting with 1. Creation date: (2/4/02 10:58:33 AM)

Returns:
int

int com::cosylab::gui::components::r2::DateChooser::getMonth  )  [inline]
 

Returns the index of the currently selected month starting with 1. Creation date: (2/4/02 10:56:46 AM)

Returns:
int

int com::cosylab::gui::components::r2::DateChooser::getNumberOfYears  )  [inline]
 

Returns the number of year to display in the year selector.

Creation date: (2/10/2002 18:12:00)

Returns:
int

int com::cosylab::gui::components::r2::DateChooser::getStartingYear  )  [inline]
 

Returns the starting year to display in the year selector. No year lower than this can be selected by the user or set using setDate method.

Creation date: (2/10/2002 18:12:00)

Returns:
int

int com::cosylab::gui::components::r2::DateChooser::getYear  )  [inline]
 

Returns the currently selected year. Creation date: (2/4/02 10:57:25 AM)

Returns:
int

void com::cosylab::gui::components::r2::DateChooser::main String[]  args  )  [inline, static]
 

void com::cosylab::gui::components::r2::DateChooser::setDate Date  date  )  [inline]
 

Sets the date to display. Creation date: (2/4/02 12:36:48 PM)

Parameters:
date java.util.Date

void com::cosylab::gui::components::r2::DateChooser::setDay int  index  )  [inline]
 

Sets the day to the specified index. To ensure compatibility with java.util.Calendar class, first day of month is specified as 1. Creation date: (2/4/02 10:51:15 AM)

Parameters:
index int

void com::cosylab::gui::components::r2::DateChooser::setEnabled boolean  how  )  [inline]
 

Sets the enabled state of this component. If the component is disabled, all the combo boxes are also disabled. Creation date: (2/5/02 5:23:59 PM)

Parameters:
how boolean

void com::cosylab::gui::components::r2::DateChooser::setMonth int  index  )  [inline, protected]
 

Sets the currently selected month. January has the index of 0. Creation date: (2/4/02 10:36:44 AM)

void com::cosylab::gui::components::r2::DateChooser::setNumberOfYears int  newNumberOfYears  )  [inline]
 

Sets the number of years to display in the year selector. User can only select the years shown in the year selector.

Creation date: (2/10/2002 18:19:55)

Parameters:
newNumberOfYears int

void com::cosylab::gui::components::r2::DateChooser::setStartingYear int  newStartingYear  )  [inline]
 

Sets the starting year to be displayed in the year selector. Only the years between startingYear and startingYear+numberOfYears inclusively can be selected by the user or by calling the setDate method.

Creation date: (2/10/2002 18:19:55)

Parameters:
newStartingYear int

void com::cosylab::gui::components::r2::DateChooser::setYear int  index  )  [inline]
 

Sets the currently selected year. Years are specified absolutely, although only years between startingYear and numberOfYears will be displayed. If the year is not within this range, the closest value will be set. Creation date: (2/4/02 11:22:21 AM)

Parameters:
index int

void com::cosylab::gui::components::r2::DateChooser::updateComponents  )  [inline, private]
 

Updates the display after setting the value properties. Creation date: (2/4/02 10:09:05 AM)


Member Data Documentation

Calendar com::cosylab::gui::components::r2::DateChooser::calendar = null [private]
 

JLabel com::cosylab::gui::components::r2::DateChooser::dayLabel = null [private]
 

JComboBox com::cosylab::gui::components::r2::DateChooser::daySelector = null [protected]
 

JLabel com::cosylab::gui::components::r2::DateChooser::monthLabel = null [private]
 

JComboBox com::cosylab::gui::components::r2::DateChooser::monthSelector = null [protected]
 

int com::cosylab::gui::components::r2::DateChooser::numberOfYears = 20 [private]
 

int com::cosylab::gui::components::r2::DateChooser::startingYear = 2000 [protected]
 

JLabel com::cosylab::gui::components::r2::DateChooser::yearLabel = null [private]
 

JComboBox com::cosylab::gui::components::r2::DateChooser::yearSelector = null [protected]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:12:27 2009 for ACS Java API by doxygen 1.3.8