diff --git a/megameklab/src/megameklab/printing/CGLMassPrinter.java b/megameklab/src/megameklab/printing/CGLMassPrinter.java index b908f0273..02f05e8e3 100644 --- a/megameklab/src/megameklab/printing/CGLMassPrinter.java +++ b/megameklab/src/megameklab/printing/CGLMassPrinter.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/src/megameklab/printing/PageBreak.java b/megameklab/src/megameklab/printing/PageBreak.java index 3a0241fce..b7aece16b 100644 --- a/megameklab/src/megameklab/printing/PageBreak.java +++ b/megameklab/src/megameklab/printing/PageBreak.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/src/megameklab/printing/PrintUtil.java b/megameklab/src/megameklab/printing/PrintUtil.java index dc31a7826..cc902cac7 100644 --- a/megameklab/src/megameklab/printing/PrintUtil.java +++ b/megameklab/src/megameklab/printing/PrintUtil.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,9 +41,9 @@ public static boolean isPrintableEquipment(EquipmentType eq) { * simple method to let us know if eq should be printed on the weapons and * equipment section of the Record sheet. * - * @param eq The equipment to test The equipment + * @param eq The equipment to test The equipment * @param entity The Entity it's mounted on - * @return Whether the equipment should be shown on the record sheet + * @return Whether the equipment should be shown on the record sheet */ public static boolean isPrintableEquipment(EquipmentType eq, Entity entity) { if (eq instanceof AmmoType) { @@ -59,9 +59,9 @@ public static boolean isPrintableEquipment(EquipmentType eq, Entity entity) { * simple method to let us know if eq should be printed on the weapons and * equipment section of the Record sheet. * - * @param eq The equipment to test The equipment + * @param eq The equipment to test The equipment * @param isMek Whether the equipment is mounted on a Mek - * @return Whether the equipment should be shown on the record sheet + * @return Whether the equipment should be shown on the record sheet */ public static boolean isPrintableEquipment(EquipmentType eq, boolean isMek) { if (UnitUtil.isArmorOrStructure(eq)) { @@ -92,9 +92,9 @@ public static boolean isPrintableEquipment(EquipmentType eq, boolean isMek) { || eq.hasFlag(MiscType.F_MASS) || eq.hasFlag(MiscType.F_CHASSIS_MODIFICATION) || eq.hasFlag(MiscType.F_SPONSON_TURRET)) - || eq.hasFlag(MiscType.F_EXTERNAL_STORES_HARDPOINT) - || eq.hasFlag(MiscType.F_BASIC_FIRECONTROL) - || eq.hasFlag(MiscType.F_ADVANCED_FIRECONTROL)) { + || eq.hasFlag(MiscType.F_EXTERNAL_STORES_HARDPOINT) + || eq.hasFlag(MiscType.F_BASIC_FIRECONTROL) + || eq.hasFlag(MiscType.F_ADVANCED_FIRECONTROL)) { return false; } @@ -105,7 +105,8 @@ public static boolean isPrintableEquipment(EquipmentType eq, boolean isMek) { return true; } - private PrintUtil() { } + private PrintUtil() { + } /** * simple method to let us know if eq should be printed on the weapons and diff --git a/megameklab/src/megameklab/ui/EntitySource.java b/megameklab/src/megameklab/ui/EntitySource.java index 3b57ad2ee..bb976f0d3 100644 --- a/megameklab/src/megameklab/ui/EntitySource.java +++ b/megameklab/src/megameklab/ui/EntitySource.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/src/megameklab/ui/EquipmentToolTip.java b/megameklab/src/megameklab/ui/EquipmentToolTip.java index 70d7096d3..d4e04034b 100644 --- a/megameklab/src/megameklab/ui/EquipmentToolTip.java +++ b/megameklab/src/megameklab/ui/EquipmentToolTip.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/src/megameklab/ui/battleArmor/BACriticalSuit.java b/megameklab/src/megameklab/ui/battleArmor/BACriticalSuit.java index 39fcd1548..ff00dfae1 100644 --- a/megameklab/src/megameklab/ui/battleArmor/BACriticalSuit.java +++ b/megameklab/src/megameklab/ui/battleArmor/BACriticalSuit.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/src/megameklab/ui/dialog/UiLoader.java b/megameklab/src/megameklab/ui/dialog/UiLoader.java index fcab271b8..7a774eff0 100644 --- a/megameklab/src/megameklab/ui/dialog/UiLoader.java +++ b/megameklab/src/megameklab/ui/dialog/UiLoader.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2019, 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,7 +44,8 @@ import megameklab.util.UnitUtil; /** - * This class prepares a new editing UI for either a given Entity or an Entity type (new unit). While + * This class prepares a new editing UI for either a given Entity or an Entity + * type (new unit). While * preparation runs, a splash screen is shown. * * @author Taharqa @@ -58,8 +59,7 @@ public class UiLoader { private static final TreeMap LOAD_SCREEN_IMAGES = new TreeMap<>(Map.of( 0, Configuration.miscImagesDir() + "/mml_load_spooky_hd.jpg", 1441, Configuration.miscImagesDir() + "/mml_load_spooky_fhd.jpg", - 1921, Configuration.miscImagesDir() + "/mml_load_spooky_uhd.jpg" - )); + 1921, Configuration.miscImagesDir() + "/mml_load_spooky_uhd.jpg")); private static final ResourceBundle RESOURCES = ResourceBundle.getBundle("megameklab.resources.Menu"); private final JDialog splashImage; @@ -99,11 +99,14 @@ public static void loadUi(long type, boolean primitive, boolean industrial) { } /** - * @param type - the unit type to load the mainUI from, based on the types in StartupGUI.java + * @param type - the unit type to load the mainUI from, based on the types + * in StartupGUI.java * @param primitive - is unit primitive * @param industrial - is unit industrial - * @param newUnit - a specific Entity to load in rather than default - * @param fileName - the file name of the new unit; empty String if the unit has no file + * @param newUnit - a specific Entity to load in rather than + * default + * @param fileName - the file name of the new unit; empty String if the unit + * has no file */ private UiLoader(long type, boolean primitive, boolean industrial, Entity newUnit, String fileName) { this.type = type; @@ -119,7 +122,10 @@ private UiLoader(long type, boolean primitive, boolean industrial, Entity newUni splashImage.setLocationRelativeTo(null); } - /** Shows the splash image, hides the calling frame and starts loading the new unit's UI. */ + /** + * Shows the splash image, hides the calling frame and starts loading the new + * unit's UI. + */ public void show() { splashImage.setVisible(true); SwingUtilities.invokeLater(this::loadNewUi); @@ -138,7 +144,10 @@ private void loadNewUi() { splashImage.dispose(); } - /** @return The correct MainUI for an Entity of the given type (ETYPE_xxx), primitive and industrial flag. */ + /** + * @return The correct MainUI for an Entity of the given type (ETYPE_xxx), + * primitive and industrial flag. + */ public static MegaMekLabMainUI getUI(long type, boolean primitive, boolean industrial) { if (type == Entity.ETYPE_TANK) { return new CVMainUI(); diff --git a/megameklab/src/megameklab/ui/generalUnit/RecordSheetPreviewPanel.java b/megameklab/src/megameklab/ui/generalUnit/RecordSheetPreviewPanel.java index ed47e0f52..5623baeaa 100644 --- a/megameklab/src/megameklab/ui/generalUnit/RecordSheetPreviewPanel.java +++ b/megameklab/src/megameklab/ui/generalUnit/RecordSheetPreviewPanel.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,11 +48,10 @@ import megameklab.printing.RecordSheetOptions; import megameklab.util.UnitPrintManager; - /** * @author pavelbraginskiy * - * Simply fills itself with the record sheet for the given unit. + * Simply fills itself with the record sheet for the given unit. */ public class RecordSheetPreviewPanel extends JPanel { private class RightClickListener extends MouseAdapter { @@ -68,7 +67,7 @@ private class RightClickListener extends MouseAdapter { Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new Transferable() { @Override public DataFlavor[] getTransferDataFlavors() { - return new DataFlavor[] {DataFlavor.imageFlavor}; + return new DataFlavor[] { DataFlavor.imageFlavor }; } @Override @@ -119,24 +118,22 @@ private void paintComponent(Graphics2D g, int width, int height) { g.setBackground(Color.WHITE); g.clearRect(0, 0, width, height); - if (entity != null) { RecordSheetOptions options = new RecordSheetOptions(); PrintRecordSheet sheet = UnitPrintManager.createSheets(List.of(entity), true, options).get(0); // 5-pixel margin around rs - // Except for SmallUnitSheets which have weird clipping issues with nonstandard margin + // Except for SmallUnitSheets which have weird clipping issues with nonstandard + // margin PageFormat pf = new PageFormat(); if (sheet instanceof PrintSmallUnitSheet) { pf.setPaper(options.getPaperSize().createPaper()); sheet.createDocument(0, pf, false); - } - else { + } else { pf.setPaper(options.getPaperSize().createPaper(5, 5, 5, 5)); sheet.createDocument(0, pf, true); } - GraphicsNode gn = sheet.build(); // Scale record sheet to the size of the panel diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/AmmoSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/AmmoSummaryItem.java index 3fa5259e3..812ed8875 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/AmmoSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/AmmoSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/CockpitSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/CockpitSummaryItem.java index 722a65eef..6462c5cbb 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/CockpitSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/CockpitSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/CrewSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/CrewSummaryItem.java index 44bded2b4..04c28fa8f 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/CrewSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/CrewSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,4 +37,4 @@ public void refresh(Entity entity) { weightLabel.setText(formatWeight(testAero.getWeightQuarters(), entity)); } } -} \ No newline at end of file +} diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/GravDeckSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/GravDeckSummaryItem.java index 80c85adf7..90831e606 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/GravDeckSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/GravDeckSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,10 +18,10 @@ */ package megameklab.ui.generalUnit.summary; - import megamek.common.Entity; - import megamek.common.Jumpship; - import megamek.common.verifier.TestAdvancedAerospace; - import megameklab.util.UnitUtil; +import megamek.common.Entity; +import megamek.common.Jumpship; +import megamek.common.verifier.TestAdvancedAerospace; +import megameklab.util.UnitUtil; public class GravDeckSummaryItem extends AbstractSummaryItem { @@ -37,4 +37,4 @@ public void refresh(Entity entity) { weightLabel.setText(formatWeight(testShip.getWeightGravDecks(), entity)); } } -} \ No newline at end of file +} diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/HardpointSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/HardpointSummaryItem.java index e63792f22..38d53ada9 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/HardpointSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/HardpointSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,4 +37,4 @@ public void refresh(Entity entity) { weightLabel.setText(formatWeight(testShip.getWeightHardpoints(), entity)); } } -} \ No newline at end of file +} diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/KfDriveSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/KfDriveSummaryItem.java index 10ae007fb..0338b3709 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/KfDriveSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/KfDriveSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,4 +37,4 @@ public void refresh(Entity entity) { weightLabel.setText(formatWeight(testShip.getWeightKFDrive(), entity)); } } -} \ No newline at end of file +} diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/LfBatterySummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/LfBatterySummaryItem.java index f8f6c0775..bde5f00fb 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/LfBatterySummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/LfBatterySummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,4 +37,4 @@ public void refresh(Entity entity) { weightLabel.setText(formatWeight(testShip.getWeightLFBattery(), entity)); } } -} \ No newline at end of file +} diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/LifeBoatSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/LifeBoatSummaryItem.java index 602d621a9..016956b9d 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/LifeBoatSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/LifeBoatSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,4 +37,4 @@ public void refresh(Entity entity) { weightLabel.setText(formatWeight(testShip.getWeightLifeBoats(), entity)); } } -} \ No newline at end of file +} diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/MiscEquipmentSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/MiscEquipmentSummaryItem.java index 94fddd8be..10dddae1e 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/MiscEquipmentSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/MiscEquipmentSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +24,8 @@ import megameklab.util.UnitUtil; /** - * This Summary Item sums up all misctype equipment not handled elsewhere (it excludes JJ, UMU, heat sinks, + * This Summary Item sums up all misctype equipment not handled elsewhere (it + * excludes JJ, UMU, heat sinks, * TSM) and without weapons and ammo. */ public class MiscEquipmentSummaryItem extends AbstractSummaryItem { diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/PropulsionSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/PropulsionSummaryItem.java index 7eaab6a79..caf468fb9 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/PropulsionSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/PropulsionSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/SailSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/SailSummaryItem.java index fe81d24b4..633c991a0 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/SailSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/SailSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,4 +37,4 @@ public void refresh(Entity entity) { weightLabel.setText(formatWeight(testShip.getWeightSail(), entity)); } } -} \ No newline at end of file +} diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/SpecialsSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/SpecialsSummaryItem.java index e548bbd9b..2e0d51472 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/SpecialsSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/SpecialsSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,7 +23,8 @@ import megameklab.util.UnitUtil; /** - * This item only lists the weight of TestEntity.getWeightMisc(). It overlaps with OtherSummaryItem! + * This item only lists the weight of TestEntity.getWeightMisc(). It overlaps + * with OtherSummaryItem! */ public class SpecialsSummaryItem extends AbstractSummaryItem { diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/StructureSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/StructureSummaryItem.java index 4f916b84c..6556ba16b 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/StructureSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/StructureSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/TransportSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/TransportSummaryItem.java index 928b8723e..867394b65 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/TransportSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/TransportSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/WeaponsSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/WeaponsSummaryItem.java index 4ac4f5149..38998ce2d 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/WeaponsSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/WeaponsSummaryItem.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,4 +34,4 @@ public void refresh(Entity entity) { TestEntity testEntity = UnitUtil.getEntityVerifier(entity); weightLabel.setText(formatWeight(testEntity.getWeightWeapon(), entity)); } -} \ No newline at end of file +} diff --git a/megameklab/src/megameklab/ui/listeners/DropshipBuildListener.java b/megameklab/src/megameklab/ui/listeners/DropshipBuildListener.java index 1a9067aa2..6106efcb8 100644 --- a/megameklab/src/megameklab/ui/listeners/DropshipBuildListener.java +++ b/megameklab/src/megameklab/ui/listeners/DropshipBuildListener.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/src/megameklab/ui/util/AbstractCriticalTransferHandler.java b/megameklab/src/megameklab/ui/util/AbstractCriticalTransferHandler.java index c149ab1e3..977ecd3d4 100644 --- a/megameklab/src/megameklab/ui/util/AbstractCriticalTransferHandler.java +++ b/megameklab/src/megameklab/ui/util/AbstractCriticalTransferHandler.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,13 +18,14 @@ */ package megameklab.ui.util; +import javax.swing.JComponent; +import javax.swing.TransferHandler; + import megamek.common.Entity; import megamek.common.Mounted; import megameklab.ui.EntitySource; import megameklab.util.UnitUtil; -import javax.swing.*; - public class AbstractCriticalTransferHandler extends TransferHandler { protected final EntitySource eSource; diff --git a/megameklab/src/megameklab/ui/util/AppCloser.java b/megameklab/src/megameklab/ui/util/AppCloser.java index 0b2720398..dbba44fab 100644 --- a/megameklab/src/megameklab/ui/util/AppCloser.java +++ b/megameklab/src/megameklab/ui/util/AppCloser.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,8 +19,10 @@ package megameklab.ui.util; /** - * This interface may implemented by all windows that exit the application. They may override the - * exit() method to provide exit handling such as saving global preferences or window settings or + * This interface may implemented by all windows that exit the application. They + * may override the + * exit() method to provide exit handling such as saving global preferences or + * window settings or * show a safety dialog before exiting. * * @author Simon (Juliez) @@ -28,7 +30,8 @@ public interface AppCloser { /** - * Override to provide specific exit handling. Return false to prevent exiting the application, + * Override to provide specific exit handling. Return false to prevent exiting + * the application, * true to confirm it. By default, this method does nothing and returns true. * * @return False to prevent exiting, true to confirm diff --git a/megameklab/src/megameklab/ui/util/CritCellUtil.java b/megameklab/src/megameklab/ui/util/CritCellUtil.java index 38b70d582..25c4ac4cd 100644 --- a/megameklab/src/megameklab/ui/util/CritCellUtil.java +++ b/megameklab/src/megameklab/ui/util/CritCellUtil.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/src/megameklab/ui/util/ExitOnWindowClosingListener.java b/megameklab/src/megameklab/ui/util/ExitOnWindowClosingListener.java index f653c59b4..15cc52ab3 100644 --- a/megameklab/src/megameklab/ui/util/ExitOnWindowClosingListener.java +++ b/megameklab/src/megameklab/ui/util/ExitOnWindowClosingListener.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2023 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,8 +22,10 @@ import java.awt.event.WindowEvent; /** - * This is a specific WindowAdapter that acts on a windowClosing event by calling the given AppCloser's - * exit() method and exits the application if exit() returned true. Add this to any Frame that + * This is a specific WindowAdapter that acts on a windowClosing event by + * calling the given AppCloser's + * exit() method and exits the application if exit() returned true. Add this to + * any Frame that * should exit the application by closing its window. * * @author Simon (Juliez) @@ -33,10 +35,13 @@ public final class ExitOnWindowClosingListener extends WindowAdapter { private final AppCloser frame; /** - * Returns a new window listener for the given frame that will react to windowClosing events by calling - * the frame's exit() method and closing the application when exit() returns true. + * Returns a new window listener for the given frame that will react to + * windowClosing events by calling + * the frame's exit() method and closing the application when exit() returns + * true. * - * @param frame The frame (implementing AppCloser) that this window listener is for + * @param frame The frame (implementing AppCloser) that this window listener is + * for */ public ExitOnWindowClosingListener(AppCloser frame) { this.frame = frame; diff --git a/megameklab/src/megameklab/util/AeroUtil.java b/megameklab/src/megameklab/util/AeroUtil.java index f73872718..af3beb405 100644 --- a/megameklab/src/megameklab/util/AeroUtil.java +++ b/megameklab/src/megameklab/util/AeroUtil.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab.ab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,6 +18,10 @@ */ package megameklab.util; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + import megamek.common.*; import megamek.common.verifier.TestAero; import megamek.common.verifier.TestSmallCraft; @@ -31,10 +35,6 @@ import megamek.common.weapons.srms.SRMWeapon; import megamek.common.weapons.srms.SRTWeapon; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - public final class AeroUtil { public static boolean isAeroWeapon(EquipmentType eq, Aero unit) { diff --git a/megameklab/src/megameklab/util/BattleArmorUtil.java b/megameklab/src/megameklab/util/BattleArmorUtil.java index 4b5814d0d..135c4004b 100644 --- a/megameklab/src/megameklab/util/BattleArmorUtil.java +++ b/megameklab/src/megameklab/util/BattleArmorUtil.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,13 @@ */ package megameklab.util; -import megamek.common.*; +import megamek.common.AmmoType; +import megamek.common.BattleArmor; +import megamek.common.Entity; +import megamek.common.EquipmentType; +import megamek.common.MiscType; +import megamek.common.Mounted; +import megamek.common.WeaponType; import megamek.common.annotations.Nullable; import megamek.common.weapons.LegAttack; import megamek.common.weapons.StopSwarmAttack; diff --git a/megameklab/src/megameklab/util/InfantryUtil.java b/megameklab/src/megameklab/util/InfantryUtil.java index ccfe6cf35..02c05d29e 100644 --- a/megameklab/src/megameklab/util/InfantryUtil.java +++ b/megameklab/src/megameklab/util/InfantryUtil.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/src/megameklab/util/ProtoMekUtil.java b/megameklab/src/megameklab/util/ProtoMekUtil.java index 17bf034c2..99829a1a6 100644 --- a/megameklab/src/megameklab/util/ProtoMekUtil.java +++ b/megameklab/src/megameklab/util/ProtoMekUtil.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,12 @@ */ package megameklab.util; -import megamek.common.*; +import megamek.common.EquipmentType; +import megamek.common.LocationFullException; +import megamek.common.MiscType; +import megamek.common.Mounted; +import megamek.common.ProtoMek; +import megamek.common.WeaponType; import megamek.common.verifier.TestProtoMek; public final class ProtoMekUtil { @@ -47,7 +52,10 @@ public static boolean isProtoMekEquipment(EquipmentType eq, ProtoMek proto, bool return true; } - /** Adds the given number of shots to the already present given ammo on the given ProtoMek. */ + /** + * Adds the given number of shots to the already present given ammo on the given + * ProtoMek. + */ public static void addProtoMekAmmo(ProtoMek entity, EquipmentType ammo, int shots) throws LocationFullException { Mounted aMount = entity.getAmmo().stream() .filter(m -> ammo.equals(m.getType())).findFirst().orElse(null); @@ -61,7 +69,8 @@ public static void addProtoMekAmmo(ProtoMek entity, EquipmentType ammo, int shot } /** - * Subtracts the given number of shots from the given ammo on the given ProtoMek. + * Subtracts the given number of shots from the given ammo on the given + * ProtoMek. * May remove the entire Mounted from the ProtoMek. */ public static void reduceProtoMekAmmo(ProtoMek entity, EquipmentType ammo, int shots) { @@ -77,7 +86,8 @@ public static void reduceProtoMekAmmo(ProtoMek entity, EquipmentType ammo, int s } /** - * Checks whether the space has room for the equipment within the slot and weight limits. + * Checks whether the space has room for the equipment within the slot and + * weight limits. * * @param location A ProtoMek location * @param mount The equipment to be added to the location @@ -105,5 +115,6 @@ public static boolean protoMekHasRoom(ProtoMek proto, int location, Mounted m return true; } - private ProtoMekUtil() { } + private ProtoMekUtil() { + } } diff --git a/megameklab/src/megameklab/util/TankUtil.java b/megameklab/src/megameklab/util/TankUtil.java index a945f8025..add8300ea 100644 --- a/megameklab/src/megameklab/util/TankUtil.java +++ b/megameklab/src/megameklab/util/TankUtil.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab.ab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,13 @@ */ package megameklab.util; -import megamek.common.*; +import megamek.common.Engine; +import megamek.common.Entity; +import megamek.common.EquipmentType; +import megamek.common.MiscType; +import megamek.common.Tank; +import megamek.common.VTOL; +import megamek.common.WeaponType; import megamek.common.verifier.TestTank; import megamek.common.weapons.c3.ISC3M; import megamek.common.weapons.c3.ISC3MBS; @@ -49,9 +55,11 @@ public static boolean isTankWeapon(EquipmentType eq, Entity unit) { } /** - * Tests whether equipment should be shown on the equipment tab for the unit. This is + * Tests whether equipment should be shown on the equipment tab for the unit. + * This is * used for both combat vehicles and non-aerospace support vehicles. - * @param eq The equipment to show + * + * @param eq The equipment to show * @param tank The tank * @return Whether the equipment should show on the table */ @@ -60,9 +68,12 @@ public static boolean isTankEquipment(EquipmentType eq, Tank tank) { } /** - * Tests whether equipment should be shown on the equipment tab for the unit as non-weapon - * equipment. This is used for both combat vehicles and non-aerospace support vehicles. - * @param eq The equipment to show + * Tests whether equipment should be shown on the equipment tab for the unit as + * non-weapon + * equipment. This is used for both combat vehicles and non-aerospace support + * vehicles. + * + * @param eq The equipment to show * @param tank The tank * @return Whether the equipment should show on the table */ @@ -94,7 +105,7 @@ public static boolean isTankMiscEquipment(EquipmentType eq, Entity tank) { // External fuel tanks are only allowed on ICE and fuel cell engines if (eq.hasFlag(MiscType.F_FUEL) && (!tank.hasEngine() || (tank.getEngine().getEngineType() != Engine.COMBUSTION_ENGINE - && tank.getEngine().getEngineType() != Engine.FUEL_CELL))) { + && tank.getEngine().getEngineType() != Engine.FUEL_CELL))) { return false; } if (eq.hasFlag(MiscType.F_VTOL_EQUIPMENT) && (tank instanceof VTOL)) { @@ -109,5 +120,6 @@ public static boolean isTankMiscEquipment(EquipmentType eq, Entity tank) { return false; } - private TankUtil() { } -} \ No newline at end of file + private TankUtil() { + } +} diff --git a/megameklab/src/megameklab/util/UnitUtil.java b/megameklab/src/megameklab/util/UnitUtil.java index 0836c2740..c6f170075 100644 --- a/megameklab/src/megameklab/util/UnitUtil.java +++ b/megameklab/src/megameklab/util/UnitUtil.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2008-2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/unittests/megameklab/printing/PrintSmallUnitSheetTest.java b/megameklab/unittests/megameklab/printing/PrintSmallUnitSheetTest.java index 45f69b25d..e8e7aaed1 100644 --- a/megameklab/unittests/megameklab/printing/PrintSmallUnitSheetTest.java +++ b/megameklab/unittests/megameklab/printing/PrintSmallUnitSheetTest.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/unittests/megameklab/testing/util/InitializeTypes.java b/megameklab/unittests/megameklab/testing/util/InitializeTypes.java index 95bceb74f..077a8d108 100644 --- a/megameklab/unittests/megameklab/testing/util/InitializeTypes.java +++ b/megameklab/unittests/megameklab/testing/util/InitializeTypes.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/megameklab/unittests/megameklab/ui/util/EquipmentTableModelTest.java b/megameklab/unittests/megameklab/ui/util/EquipmentTableModelTest.java index e1580b618..dc18dd3ed 100644 --- a/megameklab/unittests/megameklab/ui/util/EquipmentTableModelTest.java +++ b/megameklab/unittests/megameklab/ui/util/EquipmentTableModelTest.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. * - * This file is part of MegaMek. + * This file is part of MegaMekLab. * * MegaMek is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by