Class VFXGridSkin<T,C extends VFXCell<T>>

java.lang.Object
javafx.scene.control.SkinBase<VFXGrid<T,C>>
io.github.palexdev.mfxcore.controls.SkinBase<VFXGrid<T,C>,VFXGridManager<T,C>>
io.github.palexdev.virtualizedfx.grid.VFXGridSkin<T,C>
All Implemented Interfaces:
javafx.scene.control.Skin<VFXGrid<T,C>>

public class VFXGridSkin<T,C extends VFXCell<T>> extends io.github.palexdev.mfxcore.controls.SkinBase<VFXGrid<T,C>,VFXGridManager<T,C>>
Default skin implementation for VFXGrid, extends SkinBase and expects behaviors of type VFXGridManager.

The layout is quite simple: there is just one node, called the 'viewport', that is the Pane resposnible for containing and laying out the cells. Needless to say, the layout strategy is custom, and it's defined in the layout() method.

Compared to other virtualized components' skin, this implements a rather unique feature. It allows you, by setting the VFXGrid.alignmentProperty(), to change the x and y coordinates of the viewport node. This is especially useful if you want the content to be centered and in combination with VFXGrid.autoArrange(int) (think about a gallery, for example).

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 VFXGridManager. 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
     
    protected final javafx.scene.layout.Pane
     
  • 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 VFXGridState 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
    Core method responsible for resizing and positioning cells in the viewport.
    protected void
    layoutChildren(double x, double y, double w, double h)
     
    protected void
    onLayoutCompleted(boolean done)
    This method is crucial because it resets the VFXGrid.needsViewportLayoutProperty() to false.

    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, 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