com.sas.swing.visuals
Class CalendarPanel

com.sas.swing.visuals.CalendarPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener

public class CalendarPanel
implements javax.swing.event.ChangeListener, java.beans.PropertyChangeListener

The CalendarPanel class provides a swing-based JPanel that allows the user to view days of the month and select a single day. The panel provides buttons for navigating up and down through days and months, as well as a way to jump to the current date. The selected date is a date (and possibly time) that the user has selected, or that has been specified via the API. It is represented by inverted colors for the day box. The current date (defaults to today when not specified) is the calendar "page" that should be shown in the component. It is merely a navigational setting and doesn't affect the selected date. The calendar also shows an outline (default blue) around the day representing today. An optional time button can be displayed, allowing the user to expand/collapse a time panel. From this panel, the user can view/change a time associated with the date.

See Also:
Serialized Form

Field Summary
protected  java.lang.String accessibleNamePrefix
           
protected  javax.swing.JPanel buttonPanel
           
protected  javax.swing.Icon CALENDAR_CLOCK_ICON
           
static java.lang.String DATE_CHANGED
           
static int DAY_SELECTION
           
protected  int daysInMonth
           
protected  javax.swing.JPanel daysPanel
           
protected  javax.swing.JPanel daysUserContentPanel
           
protected  java.util.GregorianCalendar displayDate
           
protected  javax.swing.Icon DOUBLE_LEFT_ARROW
           
protected  javax.swing.Icon DOUBLE_RIGHT_ARROW
           
protected  boolean enabled
           
static int GO_TO_CURRENT_DATE
          Deprecated. Use GO_TO_TODAY instead.
static int GO_TO_SELECTED_DATE
          Instructs the "go to" button to display the currently selected date.
protected  java.lang.String GO_TO_SELECTED_DATE_TEXT
           
protected  java.lang.String GO_TO_SELECTED_DATE_TOOLTIP
           
static int GO_TO_TODAY
          Instructs the "go to" button to display and select today's date.
protected  java.lang.String GO_TO_TODAY_FMT
           
protected  java.lang.String GO_TO_TODAY_TOOLTIP
           
protected  javax.swing.JButton goToButton
           
protected  int goToMode
           
protected  ComboBox headingMonthComboBox
           
protected  ComboBox headingQuarterComboBox
           
protected  javax.swing.JSpinner headingYearSpinner
           
protected  javax.swing.Icon LEFT_ARROW
           
protected  javax.swing.JPanel mainPanel
           
protected  java.util.GregorianCalendar maxDate
           
protected  java.util.GregorianCalendar minDate
           
protected  int minimalDaysInFirstWeek
           
static int MONTH_SELECTION
           
protected  javax.swing.JPanel monthAndYearPanel
           
protected  javax.swing.JLabel monthLabel
           
protected  javax.swing.JButton nextDisplayMonthButton
           
protected  javax.swing.JButton nextYearButton
           
protected  javax.swing.JButton okButton
           
protected  boolean okClicked
           
protected  javax.swing.JButton prevDisplayMonthButton
           
protected  javax.swing.JButton prevYearButton
           
static int QUARTER_SELECTION
           
protected  javax.swing.JLabel quarterLabel
           
static java.lang.String RB_KEY
           
protected  javax.swing.Icon RIGHT_ARROW
           
protected  java.util.GregorianCalendar selectedDate
           
protected  CalendarDayButton selectedDayButton
           
protected  int selectMode
           
protected  boolean showCalendar
           
protected  boolean showMonthQuarterYearLabels
           
protected  boolean showSeconds
           
protected  boolean showWeekdayHeaders
           
protected  boolean showWeekNumbers
           
static java.lang.String SIZE_CHANGED
           
static java.lang.String TIME_CHANGED
           
protected  java.lang.String TIME_PANEL_TEXT
           
static int TIME_SELECTION
           
protected  javax.swing.JButton timeButton
           
protected  javax.swing.JLabel timeLabel
           
protected  boolean timeMode24Hour
           
protected  javax.swing.JPanel timePanel
           
protected  boolean timePanelVisible
           
protected  javax.swing.JSpinner timeSpinner
           
protected  java.util.TimeZone timeZone
           
protected  java.util.GregorianCalendar todayDate
           
protected  java.text.DateFormat todayDateFormat
           
protected  java.awt.Color todayOutlineColor
           
static java.lang.String VALUE_CHANGED
           
protected  java.util.Vector vectorDays
           
protected  java.util.Vector vectorWeeks
           
static int WEEK_SELECTION
           
static int WEEKDAY_SELECTION
           
protected  java.awt.Font weekdayHeaderFont
           
protected  javax.swing.JPanel weeksPanel
           
protected  int weekStartingDay
           
protected  javax.swing.JLabel yearLabel
           
 
Constructor Summary
CalendarPanel()
          Constructor
CalendarPanel(java.util.GregorianCalendar date)
          Constructor
CalendarPanel(java.util.TimeZone timeZone)
          Constructor taking a TimeZone to use for dates.
 
Method Summary
protected  void addComponents()
          Method to add all the Components
protected  void addDateToSpinnerTime(java.util.GregorianCalendar date)
           
protected  void addSpinnerTimeToDate(java.util.GregorianCalendar date)
           
protected  void dateSelected()
           
 void dispose()
          Method to dispose the _owner (if any)
 void enableTimeButton(boolean enabled)
          Determines whether or not the time (clock) button is enabled (if shown).
 boolean get24HourTime()
          Returns the format of the time display in the time panel (when enabled).
protected  java.util.GregorianCalendar getCalendarWithTimeZone(java.util.GregorianCalendar calendar, java.util.TimeZone timeZone)
          Returns a new calendar that has the same date as the specified calendar and the same time zone as the specified time zone.
 java.util.GregorianCalendar getCurrentDate()
          Returns the currently viewed date (or calendar "page") for this component.
protected  CalendarDayButton getDayButton(int ix)
           
 boolean getEnabled()
          Returns the enabled state of the panel.
protected  int getFirstDayOfWeek(java.util.GregorianCalendar calendar)
          Get the day of the week for the first day in the specified month
 int getGoToButtonMode()
          Gets the current mode of the "Go To" button.
 java.util.GregorianCalendar getMaxDate()
          Method to get the maximum date the can be selected
 java.util.GregorianCalendar getMinDate()
          Method to get the minimun date the can be selected
protected  java.util.GregorianCalendar getNewCalendar()
           
 javax.swing.JButton getOKButton()
          Returns the JButton representing the OK button in the panel.
 java.util.GregorianCalendar getSelectedDate()
          Method to return the selected date
 boolean getShowWeekdayHeaders()
          Returns the visibility of the weekday headers which appear above the grid of days in the month.
 java.util.TimeZone getTimeZone()
          Returns the current time zone for dates that are retrieved from this component.
 java.awt.Color getTodayOutlineColor()
          Returns the color used for the outline for the day representing today.
protected  CalendarDayButton getWeekButton(int ix)
           
protected  void goNextDisplayMonth()
          Method to go to the next Month
protected  void goNextYear()
          Method to go to the next year
protected  void goPrevDisplayMonth()
          Method to go to the prev Month
protected  void goPrevYear()
          Method to go to the prev year
protected  void goToDate()
          Method to go to date (either selected date or today)
 void goToSelectedDate()
          Deprecated. This functionality should no longer be needed.
protected  void init()
           
protected  void initializeUI()
           
protected  void layoutUI()
          layoutUI()
 boolean okClicked()
          Method to see if the ok button was pressed
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void redraw()
          Redraws the components in this panel.
 void set24HourTime(boolean mode)
          Determines the format of the time display in the time panel (when enabled).
 void setAccessibleNamePrefix(java.lang.String prefix)
          Sets the string prefix to use when defining accessible names for all components in this panel.
protected  void setAccessibleNames()
           
 void setCurrentDate(java.util.GregorianCalendar date)
          Sets the currently viewed date (or calendar "page") for this component.
protected  void setDisplayMonth(int monthIndex)
           
protected  void setDisplayQuarter(int quarterIndex)
           
 void setEnabled(boolean enabled)
          Sets the enabled state of the panel.
 void setGoToButtonMode(int mode)
          Sets the "Go To" button to the specified mode.
 void setGoToButtonText(int mode, java.lang.String text, java.lang.String toolTip)
          Provides an override for the text used for the "Go To" button.
 void setMaxDate(java.util.GregorianCalendar aDate)
          Method to set the maximum date the can be selected
 void setMinDate(java.util.GregorianCalendar aDate)
          Method to set the minimun date the can be selected
 void setNextMonthButtonIcon(javax.swing.Icon icon)
          Sets the icon to use for the "next month" button at the top of the panel.
 void setNextYearButtonIcon(javax.swing.Icon icon)
          Sets the icon to use for the "next year" button at the top of the panel.
 void setPrevMonthButtonIcon(javax.swing.Icon icon)
          Sets the icon to use for the "previous month" button at the top of the panel.
 void setPrevYearButtonIcon(javax.swing.Icon icon)
          Sets the icon to use for the "previous year" button at the top of the panel.
 void setSelectedDate(java.util.GregorianCalendar aDate)
          Method to set the selected date
protected  void setSelectedDate(java.util.GregorianCalendar aDate, boolean redraw)
          Method to set the selected date
protected  void setSelectedWeek(java.util.GregorianCalendar aDate, boolean redraw)
          Method to set the selected week
 void setShowWeekdayHeaders(boolean show)
          Sets the visibility of the weekday headers which appear above the grid of days in the month.
 void setTimePanelText(java.lang.String label)
          Provides an override for the text used to preface the time spinner box in the time panel.
 void setTimeZone(java.util.TimeZone timeZone)
          Sets the time zone to use for dates that are retrieved from this component.
 void setTodayDisplayFormat(java.text.DateFormat format)
          Method to set the format of the date shown in the Today button.
 void setTodayOutlineColor(java.awt.Color color)
          Sets the color used for the outline for the day representing today.
 void showOKButton(boolean show)
          Determines whether or not an OK button is displayed in the lower right corner of the panel.
 void showTimeButton(boolean show)
          Determines whether or not the time (clock) button is displayed in the lower right corner of the panel.
 void showTimePanel(boolean show)
          Determines whether or not the time panel is displayed below the calendar days.
 void stateChanged(javax.swing.event.ChangeEvent e)
           
protected  void updateDateComponents()
           
protected  void updateDayComponents()
           
protected  void updateGoToButton()
           
protected  void updateMonthComponents()
           
protected  void updateMonthQuarterYearComponents()
           
protected  void updateQuarterComponents()
           
protected  void updateYearComponents()
           
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

VALUE_CHANGED

public static final java.lang.String VALUE_CHANGED
See Also:
Constant Field Values

DATE_CHANGED

public static final java.lang.String DATE_CHANGED
See Also:
Constant Field Values

TIME_CHANGED

public static final java.lang.String TIME_CHANGED
See Also:
Constant Field Values

SIZE_CHANGED

public static final java.lang.String SIZE_CHANGED
See Also:
Constant Field Values

accessibleNamePrefix

protected java.lang.String accessibleNamePrefix

todayDate

protected java.util.GregorianCalendar todayDate

selectedDate

protected java.util.GregorianCalendar selectedDate

displayDate

protected java.util.GregorianCalendar displayDate

maxDate

protected java.util.GregorianCalendar maxDate

minDate

protected java.util.GregorianCalendar minDate

timeZone

protected java.util.TimeZone timeZone

selectedDayButton

protected CalendarDayButton selectedDayButton

todayDateFormat

protected java.text.DateFormat todayDateFormat

weekdayHeaderFont

protected java.awt.Font weekdayHeaderFont

monthAndYearPanel

protected javax.swing.JPanel monthAndYearPanel

daysPanel

protected javax.swing.JPanel daysPanel

weeksPanel

protected javax.swing.JPanel weeksPanel

mainPanel

protected javax.swing.JPanel mainPanel

buttonPanel

protected javax.swing.JPanel buttonPanel

timePanel

protected javax.swing.JPanel timePanel

daysUserContentPanel

protected javax.swing.JPanel daysUserContentPanel

LEFT_ARROW

protected javax.swing.Icon LEFT_ARROW

RIGHT_ARROW

protected javax.swing.Icon RIGHT_ARROW

DOUBLE_LEFT_ARROW

protected javax.swing.Icon DOUBLE_LEFT_ARROW

DOUBLE_RIGHT_ARROW

protected javax.swing.Icon DOUBLE_RIGHT_ARROW

CALENDAR_CLOCK_ICON

protected javax.swing.Icon CALENDAR_CLOCK_ICON

GO_TO_SELECTED_DATE_TEXT

protected java.lang.String GO_TO_SELECTED_DATE_TEXT

GO_TO_SELECTED_DATE_TOOLTIP

protected java.lang.String GO_TO_SELECTED_DATE_TOOLTIP

GO_TO_TODAY_FMT

protected java.lang.String GO_TO_TODAY_FMT

GO_TO_TODAY_TOOLTIP

protected java.lang.String GO_TO_TODAY_TOOLTIP

TIME_PANEL_TEXT

protected java.lang.String TIME_PANEL_TEXT

nextYearButton

protected javax.swing.JButton nextYearButton

prevYearButton

protected javax.swing.JButton prevYearButton

prevDisplayMonthButton

protected javax.swing.JButton prevDisplayMonthButton

nextDisplayMonthButton

protected javax.swing.JButton nextDisplayMonthButton

goToButton

protected javax.swing.JButton goToButton

timeButton

protected javax.swing.JButton timeButton

okButton

protected javax.swing.JButton okButton

monthLabel

protected javax.swing.JLabel monthLabel

quarterLabel

protected javax.swing.JLabel quarterLabel

yearLabel

protected javax.swing.JLabel yearLabel

headingMonthComboBox

protected ComboBox headingMonthComboBox

headingQuarterComboBox

protected ComboBox headingQuarterComboBox

headingYearSpinner

protected javax.swing.JSpinner headingYearSpinner

timeLabel

protected javax.swing.JLabel timeLabel

timeSpinner

protected javax.swing.JSpinner timeSpinner

goToMode

protected int goToMode

GO_TO_TODAY

public static final int GO_TO_TODAY
Instructs the "go to" button to display and select today's date.

See Also:
Constant Field Values

GO_TO_CURRENT_DATE

public static final int GO_TO_CURRENT_DATE
Deprecated. Use GO_TO_TODAY instead.
See Also:
Constant Field Values

GO_TO_SELECTED_DATE

public static final int GO_TO_SELECTED_DATE
Instructs the "go to" button to display the currently selected date.

See Also:
Constant Field Values

enabled

protected boolean enabled

daysInMonth

protected int daysInMonth

okClicked

protected boolean okClicked

showWeekdayHeaders

protected boolean showWeekdayHeaders

vectorDays

protected java.util.Vector vectorDays

timePanelVisible

protected boolean timePanelVisible

timeMode24Hour

protected boolean timeMode24Hour

showSeconds

protected boolean showSeconds

todayOutlineColor

protected java.awt.Color todayOutlineColor

DAY_SELECTION

public static final int DAY_SELECTION
See Also:
Constant Field Values

WEEK_SELECTION

public static final int WEEK_SELECTION
See Also:
Constant Field Values

MONTH_SELECTION

public static final int MONTH_SELECTION
See Also:
Constant Field Values

QUARTER_SELECTION

public static final int QUARTER_SELECTION
See Also:
Constant Field Values

TIME_SELECTION

public static final int TIME_SELECTION
See Also:
Constant Field Values

WEEKDAY_SELECTION

public static final int WEEKDAY_SELECTION
See Also:
Constant Field Values

weekStartingDay

protected int weekStartingDay

minimalDaysInFirstWeek

protected int minimalDaysInFirstWeek

showWeekNumbers

protected boolean showWeekNumbers

showCalendar

protected boolean showCalendar

showMonthQuarterYearLabels

protected boolean showMonthQuarterYearLabels

selectMode

protected int selectMode

vectorWeeks

protected java.util.Vector vectorWeeks
Constructor Detail

CalendarPanel

public CalendarPanel()
Constructor


CalendarPanel

public CalendarPanel(java.util.TimeZone timeZone)
Constructor taking a TimeZone to use for dates.

Parameters:
timeZone - The TimeZone to use.

CalendarPanel

public CalendarPanel(java.util.GregorianCalendar date)
Constructor

Parameters:
date - The current date associated with this panel
Method Detail

init

protected void init()

setAccessibleNamePrefix

public void setAccessibleNamePrefix(java.lang.String prefix)
Sets the string prefix to use when defining accessible names for all components in this panel.

Parameters:
prefix - The string prefix to use.

setAccessibleNames

protected void setAccessibleNames()

setShowWeekdayHeaders

public void setShowWeekdayHeaders(boolean show)
Sets the visibility of the weekday headers which appear above the grid of days in the month.

Parameters:
show - Set to true to show the headers, false otherwise.

getShowWeekdayHeaders

public boolean getShowWeekdayHeaders()
Returns the visibility of the weekday headers which appear above the grid of days in the month.

Returns:
Returns true if the headers are currently visible, false otherwise.

initializeUI

protected void initializeUI()

layoutUI

protected void layoutUI()
                 throws java.lang.Exception
layoutUI()

Throws:
java.lang.Exception

addComponents

protected void addComponents()
Method to add all the Components


updateDateComponents

protected void updateDateComponents()

updateMonthQuarterYearComponents

protected void updateMonthQuarterYearComponents()

updateMonthComponents

protected void updateMonthComponents()

updateQuarterComponents

protected void updateQuarterComponents()

updateYearComponents

protected void updateYearComponents()

updateDayComponents

protected void updateDayComponents()

getDayButton

protected CalendarDayButton getDayButton(int ix)

getWeekButton

protected CalendarDayButton getWeekButton(int ix)

updateGoToButton

protected void updateGoToButton()

setTimeZone

public void setTimeZone(java.util.TimeZone timeZone)
Sets the time zone to use for dates that are retrieved from this component. Note that this doesn't alter the notion of "today" in the display, which will always be in the client's default timezone.

Parameters:
timeZone - The TimeZone to use.
See Also:
getTimeZone()

getTimeZone

public java.util.TimeZone getTimeZone()
Returns the current time zone for dates that are retrieved from this component.

Returns:
The currently defined TimeZone, or null if none defined.
See Also:
setTimeZone(TimeZone)

getCalendarWithTimeZone

protected java.util.GregorianCalendar getCalendarWithTimeZone(java.util.GregorianCalendar calendar,
                                                              java.util.TimeZone timeZone)
Returns a new calendar that has the same date as the specified calendar and the same time zone as the specified time zone. However, the date is not adjusted when moving to the new time zone.

Parameters:
calendar - The calendar with the desired date
timeZone - The desired time zone for the new calendar
Returns:
A new calendar with the specified date and time zone.

getSelectedDate

public java.util.GregorianCalendar getSelectedDate()
Method to return the selected date

Returns:
the date

setSelectedDate

public void setSelectedDate(java.util.GregorianCalendar aDate)
Method to set the selected date

Parameters:
aDate - the date that you want to be selected

setSelectedDate

protected void setSelectedDate(java.util.GregorianCalendar aDate,
                               boolean redraw)
Method to set the selected date

Parameters:
aDate - the date that you want to be selected
redraw - Set to true to redraw the calendar, false otherwise

setSelectedWeek

protected void setSelectedWeek(java.util.GregorianCalendar aDate,
                               boolean redraw)
Method to set the selected week

Parameters:
aDate - the date that belongs to the week that you want to be selected
redraw - Set to true to redraw the calendar, false otherwise

getCurrentDate

public java.util.GregorianCalendar getCurrentDate()
Returns the currently viewed date (or calendar "page") for this component.

Returns:
The currently viewed date.

setCurrentDate

public void setCurrentDate(java.util.GregorianCalendar date)
Sets the currently viewed date (or calendar "page") for this component.

Parameters:
date - The currently viewed date.

getMaxDate

public java.util.GregorianCalendar getMaxDate()
Method to get the maximum date the can be selected

Returns:
max date

setMaxDate

public void setMaxDate(java.util.GregorianCalendar aDate)
Method to set the maximum date the can be selected

Parameters:
aDate - max date

getMinDate

public java.util.GregorianCalendar getMinDate()
Method to get the minimun date the can be selected

Returns:
minimun date

setMinDate

public void setMinDate(java.util.GregorianCalendar aDate)
Method to set the minimun date the can be selected

Parameters:
aDate - min date

okClicked

public boolean okClicked()
Method to see if the ok button was pressed

Returns:
boolean

setTodayDisplayFormat

public void setTodayDisplayFormat(java.text.DateFormat format)
Method to set the format of the date shown in the Today button.

Parameters:
format - The DateFormat to use for the date display.

goToDate

protected void goToDate()
Method to go to date (either selected date or today)


goToSelectedDate

public void goToSelectedDate()
Deprecated. This functionality should no longer be needed.

Method to go to the selected date


goPrevDisplayMonth

protected void goPrevDisplayMonth()
Method to go to the prev Month


goNextDisplayMonth

protected void goNextDisplayMonth()
Method to go to the next Month


goPrevYear

protected void goPrevYear()
Method to go to the prev year


goNextYear

protected void goNextYear()
Method to go to the next year


dateSelected

protected void dateSelected()

getFirstDayOfWeek

protected int getFirstDayOfWeek(java.util.GregorianCalendar calendar)
Get the day of the week for the first day in the specified month

Returns:
int the day number

dispose

public void dispose()
Method to dispose the _owner (if any)


setPrevYearButtonIcon

public void setPrevYearButtonIcon(javax.swing.Icon icon)
Sets the icon to use for the "previous year" button at the top of the panel.

Parameters:
icon - The icon to use.

setNextYearButtonIcon

public void setNextYearButtonIcon(javax.swing.Icon icon)
Sets the icon to use for the "next year" button at the top of the panel.

Parameters:
icon - The icon to use.

setPrevMonthButtonIcon

public void setPrevMonthButtonIcon(javax.swing.Icon icon)
Sets the icon to use for the "previous month" button at the top of the panel.

Parameters:
icon - The icon to use.

setNextMonthButtonIcon

public void setNextMonthButtonIcon(javax.swing.Icon icon)
Sets the icon to use for the "next month" button at the top of the panel.

Parameters:
icon - The icon to use.

setDisplayMonth

protected void setDisplayMonth(int monthIndex)

setDisplayQuarter

protected void setDisplayQuarter(int quarterIndex)

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

addSpinnerTimeToDate

protected void addSpinnerTimeToDate(java.util.GregorianCalendar date)

addDateToSpinnerTime

protected void addDateToSpinnerTime(java.util.GregorianCalendar date)

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

getOKButton

public javax.swing.JButton getOKButton()
Returns the JButton representing the OK button in the panel.

Returns:
The JButton instance for the OK button.

showOKButton

public void showOKButton(boolean show)
Determines whether or not an OK button is displayed in the lower right corner of the panel. The default value is false.

Parameters:
show - Set to true to display the OK button, false otherwise.

showTimeButton

public void showTimeButton(boolean show)
Determines whether or not the time (clock) button is displayed in the lower right corner of the panel. When clicked, this button will reveal/hide a panel below the calendar days, displaying a time associated with a date. The default value is false.

Parameters:
show - Set to true to display the Time button, false otherwise.

enableTimeButton

public void enableTimeButton(boolean enabled)
Determines whether or not the time (clock) button is enabled (if shown).

Parameters:
enabled - Set to true to enable the button, false otherwise.

showTimePanel

public void showTimePanel(boolean show)
Determines whether or not the time panel is displayed below the calendar days. This panel shows a time associated with a date, and can allow the user to change the time.

Parameters:
show - Set to true to display the panel, false otherwise.

get24HourTime

public boolean get24HourTime()
Returns the format of the time display in the time panel (when enabled).

Returns:
True if 24-hr time display is displayed, false otherwise.

set24HourTime

public void set24HourTime(boolean mode)
Determines the format of the time display in the time panel (when enabled). When enabled, the time format will be shown in 24-hr (military) mode, otherwise it will be shown in 12-hr mode with appropriate AM/PM designator. The default is false (12-hr mode).

Parameters:
mode - True if 24-hr time display is desired, false otherwise.

setGoToButtonMode

public void setGoToButtonMode(int mode)
Sets the "Go To" button to the specified mode. Valid modes are: GO_TO_TODAY: The button displays today's date and displays/selects "today" when pressed. GO_TO_SELECTED_DATE: The button takes the user to the currently selected date (if one) when pressed. Default is GO_TO_TODAY.

Parameters:
mode - The mode to set for the "Go To" button.

getGoToButtonMode

public int getGoToButtonMode()
Gets the current mode of the "Go To" button.

Returns:
The current mode, either GO_TO_TODAY or GO_TO_SELECTED_DATE.

setGoToButtonText

public void setGoToButtonText(int mode,
                              java.lang.String text,
                              java.lang.String toolTip)
Provides an override for the text used for the "Go To" button. Specify the "Go To" button's mode to override, and the new text and (optional) tool tip.

Parameters:
mode - Change text for the specified mode, either GO_TO_TODAY or GO_TO_SELECTED_DATE.
text - The new text of the button. You can include {0} in the text for the GO_TO_TODAY mode and today's date will be substituted in its place.
toolTip - The new tool tip text for the button.

setTimePanelText

public void setTimePanelText(java.lang.String label)
Provides an override for the text used to preface the time spinner box in the time panel.

Parameters:
label - The new text to use for the label.

getEnabled

public boolean getEnabled()
Returns the enabled state of the panel.

Returns:
True if the panel is enabled, false otherwise.

setEnabled

public void setEnabled(boolean enabled)
Sets the enabled state of the panel. When disabled, components are greyed out and do not accept user input. The default value is enabled (true).

Overrides:
setEnabled in class javax.swing.JComponent
Parameters:
enabled - True if the panel should be enabled, false otherwise.

setTodayOutlineColor

public void setTodayOutlineColor(java.awt.Color color)
Sets the color used for the outline for the day representing today.

Parameters:
color - The color to use for the outline

getTodayOutlineColor

public java.awt.Color getTodayOutlineColor()
Returns the color used for the outline for the day representing today.

Returns:
The color used for the outline.

getNewCalendar

protected java.util.GregorianCalendar getNewCalendar()
Returns:

redraw

public void redraw()
Redraws the components in this panel.




Copyright © 2009 SAS Institute Inc. All Rights Reserved.