Class VFXGrid<T,C extends VFXCell<T>>

java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.Control
io.github.palexdev.mfxcore.controls.Control<VFXGridManager<T,C>>
io.github.palexdev.virtualizedfx.grid.VFXGrid<T,C>
Type Parameters:
T - the type of items in the grid
C - 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

public class VFXGrid<T,C extends VFXCell<T>> extends io.github.palexdev.mfxcore.controls.Control<VFXGridManager<T,C>> implements VFXContainer<T>, WithCellFactory<T,C>, VFXStyleable, VFXScrollable
Implementation of a virtualized container to show a list of items in a "2D" perspective. The default style class is: '.vfx-grid'.

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.

Features & Implementation Details

- 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

    Properties
    Type
    Property
    Description
    io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<javafx.geometry.Pos>
    Specifies the position of the viewport node inside the grid as a Pos 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 a Size 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 a VFXGridHelper instance.
    javafx.beans.property.ReadOnlyObjectProperty<VFXGridHelper<T,C>>
    Specifies the instance of the VFXGridHelper built by the helperFactoryProperty().
    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 the ObservableList used to store the items.
    javafx.beans.property.ReadOnlyDoubleProperty
    javafx.beans.property.ReadOnlyDoubleProperty
    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
    javafx.beans.property.ReadOnlyDoubleProperty
    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
    Constructor
    Description
     
    VFXGrid(javafx.collections.ObservableList<T> items, Function<T,C> cellFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<javafx.geometry.Pos>
    Specifies the position of the viewport node inside the grid as a Pos object.
    void
    Calls autoArrange(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 for VFXCellsCache.size().
    io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty
    Specifies the cells' width and height as a Size 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.
     
     
     
    javafx.geometry.Pos
    Gets the value of the alignment property.
    protected VFXCellsCache<T,C>
     
    int
    Gets the value of the cacheCapacity property.
    Specifies the wrapper class CellFactory for the cell factory function
    io.github.palexdev.mfxcore.base.beans.Size
    Gets the value of the cellSize property.
    static List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>>
     
    double
    Gets the value of the clipBorderRadius property.
    int
    Gets the value of the columnsNum property.
    io.github.palexdev.mfxcore.base.beans.range.IntegerRange
    protected List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>>
     
    Gets the value of the helper property.
    Gets the value of the helperFactory property.
    double
    Gets the value of the hSpacing property.
    io.github.palexdev.mfxcore.base.beans.range.IntegerRange
    Gets the value of the state property.
    double
    Gets the value of the vSpacing property.
    io.github.palexdev.mfxcore.base.properties.functional.SupplierProperty<VFXGridHelper<T,C>>
    Specifies the function used to build a VFXGridHelper instance.
    javafx.beans.property.ReadOnlyObjectProperty<VFXGridHelper<T,C>>
    Specifies the instance of the VFXGridHelper built by the helperFactoryProperty().
    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 the needsViewportLayout property.
    javafx.beans.property.ListProperty<T>
    Specifies the ObservableList used to store the items.
    Wraps this in a VFXScrollPane to enable scrolling.
    javafx.beans.property.ReadOnlyDoubleProperty
    javafx.beans.property.ReadOnlyDoubleProperty
    javafx.beans.property.ReadOnlyBooleanProperty
    Specifies whether the viewport needs to compute the layout of its content.
    void
    void
    scrollToColumn(int column)
    void
    Delegate for VFXGridHelper.scrollToColumn(int), with parameter 0.
    void
    Delegate for VFXGridHelper.scrollToRow(int), with parameter 0.
    void
    void
    void
    scrollToRow(int row)
    void
    setAlignment(javafx.geometry.Pos alignment)
    Sets the value of the alignment property.
    void
    setCacheCapacity(int cacheCapacity)
    Sets the value of the cacheCapacity 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 the cellSize property.
    void
    setClipBorderRadius(double clipBorderRadius)
    Sets the value of the clipBorderRadius property.
    void
    setColumnsNum(int columnsNum)
    Sets the value of the columnsNum property.
    protected void
    Sets the value of the helper property.
    void
    Sets the value of the helperFactory property.
    void
    setHSpacing(double spacing)
    Sets the value of the hSpacing property.
    protected void
    setNeedsViewportLayout(boolean needsViewportLayout)
    Sets the value of the needsViewportLayout 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
    Sets the value of the state property.
    void
    setVSpacing(double spacing)
    Sets the value of the vSpacing 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
    Setter for the stateProperty().
    javafx.beans.property.ReadOnlyDoubleProperty
    javafx.beans.property.ReadOnlyDoubleProperty
    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.mfxcore.behavior.WithBehavior

    setDefaultBehaviorProvider

    Methods inherited from interface io.github.palexdev.virtualizedfx.base.WithCellFactory

    create, setCellFactory
  • Property Details

    • virtualMaxX

      public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXProperty
      Specified by:
      virtualMaxXProperty in interface VFXContainer<T>
      Returns:
      the virtualMaxX property
      See Also:
    • virtualMaxY

      public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYProperty
      Specified by:
      virtualMaxYProperty in interface VFXContainer<T>
      Returns:
      the virtualMaxY property
      See Also:
    • maxVScroll

      public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollProperty
      Specified by:
      maxVScrollProperty in interface VFXContainer<T>
      Returns:
      the maxVScroll property
      See Also:
    • maxHScroll

      public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollProperty
      Specified by:
      maxHScrollProperty in interface VFXContainer<T>
      Returns:
      the maxHScroll property
      See Also:
    • cellSize

      public io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty cellSizeProperty
      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.

      See Also:
    • columnsNum

      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'.

      See Also:
    • alignment

      public io.github.palexdev.mfxcore.base.properties.styleable.StyleableObjectProperty<javafx.geometry.Pos> alignmentProperty
      Specifies the position of the viewport node inside the grid as a Pos object. Note that 'baseline' positions are not supported and will default to Pos.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 hSpacingProperty
      Specifies 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 vSpacingProperty
      Specifies 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> 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 interface VFXContainer<T>
      Returns:
      the bufferSize property
      See Also:
    • clipBorderRadius

      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 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'.

      See Also:
    • cacheCapacity

      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'.

      See Also:
    • items

      public javafx.beans.property.ListProperty<T> itemsProperty
      Specifies the ObservableList used to store the items.

      We use a 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 an InvalidationListener that will both inform about changes of the property and in the list.

      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.
      Specified by:
      itemsProperty in interface VFXContainer<T>
      Returns:
      the items property
      See Also:
    • helper

      public javafx.beans.property.ReadOnlyObjectProperty<VFXGridHelper<T,C extends VFXCell<T>>> helperProperty
      Specifies the instance of the VFXGridHelper built by the helperFactoryProperty().
      See Also:
    • helperFactory

      public io.github.palexdev.mfxcore.base.properties.functional.SupplierProperty<VFXGridHelper<T,C extends VFXCell<T>>> helperFactoryProperty
      Specifies the function used to build a VFXGridHelper instance.
      See Also:
    • vPos

      public javafx.beans.property.DoubleProperty vPosProperty
      Specified by:
      vPosProperty in interface VFXContainer<T>
      Returns:
      the vPos property
      See Also:
    • hPos

      public javafx.beans.property.DoubleProperty hPosProperty
      Specified by:
      hPosProperty in interface VFXContainer<T>
      Returns:
      the hPos property
      See Also:
    • state

      public javafx.beans.property.ReadOnlyObjectProperty<VFXGridState<T,C extends VFXCell<T>>> 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).
      See Also:
    • needsViewportLayout

      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().

      See Also:
  • Constructor Details

    • VFXGrid

      public VFXGrid()
    • VFXGrid

      public VFXGrid(javafx.collections.ObservableList<T> items, Function<T,C> cellFactory)
  • Method Details

    • autoArrange

      public void autoArrange()
      Calls autoArrange(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

      protected VFXCellsCache<T,C> createCache()
      Responsible for creating the cache instance used by this container.
      See Also:
    • update

      protected void update(VFXGridState<T,C> state)
      Setter for the stateProperty().
    • defaultHelperFactory

      protected Supplier<VFXGridHelper<T,C>> defaultHelperFactory()
      Returns:
      the default function used to build a VFXGridHelper.
    • requestViewportLayout

      public void requestViewportLayout()
      Setter for the needsViewportLayoutProperty(). 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 interface VFXContainer<T>
      See Also:
    • defaultStyleClasses

      public List<String> defaultStyleClasses()
      Specified by:
      defaultStyleClasses in interface VFXStyleable
      Returns:
      a list containing all the component's default style classes
    • buildSkin

      protected io.github.palexdev.mfxcore.controls.SkinBase<?,?> buildSkin()
      Specified by:
      buildSkin in class io.github.palexdev.mfxcore.controls.Control<VFXGridManager<T,C extends VFXCell<T>>>
    • defaultBehaviorProvider

      public Supplier<VFXGridManager<T,C>> defaultBehaviorProvider()
      Specified by:
      defaultBehaviorProvider in interface io.github.palexdev.mfxcore.behavior.WithBehavior<T>
    • makeScrollable

      public VFXScrollPane makeScrollable()
      Description copied from interface: VFXScrollable
      Wraps this in a VFXScrollPane to enable scrolling.
      Specified by:
      makeScrollable in interface VFXScrollable
    • populateCache

      public VFXGrid<T,C> populateCache()
    • getRowsRange

      public io.github.palexdev.mfxcore.base.beans.range.IntegerRange getRowsRange()
    • getColumnsRange

      public io.github.palexdev.mfxcore.base.beans.range.IntegerRange getColumnsRange()
    • getCellsByIndexUnmodifiable

      public SequencedMap<Integer,C> getCellsByIndexUnmodifiable()
    • getCellsByItemUnmodifiable

      public List<Map.Entry<T,C>> getCellsByItemUnmodifiable()
    • virtualMaxXProperty

      public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXProperty()
      Specified by:
      virtualMaxXProperty in interface VFXContainer<T>
      Returns:
      the virtualMaxX property
      See Also:
    • virtualMaxYProperty

      public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYProperty()
      Specified by:
      virtualMaxYProperty in interface VFXContainer<T>
      Returns:
      the virtualMaxY property
      See Also:
    • maxVScrollProperty

      public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollProperty()
      Specified by:
      maxVScrollProperty in interface VFXContainer<T>
      Returns:
      the maxVScroll property
      See Also:
    • maxHScrollProperty

      public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollProperty()
      Specified by:
      maxHScrollProperty in interface VFXContainer<T>
      Returns:
      the maxHScroll property
      See Also:
    • scrollToRow

      public void scrollToRow(int row)
    • scrollToColumn

      public void scrollToColumn(int column)
    • scrollToFirstRow

      public void scrollToFirstRow()
      Delegate for VFXGridHelper.scrollToRow(int), with parameter 0.
    • scrollToLastRow

      public void scrollToLastRow()
    • scrollToFirstColumn

      public void scrollToFirstColumn()
      Delegate for VFXGridHelper.scrollToColumn(int), with parameter 0.
    • scrollToLastColumn

      public void scrollToLastColumn()
    • getCellSize

      public io.github.palexdev.mfxcore.base.beans.Size getCellSize()
      Gets the value of the cellSize 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 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 cellSize property
      See Also:
    • setCellSize

      public void setCellSize(io.github.palexdev.mfxcore.base.beans.Size cellSize)
      Sets the value of the cellSize 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 the cellSize 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 the columnsNum 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 the columnsNum 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 the columnsNum property
      See Also:
    • getAlignment

      public javafx.geometry.Pos getAlignment()
      Gets the value of the alignment 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 to Pos.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 a Pos object. Note that 'baseline' positions are not supported and will default to Pos.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 the alignment 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 to Pos.TOP_LEFT instead.

      Can be set in CSS via the property: '-vfx-alignment'.

      Parameters:
      alignment - the value for the alignment property
      See Also:
    • getHSpacing

      public double getHSpacing()
      Gets the value of the hSpacing 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 the hSpacing 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 the hSpacing property
      See Also:
    • getVSpacing

      public double getVSpacing()
      Gets the value of the vSpacing 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 the vSpacing 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 the vSpacing 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 interface VFXContainer<T>
      Returns:
      the bufferSize property
      See Also:
    • getClipBorderRadius

      public double getClipBorderRadius()
      Gets the value of the clipBorderRadius 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 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 clipBorderRadius property
      See Also:
    • setClipBorderRadius

      public void setClipBorderRadius(double clipBorderRadius)
      Sets the value of the clipBorderRadius 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 the clipBorderRadius property
      See Also:
    • getCacheCapacity

      public int getCacheCapacity()
      Gets the value of the cacheCapacity 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 the cacheCapacity 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 the cacheCapacity property
      See Also:
    • getClassCssMetaData

      public static List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getClassCssMetaData()
    • getControlCssMetaData

      protected List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getControlCssMetaData()
      Overrides:
      getControlCssMetaData in class javafx.scene.control.Control
    • getCache

      protected VFXCellsCache<T,C> getCache()
      Returns:
      the cache instance used by this container
    • cacheSize

      public int cacheSize()
      Delegate for VFXCellsCache.size().
    • itemsProperty

      public javafx.beans.property.ListProperty<T> itemsProperty()
      Specifies the ObservableList used to store the items.

      We use a 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 an InvalidationListener that will both inform about changes of the property and in the list.

      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.
      Specified by:
      itemsProperty in interface VFXContainer<T>
      Returns:
      the items property
      See Also:
    • getCellFactory

      public CellFactory<T,C> getCellFactory()
      Description copied from interface: WithCellFactory
      Specifies the wrapper class CellFactory for the cell factory function
      Specified by:
      getCellFactory in interface WithCellFactory<T,C extends VFXCell<T>>
    • getHelper

      public VFXGridHelper<T,C> getHelper()
      Gets the value of the helper property.
      Property description:
      Specifies the instance of the VFXGridHelper built by the helperFactoryProperty().
      Returns:
      the value of the helper property
      See Also:
    • helperProperty

      public javafx.beans.property.ReadOnlyObjectProperty<VFXGridHelper<T,C>> helperProperty()
      Specifies the instance of the VFXGridHelper built by the helperFactoryProperty().
      Returns:
      the helper property
      See Also:
    • setHelper

      protected void setHelper(VFXGridHelper<T,C> helper)
      Sets the value of the helper property.
      Property description:
      Specifies the instance of the VFXGridHelper built by the helperFactoryProperty().
      Parameters:
      helper - the value for the helper property
      See Also:
    • getHelperFactory

      public Supplier<VFXGridHelper<T,C>> getHelperFactory()
      Gets the value of the helperFactory 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 a VFXGridHelper instance.
      Returns:
      the helperFactory property
      See Also:
    • setHelperFactory

      public void setHelperFactory(Supplier<VFXGridHelper<T,C>> helperFactory)
      Sets the value of the helperFactory property.
      Property description:
      Specifies the function used to build a VFXGridHelper instance.
      Parameters:
      helperFactory - the value for the helperFactory 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 interface VFXContainer<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 interface VFXContainer<T>
      Returns:
      the hPos property
      See Also:
    • getState

      public VFXGridState<T,C> getState()
      Gets the value of the state 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

      public javafx.beans.property.ReadOnlyObjectProperty<VFXGridState<T,C>> 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

      protected void setState(VFXGridState<T,C> state)
      Sets the value of the state 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 the state property
      See Also:
    • isNeedsViewportLayout

      public boolean isNeedsViewportLayout()
      Gets the value of the needsViewportLayout 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 the needsViewportLayout 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 the needsViewportLayout property
      See Also: