Class MegaMekLabUnitSelectorDialog

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
megamek.client.ui.dialogs.unitSelectorDialogs.AbstractUnitSelectorDialog
megameklab.ui.dialog.MegaMekLabUnitSelectorDialog
All Implemented Interfaces:
ActionListener, KeyListener, ImageObserver, MenuContainer, Serializable, Runnable, EventListener, Accessible, ListSelectionListener, RootPaneContainer, WindowConstants

public class MegaMekLabUnitSelectorDialog extends megamek.client.ui.dialogs.unitSelectorDialogs.AbstractUnitSelectorDialog
See Also:
  • Constructor Details

    • MegaMekLabUnitSelectorDialog

      public MegaMekLabUnitSelectorDialog(JFrame parent, megamek.client.ui.dialogs.UnitLoadingDialog unitLoadingDialog, boolean multiselect)
      Constructs a Unit Selector Dialog that only allows choosing with closing the dialog.
      Parameters:
      parent - The parent window of this dialog
      unitLoadingDialog - A UnitLoadingDialog likely new UnitLoadingDialog(parent).
      multiselect - Set this to true to allow multiple units to be selected at once.
    • MegaMekLabUnitSelectorDialog

      public MegaMekLabUnitSelectorDialog(JFrame parent, megamek.client.ui.dialogs.UnitLoadingDialog unitLoadingDialog, Consumer<MegaMekLabUnitSelectorDialog> entityPickCallback)
      Constructs a Unit Selector Dialog that allows choosing a Unit while keeping the dialog open by pressing Enter or the "Select" button. The entityPickCallback method will be called when units are selected in this way. Multiselect is always enabled.
      Parameters:
      parent - The parent window of this dialog
      unitLoadingDialog - A UnitLoadingDialog likely new UnitLoadingDialog(parent).
      entityPickCallback - This will be called when the user presses Select.
  • Method Details

    • updateOptionValues

      public void updateOptionValues()
      Specified by:
      updateOptionValues in class megamek.client.ui.dialogs.unitSelectorDialogs.AbstractUnitSelectorDialog
    • createButtonsPanel

      protected JPanel createButtonsPanel()
      Specified by:
      createButtonsPanel in class megamek.client.ui.dialogs.unitSelectorDialogs.AbstractUnitSelectorDialog
    • select

      protected void select(boolean close)
      Specified by:
      select in class megamek.client.ui.dialogs.unitSelectorDialogs.AbstractUnitSelectorDialog
    • getChosenEntity

      public megamek.common.units.Entity getChosenEntity()
      Returns:
      the chosenEntity
    • getChosenEntities

      public ArrayList<megamek.common.units.Entity> getChosenEntities()
    • refreshUnitView

      protected megamek.common.units.Entity refreshUnitView()
      Overrides:
      refreshUnitView in class megamek.client.ui.dialogs.unitSelectorDialogs.AbstractUnitSelectorDialog