com.jp.comp.calendar
Interface CalendarInterface

All Known Implementing Classes:
CalendarAdapter, CalendarPanel, DateField

public interface CalendarInterface

CalendarInterface is an interface which is implemented by CalendarPanel, MonthCalendarPanel, MultipleMonthCalendarPanel and DateField to have a unified access to all types of the Calendar. It includes base properties and methods.

See Also:
CalendarPanel, MonthCalendarPanel, MultipleMonthCalendarPanel, DateField

Method Summary
 void addActionListener(java.awt.event.ActionListener aListener)
          Adds action listener
 void addCalendarDateListener(CalendarDateListener aListener)
          Adds Calendar Date listener.
 void addCalendarDayRendererListener(CalendarDayRendererListener aListener)
          Adds Calendar's day renderer listener.
 void addCalendarListener(CalendarListener aListener)
          Adds Calendar's listener
 java.awt.Color getBackground()
          Returns Calendar's background Color
 CalendarController getCalendarController()
          Returns a particular CalendarController instance
 CalendarDayRenderer getCalendarDayRenderer()
          Returns a particular CalendarDayRenderer instance
 java.util.Date getDate()
          Returns selected Date
 int getDayOfMonth()
          Returns selected day of month
 java.awt.Color getForeground()
          Returns Calendar's foreground Color
 java.awt.Color getHeaderForeground()
          Returns Calendar's header (names of the days of the week) foreground Color
 java.util.Locale getLocale()
          Returns Calendar's Locale
 int getMonth()
          Returns selected month number (0 - 11)
 java.awt.Color getOffMonthWeekdayBackground()
          Returns off-month weekday background Color
 java.awt.Color getOffMonthWeekdayForeground()
          Returns off-month weekday foreground Color
 java.awt.Color getOffMonthWeekendBackground()
          Returns off-month weekend background Color
 java.awt.Color getOffMonthWeekendForeground()
          Returns off-month weekend foreground Color
 java.awt.Color getTodayBorderColor()
          Returns Calendar's today's date border Color
 int getTodayBorderThickness()
          Returns Calendar's today's date border thickness.
 java.awt.Color getWeekendBackground()
          Returns current month's weekend background Color
 java.awt.Color getWeekendForeground()
          Returns current month's weekend foreground Color
 int getYear()
          Returns selected year
 boolean isAllowSelectOffMonthDays()
          Returns true if off-month days can be selected
 boolean isPreserveCurrentDate()
          Returns true if the current date should be preserved when disabled off-month day was selected.
 boolean isShortDayCaption()
          Returns true if short day caption is shown
 boolean isShowGrid()
          Returns true if the Calendar draws grid around days, false if it doesn't.
 boolean isShowHorizontalLines()
          Returns true if the Calendar draws horizontal lines between days, false if it doesn't.
 boolean isShowOffMonthDays()
          Returns true if off-month days are shown
 boolean isShowVerticalLines()
          Returns true if the Calendar draws vertical lines between days, false if it doesn't.
 void removeActionListener(java.awt.event.ActionListener aListener)
          Removes action listener
 void removeCalendarDateListener(CalendarDateListener aListener)
          Removes Calendar Date listener
 void removeCalendarDayRendererListener(CalendarDayRendererListener aListener)
          Removes Calendar's day renderer listener
 void removeCalendarListener(CalendarListener aListener)
          Removes Calendar's listener
 void setAllowSelectOffMonthDays(boolean aFlag)
          Sets whether off-month days can be selected.
 void setBackground(java.awt.Color aColor)
          Sets Calendar's background Color
 void setCalendarController(CalendarController aCalendarControler)
          Sets the CalendarController to be used by the Calendar to perform navigation
 void setCalendarDayRenderer(CalendarDayRenderer aCalendarDayRenderer)
          Sets the CalendarDayRenderer to be used by the Calendar to display Calendar's days in a particular way
 void setDate(java.util.Date aDate)
          Sets a new Date
 void setForeground(java.awt.Color aColor)
          Sets Calendar's foreground Color
 void setHeaderForeground(java.awt.Color aHeaderForeground)
          Sets Calendar's header (names of the days of the week) foreground Color
 void setLocale(java.util.Locale aLocale)
          Sets a new Calendar's Locale.
 void setOffMonthWeekdayBackground(java.awt.Color anOffMonthWeekdayBackground)
          Sets off-month weekday background Color
 void setOffMonthWeekdayForeground(java.awt.Color anOffMonthWeekdayForeground)
          Sets off-month weekday foreground Color
 void setOffMonthWeekendBackground(java.awt.Color anOffMonthWeekendBackground)
          Sets off-month weekend background Color
 void setOffMonthWeekendForeground(java.awt.Color anOffMonthWeekendForeground)
          Sets off-month weekend foreground Color
 void setPreserveCurrentDate(boolean aFlag)
          Sets true if the current date should be preserved.
 void setShortDayCaption(boolean aShortDayCaption)
          Sets whether short day caption should be shown.
 void setShowGrid(boolean aFlag)
          Sets whether the Calendar draws grid lines around cells.
 void setShowHorizontalLines(boolean aFlag)
          Sets whether the Calendar draws horizontal lines between days.
 void setShowOffMonthDays(boolean aFlag)
          Sets whether off-month days should be shown.
 void setShowVerticalLines(boolean aFlag)
          Sets whether the Calendar draws vertical lines between days.
 void setTodayBorderColor(java.awt.Color aColor)
          Sets Calendar's today's date border Color
 void setTodayBorderThickness(int aThickness)
          Sets Calendar's today's date border thickness
 void setWeekendBackground(java.awt.Color aWeekendBackground)
          Sets current month's weekend background Color
 void setWeekendForeground(java.awt.Color aWeekendForeground)
          Sets current month's weekend foreground Color
 

Method Detail

getCalendarDayRenderer

public CalendarDayRenderer getCalendarDayRenderer()
Returns a particular CalendarDayRenderer instance

Returns:
a particular CalendarDayRenderer instance

setCalendarDayRenderer

public void setCalendarDayRenderer(CalendarDayRenderer aCalendarDayRenderer)
Sets the CalendarDayRenderer to be used by the Calendar to display Calendar's days in a particular way

Parameters:
aCalendarDayRenderer - CalendarDayRenderer
See Also:
CalendarDayRenderer

getCalendarController

public CalendarController getCalendarController()
Returns a particular CalendarController instance

Returns:
a particular CalendarController instance

setCalendarController

public void setCalendarController(CalendarController aCalendarControler)
Sets the CalendarController to be used by the Calendar to perform navigation

Parameters:
aCalendarControler - CalendarController
See Also:
CalendarController

getBackground

public java.awt.Color getBackground()
Returns Calendar's background Color

Returns:
Calendar's background Color

setBackground

public void setBackground(java.awt.Color aColor)
Sets Calendar's background Color

Parameters:
aColor - background Color

getForeground

public java.awt.Color getForeground()
Returns Calendar's foreground Color

Returns:
Calendar's foreground Color

setForeground

public void setForeground(java.awt.Color aColor)
Sets Calendar's foreground Color

Parameters:
aColor - foreground Color

getDate

public java.util.Date getDate()
Returns selected Date

Returns:
selected Date

setDate

public void setDate(java.util.Date aDate)
Sets a new Date

Parameters:
aDate - a new Date

getDayOfMonth

public int getDayOfMonth()
Returns selected day of month

Returns:
selected day of month

getMonth

public int getMonth()
Returns selected month number (0 - 11)

Returns:
selected month number

getYear

public int getYear()
Returns selected year

Returns:
selected year

getLocale

public java.util.Locale getLocale()
Returns Calendar's Locale

Returns:
Calendar's Locale

setLocale

public void setLocale(java.util.Locale aLocale)
Sets a new Calendar's Locale. The change of the Calendar's Locale will change navigation buttons tool tip text and caption, days appearance and weekday names and their order. By default Default Locale is used.

Parameters:
aLocale - a new Calendar's Locale

isShortDayCaption

public boolean isShortDayCaption()
Returns true if short day caption is shown

Returns:
true if short day caption is shown
See Also:
setShortDayCaption(boolean)

setShortDayCaption

public void setShortDayCaption(boolean aShortDayCaption)
Sets whether short day caption should be shown. If true only one letter from the name of the day of the week will be shown, otherwise default short name will be shown. It may be 1-3 letters.

Parameters:
aShortDayCaption - true if short day caption should be shown

isShowVerticalLines

public boolean isShowVerticalLines()
Returns true if the Calendar draws vertical lines between days, false if it doesn't. The default is false.

Returns:
true if the table draws vertical lines between days, false if it doesn't

setShowVerticalLines

public void setShowVerticalLines(boolean aFlag)
Sets whether the Calendar draws vertical lines between days. If aFlag is true it does; if it is false it doesn't. Change of this propery may affect the result of the method isShowGrid.

Parameters:
aFlag - true if the Calendar view should draw vertical lines
See Also:
setShowGrid(boolean)

isShowHorizontalLines

public boolean isShowHorizontalLines()
Returns true if the Calendar draws horizontal lines between days, false if it doesn't. The default is flase.

Returns:
true if the Calendar draws horizontal lines between days, false if it doesn't

setShowHorizontalLines

public void setShowHorizontalLines(boolean aFlag)
Sets whether the Calendar draws horizontal lines between days. If aFlag is true it does; if it is false it doesn't. Change of this propery may affect the result of the method isShowGrid

Parameters:
aFlag - true if the Calendar view should draw horizontal lines
See Also:
setShowGrid(boolean)

isShowGrid

public boolean isShowGrid()
Returns true if the Calendar draws grid around days, false if it doesn't. The default is false.

Returns:
true if the Calendar draws grid around days, false if it doesn't

setShowGrid

public void setShowGrid(boolean aFlag)
Sets whether the Calendar draws grid lines around cells. If aFlag is true it does; if it is false it doesn't. Change of this propery will affect the result of the methods isShowVerticalLines and setShowHorizontalLines

Parameters:
aFlag - true if the Calendar should draw grid lines
See Also:
setShowVerticalLines(boolean), setShowHorizontalLines(boolean)

isShowOffMonthDays

public boolean isShowOffMonthDays()
Returns true if off-month days are shown

Returns:
true if off-month days are shown
See Also:
setShowOffMonthDays(boolean)

setShowOffMonthDays

public void setShowOffMonthDays(boolean aFlag)
Sets whether off-month days should be shown. If true off-month days (outside of current month) of previous and next months are shown, otherwise not. Change of this propery will affect the result of the method isAllowSelectOffMonthDays

Parameters:
aFlag - true if off-month days should be shown
See Also:
setAllowSelectOffMonthDays(boolean)

isAllowSelectOffMonthDays

public boolean isAllowSelectOffMonthDays()
Returns true if off-month days can be selected

Returns:
true if off-month days can be selected
See Also:
setAllowSelectOffMonthDays(boolean)

setAllowSelectOffMonthDays

public void setAllowSelectOffMonthDays(boolean aFlag)
Sets whether off-month days can be selected. If true off-month days (outside of current month) of previous and next months can be selected, otherwise not. Change of this propery will affect the result of the method isShowOffMonthDays

Parameters:
aFlag - true if off-month days can be selected
See Also:
setShowOffMonthDays(boolean)

getOffMonthWeekdayForeground

public java.awt.Color getOffMonthWeekdayForeground()
Returns off-month weekday foreground Color

Returns:
off-month weekday foreground Color

setOffMonthWeekdayForeground

public void setOffMonthWeekdayForeground(java.awt.Color anOffMonthWeekdayForeground)
Sets off-month weekday foreground Color

Parameters:
anOffMonthWeekdayForeground - off-month weekday foreground Color

getOffMonthWeekdayBackground

public java.awt.Color getOffMonthWeekdayBackground()
Returns off-month weekday background Color

Returns:
off-month weekday background Color

setOffMonthWeekdayBackground

public void setOffMonthWeekdayBackground(java.awt.Color anOffMonthWeekdayBackground)
Sets off-month weekday background Color

Parameters:
anOffMonthWeekdayBackground - off-month weekday background Color

getOffMonthWeekendForeground

public java.awt.Color getOffMonthWeekendForeground()
Returns off-month weekend foreground Color

Returns:
off-month weekend foreground Color

setOffMonthWeekendForeground

public void setOffMonthWeekendForeground(java.awt.Color anOffMonthWeekendForeground)
Sets off-month weekend foreground Color

Parameters:
anOffMonthWeekendForeground - off-month weekend foreground Color

getOffMonthWeekendBackground

public java.awt.Color getOffMonthWeekendBackground()
Returns off-month weekend background Color

Returns:
off-month weekend background Color

setOffMonthWeekendBackground

public void setOffMonthWeekendBackground(java.awt.Color anOffMonthWeekendBackground)
Sets off-month weekend background Color

Parameters:
anOffMonthWeekendBackground - off-month weekend background Color

getWeekendForeground

public java.awt.Color getWeekendForeground()
Returns current month's weekend foreground Color

Returns:
current month's weekend foreground Color

setWeekendForeground

public void setWeekendForeground(java.awt.Color aWeekendForeground)
Sets current month's weekend foreground Color

Parameters:
aWeekendForeground - current month's weekend foreground Color

getWeekendBackground

public java.awt.Color getWeekendBackground()
Returns current month's weekend background Color

Returns:
current month's weekend background Color

setWeekendBackground

public void setWeekendBackground(java.awt.Color aWeekendBackground)
Sets current month's weekend background Color

Parameters:
aWeekendBackground - current month's weekend background Color

getHeaderForeground

public java.awt.Color getHeaderForeground()
Returns Calendar's header (names of the days of the week) foreground Color

Returns:
Calendar's header foreground Color

setHeaderForeground

public void setHeaderForeground(java.awt.Color aHeaderForeground)
Sets Calendar's header (names of the days of the week) foreground Color

Parameters:
aHeaderForeground - Calendar's header foreground Color

getTodayBorderThickness

public int getTodayBorderThickness()
Returns Calendar's today's date border thickness. The default is 1

Returns:
Calendar's today's date border thickness

setTodayBorderThickness

public void setTodayBorderThickness(int aThickness)
Sets Calendar's today's date border thickness

Parameters:
aThickness - Calendar's today's date border thickness

getTodayBorderColor

public java.awt.Color getTodayBorderColor()
Returns Calendar's today's date border Color

Returns:
Calendar's today's date border Color

setTodayBorderColor

public void setTodayBorderColor(java.awt.Color aColor)
Sets Calendar's today's date border Color

Parameters:
aColor - Calendar's today's date border Color

isPreserveCurrentDate

public boolean isPreserveCurrentDate()
Returns true if the current date should be preserved when disabled off-month day was selected. By default returns true

Returns:
true if the current date should be preserved
See Also:
setPreserveCurrentDate(boolean)

setPreserveCurrentDate

public void setPreserveCurrentDate(boolean aFlag)
Sets true if the current date should be preserved. This property works in conjuction with the propery allowSelectOffMonthDays when it set to false. If preserveCurrentDate set to true and off-month day is selected by mouse or keyboard new selection will be refused and restored to the previous one, otherwise the nearest day of current month is selected (in case of next month - last day of the month, in case of previous month - first day of the month)

Parameters:
aFlag - true if the current date should be preserved.

addCalendarListener

public void addCalendarListener(CalendarListener aListener)
Adds Calendar's listener

Parameters:
aListener - Calendar's listener

removeCalendarListener

public void removeCalendarListener(CalendarListener aListener)
Removes Calendar's listener

Parameters:
aListener - Calendar's listener

addCalendarDayRendererListener

public void addCalendarDayRendererListener(CalendarDayRendererListener aListener)
Adds Calendar's day renderer listener. ONLY ONE Calendar Day Renderer listener per Calendar is allowed

Parameters:
aListener - Calendar's day renderer listener

removeCalendarDayRendererListener

public void removeCalendarDayRendererListener(CalendarDayRendererListener aListener)
Removes Calendar's day renderer listener

Parameters:
aListener - Calendar's day renderer listener

addCalendarDateListener

public void addCalendarDateListener(CalendarDateListener aListener)
Adds Calendar Date listener. ONLY ONE Calendar Date listener per Calendar is allowed

Parameters:
aListener - Calendar's day renderer listener

removeCalendarDateListener

public void removeCalendarDateListener(CalendarDateListener aListener)
Removes Calendar Date listener

Parameters:
aListener - Calendar Date listener

addActionListener

public void addActionListener(java.awt.event.ActionListener aListener)
Adds action listener

Parameters:
aListener - action listener

removeActionListener

public void removeActionListener(java.awt.event.ActionListener aListener)
Removes action listener

Parameters:
aListener - action listener