Class VirtualFlow<T,C extends Cell<T,?>>
- Type Parameters:
T
- the model content that thecell's node
rendersC
- theCell
that can render the model with aNode
.
- All Implemented Interfaces:
javafx.css.Styleable
,javafx.event.EventTarget
,Virtualized
Navigator
. Based on the viewport's VirtualFlow.Gravity
, it sequentially lays out the
Node
s of the Cell
s 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 Node
s from "top-to-bottom" or from "bottom-to-top"
(these terms should be understood in reference to the viewport's orientation
and
VirtualFlow.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.
-
Property Summary
PropertiesTypePropertyDescriptionorg.reactfx.value.Var
<Double> org.reactfx.value.Var
<Double> org.reactfx.value.Var
<Double> javafx.beans.property.ObjectProperty
<VirtualFlow.Gravity> The gravity of the virtual flow.org.reactfx.value.Var
<Double> org.reactfx.value.Val
<Double> org.reactfx.value.Val
<Double> org.reactfx.value.Val
<Double> org.reactfx.value.Val
<Double> Properties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
Properties inherited from class javafx.scene.Parent
needsLayout
Properties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.reactfx.value.Var
<Double> private final org.reactfx.value.Var
<Double> private final CellListManager
<T, C> private final CellPositioner
<T, C> private final javafx.css.StyleableObjectProperty
<VirtualFlow.Gravity> private static final javafx.css.CssMetaData
<VirtualFlow, VirtualFlow.Gravity> private final javafx.collections.ObservableList
<T> private final org.reactfx.value.Var
<Double> private final OrientationHelper
private final SizeTracker
private static final List
<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
VirtualFlow
(javafx.collections.ObservableList<T> items, Function<? super T, ? extends C> cellFactory, OrientationHelper orientation, VirtualFlow.Gravity gravity) -
Method Summary
Modifier and TypeMethodDescriptionorg.reactfx.value.Var
<Double> javafx.geometry.Point2D
cellToViewport
(C cell, double x, double y) javafx.geometry.Bounds
cellToViewport
(C cell, javafx.geometry.Bounds bounds) javafx.geometry.Point2D
cellToViewport
(C cell, javafx.geometry.Point2D point) private double
protected final double
computePrefHeight
(double width) private double
computePrefLength
(double breadth) protected final double
computePrefWidth
(double height) static <T,
C extends Cell<T, ?>>
VirtualFlow<T, C> createHorizontal
(javafx.collections.ObservableList<T> items, Function<? super T, ? extends C> cellFactory) Creates a viewport that lays out content horizontally from left to rightstatic <T,
C extends Cell<T, ?>>
VirtualFlow<T, C> createHorizontal
(javafx.collections.ObservableList<T> items, Function<? super T, ? extends C> cellFactory, VirtualFlow.Gravity gravity) Creates a viewport that lays out content horizontallystatic <T,
C extends Cell<T, ?>>
VirtualFlow<T, C> createVertical
(javafx.collections.ObservableList<T> items, Function<? super T, ? extends C> cellFactory) Creates a viewport that lays out content vertically from top to bottomstatic <T,
C extends Cell<T, ?>>
VirtualFlow<T, C> createVertical
(javafx.collections.ObservableList<T> items, Function<? super T, ? extends C> cellFactory, VirtualFlow.Gravity gravity) Creates a viewport that lays out content vertically from top to bottomvoid
dispose()
org.reactfx.value.Var
<Double> org.reactfx.value.Var
<Double> getCell
(int itemIndex) If the item is out of view, instantiates a new cell for the item.getCellIfVisible
(int itemIndex) This method callsParent.layout()
as a side-effect to insure that the VirtualFlow is up-to-date in light of any changesstatic List
<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> final javafx.geometry.Orientation
List
<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> int
Get the index of the first visible cell (at the time of the last layout).Gets the value of thegravity
property.int
Get the index of the last visible cell (at the time of the last layout).javafx.beans.property.ObjectProperty
<VirtualFlow.Gravity> The gravity of the virtual flow.hit
(double x, double y) Hits this virtual flow at the given coordinates.private void
jumpToAbsolutePosition
(double pixels) protected void
org.reactfx.value.Var
<Double> (package private) void
scrollBreadth
(double deltaBreadth) (package private) void
scrollLength
(double deltaLength) void
scrollXBy
(double deltaX) Scroll the content horizontally by the given amount.void
scrollXToPixel
(double pixel) Scroll the content horizontally to the pixelvoid
scrollYBy
(double deltaY) Scroll the content vertically by the given amount.void
scrollYToPixel
(double pixel) Scroll the content vertically to the pixel(package private) void
setBreadthOffset
(double pixels) void
setGravity
(VirtualFlow.Gravity gravity) Sets the value of thegravity
property.(package private) void
setLengthOffset
(double pixels) void
show
(double viewportOffset) Forces the viewport to acts as though it scrolled from 0 toviewportOffset
).void
show
(int itemIdx) Forces the viewport to show the given item by "scrolling" to itvoid
show
(int itemIndex, javafx.geometry.Bounds region) Forces the viewport to show the given item by "scrolling" to it and then further "scrolling," so that theregion
is visible, in one layout call (e.g., this method does not "scroll" twice).void
showAsFirst
(int itemIdx) Forces the viewport to show the given item as the first visible item as determined by itsVirtualFlow.Gravity
.void
showAsLast
(int itemIdx) Forces the viewport to show the given item as the last visible item as determined by itsVirtualFlow.Gravity
.void
showAtOffset
(int itemIdx, double offset) Forces the viewport to show the given item by "scrolling" to it and then further "scrolling" byoffset
in one layout call (e.g., this method does not "scroll" twice)private void
showBreadthRegion
(double fromX, double toX) org.reactfx.value.Val
<Double> org.reactfx.value.Val
<Double> org.reactfx.value.Val
<Double> org.reactfx.value.Val
<Double> javafx.collections.ObservableList
<C> This method callsParent.layout()
as a side-effect to insure that the VirtualFlow is up-to-date in light of any changesMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
Methods inherited from class javafx.scene.Parent
getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
Methods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javafx.css.Styleable
getStyleableNode
Methods inherited from interface org.fxmisc.flowless.Virtualized
getEstimatedScrollX, getEstimatedScrollY, getTotalHeightEstimate, getTotalWidthEstimate, scrollBy, scrollBy, scrollToPixel, scrollToPixel
-
Property Details
-
breadthOffset
- See Also:
-
totalBreadthEstimate
- See Also:
-
lengthOffsetEstimate
- See Also:
-
totalLengthEstimate
- See Also:
-
totalWidthEstimate
- Specified by:
totalWidthEstimateProperty
in interfaceVirtualized
- See Also:
-
totalHeightEstimate
- Specified by:
totalHeightEstimateProperty
in interfaceVirtualized
- See Also:
-
estimatedScrollX
- Specified by:
estimatedScrollXProperty
in interfaceVirtualized
- See Also:
-
estimatedScrollY
- Specified by:
estimatedScrollYProperty
in interfaceVirtualized
- See Also:
-
gravity
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; }
- See Also:
-
-
Field Details
-
items
-
orientation
-
cellListManager
-
sizeTracker
-
cellPositioner
-
gravity
-
breadthOffset0
-
breadthOffset
-
lengthOffsetEstimate
-
GRAVITY
-
STYLEABLES
-
-
Constructor Details
-
VirtualFlow
private VirtualFlow(javafx.collections.ObservableList<T> items, Function<? super T, ? extends C> cellFactory, OrientationHelper orientation, VirtualFlow.Gravity gravity)
-
-
Method Details
-
createHorizontal
public static <T,C extends Cell<T, VirtualFlow<T,?>> C> createHorizontal(javafx.collections.ObservableList<T> items, Function<? super T, ? extends C> cellFactory) Creates a viewport that lays out content horizontally from left to right -
createHorizontal
public static <T,C extends Cell<T, VirtualFlow<T,?>> C> createHorizontal(javafx.collections.ObservableList<T> items, Function<? super T, ? extends C> cellFactory, VirtualFlow.Gravity gravity) Creates a viewport that lays out content horizontally -
createVertical
public static <T,C extends Cell<T, VirtualFlow<T,?>> C> createVertical(javafx.collections.ObservableList<T> items, Function<? super T, ? extends C> cellFactory) Creates a viewport that lays out content vertically from top to bottom -
createVertical
public static <T,C extends Cell<T, VirtualFlow<T,?>> C> createVertical(javafx.collections.ObservableList<T> items, Function<? super T, ? extends C> cellFactory, VirtualFlow.Gravity gravity) Creates a viewport that lays out content vertically from top to bottom -
breadthOffsetProperty
- Returns:
- the
breadthOffset
property
-
totalBreadthEstimateProperty
- Returns:
- the
totalBreadthEstimate
property
-
lengthOffsetEstimateProperty
- Returns:
- the
lengthOffsetEstimate
property
-
dispose
public void dispose() -
getCell
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.- 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.
-
getCellIfVisible
This method callsParent.layout()
as a side-effect to insure that the VirtualFlow is up-to-date in light of any changes -
visibleCells
This method callsParent.layout()
as a side-effect to insure that the VirtualFlow is up-to-date in light of any changes -
totalLengthEstimateProperty
- Returns:
- the
totalLengthEstimate
property
-
cellToViewport
-
cellToViewport
-
cellToViewport
-
layoutChildren
protected void layoutChildren()- Overrides:
layoutChildren
in classjavafx.scene.Parent
-
computePrefWidth
protected final double computePrefWidth(double height) - Overrides:
computePrefWidth
in classjavafx.scene.layout.Region
-
computePrefHeight
protected final double computePrefHeight(double width) - Overrides:
computePrefHeight
in classjavafx.scene.layout.Region
-
computePrefBreadth
private double computePrefBreadth() -
computePrefLength
private double computePrefLength(double breadth) -
getContentBias
public final javafx.geometry.Orientation getContentBias()- Overrides:
getContentBias
in classjavafx.scene.Node
-
scrollLength
void scrollLength(double deltaLength) -
scrollBreadth
void scrollBreadth(double deltaBreadth) -
scrollXBy
public void scrollXBy(double deltaX) Scroll the content horizontally by the given amount.- Specified by:
scrollXBy
in interfaceVirtualized
- Parameters:
deltaX
- positive value scrolls right, negative value scrolls left
-
scrollYBy
public void scrollYBy(double deltaY) Scroll the content vertically by the given amount.- Specified by:
scrollYBy
in interfaceVirtualized
- Parameters:
deltaY
- positive value scrolls down, negative value scrolls up
-
scrollXToPixel
public void scrollXToPixel(double pixel) Scroll the content horizontally to the pixel- Specified by:
scrollXToPixel
in interfaceVirtualized
- Parameters:
pixel
- - the pixel position to which to scroll
-
scrollYToPixel
public void scrollYToPixel(double pixel) Scroll the content vertically to the pixel- Specified by:
scrollYToPixel
in interfaceVirtualized
- Parameters:
pixel
- - the pixel position to which to scroll
-
totalWidthEstimateProperty
- Specified by:
totalWidthEstimateProperty
in interfaceVirtualized
- Returns:
- the
totalWidthEstimate
property
-
totalHeightEstimateProperty
- Specified by:
totalHeightEstimateProperty
in interfaceVirtualized
- Returns:
- the
totalHeightEstimate
property
-
estimatedScrollXProperty
- Specified by:
estimatedScrollXProperty
in interfaceVirtualized
- Returns:
- the
estimatedScrollX
property
-
estimatedScrollYProperty
- Specified by:
estimatedScrollYProperty
in interfaceVirtualized
- Returns:
- the
estimatedScrollY
property
-
hit
Hits this virtual flow at the given coordinates.- Parameters:
x
- x offset from the left edge of the viewporty
- y offset from the top edge of the viewport- 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.
-
show
public void show(double viewportOffset) Forces the viewport to acts as though it scrolled from 0 toviewportOffset
). Note: the viewport makes an educated guess as to which cell is actually atviewportOffset
if the viewport's entire content was completely rendered.- Parameters:
viewportOffset
- SeeOrientationHelper
and its implementations for explanation on what the offset means based on which implementation is used.
-
show
public void show(int itemIdx) Forces the viewport to show the given item by "scrolling" to it -
showAsFirst
public void showAsFirst(int itemIdx) Forces the viewport to show the given item as the first visible item as determined by itsVirtualFlow.Gravity
. -
showAsLast
public void showAsLast(int itemIdx) Forces the viewport to show the given item as the last visible item as determined by itsVirtualFlow.Gravity
. -
showAtOffset
public void showAtOffset(int itemIdx, double offset) Forces the viewport to show the given item by "scrolling" to it and then further "scrolling" byoffset
in one layout call (e.g., this method does not "scroll" twice)- Parameters:
offset
- the offset value as determined by the viewport'sOrientationHelper
.
-
show
public void show(int itemIndex, javafx.geometry.Bounds region) Forces the viewport to show the given item by "scrolling" to it and then further "scrolling," so that theregion
is visible, in one layout call (e.g., this method does not "scroll" twice). -
getFirstVisibleIndex
public int getFirstVisibleIndex()Get the index of the first visible cell (at the time of the last layout).- Returns:
- The index of the first visible cell
-
getLastVisibleIndex
public int getLastVisibleIndex()Get the index of the last visible cell (at the time of the last layout).- Returns:
- The index of the last visible cell
-
showBreadthRegion
private void showBreadthRegion(double fromX, double toX) -
setLengthOffset
void setLengthOffset(double pixels) -
setBreadthOffset
void setBreadthOffset(double pixels) -
jumpToAbsolutePosition
private void jumpToAbsolutePosition(double pixels) -
gravityProperty
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; }
- Returns:
- the
gravity
property - See Also:
-
getGravity
Gets the value of thegravity
property.- Property description:
- 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; }
- Returns:
- the value of the
gravity
property - See Also:
-
setGravity
Sets the value of thegravity
property.- Property description:
- 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; }
- Parameters:
gravity
- the value for thegravity
property- See Also:
-
getClassCssMetaData
-
getCssMetaData
- Specified by:
getCssMetaData
in interfacejavafx.css.Styleable
- Overrides:
getCssMetaData
in classjavafx.scene.layout.Region
-