Interface VFXTableHelper<T>
- All Superinterfaces:
VFXContainerHelper<T, VFXTable<T>>
- All Known Implementing Classes:
VFXTableHelper.AbstractHelper
,VFXTableHelper.FixedTableHelper
,VFXTableHelper.VariableTableHelper
This interface is a utility API for
VFXTable
, computations may change depending on the
VFXTable.columnsLayoutModeProperty()
. For this reason, there are two concrete implementations:
VFXTableHelper.FixedTableHelper
and VFXTableHelper.VariableTableHelper
.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Abstract implementation ofVFXTableHelper
, contains common members for the two concrete implementationsVFXTableHelper.FixedTableHelper
andVFXTableHelper.VariableTableHelper
, such as:static class
Concrete implementation ofVFXTableHelper.AbstractHelper
forColumnsLayoutMode.FIXED
.static class
Concrete implementation ofVFXTableHelper.AbstractHelper
forColumnsLayoutMode.VARIABLE
.Nested classes/interfaces inherited from interface io.github.palexdev.virtualizedfx.base.VFXContainerHelper
VFXContainerHelper.VFXContainerHelperBase<T, C extends Region & VFXContainer<T>>
-
Property Summary
PropertiesTypePropertyDescriptionReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> Specifies the range of columns that should be present in the viewport.ReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> Specifies the range of rows that should be present in the viewport.Properties inherited from interface io.github.palexdev.virtualizedfx.base.VFXContainerHelper
maxHScroll, maxVScroll, viewportPosition, virtualMaxX, virtualMaxY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
autosizeColumn
(VFXTableColumn<T, ?> column) Determines and sets the ideal width for the given column, where 'ideal' means that the column's header as well as all the related cells' content will be fully visible.void
Depends on the implementation!default io.github.palexdev.mfxcore.base.beans.range.IntegerRange
ReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> Specifies the range of columns that should be present in the viewport.int
int
firstRow()
double
getColumnPos
(int layoutIdx, VFXTableColumn<T, ?> column) double
getColumnWidth
(VFXTableColumn<T, ?> column) default double
default VFXTableRow
<T> indexToRow
(int index) Converts the given index to a row.boolean
isInViewport
(VFXTableColumn<T, ?> column) default boolean
isLastColumn
(VFXTableColumn<T, ?> column) Checks whether the given column is the last inVFXTable.getColumns()
.default VFXTableRow
<T> Converts the given item to a row.int
int
lastRow()
boolean
layoutCell
(int layoutIdx, VFXTableCell<T> cell) Lays out the given cell.boolean
layoutColumn
(int layoutIdx, VFXTableColumn<T, ?> column) Lays out the given column.default void
layoutRow
(int layoutIdx, VFXTableRow<T> row) Lays out the given row.default io.github.palexdev.mfxcore.base.beans.range.IntegerRange
ReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> Specifies the range of rows that should be present in the viewport.default void
scrollBy
(Orientation orientation, double pixels) Scrolls in the viewport, in the given direction (orientation) by the given number of pixels.void
scrollToIndex
(Orientation orientation, int index) Scrolls in the viewport, depending on the given direction (orientation) to:default void
scrollToPixel
(Orientation orientation, double pixel) Scrolls in the viewport, in the given direction (orientation) to the given pixel value.default int
int
int
int
Depends on the implementation!int
int
Methods inherited from interface io.github.palexdev.virtualizedfx.base.VFXContainerHelper
dispose, getContainer, getMaxHScroll, getMaxVScroll, getViewportPosition, getVirtualMaxX, getVirtualMaxY, indexToItem, invalidatePos, invalidateVirtualSizes, maxHScrollProperty, maxVScrollProperty, viewportPositionProperty, virtualMaxXProperty, virtualMaxYProperty
-
Property Details
-
columnsRange
ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> columnsRangePropertySpecifies the range of columns that should be present in the viewport. This also takes into account buffer columns, seevisibleColumns()
andtotalColumns()
.- See Also:
-
rowsRange
ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> rowsRangePropertySpecifies the range of rows that should be present in the viewport. This also takes into account buffer rows, seevisibleRows()
andtotalRows()
.- See Also:
-
-
Method Details
-
firstColumn
int firstColumn()- Returns:
- the index of the first visible column
-
lastColumn
int lastColumn()- Returns:
- the index of the last visible column
-
visibleColumns
int visibleColumns()- Returns:
- the number of columns visible in the viewport. Not necessarily the same as
totalColumns()
-
totalColumns
int totalColumns()- Returns:
- the total number of columns in the viewport which doesn't include only the number of visible columns but also the number of buffer columns
- See Also:
-
columnsRangeProperty
ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> columnsRangeProperty()Specifies the range of columns that should be present in the viewport. This also takes into account buffer columns, seevisibleColumns()
andtotalColumns()
.- Returns:
- the
columnsRange
property
-
columnsRange
default io.github.palexdev.mfxcore.base.beans.range.IntegerRange columnsRange()- Returns:
- the range of columns that should be present in the viewport. This also takes into account buffer columns,
see
visibleColumns()
andtotalColumns()
-
firstRow
int firstRow()- Returns:
- the index of the first visible row
-
lastRow
int lastRow()- Returns:
- the index of the last visible row
-
visibleRows
int visibleRows()- Returns:
- the number of rows visible in the viewport. Not necessarily the same as
totalRows()
-
totalRows
int totalRows()- 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
ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> rowsRangeProperty()Specifies the range of rows that should be present in the viewport. This also takes into account buffer rows, seevisibleRows()
andtotalRows()
.- Returns:
- the
rowsRange
property
-
rowsRange
default io.github.palexdev.mfxcore.base.beans.range.IntegerRange rowsRange()- Returns:
- the range of rows that should be present in the viewport. This also takes into account buffer rows,
see
visibleRows()
andtotalRows()
.
-
getColumnWidth
- Returns:
- the width for the given column
-
getColumnPos
- Returns:
- the x position for the given column and its layout index in the viewport
-
isInViewport
- Returns:
- whether the given column is currently visible in the viewport
-
layoutColumn
Lays out the given column. The layout index is necessary to identify the position of a column among the others (comes before/after).- Returns:
- whether the column was sized and positioned successfully
- See Also:
-
layoutRow
Lays out the given row. The layout index is necessary to identify the position of a row among the others (comes above/below). Positions the row atX: 0
andY: index * rowsHeight
.Sizes the row to be
W: virtualMaxX
andH: rowsHeight
.- See Also:
-
layoutCell
Lays out the given cell. The layout index is necessary to identify the position of a cell among the others (comes before/after).- See Also:
-
autosizeColumn
Determines and sets the ideal width for the given column, where 'ideal' means that the column's header as well as all the related cells' content will be fully visible.Note: for obvious reasons, the computation is done on the currently visible items!
-
autosizeColumns
void autosizeColumns()Depends on the implementation! -
visibleCells
int visibleCells()Depends on the implementation! -
totalCells
default int totalCells()- Returns:
- the total number of cells in the viewport which doesn't include only the number of visible cells but also the number of buffer cells
-
indexToRow
Converts the given index to a row. UsesitemToRow(Object)
. -
itemToRow
Converts the given item to a row. The result is either on of the rows cached inVFXCellsCache
that is updated with the given item, or a totally new one created by theVFXTable.rowFactoryProperty()
. -
getViewportHeight
default double getViewportHeight()- Returns:
- the viewport's height by taking into account the table's header height, which is given by
VFXTable.columnsSizeProperty()
-
isLastColumn
Checks whether the given column is the last inVFXTable.getColumns()
. Basically a shortcut fortable.getColumn().getLast() == column)
-
scrollBy
Scrolls in the viewport, in the given direction (orientation) by the given number of pixels. -
scrollToPixel
Scrolls in the viewport, in the given direction (orientation) to the given pixel value. -
scrollToIndex
Scrolls in the viewport, depending on the given direction (orientation) to:- the item at the given index if it's
Orientation.VERTICAL
- the column at the given index if it's
Orientation.HORIZONTAL
-