com.jp.comp.calendar
Class CalendarPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.jp.comp.calendar.CalendarAdapter
                      extended bycom.jp.comp.calendar.CalendarPanel
All Implemented Interfaces:
javax.accessibility.Accessible, CalendarInterface, CalendarListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
MonthCalendarPanel

public class CalendarPanel
extends CalendarAdapter
implements CalendarListener, CalendarInterface

CalendarPanel represents a simple month calendar with navigation by keyboard and mouse. By default this calendar uses DefaultCalendarDayRenderer as a CalendarDayRenderer and MonthCalendarController as a CalendarController

See Also:
Serialized Form

Nested Class Summary
protected  class CalendarPanel.CalendarHeaderBorder
          Calendar's header border
protected  class CalendarPanel.CalendarTableCellRenderer
          Calendar's table cell renderer.
protected  class CalendarPanel.CalendarTableHeaderCellRenderer
          Calendar's table header cell renderer
protected static class CalendarPanel.CalendarTableUI
           
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.awt.Color DEFAULT_OFFMONTH_WEEKDAY_FOREGROUND
          Default weekday foreground color
static java.awt.Color DEFAULT_OFFMONTH_WEEKEND_FOREGROUND
          Default off-month weekend foreground color
static java.awt.Color DEFAULT_WEEKEND_FOREGROUND
          Default weekend foreground color
protected static javax.swing.border.EmptyBorder EMPTY_BORDER
           
protected  CalendarController fCalendarController
           
protected  CalendarDayRenderer fCalendarDayRenderer
           
protected  java.awt.Color fHeaderForeground
           
protected  boolean fMouseHolding
           
protected  java.awt.Color fOffMonthWeekdayBackground
           
protected  java.awt.Color fOffMonthWeekdayForeground
           
protected  java.awt.Color fOffMonthWeekendBackground
           
protected  java.awt.Color fOffMonthWeekendForeground
           
protected  boolean fPreserveCurrentDate
           
protected  boolean fSelectionChanged
           
protected  CalendarTableModel fTableModel
           
protected  java.awt.Color fWeekendBackground
           
protected  java.awt.Color fWeekendForeground
           
protected  javax.swing.JPanel pnlCalendar
           
static java.lang.String PROPERTY_CALENDAR_CONTROLLER
          Property name for the calendarController property
static java.lang.String PROPERTY_CALENDAR_DAY_RENDERER
          Property name for the calendarDayRenderer property
static java.lang.String PROPERTY_DATE
          Property name for the date property
static java.lang.String PROPERTY_HEADER_FOREGROUND
          Property name for the headerForeground property
static java.lang.String PROPERTY_LOCALE
          Property name for the locale property
static java.lang.String PROPERTY_OFFMONTH_WEEKDAY_BACKGROUND
          Property name for the offMonthWeekdayBackground property
static java.lang.String PROPERTY_OFFMONTH_WEEKDAY_FOREGROUND
          Property name for the offMonthWeekdayForeground property
static java.lang.String PROPERTY_OFFMONTH_WEEKEND_BACKGROUND
          Property name for the offMonthWeekendBackground property
static java.lang.String PROPERTY_OFFMONTH_WEEKEND_FOREGROUND
          Property name for the offMonthWeekendForeground property
static java.lang.String PROPERTY_PRESERVE_CURRENT_DATE
          Property name for the preserveCurrentDate property
static java.lang.String PROPERTY_SELECTED_DATE
          Property name for the date selectedDate property
static java.lang.String PROPERTY_SHORT_DAY_CAPTION
          Property name for the shortDayCaption property
static java.lang.String PROPERTY_SHOW_GRID
          Property name for the showGrid property
static java.lang.String PROPERTY_SHOW_HORIZONTAL_LINES
          Property name for the showHorizontalLines property
static java.lang.String PROPERTY_SHOW_VERTICAL_LINES
          Property name for the showVerticalLines property
static java.lang.String PROPERTY_TODAY_BORDER_COLOR
          Property name for the todayBorderColor property
static java.lang.String PROPERTY_TODAY_BORDER_THICKNESS
          Property name for the todayBorderThickness property
static java.lang.String PROPERTY_WEEKEND_BACKGROUND
          Property name for the weekendBackground property
static java.lang.String PROPERTY_WEEKEND_FOREGROUND
          Property name for the weekendForeground property
protected static int TABLE_COLUMN_MARGIN
           
protected  javax.swing.JTable tblCalendar
           
protected  javax.swing.table.JTableHeader tblhCalendarHeader
           
static javax.swing.border.LineBorder TODAY_BORDER
          Today's date border
 
Fields inherited from class com.jp.comp.calendar.CalendarAdapter
fActionListeners, fAllowSelectOffMonthDays, fCalendarDateListeners, fCalendarDayRendererListeners, fCalendarListeners, fLocale, fShowOffMonthDays, fSynchronizeSetDate, PROPERTY_ALLOW_SELECT_OFFMONTH_DAYS, PROPERTY_SHOW_OFFMONTH_DAYS
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CalendarPanel()
          Constructs the Calendar with default Locale, CalendarDayRenderer and CalendarControler
CalendarPanel(java.util.Locale aLocale)
          Constructs the Calendar with specified Locale, and default CalendarDayRenderer and CalendarControler
CalendarPanel(java.util.Locale aLocale, CalendarDayRenderer aCalendarDayRenderer)
          Constructs the Calendar with specified Locale and CalendarDayRenderer, and default CalendarControler
CalendarPanel(java.util.Locale aLocale, CalendarDayRenderer aCalendarDayRenderer, CalendarController aCalendarControler)
          Constructs the Calendar with specified Locale, CalendarDayRenderer and CalendarControler
 
Method Summary
protected  void changeSelection(int aRow, int aColumn, int aSelection)
          Invoked by the table when selection is changing
 void dateChanged(CalendarEvent anEvent)
          Catches date is changed event from the table model and forwards it to the method fireDateChanged
protected  void dateSelected()
          Invoked by the table listeners when Enter is pressed or mouse double click is performed to fire dateSelected event
 void dateSelected(CalendarEvent anEvent)
          Invoked by the Calendar when date is selected in the Calendar by mouse double click or when Enter is presssed
 java.lang.String getAbout()
           
 CalendarController getCalendarController()
          Returns the CalendarController
 CalendarDayRenderer getCalendarDayRenderer()
          Returns the CalendarDayRenderer
 java.util.Date getDate()
          Returns selected Date
 int getDayOfMonth()
          Returns selected day of month
static CalendarController getDefaultCalendarController()
          Returns the instance of default CalendarController
static CalendarDayRenderer getDefaultCalendarDayRenderer()
          Returns the instance of default CalendarDayRenderer
 java.awt.Color getGridColor()
           
 java.awt.Color getHeaderForeground()
          Returns Calendar's header (names of the days of the week) foreground Color
 CalendarItem getItem(int aRow, int aColumn)
          Gets the CalendarItem from specified row and column
 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
 int getSelectedColumn()
          Gets selected column
 CalendarItem getSelectedItem()
          Gets selected CalendarItem
 int getSelectedRow()
          Gets selected row
 javax.swing.JTable getTable()
          Returns the table that represents the Calendar's data (days and names of weekdays)
 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 isEnabled()
          Returns whether this component is enabled
 boolean isPreserveCurrentDate()
          Returns true if the current date should be preserved
 boolean isShortDayCaption()
          Returns true if short day caption is shown
 boolean isShowGrid()
          Returns true if the Calendar draws grid around days
 boolean isShowHorizontalLines()
          Returns true if the Calendar draws horizontal lines between days
 boolean isShowVerticalLines()
          Returns true if the Calendar draws vertical lines between days
 void localeChanged(CalendarInterface aSource, java.util.Locale aLocale, java.util.Date aDate)
          Catches locale is changed event from the table model and delegates it to the method fireLocaleChanged
 void requestFocus()
           
 void setAbout(java.lang.String aAbout)
           
 void setCalendarController(CalendarController aCalendarControler)
          Sets the CalendarController
 void setCalendarDayRenderer(CalendarDayRenderer aCalendarDayRenderer)
          Sets the CalendarDayRenderer
protected  void setCalendarSize()
          Calculates and sets Calendar's size
 void setDate(java.util.Date aDate)
          Sets a new Date
 void setEnabled(boolean aFlag)
          Sets this component accessibility.
 void setGridColor(java.awt.Color gridColor)
           
 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
protected  void setSelection()
          Selects current day
 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 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
 void updateUI()
           
 
Methods inherited from class com.jp.comp.calendar.CalendarAdapter
aboutToChangeDate, addActionListener, addCalendarDateListener, addCalendarDayRendererListener, addCalendarListener, fireAboutToChangeDate, fireActionPerformed, fireDateChanged, fireDateSelected, fireLocaleChanged, fireOnCalendarDayRenderer, isAllowSelectOffMonthDays, isShowOffMonthDays, removeActionListener, removeCalendarDateListener, removeCalendarDayRendererListener, removeCalendarListener, setAllowSelectOffMonthDays, setShowOffMonthDays
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.jp.comp.calendar.CalendarInterface
addActionListener, addCalendarDateListener, addCalendarDayRendererListener, addCalendarListener, getBackground, getForeground, isAllowSelectOffMonthDays, isShowOffMonthDays, removeActionListener, removeCalendarDateListener, removeCalendarDayRendererListener, removeCalendarListener, setAllowSelectOffMonthDays, setBackground, setForeground, setShowOffMonthDays
 

Field Detail

PROPERTY_CALENDAR_CONTROLLER

public static final java.lang.String PROPERTY_CALENDAR_CONTROLLER
Property name for the calendarController property

See Also:
Constant Field Values

PROPERTY_CALENDAR_DAY_RENDERER

public static final java.lang.String PROPERTY_CALENDAR_DAY_RENDERER
Property name for the calendarDayRenderer property

See Also:
Constant Field Values

PROPERTY_HEADER_FOREGROUND

public static final java.lang.String PROPERTY_HEADER_FOREGROUND
Property name for the headerForeground property

See Also:
Constant Field Values

PROPERTY_LOCALE

public static final java.lang.String PROPERTY_LOCALE
Property name for the locale property

See Also:
Constant Field Values

PROPERTY_OFFMONTH_WEEKDAY_BACKGROUND

public static final java.lang.String PROPERTY_OFFMONTH_WEEKDAY_BACKGROUND
Property name for the offMonthWeekdayBackground property

See Also:
Constant Field Values

PROPERTY_OFFMONTH_WEEKDAY_FOREGROUND

public static final java.lang.String PROPERTY_OFFMONTH_WEEKDAY_FOREGROUND
Property name for the offMonthWeekdayForeground property

See Also:
Constant Field Values

PROPERTY_OFFMONTH_WEEKEND_BACKGROUND

public static final java.lang.String PROPERTY_OFFMONTH_WEEKEND_BACKGROUND
Property name for the offMonthWeekendBackground property

See Also:
Constant Field Values

PROPERTY_OFFMONTH_WEEKEND_FOREGROUND

public static final java.lang.String PROPERTY_OFFMONTH_WEEKEND_FOREGROUND
Property name for the offMonthWeekendForeground property

See Also:
Constant Field Values

PROPERTY_PRESERVE_CURRENT_DATE

public static final java.lang.String PROPERTY_PRESERVE_CURRENT_DATE
Property name for the preserveCurrentDate property

See Also:
Constant Field Values

PROPERTY_SHORT_DAY_CAPTION

public static final java.lang.String PROPERTY_SHORT_DAY_CAPTION
Property name for the shortDayCaption property

See Also:
Constant Field Values

PROPERTY_SHOW_GRID

public static final java.lang.String PROPERTY_SHOW_GRID
Property name for the showGrid property

See Also:
Constant Field Values

PROPERTY_SHOW_HORIZONTAL_LINES

public static final java.lang.String PROPERTY_SHOW_HORIZONTAL_LINES
Property name for the showHorizontalLines property

See Also:
Constant Field Values

PROPERTY_SHOW_VERTICAL_LINES

public static final java.lang.String PROPERTY_SHOW_VERTICAL_LINES
Property name for the showVerticalLines property

See Also:
Constant Field Values

PROPERTY_TODAY_BORDER_COLOR

public static final java.lang.String PROPERTY_TODAY_BORDER_COLOR
Property name for the todayBorderColor property

See Also:
Constant Field Values

PROPERTY_TODAY_BORDER_THICKNESS

public static final java.lang.String PROPERTY_TODAY_BORDER_THICKNESS
Property name for the todayBorderThickness property

See Also:
Constant Field Values

PROPERTY_WEEKEND_BACKGROUND

public static final java.lang.String PROPERTY_WEEKEND_BACKGROUND
Property name for the weekendBackground property

See Also:
Constant Field Values

PROPERTY_WEEKEND_FOREGROUND

public static final java.lang.String PROPERTY_WEEKEND_FOREGROUND
Property name for the weekendForeground property

See Also:
Constant Field Values

PROPERTY_DATE

public static final java.lang.String PROPERTY_DATE
Property name for the date property

See Also:
Constant Field Values

PROPERTY_SELECTED_DATE

public static final java.lang.String PROPERTY_SELECTED_DATE
Property name for the date selectedDate property

See Also:
Constant Field Values

DEFAULT_WEEKEND_FOREGROUND

public static final java.awt.Color DEFAULT_WEEKEND_FOREGROUND
Default weekend foreground color


DEFAULT_OFFMONTH_WEEKDAY_FOREGROUND

public static final java.awt.Color DEFAULT_OFFMONTH_WEEKDAY_FOREGROUND
Default weekday foreground color


DEFAULT_OFFMONTH_WEEKEND_FOREGROUND

public static final java.awt.Color DEFAULT_OFFMONTH_WEEKEND_FOREGROUND
Default off-month weekend foreground color


TODAY_BORDER

public static javax.swing.border.LineBorder TODAY_BORDER
Today's date border


TABLE_COLUMN_MARGIN

protected static final int TABLE_COLUMN_MARGIN
See Also:
Constant Field Values

EMPTY_BORDER

protected static final javax.swing.border.EmptyBorder EMPTY_BORDER

pnlCalendar

protected javax.swing.JPanel pnlCalendar

tblhCalendarHeader

protected javax.swing.table.JTableHeader tblhCalendarHeader

tblCalendar

protected javax.swing.JTable tblCalendar

fCalendarDayRenderer

protected CalendarDayRenderer fCalendarDayRenderer

fCalendarController

protected CalendarController fCalendarController

fTableModel

protected CalendarTableModel fTableModel

fHeaderForeground

protected java.awt.Color fHeaderForeground

fWeekendForeground

protected java.awt.Color fWeekendForeground

fWeekendBackground

protected java.awt.Color fWeekendBackground

fOffMonthWeekdayForeground

protected java.awt.Color fOffMonthWeekdayForeground

fOffMonthWeekdayBackground

protected java.awt.Color fOffMonthWeekdayBackground

fOffMonthWeekendForeground

protected java.awt.Color fOffMonthWeekendForeground

fOffMonthWeekendBackground

protected java.awt.Color fOffMonthWeekendBackground

fPreserveCurrentDate

protected boolean fPreserveCurrentDate

fMouseHolding

protected boolean fMouseHolding

fSelectionChanged

protected boolean fSelectionChanged
Constructor Detail

CalendarPanel

public CalendarPanel()
Constructs the Calendar with default Locale, CalendarDayRenderer and CalendarControler


CalendarPanel

public CalendarPanel(java.util.Locale aLocale)
Constructs the Calendar with specified Locale, and default CalendarDayRenderer and CalendarControler

Parameters:
aLocale - the Locale

CalendarPanel

public CalendarPanel(java.util.Locale aLocale,
                     CalendarDayRenderer aCalendarDayRenderer)
Constructs the Calendar with specified Locale and CalendarDayRenderer, and default CalendarControler

Parameters:
aLocale - the Locale
aCalendarDayRenderer - the CalendarDayRenderer

CalendarPanel

public CalendarPanel(java.util.Locale aLocale,
                     CalendarDayRenderer aCalendarDayRenderer,
                     CalendarController aCalendarControler)
Constructs the Calendar with specified Locale, CalendarDayRenderer and CalendarControler

Parameters:
aLocale - the Locale
aCalendarDayRenderer - the CalendarDayRenderer
aCalendarControler - the CalendarController
Method Detail

getTable

public javax.swing.JTable getTable()
Returns the table that represents the Calendar's data (days and names of weekdays)

Returns:
the table

getItem

public CalendarItem getItem(int aRow,
                            int aColumn)
Gets the CalendarItem from specified row and column

Parameters:
aRow - the row
aColumn - the column
Returns:
the CalendarItem

getSelectedItem

public CalendarItem getSelectedItem()
Gets selected CalendarItem

Returns:
selected CalendarItem

getSelectedColumn

public int getSelectedColumn()
Gets selected column

Returns:
selected column

getSelectedRow

public int getSelectedRow()
Gets selected row

Returns:
selected row

getDefaultCalendarDayRenderer

public static CalendarDayRenderer getDefaultCalendarDayRenderer()
Returns the instance of default CalendarDayRenderer

Returns:
the instance of default CalendarDayRenderer

getDefaultCalendarController

public static CalendarController getDefaultCalendarController()
Returns the instance of default CalendarController

Returns:
the instance of default CalendarController

getCalendarDayRenderer

public CalendarDayRenderer getCalendarDayRenderer()
Returns the CalendarDayRenderer

Specified by:
getCalendarDayRenderer in interface CalendarInterface
Returns:
the CalendarDayRenderer

setCalendarDayRenderer

public void setCalendarDayRenderer(CalendarDayRenderer aCalendarDayRenderer)
Sets the CalendarDayRenderer

Specified by:
setCalendarDayRenderer in interface CalendarInterface
Parameters:
aCalendarDayRenderer - CalendarDayRenderer
See Also:
CalendarDayRenderer

getCalendarController

public CalendarController getCalendarController()
Returns the CalendarController

Specified by:
getCalendarController in interface CalendarInterface
Returns:
the CalendarController

setCalendarController

public void setCalendarController(CalendarController aCalendarControler)
Sets the CalendarController

Specified by:
setCalendarController in interface CalendarInterface
Parameters:
aCalendarControler - the CalendarController
See Also:
CalendarController

getDate

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

Specified by:
getDate in interface CalendarInterface
Returns:
selected Date

setDate

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

Specified by:
setDate in interface CalendarInterface
Parameters:
aDate - a new Date

getDayOfMonth

public int getDayOfMonth()
Returns selected day of month

Specified by:
getDayOfMonth in interface CalendarInterface
Returns:
selected day of month

getMonth

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

Specified by:
getMonth in interface CalendarInterface
Returns:
selected month number

getYear

public int getYear()
Returns selected year

Specified by:
getYear in interface CalendarInterface
Returns:
selected year

getLocale

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

Specified by:
getLocale in interface CalendarInterface
Returns:
Calendar's Locale

setLocale

public void setLocale(java.util.Locale aLocale)
Sets a new Calendar's Locale

Specified by:
setLocale in interface CalendarInterface
Parameters:
aLocale - a new Calendar's Locale

isShortDayCaption

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

Specified by:
isShortDayCaption in interface CalendarInterface
Returns:
true if short day caption is shown
See Also:
CalendarInterface.setShortDayCaption(boolean)

setShortDayCaption

public void setShortDayCaption(boolean aShortDayCaption)
Sets whether short day caption should be shown

Specified by:
setShortDayCaption in interface CalendarInterface
Parameters:
aShortDayCaption - true if short day caption should be shown

isEnabled

public boolean isEnabled()
Returns whether this component is enabled

Returns:
true if enabled

setEnabled

public void setEnabled(boolean aFlag)
Sets this component accessibility. This method will also disable mouse whell navigation

Parameters:
aFlag - true if this component should be enabled
See Also:
#setMouseWheelNavigationEnabled

isShowVerticalLines

public boolean isShowVerticalLines()
Returns true if the Calendar draws vertical lines between days

Specified by:
isShowVerticalLines in interface CalendarInterface
Returns:
true if the table draws vertical lines between days

setShowVerticalLines

public void setShowVerticalLines(boolean aFlag)
Sets whether the Calendar draws vertical lines between days

Specified by:
setShowVerticalLines in interface CalendarInterface
Parameters:
aFlag - true if the Calendar view should draw vertical lines
See Also:
CalendarInterface.setShowGrid(boolean)

isShowHorizontalLines

public boolean isShowHorizontalLines()
Returns true if the Calendar draws horizontal lines between days

Specified by:
isShowHorizontalLines in interface CalendarInterface
Returns:
true if the Calendar draws horizontal lines between days

setShowHorizontalLines

public void setShowHorizontalLines(boolean aFlag)
Sets whether the Calendar draws horizontal lines between days

Specified by:
setShowHorizontalLines in interface CalendarInterface
Parameters:
aFlag - true if the Calendar view should draw horizontal lines
See Also:
CalendarInterface.setShowGrid(boolean)

isShowGrid

public boolean isShowGrid()
Returns true if the Calendar draws grid around days

Specified by:
isShowGrid in interface CalendarInterface
Returns:
true if the Calendar draws grid around days

setShowGrid

public void setShowGrid(boolean aFlag)
Sets whether the Calendar draws grid lines around cells

Specified by:
setShowGrid in interface CalendarInterface
Parameters:
aFlag - true if the Calendar should draw grid lines
See Also:
CalendarInterface.setShowVerticalLines(boolean), CalendarInterface.setShowHorizontalLines(boolean)

getOffMonthWeekdayForeground

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

Specified by:
getOffMonthWeekdayForeground in interface CalendarInterface
Returns:
off-month weekday foreground Color

setOffMonthWeekdayForeground

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

Specified by:
setOffMonthWeekdayForeground in interface CalendarInterface
Parameters:
anOffMonthWeekdayForeground - off-month weekday foreground Color

getOffMonthWeekdayBackground

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

Specified by:
getOffMonthWeekdayBackground in interface CalendarInterface
Returns:
off-month weekday background Color

setOffMonthWeekdayBackground

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

Specified by:
setOffMonthWeekdayBackground in interface CalendarInterface
Parameters:
anOffMonthWeekdayBackground - off-month weekday background Color

getOffMonthWeekendForeground

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

Specified by:
getOffMonthWeekendForeground in interface CalendarInterface
Returns:
off-month weekend foreground Color

setOffMonthWeekendForeground

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

Specified by:
setOffMonthWeekendForeground in interface CalendarInterface
Parameters:
anOffMonthWeekendForeground - off-month weekend foreground Color

getOffMonthWeekendBackground

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

Specified by:
getOffMonthWeekendBackground in interface CalendarInterface
Returns:
off-month weekend background Color

setOffMonthWeekendBackground

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

Specified by:
setOffMonthWeekendBackground in interface CalendarInterface
Parameters:
anOffMonthWeekendBackground - off-month weekend background Color

getWeekendForeground

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

Specified by:
getWeekendForeground in interface CalendarInterface
Returns:
current month's weekend foreground Color

setWeekendForeground

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

Specified by:
setWeekendForeground in interface CalendarInterface
Parameters:
aWeekendForeground - current month's weekend foreground Color

getWeekendBackground

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

Specified by:
getWeekendBackground in interface CalendarInterface
Returns:
current month's weekend background Color

setWeekendBackground

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

Specified by:
setWeekendBackground in interface CalendarInterface
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

Specified by:
getHeaderForeground in interface CalendarInterface
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

Specified by:
setHeaderForeground in interface CalendarInterface
Parameters:
aHeaderForeground - Calendar's header foreground Color

getTodayBorderThickness

public int getTodayBorderThickness()
Returns Calendar's today's date border thickness

Specified by:
getTodayBorderThickness in interface CalendarInterface
Returns:
Calendar's today's date border thickness

setTodayBorderThickness

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

Specified by:
setTodayBorderThickness in interface CalendarInterface
Parameters:
aThickness - Calendar's today's date border thickness

getTodayBorderColor

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

Specified by:
getTodayBorderColor in interface CalendarInterface
Returns:
Calendar's today's date border Color

setTodayBorderColor

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

Specified by:
setTodayBorderColor in interface CalendarInterface
Parameters:
aColor - Calendar's today's date border Color

isPreserveCurrentDate

public boolean isPreserveCurrentDate()
Returns true if the current date should be preserved

Specified by:
isPreserveCurrentDate in interface CalendarInterface
Returns:
true if the current date should be preserved
See Also:
CalendarInterface.setPreserveCurrentDate(boolean)

setPreserveCurrentDate

public void setPreserveCurrentDate(boolean aFlag)
Sets true if the current date should be preserved

Specified by:
setPreserveCurrentDate in interface CalendarInterface
Parameters:
aFlag - true if the current date should be preserved.

setSelection

protected void setSelection()
Selects current day


updateUI

public void updateUI()

setCalendarSize

protected void setCalendarSize()
Calculates and sets Calendar's size


changeSelection

protected void changeSelection(int aRow,
                               int aColumn,
                               int aSelection)
Invoked by the table when selection is changing

Parameters:
aRow - the row
aColumn - the row
aSelection - selection key

dateSelected

protected void dateSelected()
Invoked by the table listeners when Enter is pressed or mouse double click is performed to fire dateSelected event


requestFocus

public void requestFocus()

dateChanged

public void dateChanged(CalendarEvent anEvent)
Catches date is changed event from the table model and forwards it to the method fireDateChanged

Specified by:
dateChanged in interface CalendarListener
Parameters:
anEvent - the CalendarEvent

dateSelected

public void dateSelected(CalendarEvent anEvent)
Description copied from interface: CalendarListener
Invoked by the Calendar when date is selected in the Calendar by mouse double click or when Enter is presssed

Specified by:
dateSelected in interface CalendarListener
Parameters:
anEvent - the CalendarEvent

localeChanged

public void localeChanged(CalendarInterface aSource,
                          java.util.Locale aLocale,
                          java.util.Date aDate)
Catches locale is changed event from the table model and delegates it to the method fireLocaleChanged

Specified by:
localeChanged in interface CalendarListener
Parameters:
aSource - the source of the event
aLocale - the new Locale
aDate - the current Date

getGridColor

public java.awt.Color getGridColor()

setGridColor

public void setGridColor(java.awt.Color gridColor)

getAbout

public java.lang.String getAbout()

setAbout

public void setAbout(java.lang.String aAbout)