|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JScrollPane | +--com.klg.jclass.util.calendar.DayTable
DayTable is the table of days used to form the day portion of a calendar.
Nested Class Summary | |
protected class |
DayTable.DayModel
Build data model wrapper around DateSymbols that builds a 7x6 table of month with the current date for picking. |
protected class |
DayTable.Renderer
Use a table cell renderer to draw current day in reverse video |
Nested classes inherited from class javax.swing.JScrollPane |
JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
protected com.klg.jclass.util.JCListenerList |
actionListeners
A list of action listeners |
protected int |
cellSize
|
protected int |
componentSpacing
|
protected int |
day
|
protected DayTable.DayModel |
dayModel
The model used for the table |
protected String[] |
days
|
protected boolean |
editable
|
protected int |
firstDayOfWeek
|
protected Calendar |
intermediateDate
Date used when click-dragging date. |
protected boolean |
isDragging
|
protected Locale |
locale
|
protected static int |
MIN_CELL_SIZE
|
protected int |
month
|
protected static int |
NUM_DAYS
|
protected static int |
NUM_ROWS
|
protected Color |
otherBackground
|
protected Color |
otherForeground
|
protected com.klg.jclass.util.value.JCValueModel |
selectedDate
|
protected Color |
selectionBackground
|
protected Color |
selectionForeground
|
protected Color |
specialBackground
|
protected com.klg.jclass.util.calendar.JCCalendar |
specialDates
|
protected Color |
specialForeground
|
protected int |
startingCell
|
protected JTable |
table
|
protected int |
tableCellSize
|
protected boolean |
userSetDays
|
protected int |
year
|
Fields inherited from class javax.swing.JScrollPane |
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport |
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.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 | |
DayTable(com.klg.jclass.util.value.JCValueModel date,
com.klg.jclass.util.calendar.JCCalendar special_dates,
Locale locale)
Creates a DayTable with specified a calendar, list of special dates, and locale. |
|
DayTable(com.klg.jclass.util.value.JCValueModel date,
com.klg.jclass.util.calendar.JCCalendar special_dates,
Locale locale,
String[] days)
Creates a DayTable with a specified calendar model, list of special dates, locale, and set of day strings. |
Method Summary | |
void |
addActionListener(ActionListener l)
Add listener to receive action event when data is changed by the user. |
void |
addNotify()
Override addNotify to also set the size of the table. |
protected void |
adjustSize()
Adjust the size of the table |
protected void |
calculateCalendar()
Find out which cell to begin drawing - first day of week may not start on Sunday. |
protected void |
calculateCellSize()
Calculates the cell size. |
int |
dayFromRowColumn(int row,
int column)
Returns the day given the row and column on the DayTable. |
void |
fireActionEvent()
Fire the Action events. |
protected void |
fireActionEvent(boolean hidePopup)
|
protected Calendar |
getCalendarFromDay(int dayValue)
Return a copy of the current selected date with the day changed to the passed in value. |
protected Calendar |
getCalendarFromPoint(Point point)
Calculate the day on the table which corresponds to the passed in point. |
com.klg.jclass.util.value.JCValueModel |
getCalendarModel()
Get the value model the DayTable is using. |
int |
getCellSize()
Returns the current cell size used. |
protected int |
getDayFromPoint(Point point)
Calculate the day on the table which corresponds to the passed in point. |
Locale |
getLocale()
Get the locale object being used by the DayTable. |
Dimension |
getPreferredSize()
Gets the preferred size of the DayTable. |
com.klg.jclass.util.calendar.JCCalendar |
getSpecialDates()
Get the special dates being used by the DayTable. |
com.klg.jclass.util.calendar.JCCalendar |
getSpecialDates(com.klg.jclass.util.calendar.JCCalendar sd)
Deprecated. As the parameter is unused, should use getSpecialDates() |
protected void |
inferLookAndFeel()
Set Look and Feel specific values (note that these overrided user specified values). |
protected boolean |
isDayInCurrentMonth(int dayValue)
Is passed in day, within the current month? |
boolean |
isEditable()
Test whether the DayTable is editable. |
boolean |
isSelectedDate(int row,
int column)
Test to see if the day at a certain row and column is selected. |
boolean |
isSelectedMonth(int row,
int column)
Test to see if the day at a certain row and column is in the month that has been selected to be displayed. |
protected boolean |
isValidDate(Calendar c)
Is the passed in calendar valid? If the parent is a JCDateChooser, check the date thru its bounds validator. |
void |
mouseClicked(MouseEvent e)
React to a mouseClicked event. |
void |
mouseDragged(MouseEvent e)
mouseDragged. |
void |
mouseEntered(MouseEvent e)
mouseEntered. |
void |
mouseExited(MouseEvent e)
mouseExited. |
void |
mouseMoved(MouseEvent e)
mouseMoved. |
void |
mousePressed(MouseEvent ev)
React to a mousePressed event. |
void |
mouseReleased(MouseEvent ev)
React to a mouseReleased event. |
void |
removeActionListener(ActionListener l)
Remove listener to receive action event when data is changed by the user. |
void |
setCalendarModel(com.klg.jclass.util.value.JCValueModel model)
Set the value model the DayTable should use. |
void |
setCellSize(int cellSize)
Sets the size of the cells in the table. |
void |
setEditable(boolean e)
Set whether the DayTable will allow the selection of a day or not. |
void |
setFont(Font font)
Override setFont to store the table font. |
void |
setLocale(Locale l)
Set the locale the DayTable should use. |
void |
setOtherDateBackground(Color c)
Set the background color of other information (not normal dates and special dates. |
void |
setOtherDateForeground(Color c)
Set the foreground color of other information (not normal dates and special dates. |
void |
setSelectedDateBackground(Color c)
Set the background color of the selected date. |
void |
setSelectedDateForeground(Color c)
Set the foreground color of selected date. |
void |
setSpecialDateBackground(Color c)
Set the background color of special dates. |
void |
setSpecialDateForeground(Color c)
Set the foreground color of special dates. |
void |
setSpecialDates(com.klg.jclass.util.calendar.JCCalendar sd)
Set special dates to appear on the DayTable. |
protected void |
setUI(ComponentUI ui)
Set the UI. |
void |
updateUI()
Update the UI. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected com.klg.jclass.util.value.JCValueModel selectedDate
protected com.klg.jclass.util.calendar.JCCalendar specialDates
protected int componentSpacing
protected Color otherBackground
protected Color otherForeground
protected Color specialBackground
protected Color specialForeground
protected Color selectionBackground
protected Color selectionForeground
protected int tableCellSize
protected int cellSize
protected Locale locale
protected String[] days
protected boolean userSetDays
protected int firstDayOfWeek
protected int year
protected int month
protected int day
protected int startingCell
protected boolean isDragging
protected static int NUM_ROWS
protected static int NUM_DAYS
protected static int MIN_CELL_SIZE
protected JTable table
protected boolean editable
protected com.klg.jclass.util.JCListenerList actionListeners
protected Calendar intermediateDate
protected DayTable.DayModel dayModel
Constructor Detail |
public DayTable(com.klg.jclass.util.value.JCValueModel date, com.klg.jclass.util.calendar.JCCalendar special_dates, Locale locale)
date
- The calendar value model to use (which stores a date)special_dates
- The list of special dates for this calendar stored
within a JCCalendar objectlocale
- The locale to be usedCalendar
,
Locale
public DayTable(com.klg.jclass.util.value.JCValueModel date, com.klg.jclass.util.calendar.JCCalendar special_dates, Locale locale, String[] days)
date
- The calendar value model to use (which stores a date)special_dates
- The list of special dates for this calendar stored
within a JCCalendar objectlocale
- The locale to be useddays
- A list of day of week names to use (null means use locale
specific names)Calendar
,
Locale
Method Detail |
public void setEditable(boolean e)
e
- true for editable false for non-editable.public boolean isEditable()
public void setSelectedDateBackground(Color c)
c
- The new selected date background colorpublic void setSelectedDateForeground(Color c)
c
- The new selected date foreground colorpublic void setSpecialDateBackground(Color c)
c
- The new special date background colorpublic void setSpecialDateForeground(Color c)
c
- The new special date foreground colorpublic void setOtherDateBackground(Color c)
c
- The new other date background colorpublic void setOtherDateForeground(Color c)
c
- The new other date foreground colorpublic void setLocale(Locale l)
setLocale
in interface CalendarComponent
setLocale
in class Component
l
- The locale object to use.public Locale getLocale()
getLocale
in class Component
public void setFont(Font font)
setFont
in class JComponent
font
- The new fontpublic void setCalendarModel(com.klg.jclass.util.value.JCValueModel model)
setCalendarModel
in interface CalendarComponent
model
- The calendar value model to use.public com.klg.jclass.util.value.JCValueModel getCalendarModel()
public void setSpecialDates(com.klg.jclass.util.calendar.JCCalendar sd)
setSpecialDates
in interface CalendarComponent
sd
- The new list of special dates stored within a JCCalendar objectpublic com.klg.jclass.util.calendar.JCCalendar getSpecialDates(com.klg.jclass.util.calendar.JCCalendar sd)
sd
- Unused
public com.klg.jclass.util.calendar.JCCalendar getSpecialDates()
public void addActionListener(ActionListener l)
addActionListener
in interface CalendarComponent
l
- The action listener to be addedpublic void removeActionListener(ActionListener l)
removeActionListener
in interface CalendarComponent
l
- The action listener to be removedprotected void adjustSize()
public void addNotify()
addNotify
in class JComponent
JComponent.addNotify()
public void setCellSize(int cellSize)
cellSize
- The new cellSize (in pixels)public int getCellSize()
protected void calculateCalendar()
protected void calculateCellSize()
Calendar cells are square so the cell size is the maximum of 1) the max width of the days of the week, 2) the width of a double digit, and 3) the height of a digit.
public void fireActionEvent()
protected void fireActionEvent(boolean hidePopup)
public int dayFromRowColumn(int row, int column)
row
- The row indexcolumn
- The column index
protected int getDayFromPoint(Point point)
point
- A point on the table.
protected Calendar getCalendarFromDay(int dayValue)
dayValue
- The day to use.
protected Calendar getCalendarFromPoint(Point point)
point
- A point on the table
protected boolean isDayInCurrentMonth(int dayValue)
dayValue
- The day value to check.
protected boolean isValidDate(Calendar c)
c
- The date (in a Calendar object) to check
public void mousePressed(MouseEvent ev)
mousePressed
in interface MouseListener
ev
- The mouse event generatedpublic void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
e
- The mouse event generatedpublic void mouseReleased(MouseEvent ev)
mouseReleased
in interface MouseListener
ev
- The mouse event generatedpublic void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
e
- The mouse event generatedpublic void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
e
- The mouse event generatedpublic void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
e
- The mouse event generatedpublic void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
e
- The mouse event generatedpublic Dimension getPreferredSize()
getPreferredSize
in class JComponent
public boolean isSelectedDate(int row, int column)
row
- The row indexcolumn
- The column index
public boolean isSelectedMonth(int row, int column)
row
- The row indexcolumn
- The column index
protected void setUI(ComponentUI ui)
setUI
in class JComponent
ui
- The new uipublic void updateUI()
updateUI
in class JScrollPane
protected void inferLookAndFeel()
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |