Style: Apply Spotless
This commit is contained in:
+8
-8
@@ -166,17 +166,17 @@ public class ChatBoxController {
|
||||
if (!activeWhisperChats.contains(target)) {
|
||||
activeWhisperChats.add(target);
|
||||
ChatType whisper = ChatType.WHISPER;
|
||||
chatController
|
||||
.getChatModelMap()
|
||||
.put(new ChatKey(whisper, target), chatModel);
|
||||
chatController.getChatModelMap().put(new ChatKey(whisper, target), chatModel);
|
||||
ChatViewController chatViewController = addChatTab(target, chatModel, whisper);
|
||||
Tab chatTab = chatViewController.getChatTab();
|
||||
chatTab.setOnCloseRequest(_ -> {
|
||||
chatTab.setOnCloseRequest(
|
||||
_ -> {
|
||||
chatViewController.tabIsOpen = false;
|
||||
chatTabPane.getTabs().remove(chatTab);
|
||||
});
|
||||
} else {
|
||||
ChatViewController chatViewController = chatController.activeChatControllers.get(new ChatKey(ChatType.WHISPER, target));
|
||||
ChatViewController chatViewController =
|
||||
chatController.activeChatControllers.get(new ChatKey(ChatType.WHISPER, target));
|
||||
if (!chatViewController.tabIsOpen) {
|
||||
reopenChatTab(chatViewController.getChatTab());
|
||||
chatViewController.tabIsOpen = true;
|
||||
@@ -211,8 +211,7 @@ public class ChatBoxController {
|
||||
} else {
|
||||
chatKey = new ChatKey(chatType);
|
||||
}
|
||||
chatController.activeChatControllers.put(
|
||||
chatKey, chatViewController);
|
||||
chatController.activeChatControllers.put(chatKey, chatViewController);
|
||||
fxmlLoader.setController(chatViewController);
|
||||
Node load = fxmlLoader.load();
|
||||
VBox.setVgrow(load, Priority.ALWAYS);
|
||||
@@ -291,7 +290,8 @@ public class ChatBoxController {
|
||||
}
|
||||
|
||||
public void reopenChatTab(Tab chatTab) {
|
||||
Platform.runLater(() -> {
|
||||
Platform.runLater(
|
||||
() -> {
|
||||
chatTabPane.getTabs().add(chatTab);
|
||||
chatTabPane.getSelectionModel().select(chatTab);
|
||||
});
|
||||
|
||||
+10
-4
@@ -2,15 +2,17 @@ package ch.unibas.dmi.dbis.cs108.casono.client.ui.chatui;
|
||||
|
||||
import ch.unibas.dmi.dbis.cs108.casono.client.chat.ChatController;
|
||||
import ch.unibas.dmi.dbis.cs108.casono.client.chat.ChatModel;
|
||||
import ch.unibas.dmi.dbis.cs108.casono.client.chat.ChatType;
|
||||
import ch.unibas.dmi.dbis.cs108.casono.client.chat.Message;
|
||||
import java.net.URL;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
import javafx.application.Platform;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.ScrollPane;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.layout.VBox;
|
||||
|
||||
@@ -50,7 +52,11 @@ public class ChatViewController implements Initializable {
|
||||
|
||||
private static final int CHAT_PADDING = 20;
|
||||
|
||||
public ChatViewController(ChatController chatController, ChatModel chatModel, String username, ChatBoxController chatBoxController) {
|
||||
public ChatViewController(
|
||||
ChatController chatController,
|
||||
ChatModel chatModel,
|
||||
String username,
|
||||
ChatBoxController chatBoxController) {
|
||||
this.controller = chatController;
|
||||
this.username = username;
|
||||
this.chatModel = chatModel;
|
||||
|
||||
Reference in New Issue
Block a user