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 doHttpRequestCommand
           
private  javax.microedition.lcdui.Command exitCommand
           
private  javax.microedition.lcdui.Form form
           
private  javax.microedition.lcdui.Command infoItemCommand
           
private  javax.microedition.lcdui.StringItem infoStringItem
           
private  javax.microedition.lcdui.Command itemCommand
           
 boolean midletPaused
           
private  javax.microedition.lcdui.StringItem resultStringItem
           
private  javax.microedition.lcdui.StringItem urlInfoStringItem
           
 
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.
private  void doHttpRequestCommand()
           
 void exitMIDlet()
          Exits MIDlet.
 javax.microedition.lcdui.Display getDisplay()
          Returns a display instance.
 javax.microedition.lcdui.Command getDoHttpRequestCommand()
          Returns an initiliazed instance of doHttpRequestCommand component.
 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.StringItem getInfoStringItem()
          Returns an initiliazed instance of infoStringItem component.
 javax.microedition.lcdui.Command getItemCommand()
          Returns an initiliazed instance of itemCommand component.
 javax.microedition.lcdui.StringItem getResultStringItem()
          Returns an initiliazed instance of resultStringItem component.
 javax.microedition.lcdui.StringItem getUrlInfoStringItem()
          Returns an initiliazed instance of urlInfoStringItem 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 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

doHttpRequestCommand

private javax.microedition.lcdui.Command doHttpRequestCommand

infoItemCommand

private javax.microedition.lcdui.Command infoItemCommand

itemCommand

private javax.microedition.lcdui.Command itemCommand

form

private javax.microedition.lcdui.Form form

urlInfoStringItem

private javax.microedition.lcdui.StringItem urlInfoStringItem

resultStringItem

private javax.microedition.lcdui.StringItem resultStringItem

infoStringItem

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

doHttpRequestCommand

private void doHttpRequestCommand()

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

getUrlInfoStringItem

public javax.microedition.lcdui.StringItem getUrlInfoStringItem()
Returns an initiliazed instance of urlInfoStringItem component.

Returns:
the initialized component instance

getDoHttpRequestCommand

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

getResultStringItem

public javax.microedition.lcdui.StringItem getResultStringItem()
Returns an initiliazed instance of resultStringItem component.

Returns:
the initialized component instance

getInfoStringItem

public javax.microedition.lcdui.StringItem getInfoStringItem()
Returns an initiliazed instance of infoStringItem 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.


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.