int blockIncr = scrollComp.getScrollableBlockIncrement(viewRect, orientation, direction); if (direction < 0) {
@Override public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { return getScrollable(orientation).getScrollableBlockIncrement( visibleRect, orientation, direction); }
/** * Components that display logical rows or columns should compute * the scroll increment that will completely expose one block * of rows or columns, depending on the value of orientation. * * @return the "block" increment for scrolling in the specified direction * @see Scrollable#getScrollableBlockIncrement(Rectangle, int, int) */ public int getScrollableBlockIncrement(JXLayer<? extends V> l, Rectangle visibleRect, int orientation, int direction) { if (l.getView() instanceof Scrollable) { return ((Scrollable) l.getView()).getScrollableBlockIncrement( visibleRect, orientation, direction); } return (orientation == SwingConstants.VERTICAL) ? visibleRect.height : visibleRect.width; }
amount = ((Scrollable)view).getScrollableBlockIncrement (visRect, orientation, direction);
amount = ((Scrollable) view).getScrollableBlockIncrement(visRect, orientation, direction); } else { amount = ((Scrollable) view).getScrollableUnitIncrement(visRect, orientation, direction);
public int getBlockIncrement(int direction) { JViewport vp = getViewport(); if (blockIncrementSet || vp == null) { return super.getBlockIncrement(direction); } else if (vp.getView() instanceof Scrollable) { Scrollable view = (Scrollable) (vp.getView()); Rectangle vr = vp.getViewRect(); return view.getScrollableBlockIncrement(vr, getOrientation(), direction); } else if (getOrientation() == VERTICAL) { return vp.getExtentSize().height; } else { return vp.getExtentSize().width; } }
int blockIncr = scrollComp.getScrollableBlockIncrement( viewRect, orientation, direction); if (direction < 0) {
int blockIncr = scrollComp.getScrollableBlockIncrement(viewRect, orientation, direction); if (direction < 0) { scrollMin = Math.max(scrollMin, toScroll.getValue() - blockIncr);