Enum Class ScrollUnits
- All Implemented Interfaces:
Serializable
,Comparable<ScrollUnits>
,Constable
VFXScrollPane
.
Scroll units are used to convert a logical amount (e.g., 3 cells, 100 pixels) into a percentage value
in the range [0.0, 1.0]
, which is then applied to the scroll pane.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionScrolls by a number of cells/rows/columns, depending on the orientation.Scrolls by a percentage of the total scrollable area.Scrolls by a fixed number of pixels. -
Method Summary
Modifier and TypeMethodDescriptioncalc
(VFXScrollPane vsp, double amount, Orientation orientation) Calculates the scroll amount as a percentage value in[0.0, 1.0]
, based on the given unit type.abstract ObservableValue<?>[]
deps
(VFXScrollPane vsp, Orientation orientation) Lists observable properties that should be watched when using this unit in a binding context.static ScrollUnits
Returns the enum constant of this class with the specified name.static ScrollUnits[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CELL
Scrolls by a number of cells/rows/columns, depending on the orientation. This unit is only valid when the scroll pane's content is an instance ofVFXContainer
. The pixel size of each cell/row/column is multiplied by the specified amount and then converted into a percentage relative to the container's max scroll value (VFXContainer.maxVScrollProperty()
orVFXContainer.maxHScrollProperty()
). Binding dependencies include the container's scroll bounds and its cell size property. -
PERCENTAGE
Scrolls by a percentage of the total scrollable area.This is the simplest unit, no conversion is performed. Because of that, bindings for this unit are ignored and fallback to a standard apply.
Use this when you want to directly specify the exact scroll delta in percentage terms.
-
PIXELS
Scrolls by a fixed number of pixels.The specified pixel amount is converted into a percentage based on the scrollable content's size and the scroll pane's viewport size. If the content is a
Binding dependencies include either virtual scroll bounds or layout bounds, depending on content type.VFXContainer
, its virtualized scroll bounds are used. Otherwise, the scrollable extent is derived from the layout bounds.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
calc
Calculates the scroll amount as a percentage value in[0.0, 1.0]
, based on the given unit type. Theorientation
parameters specifies the axis on which select the properties. E.g: VERTICAL -> height, HORIZONTAL -> width -
deps
Lists observable properties that should be watched when using this unit in a binding context.An empty array indicates that the binding is not necessary and should be ignored. This is the case of
PERCENTAGE
.
-