From 3e1050863ad09827c8854a0672411d48b99576d0 Mon Sep 17 00:00:00 2001 From: Henry Dugmore Date: Fri, 1 May 2020 12:49:18 +0100 Subject: [PATCH 1/2] Fixed //comments in code to fit SE.QA.09 fixed comment formatting to fit SE.QA.09 --- .../uk/ac/aber/cs221/group20/javafx/AddWordController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/AddWordController.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/AddWordController.java index 8b83230..ba6a64a 100644 --- a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/AddWordController.java +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/AddWordController.java @@ -103,6 +103,7 @@ public class AddWordController extends SharedCodeController { trueWordType = DictionaryEntry.wordTypeEnum.other; } boolean entryFound = false; + // test for one or more blank fields and if there is create the correct error dialogue box if (english.getText().isBlank() || welsh.getText().isBlank() || wordType.getValue().equals("Type")) { Alert error = new Alert(Alert.AlertType.ERROR); @@ -113,6 +114,7 @@ public class AddWordController extends SharedCodeController { error.showAndWait(); } else { for (DictionaryEntry entry : Application.dictionary) { + //test if the entry exists in the dictionary and if it does create the correct error dialogue box entryFound = false; DictionaryEntry newEntry = new DictionaryEntry(english.getText(), welsh.getText(), trueWordType); @@ -130,6 +132,7 @@ public class AddWordController extends SharedCodeController { } } if (!entryFound) { + //if everything is fine, save the entered values as a dictionary entry in the dictionary Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setTitle("Success"); @@ -165,6 +168,7 @@ public class AddWordController extends SharedCodeController { * * @param actionEvent action event for the button click */ + // add character methods for characters ch, dd, ff, ng, ll, ph, rh, th public void addCharch(ActionEvent actionEvent) { welsh.appendText("ch"); From d83f9e6da1b2d98b52d9365fb0923c092bd9d266 Mon Sep 17 00:00:00 2001 From: law39 Date: Fri, 1 May 2020 13:01:02 +0100 Subject: [PATCH 2/2] Added JavaDoc to the Dictionary Controller. Issue #37 --- .../cs221/group20/javafx/DictionaryController.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/DictionaryController.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/DictionaryController.java index ca79637..8ad61b2 100644 --- a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/DictionaryController.java +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs221/group20/javafx/DictionaryController.java @@ -62,7 +62,10 @@ public class DictionaryController extends SharedCodeController { public ObservableList list = FXCollections.observableArrayList(); /** - * + * Method to switch the language used to sort the dictionary list. + *

+ * If currently sorted by English, this will change the sort to by Welsh. + * If currently sorted by Welsh, this will change the sort to by English. */ @FXML private void switchLangSort() { @@ -97,7 +100,10 @@ public class DictionaryController extends SharedCodeController { } /** - * + * Method to switch the alphabetical order used to sort the dictionary list. + *

+ * If currently sorted by A-Z, this will change the sort to by Z-A. + * If currently sorted by Z-A, this will change the sort to by A-Z. */ @FXML private void switchAlphaSort() {