Class EnumSetting<T extends Enum>

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

public class EnumSetting<T extends Enum> extends Setting<T>
  • Field Details

    • values

      private final T extends Enum[] values
  • Constructor Details

    • EnumSetting

      public EnumSetting(String name, T value, String description, T[] values)
  • Method Details

    • 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 extends Enum>
      Parameters:
      str - The string to convert.
      Returns:
      The value of type T parsed from the string.
    • getValues

      public T[] getValues()
    • panel

      public ButtonGroupSPanel 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 extends Enum>
      Returns:
      A UI component representing this setting, or null if not implemented by a subclass.
    • onSetValue

      public EnumSetting<T> onSetValue(Function<T,Void> callback)
      Description copied from class: Setting
      Registers a callback function to be executed whenever the setting's value is changed. The callback receives the new value as an argument.
      Overrides:
      onSetValue in class Setting<T extends Enum>
      Parameters:
      callback - The Function to be called on value change.
      Returns:
      This Setting instance, allowing for method chaining.