diff --git a/dev/20200302/osp1/Viewpane/hellofx/src/main/java/org/openjfx/javaFX/AddController.java b/dev/20200302/osp1/Viewpane/hellofx/src/main/java/org/openjfx/javaFX/AddController.java index c0672ef..e82d2a9 100644 --- a/dev/20200302/osp1/Viewpane/hellofx/src/main/java/org/openjfx/javaFX/AddController.java +++ b/dev/20200302/osp1/Viewpane/hellofx/src/main/java/org/openjfx/javaFX/AddController.java @@ -20,9 +20,11 @@ public class AddController { @FXML protected void addButtonClick(ActionEvent actionEvent) { App.words.add(new WelshDictionary(english.getText(),welsh.getText(),wordType.getText())); + App.words.add(new WelshDictionary("englishcar", "welshcar", "nm")); StringBuilder sb = new StringBuilder(); sb.append("Your Welsh word: ").append(welsh.getText()).append("\n"); sb.append("With English translation: ").append(english.getText()).append("\n"); + sb.append("Word type is: ").append(wordType.getText()).append("\n"); sb.append("Has been added to the dictionary."); english.setText(""); @@ -122,9 +124,7 @@ public class AddController { public void addCharè(ActionEvent actionEvent) { welsh.appendText("è"); } - public void addCharì(ActionEvent actionEvent) { - welsh.appendText("ì"); - } + public void addCharì(ActionEvent actionEvent) { welsh.appendText("ì"); } public void addCharò(ActionEvent actionEvent) { welsh.appendText("ò"); } diff --git a/dev/20200302/osp1/Viewpane/hellofx/src/main/java/org/openjfx/javaFX/ViewboxController.java b/dev/20200302/osp1/Viewpane/hellofx/src/main/java/org/openjfx/javaFX/ViewboxController.java index 18ab550..af5396c 100644 --- a/dev/20200302/osp1/Viewpane/hellofx/src/main/java/org/openjfx/javaFX/ViewboxController.java +++ b/dev/20200302/osp1/Viewpane/hellofx/src/main/java/org/openjfx/javaFX/ViewboxController.java @@ -19,14 +19,16 @@ import org.openjfx.javaFX.App; public class ViewboxController { public ListView EnglishlistView; - @FXML private TextField welsh; - @FXML private TextField english; + @FXML + private TextField welsh; + @FXML + private TextField english; private Scene firstScene; public static final ObservableList names = FXCollections.observableArrayList(); public static final ObservableList data = FXCollections.observableArrayList(); - public void initialize(){ + public void initialize() { } @@ -37,7 +39,7 @@ public class ViewboxController { alert.setHeaderText("Scene switched"); alert.showAndWait(); - Stage primaryStage = (Stage)((Node)actionEvent.getSource()).getScene().getWindow(); + Stage primaryStage = (Stage) ((Node) actionEvent.getSource()).getScene().getWindow(); primaryStage.setScene(firstScene); } @@ -46,15 +48,20 @@ public class ViewboxController { } public void loadList(ActionEvent actionEvent) { + App.words.add(new WelshDictionary("loadListTestEng", "loadListTestWel", "loadListTestWordType")); EnglishlistView.setOrientation(Orientation.VERTICAL); - EnglishlistView.setCellFactory(param -> new ListCell() { @Override protected void updateItem(WelshDictionary item, boolean empty) { super.updateItem(item, empty); - - if (empty || item == null || item.getEnglish() == null||item.getWelsh() == null || item.getWordType() ==null) { + if (empty || item == null || item.getEnglish() == null || item.getWelsh() == null || item.getWordType() == null) { setText(null); + } else if (item.getWordType().equals("verb")) { + setText("to " + item.getEnglish() + " " + item.getWelsh()); + } else if (item.getWordType().equals("nm")) { + setText(item.getEnglish() + " " + item.getWelsh() + " {nm}"); + } else if (item.getWordType().equals("nf")) { + setText(item.getEnglish() + " " + item.getWelsh() + " {nf}"); } else { setText(item.getEnglish() + " " + item.getWelsh()); } diff --git a/dev/20200302/osp1/Viewpane/hellofx/target/classes/org/openjfx/javaFX/AddController.class b/dev/20200302/osp1/Viewpane/hellofx/target/classes/org/openjfx/javaFX/AddController.class index e2db5b8..2f3dbb9 100644 Binary files a/dev/20200302/osp1/Viewpane/hellofx/target/classes/org/openjfx/javaFX/AddController.class and b/dev/20200302/osp1/Viewpane/hellofx/target/classes/org/openjfx/javaFX/AddController.class differ diff --git a/dev/20200302/osp1/Viewpane/hellofx/target/classes/org/openjfx/javaFX/ViewboxController$1.class b/dev/20200302/osp1/Viewpane/hellofx/target/classes/org/openjfx/javaFX/ViewboxController$1.class index b3f36f9..4e9c732 100644 Binary files a/dev/20200302/osp1/Viewpane/hellofx/target/classes/org/openjfx/javaFX/ViewboxController$1.class and b/dev/20200302/osp1/Viewpane/hellofx/target/classes/org/openjfx/javaFX/ViewboxController$1.class differ diff --git a/dev/20200302/osp1/Viewpane/hellofx/target/classes/org/openjfx/javaFX/ViewboxController.class b/dev/20200302/osp1/Viewpane/hellofx/target/classes/org/openjfx/javaFX/ViewboxController.class index dd4e61e..60cc659 100644 Binary files a/dev/20200302/osp1/Viewpane/hellofx/target/classes/org/openjfx/javaFX/ViewboxController.class and b/dev/20200302/osp1/Viewpane/hellofx/target/classes/org/openjfx/javaFX/ViewboxController.class differ diff --git a/dev/20200331/osp1/Welsh Vocabulary Tutor/.idea/workspace.xml b/dev/20200331/osp1/Welsh Vocabulary Tutor/.idea/workspace.xml index 2ab9ee6..a0d42ca 100644 --- a/dev/20200331/osp1/Welsh Vocabulary Tutor/.idea/workspace.xml +++ b/dev/20200331/osp1/Welsh Vocabulary Tutor/.idea/workspace.xml @@ -29,7 +29,7 @@ - + @@ -77,34 +77,34 @@ - + - + - + - - + + - - + + - - + + - - + + - + @@ -129,10 +129,10 @@ - + - + diff --git a/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/App.java b/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/App.java index a6c39f9..554342d 100644 --- a/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/App.java +++ b/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/App.java @@ -1,3 +1,9 @@ +/** + * @(#) App.java 0,1 2020/04/07 + * + * Copyright (c) 2020 Aberystwyth University. + * All rights reserved. + */ package uk.ac.aber.cs22120.group20; import javafx.application.Application; @@ -10,7 +16,7 @@ import java.io.IOException; import java.util.LinkedList; /** - * Launch class of the Welsh Vocabulary tutor Application + * A class that launches the Welsh Vocabulary tutor Application. * * @author Brad Corbett [brc9] * @author Henry Dugmore [hjd3] @@ -21,13 +27,18 @@ import java.util.LinkedList; * @author Tom Perry [top1] * @author Waylen Watts [ncw] * - * @version 0.1 + * @version 0.1 Initial development */ public class App extends Application { private static Scene scene; - public static LinkedList words = new LinkedList<>(); + public static LinkedList words = new LinkedList<>(); + /** + * + * @param stage + * @throws IOException + */ @Override public void start(Stage stage) throws IOException { scene = new Scene(loadFXML("primary")); @@ -35,15 +46,30 @@ public class App extends Application { stage.show(); } + /** + * + * @param fxml + * @throws IOException + */ static void setRoot(String fxml) throws IOException { scene.setRoot(loadFXML(fxml)); } + /** + * + * @param fxml + * @return + * @throws IOException + */ private static Parent loadFXML(String fxml) throws IOException { FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml")); return fxmlLoader.load(); } + /** + * + * @param args + */ public static void main(String[] args) { launch(); } diff --git a/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/DictionaryController.java b/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/DictionaryController.java index 98db24a..1ce30a2 100644 --- a/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/DictionaryController.java +++ b/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/DictionaryController.java @@ -1,78 +1,79 @@ +/** + * @(#) DictionaryController.java 0,1 2020/04/07 + *

+ * Copyright (c) 2020 Aberystwyth University. + * All rights reserved. + */ package uk.ac.aber.cs22120.group20; import javafx.collections.FXCollections; import javafx.collections.ObservableList; -import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.control.cell.PropertyValueFactory; -import javafx.scene.input.MouseEvent; import javafx.stage.Stage; -import javafx.util.Callback; import java.io.IOException; import java.net.URL; import java.util.ResourceBundle; /** - * Placeholder Controller + * A class that handles the keyboard and mouse input and interaction for the 'Dictionary Page' which is + * defined by 'dictionary.fxml' + * + * @author Brad Corbett [brc9] + * @author Henry Dugmore [hjd3] + * @author Kain Bryan-Jones [kab74] + * @author Luke Wybar [law39] + * @author Marcin Jakob [maj83] + * @author Oscar Pocock [osp1] + * @author Tom Perry [top1] + * @author Waylen Watts [ncw] + * @version 0.1 Initial development. + * @see DictionaryEntry + * @see App */ public class DictionaryController implements Initializable { public static Stage primaryStage = null; - @FXML private TableView table; - @FXML private TableColumn english; - @FXML private TableColumn welsh; + @FXML + private TableView table; + @FXML + private TableColumn english; + @FXML + private TableColumn welsh; - private Scene firstScene; - - public ObservableList list = FXCollections.observableArrayList( - new WelshDictionary("abbey", "abaty", "nm"), - new WelshDictionary("believe", "credu", "verb"), - new WelshDictionary("concert", "cyngerdd", "nm"), - new WelshDictionary("disease", "clefyd", "nm"), - new WelshDictionary("extremely", "dros ben", "other"), - new WelshDictionary("flu", "ffliw", "nm") + public ObservableList list = FXCollections.observableArrayList( + new DictionaryEntry("abbey", "abaty", "nm", false), + new DictionaryEntry("believe", "credu", "verb", false), + new DictionaryEntry("concert", "cyngerdd", "nm", false), + new DictionaryEntry("disease", "clefyd", "nm", false), + new DictionaryEntry("extremely", "dros ben", "other", false), + new DictionaryEntry("flu", "ffliw", "nm", false) ); + /** + * Switches to the primary scene. + * @throws IOException + */ @FXML private void switchToPrimary() throws IOException { App.setRoot("primary"); } + /** + * Sets up the table and loads the words into it. + * @param url + * @param resourceBundle + */ @Override public void initialize(URL url, ResourceBundle resourceBundle) { - welsh.setCellValueFactory(new PropertyValueFactory("welsh")); - english.setCellValueFactory(new PropertyValueFactory("english")); + welsh.setCellValueFactory(new PropertyValueFactory("welsh")); + english.setCellValueFactory(new PropertyValueFactory("english")); table.setItems(list); } - } +} - // public void loadList(ActionEvent actionEvent) { -// // FOR TESTING UNTIL JSON PROCESSOR IS FINISHED: LIST VIEW -// englishListView.setOrientation(Orientation.VERTICAL); -// englishListView.setCellFactory(param -> new ListCell() { -// @Override -// protected void updateItem(WelshDictionary item, boolean empty) { -// super.updateItem(item, empty); -// -// if (empty || item == null || item.getEnglish() == null || item.getWelsh() == null || item.getWordType() ==null) { -// setText(null); -// } else { -// setText(item.getEnglish() + " " + item.getWelsh() + " " + item.getWordType()); -// } -// } -// }); -// //ADDING WORDS MANUALLY TILL JSON PROCESSOR IS DONE -// data.addAll(new WelshDictionary("englishCar", "welshCar", "testWordType1"), -// new WelshDictionary("englishCat", "welshCat", "testWordType2"), -// new WelshDictionary("englishDog", "welshDog", "testWordType3"), -// new WelshDictionary("englishStick", "welshStick", "testWordType4") -// ); -//// data.addAll(App.words); -// englishListView.setItems(data); -// } -//} diff --git a/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/DictionaryEntry.java b/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/DictionaryEntry.java new file mode 100644 index 0000000..29644d3 --- /dev/null +++ b/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/DictionaryEntry.java @@ -0,0 +1,144 @@ +/** + * @(#) DictionaryEntry.java 0,1 2020/04/07 + *

+ * Copyright (c) 2020 Aberystwyth University. + * All rights reserved. + */ +package uk.ac.aber.cs22120.group20; + +import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleStringProperty; + +/** + * A class that demonstrates how a controller works. + * + * @author Brad Corbett [brc9] + * @author Henry Dugmore [hjd3] + * @author Kain Bryan-Jones [kab74] + * @author Luke Wybar [law39] + * @author Marcin Jakob [maj83] + * @author Oscar Pocock [osp1] + * @author Tom Perry [top1] + * @author Waylen Watts [ncw] + * @version 0.1 Initial development + * @see DictionaryController + */ +public class DictionaryEntry { + private SimpleStringProperty english; + private SimpleStringProperty welsh; + private SimpleStringProperty wordType; + private SimpleBooleanProperty practiceWord; + + /** + * Creates new instance of a DictionaryEntry + * + * @param english english translation of the word + * @param welsh welsh translation of the word + * @param wordType type of word + * @param practiceWord determines if the entry is in the practice list + * @see App + * @see DictionaryController + */ + public DictionaryEntry(String english, String welsh, String wordType, Boolean practiceWord) { + this.english = new SimpleStringProperty(english); + this.welsh = new SimpleStringProperty(welsh); + this.wordType = new SimpleStringProperty(wordType); + this.practiceWord = new SimpleBooleanProperty(practiceWord); + + } + + /** + * @return the plain text English word in the entry. + */ + public String getEnglish() { + return english.get(); + } + + /** + * + * @return the SimpleStringProperty of the English word in the entry. + */ + public SimpleStringProperty englishProperty() { + return english; + } + + /** + * Sets the English word in the entry. + * @param english the English word you want to set/change. + */ + public void setEnglish(String english) { + this.english.set(english); + } + + /** + * + * @return the plain text Welsh word in the entry. + */ + public String getWelsh() { + return welsh.get(); + } + + /** + * + * @return the SimpleStringProperty of the Welsh word in the entry. + */ + public SimpleStringProperty welshProperty() { + return welsh; + } + + /** + * Sets the Welsh word in the entry. + * @param welsh + */ + public void setWelsh(String welsh) { + this.welsh.set(welsh); + } + + /** + * + * @return + */ + public String getWordType() { + return wordType.get(); + } + + /** + * + * @return + */ + public SimpleStringProperty wordTypeProperty() { + return wordType; + } + + /** + * + * @param wordType + */ + public void setWordType(String wordType) { + this.wordType.set(wordType); + } + + /** + * + * @return + */ + public boolean isPracticeWord() { + return practiceWord.get(); + } + + /** + * + * @return + */ + public SimpleBooleanProperty practiceWordProperty() { + return practiceWord; + } + + /** + * + * @param practiceWord + */ + public void setPracticeWord(boolean practiceWord) { + this.practiceWord.set(practiceWord); + } +} diff --git a/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/PrimaryController.java b/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/PrimaryController.java index b1929a6..401d547 100644 --- a/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/PrimaryController.java +++ b/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/PrimaryController.java @@ -1,9 +1,31 @@ +/** + * @(#) PrimaryController.java 0,1 2020/04/07 + * + * Copyright (c) 2020 Aberystwyth University. + * All rights reserved. + */ package uk.ac.aber.cs22120.group20; import java.io.IOException; import javafx.fxml.FXML; + /** - * Placeholder Controller + * A class that generates a dictionary entry which is made up of: + * 1. a Welsh word + * 2. it's English translation + * 3. it's word type + * 4. whether or not it's a practice word (by default: not a practice word) + * + * @author Brad Corbett [brc9] + * @author Henry Dugmore [hjd3] + * @author Kain Bryan-Jones [kab74] + * @author Luke Wybar [law39] + * @author Marcin Jakob [maj83] + * @author Oscar Pocock [osp1] + * @author Tom Perry [top1] + * @author Waylen Watts [ncw] + * @version 0.1 Initial development + * @see App */ public class PrimaryController { diff --git a/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/SecondaryController.java b/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/SecondaryController.java index 273a027..8d40e2d 100644 --- a/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/SecondaryController.java +++ b/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/SecondaryController.java @@ -1,9 +1,27 @@ +/** + * @(#) SecondaryController.java 0,1 2020/04/07 + * + * Copyright (c) 2020 Aberystwyth University. + * All rights reserved. + */ package uk.ac.aber.cs22120.group20; import java.io.IOException; import javafx.fxml.FXML; + /** - * Placeholder Controller + * A class that demonstrates how a controller works. + * + * @author Brad Corbett [brc9] + * @author Henry Dugmore [hjd3] + * @author Kain Bryan-Jones [kab74] + * @author Luke Wybar [law39] + * @author Marcin Jakob [maj83] + * @author Oscar Pocock [osp1] + * @author Tom Perry [top1] + * @author Waylen Watts [ncw] + * @version 0.1 Initial development + * @see App */ public class SecondaryController { diff --git a/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/WelshDictionary.java b/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/WelshDictionary.java deleted file mode 100644 index e9cb6df..0000000 --- a/dev/20200331/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/WelshDictionary.java +++ /dev/null @@ -1,39 +0,0 @@ -package uk.ac.aber.cs22120.group20; - -import javafx.beans.property.SimpleStringProperty; - -public class WelshDictionary { - private SimpleStringProperty english; - private SimpleStringProperty welsh; - private SimpleStringProperty wordType; - - public WelshDictionary(String english, String welsh, String wordType) { - this.english = new SimpleStringProperty(english); - this.welsh = new SimpleStringProperty(welsh); - this.wordType = new SimpleStringProperty(wordType); - } - - public String getWelsh() { - return welsh.get(); - } - - public SimpleStringProperty welshProperty() { - return welsh; - } - - public String getEnglish() { - return english.get(); - } - - public SimpleStringProperty englishProperty() { - return english; - } - - public String getWordType() { - return wordType.get(); - } - - public SimpleStringProperty wordTypeProperty() { - return wordType; - } -} diff --git a/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/App.class b/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/App.class index 723fbb1..a4a5496 100644 Binary files a/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/App.class and b/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/App.class differ diff --git a/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/DictionaryController.class b/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/DictionaryController.class index a379ae4..fda571a 100644 Binary files a/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/DictionaryController.class and b/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/DictionaryController.class differ diff --git a/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/DictionaryEntry.class b/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/DictionaryEntry.class new file mode 100644 index 0000000..d27a378 Binary files /dev/null and b/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/DictionaryEntry.class differ diff --git a/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/PrimaryController.class b/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/PrimaryController.class index 91ab430..44e9c23 100644 Binary files a/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/PrimaryController.class and b/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/PrimaryController.class differ diff --git a/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/SecondaryController.class b/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/SecondaryController.class index 4a8d928..7d5b240 100644 Binary files a/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/SecondaryController.class and b/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/SecondaryController.class differ diff --git a/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/WelshDictionary.class b/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/WelshDictionary.class deleted file mode 100644 index 1e4cd27..0000000 Binary files a/dev/20200331/osp1/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/WelshDictionary.class and /dev/null differ diff --git a/dev/20200407/.gitkeep b/dev/20200407/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/compiler.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/compiler.xml new file mode 100644 index 0000000..a673ce6 --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/compiler.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/encodings.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_base_11.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_base_11.xml new file mode 100644 index 0000000..88eebdf --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_base_11.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_base_linux_11.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_base_linux_11.xml new file mode 100644 index 0000000..b59bf8f --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_base_linux_11.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_controls_11.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_controls_11.xml new file mode 100644 index 0000000..40e5c7e --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_controls_11.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_controls_linux_11.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_controls_linux_11.xml new file mode 100644 index 0000000..af54a59 --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_controls_linux_11.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_fxml_11.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_fxml_11.xml new file mode 100644 index 0000000..3eaa3ca --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_fxml_11.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_fxml_linux_11.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_fxml_linux_11.xml new file mode 100644 index 0000000..0c647c0 --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_fxml_linux_11.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_graphics_11.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_graphics_11.xml new file mode 100644 index 0000000..adbd0c7 --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_graphics_11.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_graphics_linux_11.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_graphics_linux_11.xml new file mode 100644 index 0000000..ad6732e --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/Maven__org_openjfx_javafx_graphics_linux_11.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/com_fasterxml_jackson_core_jackson_databind_2_9_4.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/com_fasterxml_jackson_core_jackson_databind_2_9_4.xml new file mode 100644 index 0000000..92c5003 --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/libraries/com_fasterxml_jackson_core_jackson_databind_2_9_4.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/misc.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/misc.xml new file mode 100644 index 0000000..7193838 --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/misc.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/modules.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/modules.xml new file mode 100644 index 0000000..7199637 --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/uiDesigner.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/workspace.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/workspace.xml new file mode 100644 index 0000000..a0d42ca --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/.idea/workspace.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1585772505035 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/Welsh Vocabulary Tutor.iml b/dev/20200407/osp1/Welsh Vocabulary Tutor/Welsh Vocabulary Tutor.iml new file mode 100644 index 0000000..4bcd5a8 --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/Welsh Vocabulary Tutor.iml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/pom.xml b/dev/20200407/osp1/Welsh Vocabulary Tutor/pom.xml new file mode 100644 index 0000000..d2e762f --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/pom.xml @@ -0,0 +1,44 @@ + + 4.0.0 + uk.ac.aber.cs22120.group20 + Welsh Vocabulary Tutor + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 11 + + + org.openjfx + javafx-fxml + 11 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.1 + + uk.ac.aber.cs22120.group20.App + + + + + \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/module-info.java b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/module-info.java new file mode 100644 index 0000000..9305364 --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/module-info.java @@ -0,0 +1,9 @@ +module uk.ac.aber.cs22120.group20 { + requires javafx.controls; + requires javafx.fxml; + requires com.fasterxml.jackson.core; + requires com.fasterxml.jackson.databind; + + opens uk.ac.aber.cs22120.group20 to javafx.fxml; + exports uk.ac.aber.cs22120.group20; +} \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/App.java b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/App.java new file mode 100644 index 0000000..554342d --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/App.java @@ -0,0 +1,77 @@ +/** + * @(#) App.java 0,1 2020/04/07 + * + * Copyright (c) 2020 Aberystwyth University. + * All rights reserved. + */ +package uk.ac.aber.cs22120.group20; + +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; + +import java.io.IOException; +import java.util.LinkedList; + +/** + * A class that launches the Welsh Vocabulary tutor Application. + * + * @author Brad Corbett [brc9] + * @author Henry Dugmore [hjd3] + * @author Kain Bryan-Jones [kab74] + * @author Luke Wybar [law39] + * @author Marcin Jakob [maj83] + * @author Oscar Pocock [osp1] + * @author Tom Perry [top1] + * @author Waylen Watts [ncw] + * + * @version 0.1 Initial development + */ +public class App extends Application { + private static Scene scene; + + public static LinkedList words = new LinkedList<>(); + + /** + * + * @param stage + * @throws IOException + */ + @Override + public void start(Stage stage) throws IOException { + scene = new Scene(loadFXML("primary")); + stage.setScene(scene); + stage.show(); + } + + /** + * + * @param fxml + * @throws IOException + */ + static void setRoot(String fxml) throws IOException { + scene.setRoot(loadFXML(fxml)); + } + + /** + * + * @param fxml + * @return + * @throws IOException + */ + private static Parent loadFXML(String fxml) throws IOException { + FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml")); + return fxmlLoader.load(); + } + + /** + * + * @param args + */ + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/DictionaryController.java b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/DictionaryController.java new file mode 100644 index 0000000..1ce30a2 --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/DictionaryController.java @@ -0,0 +1,79 @@ +/** + * @(#) DictionaryController.java 0,1 2020/04/07 + *

+ * Copyright (c) 2020 Aberystwyth University. + * All rights reserved. + */ +package uk.ac.aber.cs22120.group20; + +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.scene.Scene; +import javafx.scene.control.*; +import javafx.scene.control.cell.PropertyValueFactory; +import javafx.stage.Stage; + +import java.io.IOException; +import java.net.URL; +import java.util.ResourceBundle; + +/** + * A class that handles the keyboard and mouse input and interaction for the 'Dictionary Page' which is + * defined by 'dictionary.fxml' + * + * @author Brad Corbett [brc9] + * @author Henry Dugmore [hjd3] + * @author Kain Bryan-Jones [kab74] + * @author Luke Wybar [law39] + * @author Marcin Jakob [maj83] + * @author Oscar Pocock [osp1] + * @author Tom Perry [top1] + * @author Waylen Watts [ncw] + * @version 0.1 Initial development. + * @see DictionaryEntry + * @see App + */ +public class DictionaryController implements Initializable { + public static Stage primaryStage = null; + + @FXML + private TableView table; + @FXML + private TableColumn english; + @FXML + private TableColumn welsh; + + public ObservableList list = FXCollections.observableArrayList( + new DictionaryEntry("abbey", "abaty", "nm", false), + new DictionaryEntry("believe", "credu", "verb", false), + new DictionaryEntry("concert", "cyngerdd", "nm", false), + new DictionaryEntry("disease", "clefyd", "nm", false), + new DictionaryEntry("extremely", "dros ben", "other", false), + new DictionaryEntry("flu", "ffliw", "nm", false) + ); + + /** + * Switches to the primary scene. + * @throws IOException + */ + @FXML + private void switchToPrimary() throws IOException { + App.setRoot("primary"); + } + + /** + * Sets up the table and loads the words into it. + * @param url + * @param resourceBundle + */ + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + welsh.setCellValueFactory(new PropertyValueFactory("welsh")); + english.setCellValueFactory(new PropertyValueFactory("english")); + table.setItems(list); + } + +} + diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/DictionaryEntry.java b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/DictionaryEntry.java new file mode 100644 index 0000000..29644d3 --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/DictionaryEntry.java @@ -0,0 +1,144 @@ +/** + * @(#) DictionaryEntry.java 0,1 2020/04/07 + *

+ * Copyright (c) 2020 Aberystwyth University. + * All rights reserved. + */ +package uk.ac.aber.cs22120.group20; + +import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleStringProperty; + +/** + * A class that demonstrates how a controller works. + * + * @author Brad Corbett [brc9] + * @author Henry Dugmore [hjd3] + * @author Kain Bryan-Jones [kab74] + * @author Luke Wybar [law39] + * @author Marcin Jakob [maj83] + * @author Oscar Pocock [osp1] + * @author Tom Perry [top1] + * @author Waylen Watts [ncw] + * @version 0.1 Initial development + * @see DictionaryController + */ +public class DictionaryEntry { + private SimpleStringProperty english; + private SimpleStringProperty welsh; + private SimpleStringProperty wordType; + private SimpleBooleanProperty practiceWord; + + /** + * Creates new instance of a DictionaryEntry + * + * @param english english translation of the word + * @param welsh welsh translation of the word + * @param wordType type of word + * @param practiceWord determines if the entry is in the practice list + * @see App + * @see DictionaryController + */ + public DictionaryEntry(String english, String welsh, String wordType, Boolean practiceWord) { + this.english = new SimpleStringProperty(english); + this.welsh = new SimpleStringProperty(welsh); + this.wordType = new SimpleStringProperty(wordType); + this.practiceWord = new SimpleBooleanProperty(practiceWord); + + } + + /** + * @return the plain text English word in the entry. + */ + public String getEnglish() { + return english.get(); + } + + /** + * + * @return the SimpleStringProperty of the English word in the entry. + */ + public SimpleStringProperty englishProperty() { + return english; + } + + /** + * Sets the English word in the entry. + * @param english the English word you want to set/change. + */ + public void setEnglish(String english) { + this.english.set(english); + } + + /** + * + * @return the plain text Welsh word in the entry. + */ + public String getWelsh() { + return welsh.get(); + } + + /** + * + * @return the SimpleStringProperty of the Welsh word in the entry. + */ + public SimpleStringProperty welshProperty() { + return welsh; + } + + /** + * Sets the Welsh word in the entry. + * @param welsh + */ + public void setWelsh(String welsh) { + this.welsh.set(welsh); + } + + /** + * + * @return + */ + public String getWordType() { + return wordType.get(); + } + + /** + * + * @return + */ + public SimpleStringProperty wordTypeProperty() { + return wordType; + } + + /** + * + * @param wordType + */ + public void setWordType(String wordType) { + this.wordType.set(wordType); + } + + /** + * + * @return + */ + public boolean isPracticeWord() { + return practiceWord.get(); + } + + /** + * + * @return + */ + public SimpleBooleanProperty practiceWordProperty() { + return practiceWord; + } + + /** + * + * @param practiceWord + */ + public void setPracticeWord(boolean practiceWord) { + this.practiceWord.set(practiceWord); + } +} diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/PrimaryController.java b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/PrimaryController.java new file mode 100644 index 0000000..401d547 --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/PrimaryController.java @@ -0,0 +1,36 @@ +/** + * @(#) PrimaryController.java 0,1 2020/04/07 + * + * Copyright (c) 2020 Aberystwyth University. + * All rights reserved. + */ +package uk.ac.aber.cs22120.group20; + +import java.io.IOException; +import javafx.fxml.FXML; + +/** + * A class that generates a dictionary entry which is made up of: + * 1. a Welsh word + * 2. it's English translation + * 3. it's word type + * 4. whether or not it's a practice word (by default: not a practice word) + * + * @author Brad Corbett [brc9] + * @author Henry Dugmore [hjd3] + * @author Kain Bryan-Jones [kab74] + * @author Luke Wybar [law39] + * @author Marcin Jakob [maj83] + * @author Oscar Pocock [osp1] + * @author Tom Perry [top1] + * @author Waylen Watts [ncw] + * @version 0.1 Initial development + * @see App + */ +public class PrimaryController { + + @FXML + private void switchToSecondary() throws IOException { + App.setRoot("secondary"); + } +} diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/SecondaryController.java b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/SecondaryController.java new file mode 100644 index 0000000..8d40e2d --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/SecondaryController.java @@ -0,0 +1,32 @@ +/** + * @(#) SecondaryController.java 0,1 2020/04/07 + * + * Copyright (c) 2020 Aberystwyth University. + * All rights reserved. + */ +package uk.ac.aber.cs22120.group20; + +import java.io.IOException; +import javafx.fxml.FXML; + +/** + * A class that demonstrates how a controller works. + * + * @author Brad Corbett [brc9] + * @author Henry Dugmore [hjd3] + * @author Kain Bryan-Jones [kab74] + * @author Luke Wybar [law39] + * @author Marcin Jakob [maj83] + * @author Oscar Pocock [osp1] + * @author Tom Perry [top1] + * @author Waylen Watts [ncw] + * @version 0.1 Initial development + * @see App + */ +public class SecondaryController { + + @FXML + private void switchToDictionary() throws IOException { + App.setRoot("dictionary"); + } +} \ No newline at end of file diff --git a/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/dictionary.fxml b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/dictionary.fxml new file mode 100644 index 0000000..5c96094 --- /dev/null +++ b/dev/20200407/osp1/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/dictionary.fxml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +