Class VirtualGrid<T,C extends GridCell<T>>
- Type Parameters:
T- the type of objects to representC- the type ofGridCellto use
- All Implemented Interfaces:
VirtualScrollPane.Wrappable,Styleable,EventTarget,Skinnable
- Direct Known Subclasses:
PaginatedVirtualGrid
Extends Control, has its own skin implementation VirtualGridSkin and its own cell system,
GridCell.
The data structure used by this control is a custom one that is specifically made to simplify operations on rows and
columns, a dynamic 2D array. In reality such structure is backed by a 1D collection, a simple List, so
operations are always linear, see Grid and ObservableGrid.
- The items data structure is managed automatically, for all changes that may occur see GridChangeType
- The function used to generate cells, also called "cellFactory" can be changed anytime, even at runtime
- The control also manages the size of all the cells through the cellSizeProperty(), which is also
settable via CSS
- You can programmatically set the position of the viewport through a series of public methods
- It is possible to retrieve the current shown/built cells as well as other information regarding the state of
the viewport through the stateProperty()
- It is possible to observe for changes to the estimated size of the viewport through the estimatedSizeProperty()
- It is possible to programmatically tell the viewport to update its layout with requestViewportLayout()
VirtualGrid uses
a particular dynamic 2D structure which is ObservableGrid. About the performance: operations on rows are generally
faster since the backing data structure is a linear 1D list; operations on columns on the other hand are quite expensive
since it will almost always require a "complete" update of the viewport, to be precise, most of the cells will just
need an index update, whereas just a few of them may require both an index and item update. Nonetheless, computing
changes like a column addition or removal is always a quite complex and expensive operation.-
Property Summary
PropertiesTypePropertyDescriptionSpecifies the function used to build the cells.io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizePropertySpecifies the size of the cells as aSize.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoublePropertyUsed by the viewport's clip to set its border radius.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Size>Specifies the total virtual size of the viewport as aSizeobject.The current built helper for the grid, seeGridHelper.io.github.palexdev.mfxcore.base.properties.functional.SupplierProperty<GridHelper>ObjectProperty<io.github.palexdev.mfxcore.collections.ObservableGrid<T>>Specifies theObservableGridused to store the items.io.github.palexdev.mfxcore.base.properties.range.IntegerRangePropertySpecifies the last range of displayed columns by the viewport as anIntegerRange.io.github.palexdev.mfxcore.base.properties.range.IntegerRangePropertySpecifies the last range of displayed rows by the viewport as anIntegerRange.Specifies whether the viewport needs to compute the layout of its content.io.github.palexdev.mfxcore.base.properties.PositionPropertySpecifies the current position of the viewport as aPositionobject which has both the x and y positions.Carries theGridStateobject which represents the current state of the viewport.Properties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltipProperties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.Parent
needsLayoutProperties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible -
Field Summary
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZEFields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT -
Constructor Summary
ConstructorsConstructorDescriptionVirtualGrid(io.github.palexdev.mfxcore.collections.ObservableGrid<T> items, Function<T, C> cellFactory) -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the function used to build the cells.io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizePropertySpecifies the size of the cells as aSize.voidclear()Delegate forObservableGrid.clear()io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoublePropertyUsed by the viewport's clip to set its border radius.protected Skin<?>ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Size>Specifies the total virtual size of the viewport as aSizeobject.Gets the value of thecellFactoryproperty.io.github.palexdev.mfxcore.base.beans.SizeGets the value of thecellSizeproperty.static List<CssMetaData<? extends Styleable,?>> doubleGets the value of theclipBorderRadiusproperty.intDelegate forGrid.getColumnsNum()protected List<CssMetaData<? extends Styleable,?>> io.github.palexdev.mfxcore.base.beans.SizeGets the value of theestimatedSizeproperty.Gets the value of thegridHelperproperty.To allow more customization on how the cells are laid out, the virtual grid allows you to specify a supplier used to build aGridHelperwhich is responsible for some core actions about cells and layout.doublegetHPos()Delegate forGridState.getIndexedCells().io.github.palexdev.mfxcore.collections.ObservableGrid<T>getItems()Gets the value of theitemsproperty.io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>Gets the value of thelastColumnsRangeproperty.io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>Gets the value of thelastRowsRangeproperty.io.github.palexdev.mfxcore.base.beans.PositionGets the value of thepositionproperty.intDelegate forGrid.getRowsNum()getState()Gets the value of thestateproperty.protected GridManager<T,C> doublegetVPos()The current built helper for the grid, seeGridHelper.io.github.palexdev.mfxcore.base.properties.functional.SupplierProperty<GridHelper>io.github.palexdev.mfxcore.collections.ObservableGrid<T>init()Delegate forObservableGrid.init()io.github.palexdev.mfxcore.collections.ObservableGrid<T>init(int rows, int columns) Delegate forObservableGrid.init(int, int)io.github.palexdev.mfxcore.collections.ObservableGrid<T>init(int rows, int columns, BiFunction<Integer, Integer, T> valFunction) Delegate forObservableGrid.init(int, int, BiFunction)io.github.palexdev.mfxcore.collections.ObservableGrid<T>Delegate forObservableGrid.init(int, int, Object)booleanisEmpty()Delegate forGrid.isEmpty()booleanGets the value of theneedsViewportLayoutproperty.ObjectProperty<io.github.palexdev.mfxcore.collections.ObservableGrid<T>>Specifies theObservableGridused to store the items.io.github.palexdev.mfxcore.base.properties.range.IntegerRangePropertySpecifies the last range of displayed columns by the viewport as anIntegerRange.io.github.palexdev.mfxcore.base.properties.range.IntegerRangePropertySpecifies the last range of displayed rows by the viewport as anIntegerRange.Specifies whether the viewport needs to compute the layout of its content.protected voidThis method is called every time thecellSizeProperty()changes, and is responsible for updating the viewport.io.github.palexdev.mfxcore.base.properties.PositionPropertySpecifies the current position of the viewport as aPositionobject which has both the x and y positions.voidBasically a setter forneedsViewportLayoutProperty().voidscrollBy(double pixels, Orientation orientation) Scrolls by the given amount of pixels in the given direction.voidscrollTo(double pixel, Orientation orientation) Scrolls to the given pixel value in the given direction.voidscrollToColumn(int index) Scrolls to the given column index.voidScrolls to the first columns.voidScrolls to the first row.voidScrolls to the last column.voidScrolls to the last row.voidscrollToRow(int index) Scrolls to the given row index.voidsetCellFactory(Function<T, C> cellFactory) Sets the value of thecellFactoryproperty.voidsetCellSize(io.github.palexdev.mfxcore.base.beans.Size cellSize) Sets the value of thecellSizeproperty.voidsetClipBorderRadius(double clipBorderRadius) Sets the value of theclipBorderRadiusproperty.protected voidsetGridHelper(GridHelper helper) Sets the value of thegridHelperproperty.voidsetGridHelperSupplier(Supplier<GridHelper> gridHelperSupplier) Sets the value of thegridHelperSupplierproperty.voidsetHPos(double hPos) Shortcut forsetPosition(double, double), which uses the current vPos as the y value for the newPositionobject.voidSets the value of theitemsproperty.protected voidsetNeedsViewportLayout(boolean needsViewportLayout) Sets the value of theneedsViewportLayoutproperty.voidsetPosition(double x, double y) Convenience method, alternative tosetPosition(Position).voidsetPosition(io.github.palexdev.mfxcore.base.beans.Position position) Sets the value of thepositionproperty.voidsetVPos(double vPos) Shortcut forsetPosition(double, double), which uses the current hPos as the x value for the newPositionobject.size()Delegate forGrid.size()Carries theGridStateobject which represents the current state of the viewport.intDelegate forGrid.totalSize()wrap()Wraps this in aVirtualScrollPaneMethods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipPropertyMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
estimatedSize
Specifies the total virtual size of the viewport as aSizeobject.- See Also:
-
state
Carries theGridStateobject which represents the current state of the viewport. This property is useful to catch any change happening in the viewport, and carries valuable information.- See Also:
-
lastRowsRange
public io.github.palexdev.mfxcore.base.properties.range.IntegerRangeProperty lastRowsRangePropertySpecifies the last range of displayed rows by the viewport as anIntegerRange.- See Also:
-
lastColumnsRange
public io.github.palexdev.mfxcore.base.properties.range.IntegerRangeProperty lastColumnsRangePropertySpecifies the last range of displayed columns by the viewport as anIntegerRange. -
cellSize
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty cellSizePropertySpecifies the size of the cells as aSize.It is also possible to set this property via CSS with the
"-fx-cell-size"property, checkStyleableSizePropertyandStyleableSizeProperty.SizeConverterfor more info.- 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 virtual grid, this prevents the content from going outside the view. This is mostly useful if not using the grid withVirtualScrollPane, this is the same asVirtualScrollPane.clipBorderRadiusProperty(). Side note: the clip is aRectangle, now for some fucking reason the rectangle's arcWidth and arcHeight values used to make it round do not act like the border-radius or background-radius properties, instead their value is usually 2 / 2.5 times the latter. So for a border radius of 5 you want this value to be at least 10/13.It is also possible to set this property via CSS with the
"-fx-clip-border-radius"property. -
items
Specifies theObservableGridused to store the items.This is an
ObjectPropertyso that it can also be bound to other properties. -
cellFactory
public io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<T,C extends GridCell<T>> cellFactoryPropertySpecifies the function used to build the cells. -
position
public io.github.palexdev.mfxcore.base.properties.PositionProperty positionPropertySpecifies the current position of the viewport as aPositionobject which has both the x and y positions. -
gridHelper
The current built helper for the grid, seeGridHelper. -
gridHelperSupplier
public io.github.palexdev.mfxcore.base.properties.functional.SupplierProperty<GridHelper> gridHelperSupplierProperty -
needsViewportLayout
Specifies whether the viewport needs to compute the layout of its content.Since this is read-only, layout requests must be sent by using
requestViewportLayout().
-
-
Constructor Details
-
VirtualGrid
public VirtualGrid() -
VirtualGrid
-
-
Method Details
-
requestViewportLayout
public void requestViewportLayout()Basically a setter forneedsViewportLayoutProperty().This sets the property to true causing the virtual grid skin to catch the change through a listener which then tells the viewport to recompute the layout.
-
onCellSizeChanged
protected void onCellSizeChanged()This method is called every time thecellSizeProperty()changes, and is responsible for updating the viewport. Different implementations may take different approaches as how to update it. -
init
Delegate forObservableGrid.init() -
init
Delegate forObservableGrid.init(int, int) -
init
Delegate forObservableGrid.init(int, int, Object) -
init
public io.github.palexdev.mfxcore.collections.ObservableGrid<T> init(int rows, int columns, BiFunction<Integer, Integer, T> valFunction) Delegate forObservableGrid.init(int, int, BiFunction) -
getRowsNum
public int getRowsNum()Delegate forGrid.getRowsNum() -
getColumnsNum
public int getColumnsNum()Delegate forGrid.getColumnsNum() -
clear
public void clear()Delegate forObservableGrid.clear() -
totalSize
public int totalSize()Delegate forGrid.totalSize() -
size
Delegate forGrid.size() -
isEmpty
public boolean isEmpty()Delegate forGrid.isEmpty() -
getEstimatedSize
public io.github.palexdev.mfxcore.base.beans.Size getEstimatedSize()Gets the value of theestimatedSizeproperty.- Property description:
- Specifies the total virtual size of the viewport as a
Sizeobject. - Returns:
- the value of the
estimatedSizeproperty - See Also:
-
estimatedSizeProperty
Specifies the total virtual size of the viewport as aSizeobject.- Returns:
- the
estimatedSizeproperty - See Also:
-
getState
Gets the value of thestateproperty.- Property description:
- Carries the
GridStateobject which represents the current state of the viewport. This property is useful to catch any change happening in the viewport, and carries valuable information. - Returns:
- the value of the
stateproperty - See Also:
-
stateProperty
Carries theGridStateobject which represents the current state of the viewport. This property is useful to catch any change happening in the viewport, and carries valuable information.- Returns:
- the
stateproperty - See Also:
-
getLastRowsRange
Gets the value of thelastRowsRangeproperty.- Property description:
- Specifies the last range of displayed rows by the viewport as an
IntegerRange. - Returns:
- the value of the
lastRowsRangeproperty - See Also:
-
lastRowsRangeProperty
public io.github.palexdev.mfxcore.base.properties.range.IntegerRangeProperty lastRowsRangeProperty()Specifies the last range of displayed rows by the viewport as anIntegerRange.- Returns:
- the
lastRowsRangeproperty - See Also:
-
getLastColumnsRange
Gets the value of thelastColumnsRangeproperty.- Property description:
- Specifies the last range of displayed columns by the viewport as an
IntegerRange. - Returns:
- the value of the
lastColumnsRangeproperty - See Also:
-
lastColumnsRangeProperty
public io.github.palexdev.mfxcore.base.properties.range.IntegerRangeProperty lastColumnsRangeProperty()Specifies the last range of displayed columns by the viewport as anIntegerRange.- Returns:
- the
lastColumnsRangeproperty - See Also:
-
getIndexedCells
Delegate forGridState.getIndexedCells(). -
scrollToFirstRow
public void scrollToFirstRow()Scrolls to the first row. -
scrollToLastRow
public void scrollToLastRow()Scrolls to the last row. -
scrollToRow
public void scrollToRow(int index) Scrolls to the given row index. -
scrollToFirstColumn
public void scrollToFirstColumn()Scrolls to the first columns. -
scrollToLastColumn
public void scrollToLastColumn()Scrolls to the last column. -
scrollToColumn
public void scrollToColumn(int index) Scrolls to the given column index. -
scrollBy
Scrolls by the given amount of pixels in the given direction.- Parameters:
orientation- the scroll direction
-
scrollTo
Scrolls to the given pixel value in the given direction.- Parameters:
orientation- the scroll direction
-
createDefaultSkin
- Overrides:
createDefaultSkinin classControl
-
getControlCssMetaData
- Overrides:
getControlCssMetaDatain classControl
-
wrap
Description copied from interface:VirtualScrollPane.WrappableWraps this in aVirtualScrollPane- Specified by:
wrapin interfaceVirtualScrollPane.Wrappable
-
getCellSize
public io.github.palexdev.mfxcore.base.beans.Size getCellSize()Gets the value of thecellSizeproperty.- Property description:
- Specifies the size of the cells as a
Size.It is also possible to set this property via CSS with the
"-fx-cell-size"property, checkStyleableSizePropertyandStyleableSizeProperty.SizeConverterfor more info. - Returns:
- the value of the
cellSizeproperty - See Also:
-
cellSizeProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableSizeProperty cellSizeProperty()Specifies the size of the cells as aSize.It is also possible to set this property via CSS with the
"-fx-cell-size"property, checkStyleableSizePropertyandStyleableSizeProperty.SizeConverterfor more info.- 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 size of the cells as a
Size.It is also possible to set this property via CSS with the
"-fx-cell-size"property, checkStyleableSizePropertyandStyleableSizeProperty.SizeConverterfor more info. - Parameters:
cellSize- the value for thecellSizeproperty- See Also:
-
getClipBorderRadius
public double getClipBorderRadius()Gets the value of theclipBorderRadiusproperty.- Property description:
- Used by the viewport's clip to set its border radius.
This is useful when you want to make a rounded virtual grid, this
prevents the content from going outside the view.
This is mostly useful if not using the grid with
VirtualScrollPane, this is the same asVirtualScrollPane.clipBorderRadiusProperty(). Side note: the clip is aRectangle, now for some fucking reason the rectangle's arcWidth and arcHeight values used to make it round do not act like the border-radius or background-radius properties, instead their value is usually 2 / 2.5 times the latter. So for a border radius of 5 you want this value to be at least 10/13.It is also possible to set this property via CSS with the
"-fx-clip-border-radius"property. - Returns:
- the value of the
clipBorderRadiusproperty - See Also:
-
clipBorderRadiusProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty clipBorderRadiusProperty()Used by the viewport's clip to set its border radius. This is useful when you want to make a rounded virtual grid, this prevents the content from going outside the view. This is mostly useful if not using the grid withVirtualScrollPane, this is the same asVirtualScrollPane.clipBorderRadiusProperty(). Side note: the clip is aRectangle, now for some fucking reason the rectangle's arcWidth and arcHeight values used to make it round do not act like the border-radius or background-radius properties, instead their value is usually 2 / 2.5 times the latter. So for a border radius of 5 you want this value to be at least 10/13.It is also possible to set this property via CSS with the
"-fx-clip-border-radius"property.- Returns:
- the
clipBorderRadiusproperty - See Also:
-
setClipBorderRadius
public void setClipBorderRadius(double clipBorderRadius) Sets the value of theclipBorderRadiusproperty.- Property description:
- Used by the viewport's clip to set its border radius.
This is useful when you want to make a rounded virtual grid, this
prevents the content from going outside the view.
This is mostly useful if not using the grid with
VirtualScrollPane, this is the same asVirtualScrollPane.clipBorderRadiusProperty(). Side note: the clip is aRectangle, now for some fucking reason the rectangle's arcWidth and arcHeight values used to make it round do not act like the border-radius or background-radius properties, instead their value is usually 2 / 2.5 times the latter. So for a border radius of 5 you want this value to be at least 10/13.It is also possible to set this property via CSS with the
"-fx-clip-border-radius"property. - Parameters:
clipBorderRadius- the value for theclipBorderRadiusproperty- See Also:
-
getClassCssMetaData
-
getViewportManager
- Returns:
- the
GridManagerinstance for thisVirtualGrid
-
getItems
Gets the value of theitemsproperty.- Property description:
- Specifies the
ObservableGridused to store the items.This is an
ObjectPropertyso that it can also be bound to other properties. - Returns:
- the value of the
itemsproperty - See Also:
-
itemsProperty
Specifies theObservableGridused to store the items.This is an
ObjectPropertyso that it can also be bound to other properties.- Returns:
- the
itemsproperty - See Also:
-
setItems
Sets the value of theitemsproperty.- Property description:
- Specifies the
ObservableGridused to store the items.This is an
ObjectPropertyso that it can also be bound to other properties. - Parameters:
items- the value for theitemsproperty- See Also:
-
getCellFactory
Gets the value of thecellFactoryproperty.- Property description:
- Specifies the function used to build the cells.
- Returns:
- the value of the
cellFactoryproperty - See Also:
-
cellFactoryProperty
public io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<T,C> cellFactoryProperty()Specifies the function used to build the cells.- Returns:
- the
cellFactoryproperty - See Also:
-
setCellFactory
Sets the value of thecellFactoryproperty.- Property description:
- Specifies the function used to build the cells.
- Parameters:
cellFactory- the value for thecellFactoryproperty- See Also:
-
setVPos
public void setVPos(double vPos) Shortcut forsetPosition(double, double), which uses the current hPos as the x value for the newPositionobject. -
getVPos
public double getVPos()- Returns:
- the vertical position of the viewport
-
setHPos
public void setHPos(double hPos) Shortcut forsetPosition(double, double), which uses the current vPos as the y value for the newPositionobject. -
getHPos
public double getHPos()- Returns:
- the horizontal position of the viewport
-
getPosition
public io.github.palexdev.mfxcore.base.beans.Position getPosition()Gets the value of thepositionproperty.- Property description:
- Specifies the current position of the viewport as a
Positionobject which has both the x and y positions. - Returns:
- the value of the
positionproperty - See Also:
-
positionProperty
public io.github.palexdev.mfxcore.base.properties.PositionProperty positionProperty()Specifies the current position of the viewport as aPositionobject which has both the x and y positions.- Returns:
- the
positionproperty - See Also:
-
setPosition
public void setPosition(double x, double y) Convenience method, alternative tosetPosition(Position). -
setPosition
public void setPosition(io.github.palexdev.mfxcore.base.beans.Position position) Sets the value of thepositionproperty.- Property description:
- Specifies the current position of the viewport as a
Positionobject which has both the x and y positions. - Parameters:
position- the value for thepositionproperty- See Also:
-
getGridHelper
Gets the value of thegridHelperproperty.- Property description:
- The current built helper for the grid, see
GridHelper. - Returns:
- the value of the
gridHelperproperty - See Also:
-
gridHelperProperty
The current built helper for the grid, seeGridHelper.- Returns:
- the
gridHelperproperty - See Also:
-
setGridHelper
Sets the value of thegridHelperproperty.- Property description:
- The current built helper for the grid, see
GridHelper. - Parameters:
helper- the value for thegridHelperproperty- See Also:
-
getGridHelperSupplier
To allow more customization on how the cells are laid out, the virtual grid allows you to specify a supplier used to build aGridHelperwhich is responsible for some core actions about cells and layout. This way you could implement your own helper and set it through this factory since thegridHelperProperty()is intended to be read-only. -
gridHelperSupplierProperty
public io.github.palexdev.mfxcore.base.properties.functional.SupplierProperty<GridHelper> gridHelperSupplierProperty()- Returns:
- the
gridHelperSupplierproperty - See Also:
-
setGridHelperSupplier
Sets the value of thegridHelperSupplierproperty.- Property description:
- Parameters:
gridHelperSupplier- the value for thegridHelperSupplierproperty- See Also:
-
isNeedsViewportLayout
public boolean isNeedsViewportLayout()Gets the value of theneedsViewportLayoutproperty.- Property description:
- Specifies whether the viewport needs to compute the layout of its content.
Since this is read-only, layout requests must be sent by using
requestViewportLayout(). - Returns:
- the value of the
needsViewportLayoutproperty - See Also:
-
needsViewportLayoutProperty
Specifies whether the viewport needs to compute the layout of its content.Since this is read-only, layout requests must be sent by using
requestViewportLayout().- Returns:
- the
needsViewportLayoutproperty - See Also:
-
setNeedsViewportLayout
protected void setNeedsViewportLayout(boolean needsViewportLayout) Sets the value of theneedsViewportLayoutproperty.- Property description:
- Specifies whether the viewport needs to compute the layout of its content.
Since this is read-only, layout requests must be sent by using
requestViewportLayout(). - Parameters:
needsViewportLayout- the value for theneedsViewportLayoutproperty- See Also:
-