Class MegaMekLabFileSaver

java.lang.Object
megameklab.ui.util.MegaMekLabFileSaver

public class MegaMekLabFileSaver extends Object
  • Constructor Details

    • MegaMekLabFileSaver

      public MegaMekLabFileSaver(megamek.logging.MMLogger mainLogger, String dialogTitle)
  • Method Details

    • createUnitFilename

      public static String createUnitFilename(megamek.common.units.Entity entity)
      Constructs a file name for the current Entity using the chassis and model name and the correct extension for the unit type. Any character that is not legal for a Windows filename is replaced by an underscore.
      Parameters:
      entity - The Entity
      Returns:
      A default filename for the Entity
    • saveUnit

      public String saveUnit(JFrame ownerFrame, FileNameManager fileNameManager, megamek.common.units.Entity entity)
      Tries to save the unit directly to its file, if it has a filename already. If it hasn't, it performs a Save As...
    • saveUnitAs

      public String saveUnitAs(JFrame ownerFrame, megamek.common.units.Entity entity)