bluegammon.gui.animation
Class CursorAnim

java.lang.Object
  extended bybluegammon.gui.animation.Animation
      extended bybluegammon.gui.animation.CursorAnim

public class CursorAnim
extends Animation

Animation of the cursors indicating the source and destination index of a possible movement.

Author:
Peter Andersson

Constructor Summary
CursorAnim(int source, int dest, int bxOnSrc, int bxOnDst, boolean white)
          Creates a new cursor animation indicating where user moves a piece from and where the piece will end up.
 
Method Summary
 long getInterval()
          Returns interval time in milliseconds when the animation should be updated, i.e. the next method is invoked.
static void init(int cursorSize)
          Initializes this animation with the size of the cursor, depending on the canvas size of this device.
 boolean isFinished()
          Probes to check if the animation can be removed
 void next()
          Called each time the animation should be updated.
 void paint(javax.microedition.lcdui.Graphics g)
          Draws the animation using the specified graphics context.
 void stop()
          Stops this cursor animation.
 
Methods inherited from class bluegammon.gui.animation.Animation
callNext, getLastInvoke, onExit, onStart
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CursorAnim

public CursorAnim(int source,
                  int dest,
                  int bxOnSrc,
                  int bxOnDst,
                  boolean white)
Creates a new cursor animation indicating where user moves a piece from and where the piece will end up.

Parameters:
source - Source index of piece.
dest - Destination index of piece.
bxOnSrc - Number of pieces on source row.
bxOnDst - Number of pieces on destination row.
white - True for white player, false for black.
Method Detail

init

public static void init(int cursorSize)
Initializes this animation with the size of the cursor, depending on the canvas size of this device.

Parameters:
cursorSize - The size of the cursor.

paint

public void paint(javax.microedition.lcdui.Graphics g)
Description copied from class: Animation
Draws the animation using the specified graphics context.

Specified by:
paint in class Animation
Parameters:
g - The graphics context.

next

public void next()
Description copied from class: Animation
Called each time the animation should be updated.

Specified by:
next in class Animation

isFinished

public boolean isFinished()
Description copied from class: Animation
Probes to check if the animation can be removed

Specified by:
isFinished in class Animation
Returns:
true if finished, false if still active

getInterval

public long getInterval()
Description copied from class: Animation
Returns interval time in milliseconds when the animation should be updated, i.e. the next method is invoked.

Specified by:
getInterval in class Animation
Returns:
update interval in milliseconds.

stop

public void stop()
Stops this cursor animation.