public BoundedRangeModel getHorizontalVisibility() {
if (boundedRangeModel == null) {
final int prefWidth = (int) rootViewContext.getView().getPreferredSpan(View.X_AXIS);
final int value = getMaxScrollOffset();
final int max = Math.max(prefWidth, value);
boundedRangeModel = new DefaultBoundedRangeModel(value, max - value, 0, max);
boundedRangeModel.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
scrollPosition.x = -boundedRangeModel.getValue();
}
});