Package megameklab.ui

Class MenuBar

All Implemented Interfaces:
ClipboardOwner, ImageObserver, MenuContainer, Serializable, Accessible, MenuElement

public class MenuBar extends JMenuBar implements ClipboardOwner
See Also:
  • Field Details

    • loadImageFileChooser

      public final MMLFileChooser loadImageFileChooser
  • Constructor Details

  • Method Details

    • getUnitMainUi

      @Nullable public MegaMekLabMainUI getUnitMainUi()
      Returns the unit main UI, if this menubar is attached to one (instead of the StartupGUI aka splash screen), null otherwise. Under the Tabbed UI, returns the main UI for the currently selected tab.
      Returns:
      The unit main UI of this menubar or null
    • saveUnitAs

      public void saveUnitAs()
    • saveUnit

      public void saveUnit()
    • refreshEditMenu

      public void refreshEditMenu()
      * Refreshes the state of the Edit menu items based on the current state of the active editor.
    • loadUnitFromFile

      public void loadUnitFromFile(int fileNumber)
    • loadFile

      public void loadFile(File unitFile)
    • lostOwnership

      public void lostOwnership(Clipboard arg0, Transferable arg1)
      Specified by:
      lostOwnership in interface ClipboardOwner
    • refreshMenuBar

      public void refreshMenuBar()
      Refreshes this menubar to show options relevant to the currently selected unit.
    • importSettings

      public void importSettings()
      Performs a settings import, currently only for the megameklab.properties file (CConfig). Shows a help message before showing a file chooser for selecting a directory. The directory should always be MML's main directory (which contains the mmconf directory with the megameklab.properties file).
    • showUnitWeightBreakDown

      public static void showUnitWeightBreakDown(megamek.common.units.Entity entity, JFrame frame)
    • showBVCalculations

      public static void showBVCalculations(JFrame frame, @Nullable megamek.common.units.Entity entity)
    • viewForce

      public void viewForce()
    • addUnitToForce

      public void addUnitToForce(megamek.common.units.Entity entity)