scheduledScrollCallback = null;
}
}
private void scroll() {
ScrollBar scrollBar = (ScrollBar)TerraScrollBarSkin.this.getComponent();
int rangeStart = scrollBar.getRangeStart();
int rangeEnd = scrollBar.getRangeEnd();
int extent = scrollBar.getExtent();
int value = scrollBar.getValue();
int adjustment;
if (incrementType == IncrementType.UNIT) {
adjustment = direction * scrollBar.getUnitIncrement();
} else {
adjustment = direction * scrollBar.getBlockIncrement();
}
if (adjustment < 0) {
int newValue = Math.max(value + adjustment, rangeStart);
scrollBar.setValue(newValue);
if (stopValue != -1
&& newValue < stopValue) {
// We've reached the explicit stop value
stop();
}
if (newValue == rangeStart) {
// We implicit stop at the minimum scroll bar value
stop();
}
} else {
int newValue = Math.min(value + adjustment, rangeEnd - extent);
scrollBar.setValue(newValue);
if (stopValue != -1
&& newValue > stopValue) {
// We've reached the explicit stop value
stop();