diff --git a/src/main/java/org/kryptojagd/controls/AbstractController.java b/src/main/java/org/kryptojagd/controls/AbstractController.java index 6710ba6..91a969a 100644 --- a/src/main/java/org/kryptojagd/controls/AbstractController.java +++ b/src/main/java/org/kryptojagd/controls/AbstractController.java @@ -11,6 +11,11 @@ public abstract class AbstractController { */ static MainController mainController; + /** + * Updates the timer in the corresponding window. + */ + void updateTimer(){} + /** * Sets main controller. * diff --git a/src/main/java/org/kryptojagd/controls/DecryptionController.java b/src/main/java/org/kryptojagd/controls/DecryptionController.java index 2110efa..636bd85 100644 --- a/src/main/java/org/kryptojagd/controls/DecryptionController.java +++ b/src/main/java/org/kryptojagd/controls/DecryptionController.java @@ -115,6 +115,7 @@ private void clickAnswer(Button procedure){ * Updates the {@link DecryptionController#timer} every second in the corresponding fxml-file. */ @FXML + @Override void updateTimer() { Timeline time = new Timeline(); time.setCycleCount(Timeline.INDEFINITE); diff --git a/src/main/java/org/kryptojagd/controls/EncryptionController.java b/src/main/java/org/kryptojagd/controls/EncryptionController.java index a8cf602..905ada9 100644 --- a/src/main/java/org/kryptojagd/controls/EncryptionController.java +++ b/src/main/java/org/kryptojagd/controls/EncryptionController.java @@ -64,6 +64,7 @@ void checkEncryption(ActionEvent event) { * Updates the {@link EncryptionController#timer} every second in the corresponding fxml-file. */ @FXML + @Override void updateTimer() { Timeline time = new Timeline(); time.setCycleCount(Timeline.INDEFINITE); diff --git a/src/main/java/org/kryptojagd/controls/MultipleChoiceController.java b/src/main/java/org/kryptojagd/controls/MultipleChoiceController.java index 243842a..1939b59 100644 --- a/src/main/java/org/kryptojagd/controls/MultipleChoiceController.java +++ b/src/main/java/org/kryptojagd/controls/MultipleChoiceController.java @@ -117,6 +117,7 @@ private void clickAnswer(String answer){ * Updates the {@link MultipleChoiceController#timer} every second in the corresponding fxml-file. */ @FXML + @Override void updateTimer() { Timeline time = new Timeline(); time.setCycleCount(Timeline.INDEFINITE); diff --git a/src/main/java/org/kryptojagd/controls/TaskFinishedController.java b/src/main/java/org/kryptojagd/controls/TaskFinishedController.java index 88fb8aa..5a17070 100644 --- a/src/main/java/org/kryptojagd/controls/TaskFinishedController.java +++ b/src/main/java/org/kryptojagd/controls/TaskFinishedController.java @@ -107,6 +107,7 @@ void nextWindow(ActionEvent event) { * Updates the {@link TaskFinishedController#timer} every second in the corresponding fxml-file. */ @FXML + @Override void updateTimer() { Timeline time = new Timeline(); time.setCycleCount(Timeline.INDEFINITE); diff --git a/src/main/java/org/kryptojagd/presentation/PresentationManager.java b/src/main/java/org/kryptojagd/presentation/PresentationManager.java index 168191f..5ebf60b 100644 --- a/src/main/java/org/kryptojagd/presentation/PresentationManager.java +++ b/src/main/java/org/kryptojagd/presentation/PresentationManager.java @@ -1,6 +1,8 @@ package org.kryptojagd.presentation; import java.io.IOException; +import java.util.Objects; + import javafx.application.Platform; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; @@ -34,7 +36,7 @@ public void switchWindow(String str) { Parent root; try { - root = FXMLLoader.load(getClass().getResource(str)); + root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource(str))); // root = loader.load(); Scene scene = new Scene(root); stage.setScene(scene);