From 10157362834a78d8ed93e61f9f338ef713e22a61 Mon Sep 17 00:00:00 2001 From: law39 Date: Wed, 1 Apr 2020 02:41:00 +0100 Subject: [PATCH] Added Programming Project Added base template project including: basic javadoc comments. Maven JavaFX setup. Placeholder JavaFX controllers and FXML files. --- src/Welsh Vocabulary Tutor/.idea/compiler.xml | 13 +++ .../.idea/encodings.xml | 7 ++ src/Welsh Vocabulary Tutor/.idea/misc.xml | 14 +++ .../.idea/workspace.xml | 90 ++++++++++++++++++ .../Welsh Vocabulary Tutor.iml | 2 + src/Welsh Vocabulary Tutor/pom.xml | 44 +++++++++ .../src/main/java/module-info.java | 7 ++ .../java/uk/ac/aber/cs22120/group20/App.java | 48 ++++++++++ .../cs22120/group20/PrimaryController.java | 14 +++ .../cs22120/group20/SecondaryController.java | 14 +++ .../uk/ac/aber/cs22120/group20/primary.fxml | 16 ++++ .../uk/ac/aber/cs22120/group20/secondary.fxml | 16 ++++ .../target/classes/module-info.class | Bin 0 -> 270 bytes .../uk/ac/aber/cs22120/group20/App.class | Bin 0 -> 1923 bytes .../cs22120/group20/PrimaryController.class | Bin 0 -> 620 bytes .../cs22120/group20/SecondaryController.class | Bin 0 -> 622 bytes .../uk/ac/aber/cs22120/group20/primary.fxml | 16 ++++ .../uk/ac/aber/cs22120/group20/secondary.fxml | 16 ++++ 18 files changed, 317 insertions(+) create mode 100644 src/Welsh Vocabulary Tutor/.idea/compiler.xml create mode 100644 src/Welsh Vocabulary Tutor/.idea/encodings.xml create mode 100644 src/Welsh Vocabulary Tutor/.idea/misc.xml create mode 100644 src/Welsh Vocabulary Tutor/.idea/workspace.xml create mode 100644 src/Welsh Vocabulary Tutor/Welsh Vocabulary Tutor.iml create mode 100644 src/Welsh Vocabulary Tutor/pom.xml create mode 100644 src/Welsh Vocabulary Tutor/src/main/java/module-info.java create mode 100644 src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/App.java create mode 100644 src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/PrimaryController.java create mode 100644 src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/SecondaryController.java create mode 100644 src/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/primary.fxml create mode 100644 src/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/secondary.fxml create mode 100644 src/Welsh Vocabulary Tutor/target/classes/module-info.class create mode 100644 src/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/App.class create mode 100644 src/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/PrimaryController.class create mode 100644 src/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/SecondaryController.class create mode 100644 src/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/primary.fxml create mode 100644 src/Welsh Vocabulary Tutor/target/classes/uk/ac/aber/cs22120/group20/secondary.fxml diff --git a/src/Welsh Vocabulary Tutor/.idea/compiler.xml b/src/Welsh Vocabulary Tutor/.idea/compiler.xml new file mode 100644 index 0000000..0c465ee --- /dev/null +++ b/src/Welsh Vocabulary Tutor/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Welsh Vocabulary Tutor/.idea/encodings.xml b/src/Welsh Vocabulary Tutor/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/src/Welsh Vocabulary Tutor/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/Welsh Vocabulary Tutor/.idea/misc.xml b/src/Welsh Vocabulary Tutor/.idea/misc.xml new file mode 100644 index 0000000..d24ea8e --- /dev/null +++ b/src/Welsh Vocabulary Tutor/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/Welsh Vocabulary Tutor/.idea/workspace.xml b/src/Welsh Vocabulary Tutor/.idea/workspace.xml new file mode 100644 index 0000000..abf7dc2 --- /dev/null +++ b/src/Welsh Vocabulary Tutor/.idea/workspace.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1585703857421 + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Welsh Vocabulary Tutor/Welsh Vocabulary Tutor.iml b/src/Welsh Vocabulary Tutor/Welsh Vocabulary Tutor.iml new file mode 100644 index 0000000..78b2cc5 --- /dev/null +++ b/src/Welsh Vocabulary Tutor/Welsh Vocabulary Tutor.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Welsh Vocabulary Tutor/pom.xml b/src/Welsh Vocabulary Tutor/pom.xml new file mode 100644 index 0000000..d2e762f --- /dev/null +++ b/src/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/src/Welsh Vocabulary Tutor/src/main/java/module-info.java b/src/Welsh Vocabulary Tutor/src/main/java/module-info.java new file mode 100644 index 0000000..5d44bb3 --- /dev/null +++ b/src/Welsh Vocabulary Tutor/src/main/java/module-info.java @@ -0,0 +1,7 @@ +module uk.ac.aber.cs22120.group20 { + requires javafx.controls; + requires javafx.fxml; + + opens uk.ac.aber.cs22120.group20 to javafx.fxml; + exports uk.ac.aber.cs22120.group20; +} \ No newline at end of file diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/App.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/App.java new file mode 100644 index 0000000..8b5c64d --- /dev/null +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/App.java @@ -0,0 +1,48 @@ +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; + +/** + * Launch class of 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 + */ +public class App extends Application { + private static Scene scene; + + @Override + public void start(Stage stage) throws IOException { + scene = new Scene(loadFXML("primary")); + stage.setScene(scene); + stage.show(); + } + + static void setRoot(String fxml) throws IOException { + scene.setRoot(loadFXML(fxml)); + } + + private static Parent loadFXML(String fxml) throws IOException { + FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml")); + return fxmlLoader.load(); + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/PrimaryController.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/PrimaryController.java new file mode 100644 index 0000000..b1929a6 --- /dev/null +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/PrimaryController.java @@ -0,0 +1,14 @@ +package uk.ac.aber.cs22120.group20; + +import java.io.IOException; +import javafx.fxml.FXML; +/** + * Placeholder Controller + */ +public class PrimaryController { + + @FXML + private void switchToSecondary() throws IOException { + App.setRoot("secondary"); + } +} diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/SecondaryController.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/SecondaryController.java new file mode 100644 index 0000000..94eb1ac --- /dev/null +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/SecondaryController.java @@ -0,0 +1,14 @@ +package uk.ac.aber.cs22120.group20; + +import java.io.IOException; +import javafx.fxml.FXML; +/** + * Placeholder Controller + */ +public class SecondaryController { + + @FXML + private void switchToPrimary() throws IOException { + App.setRoot("primary"); + } +} \ No newline at end of file diff --git a/src/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/primary.fxml b/src/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/primary.fxml new file mode 100644 index 0000000..e2ba159 --- /dev/null +++ b/src/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/primary.fxml @@ -0,0 +1,16 @@ + + + + + + + + + +