Class Configurer

java.lang.Object
VASSAL.configure.Configurer
  • Field Details

    • NAME_PROPERTY

      public static final String NAME_PROPERTY
      See Also:
    • key

      protected String key
      A String the uniquely identifies this property
    • name

      protected String name
      A String that provides a short description of the property to the user
    • value

      protected Object value
      The value
    • changeSupport

      protected PropertyChangeSupport changeSupport
    • noUpdate

      protected boolean noUpdate
      When noUpdate is true, setting the value programmatically will not result in an update of the GUI Component
    • frozen

      protected boolean frozen
      When frozen is true, setting the value programmatically will not result in a PropertyChangeEvent being fired
    • hint

      protected String hint
      A Hint to be displayed in an empty field
    • LIST_ENTRY_HIGHLIGHT_COLOR

      public static final Color LIST_ENTRY_HIGHLIGHT_COLOR
      Default Highlight Color for Configurable Lists
    • contextLevel

      protected Configurer.ContextLevel contextLevel
    • context

      protected AbstractBuildable context
  • Constructor Details

  • Method Details

    • getKey

      public String getKey()
      Unique identifier
    • getName

      public String getName()
      Plain English description of the Object
    • setName

      public void setName(String s)
    • getValue

      public Object getValue()
      The Object value May be null if the Object has not been initialized
    • getValueString

      public abstract String getValueString()
      Returns:
      a String representation of the Object value
    • setValue

      public void setValue(Object o)
      Set the Object value
    • setFrozen

      public void setFrozen(boolean val)
      If true, then don't fire PropertyChangeEvents when the value is reset
    • isFrozen

      public boolean isFrozen()
    • fireUpdate

      public void fireUpdate()
      Fire a PropertyChangeEvent as if the value had been set from null
    • setValue

      public abstract void setValue(String s)
      Set the Object value from a String
    • getControls

      public abstract Component getControls()
      GUI interface for setting the option in an editing window
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener l)
      Add a listener to be notified when the Object state changes
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener l)
    • repack

      protected void repack()
      Repack the current configurer
    • repack

      protected void repack(Component controls)
      Repack a dialog or window
    • getScreenSize

      protected Dimension getScreenSize()
      Return the current screen size for use by List type configurers to allow them to take up maximum screen real estate if needed. The headless check is required in case any Configurers try to initialize during tests.
      Returns:
      Screen Size.
    • getHint

      public String getHint()
      Return the current hint String
      Returns:
      Current Hint String
    • setHint

      public void setHint(String hint)
      Set the Hint String
      Parameters:
      hint - New Hint string
    • setHintKey

      public void setHintKey(String hintKey)
      Set the Hint String via a I18n key
      Parameters:
      hintKey - I18n key for the hint
    • setLabelVisible

      public void setLabelVisible(boolean visible)
      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.
      Parameters:
      visible - Hide label if true
    • setLabelVisibile

      @Deprecated(since="2023-01-14", forRemoval=true) public void setLabelVisibile(boolean visible)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setHighlighted

      public void setHighlighted(boolean highlighted)
      Set the highlighted status of this configurer. It is up to individual Configurers to override this method and implement a suitable visual highlighting scheme Note: Cannot make this abstract as it will break custom code.
      Parameters:
      highlighted - New Highlighted status
    • isHighlighted

      public boolean isHighlighted()
      Return the current highlighted status
      Returns:
      Highlight status
    • addFocusListener

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

      public void removeFocusListener(FocusListener listener)
      Remove a FocusListener from the Swing Components that make up this Configurer.
      Parameters:
      listener - Focus Listener
    • requestFocus

      public void requestFocus()
      Move the cursor to the first input field of this Configurer
    • initCustomControls

      public void initCustomControls(JDialog d, Configurable target)
      Initialize any custom controls / keystrokes
    • setEnabled

      public void setEnabled(boolean enabled)
      Enable or Disable the action of this configurer/
      Parameters:
      enabled -
    • getContext

      public AbstractBuildable getContext()
      Get the Context for this Configurer
      Returns:
      Owning Configurable
    • setContext

      public void setContext(AbstractBuildable context)
      Set the Context for this Configurer to the first ancestor that is of type GameModule or Map NOTE: The ContextLevel may already have been preset by the ConfigureFactory when the Configurer was created. Don't let the AutoConfigurer over-write this
      Parameters:
      context - Owning Configurable
    • setContext

      public void setContext(Configurable context)
    • setContext

      public void setContext(Buildable context)
    • getContextLevel

      public Configurer.ContextLevel getContextLevel()
    • isPieceContext

      public boolean isPieceContext()
    • setContextLevel

      public void setContextLevel(Configurer.ContextLevel contextLevel)