Interface VFXContainerHelper<T,C extends javafx.scene.layout.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 javafx.scene.layout.Region & VFXContainer<T>>
Base API for all helpers used in virtualized containers.
Groups common properties, computations and utilities, minimizing redundancy and improving maintainability.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
VFXContainerHelper.VFXContainerHelperBase<T,
C extends javafx.scene.layout.Region & VFXContainer<T>> Abstract implementation ofVFXContainerHelper
. -
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ReadOnlyDoubleProperty
Specifies the maximum possible horizontal position.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the maximum possible vertical position.javafx.beans.property.ReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.Position> Cells are actually contained in a separate pane called 'viewport'.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the total number of pixels on the x-axis.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the total number of pixels on the y-axis. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
dispose()
If the helper uses listeners/bindings that may lead to memory leaks, this is the right place to remove them.default double
default double
default io.github.palexdev.mfxcore.base.beans.Position
default double
default double
default T
indexToItem
(int index) Converts the given index to an item (shortcut forgetContainer().getItems().get(index)
).default void
Forces theVFXContainer.vPosProperty()
andVFXContainer.hPosProperty()
to be invalidated.void
Implementations should define the logic to manually invalidate the virtual sizes (virtualMaxXProperty()
andvirtualMaxYProperty()
) of the container when needed.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the maximum possible horizontal position.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the maximum possible vertical position.javafx.beans.property.ReadOnlyObjectProperty
<io.github.palexdev.mfxcore.base.beans.Position> Cells are actually contained in a separate pane called 'viewport'.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the total number of pixels on the x-axis.javafx.beans.property.ReadOnlyDoubleProperty
Specifies the total number of pixels on the y-axis.
-
Property Details
-
virtualMaxX
javafx.beans.property.ReadOnlyDoubleProperty virtualMaxXPropertySpecifies the total number of pixels on the x-axis.- See Also:
-
virtualMaxY
javafx.beans.property.ReadOnlyDoubleProperty virtualMaxYPropertySpecifies the total number of pixels on the y-axis.- See Also:
-
maxVScroll
javafx.beans.property.ReadOnlyDoubleProperty maxVScrollPropertySpecifies the maximum possible vertical position.- See Also:
-
maxHScroll
javafx.beans.property.ReadOnlyDoubleProperty maxHScrollPropertySpecifies the maximum possible horizontal position.- See Also:
-
viewportPosition
javafx.beans.property.ReadOnlyObjectProperty<io.github.palexdev.mfxcore.base.beans.Position> viewportPositionPropertyCells 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.
- See Also:
-
-
Method Details
-
getVirtualMaxX
default double getVirtualMaxX()- Returns:
- the total number of pixels on the x-axis.
-
virtualMaxXProperty
javafx.beans.property.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
javafx.beans.property.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
javafx.beans.property.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
javafx.beans.property.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
javafx.beans.property.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 theVFXContainer.vPosProperty()
andVFXContainer.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()
andgetMaxHScroll()
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()
andvirtualMaxYProperty()
) 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
Converts the given index to an item (shortcut forgetContainer().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.
-