|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--brf.j2me.dynaworks.Application
The Application class is the abstract base class for all DynaWorks-based applications. It manages one or more Page objects that represent the different views of the application.
Using the Application class
Normally - which means you are not planning to use nasty tricks within your
application - you don't need to derive from this class to build your
application. Indeed the start-up code for an application looks like:
public static void main (String[] args) {
Environment.setImpl (new J9Impl ());
Application theApp = new Application ("MyApp");
theApp.addPage (new MyPage ("MyPage"));
theApp.run ("MyPage");
}
So every display and user interaction only take place in Page objects. You add one ore more page objects to the application before calling the run method of the application telling it which page to load (first). For more information on how to switch from one page to another see the description for the Page class.
Page,
Environment| Field Summary | |
private Page |
active
Reference to active page |
private java.util.Vector |
callstack
stack for nested pages |
private DataDictionary |
dict
Data dictionary for this application |
private EventQueue |
events
Event queue for this application. |
private static java.util.Hashtable |
os
object store for data used by all applications running DynaPage. |
private java.util.Hashtable |
pages
list of pages managed by this application |
| Constructor Summary | |
Application(java.lang.String name)
constructor. |
|
| Method Summary | |
(package private) static void |
static initialization of class. |
boolean |
addPage(Page p)
add a Page object to the list. |
boolean |
addPage(java.lang.String name,
java.lang.Class cl)
add a Page class to the list. |
boolean |
addVariable(java.lang.String name,
java.lang.Object data)
add a object variable to the application data store. |
java.lang.Object |
getVariable(java.lang.String name)
return an object variable from the application data store. |
boolean |
removePage(Page p)
remove a Page object to the list. |
boolean |
removePage(java.lang.String name)
remove a Page object to the list by name. |
boolean |
removeVariable(java.lang.String name)
remove an object variable from the application data store. |
void |
run(java.lang.String name)
run the application by starting a specific page. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
| Field Detail |
private EventQueue events
private DataDictionary dict
private java.util.Hashtable pages
private static java.util.Hashtable os
private java.util.Vector callstack
private Page active
| Constructor Detail |
public Application(java.lang.String name)
name - String - unique application name.| Method Detail |
static void()
public boolean addPage(Page p)
p - Page - page object to be added to list.Page,
removePage(brf.j2me.dynaworks.Page)
public boolean addPage(java.lang.String name,
java.lang.Class cl)
cl - Class - class of page to be added to list.Page,
removePage(brf.j2me.dynaworks.Page)public boolean removePage(Page p)
p - Page - page object to be removed from list.Page,
addPage(brf.j2me.dynaworks.Page)public boolean removePage(java.lang.String name)
name - String - name of the page object to be removed from list.Page,
addPage(brf.j2me.dynaworks.Page)public void run(java.lang.String name)
name - String - name of the page to be executed.
public boolean addVariable(java.lang.String name,
java.lang.Object data)
name - String - name of the variabledata - Object - data object to be addedDataDictionary,
removeVariable(java.lang.String),
getVariable(java.lang.String)public boolean removeVariable(java.lang.String name)
name - String - name of the variable to be removed.DataDictionary,
addVariable(java.lang.String, java.lang.Object),
getVariable(java.lang.String)public java.lang.Object getVariable(java.lang.String name)
name - String - name of the variable.DataDictionary,
addVariable(java.lang.String, java.lang.Object),
removeVariable(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||