boolean (MouseWheelEvent event) { if (!isSupportedScrollType(event)) return false; if (event.isShiftDown() == (orientation == VERTICAL)) return false; if (!ScrollSettings.isEligibleFor(this)) return false; double delta = getPreciseDelta(event); if (!Double.isFinite(delta)) return false; int value = getTargetValue(); double deltaAdjusted = getDeltaAdjusted(value, delta); if (deltaAdjusted != 0.0) { boolean isPositiveDelta = deltaAdjusted > 0.0; if (wasPositiveDelta != isPositiveDelta) { // reset accumulator if scrolling direction is changed wasPositiveDelta = isPositiveDelta; myFractionalRemainder = 0.0; } deltaAdjusted += myFractionalRemainder; int valueAdjusted = (int)deltaAdjusted; if (valueAdjusted == 0) { myFractionalRemainder = deltaAdjusted; } else { myFractionalRemainder = deltaAdjusted - (double)valueAdjusted; setValue(value + valueAdjusted); } } else if (delta != 0.0) { return true; // do not consume event if it can be processed by parent component } event.consume(); return true; }