|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectGameCanvas
org.kalmeo.kuix.core.KuixCanvas
public final class KuixCanvas
This is the Kuix implementation of the J2ME GameCanvas
.
This canvas intercept all user events (keyboard and pointer)
Constructor Summary | |
---|---|
KuixCanvas(KuixInitializer initializer,
boolean fullscreen)
Construct a KuixCanvas . |
Method Summary | |
---|---|
void |
addUnpaintableWidget(Widget widget)
Add a new unpaintable widget to the unpaintableWidgets list. |
int |
adoptKeyCode(int keyCode)
Used to adopt key code to predefined constances, which are platform independent. |
void |
clearUnpaintableWidgets()
Remove all unpaintable widgets. |
protected void |
drawDebugInfos(Graphics g)
Draw debugInfos to the given Graphics |
java.lang.String |
getDebugInfos()
Returns a String representation of the debug infos. |
Desktop |
getDesktop()
Returns the Desktop instance. |
KuixInitializer |
getInitializer()
Returns the KuixInitializer instance. |
java.lang.String |
getPlatformName()
name of curent platform |
protected void |
hideNotify()
|
protected void |
initialize()
Initialize the Canvas |
boolean |
isDebugInfosEnabled()
|
protected void |
keyPressed(int keyCode)
|
protected void |
keyReleased(int keyCode)
|
protected void |
keyRepeated(int keyCode)
|
void |
paint(Graphics g)
|
protected void |
pointerDragged(int x,
int y)
|
protected void |
pointerPressed(int x,
int y)
|
protected void |
pointerReleased(int x,
int y)
|
protected void |
processKeyEvent(byte type,
int keyCode)
Process the key events |
protected void |
processPointerEvent(byte type,
int x,
int y)
Common process for pointer events |
void |
removeUnpaintableWidget(Widget widget)
Add a widget from the unpaintableWidgets list. |
void |
repaintAsSoonAsPossible()
Repaint the desktop as soon as possible. |
void |
repaintNextFrame()
Repaint through the Worker task |
void |
repaintNextFrame(int x,
int y,
int width,
int height)
Repaint through the Worker task |
void |
revalidateAsSoonAsPossible()
Revalidate (and repaint) the desktop as soon as possible. |
void |
revalidateNextFrame()
Revalidate the desktop throught the Worker task. |
void |
setDebugInfosEnabled(boolean debugInfosEnabled)
|
protected void |
setDebugInfosKuixKeyCode(int debugInfosKuixKeyCode)
Define the key that the user need to press 3 consecutive times to display on screen debug infos. |
void |
setTransition(Transition transition)
Define the next repaint transition. |
protected void |
showNotify()
|
protected void |
sizeChanged(int w,
int h)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KuixCanvas(KuixInitializer initializer, boolean fullscreen)
KuixCanvas
. By default the canvas is auto created by
the KuixMIDlet
. But if you create it manualy @se
KuixInitializer
.
initializer
- fullscreen
- Method Detail |
---|
public KuixInitializer getInitializer()
KuixInitializer
instance.
public Desktop getDesktop()
Desktop
instance.
protected void setDebugInfosKuixKeyCode(int debugInfosKuixKeyCode)
KuixConstants.KUIX_KEY_STAR | KuixConstants.KUIX_KEY_POUND
,
press * or # to activete debug onfos display)KuixConstants.KUIX_KEY_STAR
.
debugInfosKuixKeyCode
- the debugInfosKuixKeyCode to setpublic boolean isDebugInfosEnabled()
public void setDebugInfosEnabled(boolean debugInfosEnabled)
debugInfosEnabled
- the debugInfosEnabled to setpublic void setTransition(Transition transition)
transition
- protected void initialize()
public void paint(Graphics g)
protected void sizeChanged(int w, int h)
protected void hideNotify()
protected void showNotify()
public void repaintNextFrame()
public void repaintNextFrame(int x, int y, int width, int height)
x
- x coordinate of the repaint regiony
- y coordinate of the repaint regionwidth
- width of the repaint regionheight
- height of the repaint regionpublic void revalidateNextFrame()
repaintNextFrame
is automaticaly call.
public void revalidateAsSoonAsPossible()
public void repaintAsSoonAsPossible()
public void addUnpaintableWidget(Widget widget)
widget
- public void removeUnpaintableWidget(Widget widget)
widget
- public void clearUnpaintableWidgets()
protected void drawDebugInfos(Graphics g)
Graphics
g
- public java.lang.String getDebugInfos()
protected void keyPressed(int keyCode)
protected void keyReleased(int keyCode)
protected void keyRepeated(int keyCode)
protected void processKeyEvent(byte type, int keyCode)
type
- keyCode
- protected void pointerDragged(int x, int y)
protected void pointerPressed(int x, int y)
protected void pointerReleased(int x, int y)
protected void processPointerEvent(byte type, int x, int y)
type
- x
- y
- public java.lang.String getPlatformName()
public int adoptKeyCode(int keyCode)
keyCode
- This code is sent by platform to canvas and redirected
here
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |