All Packages Class Hierarchy This Package Previous Next Index
Class ca.bc.europa.awt.MonthCal
java.lang.Object
|
+----java.awt.Component
|
+----ca.bc.europa.awt.MonthCal
- public class MonthCal
- extends Component
- implements Runnable, ItemSelectable
The MonthCal
class displays a Calendar.
The look of the calendar is taken from an image, which
is chopped up into 1-31 day images, and recombined to
represent the chosen month (like a shuffle puzzel).
The component starts a thread to prepare the calendar
so that the calling code will not have to wait around
for initialization.
Example Calendar Image:
- See Also:
- Component, Runable, GregorianCalendar, Calendar
-
MonthCal(Image, int, int, int, int, int)
- MonthCal(calImage, cellWidth, cellHeight, titleHeight, year, month)
-
MonthCal(Image, int, int, int, int, int, ImageFilter, ImageFilter)
- MonthCal(calImage, cellWidth, cellHeight, titleHeight, year, month)
-
MonthCal(URL, int, int, int, int, int)
- MonthCal(imageURL, cellWidth, cellHeight, titleHeight, year, month)
-
MonthCal(URL, int, int, int, int, int, ImageFilter, ImageFilter)
- MonthCal(imageURL, cellWidth, cellHeight, titleHeight, year, month)
-
addItemListener(ItemListener)
- Add a listener for ItemEvent.
-
clear()
- Clear all selected dates.
-
getGregorianCalendar()
- Get the Gregorian calendar associated with the displayed calendar.
-
getLastDayOfMonth(GregorianCalendar)
- Get the last day of the current month.
-
getPreferredSize()
-
-
getSelectedDays()
- Get an array representing the selection states of the days.
-
getSelectedObjects()
- Return the selected date as an Object array.
-
mouseCallBack(MouseEvent)
-
-
paint(Graphics)
-
-
removeItemListener(ItemListener)
- Remove a listener for ItemEvent.
-
run()
- Load the image that defines the calendar and generate
all visuals.
-
set(int, int)
- Set the year and month of the calendar, the month is in classic
GregorianCalendar format of 0 to 11.
-
setDay(int, boolean)
- Set the selection state of a day.
-
setMultiSelect(boolean)
- Set the multi selection behaviour.
-
update(Graphics)
-
MonthCal
public MonthCal(Image calImage,
int width,
int height,
int tHeight,
int year,
int month,
ImageFilter def,
ImageFilter sel)
- MonthCal(calImage, cellWidth, cellHeight, titleHeight, year, month)
- Parameters:
- calImage - An image of a calendar, title on top, day boxes begin upper left and progress right, wrap every 7 days.
- cellWidth - The pixel width of a single day on the image.
- cellHeight - The pixel height of a single day on the image.
- titleHeight - The pixel height of the calendar title bar.
- year - The year of the calendar.
- month - The month of the calendar (0-11).
- def - The ImageFilter used to construct default day images.
- sel - The ImageFilter used to construct images for selected.
days.
MonthCal
public MonthCal(Image calImage,
int width,
int height,
int tHeight,
int year,
int month)
- MonthCal(calImage, cellWidth, cellHeight, titleHeight, year, month)
- Parameters:
- calImage - An image of a calendar, title on top, day boxes begin upper left and progress right, wrap every 7 days.
- cellWidth - The pixel width of a single day on the image.
- cellHeight - The pixel height of a single day on the image.
- titleHeight - The pixel height of the calendar title bar.
- year - The year of the calendar.
- month - The month of the calendar (0-11).
MonthCal
public MonthCal(URL imageURL,
int width,
int height,
int tHeight,
int year,
int month,
ImageFilter def,
ImageFilter sel)
- MonthCal(imageURL, cellWidth, cellHeight, titleHeight, year, month)
- Parameters:
- imageURL - A URL to an image of a calendar, title on top, day boxes begin upper left and progress right, wrap every 7 days.
- cellWidth - The pixel width of a single day on the image.
- cellHeight - The pixel height of a single day on the image.
- titleHeight - The pixel height of the calendar title bar.
- year - The year of the calendar.
- month - The month of the calendar (0-11).
- def - The ImageFilter used to construct default day images.
- sel - The ImageFilter used to construct images for selected.
days.
MonthCal
public MonthCal(URL imageURL,
int width,
int height,
int tHeight,
int year,
int month)
- MonthCal(imageURL, cellWidth, cellHeight, titleHeight, year, month)
- Parameters:
- imageURL - A URL to an image of a calendar, title on top, day boxes begin upper left and progress right, wrap every 7 days.
- cellWidth - The pixel width of a single day on the image.
- cellHeight - The pixel height of a single day on the image.
- titleHeight - The pixel height of the calendar title bar.
- year - The year of the calendar.
- month - The month of the calendar (0-11).
getPreferredSize
public Dimension getPreferredSize()
- Overrides:
- getPreferredSize in class Component
update
public void update(Graphics g)
- Overrides:
- update in class Component
paint
public void paint(Graphics g)
- Overrides:
- paint in class Component
run
public void run()
- Load the image that defines the calendar and generate
all visuals.
set
public void set(int year,
int month)
- Set the year and month of the calendar, the month is in classic
GregorianCalendar format of 0 to 11.
- Parameters:
- year - The year in YYYY format.
- month - The month 0 to 11, i.e. January == 0.
getGregorianCalendar
public GregorianCalendar getGregorianCalendar()
- Get the Gregorian calendar associated with the displayed calendar.
getSelectedDays
public boolean[] getSelectedDays()
- Get an array representing the selection states of the days.
setMultiSelect
public void setMultiSelect(boolean state)
- Set the multi selection behaviour. true state allows multiple
days to be selected at one time.
setDay
public void setDay(int day,
boolean toggle)
- Set the selection state of a day.
- Parameters:
- day - The day to be selected or deselected, from 0 to 30.
- toggle - The selection state.
getLastDayOfMonth
public int getLastDayOfMonth(GregorianCalendar g)
- Get the last day of the current month.
- Parameters:
- g - A GregorianCalendar that is set to the month you are
interested in.
getSelectedObjects
public Object[] getSelectedObjects()
- Return the selected date as an Object array.
- See Also:
- ItemSelectable
addItemListener
public void addItemListener(ItemListener l)
- Add a listener for ItemEvent.
- See Also:
- ItemSelectable
removeItemListener
public void removeItemListener(ItemListener l)
- Remove a listener for ItemEvent.
- See Also:
- ItemSelectable
clear
public void clear()
- Clear all selected dates.
no repaint is done
mouseCallBack
public void mouseCallBack(MouseEvent e)
All Packages Class Hierarchy This Package Previous Next Index