Package megameklab.ui.util
Class MegaMekLabFileSaver
java.lang.Object
megameklab.ui.util.MegaMekLabFileSaver
-
Constructor Summary
ConstructorsConstructorDescriptionMegaMekLabFileSaver(megamek.logging.MMLogger mainLogger, String dialogTitle) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateUnitFilename(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.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.saveUnitAs(JFrame ownerFrame, megamek.common.units.Entity entity)
-
Constructor Details
-
MegaMekLabFileSaver
-
-
Method Details
-
createUnitFilename
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
-