Top Description Fields Constructors Methods
org.fxmisc.flowless

pack-priv final Class CellListManager<T, C extends Cell<T, ? extends Node>>

extends Object
Class Inheritance
Imports
java.util.Optional, java.util.function.Function, javafx.collections.ObservableList, javafx.scene.Node, javafx.scene.control.IndexRange, javafx.scene.input.ScrollEvent, org.reactfx.EventStreams, .Subscription, org.reactfx.collection.LiveList, .MemoizationList, .QuasiListModification

Tracks all of the cells that the viewport can display (cells) and which cells the viewport is currently displaying (presentCells).

Field Summary

Modifier and TypeField and Description
private final LiveList<Node>
private final CellPool<T, C>
private final MemoizationList<C>
private final Node
private final LiveList<C>
private final Subscription

Constructor Summary

AccessConstructor and Description
public
CellListManager(Node owner, ObservableList<T> items, Function<? super T, ? extends C> cellFactory)

Method Summary

Modifier and TypeMethod and Description
private C
cellForItem(T item)

public void
cropTo(int
the index of the first item to display
fromItem
,
int
the index of the last item to display
toItem
)

Updates the list of cells to display

public void
public C
getCell(int itemIndex)

public Optional<C>
getCellIfPresent(int itemIndex)

public MemoizationList<C>
public ObservableList<Node>
getNodes()

Gets the list of nodes that the viewport is displaying

public C
getPresentCell(int itemIndex)

public boolean
isCellPresent(int itemIndex)

private void
private void
pushScrollEvent(ScrollEvent se)

Push scroll events received by cell nodes directly to the 'owner' Node.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cellNodesback to summary
private final LiveList<Node> cellNodes
cellPoolback to summary
private final CellPool<T, C> cellPool
cellsback to summary
private final MemoizationList<C> cells
ownerback to summary
private final Node owner
presentCellsback to summary
private final LiveList<C> presentCells
presentCellsSubscriptionback to summary
private final Subscription presentCellsSubscription

Constructor Detail

CellListManagerback to summary
public CellListManager(Node owner, ObservableList<T> items, Function<? super T, ? extends C> cellFactory)

Method Detail

cellForItemback to summary
private C cellForItem(T item)
cropToback to summary
public void cropTo(int fromItem, int toItem)

Updates the list of cells to display

Parameters
fromItem:int

the index of the first item to display

toItem:int

the index of the last item to display

disposeback to summary
public void dispose()
getCellback to summary
public C getCell(int itemIndex)
getCellIfPresentback to summary
public Optional<C> getCellIfPresent(int itemIndex)
getLazyCellListback to summary
public MemoizationList<C> getLazyCellList()
getNodesback to summary
public ObservableList<Node> getNodes()

Gets the list of nodes that the viewport is displaying

getPresentCellback to summary
public C getPresentCell(int itemIndex)
isCellPresentback to summary
public boolean isCellPresent(int itemIndex)
presentCellsChangedback to summary
private void presentCellsChanged(QuasiListModification<? extends C> mod)
pushScrollEventback to summary
private void pushScrollEvent(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.