Interface VFXTableHelper<T>

All Superinterfaces:
VFXContainerHelper<T, VFXTable<T>>
All Known Implementing Classes:
VFXTableHelper.AbstractHelper, VFXTableHelper.FixedTableHelper, VFXTableHelper.VariableTableHelper

public interface VFXTableHelper<T> extends VFXContainerHelper<T, VFXTable<T>>
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.
  • Property Details

  • 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, see visibleColumns() and totalColumns().
      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() and totalColumns()
    • 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, see visibleRows() and totalRows().
      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() and totalRows().
    • getColumnWidth

      double getColumnWidth(VFXTableColumn<T,?> column)
      Returns:
      the width for the given column
    • getColumnPos

      double getColumnPos(int layoutIdx, VFXTableColumn<T,?> column)
      Returns:
      the x position for the given column and its layout index in the viewport
    • isInViewport

      boolean isInViewport(VFXTableColumn<T,?> column)
      Returns:
      whether the given column is currently visible in the viewport
    • layoutColumn

      boolean layoutColumn(int layoutIdx, VFXTableColumn<T,?> column)
      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

      default void layoutRow(int layoutIdx, VFXTableRow<T> row)
      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 at X: 0 and Y: index * rowsHeight.

      Sizes the row to be W: virtualMaxX and H: rowsHeight.

      See Also:
    • layoutCell

      boolean layoutCell(int layoutIdx, VFXTableCell<T> cell)
      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

      void 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.

      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

      default VFXTableRow<T> indexToRow(int index)
      Converts the given index to a row. Uses itemToRow(Object).
    • itemToRow

      default VFXTableRow<T> itemToRow(T item)
      Converts the given item to a row. The result is either on of the rows cached in VFXCellsCache that is updated with the given item, or a totally new one created by the VFXTable.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

      default boolean isLastColumn(VFXTableColumn<T,?> column)
      Checks whether the given column is the last in VFXTable.getColumns(). Basically a shortcut for table.getColumn().getLast() == column)
    • scrollBy

      default void scrollBy(Orientation orientation, double pixels)
      Scrolls in the viewport, in the given direction (orientation) by the given number of pixels.
    • scrollToPixel

      default void scrollToPixel(Orientation orientation, double pixel)
      Scrolls in the viewport, in the given direction (orientation) to the given pixel value.
    • scrollToIndex

      void scrollToIndex(Orientation orientation, int index)
      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