From cace49bd68c4854d7c4f9351bff2e6a931b778e3 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Sat, 28 Mar 2020 10:39:15 +0100 Subject: [PATCH] Added custom list cells for the user and message list views --- src/main/java/envoy/client/Startup.java | 53 +++--- src/main/java/envoy/client/ui/ChatScene.fxml | 37 ++-- .../envoy/client/ui/ChatSceneController.java | 13 ++ .../java/envoy/client/ui/MessageListCell.java | 26 +++ src/main/java/envoy/client/ui/Startup.java | 169 +++++++++--------- .../java/envoy/client/ui/UserListCell.java | 26 +++ 6 files changed, 199 insertions(+), 125 deletions(-) create mode 100644 src/main/java/envoy/client/ui/MessageListCell.java create mode 100644 src/main/java/envoy/client/ui/UserListCell.java diff --git a/src/main/java/envoy/client/Startup.java b/src/main/java/envoy/client/Startup.java index 50ae4af..0633834 100644 --- a/src/main/java/envoy/client/Startup.java +++ b/src/main/java/envoy/client/Startup.java @@ -1,15 +1,9 @@ package envoy.client; -import java.awt.EventQueue; import java.util.logging.Logger; -import javax.swing.JFrame; - -import envoy.client.data.Settings; -import envoy.client.ui.StatusTrayIcon; import envoy.client.ui.container.ChatWindow; import envoy.data.Config; -import envoy.exception.EnvoyException; import envoy.util.EnvoyLog; /** @@ -42,30 +36,29 @@ public class Startup { */ public static void main(String[] args) { // Display ChatWindow and StatusTrayIcon - EventQueue.invokeLater(() -> { - try { - chatWindow.initContent(client, localDB, writeProxy); - - // Relay unread messages from cache - if (cache != null && client.isOnline()) cache.relay(); - - try { - new StatusTrayIcon(chatWindow).show(); - - // If the tray icon is supported and corresponding settings is set, hide the - // chat window on close - Settings.getInstance() - .getItems() - .get("onCloseMode") - .setChangeHandler((onCloseMode) -> chatWindow - .setDefaultCloseOperation((Boolean) onCloseMode ? JFrame.HIDE_ON_CLOSE : JFrame.EXIT_ON_CLOSE)); - } catch (EnvoyException e) { - logger.warning("The StatusTrayIcon is not supported on this platform!"); - } - } catch (Exception e) { - e.printStackTrace(); - } - }); + // EventQueue.invokeLater(() -> { + // try { + // chatWindow.initContent(client, localDB, writeProxy); + // + // + // try { + // new StatusTrayIcon(chatWindow).show(); + // + // // If the tray icon is supported and corresponding settings is set, hide the + // // chat window on close + // Settings.getInstance() + // .getItems() + // .get("onCloseMode") + // .setChangeHandler((onCloseMode) -> chatWindow + // .setDefaultCloseOperation((Boolean) onCloseMode ? JFrame.HIDE_ON_CLOSE : + // JFrame.EXIT_ON_CLOSE)); + // } catch (EnvoyException e) { + // logger.warning("The StatusTrayIcon is not supported on this platform!"); + // } + // } catch (Exception e) { + // e.printStackTrace(); + // } + // }); } } diff --git a/src/main/java/envoy/client/ui/ChatScene.fxml b/src/main/java/envoy/client/ui/ChatScene.fxml index bbf5504..cc8b797 100644 --- a/src/main/java/envoy/client/ui/ChatScene.fxml +++ b/src/main/java/envoy/client/ui/ChatScene.fxml @@ -8,22 +8,37 @@ - + - - + + - - - + + + - +