public class nUIController
extends java.lang.Object
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) |
void |
dumpImageCache() |
void |
enableImageCache(boolean enable) |
static boolean |
eventListenerCallback(nUIObject object,
int evt_type) |
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 int |
getMaxScreenWidthHeight() |
static int |
getMinScreenWidthHeight() |
static int |
getScreenHeight()
Gets the screen height
|
static int |
getScreenPPI()
Gets screen PPI
|
static int |
getScreenWidth()
Gets the screen width
|
static boolean |
isRunningOnMDThread() |
static void |
output(java.lang.String s,
int debug_type) |
static void |
registerCanvasInterface(nUICanvasInterface ci) |
static void |
removeEventListener(nUIEventListener listener)
Removes an existing event-listener
|
static void |
render(javax.microedition.lcdui.Graphics g)
This is the core rendering method
|
static void |
runAsync(ICallable task,
IResultCallback callback)
Runs the given
task asynchronously. |
static void |
runAsync(ICallable task,
IResultCallback callback,
boolean runCallbackOnMainThread)
Runs the given
task asynchronously. |
static void |
runAsync(java.lang.Runnable task)
Runs the given
task asynchronously. |
static void |
runAsync(java.lang.Runnable task,
IResultCallback callback)
Runs the given
task asynchronously. |
static void |
runAsync(java.lang.Runnable task,
IResultCallback callback,
boolean runCallbackOnMainThread)
Runs the given
task asynchronously. |
static void |
runOnMDThread(java.lang.Runnable task) |
static void |
runOnMDThreadAndWait(java.lang.Runnable task) |
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) |
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)
public static void registerCanvasInterface(nUICanvasInterface ci)
public 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)
public 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)
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 Canvaspublic static int getScreenPPI()
public static int getScreenWidth()
public static int getScreenHeight()
public static int getMinScreenWidthHeight()
public static int getMaxScreenWidthHeight()
public static boolean isRunningOnMDThread()
public static void runAsync(java.lang.Runnable task, IResultCallback callback, boolean runCallbackOnMainThread)
task
asynchronously.task
- - the task will be executed in a new thread.callback
- - is used to notify if task has been finished.runCallbackOnMainThread
- - if true, the callback will run on the main thread.public static void runAsync(java.lang.Runnable task, IResultCallback callback)
task
asynchronously.task
- - task to be executed in a new thread.callback
- - callback to notify callers task has been finished with success or not. This will be called on main thread, which can access UI elements.public static void runAsync(java.lang.Runnable task)
task
asynchronously.task
- - task to be executed in a new thread.public static void runAsync(ICallable task, IResultCallback callback, boolean runCallbackOnMainThread)
task
asynchronously.task
- - the task will be executed in a new thread.callback
- - is used to notify if task has been finished.runCallbackOnMainThread
- - if true, the callback will run on the main thread.public static void runAsync(ICallable task, IResultCallback callback)
task
asynchronously.task
- - task to be executed in a new thread.callback
- - callback to notify callers task has been finished with success or not. This will be called on main thread, which can access UI elements.public static void runOnMDThread(java.lang.Runnable task)
public static void runOnMDThreadAndWait(java.lang.Runnable task)