|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface CommonInterface
The CommonInterface interface provides methods to allow multiple application modes to all support certain input event methods.
The purpose is to define commonly required methods like mouse movement and clicking handling as well as redrawing the display.
| Field Summary | |
|---|---|
static int |
MOUSE_PRIMARY
The primary mouse button (usually the left). |
static int |
MOUSE_SECONDARY
The secondary mouse button (usually the right). |
| Method Summary | |
|---|---|
void |
hide()
Switch from this mode. |
boolean |
keyPressed(int keyCode)
Indicates that a key has been pressed. |
boolean |
mouseClick(int button,
java.lang.Object hover)
Indicates that a mouse button has been clicked. |
boolean |
mouseMoved(java.awt.Point position,
java.lang.Object hover)
Indicates that the mouse has been moved. |
void |
paint(java.awt.Graphics g,
java.awt.Dimension size)
Called after the network has been drawn to allow custom drawing to take place. |
void |
show()
Switch to this mode. |
| Field Detail |
|---|
static final int MOUSE_PRIMARY
static final int MOUSE_SECONDARY
| Method Detail |
|---|
boolean mouseClick(int button,
java.lang.Object hover)
button - The button pressed, either MOUSE_PRIMARY or MOUSE_SECONDARY.hover - The object, if any, that the mouse pointer is hovering over at the time.
boolean mouseMoved(java.awt.Point position,
java.lang.Object hover)
position - The position of the mouse pointer.hover - The object, if any, that the mouse pointer is hovering over at the time.
boolean keyPressed(int keyCode)
keyCode - The KeyCode.getKeyCode() value.
void paint(java.awt.Graphics g,
java.awt.Dimension size)
g - The Graphics object to draw to.size - The visible area of the panel to be drawn on.void show()
void hide()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||