Package totalcross.ui.anim
Class ControlAnimation
- java.lang.Object
-
- totalcross.ui.anim.ControlAnimation
-
- All Implemented Interfaces:
UpdateListener
- Direct Known Subclasses:
FadeAnimation,PathAnimation
public abstract class ControlAnimation extends java.lang.Object implements UpdateListener
Abstract class used to create and handle animations- Since:
- TotalCross 3.03
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceControlAnimation.AnimationFinished
-
Field Summary
Fields Modifier and Type Field Description protected ControlcintdelayAfterFinishA delay issued right after the animation finishesprotected intexecutedTimeprotected booleanreleaseScreenShotprotected inttotalTimebooleanuseOffscreenUse or not the offscreen.
-
Constructor Summary
Constructors Constructor Description ControlAnimation(Control c)ControlAnimation(Control c, ControlAnimation.AnimationFinished animFinish)ControlAnimation(Control c, ControlAnimation.AnimationFinished animFinish, int totalTime)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidanimate()protected doublecomputeSpeed(double distance)voidsetAnimationFinishedAction(ControlAnimation.AnimationFinished animationFinished)Sets the action that will be performed after the animation finishesvoidstart()voidstop(boolean abort)ControlAnimationthen(ControlAnimation other)voidupdateListenerTriggered(int elapsedMilliseconds)Called regularly by the system.ControlAnimationwith(ControlAnimation other)
-
-
-
Field Detail
-
c
protected Control c
-
totalTime
protected int totalTime
-
executedTime
protected int executedTime
-
releaseScreenShot
protected boolean releaseScreenShot
-
delayAfterFinish
public int delayAfterFinish
A delay issued right after the animation finishes
-
useOffscreen
public boolean useOffscreen
Use or not the offscreen.
-
-
Constructor Detail
-
ControlAnimation
public ControlAnimation(Control c, ControlAnimation.AnimationFinished animFinish, int totalTime)
-
ControlAnimation
public ControlAnimation(Control c, ControlAnimation.AnimationFinished animFinish)
-
ControlAnimation
public ControlAnimation(Control c)
-
-
Method Detail
-
start
public void start()
-
stop
public void stop(boolean abort)
-
computeSpeed
protected double computeSpeed(double distance)
-
with
public ControlAnimation with(ControlAnimation other)
-
then
public ControlAnimation then(ControlAnimation other)
-
updateListenerTriggered
public void updateListenerTriggered(int elapsedMilliseconds)
Description copied from interface:UpdateListenerCalled regularly by the system.- Specified by:
updateListenerTriggeredin interfaceUpdateListener- Parameters:
elapsedMilliseconds- number of milliseconds since the last UpdateListenerTriggered call
-
animate
protected abstract void animate()
-
setAnimationFinishedAction
public void setAnimationFinishedAction(ControlAnimation.AnimationFinished animationFinished)
Sets the action that will be performed after the animation finishes- Parameters:
animationFinished-
-
-