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

Remove wordWrap Method from RandomMarriageMethod, RandomProcreationMethod, RandomDivorceMethod Classes #4964

Merged
merged 3 commits into from
Oct 4, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

import java.util.ResourceBundle;

import static megamek.client.ui.WrapLayout.wordWrap;

/**
* An enumeration representing the available random divorce methods.
* <p>
Expand Down Expand Up @@ -60,7 +58,7 @@ public enum RandomDivorceMethod {
final ResourceBundle resources = ResourceBundle.getBundle("mekhq.resources.Personnel",
MekHQ.getMHQOptions().getLocale());
this.name = resources.getString(name);
this.toolTipText = wordWrap(resources.getString(toolTipText));
this.toolTipText = resources.getString(toolTipText);
}
//endregion Constructors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

import java.util.ResourceBundle;

import static megamek.client.ui.WrapLayout.wordWrap;

/**
* The {@link RandomProcreationMethod} enum represents different methods of getting random procreation.
* <p>
Expand Down Expand Up @@ -58,7 +56,7 @@ public enum RandomProcreationMethod {
final ResourceBundle resources = ResourceBundle.getBundle("mekhq.resources.Personnel",
MekHQ.getMHQOptions().getLocale());
this.name = resources.getString(name);
this.toolTipText = wordWrap(resources.getString(toolTipText));
this.toolTipText = resources.getString(toolTipText);
}
//endregion Constructors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import java.util.ResourceBundle;

import static megamek.client.ui.WrapLayout.wordWrap;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
Expand All @@ -45,8 +44,8 @@ public class RandomDivorceMethodTest {
//region Getters
@Test
public void testGetToolTipText() {
String expected = wordWrap(resources.getString("RandomDivorceMethod.NONE.toolTipText")).replaceAll("\\s", "");
String actual = wordWrap(RandomDivorceMethod.NONE.getToolTipText().trim()).replaceAll("\\s", "");
String expected = resources.getString("RandomDivorceMethod.NONE.toolTipText").replaceAll("\\s", "");
String actual = RandomDivorceMethod.NONE.getToolTipText().trim().replaceAll("\\s", "");

assertEquals(expected, actual);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public void testGetMethod() {

@Test
public void testToStringOverride() {
assertEquals(wordWrap(resources.getString("RandomMarriageMethod.NONE.text")).trim(),
assertEquals(resources.getString("RandomMarriageMethod.NONE.text").trim(),
RandomMarriageMethod.NONE.toString().trim());
assertEquals(wordWrap(resources.getString("RandomMarriageMethod.DICE_ROLL.text")).trim(),
assertEquals(resources.getString("RandomMarriageMethod.DICE_ROLL.text").trim(),
RandomMarriageMethod.DICE_ROLL.toString().trim());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public class RandomProcreationMethodTest {
//region Getters
@Test
public void testGetToolTipText() {
assertEquals(resources.getString("RandomProcreationMethod.NONE.toolTipText").trim(),
RandomProcreationMethod.NONE.getToolTipText().trim());
assertEquals(resources.getString("RandomProcreationMethod.DICE_ROLL.toolTipText").trim(),
RandomProcreationMethod.DICE_ROLL.getToolTipText().trim());
assertEquals(resources.getString("RandomProcreationMethod.NONE.toolTipText"),
RandomProcreationMethod.NONE.getToolTipText());
assertEquals(resources.getString("RandomProcreationMethod.DICE_ROLL.toolTipText"),
RandomProcreationMethod.DICE_ROLL.getToolTipText());
}
//endregion Getters

Expand Down