public class BasicCalendarPanelUI extends CalendarPanelUI
IlvJCalendarPanel
components.Modifier and Type | Class and Description |
---|---|
class |
BasicCalendarPanelUI.CalendarModelHandler
The
CalendarModelListener that is added to the calendar panel's
model as needed. |
class |
BasicCalendarPanelUI.FocusHandler
The focus listener that is added to the calendar panel at
installUI(javax.swing.JComponent) time. |
class |
BasicCalendarPanelUI.MouseHandler
The mouse input listener that is added to the calendar panel at
installUI(javax.swing.JComponent) time. |
class |
BasicCalendarPanelUI.PropertyChangeHandler
The
PropertyChangeListener that is added to the calendar panel at
installUI(javax.swing.JComponent) time. |
static class |
BasicCalendarPanelUI.SelectionBorder
SelectionBorder is the default border for selected day cells
in an IlvJCalendarPanel . |
Modifier and Type | Field and Description |
---|---|
protected IlvJCalendarPanel |
calendarPanel
The
IlvJCalendarPanel that we're a UI delegate for. |
protected FocusListener |
focusListener
The listener for focus changes to the calendar panel.
|
protected CalendarModelListener |
modelListener
The listener for changes to the calendar data model.
|
protected MouseInputListener |
mouseListener
The listener for mouse input events.
|
protected PropertyChangeListener |
propertyChangeListener
The listener for property changes to the calendar panel.
|
protected CellRendererPane |
rendererPane
The intermediate container between the calendar panel and its renderers.
|
Constructor and Description |
---|
BasicCalendarPanelUI()
Creates a new
BasicCalendarPanelUI delegate. |
Modifier and Type | Method and Description |
---|---|
protected CalendarModelListener |
createCalendarModelListener()
Creates an instance of
BasicCalendarPanelUI.CalendarModelHandler that is added to
the calendar panel's model as needed. |
protected FocusListener |
createFocusListener()
Creates an instance of
BasicCalendarPanelUI.FocusHandler that is added to
the calendar panel by installUI(javax.swing.JComponent) . |
protected MouseInputListener |
createMouseListener()
Creates an instance of
BasicCalendarPanelUI.MouseHandler that is added to
the calendar panel by installUI(javax.swing.JComponent) . |
protected PropertyChangeListener |
createPropertyChangeListener()
Creates an instance of
BasicCalendarPanelUI.PropertyChangeHandler that is added to
the calendar panel by installUI(javax.swing.JComponent) . |
static ComponentUI |
createUI(JComponent c)
Returns a new instance of
BasicCalendarPanelUI . |
Calendar |
getCellDate(IlvJCalendarPanel calendarPanel,
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(IlvJCalendarPanel calendarPanel,
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 . |
int |
getColumnAtPoint(IlvJCalendarPanel calendarPanel,
Point point)
Returns the index of the day-of-week column that
point lies
in. |
int |
getColumnCount(IlvJCalendarPanel calendarPanel)
Returns the number of day-of-week columns in the specified calendar panel.
|
int |
getColumnWidth(IlvJCalendarPanel calendarPanel)
Returns the width of the day-of-week columns in the specified calendar panel.
|
protected Calendar |
getFirstDayOfMonth()
Returns the first day of the month displayed by the calendar panel.
|
protected Calendar |
getFirstDayOfPanel()
Returns the date displayed in the first day cell of the calendar panel.
|
Dimension |
getMaximumSize(JComponent c)
Returns the maximum size of the calendar panel.
|
Dimension |
getMinimumSize(JComponent c)
Returns the minimum size of the calendar panel.
|
Dimension |
getPreferredSize(JComponent c)
Returns the preferred size of the calendar panel.
|
int |
getRowAtPoint(IlvJCalendarPanel calendarPanel,
Point point)
Returns the index of the week row that
point lies in. |
int |
getRowCount(IlvJCalendarPanel calendarPanel)
Returns the number of week rows in the specified calendar panel.
|
int |
getRowHeight(IlvJCalendarPanel calendarPanel)
Returns the height of the week rows in the specified calendar panel.
|
protected void |
installDefaults()
Initializes the calendar panel properties.
|
protected void |
installListeners()
Creates and installs the listeners for the calendar panel and its model.
|
void |
installUI(JComponent c)
Configures the specified calendar panel for the look and feel.
|
void |
paint(Graphics g,
JComponent c)
Paints a representation of the calendar panel.
|
protected void |
paintCell(Graphics g,
Rectangle cellRect,
int row,
int column,
IlvCalendarCellRenderer cellRenderer,
Calendar calendar,
boolean prevMonth,
boolean nextMonth,
boolean selected)
Paints one day cell of the calendar panel.
|
protected void |
paintHeader(Graphics g,
Rectangle cellRect,
int column,
IlvCalendarHeaderRenderer headerRenderer,
Calendar calendar)
Paints one cell of the day-of-week column header.
|
protected void |
resizeAndRepaint()
Resizes the calendar panel and marks it as needing display.
|
protected void |
uninstallDefaults()
Reverses the configuration of the calendar panel that was performed
during
installDefaults() . |
protected void |
uninstallListeners()
Removes the listeners for the calendar panel and its model.
|
void |
uninstallUI(JComponent c)
Reverses the configuration that was done on the specified calendar panel
during
installUI(javax.swing.JComponent) . |
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, update
protected IlvJCalendarPanel calendarPanel
IlvJCalendarPanel
that we're a UI delegate for. Initialized by
the installUI(javax.swing.JComponent)
method, and reset to null
by uninstallUI(javax.swing.JComponent)
.protected CellRendererPane rendererPane
protected PropertyChangeListener propertyChangeListener
protected CalendarModelListener modelListener
protected FocusListener focusListener
protected MouseInputListener mouseListener
public BasicCalendarPanelUI()
BasicCalendarPanelUI
delegate.public static ComponentUI createUI(JComponent c)
BasicCalendarPanelUI
. UI
delegates are allocated one per IlvJCalendarPanel
.c
- The IlvJCalendarPanel
.BasicCalendarPanelUI
object.public void installUI(JComponent c)
installUI
in class ComponentUI
c
- The IlvJCalendarPanel
where this UI delegate is being
installed.uninstallUI(javax.swing.JComponent)
public void uninstallUI(JComponent c)
installUI(javax.swing.JComponent)
.uninstallUI
in class ComponentUI
c
- The IlvJCalendarPanel
from which this UI delegate is being
removed.protected void installDefaults()
protected void uninstallDefaults()
installDefaults()
.protected void installListeners()
installUI(javax.swing.JComponent)
time.uninstallListeners()
protected void uninstallListeners()
uninstallUI(javax.swing.JComponent)
time.installListeners()
protected FocusListener createFocusListener()
BasicCalendarPanelUI.FocusHandler
that is added to
the calendar panel by installUI(javax.swing.JComponent)
.protected MouseInputListener createMouseListener()
BasicCalendarPanelUI.MouseHandler
that is added to
the calendar panel by installUI(javax.swing.JComponent)
.protected CalendarModelListener createCalendarModelListener()
BasicCalendarPanelUI.CalendarModelHandler
that is added to
the calendar panel's model as needed.protected PropertyChangeListener createPropertyChangeListener()
BasicCalendarPanelUI.PropertyChangeHandler
that is added to
the calendar panel by installUI(javax.swing.JComponent)
.public int getRowCount(IlvJCalendarPanel calendarPanel)
6
.getRowCount
in class CalendarPanelUI
calendarPanel
- The calendar panel.public int getColumnCount(IlvJCalendarPanel calendarPanel)
getColumnCount
in class CalendarPanelUI
calendarPanel
- The calendar panel. This implementation returns
7
.public int getRowHeight(IlvJCalendarPanel calendarPanel)
getRowHeight
in class CalendarPanelUI
calendarPanel
- The calendar panel.public int getColumnWidth(IlvJCalendarPanel calendarPanel)
getColumnWidth
in class CalendarPanelUI
calendarPanel
- The calendar panel.public Rectangle getCellRect(IlvJCalendarPanel calendarPanel, int row, int column)
row
and day-of-week column
. A
value of -1 can be specified for the row
to indicate the
days-of-week header. If the specified cell coordinates are out of range,
then null
is returned.getCellRect
in class CalendarPanelUI
calendarPanel
- The calendar panel.row
- The week row, or -1 to indicate the days-of-week header.column
- The day-of-week column.public int getRowAtPoint(IlvJCalendarPanel calendarPanel, Point point)
point
lies in. This
method returns -1 if the point lies in the days-of-week header. Otherwise,
this method returns -2 if the result is not in the range [0, getRowCount(ilog.views.util.swing.calendar.IlvJCalendarPanel)
-1].getRowAtPoint
in class CalendarPanelUI
calendarPanel
- The calendar panel.point
- The location of interest.point
lies in, or -1
if point
lies in the days-of-week header, or -2 if the
result is not in the range [0, getRowCount(ilog.views.util.swing.calendar.IlvJCalendarPanel)
-1].getColumnAtPoint(ilog.views.util.swing.calendar.IlvJCalendarPanel, java.awt.Point)
public int getColumnAtPoint(IlvJCalendarPanel calendarPanel, Point point)
point
lies
in. This method returns -1 if the point is not in the range
[0, getColumnCount(ilog.views.util.swing.calendar.IlvJCalendarPanel)
-1].getColumnAtPoint
in class CalendarPanelUI
calendarPanel
- The calendar panel.point
- The location of interest.point
lies
in, or -1 if the result is not in the range [0, getColumnCount(ilog.views.util.swing.calendar.IlvJCalendarPanel)
-1].getRowAtPoint(ilog.views.util.swing.calendar.IlvJCalendarPanel, java.awt.Point)
public Dimension getPreferredSize(JComponent c)
getPreferredSize
in class ComponentUI
public Dimension getMinimumSize(JComponent c)
getMinimumSize
in class ComponentUI
public Dimension getMaximumSize(JComponent c)
getMaximumSize
in class ComponentUI
protected final Calendar getFirstDayOfMonth()
protected final Calendar getFirstDayOfPanel()
public Calendar getCellDate(IlvJCalendarPanel calendarPanel, int row, int column)
row
and day-of-week column
.
If the specified cell coordinates are out of range, then null
is returned.getCellDate
in class CalendarPanelUI
calendarPanel
- The calendar panel.row
- The week row.column
- The day-of-week column.protected void resizeAndRepaint()
revalidate
followed by repaint
on the calendar panel.public void paint(Graphics g, JComponent c)
paint
in class ComponentUI
g
- The paint graphics.c
- The IlvJCalendarPanel
.protected void paintHeader(Graphics g, Rectangle cellRect, int column, IlvCalendarHeaderRenderer headerRenderer, Calendar calendar)
CellRendererPane
to paint it.g
- The paint graphics.cellRect
- The bounds of the header cell.column
- The column index of the day-of-week header cell being drawn.headerRenderer
- The day-of-week column header renderer.calendar
- The calendar value of the day-of-week column.protected void paintCell(Graphics g, Rectangle cellRect, int row, int column, IlvCalendarCellRenderer cellRenderer, Calendar calendar, boolean prevMonth, boolean nextMonth, boolean selected)
CellRendererPane
to paint it.g
- The paint graphics.cellRect
- The bounds of the day cell.row
- The row index of the cell being drawn.column
- The column index of the cell being drawn.cellRenderer
- The day cell renderer.calendar
- The calendar value of the cell.prevMonth
- Indicates if the cell is in the month prior to the
current month displayed by the calendar panel.nextMonth
- Indicates if the cell is in the month after the
current month displayed by the calendar panel.selected
- Indicates if the cell is selected.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.