Package megameklab.ui

Class StartupGUI

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
megamek.client.ui.widget.SkinnedJPanel
megameklab.ui.StartupGUI
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, MenuBarOwner, AppCloser

public class StartupGUI extends megamek.client.ui.widget.SkinnedJPanel implements MenuBarOwner
A startup splash screen for MegaMekLab
See Also:
  • Method Details

    • handleDpiChange

      public void handleDpiChange()
      Handles DPI changes
    • hasInstance

      public static boolean hasInstance()
      Checks if the StartupGUI instance is already created.
    • getInstance

      public static StartupGUI getInstance()
      Returns the instance of the StartupGUI. If it does not exist, it creates a new one.
      Returns:
      The instance of the StartupGUI.
    • setVisible

      public void setVisible(boolean aFlag)
      Overrides:
      setVisible in class JComponent
    • selectAndLoadUnitFromCache

      public static void selectAndLoadUnitFromCache(MenuBarOwner previousFrame)
      Shows the Unit Selector Window and loads the unit if the user selects one. When the chosen unit fits the MageMekLabMainUI given as previousFrame this frame will be kept and updated to the chosen unit, otherwise, a new UI will be created for the unit and previousFrame will be closed and disposed.
      Parameters:
      previousFrame - The active frame before loading a new unit; can be the StartupGUI or any MegaMekLabMainUI.
    • getFrame

      public JFrame getFrame()
      Specified by:
      getFrame in interface MenuBarOwner
      Returns:
      A frame of this menubar owner to use as a parent for dialogs.
    • getEntity

      public megamek.common.units.Entity getEntity()
      Specified by:
      getEntity in interface MenuBarOwner
      Returns:
      The entity currently worked on or null.
    • getFileName

      public String getFileName()
      Specified by:
      getFileName in interface MenuBarOwner
      Returns:
      The file name of the currently worked on unit or an empty String.
    • hasEntityNameChanged

      public boolean hasEntityNameChanged()
      Specified by:
      hasEntityNameChanged in interface MenuBarOwner
      Returns:
      True if the entity's name has changed since load.
    • refreshMenuBar

      public void refreshMenuBar()
      Description copied from interface: MenuBarOwner
      Refreshes the menu bar. Updates the recent units in the File menu.
      Specified by:
      refreshMenuBar in interface MenuBarOwner
    • getMMLMenuBar

      public MenuBar getMMLMenuBar()
      Specified by:
      getMMLMenuBar in interface MenuBarOwner