Package com.j3d.gen.settings.types
Class DoubleSetting
- All Implemented Interfaces:
EventEmitterInterface,SettingsChild
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDoubleSetting(String name, Double value, String description, double min, double max) -
Method Summary
Modifier and TypeMethodDescriptionfromString(String str) Converts a string representation back to the setting's type.doublegetMax()doublegetMin()onSetValue(Function<Double, Void> callback) Registers a callback function to be executed whenever the setting's value is changed.panel()Returns the panel associated with this setting for display and interaction.voidSets the value of this setting and broadcasts an update event.Methods inherited from class com.j3d.gen.settings.Setting
attachListener, broadcast, deserialize, detachAll, detachListener, getDefaultValue, getDescription, getName, getValue, isAttached, serialize, setValueNoBroadcast, valueToStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.j3d.gen.settings.SettingsChild
serializedName
-
Field Details
-
min
private final double min -
max
private final double max -
toInt
-
toDouble
-
stepSize
private double stepSize
-
-
Constructor Details
-
DoubleSetting
-
-
Method Details
-
setValues
-
fromString
Description copied from class:SettingConverts a string representation back to the setting's type.- Overrides:
fromStringin classSetting<Double>- Parameters:
str- The string to convert.- Returns:
- The value of type T parsed from the string.
-
getMin
public double getMin() -
getMax
public double getMax() -
setValue
Description copied from class:SettingSets the value of this setting and broadcasts an update event. -
panel
Description copied from class:SettingReturns the panel associated with this setting for display and interaction.- Specified by:
panelin interfaceSettingsChild- Overrides:
panelin classSetting<Double>- Returns:
- A UI component representing this setting, or
nullif not implemented by a subclass.
-
onSetValue
Description copied from class:SettingRegisters a callback function to be executed whenever the setting's value is changed. The callback receives the new value as an argument.- Overrides:
onSetValuein classSetting<Double>- Parameters:
callback- TheFunctionto be called on value change.- Returns:
- This
Settinginstance, allowing for method chaining.
-