public class nUIController
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
static java.util.Vector |
active_windows |
static nUICanvasInterface |
canvas_interface
We use this for the odd callback to the runtime
|
static int |
DEBUG_DISPLAYABLE_RENDERS |
static int |
DEBUG_EVENT_CALLBACKS |
static int |
DEBUG_LEVEL |
static int |
DEBUG_OBJECT_HIERARCHY |
static int |
DEBUG_USAGE_ERRORS |
static nUIEventListener |
event_listener
We use the event_listener as the synchronicity object so the developer has access to it too
|
static java.util.Vector |
event_queue |
static nUIController |
instance |
static int |
MS_PER_UPDATE |
static int |
TRANSITION_APPEAR |
static int |
TRANSITION_DOWN |
static int |
TRANSITION_FADE |
static int |
TRANSITION_LEFT |
static int |
TRANSITION_RIGHT |
static int |
TRANSITION_UP |
static int |
UPDATE_FLAG_SOMETHING |
Constructor and Description |
---|
nUIController() |
Modifier and Type | Method and Description |
---|---|
static void |
addEventListener(nUIEventListener listener,
boolean threaded)
Adds a new event-listener, replacing any previously defined listener
|
void |
clearImageCache() |
void |
clearImageCache(java.lang.String name) |
static boolean |
deviceSupportsAppDirectionality(int direction)
Test to see if the device supports the required directionality.
|
void |
dumpImageCache() |
void |
enableImageCache(boolean enable) |
static boolean |
eventListenerCallback(nUIObject object,
int evt_type)
A standardised method to perform event callbacks (so there's no need for null-comparisons everywhere else)
|
static void |
eventListenerQueue(nUIObject object,
int evt_type)
A standardised method to perform event callbacks
(so there's no need for null-comparisons everywhere else)
CALL THIS IF YOU AREN'T CALLING BACK FROM THE CORE NUI THREAD |
static int |
getAppDirectionality()
Returns the current directionality setting.
|
static java.lang.String |
getEventName(int evt_type)
Returns the String representation of an event
|
static void |
output(java.lang.String s,
int debug_type)
A standardised method to output messages
|
static void |
registerCanvasInterface(nUICanvasInterface ci)
Registers a
nUICanvasInterface
with NativeUI - under normal circumstances, you shouldn't need to call this. |
static void |
removeEventListener(nUIEventListener listener)
Removes an existing event-listener
|
static void |
render(javax.microedition.lcdui.Graphics g)
This is the core rendering method
|
void |
run()
A background thread that keeps running for as long as the NativeUI is needed
|
static void |
runOnce(int ms)
One cycle of the 'run' method, whether that's from our thread or a developer supplied one
|
static void |
setAppDirectionality(int direction)
Set the text and UI directionality, if possible.
|
static void |
sizeChanged(int new_width,
int new_height)
Call this when the Canvas size has changed (usually on an orientation change event)
|
static void |
transitionFrom(nUIWindowDisplay window)
Transition from an old window, with effect (DIS)"APPEAR"
|
static void |
transitionFrom(nUIWindowDisplay window,
int transition)
Transition from an old window
|
static void |
transitionTo(nUIWindowDisplay window)
Transition to a new window, with effect "APPEAR"
|
static void |
transitionTo(nUIWindowDisplay window,
int transition)
Transition to a new window
|
public static int UPDATE_FLAG_SOMETHING
public static final int DEBUG_USAGE_ERRORS
public static final int DEBUG_EVENT_CALLBACKS
public static final int DEBUG_DISPLAYABLE_RENDERS
public static final int DEBUG_OBJECT_HIERARCHY
public static final int DEBUG_LEVEL
public static final int TRANSITION_APPEAR
public static final int TRANSITION_FADE
public static final int TRANSITION_LEFT
public static final int TRANSITION_RIGHT
public static final int TRANSITION_UP
public static final int TRANSITION_DOWN
public static int MS_PER_UPDATE
public static nUIController instance
public static nUIEventListener event_listener
public static nUICanvasInterface canvas_interface
public static java.util.Vector active_windows
public static java.util.Vector event_queue
public void clearImageCache()
public void clearImageCache(java.lang.String name)
public void enableImageCache(boolean enable)
public void dumpImageCache()
public static void output(java.lang.String s, int debug_type)
s
- String to outputpublic static void registerCanvasInterface(nUICanvasInterface ci)
nUICanvasInterface
with NativeUI - under normal circumstances, you shouldn't need to call this.ci
- public void run()
run
in interface java.lang.Runnable
public static void runOnce(int ms)
ms
- The number of milliseconds that have passed since the last cyclepublic static void render(javax.microedition.lcdui.Graphics g)
g
- The full-screen Graphics context to apply our rendering topublic static void transitionTo(nUIWindowDisplay window, int transition)
window
- The window to transition totransition
- The transition effect to usepublic static void transitionTo(nUIWindowDisplay window)
window
- The window to transition topublic static void transitionFrom(nUIWindowDisplay window, int transition)
window
- The window to transition fromtransition
- The transition effect to usejava.lang.NullPointerException
- if a null nUIWindowDisplay is passed inpublic static void transitionFrom(nUIWindowDisplay window)
window
- The window to transition frompublic static boolean eventListenerCallback(nUIObject object, int evt_type)
public static void eventListenerQueue(nUIObject object, int evt_type)
public static java.lang.String getEventName(int evt_type)
public static void addEventListener(nUIEventListener listener, boolean threaded)
listener
- The new listenerthreaded
- Should a new thread be created to handle the tick update - IF NOT, the user will need to call runInternal on a regular basispublic static void removeEventListener(nUIEventListener listener)
listener
- The listener to removepublic static boolean deviceSupportsAppDirectionality(int direction)
direction
- - one of the nUIConstants.TEXT_DIRECTION_*
integers.true
if calling setAppDirectionality()
with this value would be successful.public static void setAppDirectionality(int direction)
direction
- - one of the nUIConstants.TEXT_DIRECTION_*
integers.public static int getAppDirectionality()
nUIConstants.TEXT_DIRECTION_*
integer indicating the current directionality.public static void sizeChanged(int new_width, int new_height)
new_width
- New width of the Canvasnew_height
- New height of the Canvas