Package megameklab.ui

Class ForceBuildUI

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ListSelectionListener, RootPaneContainer, WindowConstants

public class ForceBuildUI extends JFrame implements ListSelectionListener, ActionListener
See Also:
  • Method Details

    • getInstance

      public static ForceBuildUI getInstance()
      Gets the singleton instance of the ForceBuildWindow. Creates the instance if it doesn't exist.
      Returns:
      The singleton ForceBuildWindow instance.
    • hasInstance

      public static boolean hasInstance()
      Verify if the singleton instance of ForceBuildWindow exists.
      Returns:
      The singleton ForceBuildWindow instance.
    • showAndAddEntity

      public static void showAndAddEntity(megamek.common.units.Entity entity)
      Gets/creates the singleton instance, adds an entity to it, and ensures it's visible.
      Parameters:
      entity - The entity to add.
    • getForceSize

      public static int getForceSize()
      Gets the size of the force list.
    • getTableModel

      public DefaultTableModel getTableModel()
    • getDialogResources

      public static ResourceBundle getDialogResources()
    • showWindow

      public static void showWindow()
      Gets/creates the singleton instance and ensures it's visible.
    • getGame

      public megamek.common.game.Game getGame()
    • clear

      public void clear()
    • addEntity

      public void addEntity(megamek.common.units.Entity entityToAdd)
      Adds an entity to the force list and updates the table.
    • removeEntity

      public void removeEntity(megamek.common.units.Entity entity)
    • removeEntityById

      public void removeEntityById(int index)
    • removeAllEntities

      public void removeAllEntities()
    • refresh

      public static void refresh()
      Updates the table and total BV label.
    • getAllEntities

      public ArrayList<megamek.common.units.Entity> getAllEntities()
      Gets the list of all entities in the force.
    • selectAndLoadUnitFromCache

      public void selectAndLoadUnitFromCache()
    • selectAndLoadUnitFromFile

      public void selectAndLoadUnitFromFile()
    • valueChanged

      public void valueChanged(ListSelectionEvent event)
      Specified by:
      valueChanged in interface ListSelectionListener
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener