Interface VFXPaginated<T>
- All Superinterfaces:
VFXContainer<T>
- All Known Implementing Classes:
VFXPaginatedList
Defines the common API for every paginated virtualized container offered by VirtualizedFX. Extends
VFXContainer.-
Property Summary
PropertiesTypePropertyDescriptionSpecifies the number of cells/items to show per each page.Specifies the maximum page index at which the container can go.Specifies the page at which the container is.Properties inherited from interface io.github.palexdev.virtualizedfx.base.VFXContainer
bufferSize, empty, hPos, items, maxHScroll, maxVScroll, size, virtualMaxX, virtualMaxY, vPos -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the number of cells/items to show per each page.default intComputes the maximum page index reachable by the container.default intfindPageByIndex(int index) Given an index, returns the page at which it would be displayed by the container.default intGets the value of thecellsPerPageproperty.default intGets the value of themaxPageproperty.default intgetPage()Gets the value of thepageproperty.Specifies the maximum page index at which the container can go.default voidmoveBy(int delta) Changes the page by the given delta.default voidnext()Goes to the next page if possible.Specifies the page at which the container is.default voidprevious()Goes to the previous page if possible.default voidsetCellsPerPage(int cellsPerPage) Sets the value of thecellsPerPageproperty.default voidsetPage(int page) Sets the value of thepageproperty.Methods inherited from interface io.github.palexdev.virtualizedfx.base.VFXContainer
bufferSizeProperty, emptyProperty, getBufferSize, getHPos, getItems, getMaxHScroll, getMaxVScroll, getVirtualMaxX, getVirtualMaxY, getVPos, hPosProperty, isEmpty, itemsProperty, maxHScrollProperty, maxVScrollProperty, setBufferSize, setHPos, setItems, setVPos, size, sizeProperty, update, virtualMaxXProperty, virtualMaxYProperty, vPosProperty
-
Property Details
-
page
-
maxPage
ReadOnlyIntegerProperty maxPagePropertySpecifies the maximum page index at which the container can go.- See Also:
-
cellsPerPage
IntegerProperty cellsPerPagePropertySpecifies the number of cells/items to show per each page.- See Also:
-
-
Method Details
-
getPage
default int getPage()Gets the value of thepageproperty.- Property description:
- Specifies the page at which the container is.
- Returns:
- the value of the
pageproperty - See Also:
-
pageProperty
IntegerProperty pageProperty()Specifies the page at which the container is.- Returns:
- the
pageproperty - See Also:
-
setPage
default void setPage(int page) Sets the value of thepageproperty.- Property description:
- Specifies the page at which the container is.
- Parameters:
page- the value for thepageproperty- See Also:
-
getMaxPage
default int getMaxPage()Gets the value of themaxPageproperty.- Property description:
- Specifies the maximum page index at which the container can go.
- Returns:
- the value of the
maxPageproperty - See Also:
-
maxPageProperty
ReadOnlyIntegerProperty maxPageProperty()Specifies the maximum page index at which the container can go.- Returns:
- the
maxPageproperty - See Also:
-
getCellsPerPage
default int getCellsPerPage()Gets the value of thecellsPerPageproperty.- Property description:
- Specifies the number of cells/items to show per each page.
- Returns:
- the value of the
cellsPerPageproperty - See Also:
-
cellsPerPageProperty
IntegerProperty cellsPerPageProperty()Specifies the number of cells/items to show per each page.- Returns:
- the
cellsPerPageproperty - See Also:
-
setCellsPerPage
default void setCellsPerPage(int cellsPerPage) Sets the value of thecellsPerPageproperty.- Property description:
- Specifies the number of cells/items to show per each page.
- Parameters:
cellsPerPage- the value for thecellsPerPageproperty- See Also:
-
next
default void next()Goes to the next page if possible. -
previous
default void previous()Goes to the previous page if possible. -
moveBy
default void moveBy(int delta) Changes the page by the given delta. -
findPageByIndex
default int findPageByIndex(int index) Given an index, returns the page at which it would be displayed by the container. Note that this will never generate an exception, rather acts as follows for edge cases:- empty list or max page is 0 or index < 0: returns 0
- index > size: returns max page
-
computeMaxPage
default int computeMaxPage()Computes the maximum page index reachable by the container. This depends on the number of items and the number of cells/items per page.The exact formula is as follows:
Math.max(0, ((int) Math.ceil(items / (double) cpp)) - 1)
-