de.enough.polish.ui.screenanimations
Class ParticleScreenChangeAnimation

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Canvas
          extended by de.enough.polish.ui.Canvas
              extended by de.enough.polish.ui.ScreenChangeAnimation
                  extended by de.enough.polish.ui.screenanimations.ParticleScreenChangeAnimation
All Implemented Interfaces:
Displayable, Runnable

public class ParticleScreenChangeAnimation
extends ScreenChangeAnimation

Magnifies the last screen into single pixels that remain in their original size. Similar to Tempest 2000 messages.

Activate this animation by specifying it in the corresponding screen's style:

 .myAlert {
                //#if polish.midp2
                        screen-change-animation: particle;
                //#endif
 }
 

Copyright (c) 2009 Enough Software

 history
        28-July-2007 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
 
Fields inherited from class de.enough.polish.ui.ScreenChangeAnimation
abort, display, isForwardAnimation, lastCanvasImage, lastCanvasRgb, lastContentX, lastContentY, nextCanvas, nextCanvasImage, nextCanvasRgb, nextContentX, nextContentY, nextDisplayable, screenHeight, screenWidth, supportsDifferentScreenSizes, useLastCanvasRgb, useNextCanvasRgb
 
Fields inherited from class de.enough.polish.ui.Canvas
_commands, DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP
 
Constructor Summary
ParticleScreenChangeAnimation()
          Creates a new animation
 
Method Summary
protected  boolean animate()
          Animates this animation.
protected  void onShow(Style style, Display dsplay, int width, int height, Displayable lstDisplayable, Displayable nxtDisplayable, boolean isForward)
          Starts the animation.
 void paintAnimation(Graphics g)
          Paints the animation.
 
Methods inherited from class de.enough.polish.ui.ScreenChangeAnimation
abort, hideNotify, keyPressed, keyReleased, keyRepeated, paint, pointerDragged, pointerPressed, pointerReleased, run, setStyle, showNotify, sizeChanged, toImage, updateNextScreen
 
Methods inherited from class de.enough.polish.ui.Canvas
_hideNotify, _hideNotifyExternal, _showNotify, addCommand, getCommandListener, getCommands, getGameAction, getHeight, getKeyCode, getKeyName, getPolishTicker, getTitle, getWidth, handlePointerTouchDown, handlePointerTouchUp, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotifyExternal, isDoubleBuffered, isShown, removeCommand, setCommandListener, setFullScreenMode, setTicker, setTitle
 
Methods inherited from class javax.microedition.lcdui.Canvas
repaint, repaint, serviceRepaints
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, getTicker, removeCommand, setCommandListener, setTicker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParticleScreenChangeAnimation

public ParticleScreenChangeAnimation()
Creates a new animation

Method Detail

onShow

protected void onShow(Style style,
                      Display dsplay,
                      int width,
                      int height,
                      Displayable lstDisplayable,
                      Displayable nxtDisplayable,
                      boolean isForward)
Description copied from class: ScreenChangeAnimation
Starts the animation. Please note that an animation can be re-used for several screens.

Overrides:
onShow in class ScreenChangeAnimation
Parameters:
style - the associated style.
dsplay - the display, which is used for setting this animation
width - the screen's width
height - the screen's height
lstDisplayable - the screen that has been shown until now
nxtDisplayable - the next screen that should be displayed when this animation finishes (as a Displayable)
isForward - true when the animation should run in the normal direction/mode - false if it should run backwards

animate

protected boolean animate()
Description copied from class: ScreenChangeAnimation
Animates this animation.

Specified by:
animate in class ScreenChangeAnimation
Returns:
true when the animation should continue, when false is returned the animation will be stopped and the next screen will be shown instead.

paintAnimation

public void paintAnimation(Graphics g)
Description copied from class: ScreenChangeAnimation
Paints the animation.

Specified by:
paintAnimation in class ScreenChangeAnimation
Parameters:
g - the graphics context