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
Groups common properties, computations and utilities, minimizing redundancy and improving maintainability.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classVFXContainerHelper.VFXContainerHelperBase<T, C extends Region & VFXContainer<T>>Abstract implementation ofVFXContainerHelper. -
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. -
Method Summary
Modifier and TypeMethodDescriptiondefault voiddispose()If the helper uses listeners/bindings that may lead to memory leaks, this is the right place to remove them.default doubledefault doubledefault io.github.palexdev.mfxcore.base.beans.Positiondefault doubledefault doubledefault TindexToItem(int index) Converts the given index to an item (shortcut forgetContainer().getItems().get(index)).default voidForces theVFXContainer.vPosProperty()andVFXContainer.hPosProperty()to be invalidated.voidImplementations should define the logic to manually invalidate the virtual sizes (virtualMaxXProperty()andvirtualMaxYProperty()) 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.
-
Property Details
-
virtualMaxX
ReadOnlyDoubleProperty virtualMaxXPropertySpecifies the total number of pixels on the x-axis.- See Also:
-
virtualMaxY
ReadOnlyDoubleProperty virtualMaxYPropertySpecifies the total number of pixels on the y-axis.- See Also:
-
maxVScroll
ReadOnlyDoubleProperty maxVScrollPropertySpecifies the maximum possible vertical position.- See Also:
-
maxHScroll
ReadOnlyDoubleProperty maxHScrollPropertySpecifies the maximum possible horizontal position.- See Also:
-
viewportPosition
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
ReadOnlyDoubleProperty virtualMaxXProperty()Specifies the total number of pixels on the x-axis.- Returns:
- the
virtualMaxXproperty - 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
virtualMaxYproperty - See Also:
-
getMaxVScroll
default double getMaxVScroll()- Returns:
- the maximum possible vertical position.
-
maxVScrollProperty
ReadOnlyDoubleProperty maxVScrollProperty()Specifies the maximum possible vertical position.- Returns:
- the
maxVScrollproperty - See Also:
-
getMaxHScroll
default double getMaxHScroll()- Returns:
- the maximum possible horizontal position.
-
maxHScrollProperty
ReadOnlyDoubleProperty maxHScrollProperty()Specifies the maximum possible horizontal position.- Returns:
- the
maxHScrollproperty - 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
viewportPositionproperty - See Also:
-
getContainer
C getContainer()- Returns:
- the
VFXContainerimplementation 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.
-