org.kalmeo.kuix.core
Class KuixMIDlet

java.lang.Object
  extended by MIDlet
      extended by org.kalmeo.kuix.core.KuixMIDlet
All Implemented Interfaces:
KuixInitializer

public abstract class KuixMIDlet
extends MIDlet
implements KuixInitializer

This class derived the J2ME MIDlet and is the base of all Kuix applications. Simply derived this class to start your own Kuix application.

Author:
bbeaulant

Constructor Summary
KuixMIDlet()
          Construct a KuixMIDlet
 
Method Summary
 void commandAction(Command command, Displayable displayable)
           
protected  KuixConverter createNewConverterInstance()
          Returns a new KuixConverter object instance.
protected  void destroyApp(boolean unconditional)
           
 void destroyImpl()
          Invoked to destroy the MIDlet implementation.
 void fatal(java.lang.String message)
          Display a basic lcdui fatal error alert popup with the given message.
 void fatal(java.lang.String message, java.lang.Throwable throwable)
          Display a basic lcdui fatal error alert popup with the given message and throwable.
 java.lang.String getAppVersion()
          Returns the MIDlet version extracted from jad properties.
static KuixMIDlet getDefault()
           
 Display getDisplay()
          Returns the display object instance.
 int getInitializationBackgroundColor()
          Returns the initalization background color.
 java.lang.String getInitializationImageFile()
          Returns the initalization message (e.g.
 java.lang.String getInitializationMessage()
          Returns the initalization message (e.g.
 int getInitializationMessageColor()
          Returns the initalization message color.
 MIDlet getMIDlet()
          Returns the application MIDlet instance.
abstract  void initDesktopContent(Desktop desktop)
          Init the Desktop's content.
abstract  void initDesktopStyles()
          Implement in this method all your style initializations (e.g.
protected  boolean isFullscreen()
          Overide this method to customize your KuixMIDlet fullscreen attribute.
protected  void onDestroy()
          Call defore destroy process.
protected  void onPause()
          Call before pause process.
protected  void onResumed()
          Call after resume (unpause) process.
protected  void onStarted()
          Call after start process.
 void onWorkerError(WorkerTask task, java.lang.Error error)
           
 void onWorkerException(WorkerTask task, java.lang.Exception exception)
           
protected  void pauseApp()
           
 void processDebugInfosKeyEvent()
          This method is invoked when a Kuix internal debug infos key event occured.
protected  void startApp()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KuixMIDlet

public KuixMIDlet()
Construct a KuixMIDlet

Method Detail

getMIDlet

public MIDlet getMIDlet()
Description copied from interface: KuixInitializer
Returns the application MIDlet instance.

Specified by:
getMIDlet in interface KuixInitializer
Returns:
the MIDlet instance.

getDisplay

public Display getDisplay()
Returns the display object instance.

Returns:
the display

getAppVersion

public java.lang.String getAppVersion()
Returns the MIDlet version extracted from jad properties.

Returns:
the MIDlet version.

getDefault

public static KuixMIDlet getDefault()
Returns:
the default instance

isFullscreen

protected boolean isFullscreen()
Overide this method to customize your KuixMIDlet fullscreen attribute. By default the value is true.

Returns:
true if the midlet is full screen

getInitializationBackgroundColor

public int getInitializationBackgroundColor()
Description copied from interface: KuixInitializer
Returns the initalization background color.

Specified by:
getInitializationBackgroundColor in interface KuixInitializer
Returns:
a color int representation.

getInitializationMessageColor

public int getInitializationMessageColor()
Description copied from interface: KuixInitializer
Returns the initalization message color.

Specified by:
getInitializationMessageColor in interface KuixInitializer
Returns:
ta color int representation.

getInitializationMessage

public java.lang.String getInitializationMessage()
Description copied from interface: KuixInitializer
Returns the initalization message (e.g. "Loading") or null if no message.

Specified by:
getInitializationMessage in interface KuixInitializer
Returns:
a string

getInitializationImageFile

public java.lang.String getInitializationImageFile()
Description copied from interface: KuixInitializer
Returns the initalization message (e.g. "/img/loading.png") or null if no image.

Specified by:
getInitializationImageFile in interface KuixInitializer
Returns:
a string

createNewConverterInstance

protected KuixConverter createNewConverterInstance()
Returns a new KuixConverter object instance.
Override this method to propose your own KuixConverter derived converter.

Returns:
the converter object instance
Since:
1.0.1

initDesktopStyles

public abstract void initDesktopStyles()
Description copied from interface: KuixInitializer
Implement in this method all your style initializations (e.g. Kuix.loadCss("myStyle.css");).

Specified by:
initDesktopStyles in interface KuixInitializer

initDesktopContent

public abstract void initDesktopContent(Desktop desktop)
Description copied from interface: KuixInitializer
Init the Desktop's content. This method is call during the initialization process, then it is preferable to load the first screen there.

Specified by:
initDesktopContent in interface KuixInitializer

destroyImpl

public void destroyImpl()
Description copied from interface: KuixInitializer
Invoked to destroy the MIDlet implementation.

Specified by:
destroyImpl in interface KuixInitializer

fatal

public void fatal(java.lang.String message)
Display a basic lcdui fatal error alert popup with the given message. After displaying the message the application will be closed.

Parameters:
message -
Since:
1.0.1

fatal

public void fatal(java.lang.String message,
                  java.lang.Throwable throwable)
Display a basic lcdui fatal error alert popup with the given message and throwable. After displaying the message the application will be closed.

Parameters:
message -
throwable -
Since:
1.0.1

commandAction

public void commandAction(Command command,
                          Displayable displayable)

startApp

protected void startApp()
                 throws MIDletStateChangeException
Throws:
MIDletStateChangeException

pauseApp

protected void pauseApp()

destroyApp

protected void destroyApp(boolean unconditional)

processDebugInfosKeyEvent

public void processDebugInfosKeyEvent()
Description copied from interface: KuixInitializer
This method is invoked when a Kuix internal debug infos key event occured.
You can override this method to implement your own debug infos process.

Specified by:
processDebugInfosKeyEvent in interface KuixInitializer

onStarted

protected void onStarted()
Call after start process. At this moment the midlet is initialized and the first screen is visible. Override this method if you want to do post start actions.


onPause

protected void onPause()
Call before pause process. Override this method if you want to do pre pause actions.


onResumed

protected void onResumed()
Call after resume (unpause) process. Override this method if you want to do post resume actions.


onDestroy

protected void onDestroy()
Call defore destroy process. Override this method if you want to do pre destroy actions.


onWorkerError

public void onWorkerError(WorkerTask task,
                          java.lang.Error error)

onWorkerException

public void onWorkerException(WorkerTask task,
                              java.lang.Exception exception)


Copyright © 2007-2008 Kalmeo. All Rights Reserved.