Skip to content

Commit

Permalink
Corrected project name in Copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
rjhancock committed Sep 13, 2024
1 parent ad6e4f6 commit 04e239e
Show file tree
Hide file tree
Showing 37 changed files with 151 additions and 104 deletions.
2 changes: 1 addition & 1 deletion megameklab/src/megameklab/printing/CGLMassPrinter.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion megameklab/src/megameklab/printing/PageBreak.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down
19 changes: 10 additions & 9 deletions megameklab/src/megameklab/printing/PrintUtil.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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)) {
Expand Down Expand Up @@ -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;
}

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion megameklab/src/megameklab/ui/EntitySource.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion megameklab/src/megameklab/ui/EquipmentToolTip.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
27 changes: 18 additions & 9 deletions megameklab/src/megameklab/ui/dialog/UiLoader.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -58,8 +59,7 @@ public class UiLoader {
private static final TreeMap<Integer, String> 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;
Expand Down Expand Up @@ -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 <code>Entity</code> 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 <code>Entity</code> 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;
Expand All @@ -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);
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 {
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -37,4 +37,4 @@ public void refresh(Entity entity) {
weightLabel.setText(formatWeight(testAero.getWeightQuarters(), entity));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 {

Expand All @@ -37,4 +37,4 @@ public void refresh(Entity entity) {
weightLabel.setText(formatWeight(testShip.getWeightGravDecks(), entity));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -37,4 +37,4 @@ public void refresh(Entity entity) {
weightLabel.setText(formatWeight(testShip.getWeightHardpoints(), entity));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -37,4 +37,4 @@ public void refresh(Entity entity) {
weightLabel.setText(formatWeight(testShip.getWeightKFDrive(), entity));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -37,4 +37,4 @@ public void refresh(Entity entity) {
weightLabel.setText(formatWeight(testShip.getWeightLFBattery(), entity));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -37,4 +37,4 @@ public void refresh(Entity entity) {
weightLabel.setText(formatWeight(testShip.getWeightLifeBoats(), entity));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit 04e239e

Please sign in to comment.