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
private  boolean active
           
(package private)  CallBacks callBacks
           
private  javax.microedition.lcdui.Command doSnapShotCommand
           
private  javax.microedition.lcdui.Command exitCommand
           
private  javax.microedition.lcdui.Form form
           
private  javax.microedition.lcdui.Command getRootsItemCommand
           
(package private)  int h
           
(package private)  javax.microedition.lcdui.Image image
           
(package private)  byte[] imageByte
           
private  javax.microedition.lcdui.Command infoItemCommand
           
private  javax.microedition.lcdui.StringItem infoStringItem
           
private  javax.microedition.lcdui.Command itemCommand
           
 boolean midletPaused
           
private  javax.microedition.media.Player player
           
(package private)  int[] rgbData
           
private  javax.microedition.lcdui.Command screenCommand
           
private  javax.microedition.media.control.VideoControl videoControl
           
(package private)  int w
           
 
Constructor Summary
RobotMIDlet()
          The RobotMIDlet constructor.
 
Method Summary
 void captureImage()
           
 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 doSnapShot()
           
 void exitMIDlet()
          Exits MIDlet.
 javax.microedition.lcdui.Display getDisplay()
          Returns a display instance.
 javax.microedition.lcdui.Command getDoSnapShotCommand()
          Returns an initiliazed instance of doSnapShotCommand 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 getGetRootsItemCommand()
          Returns an initiliazed instance of getRootsItemCommand 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.
private  void getRoots()
           
 javax.microedition.lcdui.Command getScreenCommand()
          Returns an initiliazed instance of screenCommand component.
 void initCamera()
           
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.
(package private)  void start()
           
 void startApp()
          Called when MIDlet is started.
 void startMIDlet()
          Performs an action assigned to the Mobile Device - MIDlet Started point.
(package private)  void stop()
           
 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

player

private javax.microedition.media.Player player

videoControl

private javax.microedition.media.control.VideoControl videoControl

active

private boolean active

imageByte

byte[] imageByte

image

javax.microedition.lcdui.Image image

w

int w

h

int h

rgbData

int[] rgbData

callBacks

CallBacks callBacks

exitCommand

private javax.microedition.lcdui.Command exitCommand

doSnapShotCommand

private javax.microedition.lcdui.Command doSnapShotCommand

infoItemCommand

private javax.microedition.lcdui.Command infoItemCommand

itemCommand

private javax.microedition.lcdui.Command itemCommand

screenCommand

private javax.microedition.lcdui.Command screenCommand

getRootsItemCommand

private javax.microedition.lcdui.Command getRootsItemCommand

form

private javax.microedition.lcdui.Form form

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

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

getDoSnapShotCommand

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

getInfoStringItem

public javax.microedition.lcdui.StringItem getInfoStringItem()
Returns an initiliazed instance of infoStringItem component.

Returns:
the initialized component instance

getScreenCommand

public javax.microedition.lcdui.Command getScreenCommand()
Returns an initiliazed instance of screenCommand component.

Returns:
the initialized component instance

getGetRootsItemCommand

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


getRoots

private void getRoots()

doSnapShot

public void doSnapShot()

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.

initCamera

public void initCamera()

start

void start()

stop

void stop()

captureImage

public void captureImage()

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