Package org.fxmisc.flowless
Class CellListManager<T,C extends Cell<T,? extends javafx.scene.Node>>
java.lang.Object
org.fxmisc.flowless.CellListManager<T,C>
Tracks all of the cells that the viewport can display (
cells
) and which cells the viewport is currently
displaying (presentCells
).-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCellListManager
(javafx.scene.Node owner, javafx.collections.ObservableList<T> items, Function<? super T, ? extends C> cellFactory) -
Method Summary
Modifier and TypeMethodDescriptionprivate C
cellForItem
(T item) void
cropTo
(int fromItem, int toItem) Updates the list of cells to displayvoid
dispose()
getCell
(int itemIndex) getCellIfPresent
(int itemIndex) org.reactfx.collection.MemoizationList
<C> javafx.collections.ObservableList
<javafx.scene.Node> getNodes()
Gets the list of nodes that the viewport is displayinggetPresentCell
(int itemIndex) boolean
isCellPresent
(int itemIndex) private void
presentCellsChanged
(org.reactfx.collection.QuasiListModification<? extends C> mod) private void
pushScrollEvent
(javafx.scene.input.ScrollEvent se) Push scroll events received by cell nodes directly to the 'owner' Node.
-
Field Details
-
owner
private final javafx.scene.Node owner -
cellPool
-
cells
-
presentCells
-
cellNodes
private final org.reactfx.collection.LiveList<javafx.scene.Node> cellNodes -
presentCellsSubscription
private final org.reactfx.Subscription presentCellsSubscription
-
-
Constructor Details
-
CellListManager
-
-
Method Details
-
dispose
public void dispose() -
getNodes
public javafx.collections.ObservableList<javafx.scene.Node> getNodes()Gets the list of nodes that the viewport is displaying -
getLazyCellList
-
isCellPresent
public boolean isCellPresent(int itemIndex) -
getPresentCell
-
getCellIfPresent
-
getCell
-
cropTo
public void cropTo(int fromItem, int toItem) Updates the list of cells to display- Parameters:
fromItem
- the index of the first item to displaytoItem
- the index of the last item to display
-
cellForItem
-
pushScrollEvent
private void pushScrollEvent(javafx.scene.input.ScrollEvent se) Push scroll events received by cell nodes directly to the 'owner' Node. (Generally likely to be a VirtualFlow but not required.) Normal bubbling of scroll events gets interrupted during a scroll gesture when the Cell's Node receiving the event has moved out of the viewport and is thus removed from the Navigator's children list. This breaks expected trackpad scrolling behaviour, at least on macOS. So here we take over event-bubbling duties for ScrollEvent and push them ourselves directly to the given owner. -
presentCellsChanged
-