Style: Apply Spotless

This commit is contained in:
Mathis Ginkel
2026-04-10 22:43:23 +02:00
parent 31d3947175
commit 97e5a55042
18 changed files with 136 additions and 151 deletions
@@ -3,7 +3,7 @@ package ch.unibas.dmi.dbis.cs108.casono.client.chat;
import javafx.application.Application;
public class Chat {
public static void main(String[] args) {
Application.launch(ChatApplication.class);
}
public static void main(String[] args) {
Application.launch(ChatApplication.class);
}
}
@@ -3,13 +3,12 @@ package ch.unibas.dmi.dbis.cs108.casono.client.chat;
import ch.unibas.dmi.dbis.cs108.casono.client.network.ClientService;
import ch.unibas.dmi.dbis.cs108.casono.client.network.CoreClient;
import ch.unibas.dmi.dbis.cs108.casono.client.ui.chatui.ChatBoxController;
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
public class ChatApplication extends Application {
private static final int SCENE_WIDTH = 1200;
@@ -21,30 +20,19 @@ public class ChatApplication extends Application {
public ChatApplication() {}
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/ui-structure/components/chatui/chatbox.fxml"));
FXMLLoader fxmlLoader =
new FXMLLoader(
getClass().getResource("/ui-structure/components/chatui/chatbox.fxml"));
ClientService clientService = new ClientService(ip, port);
CoreClient coreClient = new CoreClient(clientService);
// TODO login UI
coreClient.login(username);
ChatController chatController = new ChatController(username, clientService);
ChatBoxController chatBoxController = new ChatBoxController(username, chatController);
fxmlLoader.setController(chatBoxController);
/*fxmlLoader.setControllerFactory(type -> {
if (type == ChatBoxController.class) {
return chatController.getChatBoxController();
} else {
try {
return type.getConstructor().newInstance();
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
});*/
Scene scene = new Scene(fxmlLoader.load(), SCENE_WIDTH, SCENE_HEIGHT);
stage.setTitle("Chat");
stage.setScene(scene);
stage.show();
}
}