Top Description Fields Constructors Methods
org.fxmisc.flowless

pack-priv final Class SizeTracker

extends Object
Class Inheritance
Imports
java.util.Optional, .NoSuchElementException, java.util.function.Function, javafx.beans.value.ObservableObjectValue, javafx.geometry.Bounds, javafx.scene.control.IndexRange, org.reactfx.Subscription, org.reactfx.collection.LiveList, .MemoizationList, org.reactfx.value.Val, .ValBase

Estimates the size of the entire viewport (if it was actually completely rendered) based on the known sizes of the Cells whose nodes are currently displayed in the viewport and an estimated average of Cells whose nodes are not displayed in the viewport. The meaning of breadthForCells and totalLengthEstimate are dependent upon which implementation of OrientationHelper is used.

Field Summary

Modifier and TypeField and Description
private final Val<Double>
averageLengthEstimate

Stores either null or the average length of the cells' nodes currently displayed in the viewport

private final Val<Double>
breadthForCells

Stores either the greatest minimum cell's node's breadth or the viewport's breadth

private final MemoizationList<Double>
private final MemoizationList<? extends Cell<?, ?>>
private final Val<Double>
private final MemoizationList<Double>
private final Val<Double>
private final OrientationHelper
private final Subscription
private final Val<Double>
private final ObservableObjectValue<Bounds>

Constructor Summary

AccessConstructor and Description
public
SizeTracker(OrientationHelper
if vertical, breadth = width and length = height; if horizontal, breadth = height and length = width
orientation
,
ObservableObjectValue<Bounds> viewportBounds, MemoizationList<? extends Cell<?, ?>> lazyCells)

Constructs a SizeTracker

Method Summary

Modifier and TypeMethod and Description
public Val<Double>
private static <T> Val<T>
public double
breadthFor(int itemIndex)

public void
public void
forgetSizeOf(int itemIndex)

public Optional<Double>
public double
public double
public double
public double
lengthFor(int itemIndex)

public Val<Double>
public Val<Double>
public Val<Double>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

averageLengthEstimateback to summary
private final Val<Double> averageLengthEstimate

Stores either null or the average length of the cells' nodes currently displayed in the viewport

breadthForCellsback to summary
private final Val<Double> breadthForCells

Stores either the greatest minimum cell's node's breadth or the viewport's breadth

breadthsback to summary
private final MemoizationList<Double> breadths
cellsback to summary
private final MemoizationList<? extends Cell<?, ?>> cells
lengthOffsetEstimateback to summary
private final Val<Double> lengthOffsetEstimate
lengthsback to summary
private final MemoizationList<Double> lengths
maxKnownMinBreadthback to summary
private final Val<Double> maxKnownMinBreadth
orientationback to summary
private final OrientationHelper orientation
subscriptionback to summary
private final Subscription subscription
totalLengthEstimateback to summary
private final Val<Double> totalLengthEstimate
viewportBoundsback to summary
private final ObservableObjectValue<Bounds> viewportBounds

Constructor Detail

SizeTrackerback to summary
public SizeTracker(OrientationHelper orientation, ObservableObjectValue<Bounds> viewportBounds, MemoizationList<? extends Cell<?, ?>> lazyCells)

Constructs a SizeTracker

Parameters
orientation:OrientationHelper

if vertical, breadth = width and length = height; if horizontal, breadth = height and length = width

Method Detail

averageLengthEstimatePropertyback to summary
public Val<Double> averageLengthEstimateProperty()
avoidFalseInvalidationsback to summary
private static <T> Val<T> avoidFalseInvalidations(Val<T> src)
breadthForback to summary
public double breadthFor(int itemIndex)
disposeback to summary
public void dispose()
forgetSizeOfback to summary
public void forgetSizeOf(int itemIndex)
getAverageLengthEstimateback to summary
public Optional<Double> getAverageLengthEstimate()
getCellLayoutBreadthback to summary
public double getCellLayoutBreadth()
getViewportBreadthback to summary
public double getViewportBreadth()
getViewportLengthback to summary
public double getViewportLength()
lengthForback to summary
public double lengthFor(int itemIndex)
lengthOffsetEstimatePropertyback to summary
public Val<Double> lengthOffsetEstimateProperty()
maxCellBreadthPropertyback to summary
public Val<Double> maxCellBreadthProperty()
totalLengthEstimatePropertyback to summary
public Val<Double> totalLengthEstimateProperty()