Ashape – attributed graphics graph – MiG InfoCom MiG Calendar Tutorial User Manual

Page 16

Advertising
background image

MiG InfoCom AB

simple to understand, they are objects that gets some bounds to paint
within and they do just that. Since everything (yes everything!) that is
painted in the

DefaultDateArea

is painted with

Decorator

s

the look is truly pluggable, even without sub classing it.

This also means that it is possible to decide on the order that the
different installed decorators should be called. This is done through
the mutable layer index, much like for layouts explained above.
Decorators will be sorted according to their layer index and then the
painting will be done in that order.

This means you can have the grid lines drawn above or under the

ActivityView

s and so on. Some decorators will only make sens

in a certain order, for instance the background decorator should
probably be invoked first.

MiG Calendar is delivered with around 15 different decorators, all
decorating some part of the

DateArea

GUI. Background, activity

views, grid lines, cell labels and the no-fit shape are some of them.

Also

Header

s, through the

AbstractDateHeader

, are painting

its contents with decorators.

The

Decorator

class hierarchy is somewhat extensive and

checking the UML diagram for is probably a must if you intend to write
your own decorators, at least if you want to get a some free boiler
plate from one of the current decorators.

AShape – attributed graphics graph

The

AShape

framework is one of the more extensive sub

components within the MiG Calendar component. It is powerful
enough to write really innovative GUIs in, for instance be vector based
user interfaces with animations triggered by user interactions.

AShape is a complete stand alone component in its own right, with
use cases outside that of the MiG Calendar component. In this
calendar component it is used by the default activity painter to draw
the

ActivityView

s. It is also used by one type of

Header

Decorator

to draw text and backgrounds.

AShape

is an API for hierarchical graphics. Sub shapes relate to their

parent in that it will use its parent's bounds as a base for getting its
own bounds. Much of

JComponent

's design ideas are used in

AShape

, but

AShape

is a lot more light weight and more aimed at

fast Java2D graphics. There are also some similarities between the

MiG Calendar Tutorial

Page 16 / 24

Advertising