Skip to content
Snippets Groups Projects
Commit 866ef627 authored by Eilert Tunheim's avatar Eilert Tunheim
Browse files

Added popup window when 3,1 and 0 hours left

parent 5d8b36fb
No related branches found
No related tags found
No related merge requests found
package com.application.DB;
import com.application.GUI.NotificationPopUp;
import com.google.cloud.bigquery.*;
import org.joda.time.DateTime;
......@@ -28,7 +29,7 @@ public class DB {
//getName();
//getZeroPointDate();
//System.out.println(setInputParameters());
getNoOfChambers();
//getNoOfChambers();
}
......
......@@ -459,9 +459,13 @@ public class LineChartFunctionality {
if(time > 60){
time = time/60;
Main.setTimeLeftText(time + " h");
if(time == 3){NotificationPopUp.displayNotificationWindow("3 Hours Left!");}
} else {
NotificationPopUp.displayNotificationWindow("1 Hour Left!");
Main.setTimeLeftText(time + " min");
}
if(time == 0){
NotificationPopUp.displayNotificationWindow("Drying Process Finished!");
}
}
......
package com.application.GUI;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.stage.Modality;
import javafx.stage.Stage;
public class NotificationPopUp {
public static void displayNotificationWindow(String message){
Stage window = new Stage();
window.initModality(Modality.APPLICATION_MODAL);
window.setTitle("Moisture Check");
Label messageLabel = new Label();
messageLabel.setText(message);
Button close = new Button("Close");
close.setOnAction(event -> window.close());
VBox layout = new VBox(10);
layout.setAlignment(Pos.CENTER);
layout.getChildren().addAll(messageLabel,close);
Scene scene = new Scene(layout, 300, 200);
scene.getStylesheets().add(InputPopUpWindow.class.getResource("/com.application/CSS/styleSheet.css").toExternalForm());
window.setScene(scene);
window.showAndWait();
}
}
No preview for this file type
No preview for this file type
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment