Class TapHoldEvent
java.lang.Object
com.oorian.messaging.events.Event<TouchListener>
com.oorian.messaging.events.client.ClientEvent<TouchListener>
com.oorian.messaging.events.client.TouchEvent
com.oorian.messaging.events.client.TapHoldEvent
Represents a tap-and-hold gesture event that occurs when a user touches and maintains contact on a touch-enabled device.
This event is fired when the user touches a point on a touch surface and holds their finger in place
for an extended period. It extends TouchEvent as it is part of the touch interaction framework
and is dispatched to registered TouchListener instances for processing. This event is commonly
used to trigger context menus, tooltips, or alternative actions on touch-enabled interfaces.
Features:
- Detects prolonged touch gestures on touch devices
- Part of the touch event framework
- Equivalent to right-click or long-press actions
- Integrates with the touch event listener pattern
Usage:
// Create a tap hold event
TapHoldEvent event = new TapHoldEvent();
// Dispatch to a listener to handle tap-and-hold gestures
event.dispatchTo(myTouchListener);
// Common use case: show context menu
public void onEvent(TapHoldEvent event) {
System.out.println("Tap and hold detected");
showContextMenu();
}
- Since:
- 2016
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatchTo(TouchListener listener) Dispatches this event to the specified listener for processing.Methods inherited from class com.oorian.messaging.events.client.TouchEvent
getClientX, getClientY, getIdentifier, getTouchCountMethods inherited from class com.oorian.messaging.events.client.ClientEvent
getSource, getTarget, setSource, setTarget
-
Constructor Details
-
TapHoldEvent
public TapHoldEvent()
-
-
Method Details
-
dispatchTo
Dispatches this event to the specified listener for processing.This method invokes the listener's
onEventmethod with this event instance, allowing the listener to handle the tap-and-hold gesture, such as displaying context menus or triggering alternative actions.- Specified by:
dispatchToin classEvent<TouchListener>- Parameters:
listener- the listener to which this event should be dispatched
-