Class ScenarioChooserDialog

All Implemented Interfaces:
WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class ScenarioChooserDialog extends AbstractButtonDialog
This dialog lists all scenarios found in MM's scenario directory as well as the corresponding user directory. The scenarios are grouped by subdirectory (only the one directly below scenarios, further subdirectories are scanned for scenarios but not used for grouping). After closing, a chosen scenario can be retrieved by calling getSelectedScenarioFilename(). As a fallback, the dialog also allows choosing a scenario by file.
See Also:
  • Constructor Details

    • ScenarioChooserDialog

      public ScenarioChooserDialog(JFrame parentFrame)
  • Method Details

    • getSelectedScenarioFilename

      @Nullable public String getSelectedScenarioFilename()
      Returns:
      the selected preset, or null if the dialog was cancelled or no preset was selected
    • createCenterPane

      protected Container createCenterPane()
      Description copied from class: AbstractDialog
      This is used to create the dialog's center pane
      Specified by:
      createCenterPane in class AbstractDialog
      Returns:
      the center pane of the dialog
    • createButtonPanel

      protected JPanel createButtonPanel()
      Overrides:
      createButtonPanel in class AbstractButtonDialog
      Returns:
      the created Button Panel