MiG InfoCom MiG Calendar JavaBeans Guide User Manual

Page 18

Advertising
background image

MiG InfoCom AB

month(s) and year(s) views are all implemented by this
bean; it is only configured in different ways. This means that
the structure has to be expressed in a uniform and flexible
way. When you add a DateAreaBean to the GUI form it will
show a box with the most important information. This is a
good and simple way to see how the DateAreaBean is
configured.

DateGrid Structure

First there’s the notion of primary and secondary dimension,
both of which can be either horizontal or vertical but never
same. If the primary dimension is horizontal this means that
time progresses horizontally until (optionally) wrapped to the
next row. For instance text flows like this and normally year
and month views do as well. The secondary dimension is the
dimension that increases when time is wrapped at the border
of the date area. This is comparable to word wrap in normal
text. For a day(s) view that has the hours progressing
downwards the property PrimaryDimension would be set to
SwingConstants.VERTICAL.

Once primary/secondary dimension has been set (we only
need to set the primary as the secondary becomes the
“other” dimension) we must define how much time a cell
should represent. This is always seen in the primary
dimension. For instance in a month view this might be 1 day.
In a day view it might be 30 minutes or 1 hour. So if the
property PrimaryDimensionCellType is set to
DateRangeI.RANGE_TYPE_MINUTE and
PrimaryDimensionCellTypeCount is set to 30 we are on our
way to create a day(s) view where each cell span 30
minutes
.

When we know how much time passes over a cell we need to
define if the time should wrap, and if so, at what date range
type to do so. In a day(s) view time will wrap to a new
column for every day so we would set WrapBoundary
property to DateRangeI.RANGE_TYPE_DAY. In a month view
normally one week is shown each row so then WrapBoundary
would be set to DateRangeI.RANGE_TYPE_WEEK. The wrap
boundary need to be a unit that is always of equal size, so
month would not work since months are of different sizes.
This is because the Grid structure always has to be “square”.

The properties explained so far defines the grid cells used to

MiG Calendar JavaBeans Guide

Page 18 / 45

Advertising