Class VirtualGrid<T,C extends GridCell<T>>
- Type Parameters:
T
- the type of objects to representC
- the type ofGridCell
to 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.StyleableSizeProperty
Specifies the size of the cells as aSize
.io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Used 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 aSize
object.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 theObservableGrid
used to store the items.io.github.palexdev.mfxcore.base.properties.range.IntegerRangeProperty
Specifies the last range of displayed columns by the viewport as anIntegerRange
.io.github.palexdev.mfxcore.base.properties.range.IntegerRangeProperty
Specifies 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.PositionProperty
Specifies the current position of the viewport as aPosition
object which has both the x and y positions.Carries theGridState
object which represents the current state of the viewport.Properties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltip
Properties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
Properties inherited from class javafx.scene.Parent
needsLayout
Properties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
-
Field Summary
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Constructor Summary
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.StyleableSizeProperty
Specifies the size of the cells as aSize
.void
clear()
Delegate forObservableGrid.clear()
io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty
Used 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 aSize
object.Gets the value of thecellFactory
property.io.github.palexdev.mfxcore.base.beans.Size
Gets the value of thecellSize
property.static List<CssMetaData<? extends Styleable,
?>> double
Gets the value of theclipBorderRadius
property.int
Delegate forGrid.getColumnsNum()
protected List<CssMetaData<? extends Styleable,
?>> io.github.palexdev.mfxcore.base.beans.Size
Gets the value of theestimatedSize
property.Gets the value of thegridHelper
property.To allow more customization on how the cells are laid out, the virtual grid allows you to specify a supplier used to build aGridHelper
which is responsible for some core actions about cells and layout.double
getHPos()
Delegate forGridState.getIndexedCells()
.io.github.palexdev.mfxcore.collections.ObservableGrid<T>
getItems()
Gets the value of theitems
property.io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>
Gets the value of thelastColumnsRange
property.io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>
Gets the value of thelastRowsRange
property.io.github.palexdev.mfxcore.base.beans.Position
Gets the value of theposition
property.int
Delegate forGrid.getRowsNum()
getState()
Gets the value of thestate
property.protected GridManager<T,
C> double
getVPos()
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)
boolean
isEmpty()
Delegate forGrid.isEmpty()
boolean
Gets the value of theneedsViewportLayout
property.ObjectProperty<io.github.palexdev.mfxcore.collections.ObservableGrid<T>>
Specifies theObservableGrid
used to store the items.io.github.palexdev.mfxcore.base.properties.range.IntegerRangeProperty
Specifies the last range of displayed columns by the viewport as anIntegerRange
.io.github.palexdev.mfxcore.base.properties.range.IntegerRangeProperty
Specifies the last range of displayed rows by the viewport as anIntegerRange
.Specifies whether the viewport needs to compute the layout of its content.protected void
This method is called every time thecellSizeProperty()
changes, and is responsible for updating the viewport.io.github.palexdev.mfxcore.base.properties.PositionProperty
Specifies the current position of the viewport as aPosition
object which has both the x and y positions.void
Basically a setter forneedsViewportLayoutProperty()
.void
scrollBy
(double pixels, Orientation orientation) Scrolls by the given amount of pixels in the given direction.void
scrollTo
(double pixel, Orientation orientation) Scrolls to the given pixel value in the given direction.void
scrollToColumn
(int index) Scrolls to the given column index.void
Scrolls to the first columns.void
Scrolls to the first row.void
Scrolls to the last column.void
Scrolls to the last row.void
scrollToRow
(int index) Scrolls to the given row index.void
setCellFactory
(Function<T, C> cellFactory) Sets the value of thecellFactory
property.void
setCellSize
(io.github.palexdev.mfxcore.base.beans.Size cellSize) Sets the value of thecellSize
property.void
setClipBorderRadius
(double clipBorderRadius) Sets the value of theclipBorderRadius
property.protected void
setGridHelper
(GridHelper helper) Sets the value of thegridHelper
property.void
setGridHelperSupplier
(Supplier<GridHelper> gridHelperSupplier) Sets the value of thegridHelperSupplier
property.void
setHPos
(double hPos) Shortcut forsetPosition(double, double)
, which uses the current vPos as the y value for the newPosition
object.void
Sets the value of theitems
property.protected void
setNeedsViewportLayout
(boolean needsViewportLayout) Sets the value of theneedsViewportLayout
property.void
setPosition
(double x, double y) Convenience method, alternative tosetPosition(Position)
.void
setPosition
(io.github.palexdev.mfxcore.base.beans.Position position) Sets the value of theposition
property.void
setVPos
(double vPos) Shortcut forsetPosition(double, double)
, which uses the current hPos as the x value for the newPosition
object.size()
Delegate forGrid.size()
Carries theGridState
object which represents the current state of the viewport.int
Delegate forGrid.totalSize()
wrap()
Wraps this in aVirtualScrollPane
Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
Methods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
Methods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
estimatedSize
Specifies the total virtual size of the viewport as aSize
object.- See Also:
-
state
Carries theGridState
object 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, checkStyleableSizeProperty
andStyleableSizeProperty.SizeConverter
for 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 theObservableGrid
used to store the items.This is an
ObjectProperty
so that it can also be bound to other properties. -
cellFactory
public io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<T,C extends 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 aPosition
object 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 theestimatedSize
property.- Property description:
- Specifies the total virtual size of the viewport as a
Size
object. - Returns:
- the value of the
estimatedSize
property - See Also:
-
estimatedSizeProperty
Specifies the total virtual size of the viewport as aSize
object.- Returns:
- the
estimatedSize
property - See Also:
-
getState
Gets the value of thestate
property.- Property description:
- Carries the
GridState
object 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
state
property - See Also:
-
stateProperty
Carries theGridState
object 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
state
property - See Also:
-
getLastRowsRange
Gets the value of thelastRowsRange
property.- Property description:
- Specifies the last range of displayed rows by the viewport as an
IntegerRange
. - Returns:
- the value of the
lastRowsRange
property - 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
lastRowsRange
property - See Also:
-
getLastColumnsRange
Gets the value of thelastColumnsRange
property.- Property description:
- Specifies the last range of displayed columns by the viewport as an
IntegerRange
. - Returns:
- the value of the
lastColumnsRange
property - 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
lastColumnsRange
property - 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:
createDefaultSkin
in classControl
-
getControlCssMetaData
- Overrides:
getControlCssMetaData
in classControl
-
wrap
Description copied from interface:VirtualScrollPane.Wrappable
Wraps this in aVirtualScrollPane
- Specified by:
wrap
in interfaceVirtualScrollPane.Wrappable
-
getCellSize
public io.github.palexdev.mfxcore.base.beans.Size getCellSize()Gets the value of thecellSize
property.- 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, checkStyleableSizeProperty
andStyleableSizeProperty.SizeConverter
for more info. - Returns:
- the value of the
cellSize
property - 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, checkStyleableSizeProperty
andStyleableSizeProperty.SizeConverter
for more info.- Returns:
- the
cellSize
property - See Also:
-
setCellSize
public void setCellSize(io.github.palexdev.mfxcore.base.beans.Size cellSize) Sets the value of thecellSize
property.- Property description:
- Specifies the size of the cells as a
Size
.It is also possible to set this property via CSS with the
"-fx-cell-size"
property, checkStyleableSizeProperty
andStyleableSizeProperty.SizeConverter
for more info. - Parameters:
cellSize
- the value for thecellSize
property- See Also:
-
getClipBorderRadius
public double getClipBorderRadius()Gets the value of theclipBorderRadius
property.- Property description:
- Used by the viewport's clip to set its border radius.
This is useful when you want to make a rounded virtual 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
clipBorderRadius
property - See Also:
-
clipBorderRadiusProperty
public io.github.palexdev.mfxcore.base.properties.styleable.StyleableDoubleProperty clipBorderRadiusProperty()Used by the viewport's clip to set its border radius. This is useful when you want to make a rounded virtual 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
clipBorderRadius
property - See Also:
-
setClipBorderRadius
public void setClipBorderRadius(double clipBorderRadius) Sets the value of theclipBorderRadius
property.- Property description:
- Used by the viewport's clip to set its border radius.
This is useful when you want to make a rounded virtual 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 theclipBorderRadius
property- See Also:
-
getClassCssMetaData
-
getViewportManager
- Returns:
- the
GridManager
instance for thisVirtualGrid
-
getItems
Gets the value of theitems
property.- Property description:
- Specifies the
ObservableGrid
used to store the items.This is an
ObjectProperty
so that it can also be bound to other properties. - Returns:
- the value of the
items
property - See Also:
-
itemsProperty
Specifies theObservableGrid
used to store the items.This is an
ObjectProperty
so that it can also be bound to other properties.- Returns:
- the
items
property - See Also:
-
setItems
Sets the value of theitems
property.- Property description:
- Specifies the
ObservableGrid
used to store the items.This is an
ObjectProperty
so that it can also be bound to other properties. - Parameters:
items
- the value for theitems
property- See Also:
-
getCellFactory
Gets the value of thecellFactory
property.- Property description:
- Specifies the function used to build the cells.
- Returns:
- the value of the
cellFactory
property - See Also:
-
cellFactoryProperty
public io.github.palexdev.mfxcore.base.properties.functional.FunctionProperty<T,C> cellFactoryProperty()Specifies the function used to build the cells.- Returns:
- the
cellFactory
property - See Also:
-
setCellFactory
Sets the value of thecellFactory
property.- Property description:
- Specifies the function used to build the cells.
- Parameters:
cellFactory
- the value for thecellFactory
property- See Also:
-
setVPos
public void setVPos(double vPos) Shortcut forsetPosition(double, double)
, which uses the current hPos as the x value for the newPosition
object. -
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 newPosition
object. -
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 theposition
property.- Property description:
- Specifies the current position of the viewport as a
Position
object which has both the x and y positions. - Returns:
- the value of the
position
property - See Also:
-
positionProperty
public io.github.palexdev.mfxcore.base.properties.PositionProperty positionProperty()Specifies the current position of the viewport as aPosition
object which has both the x and y positions.- Returns:
- the
position
property - 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 theposition
property.- Property description:
- Specifies the current position of the viewport as a
Position
object which has both the x and y positions. - Parameters:
position
- the value for theposition
property- See Also:
-
getGridHelper
Gets the value of thegridHelper
property.- Property description:
- The current built helper for the grid, see
GridHelper
. - Returns:
- the value of the
gridHelper
property - See Also:
-
gridHelperProperty
The current built helper for the grid, seeGridHelper
.- Returns:
- the
gridHelper
property - See Also:
-
setGridHelper
Sets the value of thegridHelper
property.- Property description:
- The current built helper for the grid, see
GridHelper
. - Parameters:
helper
- the value for thegridHelper
property- 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 aGridHelper
which is responsible for some core actions about cells and layout. This way you could implement your own helper and set it through this factory since thegridHelperProperty()
is intended to be read-only. -
gridHelperSupplierProperty
public io.github.palexdev.mfxcore.base.properties.functional.SupplierProperty<GridHelper> gridHelperSupplierProperty()- Returns:
- the
gridHelperSupplier
property - See Also:
-
setGridHelperSupplier
Sets the value of thegridHelperSupplier
property.- Property description:
- Parameters:
gridHelperSupplier
- the value for thegridHelperSupplier
property- See Also:
-
isNeedsViewportLayout
public boolean isNeedsViewportLayout()Gets the value of theneedsViewportLayout
property.- Property description:
- Specifies whether the viewport needs to compute the layout of its content.
Since this is read-only, layout requests must be sent by using
requestViewportLayout()
. - Returns:
- the value of the
needsViewportLayout
property - See Also:
-
needsViewportLayoutProperty
Specifies whether the viewport needs to compute the layout of its content.Since this is read-only, layout requests must be sent by using
requestViewportLayout()
.- Returns:
- the
needsViewportLayout
property - See Also:
-
setNeedsViewportLayout
protected void setNeedsViewportLayout(boolean needsViewportLayout) Sets the value of theneedsViewportLayout
property.- Property description:
- Specifies whether the viewport needs to compute the layout of its content.
Since this is read-only, layout requests must be sent by using
requestViewportLayout()
. - Parameters:
needsViewportLayout
- the value for theneedsViewportLayout
property- See Also:
-