|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j4me.ui.UIManager
public class UIManager
The UI manager orchestrates the UI for a MIDlet. There is one
UIManager
object for the entire application and all of its
methods are static. You must call the init
method first.
Each screen, defined by a class derived from DeviceScreen
, can be
attached to the manager. The manager is responsible for navigating
between screens, getting them to paint themselves, and all other UI
control.
The application's appearance can be changed by providing a new theme.
Create a new theme class, derived from Theme
, and then attach it
to the UI manager. All the different screens will take on the colors
and layout defined by the new theme.
DeviceScreen
,
Theme
Constructor Summary | |
---|---|
UIManager()
|
Method Summary | |
---|---|
static javax.microedition.lcdui.Display |
getDisplay()
Gets the Display for this MIDlet. |
static DeviceScreen |
getScreen()
Returns the currently selected J4ME screen. |
static Theme |
getTheme()
Returns the theme used throughout the application. |
static void |
init(javax.microedition.midlet.MIDlet midlet)
Creates a UIManager implementation. |
protected static void |
setScreen(DeviceScreen canvas,
javax.microedition.lcdui.Displayable screen)
Sets the current screen for the application. |
static void |
setTheme(Theme theme)
Sets the theme used throughout the application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UIManager()
Method Detail |
---|
public static void init(javax.microedition.midlet.MIDlet midlet)
UIManager
implementation. One of these should
be created per MIDlet and be stored in the application's model.
The theme is set to the default, represented by the Theme
class.
To apply your own theme use the setTheme
method.
Note that you should ensure your application is running on MIDP 2.0+ device. Otherwise the system will throw a runtime exception that will immediately kill your MIDlet without warning.
midlet
- is the MIDlet
class that defines this application.public static Theme getTheme()
public static void setTheme(Theme theme)
theme
- is the new theme for the application.protected static void setScreen(DeviceScreen canvas, javax.microedition.lcdui.Displayable screen)
canvas
- is the J4ME object that wraps screen
.screen
- is the actual LCDUI Displayable
which takes
over the device's screen.DeviceScreen.show()
public static DeviceScreen getScreen()
null
.
The application can call toString
on the returned screen to
get its name for logging purposes.
null
if none is
set.public static javax.microedition.lcdui.Display getDisplay()
Display
for this MIDlet.
Display
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |