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 aPosobject.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.StyleableIntegerPropertySpecifies the maximum number of cells the cache can contain at any time.io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizePropertySpecifies the cells' width and height as aSizeobject.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoublePropertyUsed by the viewport's clip to set its border radius.io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerPropertySpecifies 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 aVFXGridHelperinstance.javafx.beans.property.ReadOnlyObjectProperty<VFXGridHelper<T, C>> Specifies the instance of theVFXGridHelperbuilt by thehelperFactoryProperty().javafx.beans.property.DoublePropertySpecifies the container's horizontal position.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoublePropertySpecifies the horizontal number of pixels between each cell.javafx.beans.property.ListProperty<T> Specifies theObservableListused to store the items.javafx.beans.property.ReadOnlyDoublePropertyDelegate forVFXContainerHelper.maxHScrollProperty().javafx.beans.property.ReadOnlyDoublePropertyDelegate forVFXContainerHelper.maxVScrollProperty().javafx.beans.property.ReadOnlyBooleanPropertySpecifies 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.ReadOnlyDoublePropertyDelegate forVFXContainerHelper.virtualMaxXProperty().javafx.beans.property.ReadOnlyDoublePropertyDelegate forVFXContainerHelper.virtualMaxYProperty().javafx.beans.property.DoublePropertySpecifies the container's vertical position.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoublePropertySpecifies the vertical number of pixels between each cell.Properties inherited from class io.github.palexdev.mfxcore.controls.Control
behaviorProviderProperties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltipProperties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.Parent
needsLayoutProperties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visibleProperties 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_SIZEFields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT -
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 aPosobject.voidCallsautoArrange(int)with 0 as parameter.voidautoArrange(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.StyleableIntegerPropertySpecifies the maximum number of cells the cache can contain at any time.intDelegate forVFXCellsCache.size().io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizePropertySpecifies the cells' width and height as aSizeobject.voidclip(boolean enable) Clips this virtualized container to avoid content from overflowing by using aRectanglenode with:io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoublePropertyUsed by the viewport's clip to set its border radius.io.github.palexdev.mfxcore.base.properties.styleable.StyleableIntegerPropertySpecifies 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.PosGets the value of thealignmentproperty.protected VFXCellsCache<T, C> getCache()intGets the value of thecacheCapacityproperty.Specifies the wrapper classCellFactoryfor the cell factory functionDelegate forVFXGridState.getCellsByIndexUnmodifiable()Delegate forVFXGridState.getCellsByItemUnmodifiable()io.github.palexdev.mfxcore.base.beans.SizeGets the value of thecellSizeproperty.static List<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> doubleGets the value of theclipBorderRadiusproperty.intGets the value of thecolumnsNumproperty.io.github.palexdev.mfxcore.base.beans.range.IntegerRangeDelegate forVFXGridState.getColumnsRange()protected List<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> Gets the value of thehelperproperty.Gets the value of thehelperFactoryproperty.doubleGets the value of thehSpacingproperty.io.github.palexdev.mfxcore.base.beans.range.IntegerRangeDelegate forVFXGridState.getRowsRange()getState()Gets the value of thestateproperty.doubleGets the value of thevSpacingproperty.io.github.palexdev.mfxcore.base.properties.functional.SupplierProperty<VFXGridHelper<T, C>> Specifies the function used to build aVFXGridHelperinstance.javafx.beans.property.ReadOnlyObjectProperty<VFXGridHelper<T, C>> Specifies the instance of theVFXGridHelperbuilt by thehelperFactoryProperty().javafx.beans.property.DoublePropertySpecifies the container's horizontal position.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoublePropertySpecifies the horizontal number of pixels between each cell.booleanGets the value of theneedsViewportLayoutproperty.javafx.beans.property.ListProperty<T> Specifies theObservableListused to store the items.Wraps this in aVFXScrollPaneto enable scrolling.javafx.beans.property.ReadOnlyDoublePropertyDelegate forVFXContainerHelper.maxHScrollProperty().javafx.beans.property.ReadOnlyDoublePropertyDelegate forVFXContainerHelper.maxVScrollProperty().javafx.beans.property.ReadOnlyBooleanPropertySpecifies whether the viewport needs to compute the layout of its content.Delegate forVFXCellsCache.populate().voidSetter for theneedsViewportLayoutProperty().voidscrollToColumn(int column) Delegate forVFXGridHelper.scrollToColumn(int).voidDelegate forVFXGridHelper.scrollToColumn(int), with parameter 0.voidDelegate forVFXGridHelper.scrollToRow(int), with parameter 0.voidDelegate forVFXGridHelper.scrollToColumn(int), with parameterInteger.MAX_VALUE.voidDelegate forVFXGridHelper.scrollToRow(int), with parameterInteger.MAX_VALUE.voidscrollToRow(int row) Delegate forVFXGridHelper.scrollToRow(int).voidsetAlignment(javafx.geometry.Pos alignment) Sets the value of thealignmentproperty.voidsetCacheCapacity(int cacheCapacity) Sets the value of thecacheCapacityproperty.voidsetCellSize(double size) voidsetCellSize(double w, double h) voidsetCellSize(io.github.palexdev.mfxcore.base.beans.Size cellSize) Sets the value of thecellSizeproperty.voidsetClipBorderRadius(double clipBorderRadius) Sets the value of theclipBorderRadiusproperty.voidsetColumnsNum(int columnsNum) Sets the value of thecolumnsNumproperty.protected voidsetHelper(VFXGridHelper<T, C> helper) Sets the value of thehelperproperty.voidsetHelperFactory(Supplier<VFXGridHelper<T, C>> helperFactory) Sets the value of thehelperFactoryproperty.voidsetHSpacing(double spacing) Sets the value of thehSpacingproperty.protected voidsetNeedsViewportLayout(boolean needsViewportLayout) Sets the value of theneedsViewportLayoutproperty.voidsetSpacing(double spacing) Convenience method to set both vertical and horizontal spacing to the given value.voidsetSpacing(double hSpacing, double vSpacing) Convenience method to set both vertical and horizontal spacing to the given values.protected voidsetState(VFXGridState<T, C> state) Sets the value of thestateproperty.voidsetVSpacing(double spacing) Sets the value of thevSpacingproperty.javafx.beans.property.ReadOnlyObjectProperty<VFXGridState<T, C>> Specifies the container's current state.voidupdate(int... indexes) This method should be used by implementations to "manually" update the container.protected voidupdate(VFXGridState<T, C> state) Setter for thestateProperty().javafx.beans.property.ReadOnlyDoublePropertyDelegate forVFXContainerHelper.virtualMaxXProperty().javafx.beans.property.ReadOnlyDoublePropertyDelegate forVFXContainerHelper.virtualMaxYProperty().javafx.beans.property.DoublePropertySpecifies the container's vertical position.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoublePropertySpecifies the vertical number of pixels between each cell.Methods inherited from class io.github.palexdev.mfxcore.controls.Control
behaviorProviderProperty, changeSkin, createDefaultSkin, getBehavior, getBehaviorProvider, sceneBuilderIntegration, setBehaviorProviderMethods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipPropertyMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.css.Styleable
getStyleableNodeMethods inherited from interface io.github.palexdev.virtualizedfx.base.VFXContainer
emptyProperty, getBufferSize, getHPos, getItems, getMaxHScroll, getMaxVScroll, getVirtualMaxX, getVirtualMaxY, getVPos, isEmpty, setBufferSize, setHPos, setItems, setVPos, size, sizePropertyMethods inherited from interface io.github.palexdev.virtualizedfx.base.VFXStyleable
setDefaultStyleClassesMethods inherited from interface io.github.palexdev.mfxcore.behavior.WithBehavior
setDefaultBehaviorProviderMethods inherited from interface io.github.palexdev.virtualizedfx.base.WithCellFactory
create, setCellFactory
-
Property Details
-
virtualMaxX
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXPropertyDelegate forVFXContainerHelper.virtualMaxXProperty().- Specified by:
virtualMaxXPropertyin interfaceVFXContainer<T>- Returns:
- the
virtualMaxXproperty - See Also:
-
virtualMaxY
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYPropertyDelegate forVFXContainerHelper.virtualMaxYProperty().- Specified by:
virtualMaxYPropertyin interfaceVFXContainer<T>- Returns:
- the
virtualMaxYproperty - See Also:
-
maxVScroll
public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollPropertyDelegate forVFXContainerHelper.maxVScrollProperty().- Specified by:
maxVScrollPropertyin interfaceVFXContainer<T>- Returns:
- the
maxVScrollproperty - See Also:
-
maxHScroll
public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollPropertyDelegate forVFXContainerHelper.maxHScrollProperty().- Specified by:
maxHScrollPropertyin interfaceVFXContainer<T>- Returns:
- the
maxHScrollproperty - See Also:
-
cellSize
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty cellSizePropertySpecifies the cells' width and height as aSizeobject.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 aPosobject. Note that 'baseline' positions are not supported and will default toPos.TOP_LEFTinstead.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:
bufferSizePropertyin interfaceVFXContainer<T>- Returns:
- the
bufferSizeproperty - 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 theObservableListused 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.ListPropertybecause it offers many commodities such as both the size and emptiness of the list as observable properties, as well as the possibility of adding anInvalidationListenerthat will both inform about changes of the property and in the list.- Specified by:
itemsPropertyin interfaceVFXContainer<T>- Returns:
- the
itemsproperty - See Also:
-
helper
public javafx.beans.property.ReadOnlyObjectProperty<VFXGridHelper<T,C extends VFXCell<T>>> helperPropertySpecifies the instance of theVFXGridHelperbuilt 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 aVFXGridHelperinstance.- See Also:
-
vPos
public javafx.beans.property.DoubleProperty vPosProperty- Specified by:
vPosPropertyin interfaceVFXContainer<T>- Returns:
- the
vPosproperty - See Also:
-
hPos
public javafx.beans.property.DoubleProperty hPosProperty- Specified by:
hPosPropertyin interfaceVFXContainer<T>- Returns:
- the
hPosproperty - 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. -
clip
public void clip(boolean enable) Clips this virtualized container to avoid content from overflowing by using aRectanglenode with:- the width and height bound to the grid's ones
- the arc width and height bound to the
By default, the clip is disabled because virtualized containers are meant to be used in combination with a scoll pane which already clips its viewport. Fewer nodes, more performance.clipBorderRadiusProperty()- Parameters:
enable- whether to enable or disable the clip
-
update
public void update(int... indexes) Description copied from interface:VFXContainerThis 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
indexesvar-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:
updatein interfaceVFXContainer<T>- See Also:
-
defaultStyleClasses
- Specified by:
defaultStyleClassesin interfaceVFXStyleable- Returns:
- a list containing all the component's default style classes
-
buildSkin
protected io.github.palexdev.mfxcore.controls.SkinBase<?,?> buildSkin()- Specified by:
buildSkinin classio.github.palexdev.mfxcore.controls.Control<VFXGridManager<T,C extends VFXCell<T>>>
-
defaultBehaviorProvider
- Specified by:
defaultBehaviorProviderin interfaceio.github.palexdev.mfxcore.behavior.WithBehavior<T>
-
makeScrollable
Description copied from interface:VFXScrollableWraps this in aVFXScrollPaneto enable scrolling.- Specified by:
makeScrollablein 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 forVFXContainerHelper.virtualMaxXProperty().- Specified by:
virtualMaxXPropertyin interfaceVFXContainer<T>- Returns:
- the
virtualMaxXproperty - See Also:
-
virtualMaxYProperty
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYProperty()Delegate forVFXContainerHelper.virtualMaxYProperty().- Specified by:
virtualMaxYPropertyin interfaceVFXContainer<T>- Returns:
- the
virtualMaxYproperty - See Also:
-
maxVScrollProperty
public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollProperty()Delegate forVFXContainerHelper.maxVScrollProperty().- Specified by:
maxVScrollPropertyin interfaceVFXContainer<T>- Returns:
- the
maxVScrollproperty - See Also:
-
maxHScrollProperty
public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollProperty()Delegate forVFXContainerHelper.maxHScrollProperty().- Specified by:
maxHScrollPropertyin interfaceVFXContainer<T>- Returns:
- the
maxHScrollproperty - 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 thecellSizeproperty.- Property description:
- Specifies the cells' width and height as a
Sizeobject.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
cellSizeproperty - See Also:
-
cellSizeProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty cellSizeProperty()Specifies the cells' width and height as aSizeobject.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
cellSizeproperty - See Also:
-
setCellSize
public void setCellSize(io.github.palexdev.mfxcore.base.beans.Size cellSize) Sets the value of thecellSizeproperty.- Property description:
- Specifies the cells' width and height as a
Sizeobject.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 thecellSizeproperty- See Also:
-
setCellSize
public void setCellSize(double w, double h) -
setCellSize
public void setCellSize(double size) -
getColumnsNum
public int getColumnsNum()Gets the value of thecolumnsNumproperty.- 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
columnsNumproperty - 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
columnsNumproperty - See Also:
-
setColumnsNum
public void setColumnsNum(int columnsNum) Sets the value of thecolumnsNumproperty.- 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 thecolumnsNumproperty- See Also:
-
getAlignment
public javafx.geometry.Pos getAlignment()Gets the value of thealignmentproperty.- Property description:
- Specifies the position of the viewport node inside the grid as a
Posobject. Note that 'baseline' positions are not supported and will default toPos.TOP_LEFTinstead.Can be set in CSS via the property: '-vfx-alignment'.
- Returns:
- the value of the
alignmentproperty - 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 aPosobject. Note that 'baseline' positions are not supported and will default toPos.TOP_LEFTinstead.Can be set in CSS via the property: '-vfx-alignment'.
- Returns:
- the
alignmentproperty - See Also:
-
setAlignment
public void setAlignment(javafx.geometry.Pos alignment) Sets the value of thealignmentproperty.- Property description:
- Specifies the position of the viewport node inside the grid as a
Posobject. Note that 'baseline' positions are not supported and will default toPos.TOP_LEFTinstead.Can be set in CSS via the property: '-vfx-alignment'.
- Parameters:
alignment- the value for thealignmentproperty- See Also:
-
getHSpacing
public double getHSpacing()Gets the value of thehSpacingproperty.- 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
hSpacingproperty - 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
hSpacingproperty - See Also:
-
setHSpacing
public void setHSpacing(double spacing) Sets the value of thehSpacingproperty.- 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 thehSpacingproperty- See Also:
-
getVSpacing
public double getVSpacing()Gets the value of thevSpacingproperty.- 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
vSpacingproperty - 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
vSpacingproperty - See Also:
-
setVSpacing
public void setVSpacing(double spacing) Sets the value of thevSpacingproperty.- 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 thevSpacingproperty- 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:
bufferSizePropertyin interfaceVFXContainer<T>- Returns:
- the
bufferSizeproperty - See Also:
-
getClipBorderRadius
public double getClipBorderRadius()Gets the value of theclipBorderRadiusproperty.- Property description:
- Used by the viewport's clip to set its border radius.
This is useful when you want to make a rounded 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
clipBorderRadiusproperty - See Also:
-
clipBorderRadiusProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty clipBorderRadiusProperty()Used by the viewport's clip to set its border radius. This is useful when you want to make a rounded 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
clipBorderRadiusproperty - See Also:
-
setClipBorderRadius
public void setClipBorderRadius(double clipBorderRadius) Sets the value of theclipBorderRadiusproperty.- Property description:
- Used by the viewport's clip to set its border radius.
This is useful when you want to make a rounded 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 theclipBorderRadiusproperty- See Also:
-
getCacheCapacity
public int getCacheCapacity()Gets the value of thecacheCapacityproperty.- 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
cacheCapacityproperty - 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
cacheCapacityproperty - See Also:
-
setCacheCapacity
public void setCacheCapacity(int cacheCapacity) Sets the value of thecacheCapacityproperty.- 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 thecacheCapacityproperty- See Also:
-
getClassCssMetaData
-
getControlCssMetaData
- Overrides:
getControlCssMetaDatain classjavafx.scene.control.Control
-
getCache
- Returns:
- the cache instance used by this container
-
cacheSize
public int cacheSize()Delegate forVFXCellsCache.size(). -
itemsProperty
Specifies theObservableListused 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.ListPropertybecause it offers many commodities such as both the size and emptiness of the list as observable properties, as well as the possibility of adding anInvalidationListenerthat will both inform about changes of the property and in the list.- Specified by:
itemsPropertyin interfaceVFXContainer<T>- Returns:
- the
itemsproperty - See Also:
-
getCellFactory
Description copied from interface:WithCellFactorySpecifies the wrapper classCellFactoryfor the cell factory function- Specified by:
getCellFactoryin interfaceWithCellFactory<T,C extends VFXCell<T>>
-
getHelper
Gets the value of thehelperproperty.- Property description:
- Specifies the instance of the
VFXGridHelperbuilt by thehelperFactoryProperty(). - Returns:
- the value of the
helperproperty - See Also:
-
helperProperty
Specifies the instance of theVFXGridHelperbuilt by thehelperFactoryProperty().- Returns:
- the
helperproperty - See Also:
-
setHelper
Sets the value of thehelperproperty.- Property description:
- Specifies the instance of the
VFXGridHelperbuilt by thehelperFactoryProperty(). - Parameters:
helper- the value for thehelperproperty- See Also:
-
getHelperFactory
Gets the value of thehelperFactoryproperty.- Property description:
- Specifies the function used to build a
VFXGridHelperinstance. - Returns:
- the value of the
helperFactoryproperty - See Also:
-
helperFactoryProperty
public io.github.palexdev.mfxcore.base.properties.functional.SupplierProperty<VFXGridHelper<T,C>> helperFactoryProperty()Specifies the function used to build aVFXGridHelperinstance.- Returns:
- the
helperFactoryproperty - See Also:
-
setHelperFactory
Sets the value of thehelperFactoryproperty.- Property description:
- Specifies the function used to build a
VFXGridHelperinstance. - Parameters:
helperFactory- the value for thehelperFactoryproperty- See Also:
-
vPosProperty
public javafx.beans.property.DoubleProperty vPosProperty()Description copied from interface:VFXContainerSpecifies the container's vertical position.- Specified by:
vPosPropertyin interfaceVFXContainer<T>- Returns:
- the
vPosproperty - See Also:
-
hPosProperty
public javafx.beans.property.DoubleProperty hPosProperty()Description copied from interface:VFXContainerSpecifies the container's horizontal position.- Specified by:
hPosPropertyin interfaceVFXContainer<T>- Returns:
- the
hPosproperty - See Also:
-
getState
Gets the value of thestateproperty.- 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
stateproperty - 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
stateproperty - See Also:
-
setState
Sets the value of thestateproperty.- 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 thestateproperty- See Also:
-
isNeedsViewportLayout
public boolean isNeedsViewportLayout()Gets the value of theneedsViewportLayoutproperty.- Property description:
- Specifies whether the viewport needs to compute the layout of its content.
Since this is read-only, layout requests must be sent by using
requestViewportLayout(). - Returns:
- the value of the
needsViewportLayoutproperty - See Also:
-
needsViewportLayoutProperty
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
needsViewportLayoutproperty - See Also:
-
setNeedsViewportLayout
protected void setNeedsViewportLayout(boolean needsViewportLayout) Sets the value of theneedsViewportLayoutproperty.- Property description:
- Specifies whether the viewport needs to compute the layout of its content.
Since this is read-only, layout requests must be sent by using
requestViewportLayout(). - Parameters:
needsViewportLayout- the value for theneedsViewportLayoutproperty- See Also:
-