jmunit.framework.cldc10
Class Screen

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Canvas
          extended by jmunit.framework.cldc10.Screen
All Implemented Interfaces:
java.lang.Runnable, javax.microedition.lcdui.CommandListener

public final class Screen
extends javax.microedition.lcdui.Canvas
implements javax.microedition.lcdui.CommandListener, java.lang.Runnable

The purpose of this class is generate all the framework's interface. It's a sub-class of canvas that prints the necessary informations in the simulator screen.

Since:
JMUnit 1.0

Field Summary
 
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
Screen(java.lang.String name, Test test)
          The default constructor.
 
Method Summary
 void commandAction(javax.microedition.lcdui.Command command, javax.microedition.lcdui.Displayable displayable)
          This method is responsible for handling input events.
protected  void paint(javax.microedition.lcdui.Graphics graphics)
          The paint method of Screen is the responsible for painting the interface.
 void run()
          The run method is responsible for execute the tests.
 
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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Screen

public Screen(java.lang.String name,
              Test test)
The default constructor. It initializes some variables and configures the interface's commands.

Parameters:
name - The name of the test.
test - The test that must be executed.
Since:
JMUnit 1.0
Method Detail

paint

protected void paint(javax.microedition.lcdui.Graphics graphics)
The paint method of Screen is the responsible for painting the interface. It overrides the paint method of Canvas. It's called by the framework when it's started and in ever test method execution. Currently, it draws the whole screen in all the cases, but in future versions, the paint method is going to change only some parts, for perfomance tuning.

Specified by:
paint in class javax.microedition.lcdui.Canvas
Since:
JMUnit 1.0

commandAction

public void commandAction(javax.microedition.lcdui.Command command,
                          javax.microedition.lcdui.Displayable displayable)
This method is responsible for handling input events. It closes the app if the Exit button is pressed or start a new execution of the tests, if the Test button is pressed. Never press the last button while the tests are been executed, because it may brings anomalous behavior.

Specified by:
commandAction in interface javax.microedition.lcdui.CommandListener
Since:
JMUnit 1.0

run

public void run()
The run method is responsible for execute the tests. It creates a normal scenario for doing it, erasing any possible old information of a previous execution and, then, execute again (or for the first time).

Specified by:
run in interface java.lang.Runnable
Since:
JMUnit 1.0