Skip to content

Commit

Permalink
update timer is now AbstractController
Browse files Browse the repository at this point in the history
  • Loading branch information
Sv01en committed Feb 6, 2022
2 parents cedfb8c + 84c2b8b commit ab6af44
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/main/java/org/kryptojagd/controls/AbstractController.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public abstract class AbstractController {
*/
static MainController mainController;

/**
* Updates the timer in the corresponding window.
*/
void updateTimer(){}

/**
* Sets main controller.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ab6af44

Please sign in to comment.