Class SwipeEvent
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.SwipeEvent
Represents a general swipe gesture event that occurs when a user performs a swipe motion on a touch-enabled device.
This event is fired when the user makes a rapid sliding gesture across a touch surface in any direction.
It extends TouchEvent as it is part of the touch interaction framework and is dispatched to
registered TouchListener instances for processing. This serves as a base class for directional
swipe events like SwipeLeftEvent and SwipeRightEvent.
Features:
- Detects swipe gestures on touch devices
- Part of the touch event framework
- Serves as base for directional swipe events
- Integrates with the touch event listener pattern
Usage:
// Create a general swipe event
SwipeEvent event = new SwipeEvent();
// Dispatch to a listener to handle swipe gestures
event.dispatchTo(myTouchListener);
// Common use case: implement carousel navigation
public void onEvent(SwipeEvent event) {
System.out.println("Swipe detected");
handleSwipeGesture();
}
- 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
-
SwipeEvent
public SwipeEvent()Constructs a new SwipeEvent.This constructor creates a basic swipe event without directional information. Subclasses provide specific directional implementations.
-
-
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 swipe gesture event.- Specified by:
dispatchToin classEvent<TouchListener>- Parameters:
listener- the listener to which this event should be dispatched
-