diff --git a/src/main/java/envoy/client/net/Client.java b/src/main/java/envoy/client/net/Client.java index fcf9dd0..0d09780 100644 --- a/src/main/java/envoy/client/net/Client.java +++ b/src/main/java/envoy/client/net/Client.java @@ -91,7 +91,7 @@ public class Client implements Closeable { SerializationUtils.writeBytesWithLength(credentials, socket.getOutputStream()); // Wait for a maximum of five seconds to acquire the sender object - long start = System.currentTimeMillis(); + final long start = System.currentTimeMillis(); while (sender == null) { // Quit immediately after handshake rejection @@ -162,7 +162,7 @@ public class Client implements Closeable { eventBus.register(SendEvent.class, evt -> { try { sendEvent(evt.get()); - } catch (IOException e) { + } catch (final IOException e) { e.printStackTrace(); } }); @@ -221,7 +221,7 @@ public class Client implements Closeable { */ public Map getUsers() { checkOnline(); - Map users = new HashMap<>(); + final Map users = new HashMap<>(); contacts.forEach(u -> users.put(u.getName(), u)); users.put(sender.getName(), sender); return users; diff --git a/src/main/java/envoy/client/ui/controller/ChatScene.java b/src/main/java/envoy/client/ui/controller/ChatScene.java index 5b4b1a6..6fdbd2f 100644 --- a/src/main/java/envoy/client/ui/controller/ChatScene.java +++ b/src/main/java/envoy/client/ui/controller/ChatScene.java @@ -232,9 +232,6 @@ public final class ChatScene { */ @FXML private void checkKeyCombination(KeyEvent e) { - // TODO: Letting go of ctrl automatically posts a message. Needs to be fixed - // soon. - // Automatic sending of messages via (ctrl +) enter if (!postButton.isDisabled() && settings.isEnterToSend() && e.getCode() == KeyCode.ENTER || !settings.isEnterToSend() && e.getCode() == KeyCode.ENTER && e.isControlDown()) diff --git a/src/main/java/envoy/client/ui/controller/LoginScene.java b/src/main/java/envoy/client/ui/controller/LoginScene.java index 4f13149..5f6c5aa 100644 --- a/src/main/java/envoy/client/ui/controller/LoginScene.java +++ b/src/main/java/envoy/client/ui/controller/LoginScene.java @@ -28,7 +28,7 @@ import envoy.util.EnvoyLog; * Project: envoy-client
* File: LoginDialog.java
* Created: 03.04.2020
- * + * * @author Kai S. K. Engelbart * @since Envoy Client v0.1-beta */ @@ -72,7 +72,7 @@ public final class LoginScene { /** * Loads the login dialog using the FXML file {@code LoginDialog.fxml}. - * + * * @param client the client used to perform the handshake * @param localDB the local database used for offline login * @param receivedMessageCache the cache storing messages received during @@ -104,9 +104,7 @@ public final class LoginScene { if (registerCheckBox.isSelected() && !passwordField.getText().equals(repeatPasswordField.getText())) { clearPasswordFields(); new Alert(AlertType.ERROR, "The entered password is unequal to the repeated one").showAndWait(); - } else { - performHandshake(new LoginCredentials(userTextField.getText(), passwordField.getText().toCharArray(), registerCheckBox.isSelected())); - } + } else performHandshake(new LoginCredentials(userTextField.getText(), passwordField.getText().toCharArray(), registerCheckBox.isSelected())); } @FXML @@ -120,7 +118,6 @@ public final class LoginScene { // Make repeat password field and label visible / invisible repeatPasswordField.setVisible(registerCheckBox.isSelected()); repeatPasswordLabel.setVisible(registerCheckBox.isSelected()); - clearPasswordFields(); } @@ -148,12 +145,12 @@ public final class LoginScene { try { // Try entering offline mode localDB.loadUsers(); - User clientUser = (User) localDB.getUsers().get(credentials.getIdentifier()); + final User clientUser = (User) localDB.getUsers().get(credentials.getIdentifier()); if (clientUser == null) throw new EnvoyException("Could not enter offline mode: user name unknown"); client.setSender(clientUser); new Alert(AlertType.WARNING, "A connection to the server could not be established. Starting in offline mode.").showAndWait(); loadChatScene(); - } catch (Exception e) { + } catch (final Exception e) { new Alert(AlertType.ERROR, "Client error: " + e).showAndWait(); System.exit(1); } diff --git a/src/main/java/envoy/client/ui/controller/package-info.java b/src/main/java/envoy/client/ui/controller/package-info.java index 51d18e8..7989b8f 100644 --- a/src/main/java/envoy/client/ui/controller/package-info.java +++ b/src/main/java/envoy/client/ui/controller/package-info.java @@ -4,8 +4,8 @@ * Project: envoy-client
* File: package-info.java
* Created: 08.06.2020
- * + * * @author Kai S. K. Engelbart * @since Envoy Client v0.1-beta */ -package envoy.client.ui.controller; \ No newline at end of file +package envoy.client.ui.controller; diff --git a/src/main/resources/css/dark.css b/src/main/resources/css/dark.css index 4a899b2..e10a301 100644 --- a/src/main/resources/css/dark.css +++ b/src/main/resources/css/dark.css @@ -1,4 +1,4 @@ .button{ -fx-background-color: rgb(105,0,153); -fx-text-fill: white; -} \ No newline at end of file +} diff --git a/src/main/resources/css/light.css b/src/main/resources/css/light.css index a529c0f..34a1f74 100644 --- a/src/main/resources/css/light.css +++ b/src/main/resources/css/light.css @@ -1,3 +1,3 @@ .button{ -fx-background-color: snow; -} \ No newline at end of file +}