Class ComplexSetting<T>
java.lang.Object
com.j3d.gen.settings.Setting<T>
com.j3d.gen.settings.types.ComplexSetting<T>
- All Implemented Interfaces:
EventEmitterInterface, SettingsChild
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final TriFunction<ActionEvent, JLabel, PopoutSPanel<T>, T> -
Constructor Summary
ConstructorsConstructorDescriptionComplexSetting(String name, T value, String description, TriFunction<ActionEvent, JLabel, PopoutSPanel<T>, T> onOpen, Supplier<String> onCreate) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(ArrayList<String> leftover) Deserializes the setting's value from a list of strings.fromString(String str) Converts a string representation back to the setting's type.voidopen()panel()Returns the panel associated with this setting for display and interaction.Serializes the current setting into a list of strings.valueToString(T value) Converts the setting's value to its string representation.Methods inherited from class Setting
attachListener, broadcast, detachAll, detachListener, getDefaultValue, getDescription, getName, getValue, isAttached, onSetValue, setValue, setValueNoBroadcastMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SettingsChild
serializedName
-
Field Details
-
onOpen
-
onCreate
-
isSerializable
private boolean isSerializable -
forward
-
backward
-
-
Constructor Details
-
ComplexSetting
public ComplexSetting(String name, T value, String description, TriFunction<ActionEvent, JLabel, PopoutSPanel<T>, T> onOpen, Supplier<String> onCreate)
-
-
Method Details
-
serializable
-
getOnCreate
-
fromString
-
valueToString
-
deserialize
Description copied from class:SettingDeserializes the setting's value from a list of strings. It searches for a string containing the serialized name of this setting, parses its value, and updates the setting. If no match is found or parsing fails, the setting is reset to its default value.- Specified by:
deserializein interfaceSettingsChild- Overrides:
deserializein classSetting<T>- Parameters:
leftover- AnArrayListof strings from which to deserialize the setting.
-
serialize
Description copied from class:SettingSerializes the current setting into a list of strings. For a single setting, this typically returns a list containing one string in the format "settingName = settingValue". -
panel
-
open
public void open()
-