Class ScrollUtils

java.lang.Object
io.github.palexdev.virtualizedfx.utils.ScrollUtils

public class ScrollUtils extends Object
Utility class for VirtualFlows.
  • 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, uses upOrDown(double) if orientation is VERTICAL or leftOrRight(double) if orientation is HORIZONTAL.
    • leftOrRight

      public static ScrollUtils.ScrollDirection leftOrRight(double delta)
      If the given delta is lesser than 0 returns LEFT, otherwise returns RIGHT.
    • upOrDown

      public static ScrollUtils.ScrollDirection upOrDown(double delta)
      If the given delta is lesser than 0 returns DOWN, otherwise returns UP.