From 19fafc4c38c06159377b218c29235670366b4809 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Wed, 5 Feb 2020 20:08:24 +0100 Subject: [PATCH] Fixed UI update after message status changes --- src/main/java/envoy/client/event/MessageCreationEvent.java | 1 + src/main/java/envoy/client/event/MessageEvent.java | 1 + .../java/envoy/client/event/MessageModificationEvent.java | 1 + src/main/java/envoy/client/ui/ChatWindow.java | 6 +++++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/envoy/client/event/MessageCreationEvent.java b/src/main/java/envoy/client/event/MessageCreationEvent.java index 301603e..72e47f5 100644 --- a/src/main/java/envoy/client/event/MessageCreationEvent.java +++ b/src/main/java/envoy/client/event/MessageCreationEvent.java @@ -8,6 +8,7 @@ import envoy.data.Message; * Created: 4 Dec 2019
* * @author Kai S. K. Engelbart + * @since Envoy v0.2-alpha */ public class MessageCreationEvent extends MessageEvent { diff --git a/src/main/java/envoy/client/event/MessageEvent.java b/src/main/java/envoy/client/event/MessageEvent.java index 8bd05d1..fb50109 100644 --- a/src/main/java/envoy/client/event/MessageEvent.java +++ b/src/main/java/envoy/client/event/MessageEvent.java @@ -9,6 +9,7 @@ import envoy.event.Event; * Created: 4 Dec 2019
* * @author Kai S. K. Engelbart + * @since Envoy v0.2-alpha */ public class MessageEvent implements Event { diff --git a/src/main/java/envoy/client/event/MessageModificationEvent.java b/src/main/java/envoy/client/event/MessageModificationEvent.java index 3a5549a..4077383 100644 --- a/src/main/java/envoy/client/event/MessageModificationEvent.java +++ b/src/main/java/envoy/client/event/MessageModificationEvent.java @@ -8,6 +8,7 @@ import envoy.data.Message; * Created: 4 Dec 2019
* * @author Kai S. K. Engelbart + * @since Envoy v0.2-alpha */ public class MessageModificationEvent extends MessageEvent { diff --git a/src/main/java/envoy/client/ui/ChatWindow.java b/src/main/java/envoy/client/ui/ChatWindow.java index 81d04f6..d018b40 100644 --- a/src/main/java/envoy/client/ui/ChatWindow.java +++ b/src/main/java/envoy/client/ui/ChatWindow.java @@ -190,6 +190,7 @@ public class ChatWindow extends JFrame { messageList.setModel(currentChat.getModel()); scrollPane.setChatOpened(true); + messageList.synchronizeModel(); revalidate(); repaint(); } @@ -250,8 +251,11 @@ public class ChatWindow extends JFrame { if (c == currentChat) { messageList.setModel(currentChat.getModel()); scrollPane.setChatOpened(true); - } + } else messageList.synchronizeModel(); } + + revalidate(); + repaint(); }); revalidate();