void (@NotNull MouseWheelEvent e, @Nullable Consumer<? super MouseWheelEvent> alternative) { JScrollBar bar = !myScrollEnabled.get() ? null : getEventScrollBar(e); if (bar == null) { if (alternative != null) alternative.accept(e); return; } if (TouchScrollUtil.isBegin(e)) { verticalFling.registerBegin(); horizontalFling.registerBegin(); } else if (TouchScrollUtil.isUpdate(e)) { int value = bar.getValue(); int delta = (int)TouchScrollUtil.getDelta(e); bar.setValue(value + delta); FlingManager fling = isHorizontalScroll(e) ? horizontalFling : verticalFling; fling.registerUpdate(delta); } else if (TouchScrollUtil.isEnd(e)) { verticalFling.start(getEventVerticalScrollBar(e), vertical); horizontalFling.start(getEventHorizontalScrollBar(e), horizontal); } e.consume(); }