The paint process – MiG InfoCom MiG Calendar AShape Developer Manual User Manual

Page 11

Advertising
background image

MiG InfoCom AB

(Gaussian Blur) algorithm. It takes another

AShape

object as

the object to blur which makes it very flexible.

DividerAShape

– A simple shape to use as a divider

(horizontal or vertical). Made simple to be very quick and
easy to create.

JComponentAShape

– A special kind of shape that can

contain a normal

JComponent

. There are no special magic

here, it just sets the

JComponent

's bounds. Repaints are

handled automatically since its parent should be the same
parent as the

JComponentShape

is drawn onto.

ContainerAShape

– Does not paint anything itself, it is just

to be used to group a number of

AShape

s. All

AShape

s can

be container shapes but this one is simple and paints
nothing.

The Paint Process

The actual layout and paint process is much like the one in
Sun's Swing architecture except that it happens every repaint
and it doesn't invalidate any “dirty areas” as Swing does.

The steps as they normally happen in list form:

1. Some controller (maybe your code, maybe a

AShapeComponent

which is included) decides the

reference bounds the

RootAShape

should have and sets it

with a call to

setReferenceBounds(Rectangle)

.

2. If the

AShape

is to be used as a “stamp”, and thus will be

painting several entities, the

Interactor

(s) belonging to

the currently decorated entity (i.e. an

ActivityView

) will

be set on the

RootAShape

with

setInteractors(Interactor[])

.

3.

RootAShape.paint(..)

is called to start the layout +

paint process.

4. The

RootAShape

calls

layout()

on itself to first do a

layout run where all sub shapes' reference bounds are
calculated and set.

5. The

AShapeLayout

installed will layout the children and

then call

layout()

on them to make them layout them

selves. This process makes sure that the whole tree will be

AShape Developer Manual

Page 11 / 24

Advertising