Appendix E DoodlePad Pad Events
The Pad class offers several opportunities to handle events by overriding its methods. In addition to mouse-related events, the Pad class handles keyboard events, network socket events, as well as a global timer.
Table E.0.1. Overridable Pad Mouse, Keyboard and Timer Event Methods
public void onMousePressed(double x, double y, int button) β1β
A method that can be overridden to handle mouse pressed events.
public void onMouseReleased(double x, double y, int button) β2β
A method that can be overridden to handle mouse released events.
public void onMouseMoved(double x, double y, int button) β3β
A method that can be overridden to handle mouse moved events.
public void onMouseClicked(double x, double y, int button) β4β
A method that can be overridden to handle mouse clicked events.
public void onMouseDoubleClicked(double x, double y, int button) β5β
A method that can be overridden to handle mouse double-clicked events.
public void onMouseDragged(double x, double y, int button) β6β
A method that can be overridden to handle mouse dragged events. A mouse dragged event is the same as a mouse moved event while the mouse is pressed.
public void onMouseEntered(double x, double y, int button) β7β
A method that can be overridden to handle mouse entered events.
public void onMouseExited(double x, double y, int button) β8β
A method that can be overridden to handle mouse exited events.
public void onKeyPressed(java.lang.String keyText, java.lang.String keyModifiers) β9β
A method that can be overridden to handle key pressed events
public void onKeyReleased(java.lang.String keyText, java.lang.String keyModifiers) β10β
A method that can be overridden to handle key released events
public void onKeyTyped(char keyChar) β11β
A method that can be overridden to handle key typed events
public void onTick(long when) β12β
A method that can be overridden to handle the Pad timer`s tick event. The timer tick rate is set with the setTickRate() method. The timer is started by invoking the startTimer() method. The timer is stopped by invoking the stopTimer() method.
Table E.0.2. Overridable Pad Socket Event Methodsdoodlepad.org/dist/javadoc/doodlepad/Pad.html#onMousePressed-double-double-int-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onMouseReleased-double-double-int-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onMouseMoved-double-double-int-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onMouseClicked-double-double-int-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onMouseDoubleClicked-double-double-int-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onMouseDragged-double-double-int-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onMouseEntered-double-double-int-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onMouseExited-double-double-int-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onKeyPressed-java.lang.String-java.lang.String-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onKeyReleased-java.lang.String-java.lang.String-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onKeyTyped-char-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onTick-long-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onClientOpened-int-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onClientOpened-int-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onClientReceived-int-java.lang.String-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onClientClosed-int-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onClientError-int-java.lang.String-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onClientInfo-int-java.lang.String-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onServerStarted--
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onServerStopped--
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onServerError-java.lang.String-
doodlepad.org/dist/javadoc/doodlepad/Pad.html#onServerInfo-java.lang.String-