public interface DrawListener
Draw
via callbacks.
You can see some examples in
Section 3.6.
For additional documentation, see Section 3.1 of Computer Science: An Interdisciplinary Approach by Robert Sedgewick and Kevin Wayne.
Modifier and Type | Method and Description |
---|---|
default void |
keyPressed(int keycode)
Invoked when a key has been pressed.
|
default void |
keyReleased(int keycode)
Invoked when a key has been released.
|
default void |
keyTyped(char c)
Invoked when a key has been typed.
|
default void |
mouseClicked(double x,
double y)
Invoked when the mouse has been clicked (pressed and released).
|
default void |
mouseDragged(double x,
double y)
Invoked when the mouse has been dragged.
|
default void |
mousePressed(double x,
double y)
Invoked when the mouse has been pressed.
|
default void |
mouseReleased(double x,
double y)
Invoked when the mouse has been released.
|
default void |
update()
Gets called at regular time intervals.
|
default void mousePressed(double x, double y)
x
- the x-coordinate of the mousey
- the y-coordinate of the mousedefault void mouseDragged(double x, double y)
x
- the x-coordinate of the mousey
- the y-coordinate of the mousedefault void mouseReleased(double x, double y)
x
- the x-coordinate of the mousey
- the y-coordinate of the mousedefault void mouseClicked(double x, double y)
mousePressed
method is generally preferred for
detecting mouse clicks.x
- the x-coordinate of the mousey
- the y-coordinate of the mousedefault void keyTyped(char c)
c
- the character typeddefault void keyPressed(int keycode)
keycode
- the key combination presseddefault void keyReleased(int keycode)
keycode
- the key combination releaseddefault void update()