Datearea – MiG InfoCom MiG Calendar Tutorial User Manual

Page 9

Advertising
background image

MiG InfoCom AB

only enables returning a

JComponent

and outlines how to dispose

of the header. This means that you have complete control if you want
to implement your own header. The following text explains the

AbstractDateHeader

and

ShapeDateHeader

which is the

default implementation used.

Primary and secondary dimension
Technically it is like a small version of a

DateArea

in that it is based

on a

Grid

. One dimension of the

header

is locked to the

DateArea

. For north and south

header

s the horizontal dimension

is locked and for east and west the vertical dimension is matched to
the

DateArea

. In the free (called secondary) dimension there can be

one or more rows. Each row can have its own set of properties such
as background, font, size, etc.

The cells in the primary (locked) dimensions can be automatically
merged. This is for example useful if you want the week number in the
header but are actually showing days in the date area. Every cell in
the row that have the same text (e.g. 'Week 23') will be merged.

Themes

Almost every aspect, and there are many, can be configured through

Theme

s. The header subclasses themselves are not

Theme

aware,

but

ThemeDateAreaContainer

configures them accordingly at

when they are created or recreated.

DateArea

The heart
The

DateArea

is the heart of the MiG Calendar framework. It binds

together almost all functionality. It doesn't actually implement that
much functionality, it contains references to objects that does the hard
work. It is a

JComponent

and as such it is dispatching mouse and

key events among other things. The

javadoc

for

DefaultDateArea

will be a good way to start since explaining all

functionality in text would be very abstract and hard to understand.
Some of the responsibilities for a DateArea is:

Catch and dispatch

InputEvent

s (e.g. Mouse- and

KeyEvents

) to the

Interaction

framework for further

processing.

Manage date ranges of different types, for instance Selected,
Pressed, MouseOver, Visible
and Selectable.

MiG Calendar Tutorial

Page 9 / 24

Advertising