Class SizeTracker
java.lang.Object
org.fxmisc.flowless.SizeTracker
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.-
Property Summary
Properties -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.reactfx.value.Val<Double> Stores either null or the average length of the cells' nodes currently displayed in the viewportprivate final org.reactfx.value.Val<Double> Stores either the greatest minimum cell's node's breadth or the viewport's breadthprivate final org.reactfx.collection.MemoizationList<Double> private final org.reactfx.collection.MemoizationList<? extends Cell<?, ?>> private final org.reactfx.value.Val<Double> private final org.reactfx.collection.MemoizationList<Double> private final org.reactfx.value.Val<Double> private final OrientationHelperprivate final org.reactfx.Subscriptionprivate final org.reactfx.value.Val<Double> private final javafx.beans.value.ObservableObjectValue<javafx.geometry.Bounds> -
Constructor Summary
ConstructorsConstructorDescriptionSizeTracker(OrientationHelper orientation, javafx.beans.value.ObservableObjectValue<javafx.geometry.Bounds> viewportBounds, org.reactfx.collection.MemoizationList<? extends Cell<?, ?>> lazyCells) Constructs a SizeTracker -
Method Summary
Modifier and TypeMethodDescriptionorg.reactfx.value.Val<Double> Stores either null or the average length of the cells' nodes currently displayed in the viewportprivate static <T> org.reactfx.value.Val<T> avoidFalseInvalidations(org.reactfx.value.Val<T> src) doublebreadthFor(int itemIndex) voiddispose()voidforgetSizeOf(int itemIndex) Gets the value of theaverageLengthEstimateproperty.doubledoubledoubledoublelengthFor(int itemIndex) org.reactfx.value.Val<Double> org.reactfx.value.Val<Double> org.reactfx.value.Val<Double>
-
Property Details
-
maxCellBreadth
- See Also:
-
averageLengthEstimate
Stores either null or the average length of the cells' nodes currently displayed in the viewport- See Also:
-
totalLengthEstimate
- See Also:
-
lengthOffsetEstimate
- See Also:
-
-
Field Details
-
orientation
-
viewportBounds
private final javafx.beans.value.ObservableObjectValue<javafx.geometry.Bounds> viewportBounds -
cells
-
breadths
-
maxKnownMinBreadth
-
breadthForCells
Stores either the greatest minimum cell's node's breadth or the viewport's breadth -
lengths
-
averageLengthEstimate
Stores either null or the average length of the cells' nodes currently displayed in the viewport -
totalLengthEstimate
-
lengthOffsetEstimate
-
subscription
private final org.reactfx.Subscription subscription
-
-
Constructor Details
-
SizeTracker
public SizeTracker(OrientationHelper orientation, javafx.beans.value.ObservableObjectValue<javafx.geometry.Bounds> viewportBounds, org.reactfx.collection.MemoizationList<? extends Cell<?, ?>> lazyCells) Constructs a SizeTracker- Parameters:
orientation- if vertical, breadth = width and length = height; if horizontal, breadth = height and length = width
-
-
Method Details
-
avoidFalseInvalidations
private static <T> org.reactfx.value.Val<T> avoidFalseInvalidations(org.reactfx.value.Val<T> src) -
dispose
public void dispose() -
maxCellBreadthProperty
- Returns:
- the
maxCellBreadthproperty
-
getViewportBreadth
public double getViewportBreadth() -
getViewportLength
public double getViewportLength() -
averageLengthEstimateProperty
Stores either null or the average length of the cells' nodes currently displayed in the viewport- Returns:
- the
averageLengthEstimateproperty - See Also:
-
getAverageLengthEstimate
-
totalLengthEstimateProperty
- Returns:
- the
totalLengthEstimateproperty
-
lengthOffsetEstimateProperty
- Returns:
- the
lengthOffsetEstimateproperty
-
breadthFor
public double breadthFor(int itemIndex) -
forgetSizeOf
public void forgetSizeOf(int itemIndex) -
lengthFor
public double lengthFor(int itemIndex) -
getCellLayoutBreadth
public double getCellLayoutBreadth()
-