Package com.j3d.gen.settings.types
Class IntSetting
- All Implemented Interfaces:
EventEmitterInterface,SettingsChild
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIntSetting(String name, Integer value, String description, int min, int max) -
Method Summary
Modifier and TypeMethodDescriptionfromString(String str) Converts a string representation back to the setting's type.intgetMax()intgetMin()onSetValue(Function<Integer, 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 int min -
max
private final int max
-
-
Constructor Details
-
IntSetting
-
-
Method Details
-
getMin
public int getMin() -
getMax
public int getMax() -
setValue
Description copied from class:SettingSets the value of this setting and broadcasts an update event. -
fromString
Description copied from class:SettingConverts a string representation back to the setting's type.- Overrides:
fromStringin classSetting<Integer>- Parameters:
str- The string to convert.- Returns:
- The value of type T parsed from the string.
-
panel
Description copied from class:SettingReturns the panel associated with this setting for display and interaction.- Specified by:
panelin interfaceSettingsChild- Overrides:
panelin classSetting<Integer>- 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<Integer>- Parameters:
callback- TheFunctionto be called on value change.- Returns:
- This
Settinginstance, allowing for method chaining.
-