|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
ilog.views.util.swing.calendar.IlvJCalendarPanel
public class IlvJCalendarPanel
IlvJCalendarPanel is a Swing component that renders a monthly
calendar grid.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
CELL_RENDERER_CHANGED_PROPERTY
Identifies that the calendar panel's cell renderer has changed. |
static String |
DATE_SELECTED_PROPERTY
Identifies that a user input event has selected a date in the panel. |
static String |
HEADER_BACKGROUND_CHANGED_PROPERTY
Identifies the background color of the header. |
static String |
HEADER_FONT_CHANGED_PROPERTY
Identifies the font of the header. |
static String |
HEADER_FOREGROUND_CHANGED_PROPERTY
Identifies the foreground color of the header. |
static String |
HEADER_HEIGHT_CHANGED_PROPERTY
Identifies that the height of the calendar panel's header has changed. |
static String |
HEADER_RENDERER_CHANGED_PROPERTY
Identifies that the calendar panel's header renderer has changed. |
static String |
MODEL_CHANGED_PROPERTY
Identifies that the panel's calendar model has changed. |
static String |
NEXT_MONTH_FOREGROUND_CHANGED_PROPERTY
Identifies the foreground color of the next month. |
static String |
PREVIOUS_MONTH_FOREGROUND_CHANGED_PROPERTY
Identifies the foreground color of the previous month. |
static String |
SELECTION_BACKGROUND_CHANGED_PROPERTY
Identifies the background color of the selection. |
static String |
SELECTION_FOREGROUND_CHANGED_PROPERTY
Identifies the foreground color of the selection. |
static String |
WEEKEND_BACKGROUND_CHANGED_PROPERTY
Identifies the background color of the weekends. |
static String |
WEEKEND_FONT_CHANGED_PROPERTY
Identifies the font of the weekends. |
static String |
WEEKEND_FOREGROUND_CHANGED_PROPERTY
Identifies the foreground color of the weekends. |
| 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 | |
|---|---|
IlvJCalendarPanel()
Creates a new IlvJCalendarPanel that is initialized with a default data
model. |
|
IlvJCalendarPanel(IlvCalendarModel model)
Creates a new IlvJCalendarPanel that is initialized with the specified
data model. |
|
| Method Summary | |
|---|---|
protected IlvCalendarModel |
createDefaultModel()
Returns the default calendar model object for this panel, which is an IlvDefaultCalendarModel. |
void |
fireDateSelected()
Fires a PropertyChange event to all subscribed listeners indicating that
the user has selected a date in the panel. |
Calendar |
getCalendar()
Returns the calendar displayed by the panel. |
Calendar |
getCellDate(int row,
int column)
Returns the date displayed in the day cell that lies at the intersection of the specified week row and day-of-week column. |
Rectangle |
getCellRect(int row,
int column)
Returns a rectangle for the day cell that lies at the intersection of the specified week row and day-of-week column. |
IlvCalendarCellRenderer |
getCellRenderer()
Returns the object that renders the day cells. |
int |
getColumnAtPoint(Point point)
Returns the index of the day-of-week column that point lies in. |
int |
getColumnCount()
Returns the number of day-of-week columns in the calendar panel. |
int |
getColumnWidth()
Returns the width of the day-of-week columns. |
Color |
getHeaderBackground()
Returns the header background color. |
Font |
getHeaderFont()
Returns the header font. |
Color |
getHeaderForeground()
Returns the header foreground color. |
int |
getHeaderHeight()
Returns the height of the days-of-week header, in pixels. |
IlvCalendarHeaderRenderer |
getHeaderRenderer()
Returns the object that renders the day-of-week header. |
IlvCalendarModel |
getModel()
Returns the data model that holds the calendar displayed by the panel. |
Color |
getNextMonthForeground()
Returns the next month foreground color. |
Color |
getPreviousMonthForeground()
Returns the previous month foreground color. |
int |
getRowAtPoint(Point point)
Returns the index of the week row that point lies in. |
int |
getRowCount()
Returns the number of week rows in the calendar panel. |
int |
getRowHeight()
Returns the height of the week rows. |
Color |
getSelectionBackground()
Returns the selection background color. |
Color |
getSelectionForeground()
Returns the selection foreground color. |
CalendarPanelUI |
getUI()
Returns the look and feel (L&F) object that renders this calendar panel. |
String |
getUIClassID()
Returns the suffix used to construct the name of the look and feel (L&F) class used to render this component. |
Color |
getWeekendBackground()
Returns the weekend background color. |
Font |
getWeekendFont()
Returns the weekend font. |
Color |
getWeekendForeground()
Returns the weekend foreground color. |
protected void |
init()
Initializes calendar panel properties to their default values. |
boolean |
isFocusTraversable()
Returns whether the focus can be traversed. |
void |
setCalendar(Calendar calendar)
Sets the calendar displayed by the panel. |
void |
setCellRenderer(IlvCalendarCellRenderer cellRenderer)
Sets the object that renders the day cells. |
void |
setHeaderBackground(Color headerBackground)
Sets the background color for the days-of-week header cells. |
void |
setHeaderFont(Font headerFont)
Sets the font for header cells. |
void |
setHeaderForeground(Color headerForeground)
Sets the foreground color for selected cells. |
void |
setHeaderHeight(int headerHeight)
Sets the height of the days-of-week header, in pixels. |
void |
setHeaderRenderer(IlvCalendarHeaderRenderer headerRenderer)
Sets the object that renders the day-of-week header. |
void |
setModel(IlvCalendarModel model)
Sets the data model that holds the calendar displayed by the panel. |
void |
setNextMonthForeground(Color nextMonthForeground)
Sets the foreground color for the next month cells. |
void |
setPreviousMonthForeground(Color previousMonthForeground)
Sets the foreground color for the previous month cells. |
void |
setSelectionBackground(Color selectionBackground)
Sets the background color for selected cells. |
void |
setSelectionForeground(Color selectionForeground)
Sets the foreground color for selected cells. |
void |
setUI(CalendarPanelUI ui)
Sets the look and feel (L&F) object that renders this calendar panel. |
void |
setWeekendBackground(Color weekendBackground)
Sets the background color for selected cells. |
void |
setWeekendFont(Font weekendFont)
Sets the font for weekend cells. |
void |
setWeekendForeground(Color weekendForeground)
Sets the foreground color for weekend cells. |
void |
updateUI()
Resets the UI property with the value from the current look and feel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String MODEL_CHANGED_PROPERTY
public static final String DATE_SELECTED_PROPERTY
public static final String CELL_RENDERER_CHANGED_PROPERTY
public static final String HEADER_RENDERER_CHANGED_PROPERTY
public static final String HEADER_HEIGHT_CHANGED_PROPERTY
public static final String SELECTION_FOREGROUND_CHANGED_PROPERTY
public static final String SELECTION_BACKGROUND_CHANGED_PROPERTY
public static final String WEEKEND_FOREGROUND_CHANGED_PROPERTY
public static final String WEEKEND_BACKGROUND_CHANGED_PROPERTY
public static final String WEEKEND_FONT_CHANGED_PROPERTY
public static final String PREVIOUS_MONTH_FOREGROUND_CHANGED_PROPERTY
public static final String NEXT_MONTH_FOREGROUND_CHANGED_PROPERTY
public static final String HEADER_FOREGROUND_CHANGED_PROPERTY
public static final String HEADER_BACKGROUND_CHANGED_PROPERTY
public static final String HEADER_FONT_CHANGED_PROPERTY
| Constructor Detail |
|---|
public IlvJCalendarPanel(IlvCalendarModel model)
IlvJCalendarPanel that is initialized with the specified
data model.
model - The data model for the calendar panel.public IlvJCalendarPanel()
IlvJCalendarPanel that is initialized with a default data
model.
createDefaultModel()| Method Detail |
|---|
protected void init()
public boolean isFocusTraversable()
isFocusTraversable in class Componenttrue if the focus is traversable, or false
otherwise.protected IlvCalendarModel createDefaultModel()
IlvDefaultCalendarModel. A subclass can override this method to return a different
calendar model object.
getModel(),
setModel(ilog.views.util.swing.calendar.IlvCalendarModel)public IlvCalendarModel getModel()
setModel(ilog.views.util.swing.calendar.IlvCalendarModel),
createDefaultModel()public void setModel(IlvCalendarModel model)
model - The data model to set.getModel(),
createDefaultModel()public Calendar getCalendar()
setCalendar(java.util.Calendar)public void setCalendar(Calendar calendar)
calendar - The calendar to set.getCalendar()
public Calendar getCellDate(int row,
int column)
row and day-of-week column. If the specified
cell coordinates are out of range, then null is returned.
row - The week row.column - The day-of-week column.
public String getUIClassID()
getUIClassID in class JComponentpublic CalendarPanelUI getUI()
CalendarPanelUI object that renders this component.public void setUI(CalendarPanelUI ui)
ui - The CalendarPanelUI L&F object.public void updateUI()
updateUI in class JComponentpublic void fireDateSelected()
PropertyChange event to all subscribed listeners indicating that
the user has selected a date in the panel. Warning: This method
is considered to be part of an IlvJCalendarPanel's internal
implementation and not a public API. This method should only be invoked by the
panel's LAF delegate.
public IlvCalendarCellRenderer getCellRenderer()
setCellRenderer(ilog.views.util.swing.calendar.IlvCalendarCellRenderer)public void setCellRenderer(IlvCalendarCellRenderer cellRenderer)
cellRenderer - The cell renderer object.getCellRenderer()public IlvCalendarHeaderRenderer getHeaderRenderer()
setHeaderRenderer(ilog.views.util.swing.calendar.IlvCalendarHeaderRenderer)public void setHeaderRenderer(IlvCalendarHeaderRenderer headerRenderer)
headerRenderer - The day-of-week header renderer object.getHeaderRenderer()