Class VFXContainerHelper.VFXContainerHelperBase<T, C extends Region & VFXContainer<T>>
- All Implemented Interfaces:
VFXContainerHelper<T,
C>
- Direct Known Subclasses:
VFXGridHelper.DefaultHelper
,VFXListHelper.AbstractHelper
,VFXTableHelper.AbstractHelper
- Enclosing interface:
VFXContainerHelper<T, C extends Region & VFXContainer<T>>
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.palexdev.virtualizedfx.base.VFXContainerHelper
VFXContainerHelper.VFXContainerHelperBase<T, C extends Region & VFXContainer<T>>
-
Property Summary
PropertiesTypePropertyDescriptionSpecifies the maximum possible horizontal position.Specifies the maximum possible vertical position.ReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.Position> Cells are actually contained in a separate pane called 'viewport'.Specifies the total number of pixels on the x-axis.Specifies the total number of pixels on the y-axis. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected C
protected final ReadOnlyDoubleWrapper
protected final ReadOnlyDoubleWrapper
protected final io.github.palexdev.mfxcore.base.properties.PositionProperty
protected final ReadOnlyDoubleWrapper
protected final ReadOnlyDoubleWrapper
protected DoubleBinding
protected DoubleBinding
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected DoubleBinding
Builds and returns the binding which computes themaxHScrollProperty()
's value.protected DoubleBinding
Builds and returns the binding which computes themaxVScrollProperty()
's value.protected abstract DoubleBinding
Implementations should use this build and return theDoubleBinding
with the appropriate dependencies responsible for thevirtualMaxXProperty()
's value.protected abstract DoubleBinding
Implementations should use this build and return theDoubleBinding
with the appropriate dependencies responsible for thevirtualMaxXProperty()
's value.void
dispose()
If the helper uses listeners/bindings that may lead to memory leaks, this is the right place to remove them.void
Implementations should define the logic to manually invalidate the virtual sizes (VFXContainerHelper.virtualMaxXProperty()
andVFXContainerHelper.virtualMaxYProperty()
) of the container when needed.Specifies the maximum possible horizontal position.Specifies the maximum possible vertical position.ReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.Position> Cells are actually contained in a separate pane called 'viewport'.Specifies the total number of pixels on the x-axis.Specifies the total number of pixels on the y-axis.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.palexdev.virtualizedfx.base.VFXContainerHelper
getMaxHScroll, getMaxVScroll, getViewportPosition, getVirtualMaxX, getVirtualMaxY, indexToItem, invalidatePos
-
Property Details
-
virtualMaxX
- Specified by:
virtualMaxXProperty
in interfaceVFXContainerHelper<T, C extends Region & VFXContainer<T>>
- Returns:
- the
virtualMaxX
property - See Also:
-
virtualMaxY
- Specified by:
virtualMaxYProperty
in interfaceVFXContainerHelper<T, C extends Region & VFXContainer<T>>
- Returns:
- the
virtualMaxY
property - See Also:
-
maxVScroll
- Specified by:
maxVScrollProperty
in interfaceVFXContainerHelper<T, C extends Region & VFXContainer<T>>
- Returns:
- the
maxVScroll
property - See Also:
-
maxHScroll
- Specified by:
maxHScrollProperty
in interfaceVFXContainerHelper<T, C extends Region & VFXContainer<T>>
- Returns:
- the
maxHScroll
property - See Also:
-
viewportPosition
public ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Position> viewportPositionProperty- Specified by:
viewportPositionProperty
in interfaceVFXContainerHelper<T, C extends Region & VFXContainer<T>>
- Returns:
- the
viewportPosition
property - See Also:
-
-
Field Details
-
container
-
virtualMaxX
-
vmxBinding
-
virtualMaxY
-
vmyBinding
-
maxVScroll
-
maxHScroll
-
viewportPosition
protected final io.github.palexdev.mfxcore.base.properties.PositionProperty viewportPosition
-
-
Constructor Details
-
VFXContainerHelperBase
-
-
Method Details
-
createBindings
protected void createBindings() -
createVirtualMaxXBinding
Implementations should use this build and return theDoubleBinding
with the appropriate dependencies responsible for thevirtualMaxXProperty()
's value. -
createVirtualMaxYBinding
Implementations should use this build and return theDoubleBinding
with the appropriate dependencies responsible for thevirtualMaxXProperty()
's value. -
createMaxVScrollBinding
Builds and returns the binding which computes themaxVScrollProperty()
's value.For most containers the value is given by:
virtualMaxY - containerHeight
.The formula may vary for some containers!
-
createMaxHScrollBinding
Builds and returns the binding which computes themaxHScrollProperty()
's value.For most containers the value is given by:
virtualMaxX - containerWidth
.The formula may vary for some containers!
-
virtualMaxXProperty
Description copied from interface:VFXContainerHelper
Specifies the total number of pixels on the x-axis.- Specified by:
virtualMaxXProperty
in interfaceVFXContainerHelper<T, C extends Region & VFXContainer<T>>
- Returns:
- the
virtualMaxX
property - See Also:
-
virtualMaxYProperty
Description copied from interface:VFXContainerHelper
Specifies the total number of pixels on the y-axis.- Specified by:
virtualMaxYProperty
in interfaceVFXContainerHelper<T, C extends Region & VFXContainer<T>>
- Returns:
- the
virtualMaxY
property - See Also:
-
maxVScrollProperty
Description copied from interface:VFXContainerHelper
Specifies the maximum possible vertical position.- Specified by:
maxVScrollProperty
in interfaceVFXContainerHelper<T, C extends Region & VFXContainer<T>>
- Returns:
- the
maxVScroll
property - See Also:
-
maxHScrollProperty
Description copied from interface:VFXContainerHelper
Specifies the maximum possible horizontal position.- Specified by:
maxHScrollProperty
in interfaceVFXContainerHelper<T, C extends Region & VFXContainer<T>>
- Returns:
- the
maxHScroll
property - See Also:
-
viewportPositionProperty
public 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 interfaceVFXContainerHelper<T, C extends Region & VFXContainer<T>>
- Returns:
- the
viewportPosition
property - See Also:
-
getContainer
- Specified by:
getContainer
in interfaceVFXContainerHelper<T, C extends 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()
andVFXContainerHelper.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 interfaceVFXContainerHelper<T, C extends 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 interfaceVFXContainerHelper<T, C extends Region & VFXContainer<T>>
-