From 5af1cdfce216dd503ff260067d0aa555069e99d6 Mon Sep 17 00:00:00 2001 From: dateri <263765432@qq.com> Date: Fri, 7 May 2021 23:23:27 +0800 Subject: [PATCH 01/11] fix: Random order of fields --- .../model/entry/field/FieldFactory.java | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/jabref/model/entry/field/FieldFactory.java b/src/main/java/org/jabref/model/entry/field/FieldFactory.java index b1c2f3b99b9..07adae13bd8 100644 --- a/src/main/java/org/jabref/model/entry/field/FieldFactory.java +++ b/src/main/java/org/jabref/model/entry/field/FieldFactory.java @@ -8,6 +8,7 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Set; +import java.util.TreeSet; import java.util.function.Predicate; import java.util.stream.Collectors; @@ -29,8 +30,8 @@ public static String serializeOrFields(Field... fields) { public static String serializeOrFields(OrFields fields) { return fields.stream() - .map(Field::getName) - .collect(Collectors.joining(FIELD_OR_SEPARATOR)); + .map(Field::getName) + .collect(Collectors.joining(FIELD_OR_SEPARATOR)); } public static String serializeOrFieldsList(Set fields) { @@ -47,30 +48,30 @@ public static List getIdentifierFieldNames() { public static OrFields parseOrFields(String fieldNames) { Set fields = Arrays.stream(fieldNames.split(FieldFactory.FIELD_OR_SEPARATOR)) - .filter(StringUtil::isNotBlank) - .map(FieldFactory::parseField) - .collect(Collectors.toCollection(LinkedHashSet::new)); + .filter(StringUtil::isNotBlank) + .map(FieldFactory::parseField) + .collect(Collectors.toCollection(LinkedHashSet::new)); return new OrFields(fields); } public static Set parseOrFieldsList(String fieldNames) { return Arrays.stream(fieldNames.split(FieldFactory.DELIMITER)) - .filter(StringUtil::isNotBlank) - .map(FieldFactory::parseOrFields) - .collect(Collectors.toCollection(LinkedHashSet::new)); + .filter(StringUtil::isNotBlank) + .map(FieldFactory::parseOrFields) + .collect(Collectors.toCollection(LinkedHashSet::new)); } public static Set parseFieldList(String fieldNames) { return Arrays.stream(fieldNames.split(FieldFactory.DELIMITER)) - .filter(StringUtil::isNotBlank) - .map(FieldFactory::parseField) - .collect(Collectors.toCollection(LinkedHashSet::new)); + .filter(StringUtil::isNotBlank) + .map(FieldFactory::parseField) + .collect(Collectors.toCollection(LinkedHashSet::new)); } public static String serializeFieldsList(Collection fields) { return fields.stream() - .map(Field::getName) - .collect(Collectors.joining(DELIMITER)); + .map(Field::getName) + .collect(Collectors.joining(DELIMITER)); } public static Field parseField(String fieldName) { @@ -100,7 +101,12 @@ public static Set getJournalNameFields() { public static Set getCommonFields() { EnumSet allFields = EnumSet.allOf(StandardField.class); - LinkedHashSet publicAndInternalFields = new LinkedHashSet<>(allFields.size() + 3); + TreeSet publicAndInternalFields = new TreeSet<>((field1, field2) -> { + if (field1.getDisplayName().equals(field2.getDisplayName())) + return 0; + return field1.getDisplayName().compareTo(field2.getDisplayName()) > 0 ? 1 : -1; + } + ); publicAndInternalFields.add(InternalField.INTERNAL_ALL_FIELD); publicAndInternalFields.add(InternalField.INTERNAL_ALL_TEXT_FIELDS_FIELD); publicAndInternalFields.add(InternalField.KEY_FIELD); @@ -132,8 +138,8 @@ public static Set getPersonNameFields() { private static Set getFieldsFiltered(Predicate selector) { return getAllFields().stream() - .filter(selector) - .collect(Collectors.toSet()); + .filter(selector) + .collect(Collectors.toSet()); } private static Set getAllFields() { @@ -147,7 +153,7 @@ private static Set getAllFields() { /** * These are the fields JabRef always displays as default {@link org.jabref.preferences.JabRefPreferences#setLanguageDependentDefaultValues()} - * + *

* A user can change them. The change is currently stored in the preferences only and not explicitly exposed as * separate preferences object */ From 039152d42009bd26cb9c21c39bbdfbc4872c6531 Mon Sep 17 00:00:00 2001 From: dateri <263765432@qq.com> Date: Fri, 7 May 2021 23:30:10 +0800 Subject: [PATCH 02/11] fix: Random order of fields --- src/main/java/org/jabref/model/entry/field/FieldFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jabref/model/entry/field/FieldFactory.java b/src/main/java/org/jabref/model/entry/field/FieldFactory.java index 07adae13bd8..24f5b183362 100644 --- a/src/main/java/org/jabref/model/entry/field/FieldFactory.java +++ b/src/main/java/org/jabref/model/entry/field/FieldFactory.java @@ -6,9 +6,9 @@ import java.util.EnumSet; import java.util.HashSet; import java.util.LinkedHashSet; +import java.util.TreeSet; import java.util.List; import java.util.Set; -import java.util.TreeSet; import java.util.function.Predicate; import java.util.stream.Collectors; @@ -153,7 +153,7 @@ private static Set getAllFields() { /** * These are the fields JabRef always displays as default {@link org.jabref.preferences.JabRefPreferences#setLanguageDependentDefaultValues()} - *

+ * * A user can change them. The change is currently stored in the preferences only and not explicitly exposed as * separate preferences object */ From 95d3b9c792bb5f0d69d971bba43905264804c775 Mon Sep 17 00:00:00 2001 From: dateri <263765432@qq.com> Date: Fri, 7 May 2021 23:32:18 +0800 Subject: [PATCH 03/11] fix: Random order of fields --- .../model/entry/field/FieldFactory.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/jabref/model/entry/field/FieldFactory.java b/src/main/java/org/jabref/model/entry/field/FieldFactory.java index 24f5b183362..ca73ede18bc 100644 --- a/src/main/java/org/jabref/model/entry/field/FieldFactory.java +++ b/src/main/java/org/jabref/model/entry/field/FieldFactory.java @@ -30,8 +30,8 @@ public static String serializeOrFields(Field... fields) { public static String serializeOrFields(OrFields fields) { return fields.stream() - .map(Field::getName) - .collect(Collectors.joining(FIELD_OR_SEPARATOR)); + .map(Field::getName) + .collect(Collectors.joining(FIELD_OR_SEPARATOR)); } public static String serializeOrFieldsList(Set fields) { @@ -48,30 +48,30 @@ public static List getIdentifierFieldNames() { public static OrFields parseOrFields(String fieldNames) { Set fields = Arrays.stream(fieldNames.split(FieldFactory.FIELD_OR_SEPARATOR)) - .filter(StringUtil::isNotBlank) - .map(FieldFactory::parseField) - .collect(Collectors.toCollection(LinkedHashSet::new)); + .filter(StringUtil::isNotBlank) + .map(FieldFactory::parseField) + .collect(Collectors.toCollection(LinkedHashSet::new)); return new OrFields(fields); } public static Set parseOrFieldsList(String fieldNames) { return Arrays.stream(fieldNames.split(FieldFactory.DELIMITER)) - .filter(StringUtil::isNotBlank) - .map(FieldFactory::parseOrFields) - .collect(Collectors.toCollection(LinkedHashSet::new)); + .filter(StringUtil::isNotBlank) + .map(FieldFactory::parseOrFields) + .collect(Collectors.toCollection(LinkedHashSet::new)); } public static Set parseFieldList(String fieldNames) { return Arrays.stream(fieldNames.split(FieldFactory.DELIMITER)) - .filter(StringUtil::isNotBlank) - .map(FieldFactory::parseField) - .collect(Collectors.toCollection(LinkedHashSet::new)); + .filter(StringUtil::isNotBlank) + .map(FieldFactory::parseField) + .collect(Collectors.toCollection(LinkedHashSet::new)); } public static String serializeFieldsList(Collection fields) { return fields.stream() - .map(Field::getName) - .collect(Collectors.joining(DELIMITER)); + .map(Field::getName) + .collect(Collectors.joining(DELIMITER)); } public static Field parseField(String fieldName) { @@ -138,8 +138,8 @@ public static Set getPersonNameFields() { private static Set getFieldsFiltered(Predicate selector) { return getAllFields().stream() - .filter(selector) - .collect(Collectors.toSet()); + .filter(selector) + .collect(Collectors.toSet()); } private static Set getAllFields() { From 9f82e307d29674ef733bfc38362f2dd42e8667eb Mon Sep 17 00:00:00 2001 From: dateri <263765432@qq.com> Date: Fri, 7 May 2021 23:33:29 +0800 Subject: [PATCH 04/11] fix: Random order of fields --- .../model/entry/field/FieldFactory.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/jabref/model/entry/field/FieldFactory.java b/src/main/java/org/jabref/model/entry/field/FieldFactory.java index ca73ede18bc..36d8eef4840 100644 --- a/src/main/java/org/jabref/model/entry/field/FieldFactory.java +++ b/src/main/java/org/jabref/model/entry/field/FieldFactory.java @@ -56,22 +56,22 @@ public static OrFields parseOrFields(String fieldNames) { public static Set parseOrFieldsList(String fieldNames) { return Arrays.stream(fieldNames.split(FieldFactory.DELIMITER)) - .filter(StringUtil::isNotBlank) - .map(FieldFactory::parseOrFields) - .collect(Collectors.toCollection(LinkedHashSet::new)); + .filter(StringUtil::isNotBlank) + .map(FieldFactory::parseOrFields) + .collect(Collectors.toCollection(LinkedHashSet::new)); } public static Set parseFieldList(String fieldNames) { return Arrays.stream(fieldNames.split(FieldFactory.DELIMITER)) - .filter(StringUtil::isNotBlank) - .map(FieldFactory::parseField) - .collect(Collectors.toCollection(LinkedHashSet::new)); + .filter(StringUtil::isNotBlank) + .map(FieldFactory::parseField) + .collect(Collectors.toCollection(LinkedHashSet::new)); } public static String serializeFieldsList(Collection fields) { return fields.stream() - .map(Field::getName) - .collect(Collectors.joining(DELIMITER)); + .map(Field::getName) + .collect(Collectors.joining(DELIMITER)); } public static Field parseField(String fieldName) { @@ -138,8 +138,8 @@ public static Set getPersonNameFields() { private static Set getFieldsFiltered(Predicate selector) { return getAllFields().stream() - .filter(selector) - .collect(Collectors.toSet()); + .filter(selector) + .collect(Collectors.toSet()); } private static Set getAllFields() { From 34880e67ca19e4f52ee7a1e49fc0a9b59adc0fad Mon Sep 17 00:00:00 2001 From: dateri <263765432@qq.com> Date: Fri, 7 May 2021 23:34:12 +0800 Subject: [PATCH 05/11] fix: Random order of fields --- .../org/jabref/model/entry/field/FieldFactory.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/jabref/model/entry/field/FieldFactory.java b/src/main/java/org/jabref/model/entry/field/FieldFactory.java index 36d8eef4840..85b36f1729b 100644 --- a/src/main/java/org/jabref/model/entry/field/FieldFactory.java +++ b/src/main/java/org/jabref/model/entry/field/FieldFactory.java @@ -30,8 +30,8 @@ public static String serializeOrFields(Field... fields) { public static String serializeOrFields(OrFields fields) { return fields.stream() - .map(Field::getName) - .collect(Collectors.joining(FIELD_OR_SEPARATOR)); + .map(Field::getName) + .collect(Collectors.joining(FIELD_OR_SEPARATOR)); } public static String serializeOrFieldsList(Set fields) { @@ -48,9 +48,9 @@ public static List getIdentifierFieldNames() { public static OrFields parseOrFields(String fieldNames) { Set fields = Arrays.stream(fieldNames.split(FieldFactory.FIELD_OR_SEPARATOR)) - .filter(StringUtil::isNotBlank) - .map(FieldFactory::parseField) - .collect(Collectors.toCollection(LinkedHashSet::new)); + .filter(StringUtil::isNotBlank) + .map(FieldFactory::parseField) + .collect(Collectors.toCollection(LinkedHashSet::new)); return new OrFields(fields); } From 33da5f22db2ec4e54fff5ed486ea3d0644c90c76 Mon Sep 17 00:00:00 2001 From: dateri <263765432@qq.com> Date: Fri, 7 May 2021 23:42:55 +0800 Subject: [PATCH 06/11] fix: change CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15ff79e8072..5fdd8d41770 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -550,7 +550,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where the XMP Importer would incorrectly return an empty default entry when importing pdfs [#6577](https://github.com/JabRef/jabref/issues/6577) - We fixed an issue where opening the menu 'Library properties' marked the library as modified [#6451](https://github.com/JabRef/jabref/issues/6451) - We fixed an issue when importing resulted in an exception [#7343](https://github.com/JabRef/jabref/issues/7343) - +- We fixed an issue Some fields are in random order [#7710](https://github.com/JabRef/jabref/issues/7710) ### Removed - The feature to "mark entries" was removed and merged with the groups functionality. For migration, a group is created for every value of the `__markedentry` field and the entry is added to this group. From 743d00732b2e941e7f3b0a3ce05db3781967312f Mon Sep 17 00:00:00 2001 From: dateri <263765432@qq.com> Date: Sat, 8 May 2021 01:24:14 +0800 Subject: [PATCH 07/11] modify code in ViewModel. --- .../FieldFormatterCleanupsPanelViewModel.java | 6 ++++++ .../java/org/jabref/model/entry/field/FieldFactory.java | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java b/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java index b5169b5b69d..57fe9dc33d5 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java +++ b/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java @@ -28,6 +28,12 @@ public class FieldFormatterCleanupsPanelViewModel { private final ObjectProperty selectedFormatterProperty = new SimpleObjectProperty<>(); public FieldFormatterCleanupsPanelViewModel() { + availableFieldsProperty.sort((field1, field2) -> { + if (field1.getDisplayName().equals(field2.getDisplayName())) { + return 0; + } + return field1.getDisplayName().compareTo(field2.getDisplayName()) > 0 ? 1 : -1; + }); } public void resetToRecommended() { diff --git a/src/main/java/org/jabref/model/entry/field/FieldFactory.java b/src/main/java/org/jabref/model/entry/field/FieldFactory.java index 85b36f1729b..b1c2f3b99b9 100644 --- a/src/main/java/org/jabref/model/entry/field/FieldFactory.java +++ b/src/main/java/org/jabref/model/entry/field/FieldFactory.java @@ -6,7 +6,6 @@ import java.util.EnumSet; import java.util.HashSet; import java.util.LinkedHashSet; -import java.util.TreeSet; import java.util.List; import java.util.Set; import java.util.function.Predicate; @@ -101,12 +100,7 @@ public static Set getJournalNameFields() { public static Set getCommonFields() { EnumSet allFields = EnumSet.allOf(StandardField.class); - TreeSet publicAndInternalFields = new TreeSet<>((field1, field2) -> { - if (field1.getDisplayName().equals(field2.getDisplayName())) - return 0; - return field1.getDisplayName().compareTo(field2.getDisplayName()) > 0 ? 1 : -1; - } - ); + LinkedHashSet publicAndInternalFields = new LinkedHashSet<>(allFields.size() + 3); publicAndInternalFields.add(InternalField.INTERNAL_ALL_FIELD); publicAndInternalFields.add(InternalField.INTERNAL_ALL_TEXT_FIELDS_FIELD); publicAndInternalFields.add(InternalField.KEY_FIELD); From a7ffb9b612bb21bc0f6705a2a1649a5b05be128a Mon Sep 17 00:00:00 2001 From: dateri <263765432@qq.com> Date: Sat, 8 May 2021 01:39:47 +0800 Subject: [PATCH 08/11] Add a blank line for passing checkstyle. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fdd8d41770..e9db4fbdf0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -551,6 +551,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where opening the menu 'Library properties' marked the library as modified [#6451](https://github.com/JabRef/jabref/issues/6451) - We fixed an issue when importing resulted in an exception [#7343](https://github.com/JabRef/jabref/issues/7343) - We fixed an issue Some fields are in random order [#7710](https://github.com/JabRef/jabref/issues/7710) + ### Removed - The feature to "mark entries" was removed and merged with the groups functionality. For migration, a group is created for every value of the `__markedentry` field and the entry is added to this group. From b6adbc487409a7df56578285e3ed72f58c74eeca Mon Sep 17 00:00:00 2001 From: dateri <263765432@qq.com> Date: Sat, 8 May 2021 02:25:41 +0800 Subject: [PATCH 09/11] Make code logic simpler. --- CHANGELOG.md | 2 +- .../FieldFormatterCleanupsPanelViewModel.java | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9db4fbdf0d..8606dfa7ed8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -550,7 +550,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where the XMP Importer would incorrectly return an empty default entry when importing pdfs [#6577](https://github.com/JabRef/jabref/issues/6577) - We fixed an issue where opening the menu 'Library properties' marked the library as modified [#6451](https://github.com/JabRef/jabref/issues/6451) - We fixed an issue when importing resulted in an exception [#7343](https://github.com/JabRef/jabref/issues/7343) -- We fixed an issue Some fields are in random order [#7710](https://github.com/JabRef/jabref/issues/7710) +- We fixed an issue where the field in the Field formatter dropdown selection were sorted in random order. [#7710](https://github.com/JabRef/jabref/issues/7710) ### Removed diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java b/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java index 57fe9dc33d5..fba3c190b43 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java +++ b/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java @@ -17,6 +17,8 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; +import java.util.Comparator; + public class FieldFormatterCleanupsPanelViewModel { private final BooleanProperty cleanupsDisableProperty = new SimpleBooleanProperty(); @@ -28,12 +30,7 @@ public class FieldFormatterCleanupsPanelViewModel { private final ObjectProperty selectedFormatterProperty = new SimpleObjectProperty<>(); public FieldFormatterCleanupsPanelViewModel() { - availableFieldsProperty.sort((field1, field2) -> { - if (field1.getDisplayName().equals(field2.getDisplayName())) { - return 0; - } - return field1.getDisplayName().compareTo(field2.getDisplayName()) > 0 ? 1 : -1; - }); + availableFieldsProperty.sort(Comparator.comparing(Field::getDisplayName)); } public void resetToRecommended() { From 5e98e242a2054c9189be5d397ee01931bde8bc56 Mon Sep 17 00:00:00 2001 From: dateri <263765432@qq.com> Date: Sat, 8 May 2021 03:44:54 +0800 Subject: [PATCH 10/11] fix the order for import. --- .../FieldFormatterCleanupsPanelViewModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java b/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java index fba3c190b43..27f1a27caaa 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java +++ b/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java @@ -1,5 +1,7 @@ package org.jabref.gui.commonfxcontrols; +import java.util.Comparator; + import javafx.beans.property.BooleanProperty; import javafx.beans.property.ListProperty; import javafx.beans.property.ObjectProperty; @@ -17,8 +19,6 @@ import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; -import java.util.Comparator; - public class FieldFormatterCleanupsPanelViewModel { private final BooleanProperty cleanupsDisableProperty = new SimpleBooleanProperty(); From 06943479afebcbc6cbcbcf3886c3d117806bc9f0 Mon Sep 17 00:00:00 2001 From: dateri <263765432@qq.com> Date: Sat, 8 May 2021 04:32:20 +0800 Subject: [PATCH 11/11] fix: use sortedList --- .../FieldFormatterCleanupsPanelViewModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java b/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java index 27f1a27caaa..64da5ba887d 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java +++ b/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java @@ -9,6 +9,7 @@ import javafx.beans.property.SimpleListProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; +import javafx.collections.transformation.SortedList; import javafx.scene.control.SelectionModel; import org.jabref.gui.Globals; @@ -24,13 +25,12 @@ public class FieldFormatterCleanupsPanelViewModel { private final BooleanProperty cleanupsDisableProperty = new SimpleBooleanProperty(); private final ListProperty cleanupsListProperty = new SimpleListProperty<>(FXCollections.observableArrayList()); private final ObjectProperty> selectedCleanupProperty = new SimpleObjectProperty<>(new NoSelectionModel<>()); - private final ListProperty availableFieldsProperty = new SimpleListProperty<>(FXCollections.observableArrayList(FieldFactory.getCommonFields())); + private final ListProperty availableFieldsProperty = new SimpleListProperty<>(new SortedList<>(FXCollections.observableArrayList(FieldFactory.getCommonFields()), Comparator.comparing(Field::getDisplayName))); private final ObjectProperty selectedFieldProperty = new SimpleObjectProperty<>(); private final ListProperty availableFormattersProperty = new SimpleListProperty<>(FXCollections.observableArrayList(Cleanups.getBuiltInFormatters())); private final ObjectProperty selectedFormatterProperty = new SimpleObjectProperty<>(); public FieldFormatterCleanupsPanelViewModel() { - availableFieldsProperty.sort(Comparator.comparing(Field::getDisplayName)); } public void resetToRecommended() {