Module VirtualizedFX
Class VFXTableHelper.AbstractHelper<T>
java.lang.Object
io.github.palexdev.virtualizedfx.table.VFXTableHelper.AbstractHelper<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
VFXTableHelper<T>
- Direct Known Subclasses:
VFXTableHelper.FixedTableHelper
,VFXTableHelper.VariableTableHelper
- Enclosing interface:
VFXTableHelper<T>
public abstract static class VFXTableHelper.AbstractHelper<T>
extends Object
implements VFXTableHelper<T>
Abstract implementation of
VFXTableHelper
, contains common members for the two concrete implementations
VFXTableHelper.FixedTableHelper
and VFXTableHelper.VariableTableHelper
, such as:
- the range of columns to display as a IntegerRangeProperty
- the range of rows to display as a IntegerRangeProperty
- the virtual max x as a ReadOnlyDoubleWrapper
- the virtual max y as a ReadOnlyDoubleWrapper
- the viewport's position, viewportPositionProperty()
as a PositionProperty
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> Specifies the range of columns that should be present in the viewport.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the maximum possible horizontal position.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the maximum possible vertical position.javafx.beans.property.ReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> Specifies the range of rows that should be present in the viewport.javafx.beans.property.ReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.Position> Cells are actually contained in a separate pane called 'viewport'.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the total number of pixels on the x-axis.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the total number of pixels on the y-axis. -
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.palexdev.virtualizedfx.table.VFXTableHelper
VFXTableHelper.AbstractHelper<T>, VFXTableHelper.FixedTableHelper<T>, VFXTableHelper.VariableTableHelper<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final io.github.palexdev.mfxcore.base.properties.range.IntegerRangeProperty
protected final javafx.beans.property.ReadOnlyDoubleWrapper
protected final javafx.beans.property.ReadOnlyDoubleWrapper
protected final io.github.palexdev.mfxcore.base.properties.range.IntegerRangeProperty
protected final io.github.palexdev.mfxcore.base.properties.PositionProperty
protected final javafx.beans.property.ReadOnlyDoubleWrapper
protected final javafx.beans.property.ReadOnlyDoubleWrapper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.ReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> Specifies the range of columns that should be present in the viewport.void
dispose()
Automatically called byVFXTable
when a helper is not needed anymore (changed).int
firstRow()
getTable()
protected void
Bindings and listeners should be initialized here, automatically called after the table instance is set.int
int
lastRow()
javafx.beans.property.ReadOnlyDoubleProperty
Specifies the maximum possible horizontal position.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the maximum possible vertical position.javafx.beans.property.ReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> Specifies the range of rows that should be present in the viewport.int
javafx.beans.property.ReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.Position> Cells are actually contained in a separate pane called 'viewport'.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the total number of pixels on the x-axis.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the total number of pixels on the y-axis.int
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.palexdev.virtualizedfx.table.VFXTableHelper
autosizeColumn, autosizeColumns, columnsRange, firstColumn, getColumnPos, getColumnWidth, getMaxHScroll, getMaxVScroll, getViewportHeight, getViewportPosition, getVirtualMaxX, getVirtualMaxY, indexToItem, indexToRow, invalidatePos, isInViewport, isLastColumn, itemToRow, layoutCell, layoutColumn, layoutRow, rowsRange, scrollBy, scrollToIndex, scrollToPixel, totalCells, totalColumns, visibleCells, visibleColumns
-
Property Details
-
columnsRange
public javafx.beans.property.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> columnsRangeProperty- Specified by:
columnsRangeProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
columnsRange
property - See Also:
-
rowsRange
public javafx.beans.property.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> rowsRangeProperty- Specified by:
rowsRangeProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
rowsRange
property - See Also:
-
virtualMaxX
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXProperty- Specified by:
virtualMaxXProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
virtualMaxX
property - See Also:
-
virtualMaxY
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYProperty- Specified by:
virtualMaxYProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
virtualMaxY
property - See Also:
-
maxVScroll
public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollProperty- Specified by:
maxVScrollProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
maxVScroll
property - See Also:
-
maxHScroll
public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollProperty- Specified by:
maxHScrollProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
maxHScroll
property - See Also:
-
viewportPosition
public javafx.beans.property.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Position> viewportPositionProperty- Specified by:
viewportPositionProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
viewportPosition
property - See Also:
-
-
Field Details
-
table
-
columnsRange
protected final io.github.palexdev.mfxcore.base.properties.range.IntegerRangeProperty columnsRange -
rowsRange
protected final io.github.palexdev.mfxcore.base.properties.range.IntegerRangeProperty rowsRange -
virtualMaxX
protected final javafx.beans.property.ReadOnlyDoubleWrapper virtualMaxX -
virtualMaxY
protected final javafx.beans.property.ReadOnlyDoubleWrapper virtualMaxY -
maxHScroll
protected final javafx.beans.property.ReadOnlyDoubleWrapper maxHScroll -
maxVScroll
protected final javafx.beans.property.ReadOnlyDoubleWrapper maxVScroll -
viewportPosition
protected final io.github.palexdev.mfxcore.base.properties.PositionProperty viewportPosition
-
-
Constructor Details
-
AbstractHelper
-
-
Method Details
-
initBindings
protected void initBindings()Bindings and listeners should be initialized here, automatically called after the table instance is set. -
lastColumn
public int lastColumn()Given bycolumnsRange().getMax()
- Specified by:
lastColumn
in interfaceVFXTableHelper<T>
- Returns:
- the index of the last visible column
-
columnsRangeProperty
public javafx.beans.property.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> columnsRangeProperty()Description copied from interface:VFXTableHelper
Specifies the range of columns that should be present in the viewport. This also takes into account buffer columns, seeVFXTableHelper.visibleColumns()
andVFXTableHelper.totalColumns()
.- Specified by:
columnsRangeProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
columnsRange
property
-
firstRow
public int firstRow()Given byMath.floor(vPos / rowsHeight)
, clamped between 0 andVFXContainer.size()
- 1.- Specified by:
firstRow
in interfaceVFXTableHelper<T>
- Returns:
- the index of the first visible row
-
lastRow
public int lastRow()Given byrowsRange().getMax()
- Specified by:
lastRow
in interfaceVFXTableHelper<T>
- Returns:
- the index of the last visible row
-
visibleRows
public int visibleRows()Given byMath.ceil(viewportHeight / rowsHeight)
. 0 if the rows height is also 0.- Specified by:
visibleRows
in interfaceVFXTableHelper<T>
- Returns:
- the number of rows visible in the viewport. Not necessarily the same as
VFXTableHelper.totalRows()
-
totalRows
public int totalRows()Given byvisibleRows + rowsBuffer * 2
, can't exceedVFXContainer.size()
and it's 0 if the number of visible rows is also 0.- Specified by:
totalRows
in interfaceVFXTableHelper<T>
- Returns:
- the total number of rows in the viewport which doesn't include only the number of visible rows but also the number of buffer rows
-
rowsRangeProperty
public javafx.beans.property.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> rowsRangeProperty()Description copied from interface:VFXTableHelper
Specifies the range of rows that should be present in the viewport. This also takes into account buffer rows, seeVFXTableHelper.visibleRows()
andVFXTableHelper.totalRows()
.- Specified by:
rowsRangeProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
rowsRange
property
-
virtualMaxXProperty
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXProperty()Description copied from interface:VFXTableHelper
Specifies the total number of pixels on the x-axis.- Specified by:
virtualMaxXProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
virtualMaxX
property - See Also:
-
virtualMaxYProperty
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYProperty()Description copied from interface:VFXTableHelper
Specifies the total number of pixels on the y-axis.- Specified by:
virtualMaxYProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
virtualMaxY
property - See Also:
-
maxVScrollProperty
public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollProperty()Description copied from interface:VFXTableHelper
Specifies the maximum possible vertical position.- Specified by:
maxVScrollProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
maxVScroll
property - See Also:
-
maxHScrollProperty
public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollProperty()Description copied from interface:VFXTableHelper
Specifies the maximum possible horizontal position.- Specified by:
maxHScrollProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
maxHScroll
property - See Also:
-
viewportPositionProperty
public javafx.beans.property.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Position> viewportPositionProperty()Description copied from interface:VFXTableHelper
Cells are actually contained in a separate pane called 'viewport'. The scroll is applied on this pane.This property specifies the translation of the viewport, the value depends on the implementation.
- Specified by:
viewportPositionProperty
in interfaceVFXTableHelper<T>
- Returns:
- the
viewportPosition
property - See Also:
-
getTable
- Specified by:
getTable
in interfaceVFXTableHelper<T>
- Returns:
- the
VFXTable
instance the helper is related to
-
dispose
public void dispose()Automatically called byVFXTable
when a helper is not needed anymore (changed). If the helper uses listeners/bindings that may lead to memory leaks, this is the right place to remove them. Sets the table reference tonull
.- Specified by:
dispose
in interfaceVFXTableHelper<T>
-