Record Class ScrollParams
- Record Components:
amount- the base scroll value, interpreted based on theunittrackMultiplier- a multiplier applied to the unit increment to compute the track increment the default value is:DEFAULT_TRACK_MULTIPLIERunit- the unit of measurement that determines how theamountis interpreted
VFXScrollPane,
including the scroll amount, track multiplier, and unit of measurement.
Provides a consistent way to apply or bind scrolling increments to a scroll pane, using either fixed values or dynamically computed ones.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleDefault multiplier applied to compute the track increment from the unit increment. -
Constructor Summary
ConstructorsConstructorDescriptionScrollParams(double amount, double trackMultiplier, ScrollUnits unit) Creates an instance of aScrollParamsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleamount()Returns the value of theamountrecord component.voidapply(VFXScrollPane vsp, Orientation orientation) Applies the scroll parameters to the given scroll pane in the specified orientation.voidbind(VFXScrollPane vsp, Orientation orientation) Binds the scroll parameters to the given scroll pane in the specified orientation.static ScrollParamscells(double count) Shortcut fornew ScrollParams(count, DEFAULT_TRACK_MULTIPLIER, ScrollUnits.CELL).final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static ScrollParamspercentage(double frac) Shortcut fornew ScrollParams(count, DEFAULT_TRACK_MULTIPLIER, ScrollUnits.PERCENTAGE).static ScrollParamspixels(double px) Shortcut fornew ScrollParams(count, DEFAULT_TRACK_MULTIPLIER, ScrollUnits.PIXELS).final StringtoString()Returns a string representation of this record class.doubleReturns the value of thetrackMultiplierrecord component.unit()Returns the value of theunitrecord component.withTrackMultiplier(double trackMultiplier)
-
Field Details
-
DEFAULT_TRACK_MULTIPLIER
public static final double DEFAULT_TRACK_MULTIPLIERDefault multiplier applied to compute the track increment from the unit increment.Used by all factory methods unless a custom multiplier is provided manually or set afterward using
withTrackMultiplier(double).- See Also:
-
-
Constructor Details
-
ScrollParams
Creates an instance of aScrollParamsrecord class.- Parameters:
amount- the value for theamountrecord componenttrackMultiplier- the value for thetrackMultiplierrecord componentunit- the value for theunitrecord component
-
-
Method Details
-
cells
Shortcut fornew ScrollParams(count, DEFAULT_TRACK_MULTIPLIER, ScrollUnits.CELL). -
percentage
Shortcut fornew ScrollParams(count, DEFAULT_TRACK_MULTIPLIER, ScrollUnits.PERCENTAGE). -
pixels
Shortcut fornew ScrollParams(count, DEFAULT_TRACK_MULTIPLIER, ScrollUnits.PIXELS). -
apply
Applies the scroll parameters to the given scroll pane in the specified orientation.Sets the unit and track increment as raw values, based on the calculated scroll percentage. No bindings are used — values are evaluated once and applied directly.
The track increment is obtained by multiplying the found unit increment by thetrackMultipliervalue. -
bind
Binds the scroll parameters to the given scroll pane in the specified orientation.Creates bindings that automatically update the unit and track increments when any relevant dependencies change (e.g., content bounds, cell size).
The dependencies are determined by the chosen scroll unit, seeScrollUnits.deps(VFXScrollPane, Orientation).If the scroll unit declares no dependencies, this method falls back to
The track increment properties are bound to the relative unit increment property and multiplied by theapply(io.github.palexdev.virtualizedfx.controls.VFXScrollPane, javafx.geometry.Orientation).trackMultipliervalue. -
withTrackMultiplier
- Returns:
- a new
ScrollParamsinstance with the same amount and unit, but with the specifiedtrackMultiplier
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
amount
-
trackMultiplier
public double trackMultiplier()Returns the value of thetrackMultiplierrecord component.- Returns:
- the value of the
trackMultiplierrecord component
-
unit
-