Class BooleanConfigurer

java.lang.Object
VASSAL.configure.Configurer
VASSAL.configure.BooleanConfigurer

public class BooleanConfigurer extends Configurer
Configurer for Boolean values
  • Field Details

  • Constructor Details

    • BooleanConfigurer

      public BooleanConfigurer(String key, String name, Boolean val)
      Create an old-style configurer with inbuilt label
      Parameters:
      key - Configurer key
      name - Label text
      val - Initial value
    • BooleanConfigurer

      public BooleanConfigurer(String key, String name, boolean val)
      Create an old-style configurer with inbuilt label
      Parameters:
      key - Configurer key
      name - Label text
      val - Initial value
    • BooleanConfigurer

      public BooleanConfigurer(String key, String name)
      Create an old-style configurer with inbuilt label
      Parameters:
      key - Configurer key
      name - Label text
    • BooleanConfigurer

      public BooleanConfigurer(Boolean val)
      Create a new-style labeless configurer
      Parameters:
      val - Initial value
    • BooleanConfigurer

      public BooleanConfigurer(boolean val)
      Create a new-style labeless configurer
      Parameters:
      val - Initial value
  • Method Details

    • getValueString

      public String getValueString()
      Specified by:
      getValueString in class Configurer
      Returns:
      a String representation of the Object value
    • getValueBoolean

      public boolean getValueBoolean()
    • setValue

      public void setValue(Object o)
      Description copied from class: Configurer
      Set the Object value
      Overrides:
      setValue in class Configurer
    • setValue

      public void setValue(String s)
      Description copied from class: Configurer
      Set the Object value from a String
      Specified by:
      setValue in class Configurer
    • setName

      public void setName(String s)
      Overrides:
      setName in class Configurer
    • getControls

      public Component getControls()
      Description copied from class: Configurer
      GUI interface for setting the option in an editing window
      Specified by:
      getControls in class Configurer
    • addFocusListener

      public void addFocusListener(FocusListener listener)
      Description copied from class: Configurer
      Add a FocusListener to the Swing Components that make up this Configurer.
      Overrides:
      addFocusListener in class Configurer
      Parameters:
      listener - Focus Listener
    • removeFocusListener

      public void removeFocusListener(FocusListener listener)
      Description copied from class: Configurer
      Remove a FocusListener from the Swing Components that make up this Configurer.
      Overrides:
      removeFocusListener in class Configurer
      Parameters:
      listener - Focus Listener
    • booleanValue

      public Boolean booleanValue()
    • setEnabled

      public void setEnabled(boolean enabled)
      Description copied from class: Configurer
      Enable or Disable the action of this configurer/
      Overrides:
      setEnabled in class Configurer
      Parameters:
      enabled -
    • setLabelVisible

      public void setLabelVisible(boolean visible)
      Description copied from class: Configurer
      Show/Hide the internal label maintained by this Configurer. It is up to individual Configurers to track and hide the label (if they can). This method is currently only utilized by the Preference configs PrefsEditor.addOption(String, Configurer) to extract an existing label in a configurer, display correctly aligned and suppress the original label. This keeps compatibility with custom module code setting up preferences. This method only needs to be implemented in Configurers that are added as preferences.
      Overrides:
      setLabelVisible in class Configurer
      Parameters:
      visible - Hide label if true