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

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
           
 boolean midletPaused
           
private  javax.microedition.lcdui.Command readRemoteCmdItemCommand
           
private  javax.microedition.lcdui.Command rootsCommand
           
private  javax.microedition.lcdui.StringItem rootsStringItem
           
private  javax.microedition.lcdui.StringItem stateStringItem
           
private  javax.microedition.lcdui.StringItem timeInfoStringItem
           
private  javax.microedition.lcdui.Command writeToDiscCommand
           
 
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 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 getReadRemoteCmdItemCommand()
          Returns an initiliazed instance of readRemoteCmdItemCommand component.
private  void getRoots()
           
 javax.microedition.lcdui.Command getRootsCommand()
          Returns an initiliazed instance of rootsCommand component.
 javax.microedition.lcdui.StringItem getRootsStringItem()
          Returns an initiliazed instance of rootsStringItem component.
 javax.microedition.lcdui.StringItem getStateStringItem()
          Returns an initiliazed instance of stateStringItem component.
 javax.microedition.lcdui.StringItem getTimeInfoStringItem()
          Returns an initiliazed instance of timeInfoStringItem component.
 javax.microedition.lcdui.Command getWriteToDiscCommand()
          Returns an initiliazed instance of writeToDiscCommand component.
private  void initialize()
          Initilizes the application.
 void pauseApp()
          Called when MIDlet is paused.
private  void readCommandFromDisc()
           
 void resumeMIDlet()
          Performs an action assigned to the Mobile Device - MIDlet Resumed point.
 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.
 void writeToDisc()
           
 
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

writeToDiscCommand

private javax.microedition.lcdui.Command writeToDiscCommand

infoItemCommand

private javax.microedition.lcdui.Command infoItemCommand

itemCommand

private javax.microedition.lcdui.Command itemCommand

rootsCommand

private javax.microedition.lcdui.Command rootsCommand

readRemoteCmdItemCommand

private javax.microedition.lcdui.Command readRemoteCmdItemCommand

form

private javax.microedition.lcdui.Form form

timeInfoStringItem

private javax.microedition.lcdui.StringItem timeInfoStringItem

stateStringItem

private javax.microedition.lcdui.StringItem stateStringItem

rootsStringItem

private javax.microedition.lcdui.StringItem rootsStringItem
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

getTimeInfoStringItem

public javax.microedition.lcdui.StringItem getTimeInfoStringItem()
Returns an initiliazed instance of timeInfoStringItem component.

Returns:
the initialized component instance

getWriteToDiscCommand

public javax.microedition.lcdui.Command getWriteToDiscCommand()
Returns an initiliazed instance of writeToDiscCommand 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

getRootsStringItem

public javax.microedition.lcdui.StringItem getRootsStringItem()
Returns an initiliazed instance of rootsStringItem component.

Returns:
the initialized component instance

getRootsCommand

public javax.microedition.lcdui.Command getRootsCommand()
Returns an initiliazed instance of rootsCommand component.

Returns:
the initialized component instance

getReadRemoteCmdItemCommand

public javax.microedition.lcdui.Command getReadRemoteCmdItemCommand()
Returns an initiliazed instance of readRemoteCmdItemCommand component.

Returns:
the initialized component instance

readCommandFromDisc

private void readCommandFromDisc()

getRoots

private void getRoots()

getDisplay

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

Returns:
the display instance.

exitMIDlet

public void exitMIDlet()
Exits MIDlet.


writeToDisc

public void writeToDisc()

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.