Interactions – how the user interacts – MiG InfoCom MiG Calendar Tutorial User Manual
Page 18

MiG InfoCom AB
the javadocs.
All built in
AShape
implementations are serializable to XML with the
default Java beans persistence using the standard get/set naming
convention. There is no special
Delegate
needed for this.
AShape
s can be used in two ways. There is the normal one-to-one
usage pattern which means that one shape will be used to paint one
thing. This would not be scalable if there are 1.000 or maybe 10.000
things to paint as it would mean that many
AShape
s would have to
be created. That would consume an unnecessary amount of
resources. Therefore all
AShape
types are stampable. This means
that the same
AShape
instance can be used to paint multiple,
normally all, entities (e.g.
ActivityView
s). An
Interactor
is
used as the peer between the 'thing' to paint/decorate and the
AShape
. That
Interactor
is more light weight than the
AShape
and should contain the per-'thing' information, if any. It also has other
functionality, see the Interactions section below.
Attributes, such as
Paint
,
Font
and
PlaceRect
, of the
AShape
s
are stored in a
Map
in the
AbstractShape
class. A key is used for
getting and setting the attributes. Every
AShape
subclass documents
which keys to use to access the attributes interesting for that class.
For further details on how to build and use
AShape
s see the
AShape
tutorial and the Getting Started Guide.
Interactions – how the user interacts
The Interaction framework is a Action/Command-like pattern optimized
to fit the MiG Calendar component.
To start with we have the
Interactor
hierarchy of classes, which
includes
ActivityInteractor,
MouseKeyInteractor
and
TimerInteractor
. An
Interactor
is the peer to some
functionality that need to be monitored and interacted with. For
instance the
MouseKeyInteractor
monitors mouse and key
events and for every one of them it evaluates if there is a registered
Interaction
that should be triggered.
An
Interaction
, not to be intermixed with
Interactor
, mainly
consists of three parts:
1. A trigger of some kind (e.g. mouse move)
2. An
Expression
that needs to be evaluated to
true
. E.g.
MouseButton == 1
MiG Calendar Tutorial
Page 18 / 24