Class VirtualFlow<T,C extends Cell<T>>
- Type Parameters:
T- the type of objects to representC- the type ofCellto use
- All Implemented Interfaces:
Styleable,EventTarget,Skinnable
- Direct Known Subclasses:
PaginatedVirtualFlow
Extends Control, has its own skin implementation VirtualFlowSkin and
its own cell system, Cell.
- The items list is managed automatically (permutations, insertions, removals, updates)
- The function used to generate the cells, also called "cellFactory", can be changed anytime even at runtime
- The control also manages the size of all the cells through the cellSizeProperty()
- You can set the position (scroll) through the properties or a series of public methods
- It can lay out the cell from the TOP to the BOTTOM or from the LEFT to the RIGHT according to the set
orientation, orientationProperty(), you can swap the orientation at anytime
- It even allows you to specify the OrientationHelper through the orientationHelperFactoryProperty()
- It is possible to retrieve the currently shown/built cells as a map in which each cell has
the item's index as its key. Just keep in mind that if you want to observe for changes in the cells it is best
to observe for changes on the stateProperty() since the virtual flow rarely builds new cells and reuses
the one already available
It is possible to observe for changes o the estimated length and max breadth through estimatedLengthProperty()
and maxBreadthProperty()
It is possible to programmatically tell the viewport to update its layout with requestViewportLayout()
Orientation.VERTICAL: length -> height, breadth -> width
Orientation.HORIZONTAL: length -> width, breadth -> height
-
Property Summary
PropertiesTypePropertyDescriptionSpecifies the function used to build the cells.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoublePropertySpecifies the cells' size:io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoublePropertyUsed by the viewport's clip to set its border radius.Specifies the total length of all the cells.io.github.palexdev.mfxcore.base.properties.styleable.StyleableBooleanPropertySpecifies whether cells should be resized to be the same size of the viewport in the opposite direction of the currentorientationProperty().Specifies the horizontal position in the viewport.Specifies theObservableListused to store the items.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>>Specifies the last range of displayed items by the viewport as anIntegerRange.Specifies the max breadth among the currently visible cells.Specifies whether the viewport needs to compute the layout of its content.io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<Orientation,OrientationHelper> To allow more customization on how the cells are laid out, the virtual flow allows you to specify a function used to build aOrientationHelperwhich is responsible for some core actions about cells and layout.The current built helper for the currentorientationProperty(), seeOrientationHelper.io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<Orientation>Specifies the orientation of the virtual flow.Specifies the currentFlowStatewhich describes the state of the viewport.Specifies the vertical position in the viewport.Properties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltipProperties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.Parent
needsLayoutProperties 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, focusVisible, focusWithin, 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 -
Field Summary
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZEFields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT -
Constructor Summary
ConstructorsConstructorDescriptionVirtualFlow(ObservableList<T> items, Function<T, C> cellFactory) VirtualFlow(ObservableList<T> items, Function<T, C> cellFactory, Orientation orientation) -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the function used to build the cells.protected voidio.github.palexdev.mfxcore.base.properties.styleable.StyleableDoublePropertySpecifies the cells' size:io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoublePropertyUsed by the viewport's clip to set its border radius.protected Skin<?>Specifies the total length of all the cells.io.github.palexdev.mfxcore.base.properties.styleable.StyleableBooleanPropertySpecifies whether cells should be resized to be the same size of the viewport in the opposite direction of the currentorientationProperty().Gets the value of thecellFactoryproperty.doubleGets the value of thecellSizeproperty.static List<CssMetaData<? extends Styleable,?>> doubleGets the value of theclipBorderRadiusproperty.protected List<CssMetaData<? extends Styleable,?>> doubleGets the value of theestimatedLengthproperty.doublegetHPos()Gets the value of thehPosproperty.Delegate method forFlowState.getCells().getItems()Gets the value of theitemsproperty.io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>Gets the value of thelastRangeproperty.doubleGets the value of themaxBreadthproperty.Gets the value of theorientationproperty.Gets the value of theorientationHelperproperty.Gets the value of theorientationHelperFactoryproperty.getState()Gets the value of thestateproperty.protected ViewportManager<T,C> doublegetVPos()Gets the value of thevPosproperty.Specifies the horizontal position in the viewport.booleanGets the value of thefitToBreadthproperty.booleanGets the value of theneedsViewportLayoutproperty.Specifies theObservableListused to store the items.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>>Specifies the last range of displayed items by the viewport as anIntegerRange.Specifies the max breadth among the currently visible cells.Specifies whether the viewport needs to compute the layout of its content.io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<Orientation,OrientationHelper> To allow more customization on how the cells are laid out, the virtual flow allows you to specify a function used to build aOrientationHelperwhich is responsible for some core actions about cells and layout.The current built helper for the currentorientationProperty(), seeOrientationHelper.io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<Orientation>Specifies the orientation of the virtual flow.voidBasically a setter forneedsViewportLayoutProperty().voidscrollBy(double pixels) Tells the currentorientationHelperProperty()to scroll by the given amount of pixels.voidTells the currentorientationHelperProperty()to scroll to the first cell.voidscrollToIndex(int index) Tells the currentorientationHelperProperty()to scroll to the given cell index.voidTells the currentorientationHelperProperty()to scroll to the last cell.voidscrollToPixel(double pixel) Tells the currentorientationHelperProperty()to scroll to the given pixel.voidsetCellFactory(Function<T, C> cellFactory) Sets the value of thecellFactoryproperty.voidsetCellSize(double cellSize) Sets the value of thecellSizeproperty.voidsetClipBorderRadius(double clipBorderRadius) Sets the value of theclipBorderRadiusproperty.voidsetFitToBreadth(boolean fitToBreadth) Sets the value of thefitToBreadthproperty.voidsetHPos(double hPos) Sets the value of thehPosproperty.voidsetItems(ObservableList<T> items) Sets the value of theitemsproperty.protected voidsetNeedsViewportLayout(boolean needsViewportLayout) Sets the value of theneedsViewportLayoutproperty.voidsetOrientation(Orientation orientation) Sets the value of theorientationproperty.protected voidsetOrientationHelper(OrientationHelper orientationHelper) Sets the value of theorientationHelperproperty.voidsetOrientationHelperFactory(Function<Orientation, OrientationHelper> orientationHelperFactory) Sets the value of theorientationHelperFactoryproperty.voidsetVPos(double vPos) Sets the value of thevPosproperty.Specifies the currentFlowStatewhich describes the state of the viewport.Specifies the vertical position in the viewport.Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipPropertyMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, 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, widthPropertyMethods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods 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, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, 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, isFocusVisible, isFocusWithin, 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, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
estimatedLength
Specifies the total length of all the cells. -
maxBreadth
Specifies the max breadth among the currently visible cells.- See Also:
-
state
Specifies the currentFlowStatewhich describes the state of the viewport. This property is useful to listen to any change happening in the viewport.- See Also:
-
lastRange
public ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> lastRangePropertySpecifies the last range of displayed items by the viewport as anIntegerRange.- See Also:
-
fitToBreadth
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableBooleanProperty fitToBreadthPropertySpecifies whether cells should be resized to be the same size of the viewport in the opposite direction of the currentorientationProperty().It is also possible to set this property via CSS with the
"-fx-fit-to-breadth"property. -
cellSize
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty cellSizePropertySpecifies the cells' size:- Orientation.VERTICAL: size -> height
- Orientation.HORIZONTAL: size -> width
It is also possible to set this property via CSS with the
"-fx-cell-size"property. -
orientation
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<Orientation> orientationPropertySpecifies the orientation of the virtual flow.It is also possible to set this property via CSS with the
"-fx-orientation"property. -
clipBorderRadius
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty clipBorderRadiusPropertyUsed by the viewport's clip to set its border radius. This is useful when you want to make a rounded virtual flow, this prevents the content from going outside the view. This is mostly useful if not using the flow withVirtualScrollPane, this is the same asVirtualScrollPane.clipBorderRadiusProperty(). Side note: the clip is aRectangle, now for some fucking reason the rectangle's arcWidth and arcHeight values used to make it round do not act like the border-radius or background-radius properties, instead their value is usually 2 / 2.5 times the latter. So for a border radius of 5 you want this value to be at least 10/13.It is also possible to set this property via CSS with the
"-fx-clip-border-radius"property. -
items
Specifies theObservableListused to store the items.This is an
ObjectPropertyso that it can also be bound to other properties. -
cellFactory
public io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<T,C extends Cell<T>> cellFactoryPropertySpecifies the function used to build the cells. -
vPos
Specifies the vertical position in the viewport.- See Also:
-
hPos
Specifies the horizontal position in the viewport.- See Also:
-
orientationHelper
The current built helper for the currentorientationProperty(), seeOrientationHelper. -
orientationHelperFactory
public io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<Orientation,OrientationHelper> orientationHelperFactoryPropertyTo allow more customization on how the cells are laid out, the virtual flow allows you to specify a function used to build aOrientationHelperwhich is responsible for some core actions about cells and layout. This way you could implement your own helper and set it through this factory since theorientationHelperProperty()is intended to be read-only. -
needsViewportLayout
Specifies whether the viewport needs to compute the layout of its content.Since this is read-only, layout requests must be sent by using
requestViewportLayout().
-
-
Constructor Details
-
VirtualFlow
public VirtualFlow() -
VirtualFlow
-
VirtualFlow
-
-
Method Details
-
requestViewportLayout
public void requestViewportLayout()Basically a setter forneedsViewportLayoutProperty(). This sets the property to true causing the virtual flow skin to catch the change through a listener which then orders the viewport container to re-compute the layout. -
cellSizeChanged
protected void cellSizeChanged() -
scrollBy
public void scrollBy(double pixels) Tells the currentorientationHelperProperty()to scroll by the given amount of pixels.Unsupported by
PaginatedVirtualFlow -
scrollToPixel
public void scrollToPixel(double pixel) Tells the currentorientationHelperProperty()to scroll to the given pixel.Unsupported by
PaginatedVirtualFlow -
scrollToIndex
public void scrollToIndex(int index) Tells the currentorientationHelperProperty()to scroll to the given cell index. -
scrollToFirst
public void scrollToFirst()Tells the currentorientationHelperProperty()to scroll to the first cell. -
scrollToLast
public void scrollToLast()Tells the currentorientationHelperProperty()to scroll to the last cell. -
getEstimatedLength
public double getEstimatedLength()Gets the value of theestimatedLengthproperty.- Property description:
- Specifies the total length of all the cells.
- Returns:
- the value of the
estimatedLengthproperty - See Also:
-
estimatedLengthProperty
Specifies the total length of all the cells.- Returns:
- the
estimatedLengthproperty - See Also:
-
getMaxBreadth
public double getMaxBreadth()Gets the value of themaxBreadthproperty.- Property description:
- Specifies the max breadth among the currently visible cells.
- Returns:
- the value of the
maxBreadthproperty - See Also:
-
maxBreadthProperty
Specifies the max breadth among the currently visible cells.- Returns:
- the
maxBreadthproperty - See Also:
-
getState
Gets the value of thestateproperty.- Property description:
- Specifies the current
FlowStatewhich describes the state of the viewport. This property is useful to listen to any change happening in the viewport. - Returns:
- the value of the
stateproperty - See Also:
-
stateProperty
Specifies the currentFlowStatewhich describes the state of the viewport. This property is useful to listen to any change happening in the viewport.- Returns:
- the
stateproperty - See Also:
-
getLastRange
Gets the value of thelastRangeproperty.- Property description:
- Specifies the last range of displayed items by the viewport as an
IntegerRange. - Returns:
- the value of the
lastRangeproperty - See Also:
-
lastRangeProperty
public ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> lastRangeProperty()Specifies the last range of displayed items by the viewport as anIntegerRange.- Returns:
- the
lastRangeproperty - See Also:
-
getIndexedCells
Delegate method forFlowState.getCells(). -
createDefaultSkin
- Overrides:
createDefaultSkinin classControl
-
getControlCssMetaData
- Overrides:
getControlCssMetaDatain classControl
-
isFitToBreadth
public boolean isFitToBreadth()Gets the value of thefitToBreadthproperty.- Property description:
- Specifies whether cells should be resized to be the same size of the viewport in the opposite
direction of the current
orientationProperty().It is also possible to set this property via CSS with the
"-fx-fit-to-breadth"property. - Returns:
- the value of the
fitToBreadthproperty - See Also:
-
fitToBreadthProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableBooleanProperty fitToBreadthProperty()Specifies whether cells should be resized to be the same size of the viewport in the opposite direction of the currentorientationProperty().It is also possible to set this property via CSS with the
"-fx-fit-to-breadth"property.- Returns:
- the
fitToBreadthproperty - See Also:
-
setFitToBreadth
public void setFitToBreadth(boolean fitToBreadth) Sets the value of thefitToBreadthproperty.- Property description:
- Specifies whether cells should be resized to be the same size of the viewport in the opposite
direction of the current
orientationProperty().It is also possible to set this property via CSS with the
"-fx-fit-to-breadth"property. - Parameters:
fitToBreadth- the value for thefitToBreadthproperty- See Also:
-
getCellSize
public double getCellSize()Gets the value of thecellSizeproperty.- Property description:
- Specifies the cells' size:
- Orientation.VERTICAL: size -> height
- Orientation.HORIZONTAL: size -> width
It is also possible to set this property via CSS with the
"-fx-cell-size"property. - Returns:
- the value of the
cellSizeproperty - See Also:
-
cellSizeProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty cellSizeProperty()Specifies the cells' size:- Orientation.VERTICAL: size -> height
- Orientation.HORIZONTAL: size -> width
It is also possible to set this property via CSS with the
"-fx-cell-size"property.- Returns:
- the
cellSizeproperty - See Also:
-
setCellSize
public void setCellSize(double cellSize) Sets the value of thecellSizeproperty.- Property description:
- Specifies the cells' size:
- Orientation.VERTICAL: size -> height
- Orientation.HORIZONTAL: size -> width
It is also possible to set this property via CSS with the
"-fx-cell-size"property. - Parameters:
cellSize- the value for thecellSizeproperty- See Also:
-
getOrientation
Gets the value of theorientationproperty.- Property description:
- Specifies the orientation of the virtual flow.
It is also possible to set this property via CSS with the
"-fx-orientation"property. - Returns:
- the value of the
orientationproperty - See Also:
-
orientationProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<Orientation> orientationProperty()Specifies the orientation of the virtual flow.It is also possible to set this property via CSS with the
"-fx-orientation"property.- Returns:
- the
orientationproperty - See Also:
-
setOrientation
Sets the value of theorientationproperty.- Property description:
- Specifies the orientation of the virtual flow.
It is also possible to set this property via CSS with the
"-fx-orientation"property. - Parameters:
orientation- the value for theorientationproperty- See Also:
-
getClipBorderRadius
public double getClipBorderRadius()Gets the value of theclipBorderRadiusproperty.- Property description:
- Used by the viewport's clip to set its border radius.
This is useful when you want to make a rounded virtual flow, this
prevents the content from going outside the view.
This is mostly useful if not using the flow with
VirtualScrollPane, this is the same asVirtualScrollPane.clipBorderRadiusProperty(). Side note: the clip is aRectangle, now for some fucking reason the rectangle's arcWidth and arcHeight values used to make it round do not act like the border-radius or background-radius properties, instead their value is usually 2 / 2.5 times the latter. So for a border radius of 5 you want this value to be at least 10/13.It is also possible to set this property via CSS with the
"-fx-clip-border-radius"property. - Returns:
- the value of the
clipBorderRadiusproperty - See Also:
-
clipBorderRadiusProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty clipBorderRadiusProperty()Used by the viewport's clip to set its border radius. This is useful when you want to make a rounded virtual flow, this prevents the content from going outside the view. This is mostly useful if not using the flow withVirtualScrollPane, this is the same asVirtualScrollPane.clipBorderRadiusProperty(). Side note: the clip is aRectangle, now for some fucking reason the rectangle's arcWidth and arcHeight values used to make it round do not act like the border-radius or background-radius properties, instead their value is usually 2 / 2.5 times the latter. So for a border radius of 5 you want this value to be at least 10/13.It is also possible to set this property via CSS with the
"-fx-clip-border-radius"property.- Returns:
- the
clipBorderRadiusproperty - See Also:
-
setClipBorderRadius
public void setClipBorderRadius(double clipBorderRadius) Sets the value of theclipBorderRadiusproperty.- Property description:
- Used by the viewport's clip to set its border radius.
This is useful when you want to make a rounded virtual flow, this
prevents the content from going outside the view.
This is mostly useful if not using the flow with
VirtualScrollPane, this is the same asVirtualScrollPane.clipBorderRadiusProperty(). Side note: the clip is aRectangle, now for some fucking reason the rectangle's arcWidth and arcHeight values used to make it round do not act like the border-radius or background-radius properties, instead their value is usually 2 / 2.5 times the latter. So for a border radius of 5 you want this value to be at least 10/13.It is also possible to set this property via CSS with the
"-fx-clip-border-radius"property. - Parameters:
clipBorderRadius- the value for theclipBorderRadiusproperty- See Also:
-
getClassCssMetaData
-
getViewportManager
-
getItems
Gets the value of theitemsproperty.- Property description:
- Specifies the
ObservableListused to store the items.This is an
ObjectPropertyso that it can also be bound to other properties. - Returns:
- the value of the
itemsproperty - See Also:
-
itemsProperty
Specifies theObservableListused to store the items.This is an
ObjectPropertyso that it can also be bound to other properties.- Returns:
- the
itemsproperty - See Also:
-
setItems
Sets the value of theitemsproperty.- Property description:
- Specifies the
ObservableListused to store the items.This is an
ObjectPropertyso that it can also be bound to other properties. - Parameters:
items- the value for theitemsproperty- See Also:
-
getCellFactory
Gets the value of thecellFactoryproperty.- Property description:
- Specifies the function used to build the cells.
- Returns:
- the value of the
cellFactoryproperty - See Also:
-
cellFactoryProperty
public io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<T,C> cellFactoryProperty()Specifies the function used to build the cells.- Returns:
- the
cellFactoryproperty - See Also:
-
setCellFactory
Sets the value of thecellFactoryproperty.- Property description:
- Specifies the function used to build the cells.
- Parameters:
cellFactory- the value for thecellFactoryproperty- See Also:
-
getVPos
public double getVPos()Gets the value of thevPosproperty.- Property description:
- Specifies the vertical position in the viewport.
- Returns:
- the value of the
vPosproperty - See Also:
-
vPosProperty
Specifies the vertical position in the viewport.- Returns:
- the
vPosproperty - See Also:
-
setVPos
public void setVPos(double vPos) Sets the value of thevPosproperty.- Property description:
- Specifies the vertical position in the viewport.
- Parameters:
vPos- the value for thevPosproperty- See Also:
-
getHPos
public double getHPos()Gets the value of thehPosproperty.- Property description:
- Specifies the horizontal position in the viewport.
- Returns:
- the value of the
hPosproperty - See Also:
-
hPosProperty
Specifies the horizontal position in the viewport.- Returns:
- the
hPosproperty - See Also:
-
setHPos
public void setHPos(double hPos) Sets the value of thehPosproperty.- Property description:
- Specifies the horizontal position in the viewport.
- Parameters:
hPos- the value for thehPosproperty- See Also:
-
getOrientationHelper
Gets the value of theorientationHelperproperty.- Property description:
- The current built helper for the current
orientationProperty(), seeOrientationHelper. - Returns:
- the value of the
orientationHelperproperty - See Also:
-
orientationHelperProperty
The current built helper for the currentorientationProperty(), seeOrientationHelper.- Returns:
- the
orientationHelperproperty - See Also:
-
setOrientationHelper
Sets the value of theorientationHelperproperty.- Property description:
- The current built helper for the current
orientationProperty(), seeOrientationHelper. - Parameters:
orientationHelper- the value for theorientationHelperproperty- See Also:
-
getOrientationHelperFactory
Gets the value of theorientationHelperFactoryproperty.- Property description:
- To allow more customization on how the cells are laid out, the virtual flow allows you
to specify a function used to build a
OrientationHelperwhich is responsible for some core actions about cells and layout. This way you could implement your own helper and set it through this factory since theorientationHelperProperty()is intended to be read-only. - Returns:
- the value of the
orientationHelperFactoryproperty - See Also:
-
orientationHelperFactoryProperty
public io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<Orientation,OrientationHelper> orientationHelperFactoryProperty()To allow more customization on how the cells are laid out, the virtual flow allows you to specify a function used to build aOrientationHelperwhich is responsible for some core actions about cells and layout. This way you could implement your own helper and set it through this factory since theorientationHelperProperty()is intended to be read-only.- Returns:
- the
orientationHelperFactoryproperty - See Also:
-
setOrientationHelperFactory
public void setOrientationHelperFactory(Function<Orientation, OrientationHelper> orientationHelperFactory) Sets the value of theorientationHelperFactoryproperty.- Property description:
- To allow more customization on how the cells are laid out, the virtual flow allows you
to specify a function used to build a
OrientationHelperwhich is responsible for some core actions about cells and layout. This way you could implement your own helper and set it through this factory since theorientationHelperProperty()is intended to be read-only. - Parameters:
orientationHelperFactory- the value for theorientationHelperFactoryproperty- See Also:
-
isNeedsViewportLayout
public boolean isNeedsViewportLayout()Gets the value of theneedsViewportLayoutproperty.- Property description:
- Specifies whether the viewport needs to compute the layout of its content.
Since this is read-only, layout requests must be sent by using
requestViewportLayout(). - Returns:
- the value of the
needsViewportLayoutproperty - See Also:
-
needsViewportLayoutProperty
Specifies whether the viewport needs to compute the layout of its content.Since this is read-only, layout requests must be sent by using
requestViewportLayout().- Returns:
- the
needsViewportLayoutproperty - See Also:
-
setNeedsViewportLayout
protected void setNeedsViewportLayout(boolean needsViewportLayout) Sets the value of theneedsViewportLayoutproperty.- Property description:
- Specifies whether the viewport needs to compute the layout of its content.
Since this is read-only, layout requests must be sent by using
requestViewportLayout(). - Parameters:
needsViewportLayout- the value for theneedsViewportLayoutproperty- See Also:
-