Class CellListManager<T,C extends Cell<T,? extends javafx.scene.Node>>

java.lang.Object
org.fxmisc.flowless.CellListManager<T,C>

final class CellListManager<T,C extends Cell<T,? extends javafx.scene.Node>> extends Object
Tracks all of the cells that the viewport can display (cells) and which cells the viewport is currently displaying (presentCells).
  • Field Details

    • owner

      private final javafx.scene.Node owner
    • cellPool

      private final CellPool<T,C extends Cell<T,? extends javafx.scene.Node>> cellPool
    • cells

      private final org.reactfx.collection.MemoizationList<C extends Cell<T,? extends javafx.scene.Node>> cells
    • presentCells

      private final org.reactfx.collection.LiveList<C extends Cell<T,? extends javafx.scene.Node>> presentCells
    • cellNodes

      private final org.reactfx.collection.LiveList<javafx.scene.Node> cellNodes
    • presentCellsSubscription

      private final org.reactfx.Subscription presentCellsSubscription
  • Constructor Details

    • CellListManager

      public CellListManager(javafx.scene.Node owner, javafx.collections.ObservableList<T> items, Function<? super T,? extends C> cellFactory)
  • 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

      public org.reactfx.collection.MemoizationList<C> getLazyCellList()
    • isCellPresent

      public boolean isCellPresent(int itemIndex)
    • getPresentCell

      public C getPresentCell(int itemIndex)
    • getCellIfPresent

      public Optional<C> getCellIfPresent(int itemIndex)
    • getCell

      public C getCell(int itemIndex)
    • cropTo

      public void cropTo(int fromItem, int toItem)
      Updates the list of cells to display
      Parameters:
      fromItem - the index of the first item to display
      toItem - the index of the last item to display
    • cellForItem

      private C cellForItem(T item)
    • 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

      private void presentCellsChanged(org.reactfx.collection.QuasiListModification<? extends C> mod)