Class PreferencesNode

java.lang.Object
megamek.client.ui.preferences.PreferencesNode

public class PreferencesNode extends Object
Represents a group of PreferenceElements that are part of the same Class.

This class is not thread-safe.

  • Constructor Details

    • PreferencesNode

      public PreferencesNode(Class<?> node)
  • Method Details

    • getNode

      public Class<?> getNode()
    • getElements

      public Map<String,PreferenceElement> getElements()
    • getInitialValues

      public Map<String,String> getInitialValues()
    • setInitialValues

      public void setInitialValues(Map<String,String> initialValues)
    • isInitialized

      public boolean isInitialized()
    • setInitialized

      public void setInitialized(boolean initialized)
    • isFinalized

      public boolean isFinalized()
    • setFinalized

      public void setFinalized(boolean finalized)
    • manage

      public void manage(PreferenceElement... elements)
      Adds new elements to be managed by this node. If there are initial values set for this node, we will try to set an initial value for each element.
      Parameters:
      elements - the elements to manage.
    • initialize

      public void initialize(Map<String,String> initialValues) throws Exception
      Sets the initial values for elements managed for this node. This method should only be called once.
      Parameters:
      initialValues - the initial values for the elements.
      Throws:
      Exception - if initialization has already occurred
    • getFinalValues

      public Map<String,String> getFinalValues() throws Exception
      This method should only be called once.
      Returns:
      the final values of all the elements managed by this node.
      Throws:
      Exception - if this method is called a second time