Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing MegaMekLab's Javadoc Build #1028

Merged
merged 1 commit into from
Feb 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,7 @@ publishing {
artifactId = "megameklab${mmBranchTag}"
from components.java
artifact sourcesJar
// Javadoc has errors
// artifact javadocJar
artifact javadocJar

pom {
name = "MegaMekLab"
Expand Down
20 changes: 10 additions & 10 deletions src/megameklab/com/printing/InventoryEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,61 +40,61 @@ public interface InventoryEntry {
int nRows();

/**
* @param row The row index within the entry. Should be < nRows()
* @param row The row index within the entry. Should be &lt; nRows()
* @return The number of identical equipment pieces represented by this entry
*/
String getQuantityField(int row);

/**
* @param row The row index within the entry. Should be < nRows()
* @param row The row index within the entry. Should be &lt; nRows()
* @return The name of the equipment
*/
String getNameField(int row);

/**
* @param row The row index within the entry. Should be < nRows()
* @param row The row index within the entry. Should be &lt; nRows()
* @return The location/firing arc
*/
String getLocationField(int row);

/**
* @param row The row index within the entry. Should be < nRows()
* @param row The row index within the entry. Should be &lt; nRows()
* @return The amount of heat generated
*/
String getHeatField(int row);

/**
* @param row The row index within the entry. Should be < nRows()
* @param row The row index within the entry. Should be &lt; nRows()
* @return The damage caused by the weapon, as well as its type code
*/
String getDamageField(int row);

/**
* @param row The row index within the entry. Should be < nRows()
* @param row The row index within the entry. Should be &lt; nRows()
* @return The upper limit of the minimum range
*/
String getMinField(int row);

/**
* @param row The row index within the entry. Should be < nRows()
* @param row The row index within the entry. Should be &lt; nRows()
* @return The upper limit of the short range (ground units) or SRV (aero units)
*/
String getShortField(int row);

/**
* @param row The row index within the entry. Should be < nRows()
* @param row The row index within the entry. Should be &lt; nRows()
* @return The upper limit of the medium range (ground units) or MRV (aero units)
*/
String getMediumField(int row);

/**
* @param row The row index within the entry. Should be < nRows()
* @param row The row index within the entry. Should be &lt; nRows()
* @return The upper limit of the long range (ground units) or LRV (aero units)
*/
String getLongField(int row);

/**
* @param row The row index within the entry. Should be < nRows()
* @param row The row index within the entry. Should be &lt; nRows()
* @return The ERV (aero units)
*/
String getExtremeField(int row);
Expand Down
2 changes: 1 addition & 1 deletion src/megameklab/com/printing/InventoryWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ public double printGravDecks(Jumpship ship, float fontSize, double lineHeight, d
}

/**
* Convenience method for printing information related to cargo & transport bays.
* Convenience method for printing information related to cargo and transport bays.
*
* @param fontSize The font size to use for the table rows
* @param lineHeight The height of each table row
Expand Down
4 changes: 1 addition & 3 deletions src/megameklab/com/printing/WeaponBayText.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*/

package megameklab.com.printing;

import java.math.BigInteger;
Expand All @@ -28,11 +27,10 @@

/**
* Convenience class for storing information about weapon pays for printing.
* This consists of a list of the weapons in the bay with heat & damage, along
* This consists of a list of the weapons in the bay with heat and damage, along
* with the location of the bay.
*
* @author arlith
*
*/
public class WeaponBayText implements Comparable<WeaponBayText> {

Expand Down
3 changes: 2 additions & 1 deletion src/megameklab/com/ui/EntitySource.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ default void createNewUnit(long entitytype, Entity oldUnit) {
void createNewUnit(long entitytype, boolean isPrimitive, boolean isIndustrial, Entity oldUnit);

/**
* Provides means to determine legality of any piece of tech.
* @return the current TechManager, which provides the means to determine legality of any piece
* of tech.
*/
ITechManager getTechManager();
}
16 changes: 8 additions & 8 deletions src/megameklab/com/ui/dialog/AbstractMMLButtonDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@
* Inheriting classes must call initialize() in their constructors and override createCenterPane()
*
* The resources associated with this dialog need to contain at least the following keys:
* - "Ok.text" -> text for the ok button
* - "Ok.toolTipText" -> toolTipText for the ok button
* - "Cancel.text" -> text for the cancel button
* - "Cancel.toolTipText" -> toolTipText for the cancel button
* - "Ok.text" - text for the ok button
* - "Ok.toolTipText" - toolTipText for the ok button
* - "Cancel.text" - text for the cancel button
* - "Cancel.toolTipText" - toolTipText for the cancel button
*/
public abstract class AbstractMMLButtonDialog extends AbstractButtonDialog {
//region Constructors
/**
* This creates a modal AbstractMHQButtonDialog using the default MHQ resource bundle. This is
* the normal constructor to use for an AbstractMHQButtonDialog.
* This creates a modal AbstractMMLButtonDialog using the default MML resource bundle. This is
* the normal constructor to use for an AbstractMMLButtonDialog.
*/
protected AbstractMMLButtonDialog(final JFrame frame, final String name, final String title) {
this(frame, true, name, title);
}

/**
* This creates an AbstractMHQButtonDialog using the default MHQ resource bundle. It allows one
* This creates an AbstractMMLButtonDialog using the default MML resource bundle. It allows one
* to create non-modal button dialogs, which is not recommended by default.
*/
protected AbstractMMLButtonDialog(final JFrame frame, final boolean modal, final String name,
Expand All @@ -59,7 +59,7 @@ protected AbstractMMLButtonDialog(final JFrame frame, final boolean modal, final
}

/**
* This creates an AbstractMHQButtonDialog using the specified resource bundle. This is not
* This creates an AbstractMMLButtonDialog using the specified resource bundle. This is not
* recommended by default.
*/
protected AbstractMMLButtonDialog(final JFrame frame, final boolean modal, final ResourceBundle resources,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private void callColorChooser(String type, String fgOrBg, JLabel exampleLabel) {
}

/**
* Returns a mapping of a String representing the type of color to an RGB Color string.
* @return a mapping of a String representing the type of color to an RGB Color string.
* The type string is CConfig.COLOR_XYZ+CConfig.CONFIG_FOREGROUND or BACKGROUND.
*/
Map<String, String> getAllColors() {
Expand Down
4 changes: 2 additions & 2 deletions src/megameklab/com/ui/generalUnit/ArmorAllocationView.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ public void setEntityType(long etype) {
* Helper function for patchwork. If used for non-patchwork, it will likely give incorrect values
* due to rounding up by location.
*
* @param en
* @return The total weight of all allocated armor.
* @param en the current entity
* @return The total weight of all allocated armor.
*/
public double getTotalArmorWeight(Entity en) {
double weight = 0.0;
Expand Down
4 changes: 3 additions & 1 deletion src/megameklab/com/ui/generalUnit/BasicInfoView.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ public void setSource(String source) {
txtSource.setText(source);
}

/** Returns the entered manual BV value or -1 if it can't be parsed. */
/**
* @return the entered manual BV value or -1 if it can't be parsed.
*/
public int getManualBV() {
return txtManualBV.getIntVal(-1);
}
Expand Down
12 changes: 6 additions & 6 deletions src/megameklab/com/ui/listeners/SVBuildListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ public interface SVBuildListener extends BuildListener {
/**
* Notify of a change in the number of crew seats
*
* @param standard The number of fixed standard combat crew seats
* @param standard The number of pod-mounted standard combat crew seats
* @param pillion The number of fixed pillion seats
* @param pillion The number of pod-mounted pillion seats
* @param ejection The number of fixed ejection seats
* @param ejection The number of pod-mounted ejection seats
* @param standard The number of fixed standard combat crew seats
* @param standardPod The number of pod-mounted standard combat crew seats
* @param pillion The number of fixed pillion seats
* @param pillionPod The number of pod-mounted pillion seats
* @param ejection The number of fixed ejection seats
* @param ejectionPod The number of pod-mounted ejection seats
*/
void setSeating(int standard, int standardPod, int pillion, int pillionPod,
int ejection, int ejectionPod);
Expand Down
14 changes: 8 additions & 6 deletions src/megameklab/com/ui/util/AbstractEquipmentDatabaseView.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private void updateVisibleColumns() {
protected abstract void addEquipment(EquipmentType equip, int count);

/**
* Returns the filter toggles and buttons to be used in this Equipment Database View.
* @return the filter toggles and buttons to be used in this Equipment Database View.
* By default, this method returns the standard buttons suitable for the entity as defined in
* EquipmentDatabaseCategory. It may be overridden, e.g. to hide all filter buttons by
* returning an empty Set. When doing this, shouldShow() should be overridden to prevent
Expand Down Expand Up @@ -479,7 +479,9 @@ private void showAllEquipmentTypes(ActionEvent e) {
equipmentSorter.sort();
}

/** Returns true when the given equipment is available to be added to the unit. */
/**
* @return true when the given equipment is available to be added to the unit.
*/
private boolean canLegallyBeAddedToUnit(@Nullable EquipmentType equipment) {
return (equipment != null) && eSource.getTechManager().isLegal(equipment);
}
Expand Down Expand Up @@ -518,7 +520,7 @@ && includedByFilters(equipment)
}

/**
* Returns true when the given equipment is allowed to be shown by an entry in the Text Filter.
* @return true when the given equipment is allowed to be shown by an entry in the Text Filter.
* This is always true when the Text Filter is empty. Otherwise the name, tech base and rules
* ref table columns are checked against the text filter.
*/
Expand All @@ -536,7 +538,7 @@ private boolean allowedByTextFilter(EquipmentType equipment) {
}

/**
* Returns true when the given equipment is available at all to the unit type of the
* @return true when the given equipment is available at all to the unit type of the
* current unit. For example, filters out Capital weapons for Meks.
*/
private boolean isEquipmentForEntity(EquipmentType equipment) {
Expand All @@ -559,7 +561,7 @@ private boolean isEquipmentForEntity(EquipmentType equipment) {
}

/**
* Returns true when the filter toggles allow the given equipment to be shown.
* @return true when the filter toggles allow the given equipment to be shown.
*/
private boolean includedByFilters(EquipmentType equipment) {
return (showEnergyButton.isSelected() && ENERGY.passesFilter(equipment, getEntity()))
Expand All @@ -573,7 +575,7 @@ private boolean includedByFilters(EquipmentType equipment) {
}

/**
* Returns true when the Hide toggles hide the given equipment.
* @return true when the Hide toggles hide the given equipment.
*/
private boolean hiddenEquipment(EquipmentType equipment) {
return (hideProtoButton.isSelected() && PROTOTYPE.passesFilter(equipment, getEntity()))
Expand Down
8 changes: 5 additions & 3 deletions src/megameklab/com/ui/util/CritCellUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public final class CritCellUtil {
public static final String EMPTY_CRITCELL_TEXT = "- Empty -";

/**
* Returns a titled border using the given string as title placed centered atop the
* @param title the title for this component
* @return a titled border using the given string as title placed centered atop the
* Component and using a {@link LocationBorder} as a border. To be used for crit
* location blocks, especially when they have additional information ("Slots: 0/2")
* above or below the crits to group them visually.
Expand All @@ -45,8 +46,9 @@ public static Border locationBorder(String title) {
}

/**
* Returns a titled but otherwise empty border using the given string as title
* placed centered atop the Component.
* @param title the title for this Component
* @return a titled but otherwise empty border using the given string as the title placed
* centered atop the Component.
*/
public static Border locationBorderNoLine(String title) {
return BorderFactory.createTitledBorder(
Expand Down
8 changes: 6 additions & 2 deletions src/megameklab/com/ui/util/EquipmentDatabaseCategory.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,16 @@ public boolean passesFilter(EquipmentType eq, Entity en) {
return filter.apply(eq, en);
}

/** Returns a Set of the filters that should act as "Show..." filters. */
/**
* @return a Set of the filters that should act as "Show..." filters.
*/
public static Set<EquipmentDatabaseCategory> getShowFilters() {
return Collections.unmodifiableSet(showFilters);
}

/** Returns a Set of the filters that should act as "Hide..." filters. */
/**
* @return a Set of the filters that should act as "Hide..." filters.
*/
public static Set<EquipmentDatabaseCategory> getHideFilters() {
return Collections.unmodifiableSet(hideFilters);
}
Expand Down
4 changes: 2 additions & 2 deletions src/megameklab/com/ui/util/EquipmentTableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,9 @@ public Object getValueAt(int row, int col) {
}

/**
* Returns a String representation of the Tech Base of the given equipment, i.e.
* "All", "IS" or "Clan" - or "Unknown" if the Tech Base is not one of the standard values.
* @param equipment The equipment in question; must not be null
* @return a String representation of the Tech Base of the given equipment, i.e.
* "All", "IS" or "Clan" - or "Unknown" if the Tech Base is not one of the standard values.
*/
public static String getTechBaseAsString(EquipmentType equipment) {
switch(equipment.getTechBase()) {
Expand Down
14 changes: 8 additions & 6 deletions src/megameklab/com/ui/util/IView.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,31 +70,33 @@ public Infantry getInfantry() {
}

/**
* Returns true if the entity has the Small Craft type flag (no instanceof check).
* @return true if the entity has the Small Craft type flag (no instanceof check).
* This includes DropShips.
*/
public boolean isSmallCraft() {
return getEntity().hasETypeFlag(Entity.ETYPE_SMALL_CRAFT);
}

/**
* Returns true if the entity has the JumpShip type flag (no instanceof check).
* @return true if the entity has the JumpShip type flag (no instanceof check).
* This includes WarShips and Space Stations.
*/
public boolean isJumpShip() {
return getEntity().hasETypeFlag(Entity.ETYPE_JUMPSHIP);
}

/** Returns true if the entity has the WarShip type flag (no instanceof check). */
/**
* @return true if the entity has the WarShip type flag (no instanceof check).
*/
public boolean isWarShip() {
return getEntity().hasETypeFlag(Entity.ETYPE_WARSHIP);
}

/**
* Returns true if the entity is a VTOL Combat Vehicle. This is an instanceof check and includes
* @return true if the entity is a VTOL Combat Vehicle. This is an instanceof check and includes
* Support VTOLs but not VTOL type Infantry.
* */
*/
public boolean isVTOL() {
return getEntity() instanceof VTOL;
}
}
}
7 changes: 3 additions & 4 deletions src/megameklab/com/ui/util/IntRangeTextField.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public Integer getMinimum() {

/**
* Sets the minimum value for the field.
* @param min
* @param min the minimum value
*/
public void setMinimum(Integer min) {
minimum = min;
Expand All @@ -75,7 +75,7 @@ public Integer getMaximum() {

/**
* Sets the maximum legal value
* @param max
* @param max the maximum value
*/
public void setMaximum(Integer max) {
maximum = max;
Expand Down Expand Up @@ -156,10 +156,9 @@ public int getIntVal(int defaultVal) {

/**
* Sets the text to a string representation of the provided value
* @param val
* @param val the provided value
*/
public void setIntVal(int val) {
setText(String.valueOf(val));
}

}
Loading