Date spinners/combos and date groups, Creating demo activities and categories – MiG InfoCom MiG Calendar JavaBeans Guide User Manual

Page 32

Advertising
background image

MiG InfoCom AB

Date Spinners/Combos and Date Groups

There are two kinds of date spinners. One is a normal
JComboBox and can't be configured much regarding the
visuals. The other is a custom made spinner that can be
customized a lot. Both have approximately the same date
handling. You set the "active" calendar date/time field that
will be spinned/selected (i.e. MONTH) and also the date format
string that declares how the date will be shown (i.e. "yyyy-
MM-dd" or "'Year:' yyyy").

If you want to connect spinners to show/edit the same
date/time (e.g. one that shows the year, one that shows the
month and one that shows the day-of-month) you create a
DateGroupConnectorBean (which is non-visual) and set that
bean's reference in the dateGroupConnector property of the
spinner. This ensures that all spinners/combos will have the
exact date/time and if one is changed the all change.

The DateGroupConnectorBean can also be connected to a
date area (e.g. DateAreaBean) and if the date/time is
changed the visible date range in that date area will be
changed to reflect the date/time in the spinners/combo.
Since the spinners in a group only represents a single
date/time, and not a range, there are properties in the
connector bean that can be set to "expand" the date/time to
a boundary in a very flexible way. You can of course also
listen for the date changes with a DateChangeListener and
set the visual date range on the date area manually.

Creating Demo Activities and Categories

To be able to see how some properties affect for instance
activities there is a need to create demo activities and
categories. There is a JavaBean component created just for

MiG Calendar JavaBeans Guide

Page 32 / 45

Illustration 14: Example of spinners. They are extremely

customizable.

Advertising