Class VFXTableSkin<T>

java.lang.Object
javafx.scene.control.SkinBase<VFXTable<T>>
io.github.palexdev.mfxcore.controls.SkinBase<VFXTable<T>,VFXTableManager<T>>
io.github.palexdev.virtualizedfx.table.VFXTableSkin<T>
All Implemented Interfaces:
javafx.scene.control.Skin<VFXTable<T>>

public class VFXTableSkin<T> extends io.github.palexdev.mfxcore.controls.SkinBase<VFXTable<T>,VFXTableManager<T>>
Default skin implementation for VFXTable, extends SkinBase and expects behaviors of type VFXTableManager.

The table is organized in columns, rows and cells. This architecture leads to more complex layout compared to other containers because it comprises many more nodes. The 'viewport' node wraps two Panes:

1) one contains the table's columns, can be selected in CSS as '.columns'

2) the other contains the rows, can be selected in CSS as '.rows'

The table's height and the viewport height are different here. The latter is given by the table's height minus the columns pane height, specified by VFXTable.columnsSizeProperty(). The rows are given by the VFXTable.stateProperty() and depends on the viewport's height. Each column produces one cell per row. Columns and cells are kept aligned by the layout methods defined in VFXTableHelper.

Q: Why so many nodes?

A: scrolling in a table is a bit peculiar because: vertical scrolling should affect only the rows, while horizontal scrolling should affect both rows and columns. For such reason, a clip node is set on the rows container and avoids rows overflow on vertical scroll.

As all skins typically do, this is also responsible for catching any change in the component's properties. The computation that leads to a new state is delegated to the controller/behavior, which is the VFXTableManager. Read this addListeners() to check which changes are handled.

Last but not least, by design, this skin makes the component always be at least 100px tall and wide. You can change this by overriding the DEFAULT_SIZE variable.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Adds listeners on the component's properties which need to produce a new VFXTableState upon changing.
    protected double
    computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
     
    protected double
    computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
     
    void
     
    protected void
     
    protected void
    This method redefines the viewport node layout.
    protected void
    This is responsible for sizing and positioning the columns specified by the current VFXTableState.getColumnsRange().
    protected void
    This is responsible for sizing and positioning both the rows and their cells.
    protected void
    onLayoutCompleted(boolean done)
    This must be called after processing a ViewportLayoutRequest to reset the VFXTable.needsViewportLayoutProperty() to ViewportLayoutRequest.NULL.
    protected void
    There are certain situations in which it's not necessary to re-compute the whole table layout, but it's enough to only compute it partially, starting from a specific column.
    protected void
    updateColumnIndex(VFXTableColumn<T,?> column, int index)
    This can be called during layout or other operations to update the given column's VFXTableColumn.indexProperty() to the given index.

    Methods inherited from class io.github.palexdev.mfxcore.controls.SkinBase

    computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, events, getBehavior, listeners

    Methods inherited from class javafx.scene.control.SkinBase

    computeBaselineOffset, computeMaxHeight, computeMaxWidth, computePrefHeight, computePrefWidth, consumeMouseEvents, executeAccessibleAction, getChildren, getClassCssMetaData, getCssMetaData, getNode, getSkinnable, layoutChildren, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, queryAccessibleAttribute, registerChangeListener, registerInvalidationListener, registerListChangeListener, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, unregisterChangeListeners, unregisterInvalidationListeners, unregisterListChangeListeners

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface javafx.scene.control.Skin

    install