|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--menu.Page
A Page is the basic element in a hierarchy of displayable pages. This abstract class is extended to define specific behavior by specific types of pages.
If a subclass wishes to have a separate thread, it must implement the Runnable interface. The separate thread is created and started by calling the start() method of Page.
$Id: Page.java,v 1.4 2003/01/21 00:22:08 finson Exp $
Field Summary | |
protected boolean |
run
Set to true while the dynamic content thread is running. |
protected java.lang.Thread |
theThread
The Thread object representing the dynamic content thread. |
Constructor Summary | |
Page(java.lang.String label,
java.lang.String title,
javax.microedition.lcdui.Image icon)
Initialize a new Page object using the supplied parameters. |
Method Summary | |
abstract int |
doCommandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable d)
Process the user command and return an integer value telling the PageMgr what to do next. |
abstract javax.microedition.lcdui.Displayable |
getDisplayable()
Return the Displayable object for this Page, completely filled in and ready to display. |
javax.microedition.lcdui.Image |
getIcon()
Return Page icon. |
java.lang.String |
getLabel()
Return Page label. |
Page |
getLinkedPage()
Return the Page that this Page feels should be the next page to be displayed. |
Page |
getPrevious()
Return pointer to previous page visited. |
java.lang.String |
getTitle()
Return Page title. |
void |
setPrevious(Page p)
Set pointer to previous page visited. |
void |
start()
Create a separate thread and start it running. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean run
protected java.lang.Thread theThread
Constructor Detail |
public Page(java.lang.String label, java.lang.String title, javax.microedition.lcdui.Image icon)
label
- short label for this page (as might be used in
a menu). Must not be null.title
- longer label for this page (as might be used in
a screen title).icon
- small icon for this page (as might be used in
a toolbar or menu.Method Detail |
public abstract javax.microedition.lcdui.Displayable getDisplayable()
public abstract int doCommandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
c
- a Command object identifying the command.d
- the Displayable on which this event has occurred
public void start()
java.lang.ClassCastException
- if the concrete class does not implement
the Runnable interface.
java.lang.IllegalStateException
- if there is a Page thread
already running. This means that if a thread hangs
on some long-term blocking call and the user cancels out of it and
tries the same page again before the thread actually exits, then the
midlet will die with this error unless the caller of start() catches
the exception.public Page getLinkedPage()
java.lang.IllegalStateException
- this implementation always
throws this exceptionpublic java.lang.String getLabel()
public java.lang.String getTitle()
public javax.microedition.lcdui.Image getIcon()
public Page getPrevious()
public void setPrevious(Page p)
p
- previous Page
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |