Class VFXContainerHelper.VFXContainerHelperBase<T,C extends javafx.scene.layout.Region & VFXContainer<T>>

java.lang.Object
io.github.palexdev.virtualizedfx.base.VFXContainerHelper.VFXContainerHelperBase<T,C>
All Implemented Interfaces:
VFXContainerHelper<T,C>
Direct Known Subclasses:
VFXGridHelper.DefaultHelper, VFXListHelper.AbstractHelper, VFXTableHelper.AbstractHelper
Enclosing interface:
VFXContainerHelper<T,C extends javafx.scene.layout.Region & VFXContainer<T>>

public abstract static class VFXContainerHelper.VFXContainerHelperBase<T,C extends javafx.scene.layout.Region & VFXContainer<T>> extends Object implements VFXContainerHelper<T,C>
Abstract implementation of VFXContainerHelper.

This is the recommended class onto which base concrete helpers.

Stores the virtualized container's instance, defines common properties and thus implementing some of the APIs from VFXContainerHelper, and in addition defines some other APIs that should be hidden and known only to its implementations.

  • Property Details

  • Field Details

    • container

      protected C extends javafx.scene.layout.Region & VFXContainer<T> container
    • virtualMaxX

      protected final javafx.beans.property.ReadOnlyDoubleWrapper virtualMaxX
    • vmxBinding

      protected javafx.beans.binding.DoubleBinding vmxBinding
    • virtualMaxY

      protected final javafx.beans.property.ReadOnlyDoubleWrapper virtualMaxY
    • vmyBinding

      protected javafx.beans.binding.DoubleBinding vmyBinding
    • maxVScroll

      protected final javafx.beans.property.ReadOnlyDoubleWrapper maxVScroll
    • maxHScroll

      protected final javafx.beans.property.ReadOnlyDoubleWrapper maxHScroll
    • viewportPosition

      protected final io.github.palexdev.mfxcore.base.properties.PositionProperty viewportPosition
  • Constructor Details

    • VFXContainerHelperBase

      protected VFXContainerHelperBase(C container)
  • Method Details

    • createBindings

      protected void createBindings()
    • createVirtualMaxXBinding

      protected abstract javafx.beans.binding.DoubleBinding createVirtualMaxXBinding()
      Implementations should use this build and return the DoubleBinding with the appropriate dependencies responsible for the virtualMaxXProperty()'s value.
    • createVirtualMaxYBinding

      protected abstract javafx.beans.binding.DoubleBinding createVirtualMaxYBinding()
      Implementations should use this build and return the DoubleBinding with the appropriate dependencies responsible for the virtualMaxXProperty()'s value.
    • createMaxVScrollBinding

      protected javafx.beans.binding.DoubleBinding createMaxVScrollBinding()
      Builds and returns the binding which computes the maxVScrollProperty()'s value.

      For most containers the value is given by: virtualMaxY - containerHeight.

      The formula may vary for some containers!

    • createMaxHScrollBinding

      protected javafx.beans.binding.DoubleBinding createMaxHScrollBinding()
      Builds and returns the binding which computes the maxHScrollProperty()'s value.

      For most containers the value is given by: virtualMaxX - containerWidth.

      The formula may vary for some containers!

    • virtualMaxXProperty

      public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXProperty()
      Description copied from interface: VFXContainerHelper
      Specifies the total number of pixels on the x-axis.
      Specified by:
      virtualMaxXProperty in interface VFXContainerHelper<T,C extends javafx.scene.layout.Region & VFXContainer<T>>
      Returns:
      the virtualMaxX property
      See Also:
    • virtualMaxYProperty

      public javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYProperty()
      Description copied from interface: VFXContainerHelper
      Specifies the total number of pixels on the y-axis.
      Specified by:
      virtualMaxYProperty in interface VFXContainerHelper<T,C extends javafx.scene.layout.Region & VFXContainer<T>>
      Returns:
      the virtualMaxY property
      See Also:
    • maxVScrollProperty

      public javafx.beans.property.ReadOnlyDoubleProperty maxVScrollProperty()
      Description copied from interface: VFXContainerHelper
      Specifies the maximum possible vertical position.
      Specified by:
      maxVScrollProperty in interface VFXContainerHelper<T,C extends javafx.scene.layout.Region & VFXContainer<T>>
      Returns:
      the maxVScroll property
      See Also:
    • maxHScrollProperty

      public javafx.beans.property.ReadOnlyDoubleProperty maxHScrollProperty()
      Description copied from interface: VFXContainerHelper
      Specifies the maximum possible horizontal position.
      Specified by:
      maxHScrollProperty in interface VFXContainerHelper<T,C extends javafx.scene.layout.Region & VFXContainer<T>>
      Returns:
      the maxHScroll property
      See Also:
    • viewportPositionProperty

      public javafx.beans.property.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Position> viewportPositionProperty()
      Description copied from interface: VFXContainerHelper
      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.

      Specified by:
      viewportPositionProperty in interface VFXContainerHelper<T,C extends javafx.scene.layout.Region & VFXContainer<T>>
      Returns:
      the viewportPosition property
      See Also:
    • getContainer

      public C getContainer()
      Specified by:
      getContainer in interface VFXContainerHelper<T,C extends javafx.scene.layout.Region & VFXContainer<T>>
      Returns:
      the VFXContainer implementation instance associated to this helper
    • invalidateVirtualSizes

      public void invalidateVirtualSizes()
      Description copied from interface: VFXContainerHelper
      Implementations should define the logic to manually invalidate the virtual sizes (VFXContainerHelper.virtualMaxXProperty() and VFXContainerHelper.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.

      Specified by:
      invalidateVirtualSizes in interface VFXContainerHelper<T,C extends javafx.scene.layout.Region & VFXContainer<T>>
    • dispose

      public void dispose()
      Description copied from interface: VFXContainerHelper
      If the helper uses listeners/bindings that may lead to memory leaks, this is the right place to remove them.
      Specified by:
      dispose in interface VFXContainerHelper<T,C extends javafx.scene.layout.Region & VFXContainer<T>>