|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.microedition.lcdui.Displayable
javax.microedition.lcdui.Canvas
javax.microedition.lcdui.game.GameCanvas
m3g03.midp2.GameCanvasKeyStates
public class GameCanvasKeyStates
Displays key states read from
GameCanvas.getKeyStates(). This method only returns
game actions, not general purpose keys.
| Field Summary | |
|---|---|
private javax.microedition.lcdui.Graphics |
graphics
Graphics singleton used for rendering. |
private boolean |
isRunning
Flag for stopping the Thread. |
private static java.util.Hashtable |
KEY_STATES
Maps key states to a name that can be displayed. |
| Fields inherited from class javax.microedition.lcdui.game.GameCanvas |
|---|
DOWN_PRESSED, FIRE_PRESSED, GAME_A_PRESSED, GAME_B_PRESSED, GAME_C_PRESSED, GAME_D_PRESSED, LEFT_PRESSED, RIGHT_PRESSED, UP_PRESSED |
| Fields inherited from class javax.microedition.lcdui.Canvas |
|---|
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP |
| Constructor Summary | |
|---|---|
GameCanvasKeyStates()
Constructor. |
|
| Method Summary | |
|---|---|
void |
hideNotify()
Stops the display loop. |
private void |
render(javax.microedition.lcdui.Graphics graphics)
Renders the key states. |
void |
run()
Drives the animation. |
void |
showNotify()
Called when this sample is displayed. |
| Methods inherited from class javax.microedition.lcdui.game.GameCanvas |
|---|
flushGraphics, flushGraphics, getGraphics, getKeyStates, paint |
| Methods inherited from class javax.microedition.lcdui.Canvas |
|---|
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, isDoubleBuffered, keyPressed, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setCommandListener, setFullScreenMode, sizeChanged |
| Methods inherited from class javax.microedition.lcdui.Displayable |
|---|
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, removeCommand, setTicker, setTitle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private boolean isRunning
private javax.microedition.lcdui.Graphics graphics
private static final java.util.Hashtable KEY_STATES
| Constructor Detail |
|---|
public GameCanvasKeyStates()
| Method Detail |
|---|
public void showNotify()
showNotify in class javax.microedition.lcdui.Canvaspublic void hideNotify()
hideNotify in class javax.microedition.lcdui.Canvaspublic void run()
run in interface java.lang.Runnableprivate void render(javax.microedition.lcdui.Graphics graphics)
graphics - graphics context for rendering.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||