From 6950810b952f9f4d4230db422ff7f6f7d6aade0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 5 Mar 2025 23:29:58 +0100 Subject: [PATCH] Basic structure for GUI --- .../src/main/java/client/ClientLoading.java | 16 +++++++++- .../main/resources/client/clientLoading.fxml | 2 +- .../src/main/resources/client/clientVue.fxml | 32 ++++++++++++++++--- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/ChatApp/app/src/main/java/client/ClientLoading.java b/ChatApp/app/src/main/java/client/ClientLoading.java index aa59293..cb98540 100644 --- a/ChatApp/app/src/main/java/client/ClientLoading.java +++ b/ChatApp/app/src/main/java/client/ClientLoading.java @@ -2,18 +2,32 @@ package client; import javafx.animation.RotateTransition; import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; +import javafx.scene.Scene; import javafx.scene.shape.Arc; +import javafx.stage.Stage; import javafx.util.Duration; +import java.io.IOException; +import static utilities.FxUtilities.centerStage; + public class ClientLoading { @FXML private Arc spinnerArc; - public void initialize() { + public void initialize() throws IOException, InterruptedException { // Création de l'animation de rotation RotateTransition rotate = new RotateTransition(Duration.seconds(1), spinnerArc); rotate.setByAngle(360); rotate.setCycleCount(RotateTransition.INDEFINITE); rotate.play(); } + + public void login() throws IOException { + var loader = new FXMLLoader(getClass().getResource("/client/clientVue.fxml")); + loader.load(); + Stage stage = (Stage) spinnerArc.getScene().getWindow(); + stage.setScene(new Scene(loader.getRoot(), 800, 600)); + centerStage(stage); + } } diff --git a/ChatApp/app/src/main/resources/client/clientLoading.fxml b/ChatApp/app/src/main/resources/client/clientLoading.fxml index 5c5ce8e..8d57d72 100644 --- a/ChatApp/app/src/main/resources/client/clientLoading.fxml +++ b/ChatApp/app/src/main/resources/client/clientLoading.fxml @@ -7,6 +7,6 @@ \ No newline at end of file diff --git a/ChatApp/app/src/main/resources/client/clientVue.fxml b/ChatApp/app/src/main/resources/client/clientVue.fxml index 6830bc8..9821bc5 100644 --- a/ChatApp/app/src/main/resources/client/clientVue.fxml +++ b/ChatApp/app/src/main/resources/client/clientVue.fxml @@ -7,15 +7,39 @@ + + - + - - - + + + + + + + + + + + + + + + + + +