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.SizePropertyprotected ChangeListener<? super Number>protected final ReadOnlyBooleanWrapperprotected final TableManager<?>protected ChangeListener<? super io.github.palexdev.mfxcore.base.beans.Position>protected final VirtualTable<?>protected ChangeListener<? super Number>protected DoubleBindingprotected DoubleBinding -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Disposes bindings/listeners that are not required anymore.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Size>Keeps the results ofTableHelper.computeEstimatedSize().doubleThe table is a particular virtualized control because the actual viewport height is not the entire height of the table.doubleSpecifies a certain amount by which shift the horizontal position of columns and rows.booleanInvalidatesVirtualTable.positionProperty()in case changes occur in the viewport and the current position is no longer valid.booleanGets the value of thelayoutInitializedproperty.A hook for late layout initialization.protected voidonHeightChanged(Number ov, Number nv) Executed when the table's height changes.protected voidonPositionChanged(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 voidonWidthChanged(Number ov, Number nv) Executed when the table's width changes.doubleSpecifies 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, waitMethods 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:
estimatedSizePropertyin interfaceTableHelper- Returns:
- the
estimatedSizeproperty - See Also:
-
layoutInitialized
- Specified by:
layoutInitializedPropertyin interfaceTableHelper- Returns:
- the
layoutInitializedproperty - 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:TableHelperThe 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:
getViewportHeightin 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()TheVirtualTablealways 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:
horizontalOffsetin 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()TheVirtualTablealways 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:
verticalOffsetin interfaceTableHelper
-
invalidatedPos
public boolean invalidatedPos()Description copied from interface:TableHelperInvalidatesVirtualTable.positionProperty()in case changes occur in the viewport and the current position is no longer valid.- Specified by:
invalidatedPosin interfaceTableHelper- Returns:
- true or false if the old position was invalid or not
-
estimatedSizeProperty
Description copied from interface:TableHelperKeeps the results ofTableHelper.computeEstimatedSize().- Specified by:
estimatedSizePropertyin interfaceTableHelper- Returns:
- the
estimatedSizeproperty
-
isLayoutInitialized
public boolean isLayoutInitialized()Gets the value of thelayoutInitializedproperty.- Specified by:
isLayoutInitializedin interfaceTableHelper- Property description:
- Returns:
- the value of the
layoutInitializedproperty - See Also:
-
layoutInitializedProperty
Description copied from interface:TableHelperA hook for late layout initialization. When this property changes it is guaranteed that the first full layout pass has been performed.- Specified by:
layoutInitializedPropertyin interfaceTableHelper- Returns:
- the
layoutInitializedproperty - See Also:
-
dispose
public void dispose()Description copied from interface:TableHelperDisposes bindings/listeners that are not required anymore.- Specified by:
disposein interfaceTableHelper
-