Artenus 2D Framework
Artenus Reference
Interface for all classes that handle push button events.
public interface ButtonListener

Method Summary

Modifier and TypeMethod and Description
public voidonPress(Button button)
Called when a button is pressed.
public voidonRelease(Button button, boolean cancel)
Called when a button is released, regardless of whether or not the user meant to activate the action associated with the button.

Method Detail

onPress
public void onPress(
    Button button
)
Called when a button is pressed.
Parameters:
buttonThe button that is pressed
onRelease
public void onRelease(
    Button button,
    boolean cancel
)
Called when a button is released, regardless of whether or not the user meant to activate the action associated with the button. This is usually the case for virtual buttons, where the user has a choice to either complete the click, or lift their finger or the mouse outside the button's hot region to cancel the event. If the button has an action associated only with its release event and the interval between the press and the release does not have any effect, it is recommended NOT to take that action if the cancel argument is true.
Parameters:
buttonThe button that is released
canceltrue if the event is cancelled, false otherwise