Package org.evoludo.ui
Class ContextMenu.TouchTimer
- Enclosing class:
ContextMenu
Timer for handling touch events triggering the context menu. Used to save the
position where the context menu was requested as well as the listening widget
for use once the timer fires (if it does).
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) ContextMenu.Listener
Listening widget that triggered the scheduling for the context menu.(package private) int
Horizontal position of touch event scheduled to trigger context menu (relative to browser window).(package private) int
Vertical position of touch event scheduled to trigger context menu (relative to browser window). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
run()
void
save
(ContextMenu.Listener ref, int x, int y) Save the listener widget as well as the position (relative to browser window) where the context menu will be displayed when (and if) the timer fires.Methods inherited from class Timer
cancel, isRunning, schedule, scheduleRepeating
-
Field Details
-
touchX
int touchXHorizontal position of touch event scheduled to trigger context menu (relative to browser window). -
touchY
int touchYVertical position of touch event scheduled to trigger context menu (relative to browser window). -
listener
ContextMenu.Listener listenerListening widget that triggered the scheduling for the context menu.
-
-
Constructor Details
-
TouchTimer
public TouchTimer()Constructs a new timer for touch events.
-
-
Method Details
-
save
Save the listener widget as well as the position (relative to browser window) where the context menu will be displayed when (and if) the timer fires.- Parameters:
ref
- listener widget that is (potentially) requesting a context menux
- horizontal position of touch eventy
- vertical position of touch event
-
run
public void run()Show context menu.
-