Package org.fxmisc.flowless
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
Cell
s whose nodes are currently displayed in the viewport and an estimated average of
Cell
s 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 javafx.beans.property.SimpleBooleanProperty
private final org.reactfx.value.Val
<Double> private final org.reactfx.collection.MemoizationList
<Double> private final org.reactfx.value.Val
<Double> private final OrientationHelper
private final org.reactfx.Subscription
private 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) double
breadthFor
(int itemIndex) void
dispose()
void
forgetSizeOf
(int itemIndex) Gets the value of theaverageLengthEstimate
property.double
double
double
double
lengthFor
(int itemIndex) org.reactfx.value.Val
<Double> org.reactfx.value.Val
<Double> org.reactfx.value.Val
<Double> (package private) void
-
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 -
immediateUpdate
private javafx.beans.property.SimpleBooleanProperty immediateUpdate
-
-
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
-
updateNextLengthOffsetEstimateImmediately
void updateNextLengthOffsetEstimateImmediately() -
avoidFalseInvalidations
private static <T> org.reactfx.value.Val<T> avoidFalseInvalidations(org.reactfx.value.Val<T> src) -
dispose
public void dispose() -
maxCellBreadthProperty
- Returns:
- the
maxCellBreadth
property
-
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
averageLengthEstimate
property - See Also:
-
getAverageLengthEstimate
Gets the value of theaverageLengthEstimate
property.- Property description:
- Stores either null or the average length of the cells' nodes currently displayed in the viewport
- Returns:
- the value of the
averageLengthEstimate
property - See Also:
-
totalLengthEstimateProperty
- Returns:
- the
totalLengthEstimate
property
-
lengthOffsetEstimateProperty
- Returns:
- the
lengthOffsetEstimate
property
-
breadthFor
public double breadthFor(int itemIndex) -
forgetSizeOf
public void forgetSizeOf(int itemIndex) -
lengthFor
public double lengthFor(int itemIndex) -
getCellLayoutBreadth
public double getCellLayoutBreadth()
-