From 98ab901a5111c3e895a8f6c97d36d0503864fdad Mon Sep 17 00:00:00 2001 From: top19 Date: Wed, 29 Apr 2020 17:41:57 +0100 Subject: [PATCH] Integrated flashcard with menu --- .../group20/javafx/FlashcardController.java | 18 +- .../uk/ac/aber/cs22120/group20/flashcard.fxml | 201 +++++++++++++++--- 2 files changed, 179 insertions(+), 40 deletions(-) diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/FlashcardController.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/FlashcardController.java index 90ed52d..f5dc1dc 100644 --- a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/FlashcardController.java +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/javafx/FlashcardController.java @@ -5,6 +5,7 @@ import javafx.fxml.FXML; import javafx.scene.Node; import javafx.scene.image.Image; import javafx.scene.image.ImageView; +import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import javafx.scene.text.Text; import javafx.scene.transform.Rotate; @@ -30,7 +31,7 @@ import java.io.IOException; * @see SharedCodeController */ -public class FlashcardController { +public class FlashcardController extends SharedCodeController { // /////////////////// // // Instance Variables. // @@ -49,9 +50,9 @@ public class FlashcardController { private Text testWord; @FXML - private ImageView left_arrow; + private ImageView leftArrow; @FXML - private ImageView right_arrow; + private ImageView rightArrow; // //////// // // Methods. // @@ -63,14 +64,21 @@ public class FlashcardController { */ @FXML private void initialize() { + // Call method from SharedCodeController to setup the menu screen. + setup(); + currentPageIcon.setImage(new Image("file:src/main/resources/assets/icons/white_icons/50px/flashcard-50.png")); + currentPageText.setText("Flashcard"); + flashcardIcon.setImage(new Image("file:src/main/resources/assets/icons/black_icons/50px/flashcard-50.png")); + flashcardsText.setFill(Color.BLACK); + testWord.setText(Application.practiseList.getFirst().getWelsh()); wordType.setText("Welsh"); updateCounter(); card = flashcard; - left_arrow.setImage(new Image(getClass().getResourceAsStream("/assets/icons/black_icons/50px/left-50.png"))); - right_arrow.setImage(new Image(getClass().getResourceAsStream("/assets/icons/black_icons/50px/right-50.png"))); + leftArrow.setImage(new Image(getClass().getResourceAsStream("/assets/icons/black_icons/50px/left-50.png"))); + rightArrow.setImage(new Image(getClass().getResourceAsStream("/assets/icons/black_icons/50px/right-50.png"))); } /** diff --git a/src/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/flashcard.fxml b/src/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/flashcard.fxml index 69fa448..f70bb77 100644 --- a/src/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/flashcard.fxml +++ b/src/Welsh Vocabulary Tutor/src/main/resources/uk/ac/aber/cs22120/group20/flashcard.fxml @@ -1,45 +1,176 @@ - - - - - - - + + + + - - + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - - - - - - - - + + +
+ + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + - -
+ + + + + + + + + + + + + + + + + +