Class ScrollEndEvent
java.lang.Object
com.oorian.messaging.events.Event<ScrollListener>
com.oorian.messaging.events.client.ClientEvent<ScrollListener>
com.oorian.messaging.events.client.ScrollbarEvent
com.oorian.messaging.events.client.ScrollEndEvent
Represents a scroll end event that occurs when scrolling reaches the end boundary of a scrollable element.
This event is fired when the user scrolls to the bottom or right edge of a scrollable container.
It extends ScrollbarEvent to inherit comprehensive scroll position tracking capabilities,
including vertical and horizontal scroll positions, and is dispatched to registered
ScrollListener instances for processing.
Features:
- Detects when scrolling reaches the end boundary
- Inherits scroll position tracking (top, bottom, left, right, height, width)
- Supports both vertical and horizontal scrolling
- Integrates with the scroll event listener pattern
Usage:
// Create a scroll end event with position information
ScrollEndEvent event = new ScrollEndEvent(
500f, // scrollTop
500f, // scrollBottom
1000f, // scrollHeight
0f, // scrollLeft
400f, // scrollRight
400f // scrollWidth
);
// Access inherited position getters
int top = event.getScrollTop(); // Returns 500
int height = event.getScrollHeight(); // Returns 1000
// Dispatch to a listener for infinite scroll, lazy loading, etc.
event.dispatchTo(myScrollListener);
- Since:
- 2016
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatchTo(ScrollListener listener) Dispatches this event to the specified listener for processing.Methods inherited from class com.oorian.messaging.events.client.ScrollbarEvent
getScrollBottom, getScrollHeight, getScrollLeft, getScrollRight, getScrollTop, getScrollWidthMethods inherited from class com.oorian.messaging.events.client.ClientEvent
getSource, getTarget, setSource, setTarget
-
Constructor Details
-
ScrollEndEvent
public ScrollEndEvent(Float scrollTop, Float scrollBottom, Float scrollHeight, Float scrollLeft, Float scrollRight, Float scrollWidth) Constructs a new ScrollEndEvent with the specified scroll position information.- Parameters:
scrollTop- the distance from the top of the element to its topmost visible contentscrollBottom- the distance from the top of the element to its bottommost visible contentscrollHeight- the total height of the element's content, including content not visible due to scrollingscrollLeft- the distance from the left of the element to its leftmost visible contentscrollRight- the distance from the left of the element to its rightmost visible contentscrollWidth- the total width of the element's content, including content not visible due to scrolling
-
-
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 scroll end event, such as implementing infinite scrolling or lazy loading of content.- Specified by:
dispatchToin classEvent<ScrollListener>- Parameters:
listener- the listener to which this event should be dispatched
-