Module VirtualizedFX
Class TableHelper.AbstractHelper
java.lang.Object
io.github.palexdev.virtualizedfx.table.TableHelper.AbstractHelper
- All Implemented Interfaces:
TableHelper
- Direct Known Subclasses:
TableHelper.FixedTableHelper
- Enclosing interface:
TableHelper
Abstract implementation of
TableHelper
, and base class for TableHelper.FixedTableHelper
.-
Property Summary
PropertiesTypePropertyDescriptionReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Size>
Keeps the results ofTableHelper.computeEstimatedSize()
.A hook for late layout initialization. -
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.palexdev.virtualizedfx.table.TableHelper
TableHelper.AbstractHelper, TableHelper.FixedTableHelper, TableHelper.VariableTableHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final io.github.palexdev.mfxcore.base.properties.SizeProperty
protected ChangeListener<? super Number>
protected final ReadOnlyBooleanWrapper
protected final TableManager<?>
protected ChangeListener<? super io.github.palexdev.mfxcore.base.beans.Position>
protected final VirtualTable<?>
protected ChangeListener<? super Number>
protected DoubleBinding
protected DoubleBinding
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes bindings/listeners that are not required anymore.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Size>
Keeps the results ofTableHelper.computeEstimatedSize()
.double
The table is a particular virtualized control because the actual viewport height is not the entire height of the table.double
Specifies a certain amount by which shift the horizontal position of columns and rows.boolean
InvalidatesVirtualTable.positionProperty()
in case changes occur in the viewport and the current position is no longer valid.boolean
Gets the value of thelayoutInitialized
property.A hook for late layout initialization.protected void
onHeightChanged
(Number ov, Number nv) Executed when the table's height changes.protected void
onPositionChanged
(io.github.palexdev.mfxcore.base.beans.Position ov, io.github.palexdev.mfxcore.base.beans.Position nv) Executed when theVirtualTable.positionProperty()
changes, responsible for invokingTableManager.onHScroll()
(if x pos changed( andTableManager.onVScroll()
(if y pos changed)protected void
onWidthChanged
(Number ov, Number nv) Executed when the table's width changes.double
Specifies a certain amount by which shift the vertical position of rows.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.TableHelper
autosizeColumn, autosizeColumns, columnsRange, computeEstimatedSize, computePositions, firstColumn, firstRow, lastColumn, lastRow, layout, maxColumns, maxHScroll, maxRows, maxVScroll, rowsRange, scrollBy, scrollTo, scrollToColumn, scrollToRow, xPosBinding, yPosBinding
-
Property Details
-
estimatedSize
- Specified by:
estimatedSizeProperty
in interfaceTableHelper
- Returns:
- the
estimatedSize
property - See Also:
-
layoutInitialized
- Specified by:
layoutInitializedProperty
in interfaceTableHelper
- Returns:
- the
layoutInitialized
property - See Also:
-
-
Field Details
-
table
-
manager
-
widthListener
-
heightListener
-
positionListener
-
estimatedSize
protected final io.github.palexdev.mfxcore.base.properties.SizeProperty estimatedSize -
layoutInitialized
-
xPosBinding
-
yPosBinding
-
-
Constructor Details
-
AbstractHelper
-
-
Method Details
-
onWidthChanged
Executed when the table's width changes. Re-initializes the viewport withTableManager.init()
-
onHeightChanged
Executed when the table's height changes. Re-initializes the viewport withTableManager.init()
. -
onPositionChanged
protected void onPositionChanged(io.github.palexdev.mfxcore.base.beans.Position ov, io.github.palexdev.mfxcore.base.beans.Position nv) Executed when theVirtualTable.positionProperty()
changes, responsible for invokingTableManager.onHScroll()
(if x pos changed( andTableManager.onVScroll()
(if y pos changed) -
getViewportHeight
public double getViewportHeight()Description copied from interface:TableHelper
The table is a particular virtualized control because the actual viewport height is not the entire height of the table. The container for the columns is technically not part of the viewport, so it must be subtracted.- Specified by:
getViewportHeight
in interfaceTableHelper
-
horizontalOffset
public double horizontalOffset()Specifies a certain amount by which shift the horizontal position of columns and rows. Behavior may differ between implementations and depends also onTableHelper.layout()
TheVirtualTable
always renders one extra column as overscan/buffer. This approach has a little issue for how scrolling works. When the end of the viewport is reached (horizontally) the extra column ends up overflowing the table, it's positioned outside of it.To make the layout work correctly this method returns an offset of
-table.getColumnSize().getWidth()
to ensure all columns are correctly visualized. Returns 0 if the extra offset is not needed.- Specified by:
horizontalOffset
in interfaceTableHelper
-
verticalOffset
public double verticalOffset()Specifies a certain amount by which shift the vertical position of rows. Behavior may differ between implementations and depends also onTableHelper.layout()
TheVirtualTable
always renders one extra row as overscan/buffer. This approach has a little issue for how scrolling works. When the end of the viewport is reached (vertically) the extra row ends up overflowing the table, it's positioned outside of it.To make the layout work correctly this method returns an offset of
-table.getCellHeight()
to ensure all rows are correctly visualized. Returns 0 if the extra offset is not needed.- Specified by:
verticalOffset
in interfaceTableHelper
-
invalidatedPos
public boolean invalidatedPos()Description copied from interface:TableHelper
InvalidatesVirtualTable.positionProperty()
in case changes occur in the viewport and the current position is no longer valid.- Specified by:
invalidatedPos
in interfaceTableHelper
- Returns:
- true or false if the old position was invalid or not
-
estimatedSizeProperty
Description copied from interface:TableHelper
Keeps the results ofTableHelper.computeEstimatedSize()
.- Specified by:
estimatedSizeProperty
in interfaceTableHelper
- Returns:
- the
estimatedSize
property
-
isLayoutInitialized
public boolean isLayoutInitialized()Gets the value of thelayoutInitialized
property.- Specified by:
isLayoutInitialized
in interfaceTableHelper
- Property description:
- Returns:
- the value of the
layoutInitialized
property - See Also:
-
layoutInitializedProperty
Description copied from interface:TableHelper
A hook for late layout initialization. When this property changes it is guaranteed that the first full layout pass has been performed.- Specified by:
layoutInitializedProperty
in interfaceTableHelper
- Returns:
- the
layoutInitialized
property - See Also:
-
dispose
public void dispose()Description copied from interface:TableHelper
Disposes bindings/listeners that are not required anymore.- Specified by:
dispose
in interfaceTableHelper
-