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
static PopupBox alert(java.lang.String message)
          Deprecated. use Kuix.alert(message)
 PopupBox alert(java.lang.String message, int options)
          Deprecated. use Kuix.alert(message, options)
static PopupBox alert(java.lang.String message, int options, java.lang.String okAction, java.lang.String yesAction, java.lang.String noAction, java.lang.String cancelAction)
          Deprecated. use Kuix.alert(message, options, okAction, yesAction, noAction, cancelAction)
 PopupBox alert(java.lang.String message, java.lang.Throwable throwable)
          Deprecated. use Kuix.alert(message, throwable)
 PopupBox alert(java.lang.Throwable throwable)
          Deprecated. use Kuix.alert(throwable)
 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.
 KuixCanvas getCanvas()
          Deprecated. use Kuix.getCanvas()
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.
static PopupBox showPopupBox(java.lang.String styleClass, int duration, java.lang.Object content, int progress, java.lang.String[] buttonTexts, int[] buttonShortcutKeyCodes, java.lang.String[] buttonOnActions, java.lang.String onCloseAction)
          Deprecated. use Kuix.showPopupBox(styleClass, duration, content, progress, buttonTexts, buttonShortcutKeyCodes, buttonOnActions, onCloseAction)
static PopupBox splash(int duration, Widget content, java.lang.String onCloseAction)
          Deprecated. use Kuix.splash(duration, content, onCloseAction)
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.

getCanvas

public KuixCanvas getCanvas()
Deprecated. use Kuix.getCanvas()

Returns the KuixCanvas object instance.

Returns:
the canvas

getDisplay

public Display getDisplay()
Returns the display object instance.

Returns:
the display

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

showPopupBox

public static PopupBox showPopupBox(java.lang.String styleClass,
                                    int duration,
                                    java.lang.Object content,
                                    int progress,
                                    java.lang.String[] buttonTexts,
                                    int[] buttonShortcutKeyCodes,
                                    java.lang.String[] buttonOnActions,
                                    java.lang.String onCloseAction)
Deprecated. use Kuix.showPopupBox(styleClass, duration, content, progress, buttonTexts, buttonShortcutKeyCodes, buttonOnActions, onCloseAction)

Create and display a PopupBox. This method is a full feature of all PopupBox helpers like alert, splash.

Parameters:
styleClass - The PopupBox style class
duration - the duration of the PopupBox
content - the content could be a Widget or a String
progress - a fixed-point integer representing progress value
buttonTexts - The ordered buttons text
buttonShortcutKeyCodes - The ordred buttons shortcut kuixKeyCode
buttonOnActions - The ordred buttons onAction
Returns:
The PopupBox instance

splash

public static PopupBox splash(int duration,
                              Widget content,
                              java.lang.String onCloseAction)
Deprecated. use Kuix.splash(duration, content, onCloseAction)

Display a splash PopupBox

Parameters:
duration - the duration of the splash (in ms)
content - the splash widget content
Returns:
The PopupBox instance

alert

public static PopupBox alert(java.lang.String message,
                             int options,
                             java.lang.String okAction,
                             java.lang.String yesAction,
                             java.lang.String noAction,
                             java.lang.String cancelAction)
Deprecated. use Kuix.alert(message, options, okAction, yesAction, noAction, cancelAction)

Create an open an alert box. An alert can only display text content. It is usful to display simple text message, error, ask question, etc...
The associated buttons are construct from the options parameter.

Example:

 alert("Hello world", KuixConstants.ALERT_OK | KuixConstants.ALERT_INFO, "doOk", null, null, null);
 alert("Is it rainning ?", KuixConstants.ALERT_YES | KuixConstants.ALERT_NO | KuixConstants.ALERT_QUESTION, null, null, "doYes", "doNo");
 

Parameters:
message - the text message to display
options - the options KuixConstants
okAction - the ok onAction name
yesAction - the yes onAction name
noAction - the no onAction name
cancelAction - the cancel onAction name
Returns:
The PopupBox instance

alert

public PopupBox alert(java.lang.String message,
                      int options)
Deprecated. use Kuix.alert(message, options)

Open an alert box with options. This alert is a PopupBox with a single text message an single OK button (mapped to FIRE key). If you try to use other buttons with options, they will be ignored.

Parameters:
message - the message to display
options - KuixConstants
Returns:
The PopupBox instance

alert

public static PopupBox alert(java.lang.String message)
Deprecated. use Kuix.alert(message)

Open an alert box with the message text and default style class.

Parameters:
message - the message to display
Returns:
The PopupBox instance

alert

public PopupBox alert(java.lang.String message,
                      java.lang.Throwable throwable)
Deprecated. use Kuix.alert(message, throwable)

Open an alert box with the Throwable object message and 'alerterror' style class.

Parameters:
message - the message to display
throwable - the Throwable to get message or class name
Returns:
The PopupBox instance

alert

public PopupBox alert(java.lang.Throwable throwable)
Deprecated. use Kuix.alert(throwable)

Open an alert box with the Throwable object message and 'alerterror' style class.

Parameters:
throwable - the Throwable to get message or class name
Returns:
The PopupBox instance

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.