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 classAbstract implementation ofVFXTableHelper, contains common members for the two concrete implementationsVFXTableHelper.FixedTableHelperandVFXTableHelper.VariableTableHelper, such as:static classConcrete implementation ofVFXTableHelper.AbstractHelperforColumnsLayoutMode.FIXED.static classConcrete implementation ofVFXTableHelper.AbstractHelperforColumnsLayoutMode.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 TypeMethodDescriptionvoidautosizeColumn(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.voidDepends on the implementation!default io.github.palexdev.mfxcore.base.beans.range.IntegerRangeReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> Specifies the range of columns that should be present in the viewport.intintfirstRow()doublegetColumnPos(int layoutIdx, VFXTableColumn<T, ?> column) doublegetColumnWidth(VFXTableColumn<T, ?> column) default doubledefault VFXTableRow<T> indexToRow(int index) Converts the given index to a row.booleanisInViewport(VFXTableColumn<T, ?> column) default booleanisLastColumn(VFXTableColumn<T, ?> column) Checks whether the given column is the last inVFXTable.getColumns().default VFXTableRow<T> Converts the given item to a row.intintlastRow()booleanlayoutCell(int layoutIdx, VFXTableCell<T> cell) Lays out the given cell.booleanlayoutColumn(int layoutIdx, VFXTableColumn<T, ?> column) Lays out the given column.default voidlayoutRow(int layoutIdx, VFXTableRow<T> row) Lays out the given row.default io.github.palexdev.mfxcore.base.beans.range.IntegerRangeReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.range.NumberRange<Integer>> Specifies the range of rows that should be present in the viewport.default voidscrollBy(Orientation orientation, double pixels) Scrolls in the viewport, in the given direction (orientation) by the given number of pixels.voidscrollToIndex(Orientation orientation, int index) Scrolls in the viewport, depending on the given direction (orientation) to:default voidscrollToPixel(Orientation orientation, double pixel) Scrolls in the viewport, in the given direction (orientation) to the given pixel value.default intintintintDepends on the implementation!intintMethods 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
columnsRangeproperty
-
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
rowsRangeproperty
-
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: 0andY: index * rowsHeight.Sizes the row to be
W: virtualMaxXandH: 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 inVFXCellsCachethat 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
-