|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.kbox.ActionController
public class ActionController
ActionController provides the "controller" in the Model-View-Controller (MVC) design pattern that is commonly known as "Model 2".
Field Summary | |
---|---|
protected static KConfiguration |
config
The config used to represent the configuration file. |
protected boolean |
gcCmdEvent
The flag representing if need to gc when dealing command event |
protected boolean |
gcItemEvent
The flag representing if need to gc when dealing item event |
protected boolean |
gcKeyEvent
The flag representing if need to gc when dealing key event |
protected boolean |
isCacheConfig
The flag representing if need to cache the configuration file. |
Constructor Summary | |
---|---|
protected |
ActionController(boolean isCacheConfig)
Create a new ActionController |
Method Summary | |
---|---|
void |
clearCache()
Clear the configuration cache. |
void |
commandAction(javax.microedition.lcdui.Command cmd,
javax.microedition.lcdui.Displayable display)
Forward the menu command event. |
void |
commandAction(javax.microedition.lcdui.Command cmd,
javax.microedition.lcdui.Item item)
Forward the item event. |
ActionForward |
getActionForward()
Get an ActionForward object |
protected KConfiguration |
getConfig()
Create a KConfiguration. |
static ActionController |
getInstance()
Create an ActionController(if necessary) without cache configuration data. |
static ActionController |
getInstance(boolean isCacheConfig)
Create an ActionController(if necessary). |
static ActionController |
getInstance(boolean isCacheConfig,
boolean gcCmdEvent,
boolean gcKeyEvent,
boolean gcItemEvent)
Create an ActionController(if necessary). |
protected void |
handleException(java.lang.String msg,
ActionForward forward,
java.lang.Exception e)
Handle a Exception, and show it in the mobile phone. |
void |
keyPressedAction(java.lang.String type,
java.lang.String keyName,
Unique uniuqe)
Forward the key pressed event. |
void |
registerViewer(javax.microedition.midlet.MIDlet midlet)
Register a Midlet which the result of a action should be forward to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static KConfiguration config
protected boolean isCacheConfig
protected boolean gcCmdEvent
protected boolean gcKeyEvent
protected boolean gcItemEvent
Constructor Detail |
---|
protected ActionController(boolean isCacheConfig)
isCacheConfig
- if it is true,the configuration data will be cached.Method Detail |
---|
public static ActionController getInstance()
public static ActionController getInstance(boolean isCacheConfig)
isCacheConfig
- The flag representing if needed to cache the configuration
file.
public static ActionController getInstance(boolean isCacheConfig, boolean gcCmdEvent, boolean gcKeyEvent, boolean gcItemEvent)
isCacheConfig
- The flag representing if needed to cache the configuration
file.gcCmdEvent
- The flag representing if need to gc when dealing command eventgcKeyEvent
- The flag representing if need to gc when dealing key eventgcItemEvent
- The flag representing if need to gc when dealing item event
protected KConfiguration getConfig()
public void commandAction(javax.microedition.lcdui.Command cmd, javax.microedition.lcdui.Displayable display)
commandAction
in interface javax.microedition.lcdui.CommandListener
public void keyPressedAction(java.lang.String type, java.lang.String keyName, Unique uniuqe)
KGameCanvas
public void commandAction(javax.microedition.lcdui.Command cmd, javax.microedition.lcdui.Item item)
commandAction
in interface javax.microedition.lcdui.ItemCommandListener
public void registerViewer(javax.microedition.midlet.MIDlet midlet)
midlet
- public void clearCache()
protected void handleException(java.lang.String msg, ActionForward forward, java.lang.Exception e)
msg
- forward
- e
- public ActionForward getActionForward()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |