|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmymobilesite.controller.GUI
public class GUI
The GUI class does everything that is presented to the user and handles events that are caused by user action. The class relies on several states which indicates which GUI window should be shown to the user.
Field Summary | |
---|---|
private javax.microedition.lcdui.Command |
back
|
private Controller |
controller
|
private int |
currentState
|
private javax.microedition.lcdui.Display |
display
|
static int |
ERROR_SCREEN
|
private javax.microedition.lcdui.Command |
exit
|
private javax.microedition.lcdui.Command |
help
|
static int |
HELP_SCREEN
|
private javax.microedition.lcdui.ChoiceGroup |
lang
|
private Language |
language
|
static int |
LOGIN_SCREEN
|
private javax.microedition.lcdui.Form |
mainForm
|
private java.lang.String |
message
|
private javax.microedition.lcdui.Command |
ok
|
private javax.microedition.lcdui.TextField |
password
|
private int |
previousState
|
private javax.microedition.lcdui.ChoiceGroup |
prov
|
static int |
PROVIDER_SCREEN
|
private javax.microedition.lcdui.Command |
save
|
static int |
SERVICEDETAIL_SCREEN
|
private javax.microedition.lcdui.ChoiceGroup |
servicel
|
private Service[] |
serviceList
|
static int |
SERVICELIST_SCREEN
|
private javax.microedition.lcdui.Command |
settings
|
static int |
SETTINGS_SCREEN
|
static int |
SPLASH_SCREEN
These state variables are used by the class to determine what window to show. |
private javax.microedition.lcdui.Command |
tryagain
|
private int |
userChoice
|
private javax.microedition.lcdui.TextField |
username
|
static int |
WAITING_SCREEN
|
Constructor Summary | |
---|---|
GUI(Controller cont)
The constructor is given a reference to the controller so that it can retrieve neccessary variables. |
Method Summary | |
---|---|
void |
commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable d)
Calls doCommand(c) |
void |
commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Item item)
Calls doCommand(c) |
private void |
createCommandButtons()
Creates new command buttons either at startup or when the language is changed. |
private void |
doCommand(javax.microedition.lcdui.Command c)
Performs the appropriate action according to the command it receives. |
int |
getPreviousState()
This returns the privious state which is used when the user is going back to the previous screen. |
void |
run()
This method is used when a window is set. |
void |
setLanguage(java.lang.String lan)
This method sets the language in the Configuration class if the input is different from that currently in the RecordStore. |
void |
setWindow(int window)
This method tells the application which window it should show. |
void |
setWindow(int window,
java.lang.String msg)
This method tells the application which window it should show. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SPLASH_SCREEN
public static final int LOGIN_SCREEN
public static final int HELP_SCREEN
public static final int SETTINGS_SCREEN
public static final int PROVIDER_SCREEN
public static final int SERVICELIST_SCREEN
public static final int SERVICEDETAIL_SCREEN
public static final int WAITING_SCREEN
public static final int ERROR_SCREEN
private Controller controller
private int currentState
private int previousState
private int userChoice
private Language language
private Service[] serviceList
private java.lang.String message
private javax.microedition.lcdui.Display display
private javax.microedition.lcdui.Form mainForm
private javax.microedition.lcdui.Command ok
private javax.microedition.lcdui.Command exit
private javax.microedition.lcdui.Command settings
private javax.microedition.lcdui.Command help
private javax.microedition.lcdui.Command save
private javax.microedition.lcdui.Command back
private javax.microedition.lcdui.Command tryagain
private javax.microedition.lcdui.TextField username
private javax.microedition.lcdui.TextField password
private javax.microedition.lcdui.ChoiceGroup lang
private javax.microedition.lcdui.ChoiceGroup prov
private javax.microedition.lcdui.ChoiceGroup servicel
Constructor Detail |
---|
public GUI(Controller cont)
cont
- Controller The program controller which is needed to retrieve some
variables.Method Detail |
---|
public int getPreviousState()
public void setWindow(int window)
window
- int The id of the window which we want displayedpublic void setWindow(int window, java.lang.String msg)
window
- int The id of the window which we want displayedmsg
- String The message that should be shown in this windowpublic void setLanguage(java.lang.String lan)
lan
- String The chosen language.private void createCommandButtons()
public void run()
run
in interface java.lang.Runnable
Runnable.run()
public void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
commandAction
in interface javax.microedition.lcdui.CommandListener
CommandListener.commandAction(javax.microedition.lcdui.Command,
javax.microedition.lcdui.Displayable)
public void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Item item)
commandAction
in interface javax.microedition.lcdui.ItemCommandListener
ItemCommandListener.commandAction(javax.microedition.lcdui.Command,
javax.microedition.lcdui.Item)
private void doCommand(javax.microedition.lcdui.Command c)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |