|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.yospace.yae.yogi.NativeResources
The controller and access point for the native resources needed by YAE and YoGI.
It may be assumed that this class and its subclasses are completely constructed before any other Toolkit or YogiRootPane subsystems are alive. Thus, it is important that no complex YoGI operations are invoked during the construction phase of this class, as they may not yet be initialized.
| Constructor Summary | |
protected |
NativeResources()
Constructor is protected so that NativeResources displays singleton characteristics. |
| Method Summary | |
abstract Image |
createImage(byte[] imageData,
int imageOffset,
int imageLength)
Creates an immutable native image which is decoded from the data stored in the specified byte array at the specified offset and length. |
abstract Image |
createImage(Image source)
Creates an immutable image from a source image. |
abstract Image |
createImage(java.lang.String name)
Creates an immutable image from decoded image data obtained from the named resource. |
abstract Font |
createNativeFont(int face,
int style,
int size)
Creates a MIDP Font given a typeface, style and size. |
static NativeResources |
get()
Accessor method that gets the current NativeResources object. |
abstract int |
getCanvasHeight()
Gets the canvas height. |
abstract int |
getCanvasWidth()
Gets the canvas width. |
static javax.microedition.lcdui.Display |
getDisplay()
Convenience method for getting the MIDP Display of the current NativeResources object. |
protected abstract javax.microedition.lcdui.Display |
getDisplayImpl()
Template method for accessing the Display. |
static Graphics |
getGraphics()
Convenience method for getting the Graphics of the current NativeResources object. |
protected abstract Graphics |
getGraphicsImpl()
Template method for accessing the Graphics. |
abstract java.lang.String |
getProperty(java.lang.String propName)
Gets the named property supplied in the Panelet URL. |
abstract java.lang.String |
getSystemProperty(java.lang.String name)
Template method for accessing system properties. |
void |
grabResources(java.lang.Object key)
Tells us that it is time to grab heavy resources, as YoGI is now online. |
protected void |
grabResourcesImpl()
Template method for grabbing native resources. |
abstract void |
repaint()
Requests a repaint of the whole canvas. |
abstract void |
repaint(int x,
int y,
int width,
int height)
Requests a repaint of a rectangular area of the canvas. |
abstract void |
serviceRepaints()
Forces all pending repaints to be completed immediately. |
static void |
set(NativeResources ynr)
Sets the NativeResources to be ynr. |
static void |
setKey(java.lang.Object theKey)
Sets up the key to validate resource grabbing and trimming reation requests against. |
void |
trimResources(java.lang.Object key)
Tells us that it is time to lose any heavy resources as the Panelet system is idle. |
protected void |
trimResourcesImpl()
Template method for trimming native resources. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected NativeResources()
| Method Detail |
public static void set(NativeResources ynr)
ynr - the NativeResources to be used.public static final void setKey(java.lang.Object theKey)
theKey - the key to use.public static NativeResources get()
public static Graphics getGraphics()
getGraphicsImpl().public static javax.microedition.lcdui.Display getDisplay()
getDisplayImpl().protected abstract Graphics getGraphicsImpl()
protected abstract javax.microedition.lcdui.Display getDisplayImpl()
public abstract java.lang.String getSystemProperty(java.lang.String name)
name - the name of the requested property.NullPointerException - if there is no such property.public final void trimResources(java.lang.Object key)
Calls trimResourcesImpl() if the key is valid.
key - the key for the NativeResources.protected void trimResourcesImpl()
public final void grabResources(java.lang.Object key)
Calls grabResourcesImpl() if the key is valid.
key - the key for the NativeResources.protected void grabResourcesImpl()
public abstract int getCanvasWidth()
public abstract int getCanvasHeight()
public abstract void repaint()
public abstract void repaint(int x,
int y,
int width,
int height)
x - the x coordinate of the top-left corner of the rectangle.y - the y coordinate of the top-left corner of the rectangle.width - the width of the rectangle.height - the height of the rectangle.public abstract void serviceRepaints()
public abstract Font createNativeFont(int face,
int style,
int size)
face - the typeface of the font.style - the style of the font.size - the size of the font.Font
public abstract Image createImage(byte[] imageData,
int imageOffset,
int imageLength)
imageData - the array of image data in a supported image formatimageOffset - the offset of the start of the data in the arrayimageLength - the length of the data in the arraypublic abstract Image createImage(Image source)
source - the source image to be copied.public abstract Image createImage(java.lang.String name)
name - the name of the resource containing the image data in one of the supported image formatspublic abstract java.lang.String getProperty(java.lang.String propName)
propName - name of the required property.
|
Copyright 2002 Yospace Holdings Ltd. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||