Package swingtree.api
Interface ScrollIncrementSupplier
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A supplier of scrollable increments for a
JScrollPane
.
which can be passed to the scroll pane configurator API
at UIFactoryMethods.scrollPane(Configurator)
using
ScrollableComponentDelegate.blockIncrement(ScrollIncrementSupplier)
or ScrollableComponentDelegate.unitIncrement(ScrollIncrementSupplier)
.-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the scroll increment for the given view rectangle, orientation and direction.static ScrollIncrementSupplier
none()
-
Method Details
-
none
-
get
Returns the scroll increment for the given view rectangle, orientation and direction. This scroll increment may either be a unit increment or a block increment, seeScrollable.getScrollableUnitIncrement(Rectangle, int, int)
andScrollable.getScrollableBlockIncrement(Rectangle, int, int)
for more information about the parameters.
This method is not designed to be used anywhere else than in theScrollableComponentDelegate.blockIncrement(ScrollIncrementSupplier)
orScrollableComponentDelegate.unitIncrement(ScrollIncrementSupplier)
.
Components that display logical rows or columns should compute the scroll increment that will completely expose one new row or column, depending on the value of orientation. Ideally, components should handle a partially exposed row or column by returning the distance required to completely expose the item.Scrolling containers, like JScrollPane, will use this method each time the user requests a unit scroll.
- Parameters:
visibleRectangle
- The view area visible within the viewportorientation
- Either UI.VERTICAL or UI.HORIZONTAL.direction
- Less than zero to scroll up/left, greater than zero for down/right.- Returns:
- The "unit" or "block" increment for scrolling in the specified direction. This value should always be positive.
- See Also:
-