*/
private TAction action;
+ /**
+ * How long to animate dispatch of the event in millis.
+ */
+ private static final long DISPATCH_TIME = 75;
+
/**
* Act as though the button was pressed. This is useful for other UI
* elements to get the same action as if the user clicked the button.
public void dispatch() {
if (action != null) {
action.DO();
+ inButtonPress = false;
}
}
this.mouse = mouse;
if (inButtonPress && mouse.isMouse1()) {
- inButtonPress = false;
// Dispatch the event
- if (action != null) {
- action.DO();
- }
+ dispatch();
}
}
|| keypress.equals(kbSpace)
) {
// Dispatch
- if (action != null) {
- action.DO();
- }
+ dispatch();
return;
}