MiG InfoCom MiG Calendar AShape Developer Manual User Manual

Page 20

Advertising
background image

MiG InfoCom AB

in absolute time, they will never lag behind. If the computer
can't keep up, for whatever reason, frames are dropped to
keep up rather than played in turn.

Time lines can also progress non-linear. This means that you
can provide any custom

Function

that will outline the

progress of the animation. For instance it can slow down or
accelerate. It can even have advance sinus-like equations to
make animations oscillate.

Animation

Animation

is an interface that describes how one object

fades into another, given a value between

0.0

and

1.0

(

float

). Subclasses provides the actual implementation that

does the transformation. For instance

ColorAnimation

can

“animate” between two

Color

s.

The

AbstractAnimation

class that all current

Animation

s

subclass provides for caching the values if the frame count is
provided. This is normally a must for animating

Image

transitions for instance but it can of course be turned off.

The Animator
The

Animator

class is an abstract class that provides basic

boiler plate functionality for controlling an animation. The

OverrideAnimator

is the default implementation and it

provides everything needed to animate some aspect of an

AShape

through overrides (as explained above). It does the

animating in an indirect manner, by overriding properties on
the

AShape

. It uses its own

Thread

to set overrides in the

Interactor

, which means that for instance one activity can

(optionally) be animated when mouse over:ed. Setting the
override triggers a repaint and the next frame will be shown.

This method of animation means that any property of

AShape

that can be overridden can be animated, and since

all properties can be overridden, they can all be animated.

There are seven different types of Animations delivered with
the framework and it is very simple to write your own. You
just have to extend

AbstractAnimation

and write one

method that returns the object that corresponds to the

float

value (

0..0

to

1.0

).

Time Lines
A

TimeLine

denotes how frame numbers should relate to

AShape Developer Manual

Page 20 / 24

Advertising