Class MMLForceBuilderRandomArmyDialog

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

public class MMLForceBuilderRandomArmyDialog extends AbstractRandomArmyDialog
This Random Army Dialog is shown in MML's force builder UI. It allows generating armies and adding them to the force. It can be used by other callers that can supply a consumer for a list of Entities.
See Also:
  • Constructor Details

    • MMLForceBuilderRandomArmyDialog

      public MMLForceBuilderRandomArmyDialog(JFrame parent, Consumer<List<Entity>> consumer)
      Creates a random army dialog for the given parent frame. It has an "Add to force" button; when pressed, the given consumer is called to accept the presently generated list of units and the dialog is closed.
      Parameters:
      parent - A parent frame for the dialog
      consumer - A method that processes a generated unit list
  • Method Details

    • createButtonsPanel

      protected JComponent createButtonsPanel()
      Description copied from class: AbstractRandomArmyDialog
      Override to add buttons or other components to the bottom of the dialog. The returned component is added when setVisible(true) is called for the first time; it is added as BorderLayout.SOUTH and is therefore stretched to the width of the dialog.
      Specified by:
      createButtonsPanel in class AbstractRandomArmyDialog
      Returns:
      A button panel for the dialog