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(String unitFileName)
    • loadFile

      public void loadFile(File unitFile)
    • loadFile

      public void loadFile(File unitFile, String entryName)
    • 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)
    • showTechLevelBreakdown

      public static void showTechLevelBreakdown(JFrame frame, @Nullable megamek.common.units.Entity entity, @Nullable megamek.common.interfaces.ITechManager techManager)
      Opens the composite tech level report for the given unit. The report is evaluated with the year, faction and Variable Tech Level setting of the given tech manager; when no tech manager is available, as for a unit loaded from the cache or from a file, the unit's own introduction year and tech faction are used together with the Variable Tech Level setting from the MegaMekLab configuration.
      Parameters:
      frame - The parent frame of the dialog
      entity - The unit to report on; nothing happens when this is null
      techManager - The tech manager of the unit being edited, or null when the unit is not being edited
    • viewForce

      public void viewForce()
    • loadForceFromFile

      public void loadForceFromFile()
    • addUnitToForce

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