Class ScrollUtils
java.lang.Object
io.github.palexdev.virtualizedfx.utils.ScrollUtils
Utility class for VirtualFlows.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ScrollUtils.ScrollDirectiondetermineScrollDirection(Orientation orientation, double delta)Determines the direction of the scroll from the given orientation and the given delta, usesupOrDown(double)if orientation is VERTICAL orleftOrRight(double)if orientation is HORIZONTAL.static booleanisTrackPad(double delta)Determines if a scroll event comes from the trackpad from the given delta value.static ScrollUtils.ScrollDirectionleftOrRight(double delta)If the given delta is lesser than 0 returns LEFT, otherwise returns RIGHT.static ScrollUtils.ScrollDirectionupOrDown(double delta)If the given delta is lesser than 0 returns DOWN, otherwise returns UP.
-
Method Details
-
isTrackPad
public static boolean isTrackPad(double delta)Determines if a scroll event comes from the trackpad from the given delta value. There's no real way to distinguish a scroll event from trackpad or mouse but usually all trackpad events have a much lower delta value. -
determineScrollDirection
public static ScrollUtils.ScrollDirection determineScrollDirection(Orientation orientation, double delta)Determines the direction of the scroll from the given orientation and the given delta, usesupOrDown(double)if orientation is VERTICAL orleftOrRight(double)if orientation is HORIZONTAL. -
leftOrRight
If the given delta is lesser than 0 returns LEFT, otherwise returns RIGHT. -
upOrDown
If the given delta is lesser than 0 returns DOWN, otherwise returns UP.
-