bluegammon.gui.animation
Class Animation

java.lang.Object
  extended bybluegammon.gui.animation.Animation
Direct Known Subclasses:
AbstractDicesAnim, CommitMoveAnim, CursorAnim, PieceMoveAnim, WinnerAnim, WinnerPieceMoveAnim

public abstract class Animation
extends java.lang.Object

This abstract class represents an animation and is handled by the AnimationEngine

Author:
Peter Andersson

Constructor Summary
Animation()
           
 
Method Summary
 void callNext(long t)
          Called from animation engine
abstract  long getInterval()
          Returns interval time in milliseconds when the animation should be updated, i.e. the next method is invoked.
 long getLastInvoke()
          Returns last update in milliseconds
abstract  boolean isFinished()
          Probes to check if the animation can be removed
abstract  void next()
          Called each time the animation should be updated.
 void onExit()
          Override this to invoke functionality at the end of this animation
 void onStart()
          Override this to invoke functionality at the start of this animation
abstract  void paint(javax.microedition.lcdui.Graphics g)
          Draws the animation using the specified graphics context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Animation

public Animation()
Method Detail

onStart

public void onStart()
Override this to invoke functionality at the start of this animation


paint

public abstract void paint(javax.microedition.lcdui.Graphics g)
Draws the animation using the specified graphics context.

Parameters:
g - The graphics context.

next

public abstract void next()
Called each time the animation should be updated.


isFinished

public abstract boolean isFinished()
Probes to check if the animation can be removed

Returns:
true if finished, false if still active

getInterval

public abstract long getInterval()
Returns interval time in milliseconds when the animation should be updated, i.e. the next method is invoked.

Returns:
update interval in milliseconds.

callNext

public void callNext(long t)
Called from animation engine

Parameters:
t - Current time

getLastInvoke

public long getLastInvoke()
Returns last update in milliseconds

Returns:
The time of last update

onExit

public void onExit()
Override this to invoke functionality at the end of this animation