mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Cleanup - Statement lambda -> expression lambda
This commit is contained in:
@@ -183,30 +183,28 @@ public class DialogChooseSets {
|
||||
spinnersEditionTypeMap.put(editionType, spinner);
|
||||
}
|
||||
// == SPINNERS ACTION PERFORMED ==
|
||||
editionTypeSpinners.forEach(spinner -> {
|
||||
spinner.addChangeListener(e -> {
|
||||
// As soon as the value of a spinner becomes different from zero,
|
||||
// enabled the random selection button.
|
||||
int spinValue = (int) spinner.getValue();
|
||||
if (spinValue > 0) {
|
||||
if (!randomSelectionButton.isEnabled())
|
||||
randomSelectionButton.setEnabled(true);
|
||||
} else {
|
||||
// Similarly, when all spinners are set to zero,
|
||||
// disable the random selection button
|
||||
boolean allZeros = true;
|
||||
for (FSpinner spin : editionTypeSpinners) {
|
||||
int value = (int) spin.getValue();
|
||||
if (value != 0) {
|
||||
allZeros = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (allZeros)
|
||||
randomSelectionButton.setEnabled(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
editionTypeSpinners.forEach(spinner -> spinner.addChangeListener(e -> {
|
||||
// As soon as the value of a spinner becomes different from zero,
|
||||
// enabled the random selection button.
|
||||
int spinValue = (int) spinner.getValue();
|
||||
if (spinValue > 0) {
|
||||
if (!randomSelectionButton.isEnabled())
|
||||
randomSelectionButton.setEnabled(true);
|
||||
} else {
|
||||
// Similarly, when all spinners are set to zero,
|
||||
// disable the random selection button
|
||||
boolean allZeros = true;
|
||||
for (FSpinner spin : editionTypeSpinners) {
|
||||
int value = (int) spin.getValue();
|
||||
if (value != 0) {
|
||||
allZeros = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (allZeros)
|
||||
randomSelectionButton.setEnabled(false);
|
||||
}
|
||||
}));
|
||||
|
||||
// == ADD SPINNERS AND LABELS TO THE PANEL ==
|
||||
JPanel typeFieldsPanel = null;
|
||||
|
||||
@@ -412,9 +412,7 @@ public enum CSubmenuPreferences implements ICDoc {
|
||||
final FComboBox<String> comboBox = createComboBox(new String[] {"Off", "AI", "Human For AI"}, userSetting);
|
||||
final String selectedItem = this.prefs.getPref(userSetting);
|
||||
panel.setComboBox(comboBox, selectedItem);
|
||||
comboBox.addActionListener(actionEvent -> {
|
||||
AiProfileUtil.setAiSideboardingMode(AiProfileUtil.AISideboardingMode.normalizedValueOf(comboBox.getSelectedItem()));
|
||||
});
|
||||
comboBox.addActionListener(actionEvent -> AiProfileUtil.setAiSideboardingMode(AiProfileUtil.AISideboardingMode.normalizedValueOf(comboBox.getSelectedItem())));
|
||||
}
|
||||
|
||||
private void initializeSoundSetsComboBox() {
|
||||
|
||||
Reference in New Issue
Block a user