Fixed UI update after message status changes

This commit is contained in:
Kai S. K. Engelbart 2020-02-05 20:08:24 +01:00
parent 9e024ede09
commit 19fafc4c38
4 changed files with 8 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import envoy.data.Message;
* Created: <strong>4 Dec 2019</strong><br> * Created: <strong>4 Dec 2019</strong><br>
* *
* @author Kai S. K. Engelbart * @author Kai S. K. Engelbart
* @since Envoy v0.2-alpha
*/ */
public class MessageCreationEvent extends MessageEvent { public class MessageCreationEvent extends MessageEvent {

View File

@ -9,6 +9,7 @@ import envoy.event.Event;
* Created: <strong>4 Dec 2019</strong><br> * Created: <strong>4 Dec 2019</strong><br>
* *
* @author Kai S. K. Engelbart * @author Kai S. K. Engelbart
* @since Envoy v0.2-alpha
*/ */
public class MessageEvent implements Event<Message> { public class MessageEvent implements Event<Message> {

View File

@ -8,6 +8,7 @@ import envoy.data.Message;
* Created: <strong>4 Dec 2019</strong><br> * Created: <strong>4 Dec 2019</strong><br>
* *
* @author Kai S. K. Engelbart * @author Kai S. K. Engelbart
* @since Envoy v0.2-alpha
*/ */
public class MessageModificationEvent extends MessageEvent { public class MessageModificationEvent extends MessageEvent {

View File

@ -190,6 +190,7 @@ public class ChatWindow extends JFrame {
messageList.setModel(currentChat.getModel()); messageList.setModel(currentChat.getModel());
scrollPane.setChatOpened(true); scrollPane.setChatOpened(true);
messageList.synchronizeModel();
revalidate(); revalidate();
repaint(); repaint();
} }
@ -250,8 +251,11 @@ public class ChatWindow extends JFrame {
if (c == currentChat) { if (c == currentChat) {
messageList.setModel(currentChat.getModel()); messageList.setModel(currentChat.getModel());
scrollPane.setChatOpened(true); scrollPane.setChatOpened(true);
} else messageList.synchronizeModel();
} }
}
revalidate();
repaint();
}); });
revalidate(); revalidate();