Class VFXGrid<T,C extends VFXCell<T>>
- Type Parameters:
T
- the type of items in the gridC
- the type of cells used by the container to visualize the items
- All Implemented Interfaces:
io.github.palexdev.mfxcore.behavior.WithBehavior<VFXGridManager<T,
,C>> VFXContainer<T>
,VFXScrollable
,VFXStyleable
,WithCellFactory<T,
,C> javafx.css.Styleable
,javafx.event.EventTarget
,javafx.scene.control.Skinnable
Extends Control
, implements VFXContainer
, has its own skin implementation VFXGridSkin
and behavior VFXGridManager
. Uses cells of type VFXCell
.
This is a stateful component, meaning that every meaningful variable (position, size, cell size, etc.) will produce a new
VFXGridState
when changing. The state determines how and which items are displayed in the container.
- First and foremost, it's important to describe how the grid works and why it's made as it is. The grid arranges
the contents of a simple 1D data structure (a list) in a 2D way. (History time) The previous implementation used a 2D data structure
instead which indeed made some algorithms easier to implement, but made its usage very inconvenient for one simple reason:
the data structure was not flexible enough. To add a row/column, they needed to have the same size of the data structure,
so in practice, if you had, for example, a half-full row/column to add, you had to fill it with null
elements.
The same issue occurred for the data structure creation, the source list/array had to be exactly the size given by
'nRows * nColumns'. (End of history time) So the question is, if we now use a simple 1D structure now
(which is more flexible and easier to use for the end-user), how can the grid arrange the contents in a 2D way? Well,
the answer is pretty straightforward; we need a value that the big dumb-dumb me of the past didn't think about:
the columnsNumProperty()
. Given the desired number of columns, we can easily get the number of rows as follows:
Math.ceil(nItems / nColumns)
. However, note that for performance reason, the property acts as a 'maximum number of columns',
which means that the actual number of columns in the viewport depends on these other factors: the container width,
the cell size, the horizontal spacing and the buffer size.
- The default behavior implementation, VFXGridManager
, can be considered as the name suggests more like
a 'manager' than an actual behavior. It is responsible for reacting to core changes in the functionalities defined here
to produce a new state.
The state can be considered like a 'picture' of the container at a certain time. Each combination of the variables
that influence the way items are shown (how many, start, end, changes in the list, etc.) will produce a specific state.
This is an important concept as some of the features I'm going to mention below are due to the combination of default
skin + default behavior. You are allowed to change/customize the skin and behavior as you please. BUT, beware, VFX
components are no joke, they are complex, make sure to read the documentation before!
- The alignmentProperty()
is a unique feature of the grid that allows to set the position of the viewport,
more information can be found in the skin, VFXGridSkin
.
- The items list is managed automatically (permutations, insertions, removals, updates). Compared to previous
algorithms, the VFXGridManager
adopts a much simpler strategy while still trying to keep the cell updates count
as low as possible to improve performance. See VFXGridManager.onItemsChanged()
.
- The function used to generate the cells, called "cellFactory", can be changed anytime, even at runtime, see
VFXGridManager.onCellFactoryChanged()
.
- The core aspect for virtualization is to have a fixed cell size for all cells, this parameter can be controlled through
the cellSizeProperty()
, and can also be changed anytime, see VFXGridManager.onCellSizeChanged()
.
- Similar to the JavaFX's GridPane
, this container allows you to evenly space the cells in the viewport by
setting the properties hSpacingProperty()
and vSpacingProperty()
. See VFXGridManager.onSpacingChanged()
.
- Even though the grid doesn't have the orientation property (compared to the VFXList), core computations such as
the range of rows, the range of columns, the estimated size, the layout of nodes etc., are delegated to separate 'helper'
class which is the VFXGridHelper
. You are allowed to change the helper through the helperFactoryProperty()
.
- The vertical and horizontal positions are available through the properties hPosProperty()
and vPosProperty()
.
It could indeed be possible to use a single property for the position, but they are split for performance reasons.
- The virtual bounds of the container are given by two properties:
a) the virtualMaxXProperty()
which specifies the total number of pixels on the x-axis
b) the virtualMaxYProperty()
which specifies the total number of pixels on the y-axis
- You can access the current state through the stateProperty()
. The state gives crucial information about
the container such as the rows range, the columns range and the visible cells (by index and by item). If you'd like to observe
for changes in the displayed items, then you want to add a listener on this property. Make sure to also read the
VFXGridState
documentation, as it also contains important information on the grid's mechanics.
- It is possible to force the viewport to update the layout by invoking requestViewportLayout()
,
although this should never be necessary as it is automatically handled by "system".
- Additionally, this container makes use of a simple cache implementation, VFXCellsCache
, which
avoids creating new cells when needed if some are already present in it. The most crucial aspect for this kind of
virtualization is to avoid creating nodes, as this is the most expensive operation. Not only nodes need
to be created but also added to the container and then laid out.
Instead, it's much more likely that the VFXCell.updateItem(Object)
will be simple and thus faster.
Note 1: to make the cache more generic, thus allowing its usage in more cases, a recent refactor,
removed the dependency on the container itself and replaced it with the cell factory. Since the cache can also populate
itself with "empty" cells, it must know how to create them. The cache's cell factory is automatically synchronized with
the container's one.
Note 2: by default, the capacity is set to 10 cells. However, for the grid's nature, such number is likely to be
too small, but it also depends from case to case. You can play around with the values and see if there's any benefit to performance.
-
Property Summary
PropertiesTypePropertyDescriptionio.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty
<javafx.geometry.Pos> Specifies the position of the viewport node inside the grid as aPos
object.io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty
<BufferSize> Specifies the number of extra cells to add to the container; they act as a buffer, allowing scroll to be smoother.io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty
Specifies the maximum number of cells the cache can contain at any time.io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty
Specifies the cells' width and height as aSize
object.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Used by the viewport's clip to set its border radius.io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty
Specifies the maximum number of columns the grid can have.io.github.palexdev.mfxcore.base.properties.functional.SupplierProperty
<VFXGridHelper<T, C>> Specifies the function used to build aVFXGridHelper
instance.javafx.beans.property.ReadOnlyObjectProperty
<VFXGridHelper<T, C>> Specifies the instance of theVFXGridHelper
built by thehelperFactoryProperty()
.javafx.beans.property.DoubleProperty
Specifies the container's horizontal position.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Specifies the horizontal number of pixels between each cell.javafx.beans.property.ListProperty
<T> Specifies theObservableList
used to store the items.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXGridHelper.maxHScrollProperty()
.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXGridHelper.maxVScrollProperty()
.javafx.beans.property.ReadOnlyBooleanProperty
Specifies whether the viewport needs to compute the layout of its content.javafx.beans.property.ReadOnlyObjectProperty
<VFXGridState<T, C>> Specifies the container's current state.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXGridHelper.virtualMaxXProperty()
.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXGridHelper.virtualMaxYProperty()
.javafx.beans.property.DoubleProperty
Specifies the container's vertical position.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Specifies the vertical number of pixels between each cell.Properties inherited from class io.github.palexdev.mfxcore.controls.Control
behaviorProvider
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
Properties inherited from interface io.github.palexdev.virtualizedfx.base.VFXContainer
empty, size
-
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
Fields inherited from interface io.github.palexdev.virtualizedfx.base.VFXScrollable
TRACK_MULTIPLIER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty
<javafx.geometry.Pos> Specifies the position of the viewport node inside the grid as aPos
object.void
CallsautoArrange(int)
with 0 as parameter.void
autoArrange
(int min) This method will compute the maximum number of columns that can fit in the grid.io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty
<BufferSize> Specifies the number of extra cells to add to the container; they act as a buffer, allowing scroll to be smoother.protected io.github.palexdev.mfxcore.controls.SkinBase
<?, ?> io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty
Specifies the maximum number of cells the cache can contain at any time.int
Delegate forVFXCellsCache.size()
.io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty
Specifies the cells' width and height as aSize
object.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Used by the viewport's clip to set its border radius.io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty
Specifies the maximum number of columns the grid can have.protected VFXCellsCache
<T, C> Responsible for creating the cache instance used by this container.protected Supplier
<VFXGridHelper<T, C>> javafx.geometry.Pos
Gets the value of thealignment
property.protected VFXCellsCache
<T, C> getCache()
int
Gets the value of thecacheCapacity
property.Specifies the wrapper classCellFactory
for the cell factory functionDelegate forVFXGridState.getCellsByIndexUnmodifiable()
Delegate forVFXGridState.getCellsByItemUnmodifiable()
io.github.palexdev.mfxcore.base.beans.Size
Gets the value of thecellSize
property.static List
<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> double
Gets the value of theclipBorderRadius
property.int
Gets the value of thecolumnsNum
property.io.github.palexdev.mfxcore.base.beans.range.IntegerRange
Delegate forVFXGridState.getColumnsRange()
protected List
<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> Gets the value of thehelper
property.Gets the value of thehelperFactory
property.double
Gets the value of thehSpacing
property.io.github.palexdev.mfxcore.base.beans.range.IntegerRange
Delegate forVFXGridState.getRowsRange()
getState()
Gets the value of thestate
property.double
Gets the value of thevSpacing
property.io.github.palexdev.mfxcore.base.properties.functional.SupplierProperty
<VFXGridHelper<T, C>> Specifies the function used to build aVFXGridHelper
instance.javafx.beans.property.ReadOnlyObjectProperty
<VFXGridHelper<T, C>> Specifies the instance of theVFXGridHelper
built by thehelperFactoryProperty()
.javafx.beans.property.DoubleProperty
Specifies the container's horizontal position.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Specifies the horizontal number of pixels between each cell.boolean
Gets the value of theneedsViewportLayout
property.javafx.beans.property.ListProperty
<T> Specifies theObservableList
used to store the items.Wraps this in aVFXScrollPane
to enable scrolling.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXGridHelper.maxHScrollProperty()
.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXGridHelper.maxVScrollProperty()
.javafx.beans.property.ReadOnlyBooleanProperty
Specifies whether the viewport needs to compute the layout of its content.Delegate forVFXCellsCache.populate()
.void
Setter for theneedsViewportLayoutProperty()
.void
scrollToColumn
(int column) Delegate forVFXGridHelper.scrollToColumn(int)
.void
Delegate forVFXGridHelper.scrollToColumn(int)
, with parameter 0.void
Delegate forVFXGridHelper.scrollToRow(int)
, with parameter 0.void
Delegate forVFXGridHelper.scrollToColumn(int)
, with parameterInteger.MAX_VALUE
.void
Delegate forVFXGridHelper.scrollToRow(int)
, with parameterInteger.MAX_VALUE
.void
scrollToRow
(int row) Delegate forVFXGridHelper.scrollToRow(int)
.void
setAlignment
(javafx.geometry.Pos alignment) Sets the value of thealignment
property.void
setCacheCapacity
(int cacheCapacity) Sets the value of thecacheCapacity
property.void
setCellSize
(double size) void
setCellSize
(double w, double h) void
setCellSize
(io.github.palexdev.mfxcore.base.beans.Size cellSize) Sets the value of thecellSize
property.void
setClipBorderRadius
(double clipBorderRadius) Sets the value of theclipBorderRadius
property.void
setColumnsNum
(int columnsNum) Sets the value of thecolumnsNum
property.protected void
setHelper
(VFXGridHelper<T, C> helper) Sets the value of thehelper
property.void
setHelperFactory
(Supplier<VFXGridHelper<T, C>> helperFactory) Sets the value of thehelperFactory
property.void
setHSpacing
(double spacing) Sets the value of thehSpacing
property.protected void
setNeedsViewportLayout
(boolean needsViewportLayout) Sets the value of theneedsViewportLayout
property.void
setSpacing
(double spacing) Convenience method to set both vertical and horizontal spacing to the given value.void
setSpacing
(double hSpacing, double vSpacing) Convenience method to set both vertical and horizontal spacing to the given values.protected void
setState
(VFXGridState<T, C> state) Sets the value of thestate
property.void
setVSpacing
(double spacing) Sets the value of thevSpacing
property.javafx.beans.property.ReadOnlyObjectProperty
<VFXGridState<T, C>> Specifies the container's current state.void
update
(int... indexes) This method should be used by implementations to "manually" update the container.protected void
update
(VFXGridState<T, C> state) Setter for thestateProperty()
.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXGridHelper.virtualMaxXProperty()
.javafx.beans.property.ReadOnlyDoubleProperty
Delegate forVFXGridHelper.virtualMaxYProperty()
.javafx.beans.property.DoubleProperty
Specifies the container's vertical position.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Specifies the vertical number of pixels between each cell.Methods inherited from class io.github.palexdev.mfxcore.controls.Control
behaviorProviderProperty, changeSkin, createDefaultSkin, getBehavior, getBehaviorProvider, sceneBuilderIntegration, setBehaviorProvider
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
Methods inherited from interface io.github.palexdev.virtualizedfx.base.VFXContainer
emptyProperty, getBufferSize, getHPos, getItems, getMaxHScroll, getMaxVScroll, getVirtualMaxX, getVirtualMaxY, getVPos, isEmpty, setBufferSize, setHPos, setItems, setVPos, size, sizeProperty
Methods inherited from interface io.github.palexdev.mfxcore.behavior.WithBehavior
setDefaultBehaviorProvider
Methods inherited from interface io.github.palexdev.virtualizedfx.base.WithCellFactory
create, setCellFactory
-
Property Details
-
virtualMaxX
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXPropertyDelegate forVFXGridHelper.virtualMaxXProperty()
.- Specified by:
virtualMaxXProperty
in interfaceVFXContainer<T>
- Returns:
- the
virtualMaxX
property - See Also:
-
virtualMaxY
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYPropertyDelegate forVFXGridHelper.virtualMaxYProperty()
.- Specified by:
virtualMaxYProperty
in interfaceVFXContainer<T>
- Returns:
- the
virtualMaxY
property - See Also:
-
maxVScroll
public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollPropertyDelegate forVFXGridHelper.maxVScrollProperty()
.- Specified by:
maxVScrollProperty
in interfaceVFXContainer<T>
- Returns:
- the
maxVScroll
property - See Also:
-
maxHScroll
public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollPropertyDelegate forVFXGridHelper.maxHScrollProperty()
.- Specified by:
maxHScrollProperty
in interfaceVFXContainer<T>
- Returns:
- the
maxHScroll
property - See Also:
-
cellSize
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty cellSizePropertySpecifies the cells' width and height as aSize
object.Can be set in CSS via the property: '-vfx-cell-size'.
Note that this is a special styleable property, in order to set it in CSS see the docs here
StyleableSizeProperty.SizeConverter
.- See Also:
-
columnsNum
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty columnsNumPropertySpecifies the maximum number of columns the grid can have. This number is crucial to also compute the nuber of rows. By default, the latter is computed as follows:Math.ceil(nItems / nColumns)
.Can be set in CSS via the property: '-vfx-columns-num'.
- See Also:
-
alignment
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<javafx.geometry.Pos> alignmentPropertySpecifies the position of the viewport node inside the grid as aPos
object. Note that 'baseline' positions are not supported and will default toPos.TOP_LEFT
instead.Can be set in CSS via the property: '-vfx-alignment'.
- See Also:
-
hSpacing
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty hSpacingPropertySpecifies the horizontal number of pixels between each cell.Can be set in CSS via the property: '-vfx-h-spacing'.
- See Also:
-
vSpacing
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty vSpacingPropertySpecifies the vertical number of pixels between each cell.Can be set in CSS via the property: '-vfx-v-spacing'.
- See Also:
-
bufferSize
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<BufferSize> bufferSizePropertySpecifies the number of extra cells to add to the container; they act as a buffer, allowing scroll to be smoother. To avoid edge cases due to the users abusing the system, this is done by using an enumerator which allows up to three buffer cells. To be more precise, for the grid this determines the number of extra rows and columns to add in the viewport. Since this is a "2D" container, by its nature, a considerable amount of cells is displayed (but it also depends on other factors such as the container's size, the cells size, etc.). The buffer increases such number, so if you have performance issues you may try to lower the buffer value, although I would consider it as a last resort.Can be set in CSS via the property: '-vfx-buffer-size'.
- Specified by:
bufferSizeProperty
in interfaceVFXContainer<T>
- Returns:
- the
bufferSize
property - See Also:
-
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 container, this prevents the content from going outside the view. 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.Can be set in CSS via the property: '-vfx-clip-border-radius'.
- See Also:
-
cacheCapacity
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty cacheCapacityPropertySpecifies the maximum number of cells the cache can contain at any time. Excess will not be added to the queue and disposed immediately.Can be set in CSS via the property: '-vfx-cache-capacity'.
- See Also:
-
items
Specifies theObservableList
used to store the items.We use a
Also, despite the grid being a 2D container, we still use a 1D collection because it's much more easy and convenient to use. Knowing the number of columns we want to divide the items by, it's enough to make the list act as a 2D collection.ListProperty
because it offers many commodities such as both the size and emptiness of the list as observable properties, as well as the possibility of adding anInvalidationListener
that will both inform about changes of the property and in the list.- Specified by:
itemsProperty
in interfaceVFXContainer<T>
- Returns:
- the
items
property - See Also:
-
helper
public javafx.beans.property.ReadOnlyObjectProperty<VFXGridHelper<T,C extends VFXCell<T>>> helperPropertySpecifies the instance of theVFXGridHelper
built by thehelperFactoryProperty()
.- See Also:
-
helperFactory
public io.github.palexdev.mfxcore.base.properties.functional.SupplierProperty<VFXGridHelper<T,C extends VFXCell<T>>> helperFactoryPropertySpecifies the function used to build aVFXGridHelper
instance.- See Also:
-
vPos
public javafx.beans.property.DoubleProperty vPosProperty- Specified by:
vPosProperty
in interfaceVFXContainer<T>
- Returns:
- the
vPos
property - See Also:
-
hPos
public javafx.beans.property.DoubleProperty hPosProperty- Specified by:
hPosProperty
in interfaceVFXContainer<T>
- Returns:
- the
hPos
property - See Also:
-
state
public javafx.beans.property.ReadOnlyObjectProperty<VFXGridState<T,C extends VFXCell<T>>> statePropertySpecifies the container's current state. The state carries useful information such as the range of rows and columns and the cells ordered by index, or by item (not ordered).- See Also:
-
needsViewportLayout
public javafx.beans.property.ReadOnlyBooleanProperty needsViewportLayoutPropertySpecifies whether the viewport needs to compute the layout of its content.Since this is read-only, layout requests must be sent by using
requestViewportLayout()
.- See Also:
-
-
Constructor Details
-
VFXGrid
public VFXGrid() -
VFXGrid
-
-
Method Details
-
autoArrange
public void autoArrange()CallsautoArrange(int)
with 0 as parameter. -
autoArrange
public void autoArrange(int min) This method will compute the maximum number of columns that can fit in the grid. The computation depends on the following values: the container's width, the cell width, and the horizontal spacing. The expression is the following:Math.max(Math.max(0, min), Math.floor(getWidth() / (cellWidth + hSpacing)))
.One good example of this would be a grid that automatically adapts to the size of its parent or window. In combination with the
alignmentProperty()
this can reveal to be very powerful.Needless to say, the computed number is automatically set as the
columnsNumProperty()
.- Parameters:
min
- the minimum number of columns
-
createCache
Responsible for creating the cache instance used by this container.- See Also:
-
update
Setter for thestateProperty()
. -
defaultHelperFactory
- Returns:
- the default function used to build a
VFXGridHelper
.
-
requestViewportLayout
public void requestViewportLayout()Setter for theneedsViewportLayoutProperty()
. This sets the property to true, causing the default skin to recompute the cells' layout. -
update
public void update(int... indexes) Description copied from interface:VFXContainer
This method should be used by implementations to "manually" update the container.This can be useful when working with models that do not use JavaFX properties.
Note: the
indexes
var-arg parameter can be used to specify which cells need to be updated. An empty array should update all of them.More details: some cells may use an update mechanism which relies on property invalidation. Follow this example to better understand what I mean:
// Let's say I have a User class with 'firstName' and 'lastName' fields (we also have both getters and setters) // Now, let's assume I have a UserCell class used by the VFXContainer to display User objects (in a label for example) // This is a part of its implementation... public class UserCell extends Label implements VFXCell<User> { private final ObjectProperty<User> item = new SimpleObjectProperty<>() { @Overridden protected void invalidated() { update(); } }; protected void update() { // This will update the cell's text based on the current item } } // Remember, the 'invalidated()' method is called only when the reference changes, because internally it does not // check for equality but for identity // Now let's say I want to change a User's 'lastName' field like this... container.getItems().get(i).setLastName("NewLastName"); // Question: how can we tell the cell to force the update? // There are two possible ways... // 1) For the invalidation to occur, we first set the item property to 'null', and then back to the old value // 2) We use an event-based mechanism to tell cells to force update themselves. This solution requires cells to // subscribe to such events to support "manual" updates // Solution 2 is more flexible, see VFXContainerEvent class
- Specified by:
update
in interfaceVFXContainer<T>
- See Also:
-
defaultStyleClasses
- Specified by:
defaultStyleClasses
in interfaceVFXStyleable
- Returns:
- a list containing all the component's default style classes
-
buildSkin
protected io.github.palexdev.mfxcore.controls.SkinBase<?,?> buildSkin()- Specified by:
buildSkin
in classio.github.palexdev.mfxcore.controls.Control<VFXGridManager<T,
C extends VFXCell<T>>>
-
defaultBehaviorProvider
- Specified by:
defaultBehaviorProvider
in interfaceio.github.palexdev.mfxcore.behavior.WithBehavior<T>
-
makeScrollable
Description copied from interface:VFXScrollable
Wraps this in aVFXScrollPane
to enable scrolling.- Specified by:
makeScrollable
in interfaceVFXScrollable
-
populateCache
Delegate forVFXCellsCache.populate()
. -
getRowsRange
public io.github.palexdev.mfxcore.base.beans.range.IntegerRange getRowsRange()Delegate forVFXGridState.getRowsRange()
-
getColumnsRange
public io.github.palexdev.mfxcore.base.beans.range.IntegerRange getColumnsRange()Delegate forVFXGridState.getColumnsRange()
-
getCellsByIndexUnmodifiable
Delegate forVFXGridState.getCellsByIndexUnmodifiable()
-
getCellsByItemUnmodifiable
Delegate forVFXGridState.getCellsByItemUnmodifiable()
-
virtualMaxXProperty
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXProperty()Delegate forVFXGridHelper.virtualMaxXProperty()
.- Specified by:
virtualMaxXProperty
in interfaceVFXContainer<T>
- Returns:
- the
virtualMaxX
property - See Also:
-
virtualMaxYProperty
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYProperty()Delegate forVFXGridHelper.virtualMaxYProperty()
.- Specified by:
virtualMaxYProperty
in interfaceVFXContainer<T>
- Returns:
- the
virtualMaxY
property - See Also:
-
maxVScrollProperty
public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollProperty()Delegate forVFXGridHelper.maxVScrollProperty()
.- Specified by:
maxVScrollProperty
in interfaceVFXContainer<T>
- Returns:
- the
maxVScroll
property - See Also:
-
maxHScrollProperty
public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollProperty()Delegate forVFXGridHelper.maxHScrollProperty()
.- Specified by:
maxHScrollProperty
in interfaceVFXContainer<T>
- Returns:
- the
maxHScroll
property - See Also:
-
scrollToRow
public void scrollToRow(int row) Delegate forVFXGridHelper.scrollToRow(int)
. -
scrollToColumn
public void scrollToColumn(int column) Delegate forVFXGridHelper.scrollToColumn(int)
. -
scrollToFirstRow
public void scrollToFirstRow()Delegate forVFXGridHelper.scrollToRow(int)
, with parameter 0. -
scrollToLastRow
public void scrollToLastRow()Delegate forVFXGridHelper.scrollToRow(int)
, with parameterInteger.MAX_VALUE
. -
scrollToFirstColumn
public void scrollToFirstColumn()Delegate forVFXGridHelper.scrollToColumn(int)
, with parameter 0. -
scrollToLastColumn
public void scrollToLastColumn()Delegate forVFXGridHelper.scrollToColumn(int)
, with parameterInteger.MAX_VALUE
. -
getCellSize
public io.github.palexdev.mfxcore.base.beans.Size getCellSize()Gets the value of thecellSize
property.- Property description:
- Specifies the cells' width and height as a
Size
object.Can be set in CSS via the property: '-vfx-cell-size'.
Note that this is a special styleable property, in order to set it in CSS see the docs here
StyleableSizeProperty.SizeConverter
. - Returns:
- the value of the
cellSize
property - See Also:
-
cellSizeProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty cellSizeProperty()Specifies the cells' width and height as aSize
object.Can be set in CSS via the property: '-vfx-cell-size'.
Note that this is a special styleable property, in order to set it in CSS see the docs here
StyleableSizeProperty.SizeConverter
.- Returns:
- the
cellSize
property - See Also:
-
setCellSize
public void setCellSize(io.github.palexdev.mfxcore.base.beans.Size cellSize) Sets the value of thecellSize
property.- Property description:
- Specifies the cells' width and height as a
Size
object.Can be set in CSS via the property: '-vfx-cell-size'.
Note that this is a special styleable property, in order to set it in CSS see the docs here
StyleableSizeProperty.SizeConverter
. - Parameters:
cellSize
- the value for thecellSize
property- See Also:
-
setCellSize
public void setCellSize(double w, double h) -
setCellSize
public void setCellSize(double size) -
getColumnsNum
public int getColumnsNum()Gets the value of thecolumnsNum
property.- Property description:
- Specifies the maximum number of columns the grid can have. This number is crucial to also compute the nuber of rows.
By default, the latter is computed as follows:
Math.ceil(nItems / nColumns)
.Can be set in CSS via the property: '-vfx-columns-num'.
- Returns:
- the value of the
columnsNum
property - See Also:
-
columnsNumProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty columnsNumProperty()Specifies the maximum number of columns the grid can have. This number is crucial to also compute the nuber of rows. By default, the latter is computed as follows:Math.ceil(nItems / nColumns)
.Can be set in CSS via the property: '-vfx-columns-num'.
- Returns:
- the
columnsNum
property - See Also:
-
setColumnsNum
public void setColumnsNum(int columnsNum) Sets the value of thecolumnsNum
property.- Property description:
- Specifies the maximum number of columns the grid can have. This number is crucial to also compute the nuber of rows.
By default, the latter is computed as follows:
Math.ceil(nItems / nColumns)
.Can be set in CSS via the property: '-vfx-columns-num'.
- Parameters:
columnsNum
- the value for thecolumnsNum
property- See Also:
-
getAlignment
public javafx.geometry.Pos getAlignment()Gets the value of thealignment
property.- Property description:
- Specifies the position of the viewport node inside the grid as a
Pos
object. Note that 'baseline' positions are not supported and will default toPos.TOP_LEFT
instead.Can be set in CSS via the property: '-vfx-alignment'.
- Returns:
- the value of the
alignment
property - See Also:
-
alignmentProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<javafx.geometry.Pos> alignmentProperty()Specifies the position of the viewport node inside the grid as aPos
object. Note that 'baseline' positions are not supported and will default toPos.TOP_LEFT
instead.Can be set in CSS via the property: '-vfx-alignment'.
- Returns:
- the
alignment
property - See Also:
-
setAlignment
public void setAlignment(javafx.geometry.Pos alignment) Sets the value of thealignment
property.- Property description:
- Specifies the position of the viewport node inside the grid as a
Pos
object. Note that 'baseline' positions are not supported and will default toPos.TOP_LEFT
instead.Can be set in CSS via the property: '-vfx-alignment'.
- Parameters:
alignment
- the value for thealignment
property- See Also:
-
getHSpacing
public double getHSpacing()Gets the value of thehSpacing
property.- Property description:
- Specifies the horizontal number of pixels between each cell.
Can be set in CSS via the property: '-vfx-h-spacing'.
- Returns:
- the value of the
hSpacing
property - See Also:
-
hSpacingProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty hSpacingProperty()Specifies the horizontal number of pixels between each cell.Can be set in CSS via the property: '-vfx-h-spacing'.
- Returns:
- the
hSpacing
property - See Also:
-
setHSpacing
public void setHSpacing(double spacing) Sets the value of thehSpacing
property.- Property description:
- Specifies the horizontal number of pixels between each cell.
Can be set in CSS via the property: '-vfx-h-spacing'.
- Parameters:
spacing
- the value for thehSpacing
property- See Also:
-
getVSpacing
public double getVSpacing()Gets the value of thevSpacing
property.- Property description:
- Specifies the vertical number of pixels between each cell.
Can be set in CSS via the property: '-vfx-v-spacing'.
- Returns:
- the value of the
vSpacing
property - See Also:
-
vSpacingProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty vSpacingProperty()Specifies the vertical number of pixels between each cell.Can be set in CSS via the property: '-vfx-v-spacing'.
- Returns:
- the
vSpacing
property - See Also:
-
setVSpacing
public void setVSpacing(double spacing) Sets the value of thevSpacing
property.- Property description:
- Specifies the vertical number of pixels between each cell.
Can be set in CSS via the property: '-vfx-v-spacing'.
- Parameters:
spacing
- the value for thevSpacing
property- See Also:
-
setSpacing
public void setSpacing(double spacing) Convenience method to set both vertical and horizontal spacing to the given value.- See Also:
-
setSpacing
public void setSpacing(double hSpacing, double vSpacing) Convenience method to set both vertical and horizontal spacing to the given values.- See Also:
-
bufferSizeProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<BufferSize> bufferSizeProperty()Specifies the number of extra cells to add to the container; they act as a buffer, allowing scroll to be smoother. To avoid edge cases due to the users abusing the system, this is done by using an enumerator which allows up to three buffer cells. To be more precise, for the grid this determines the number of extra rows and columns to add in the viewport. Since this is a "2D" container, by its nature, a considerable amount of cells is displayed (but it also depends on other factors such as the container's size, the cells size, etc.). The buffer increases such number, so if you have performance issues you may try to lower the buffer value, although I would consider it as a last resort.Can be set in CSS via the property: '-vfx-buffer-size'.
- Specified by:
bufferSizeProperty
in interfaceVFXContainer<T>
- Returns:
- the
bufferSize
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 container, this prevents the content from going outside the view.
Side note: the clip is a
Rectangle
, 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.Can be set in CSS via the property: '-vfx-clip-border-radius'.
- 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 container, this prevents the content from going outside the view. 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.Can be set in CSS via the property: '-vfx-clip-border-radius'.
- 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 container, this prevents the content from going outside the view.
Side note: the clip is a
Rectangle
, 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.Can be set in CSS via the property: '-vfx-clip-border-radius'.
- Parameters:
clipBorderRadius
- the value for theclipBorderRadius
property- See Also:
-
getCacheCapacity
public int getCacheCapacity()Gets the value of thecacheCapacity
property.- Property description:
- Specifies the maximum number of cells the cache can contain at any time. Excess will not be added to the queue and
disposed immediately.
Can be set in CSS via the property: '-vfx-cache-capacity'.
- Returns:
- the value of the
cacheCapacity
property - See Also:
-
cacheCapacityProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerProperty cacheCapacityProperty()Specifies the maximum number of cells the cache can contain at any time. Excess will not be added to the queue and disposed immediately.Can be set in CSS via the property: '-vfx-cache-capacity'.
- Returns:
- the
cacheCapacity
property - See Also:
-
setCacheCapacity
public void setCacheCapacity(int cacheCapacity) Sets the value of thecacheCapacity
property.- Property description:
- Specifies the maximum number of cells the cache can contain at any time. Excess will not be added to the queue and
disposed immediately.
Can be set in CSS via the property: '-vfx-cache-capacity'.
- Parameters:
cacheCapacity
- the value for thecacheCapacity
property- See Also:
-
getClassCssMetaData
-
getControlCssMetaData
- Overrides:
getControlCssMetaData
in classjavafx.scene.control.Control
-
getCache
- Returns:
- the cache instance used by this container
-
cacheSize
public int cacheSize()Delegate forVFXCellsCache.size()
. -
itemsProperty
Specifies theObservableList
used to store the items.We use a
Also, despite the grid being a 2D container, we still use a 1D collection because it's much more easy and convenient to use. Knowing the number of columns we want to divide the items by, it's enough to make the list act as a 2D collection.ListProperty
because it offers many commodities such as both the size and emptiness of the list as observable properties, as well as the possibility of adding anInvalidationListener
that will both inform about changes of the property and in the list.- Specified by:
itemsProperty
in interfaceVFXContainer<T>
- Returns:
- the
items
property - See Also:
-
getCellFactory
Description copied from interface:WithCellFactory
Specifies the wrapper classCellFactory
for the cell factory function- Specified by:
getCellFactory
in interfaceWithCellFactory<T,
C extends VFXCell<T>>
-
getHelper
Gets the value of thehelper
property.- Property description:
- Specifies the instance of the
VFXGridHelper
built by thehelperFactoryProperty()
. - Returns:
- the value of the
helper
property - See Also:
-
helperProperty
Specifies the instance of theVFXGridHelper
built by thehelperFactoryProperty()
.- Returns:
- the
helper
property - See Also:
-
setHelper
Sets the value of thehelper
property.- Property description:
- Specifies the instance of the
VFXGridHelper
built by thehelperFactoryProperty()
. - Parameters:
helper
- the value for thehelper
property- See Also:
-
getHelperFactory
Gets the value of thehelperFactory
property.- Property description:
- Specifies the function used to build a
VFXGridHelper
instance. - Returns:
- the value of the
helperFactory
property - See Also:
-
helperFactoryProperty
public io.github.palexdev.mfxcore.base.properties.functional.SupplierProperty<VFXGridHelper<T,C>> helperFactoryProperty()Specifies the function used to build aVFXGridHelper
instance.- Returns:
- the
helperFactory
property - See Also:
-
setHelperFactory
Sets the value of thehelperFactory
property.- Property description:
- Specifies the function used to build a
VFXGridHelper
instance. - Parameters:
helperFactory
- the value for thehelperFactory
property- See Also:
-
vPosProperty
public javafx.beans.property.DoubleProperty vPosProperty()Description copied from interface:VFXContainer
Specifies the container's vertical position.- Specified by:
vPosProperty
in interfaceVFXContainer<T>
- Returns:
- the
vPos
property - See Also:
-
hPosProperty
public javafx.beans.property.DoubleProperty hPosProperty()Description copied from interface:VFXContainer
Specifies the container's horizontal position.- Specified by:
hPosProperty
in interfaceVFXContainer<T>
- Returns:
- the
hPos
property - See Also:
-
getState
Gets the value of thestate
property.- Property description:
- Specifies the container's current state. The state carries useful information such as the range of rows and columns and the cells ordered by index, or by item (not ordered).
- Returns:
- the value of the
state
property - See Also:
-
stateProperty
Specifies the container's current state. The state carries useful information such as the range of rows and columns and the cells ordered by index, or by item (not ordered).- Returns:
- the
state
property - See Also:
-
setState
Sets the value of thestate
property.- Property description:
- Specifies the container's current state. The state carries useful information such as the range of rows and columns and the cells ordered by index, or by item (not ordered).
- Parameters:
state
- the value for thestate
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
public javafx.beans.property.ReadOnlyBooleanProperty 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:
-