Merge branch 'develop' into f/logger

This commit is contained in:
delvh
2019-12-07 11:22:47 +01:00
committed by GitHub
12 changed files with 491 additions and 87 deletions

View File

@ -40,7 +40,7 @@ import envoy.schema.User;
* Project: <strong>envoy-client</strong><br>
* File: <strong>ChatWindow.java</strong><br>
* Created: <strong>28 Sep 2019</strong><br>
*
*
* @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer
* @author Leon Hofmeister
@ -59,7 +59,7 @@ public class ChatWindow extends JFrame {
private Chat currentChat;
private JTextArea messageEnterTextArea;
private static final Logger logger = Logger.getLogger(ChatWindow.class.getSimpleName());
public ChatWindow(Client client, LocalDB localDB) {
@ -134,13 +134,9 @@ public class ChatWindow extends JFrame {
@Override
public void keyReleased(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER
&& ((SettingsScreen.enterToSend && e.getModifiersEx() == 0) || (e.getModifiersEx() == KeyEvent.CTRL_DOWN_MASK))) {
&& ((SettingsScreen.enterToSend && e.getModifiersEx() == 0) || (e.getModifiersEx() == KeyEvent.CTRL_DOWN_MASK)))
postMessage(messageList);
}
}
});
// Checks for changed Message
@ -268,6 +264,7 @@ public class ChatWindow extends JFrame {
private void postMessage(JList<Message> messageList) {
if (!client.hasRecipient()) {
JOptionPane.showMessageDialog(this, "Please select a recipient!", "Cannot send message", JOptionPane.INFORMATION_MESSAGE);
return;
}
if (!messageEnterTextArea.getText().isEmpty()) try {
@ -292,7 +289,7 @@ public class ChatWindow extends JFrame {
/**
* Initializes the elements of the user list by downloading them from the
* server.
*
*
* @since Envoy v0.1-alpha
*/
private void loadUsersAndChats() {
@ -313,7 +310,7 @@ public class ChatWindow extends JFrame {
/**
* Updates the data model and the UI repeatedly after a certain amount of
* time.
*
*
* @param timeout the amount of time that passes between two requests sent to
* the server
* @since Envoy v0.1-alpha