Class ComplexSetting<T>

java.lang.Object
com.j3d.gen.settings.Setting<T>
com.j3d.gen.settings.types.ComplexSetting<T>
All Implemented Interfaces:
EventEmitterInterface, SettingsChild

public class ComplexSetting<T> extends Setting<T>
  • Field Details

  • Constructor Details

  • Method Details

    • serializable

      public ComplexSetting<T> serializable(Function<T,String> forward, Function<String,T> backward)
    • getOnCreate

      public Supplier<String> getOnCreate()
    • fromString

      public T fromString(String str)
      Description copied from class: Setting
      Converts a string representation back to the setting's type.
      Overrides:
      fromString in class Setting<T>
      Parameters:
      str - The string to convert.
      Returns:
      The value of type T parsed from the string.
    • valueToString

      public String valueToString(T value)
      Description copied from class: Setting
      Converts the setting's value to its string representation.
      Overrides:
      valueToString in class Setting<T>
      Parameters:
      value - The value to convert to a string.
      Returns:
      The string representation of the value.
    • deserialize

      public void deserialize(ArrayList<String> leftover)
      Description copied from class: Setting
      Deserializes 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:
      deserialize in interface SettingsChild
      Overrides:
      deserialize in class Setting<T>
      Parameters:
      leftover - An ArrayList of strings from which to deserialize the setting.
    • serialize

      public ArrayList<String> serialize()
      Description copied from class: Setting
      Serializes 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".
      Specified by:
      serialize in interface SettingsChild
      Overrides:
      serialize in class Setting<T>
      Returns:
      An ArrayList of strings representing the serialized setting.
    • panel

      public PopoutSPanel<T> panel()
      Description copied from class: Setting
      Returns the panel associated with this setting for display and interaction.
      Specified by:
      panel in interface SettingsChild
      Overrides:
      panel in class Setting<T>
      Returns:
      A UI component representing this setting, or null if not implemented by a subclass.
    • open

      public void open()