Class VirtualFlow<T,C extends Cell<T>>
- Type Parameters:
T
- the type of objects to representC
- the type ofCell
to 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.StyleableDoubleProperty
Specifies the cells' size:io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Used 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.StyleableBooleanProperty
Specifies 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 theObservableList
used 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 aOrientationHelper
which 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 currentFlowState
which describes the state of the viewport.Specifies the vertical position in the viewport.Properties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltip
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, 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_SIZE
Fields 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 void
io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Specifies the cells' size:io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Used 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.StyleableBooleanProperty
Specifies whether cells should be resized to be the same size of the viewport in the opposite direction of the currentorientationProperty()
.Gets the value of thecellFactory
property.double
Gets the value of thecellSize
property.static List<CssMetaData<? extends Styleable,
?>> double
Gets the value of theclipBorderRadius
property.protected List<CssMetaData<? extends Styleable,
?>> double
Gets the value of theestimatedLength
property.double
getHPos()
Gets the value of thehPos
property.Delegate method forFlowState.getCells()
.getItems()
Gets the value of theitems
property.io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>
Gets the value of thelastRange
property.double
Gets the value of themaxBreadth
property.Gets the value of theorientation
property.Gets the value of theorientationHelper
property.Gets the value of theorientationHelperFactory
property.getState()
Gets the value of thestate
property.protected ViewportManager<T,
C> double
getVPos()
Gets the value of thevPos
property.Specifies the horizontal position in the viewport.boolean
Gets the value of thefitToBreadth
property.boolean
Gets the value of theneedsViewportLayout
property.Specifies theObservableList
used 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 aOrientationHelper
which 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.void
Basically a setter forneedsViewportLayoutProperty()
.void
scrollBy
(double pixels) Tells the currentorientationHelperProperty()
to scroll by the given amount of pixels.void
Tells the currentorientationHelperProperty()
to scroll to the first cell.void
scrollToIndex
(int index) Tells the currentorientationHelperProperty()
to scroll to the given cell index.void
Tells the currentorientationHelperProperty()
to scroll to the last cell.void
scrollToPixel
(double pixel) Tells the currentorientationHelperProperty()
to scroll to the given pixel.void
setCellFactory
(Function<T, C> cellFactory) Sets the value of thecellFactory
property.void
setCellSize
(double cellSize) Sets the value of thecellSize
property.void
setClipBorderRadius
(double clipBorderRadius) Sets the value of theclipBorderRadius
property.void
setFitToBreadth
(boolean fitToBreadth) Sets the value of thefitToBreadth
property.void
setHPos
(double hPos) Sets the value of thehPos
property.void
setItems
(ObservableList<T> items) Sets the value of theitems
property.protected void
setNeedsViewportLayout
(boolean needsViewportLayout) Sets the value of theneedsViewportLayout
property.void
setOrientation
(Orientation orientation) Sets the value of theorientation
property.protected void
setOrientationHelper
(OrientationHelper orientationHelper) Sets the value of theorientationHelper
property.void
setOrientationHelperFactory
(Function<Orientation, OrientationHelper> orientationHelperFactory) Sets the value of theorientationHelperFactory
property.void
setVPos
(double vPos) Sets the value of thevPos
property.Specifies the currentFlowState
which 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, tooltipProperty
Methods 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, widthProperty
Methods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, 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, 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, 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
-
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 currentFlowState
which 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 theObservableList
used to store the items.This is an
ObjectProperty
so 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 aOrientationHelper
which 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 theestimatedLength
property.- Property description:
- Specifies the total length of all the cells.
- Returns:
- the value of the
estimatedLength
property - See Also:
-
estimatedLengthProperty
Specifies the total length of all the cells.- Returns:
- the
estimatedLength
property - See Also:
-
getMaxBreadth
public double getMaxBreadth()Gets the value of themaxBreadth
property.- Property description:
- Specifies the max breadth among the currently visible cells.
- Returns:
- the value of the
maxBreadth
property - See Also:
-
maxBreadthProperty
Specifies the max breadth among the currently visible cells.- Returns:
- the
maxBreadth
property - See Also:
-
getState
Gets the value of thestate
property.- Property description:
- Specifies the current
FlowState
which describes the state of the viewport. This property is useful to listen to any change happening in the viewport. - Returns:
- the value of the
state
property - See Also:
-
stateProperty
Specifies the currentFlowState
which describes the state of the viewport. This property is useful to listen to any change happening in the viewport.- Returns:
- the
state
property - See Also:
-
getLastRange
Gets the value of thelastRange
property.- Property description:
- Specifies the last range of displayed items by the viewport as an
IntegerRange
. - Returns:
- the value of the
lastRange
property - 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
lastRange
property - See Also:
-
getIndexedCells
Delegate method forFlowState.getCells()
. -
createDefaultSkin
- Overrides:
createDefaultSkin
in classControl
-
getControlCssMetaData
- Overrides:
getControlCssMetaData
in classControl
-
isFitToBreadth
public boolean isFitToBreadth()Gets the value of thefitToBreadth
property.- 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
fitToBreadth
property - 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
fitToBreadth
property - See Also:
-
setFitToBreadth
public void setFitToBreadth(boolean fitToBreadth) Sets the value of thefitToBreadth
property.- 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 thefitToBreadth
property- See Also:
-
getCellSize
public double getCellSize()Gets the value of thecellSize
property.- 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
cellSize
property - 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
cellSize
property - See Also:
-
setCellSize
public void setCellSize(double cellSize) Sets the value of thecellSize
property.- 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 thecellSize
property- See Also:
-
getOrientation
Gets the value of theorientation
property.- 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
orientation
property - 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
orientation
property - See Also:
-
setOrientation
Sets the value of theorientation
property.- 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 theorientation
property- See Also:
-
getClipBorderRadius
public double getClipBorderRadius()Gets the value of theclipBorderRadius
property.- 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
clipBorderRadius
property - 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
clipBorderRadius
property - See Also:
-
setClipBorderRadius
public void setClipBorderRadius(double clipBorderRadius) Sets the value of theclipBorderRadius
property.- 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 theclipBorderRadius
property- See Also:
-
getClassCssMetaData
-
getViewportManager
-
getItems
Gets the value of theitems
property.- Property description:
- Specifies the
ObservableList
used to store the items.This is an
ObjectProperty
so that it can also be bound to other properties. - Returns:
- the value of the
items
property - See Also:
-
itemsProperty
Specifies theObservableList
used to store the items.This is an
ObjectProperty
so that it can also be bound to other properties.- Returns:
- the
items
property - See Also:
-
setItems
Sets the value of theitems
property.- Property description:
- Specifies the
ObservableList
used to store the items.This is an
ObjectProperty
so that it can also be bound to other properties. - Parameters:
items
- the value for theitems
property- See Also:
-
getCellFactory
Gets the value of thecellFactory
property.- Property description:
- Specifies the function used to build the cells.
- Returns:
- the value of the
cellFactory
property - 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
cellFactory
property - See Also:
-
setCellFactory
Sets the value of thecellFactory
property.- Property description:
- Specifies the function used to build the cells.
- Parameters:
cellFactory
- the value for thecellFactory
property- See Also:
-
getVPos
public double getVPos()Gets the value of thevPos
property.- Property description:
- Specifies the vertical position in the viewport.
- Returns:
- the value of the
vPos
property - See Also:
-
vPosProperty
Specifies the vertical position in the viewport.- Returns:
- the
vPos
property - See Also:
-
setVPos
public void setVPos(double vPos) Sets the value of thevPos
property.- Property description:
- Specifies the vertical position in the viewport.
- Parameters:
vPos
- the value for thevPos
property- See Also:
-
getHPos
public double getHPos()Gets the value of thehPos
property.- Property description:
- Specifies the horizontal position in the viewport.
- Returns:
- the value of the
hPos
property - See Also:
-
hPosProperty
Specifies the horizontal position in the viewport.- Returns:
- the
hPos
property - See Also:
-
setHPos
public void setHPos(double hPos) Sets the value of thehPos
property.- Property description:
- Specifies the horizontal position in the viewport.
- Parameters:
hPos
- the value for thehPos
property- See Also:
-
getOrientationHelper
Gets the value of theorientationHelper
property.- Property description:
- The current built helper for the current
orientationProperty()
, seeOrientationHelper
. - Returns:
- the value of the
orientationHelper
property - See Also:
-
orientationHelperProperty
The current built helper for the currentorientationProperty()
, seeOrientationHelper
.- Returns:
- the
orientationHelper
property - See Also:
-
setOrientationHelper
Sets the value of theorientationHelper
property.- Property description:
- The current built helper for the current
orientationProperty()
, seeOrientationHelper
. - Parameters:
orientationHelper
- the value for theorientationHelper
property- See Also:
-
getOrientationHelperFactory
Gets the value of theorientationHelperFactory
property.- 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
OrientationHelper
which 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
orientationHelperFactory
property - 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 aOrientationHelper
which 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
orientationHelperFactory
property - See Also:
-
setOrientationHelperFactory
public void setOrientationHelperFactory(Function<Orientation, OrientationHelper> orientationHelperFactory) Sets the value of theorientationHelperFactory
property.- 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
OrientationHelper
which 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 theorientationHelperFactory
property- See Also:
-
isNeedsViewportLayout
public boolean isNeedsViewportLayout()Gets the value of theneedsViewportLayout
property.- 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
needsViewportLayout
property - 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
needsViewportLayout
property - See Also:
-
setNeedsViewportLayout
protected void setNeedsViewportLayout(boolean needsViewportLayout) Sets the value of theneedsViewportLayout
property.- 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 theneedsViewportLayout
property- See Also:
-