Package dev.boze.api.option
Class SliderOption
- All Implemented Interfaces:
Serializable<Double>
A numeric option that can be adjusted using a slider
SliderOption provides a way to store and modify numeric values within a specified range
The value is always clamped between min and max, and can only be set in increments of step
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal doubleThe maximum value this slider can be set tofinal doubleThe minimum value this slider can be set tofinal doubleThe increment by which this slider's value changesFields inherited from class dev.boze.api.option.Option
description, name, owner -
Constructor Summary
ConstructorsConstructorDescriptionSliderOption(BaseModule owner, String name, String description, double value, double min, double max, double step) Creates a new slider optionSliderOption(BaseModule owner, String name, String description, double value, double min, double max, double step, Option<?> parent) Creates a new slider option with a parent -
Method Summary
Methods inherited from class dev.boze.api.option.Option
getFullName, getParent, isParent, setParent
-
Field Details
-
min
public final double minThe minimum value this slider can be set to -
max
public final double maxThe maximum value this slider can be set to -
step
public final double stepThe increment by which this slider's value changes
-
-
Constructor Details
-
SliderOption
public SliderOption(BaseModule owner, String name, String description, double value, double min, double max, double step) Creates a new slider option- Parameters:
owner- The module that owns this optionname- The name of this optiondescription- The description of this optionvalue- The initial valuemin- The minimum allowed valuemax- The maximum allowed valuestep- The increment between values
-
SliderOption
public SliderOption(BaseModule owner, String name, String description, double value, double min, double max, double step, Option<?> parent) Creates a new slider option with a parent- Parameters:
owner- The module that owns this optionname- The name of this optiondescription- The description of this optionvalue- The initial valuemin- The minimum allowed valuemax- The maximum allowed valuestep- The increment between valuesparent- The parent option, or null if this is a root option
-
-
Method Details
-
getValue
Description copied from class:OptionGets the current value of this option -
setValue
Description copied from class:OptionSets the value of this option -
reset
Description copied from class:OptionResets this option to its default value -
toJson
public com.google.gson.JsonObject toJson()- Returns:
- The object as a JsonObject
-
fromJson
- Parameters:
object- The JsonObject to deserialize- Returns:
- The deserialized object
-