www.RoboHobby.com - Java ME/SE robotics project

com.robohobby.me
Class RobotMIDlet

java.lang.Object
  extended by javax.microedition.midlet.MIDlet
      extended by com.robohobby.me.RobotMIDlet
All Implemented Interfaces:
javax.microedition.lcdui.CommandListener

public class RobotMIDlet
extends javax.microedition.midlet.MIDlet
implements javax.microedition.lcdui.CommandListener

RobotMIDlet

Author:
Oleg Lyubchenko


Field Summary
(package private)  CallBacks callBacks
           
private  javax.microedition.lcdui.Command exitCommand
           
private  javax.microedition.lcdui.Form form
           
private  javax.microedition.lcdui.Command infoItemCommand
           
private  javax.microedition.lcdui.Command itemCommand
           
(package private)  int keyCounter
           
 boolean midletPaused
           
(package private)  RobotTimerTask robotTimerTask
           
private  javax.microedition.lcdui.Command startStopTimerCommand
           
private  javax.microedition.lcdui.StringItem stateStringItem
           
(package private)  java.util.Timer timer
           
(package private)  int timerDelay
           
private  javax.microedition.lcdui.StringItem timerInfoStringItem
           
(package private)  boolean timerIsRunning
           
 
Constructor Summary
RobotMIDlet()
          The RobotMIDlet constructor.
 
Method Summary
 void commandAction(javax.microedition.lcdui.Command command, javax.microedition.lcdui.Displayable displayable)
          Called by a system to indicated that a command has been invoked on a particular displayable.
 void destroyApp(boolean unconditional)
          Called to signal the MIDlet to terminate.
 void doStartStopTimer()
           
 void exitMIDlet()
          Exits MIDlet.
 javax.microedition.lcdui.Display getDisplay()
          Returns a display instance.
 javax.microedition.lcdui.Command getExitCommand()
          Returns an initiliazed instance of exitCommand component.
 javax.microedition.lcdui.Form getForm()
          Returns an initiliazed instance of form component.
 javax.microedition.lcdui.Command getInfoItemCommand()
          Returns an initiliazed instance of infoItemCommand component.
 javax.microedition.lcdui.Command getItemCommand()
          Returns an initiliazed instance of itemCommand component.
 javax.microedition.lcdui.Command getStartStopTimerCommand()
          Returns an initiliazed instance of startStopTimerCommand component.
 javax.microedition.lcdui.StringItem getStateStringItem()
          Returns an initiliazed instance of stateStringItem component.
 javax.microedition.lcdui.StringItem getTimerInfoStringItem()
          Returns an initiliazed instance of timerInfoStringItem component.
private  void initialize()
          Initilizes the application.
 void pauseApp()
          Called when MIDlet is paused.
 void resumeMIDlet()
          Performs an action assigned to the Mobile Device - MIDlet Resumed point.
 void setTimerInfo(java.lang.String timerInfo)
           
 void startApp()
          Called when MIDlet is started.
 void startMIDlet()
          Performs an action assigned to the Mobile Device - MIDlet Started point.
 void switchDisplayable(javax.microedition.lcdui.Alert alert, javax.microedition.lcdui.Displayable nextDisplayable)
          Switches a current displayable in a display.
 
Methods inherited from class javax.microedition.midlet.MIDlet
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

midletPaused

public boolean midletPaused

callBacks

CallBacks callBacks

exitCommand

private javax.microedition.lcdui.Command exitCommand

startStopTimerCommand

private javax.microedition.lcdui.Command startStopTimerCommand

itemCommand

private javax.microedition.lcdui.Command itemCommand

infoItemCommand

private javax.microedition.lcdui.Command infoItemCommand

form

private javax.microedition.lcdui.Form form

timerInfoStringItem

private javax.microedition.lcdui.StringItem timerInfoStringItem

stateStringItem

private javax.microedition.lcdui.StringItem stateStringItem

timerIsRunning

boolean timerIsRunning

timer

java.util.Timer timer

timerDelay

int timerDelay

keyCounter

int keyCounter

robotTimerTask

RobotTimerTask robotTimerTask
Constructor Detail

RobotMIDlet

public RobotMIDlet()
The RobotMIDlet constructor.

Method Detail

initialize

private void initialize()
Initilizes the application. It is called only once when the MIDlet is started. The method is called before the startMIDlet method.


startMIDlet

public void startMIDlet()
Performs an action assigned to the Mobile Device - MIDlet Started point.


resumeMIDlet

public void resumeMIDlet()
Performs an action assigned to the Mobile Device - MIDlet Resumed point.


switchDisplayable

public void switchDisplayable(javax.microedition.lcdui.Alert alert,
                              javax.microedition.lcdui.Displayable nextDisplayable)
Switches a current displayable in a display. The display instance is taken from getDisplay method. This method is used by all actions in the design for switching displayable.

Parameters:
alert - the Alert which is temporarily set to the display; if null, then nextDisplayable is set immediately
nextDisplayable - the Displayable to be set

commandAction

public void commandAction(javax.microedition.lcdui.Command command,
                          javax.microedition.lcdui.Displayable displayable)
Called by a system to indicated that a command has been invoked on a particular displayable.

Specified by:
commandAction in interface javax.microedition.lcdui.CommandListener
Parameters:
command - the Command that was invoked
displayable - the Displayable where the command was invoked

getExitCommand

public javax.microedition.lcdui.Command getExitCommand()
Returns an initiliazed instance of exitCommand component.

Returns:
the initialized component instance

getForm

public javax.microedition.lcdui.Form getForm()
Returns an initiliazed instance of form component.

Returns:
the initialized component instance

getTimerInfoStringItem

public javax.microedition.lcdui.StringItem getTimerInfoStringItem()
Returns an initiliazed instance of timerInfoStringItem component.

Returns:
the initialized component instance

getStartStopTimerCommand

public javax.microedition.lcdui.Command getStartStopTimerCommand()
Returns an initiliazed instance of startStopTimerCommand component.

Returns:
the initialized component instance

getItemCommand

public javax.microedition.lcdui.Command getItemCommand()
Returns an initiliazed instance of itemCommand component.

Returns:
the initialized component instance

getInfoItemCommand

public javax.microedition.lcdui.Command getInfoItemCommand()
Returns an initiliazed instance of infoItemCommand component.

Returns:
the initialized component instance

getStateStringItem

public javax.microedition.lcdui.StringItem getStateStringItem()
Returns an initiliazed instance of stateStringItem component.

Returns:
the initialized component instance

getDisplay

public javax.microedition.lcdui.Display getDisplay()
Returns a display instance.

Returns:
the display instance.

exitMIDlet

public void exitMIDlet()
Exits MIDlet.


doStartStopTimer

public void doStartStopTimer()

setTimerInfo

public void setTimerInfo(java.lang.String timerInfo)

startApp

public void startApp()
Called when MIDlet is started. Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.

Specified by:
startApp in class javax.microedition.midlet.MIDlet

pauseApp

public void pauseApp()
Called when MIDlet is paused.

Specified by:
pauseApp in class javax.microedition.midlet.MIDlet

destroyApp

public void destroyApp(boolean unconditional)
Called to signal the MIDlet to terminate.

Specified by:
destroyApp in class javax.microedition.midlet.MIDlet
Parameters:
unconditional - if true, then the MIDlet has to be unconditionally terminated and all resources has to be released.

Copyright © 2004-2008 OLeg Lyubchenko, Anton Lyubchenko. All Rights Reserved.