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.ReadOnlyDoublePropertySpecifies the maximum possible horizontal position.javafx.beans.property.ReadOnlyDoublePropertySpecifies 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.ReadOnlyDoublePropertySpecifies the total number of pixels on the x-axis.javafx.beans.property.ReadOnlyDoublePropertySpecifies 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.IntegerRangePropertyprotected final javafx.beans.property.ReadOnlyDoubleWrapperprotected final javafx.beans.property.ReadOnlyDoubleWrapperprotected final io.github.palexdev.mfxcore.base.properties.range.IntegerRangePropertyprotected final io.github.palexdev.mfxcore.base.properties.PositionPropertyprotected final javafx.beans.property.ReadOnlyDoubleWrapperprotected 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.voiddispose()Automatically called byVFXTablewhen a helper is not needed anymore (changed).intfirstRow()getTable()protected voidBindings and listeners should be initialized here, automatically called after the table instance is set.intintlastRow()javafx.beans.property.ReadOnlyDoublePropertySpecifies the maximum possible horizontal position.javafx.beans.property.ReadOnlyDoublePropertySpecifies 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.intjavafx.beans.property.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Position> Cells are actually contained in a separate pane called 'viewport'.javafx.beans.property.ReadOnlyDoublePropertySpecifies the total number of pixels on the x-axis.javafx.beans.property.ReadOnlyDoublePropertySpecifies the total number of pixels on the y-axis.intMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
columnsRangePropertyin interfaceVFXTableHelper<T>- Returns:
- the
columnsRangeproperty - See Also:
-
rowsRange
public javafx.beans.property.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> rowsRangeProperty- Specified by:
rowsRangePropertyin interfaceVFXTableHelper<T>- Returns:
- the
rowsRangeproperty - See Also:
-
virtualMaxX
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXProperty- Specified by:
virtualMaxXPropertyin interfaceVFXTableHelper<T>- Returns:
- the
virtualMaxXproperty - See Also:
-
virtualMaxY
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYProperty- Specified by:
virtualMaxYPropertyin interfaceVFXTableHelper<T>- Returns:
- the
virtualMaxYproperty - See Also:
-
maxVScroll
public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollProperty- Specified by:
maxVScrollPropertyin interfaceVFXTableHelper<T>- Returns:
- the
maxVScrollproperty - See Also:
-
maxHScroll
public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollProperty- Specified by:
maxHScrollPropertyin interfaceVFXTableHelper<T>- Returns:
- the
maxHScrollproperty - See Also:
-
viewportPosition
public javafx.beans.property.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Position> viewportPositionProperty- Specified by:
viewportPositionPropertyin interfaceVFXTableHelper<T>- Returns:
- the
viewportPositionproperty - 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:
lastColumnin 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:VFXTableHelperSpecifies the range of columns that should be present in the viewport. This also takes into account buffer columns, seeVFXTableHelper.visibleColumns()andVFXTableHelper.totalColumns().- Specified by:
columnsRangePropertyin interfaceVFXTableHelper<T>- Returns:
- the
columnsRangeproperty
-
firstRow
public int firstRow()Given byMath.floor(vPos / rowsHeight), clamped between 0 andVFXContainer.size()- 1.- Specified by:
firstRowin interfaceVFXTableHelper<T>- Returns:
- the index of the first visible row
-
lastRow
public int lastRow()Given byrowsRange().getMax()- Specified by:
lastRowin 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:
visibleRowsin 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:
totalRowsin 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:VFXTableHelperSpecifies the range of rows that should be present in the viewport. This also takes into account buffer rows, seeVFXTableHelper.visibleRows()andVFXTableHelper.totalRows().- Specified by:
rowsRangePropertyin interfaceVFXTableHelper<T>- Returns:
- the
rowsRangeproperty
-
virtualMaxXProperty
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXProperty()Description copied from interface:VFXTableHelperSpecifies the total number of pixels on the x-axis.- Specified by:
virtualMaxXPropertyin interfaceVFXTableHelper<T>- Returns:
- the
virtualMaxXproperty - See Also:
-
virtualMaxYProperty
public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYProperty()Description copied from interface:VFXTableHelperSpecifies the total number of pixels on the y-axis.- Specified by:
virtualMaxYPropertyin interfaceVFXTableHelper<T>- Returns:
- the
virtualMaxYproperty - See Also:
-
maxVScrollProperty
public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollProperty()Description copied from interface:VFXTableHelperSpecifies the maximum possible vertical position.- Specified by:
maxVScrollPropertyin interfaceVFXTableHelper<T>- Returns:
- the
maxVScrollproperty - See Also:
-
maxHScrollProperty
public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollProperty()Description copied from interface:VFXTableHelperSpecifies the maximum possible horizontal position.- Specified by:
maxHScrollPropertyin interfaceVFXTableHelper<T>- Returns:
- the
maxHScrollproperty - See Also:
-
viewportPositionProperty
public javafx.beans.property.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Position> viewportPositionProperty()Description copied from interface:VFXTableHelperCells 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:
viewportPositionPropertyin interfaceVFXTableHelper<T>- Returns:
- the
viewportPositionproperty - See Also:
-
getTable
- Specified by:
getTablein interfaceVFXTableHelper<T>- Returns:
- the
VFXTableinstance the helper is related to
-
dispose
public void dispose()Automatically called byVFXTablewhen 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:
disposein interfaceVFXTableHelper<T>
-