cell's node renders
Cell that can render the model with a javafx.scene.Node .
Navigator. Based on the viewport's Gravity, it sequentially lays out the
javafx.scene.Node s of the Cells until the viewport is completely filled up or it has no additional
cell's nodes to render.
Since this viewport does not fully render all of its content, the scroll values are estimates based on the nodes that are currently displayed in the viewport. If every node that could be rendered is the same width or same height, then the corresponding scroll values (e.g., scrollX or totalX) are accurate
Note
the VirtualFlow does not have scroll bars by default. These can be added by wrapping this object
in a VirtualizedScrollPane.
Since the viewport can be used to lay out its content horizontally or vertically, it uses two
orientation-agnostic terms to refer to its width and height: "breadth" and "length," respectively. The viewport
always lays out its cell's javafx.s from "top-to-bottom" or from "bottom-to-top"
(these terms should be understood in reference to the viewport's orientation and
Gravity). Thus, its length ("height") is independent as the viewport's bounds are dependent upon
its parent's bounds whereas its breadth ("width") is dependent upon its length.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | VirtualFlow.
Determines how the cells in the viewport should be laid out and where any extra unused space should exist if there are not enough cells to completely fill up the viewport |
| Modifier and Type | Field and Description |
|---|---|
| private final Var | |
| private final Var | |
| private final CellListManager | |
| private final CellPositioner | |
| private final StyleableObjectProperty | |
| private static final CssMetaData | |
| private final ObservableList | |
| private final Var | |
| private final Navigator | |
| private final OrientationHelper | |
| private final SizeTracker | |
| private static final List |
| Access | Constructor and Description |
|---|---|
| private | VirtualFlow(ObservableList<T> items, Function<? super T, ? extends C> cellFactory, OrientationHelper orientation, VirtualFlow.
|
| Modifier and Type | Method and Description |
|---|---|
| public Var | |
| public Bounds | |
| public Point2D | |
| public Point2D | |
| private double | |
| protected final double | computePrefHeight(double width)
Overrides javafx. Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. |
| private double | |
| protected final double | computePrefWidth(double height)
Overrides javafx. Computes the preferred width of this region for the given height. |
| public static <T, C extends Cell | createHorizontal(ObservableList<T> items, Function<? super T, ? extends C> cellFactory)
Creates a viewport that lays out content horizontally from left to right |
| public static <T, C extends Cell | createHorizontal(ObservableList<T> items, Function<? super T, ? extends C> cellFactory, VirtualFlow.
Creates a viewport that lays out content horizontally |
| public static <T, C extends Cell | createVertical(ObservableList<T> items, Function<? super T, ? extends C> cellFactory)
Creates a viewport that lays out content vertically from top to bottom |
| public static <T, C extends Cell | createVertical(ObservableList<T> items, Function<? super T, ? extends C> cellFactory, VirtualFlow.
Creates a viewport that lays out content vertically from top to bottom |
| public void | |
| public Var | |
| public Var | |
| public C | Returns: Cell for the given item. The cell will be valid only until the next layout pass. It should therefore not be stored. It is intended to be used for measurement purposes only.If the item is out of view, instantiates a new cell for the item. |
| public Optional | getCellIfVisible(int itemIndex)
This method calls |
| public static List | getClassCssMetaData()
Hides javafx. Gets the |
| public final Orientation | getContentBias()
Overrides javafx. Returns the orientation of a node's resizing bias for layout purposes. |
| public List | getCssMetaData()
Overrides javafx. Implements javafx. This method should delegate to |
| public int | Returns: The index of the first visible cellGet the index of the first visible cell (at the time of the last layout). |
| public VirtualFlow. | |
| public int | Returns: The index of the last visible cellGet the index of the last visible cell (at the time of the last layout). |
| public ObjectProperty | |
| public VirtualFlowHit | Returns: hit info containing the cell that was hit and coordinates relative to the cell. If the hit was before the cells (i.e. above a vertical flow content or left of a horizontal flow content), returns a hit before cells containing offset from the top left corner of the content. If the hit was after the cells (i.e. below a vertical flow content or right of a horizontal flow content), returns a hit after cells containing offset from the top right corner of the content of a horizontal flow or bottom left corner of the content of a vertical flow.x offset from the left edge of the viewport x, double y offset from the top edge of the viewport y)Hits this virtual flow at the given coordinates. |
| private void | |
| protected void | layoutChildren()
Overrides javafx. Invoked during the layout pass to layout the children in this
|
| public Var | |
| pack-priv void | |
| pack-priv void | |
| public void | scrollXBy(double
positive value scrolls right, negative value scrolls left deltaX)Implements org. Scroll the content horizontally by the given amount. |
| public void | scrollXToPixel(double
- the pixel position to which to scroll pixel)Implements org. Scroll the content horizontally to the pixel |
| public void | scrollYBy(double
positive value scrolls down, negative value scrolls up deltaY)Implements org. Scroll the content vertically by the given amount. |
| public void | scrollYToPixel(double
- the pixel position to which to scroll pixel)Implements org. Scroll the content vertically to the pixel |
| pack-priv void | |
| public void | |
| pack-priv void | |
| public void | show(double
See viewportOffset)OrientationHelper and its implementations for explanation on what the offset
means based on which implementation is used.Forces the viewport to acts as though it scrolled from 0 to Note the
viewport makes an educated guess as to which cell is actually at |
| public void | |
| public void | |
| public void | showAsFirst(int itemIdx)
Forces the viewport to show the given item as the first visible item as determined by its |
| public void | showAsLast(int itemIdx)
Forces the viewport to show the given item as the last visible item as determined by its |
| public void | showAtOffset(int itemIdx, double
the offset value as determined by the viewport's offset)OrientationHelper.Forces the viewport to show the given item by "scrolling" to it and then further "scrolling" by |
| private void | |
| public Val | |
| public Val | |
| public Val | |
| public Val | |
| public ObservableList | visibleCells()
This method calls |
| breadthOffset | back to summary |
|---|---|
| private final Var<Double> breadthOffset | |
| breadthOffset0 | back to summary |
|---|---|
| private final Var<Double> breadthOffset0 | |
| cellListManager | back to summary |
|---|---|
| private final CellListManager<T, C> cellListManager | |
| cellPositioner | back to summary |
|---|---|
| private final CellPositioner<T, C> cellPositioner | |
| gravity | back to summary |
|---|---|
| private final StyleableObjectProperty<VirtualFlow. | |
| GRAVITY | back to summary |
|---|---|
private static final CssMetaData<VirtualFlow<T, C extends Cell<T, ?>>, VirtualFlow.
| |
| items | back to summary |
|---|---|
| private final ObservableList<T> items | |
| lengthOffsetEstimate | back to summary |
|---|---|
| private final Var<Double> lengthOffsetEstimate | |
| navigator | back to summary |
|---|---|
| private final Navigator<T, C> navigator | |
| orientation | back to summary |
|---|---|
| private final OrientationHelper orientation | |
| sizeTracker | back to summary |
|---|---|
| private final SizeTracker sizeTracker | |
| STYLEABLES | back to summary |
|---|---|
| private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES | |
| VirtualFlow | back to summary |
|---|---|
| private VirtualFlow(ObservableList<T> items, Function<? super T, ? extends C> cellFactory, OrientationHelper orientation, VirtualFlow. | |
| breadthOffsetProperty | back to summary |
|---|---|
| public Var | |
| cellToViewport | back to summary |
|---|---|
| public Bounds cellToViewport(C cell, Bounds bounds) | |
| cellToViewport | back to summary |
|---|---|
| public Point2D cellToViewport(C cell, Point2D point) | |
| cellToViewport | back to summary |
|---|---|
| public Point2D cellToViewport(C cell, double x, double y) | |
| computePrefBreadth | back to summary |
|---|---|
| private double computePrefBreadth() | |
| computePrefHeight | back to summary |
|---|---|
| protected final double computePrefHeight(double width) Overrides javafx. Doc from javafx. Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.
| |
| computePrefLength | back to summary |
|---|---|
| private double computePrefLength(double breadth) | |
| computePrefWidth | back to summary |
|---|---|
| protected final double computePrefWidth(double height) Overrides javafx. Doc from javafx. Computes the preferred width of this region for the given height. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.
| |
| createHorizontal | back to summary |
|---|---|
| public static <T, C extends Cell Creates a viewport that lays out content horizontally from left to right | |
| createHorizontal | back to summary |
|---|---|
| public static <T, C extends Cell Creates a viewport that lays out content horizontally | |
| createVertical | back to summary |
|---|---|
| public static <T, C extends Cell Creates a viewport that lays out content vertically from top to bottom | |
| createVertical | back to summary |
|---|---|
| public static <T, C extends Cell Creates a viewport that lays out content vertically from top to bottom | |
| dispose | back to summary |
|---|---|
| public void dispose() | |
| estimatedScrollXProperty | back to summary |
|---|---|
| public Var Implements org.
| |
| estimatedScrollYProperty | back to summary |
|---|---|
| public Var Implements org.
| |
| getCell | back to summary |
|---|---|
| public C getCell(int itemIndex) If the item is out of view, instantiates a new cell for the item. The returned cell will be properly sized, but not properly positioned relative to the cells in the viewport, unless it is itself in the viewport.
| |
| getCellIfVisible | back to summary |
|---|---|
| public Optional This method calls | |
| getClassCssMetaData | back to summary |
|---|---|
| public static List Hides javafx. Doc from javafx. Gets the | |
| getContentBias | back to summary |
|---|---|
| public final Orientation getContentBias() Overrides javafx. Doc from javafx. Returns the orientation of a node's resizing bias for layout purposes. If the node type has no bias, returns null. If the node is resizable and it's height depends on its width, returns HORIZONTAL, else if its width depends on its height, returns VERTICAL. Resizable subclasses should override this method to return an appropriate value.
| |
| getCssMetaData | back to summary |
|---|---|
| public List Overrides javafx. Implements javafx. Doc from javafx. This method should delegate to
| |
| getFirstVisibleIndex | back to summary |
|---|---|
| public int getFirstVisibleIndex() Get the index of the first visible cell (at the time of the last layout).
| |
| getGravity | back to summary |
|---|---|
| public VirtualFlow. | |
| getLastVisibleIndex | back to summary |
|---|---|
| public int getLastVisibleIndex() Get the index of the last visible cell (at the time of the last layout).
| |
| gravityProperty | back to summary |
|---|---|
| public ObjectProperty The gravity of the virtual flow. When there are not enough cells to fill the full height (vertical virtual flow) or width (horizontal virtual flow), the cells are placed either at the front (vertical: top, horizontal: left), or rear (vertical: bottom, horizontal: right) of the virtual flow, depending on the value of the gravity property. The gravity can also be styled in CSS, using the "-flowless-gravity" property, for example: .virtual-flow { -flowless-gravity: rear; }
| |
| hit | back to summary |
|---|---|
| public VirtualFlowHit Hits this virtual flow at the given coordinates.
| |
| jumpToAbsolutePosition | back to summary |
|---|---|
| private void jumpToAbsolutePosition(double pixels) | |
| layoutChildren | back to summary |
|---|---|
| protected void layoutChildren() Overrides javafx. Doc from javafx. Invoked during the layout pass to layout the children in this
Subclasses should override this function to layout content as needed.
| |
| lengthOffsetEstimateProperty | back to summary |
|---|---|
| public Var | |
| scrollBreadth | back to summary |
|---|---|
| pack-priv void scrollBreadth(double deltaBreadth) | |
| scrollLength | back to summary |
|---|---|
| pack-priv void scrollLength(double deltaLength) | |
| scrollXBy | back to summary |
|---|---|
| public void scrollXBy(double deltaX) Implements org. Scroll the content horizontally by the given amount.
| |
| scrollXToPixel | back to summary |
|---|---|
| public void scrollXToPixel(double pixel) Implements org. Scroll the content horizontally to the pixel
| |
| scrollYBy | back to summary |
|---|---|
| public void scrollYBy(double deltaY) Implements org. Scroll the content vertically by the given amount.
| |
| scrollYToPixel | back to summary |
|---|---|
| public void scrollYToPixel(double pixel) Implements org. Scroll the content vertically to the pixel
| |
| setBreadthOffset | back to summary |
|---|---|
| pack-priv void setBreadthOffset(double pixels) | |
| setGravity | back to summary |
|---|---|
| public void setGravity(VirtualFlow. | |
| setLengthOffset | back to summary |
|---|---|
| pack-priv void setLengthOffset(double pixels) | |
| show | back to summary |
|---|---|
| public void show(double viewportOffset) Forces the viewport to acts as though it scrolled from 0 to Note the
viewport makes an educated guess as to which cell is actually at
| |
| show | back to summary |
|---|---|
| public void show(int itemIdx) Forces the viewport to show the given item by "scrolling" to it | |
| show | back to summary |
|---|---|
| public void show(int itemIndex, Bounds region) Forces the viewport to show the given item by "scrolling" to it and then further "scrolling," so that the
| |
| showAsFirst | back to summary |
|---|---|
| public void showAsFirst(int itemIdx) Forces the viewport to show the given item as the first visible item as determined by its | |
| showAsLast | back to summary |
|---|---|
| public void showAsLast(int itemIdx) Forces the viewport to show the given item as the last visible item as determined by its | |
| showAtOffset | back to summary |
|---|---|
| public void showAtOffset(int itemIdx, double offset) Forces the viewport to show the given item by "scrolling" to it and then further "scrolling" by
| |
| showBreadthRegion | back to summary |
|---|---|
| private void showBreadthRegion(double fromX, double toX) | |
| totalBreadthEstimateProperty | back to summary |
|---|---|
| public Val | |
| totalHeightEstimateProperty | back to summary |
|---|---|
| public Val Implements org.
| |
| totalLengthEstimateProperty | back to summary |
|---|---|
| public Val | |
| totalWidthEstimateProperty | back to summary |
|---|---|
| public Val Implements org.
| |
| visibleCells | back to summary |
|---|---|
| public ObservableList This method calls | |
| Modifier and Type | Field and Description |
|---|---|
| public static final VirtualFlow. | FRONT
If using a |
| public static final VirtualFlow. | REAR
If using a |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static VirtualFlow. | |
| public static VirtualFlow. |
| FRONT | back to summary |
|---|---|
| public static final VirtualFlow. If using a
If using a | |
| REAR | back to summary |
|---|---|
| public static final VirtualFlow. If using a
If using a | |
| Gravity | back to summary |
|---|---|
| private Gravity() | |
| valueOf | back to summary |
|---|---|
| public static VirtualFlow. | |
| values | back to summary |
|---|---|
| public static VirtualFlow. | |