|
||||||||||
| 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
org.dartra.midpui.PlayDartsCanvas
A general purpose canvas used by the PlayDarts MIDlet.
This class has support for a button in the top left and top right part of the screen.
| Field Summary | |
protected javax.microedition.lcdui.Image |
backgroundImage
The background image of the canvas |
protected javax.microedition.lcdui.Image |
leftTopButtonPressedImage
The image overlay when the left top button is pressed. |
protected PlayDarts |
midlet
The MIDlet that is using this canvas. |
protected javax.microedition.lcdui.Image |
rightTopButtonPressedImage
The image overlay when the right top button is 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 | |
PlayDartsCanvas(PlayDarts midlet,
java.lang.String bgImageName,
java.lang.String leftTopButtonPressedImageName,
java.lang.String rightTopButtonPressedImageName)
|
|
| Method Summary | |
boolean |
inLeftTopButton(int x,
int y)
Returns whether or not given coordinates are inside the left top button area. |
boolean |
inRightTopButton(int x,
int y)
Returns whether or not given coordinates are inside the right top button area. |
protected void |
paint(javax.microedition.lcdui.Graphics g)
|
protected void |
pointerPressed(int x,
int y)
|
protected void |
pointerReleased(int x,
int y)
|
abstract void |
processClick(int x,
int y)
Called when the screen is clicked at any location other than inside the top left or top right buttons. |
abstract void |
processLeftTopButtonClick()
Called when the top left button is clicked. |
abstract void |
processRightTopButtonClick()
Called when the top right button is clicked. |
| Methods inherited from class javax.microedition.lcdui.Canvas |
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyPressed, keyReleased, keyRepeated, pointerDragged, repaint, repaint, serviceRepaints, setFullScreenMode, showNotify, sizeChanged |
| Methods inherited from class javax.microedition.lcdui.Displayable |
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, removeCommand, setCommandListener, setTicker, setTitle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected PlayDarts midlet
The MIDlet that is using this canvas.
protected javax.microedition.lcdui.Image backgroundImage
The background image of the canvas
protected javax.microedition.lcdui.Image leftTopButtonPressedImage
The image overlay when the left top button is pressed.
protected javax.microedition.lcdui.Image rightTopButtonPressedImage
The image overlay when the right top button is pressed.
| Constructor Detail |
public PlayDartsCanvas(PlayDarts midlet,
java.lang.String bgImageName,
java.lang.String leftTopButtonPressedImageName,
java.lang.String rightTopButtonPressedImageName)
| Method Detail |
protected void paint(javax.microedition.lcdui.Graphics g)
protected void pointerPressed(int x,
int y)
protected void pointerReleased(int x,
int y)
public boolean inLeftTopButton(int x,
int y)
Returns whether or not given coordinates are inside the left top button area.
public boolean inRightTopButton(int x,
int y)
Returns whether or not given coordinates are inside the right top button area.
public abstract void processLeftTopButtonClick()
Called when the top left button is clicked.
public abstract void processRightTopButtonClick()
Called when the top right button is clicked.
public abstract void processClick(int x,
int y)
Called when the screen is clicked at any location other than inside the top left or top right buttons.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||