Class ScenarioOptions

java.lang.Object
VASSAL.build.module.properties.ScenarioOptions
All Implemented Interfaces:
GameComponent

public class ScenarioOptions extends Object implements GameComponent
A free-standing class to display the combined Scenario options
  • Field Details

    • dialog

      protected JDialog dialog
    • optionTabs

      protected final JTabbedPane optionTabs
    • openAction

      protected Action openAction
    • launch

      protected JButton launch
    • globalProperties

      protected GlobalProperties globalProperties
      Parent Global Properties component
  • Constructor Details

  • Method Details

    • setInstance

      public static void setInstance(ScenarioOptions options)
    • getInstance

      public static ScenarioOptions getInstance()
    • toggleVisible

      protected void toggleVisible()
    • getDialog

      public JDialog getDialog()
      Create the top-level dialog, but don't populate any tabs or options yet, this is done just before display in case we are Editing and making changes, and to allow for roll-back management if user clicks cancel
      Returns:
      generated dialog
    • getOpenAction

      public Action getOpenAction()
    • getLaunchButton

      public JButton getLaunchButton()
    • processChanges

      protected void processChanges()
      OK Button has been clicked, loop tabs and generate and combine actions for any that have changed.
    • cancel

      protected void cancel()
      Close button clicked. No change to underlying properties yet, so just close the dialog, it will be rebuilt showing the old values when next opened.
    • open

      protected void open()
    • setup

      public void setup(boolean gameStarting)
      Description copied from interface: GameComponent
      Notify the GameComponent that a game has started/ended
      Specified by:
      setup in interface GameComponent
      Parameters:
      gameStarting - if true, a game is starting. If false, then a game is ending
    • getRestoreCommand

      public Command getRestoreCommand()
      Description copied from interface: GameComponent
      When saving a game, each GameComponent should return a Command that, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return null
      Specified by:
      getRestoreCommand in interface GameComponent
    • hasScenarioOptions

      protected boolean hasScenarioOptions()
      Return true if there is at least one ScenarioOption defined
    • rebuild

      protected void rebuild()