com.sun.perseus.demo
Class SplashCanvas

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Canvas
          extended by com.sun.perseus.demo.SplashCanvas

public class SplashCanvas
extends javax.microedition.lcdui.Canvas

The SplashCanvas class is used to display an image as soon as a MIDlet is started and, possibly, show information about the coming demo while that demo is loading.


Field Summary
(package private)  javax.microedition.lcdui.Image image
          The image this splash screen should show.
static long SPLASH_MIN_LENGTH
          The minimal amount of time to wait when a splash screen is displayed.
 
Fields inherited from class javax.microedition.lcdui.Canvas
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
SplashCanvas(javax.microedition.lcdui.Image image)
           
SplashCanvas(java.lang.String imageURL)
           
 
Method Summary
 void display(javax.microedition.lcdui.Display display)
           
 void paint(javax.microedition.lcdui.Graphics g)
           
 void showAndWait(javax.microedition.lcdui.Display display, javax.microedition.lcdui.Displayable displayable)
          Shows the splash screen and waits for SPLASH_MIN_LENGTH before restoring the input Displayable.
 void switchTo(javax.microedition.lcdui.Display display, javax.microedition.lcdui.Canvas newCanvas)
          Switches to the input Display after the minimal time has ellapsed.
 
Methods inherited from class javax.microedition.lcdui.Canvas
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyPressed, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setFullScreenMode, showNotify, sizeChanged
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, removeCommand, setCommandListener, setTicker, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPLASH_MIN_LENGTH

public static final long SPLASH_MIN_LENGTH
The minimal amount of time to wait when a splash screen is displayed.

See Also:
Constant Field Values

image

javax.microedition.lcdui.Image image
The image this splash screen should show.

Constructor Detail

SplashCanvas

public SplashCanvas(javax.microedition.lcdui.Image image)
Parameters:
image - the image this splash screen should show.

SplashCanvas

public SplashCanvas(java.lang.String imageURL)
Parameters:
imageURL - the url for the splash screen image.
Method Detail

paint

public void paint(javax.microedition.lcdui.Graphics g)
Specified by:
paint in class javax.microedition.lcdui.Canvas

display

public void display(javax.microedition.lcdui.Display display)
Parameters:
display - the Display on which this splash screen should paint.

switchTo

public void switchTo(javax.microedition.lcdui.Display display,
                     javax.microedition.lcdui.Canvas newCanvas)
Switches to the input Display after the minimal time has ellapsed.

Parameters:
display - the display to switch to.
newCanvas - the canvas to set after the minimal amount of time has ellapsed.

showAndWait

public void showAndWait(javax.microedition.lcdui.Display display,
                        javax.microedition.lcdui.Displayable displayable)
Shows the splash screen and waits for SPLASH_MIN_LENGTH before restoring the input Displayable.

Parameters:
display - the display on which to show the splash screen.
displayable - the displayable to restore after the help screen has been shown.