Customizing how the activities look – MiG InfoCom MiG Calendar JavaBeans Guide User Manual

Page 34

Advertising
background image

MiG InfoCom AB

The rest of the properties for DemoDataBean are pretty
straight forward and will not be reiterated here. For more info
on these properties please look at the API JavaDoc for the
bean.

Customizing how the Activities Look

The rendering of and interaction with the activities in the
date area is very flexible in the MiG Calendar component.
The implementation can be intercepted and/or exchanged at
many levels. Everything from exchanging the whole painting
cycle to just tweaking some colors on the activity.

By default there is a component-like framework called
AShape that handles the rendering and much of the plumbing
for the interactions. An AShape class (actually a RootAShape)
is used to draw and interact with the user. This default
AShape can with the ActivityAShapeBean be configured to
accommodate for many different kinds of looks, see the
demo application for some examples. For more information
about the flexible framework that AShape represents see the

AShape Developers Guide

that is installed with this component.

The ActivityAShapeBean is a non-visual bean that is used to
configure an instance of a default AShape. Every
ActivityAShapeBean configures an AShape for a certain
PaintContext which is a property of the bean. All activities
when created can be set to use a certain paint context. An
activity with a certain paint context will be painted by an
AShape registered under that context. The null context is
the default one.

You create the bean as you would with all non-visual beans
which normally mean dragging it to the GUI form. The bean
doesn’t need to be set in any other bean; it operates on its
own.

There are three properties that take a PlaceRect type (an
interface) in this bean. Those are PlaceRect,
ShadowPlaceRect and TitlePlaceRect. They all define
where those rectangles reside relative to the total bounds of
the activity view. See the JavaDoc for PlaceRect and its
concrete implementations AbsRect, AlignRect and
AspectRatioRect to get a thorough explanation on how

MiG Calendar JavaBeans Guide

Page 34 / 45

Advertising