de.enough.polish.ui.screenanimations
Class BottomScreenChangeAnimation

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.BottomScreenChangeAnimation
All Implemented Interfaces:
Displayable, Runnable

public class BottomScreenChangeAnimation
extends ScreenChangeAnimation

Moves the new screen from the bottom to the top.

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

 .myAlert {
                screen-change-animation: bottom;
                bottom-screen-change-animation-speed: 4; ( 2 is default )
                bottom-screen-change-animation-move-previous: true; ( false is default )
 }
 

Copyright (c) Enough Software 2005 - 2009

 history
        27-May-2005 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
protected  int currentY
           
 
Fields inherited from class de.enough.polish.ui.ScreenChangeAnimation
abort, animationBackwardFunction, animationDuration, animationForwardFunction, DEFAULT_DURATION, DIRECTION_BACKWARD, DIRECTION_FORWARD, display, isForwardAnimation, lastCanvasImage, lastCanvasRgb, lastContentX, lastContentY, lastDisplayable, nextCanvas, nextCanvasImage, nextCanvasRgb, nextContentX, nextContentY, nextDisplayable, screenHeight, screenWidth, startTime, 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
BottomScreenChangeAnimation()
          Creates a new animation
 
Method Summary
protected  boolean animate(long passedTime, long duration)
          Animates this animation.
 void paintAnimation(Graphics g)
          Paints the animation.
protected  void setStyle(Style style)
          Sets the style for this animation.
 
Methods inherited from class de.enough.polish.ui.ScreenChangeAnimation
_keyPressed, _keyReleased, _keyRepeated, _pointerDragged, _pointerPressed, _pointerReleased, abort, calculateAnimationPoint, getNextDisplayable, hideNotify, onShow, paint, run, 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, keyPressed, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, removeCommand, repaint, 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
 

Field Detail

currentY

protected int currentY
Constructor Detail

BottomScreenChangeAnimation

public BottomScreenChangeAnimation()
Creates a new animation

Method Detail

setStyle

protected void setStyle(Style style)
Description copied from class: ScreenChangeAnimation
Sets the style for this animation. Subclasses can override this for adapting to different design settings.

Overrides:
setStyle in class ScreenChangeAnimation
Parameters:
style - the style

animate

protected boolean animate(long passedTime,
                          long duration)
Description copied from class: ScreenChangeAnimation
Animates this animation.

Specified by:
animate in class ScreenChangeAnimation
Parameters:
passedTime - the passed time in milliseconds
duration - the maximum duration of this animation
Returns:
true when the animation should continue, when false is returned the animation will be stopped and the next screen will be shown instead.
See Also:
ScreenChangeAnimation.calculateAnimationPoint(int, int, long, long)

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