From d60f2803a52293dc186b5163f859108cdeae8cfd Mon Sep 17 00:00:00 2001 From: Florian Charlaix Date: Sun, 30 Jan 2022 18:26:06 +0100 Subject: [PATCH] Move ServerConfiguration to GUI package --- .../univ/lyon1/{common => gui}/ServerConfiguration.java | 3 +-- .../univ/lyon1/gui/controller/ApplicationController.java | 9 ++++++++- .../univ/lyon1/gui/controller/ConnectGuiController.java | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) rename src/fr/univ/lyon1/{common => gui}/ServerConfiguration.java (97%) diff --git a/src/fr/univ/lyon1/common/ServerConfiguration.java b/src/fr/univ/lyon1/gui/ServerConfiguration.java similarity index 97% rename from src/fr/univ/lyon1/common/ServerConfiguration.java rename to src/fr/univ/lyon1/gui/ServerConfiguration.java index 9737196..000eb4f 100644 --- a/src/fr/univ/lyon1/common/ServerConfiguration.java +++ b/src/fr/univ/lyon1/gui/ServerConfiguration.java @@ -1,4 +1,4 @@ -package fr.univ.lyon1.common; +package fr.univ.lyon1.gui; import org.jetbrains.annotations.NotNull; @@ -10,7 +10,6 @@ import java.util.Properties; /** * The client server configuration - * ToDo should be in gui and not in common ? */ public record ServerConfiguration(@NotNull String address, int port, @NotNull String pseudo, @NotNull String password) { @NotNull diff --git a/src/fr/univ/lyon1/gui/controller/ApplicationController.java b/src/fr/univ/lyon1/gui/controller/ApplicationController.java index 59f747d..94fcd4c 100644 --- a/src/fr/univ/lyon1/gui/controller/ApplicationController.java +++ b/src/fr/univ/lyon1/gui/controller/ApplicationController.java @@ -3,7 +3,7 @@ package fr.univ.lyon1.gui.controller; import fr.univ.lyon1.common.Channel; import fr.univ.lyon1.common.ChatSSL; import fr.univ.lyon1.common.Message; -import fr.univ.lyon1.common.ServerConfiguration; +import fr.univ.lyon1.gui.ServerConfiguration; import fr.univ.lyon1.common.command.Command; import fr.univ.lyon1.common.command.CommandType; import fr.univ.lyon1.common.exception.ChatException; @@ -258,6 +258,13 @@ public class ApplicationController { } } + /** + * Pars user input to interpret command + * @param textToSend the user input + * @throws UnknownCommand The command is unknown + * @throws NotInChannel the user is not in the channel + * @throws IOException error with the server + */ private void parsInput(String textToSend) throws UnknownCommand, NotInChannel, IOException { if (textToSend.startsWith("/")) { List args = Arrays.asList(textToSend.split(" ")); diff --git a/src/fr/univ/lyon1/gui/controller/ConnectGuiController.java b/src/fr/univ/lyon1/gui/controller/ConnectGuiController.java index c5d6824..381ebf8 100644 --- a/src/fr/univ/lyon1/gui/controller/ConnectGuiController.java +++ b/src/fr/univ/lyon1/gui/controller/ConnectGuiController.java @@ -1,6 +1,6 @@ package fr.univ.lyon1.gui.controller; -import fr.univ.lyon1.common.ServerConfiguration; +import fr.univ.lyon1.gui.ServerConfiguration; import fr.univ.lyon1.gui.Dialog; import fr.univ.lyon1.gui.handlers.ApplicationHandler; import javafx.fxml.FXML;