Interface VFXContainerHelper<T, C extends Region & VFXContainer<T>>

All Known Subinterfaces:
VFXGridHelper<T,C>, VFXListHelper<T,C>, VFXPaginatedListHelper<T,C>, VFXTableHelper<T>
All Known Implementing Classes:
VFXContainerHelper.VFXContainerHelperBase, VFXGridHelper.DefaultHelper, VFXListHelper.AbstractHelper, VFXListHelper.HorizontalHelper, VFXListHelper.VerticalHelper, VFXPaginatedListHelper.HorizontalHelper, VFXPaginatedListHelper.VerticalHelper, VFXTableHelper.AbstractHelper, VFXTableHelper.FixedTableHelper, VFXTableHelper.VariableTableHelper

public interface VFXContainerHelper<T, C extends Region & VFXContainer<T>>
Base API for all helpers used in virtualized containers.

Groups common properties, computations and utilities, minimizing redundancy and improving maintainability.

  • Property Details

  • Method Details

    • getVirtualMaxX

      default double getVirtualMaxX()
      Returns:
      the total number of pixels on the x-axis.
    • virtualMaxXProperty

      ReadOnlyDoubleProperty virtualMaxXProperty()
      Specifies the total number of pixels on the x-axis.
      Returns:
      the virtualMaxX property
      See Also:
    • getVirtualMaxY

      default double getVirtualMaxY()
      Returns:
      the total number of pixels on the y-axis.
    • virtualMaxYProperty

      ReadOnlyDoubleProperty virtualMaxYProperty()
      Specifies the total number of pixels on the y-axis.
      Returns:
      the virtualMaxY property
      See Also:
    • getMaxVScroll

      default double getMaxVScroll()
      Returns:
      the maximum possible vertical position.
    • maxVScrollProperty

      ReadOnlyDoubleProperty maxVScrollProperty()
      Specifies the maximum possible vertical position.
      Returns:
      the maxVScroll property
      See Also:
    • getMaxHScroll

      default double getMaxHScroll()
      Returns:
      the maximum possible horizontal position.
    • maxHScrollProperty

      ReadOnlyDoubleProperty maxHScrollProperty()
      Specifies the maximum possible horizontal position.
      Returns:
      the maxHScroll property
      See Also:
    • getViewportPosition

      default io.github.palexdev.mfxcore.base.beans.Position getViewportPosition()
      Returns:
      the position the viewport should be at in the container
    • viewportPositionProperty

      ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Position> viewportPositionProperty()
      Cells are actually contained in a separate pane called 'viewport'. The scroll is applied on this pane.

      This property specifies the translation of the viewport, the value depends on the implementation.

      Returns:
      the viewportPosition property
      See Also:
    • getContainer

      C getContainer()
      Returns:
      the VFXContainer implementation instance associated to this helper
    • invalidatePos

      default void invalidatePos()
      Forces the VFXContainer.vPosProperty() and VFXContainer.hPosProperty() to be invalidated.

      This is simply done by calling the respective setters with their current respective values. Those two properties will automatically call getMaxVScroll() and getMaxHScroll() to ensure the values are correct.

      Automatically invoked when needed.

    • invalidateVirtualSizes

      void invalidateVirtualSizes()
      Implementations should define the logic to manually invalidate the virtual sizes (virtualMaxXProperty() and virtualMaxYProperty()) of the container when needed.

      There are exceptional cases where we can't rely on automatic invalidation because it could lead to incorrect states, the easiest and most stable solution for those is manual invalidation.

    • indexToItem

      default T indexToItem(int index)
      Converts the given index to an item (shortcut for getContainer().getItems().get(index)).
    • dispose

      default void dispose()
      If the helper uses listeners/bindings that may lead to memory leaks, this is the right place to remove them.