From 7744d382b1704b5a0c3255db5134fdd613597fd2 Mon Sep 17 00:00:00 2001 From: delvh Date: Sun, 14 Jun 2020 16:11:46 +0200 Subject: [PATCH] Applying suggestions from code review 2 --- src/main/java/envoy/client/ui/Startup.java | 3 ++- src/main/java/envoy/client/ui/controller/ChatScene.java | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/envoy/client/ui/Startup.java b/src/main/java/envoy/client/ui/Startup.java index cc70ec2..5c106a5 100644 --- a/src/main/java/envoy/client/ui/Startup.java +++ b/src/main/java/envoy/client/ui/Startup.java @@ -52,7 +52,6 @@ public final class Startup extends Application { public void start(Stage stage) throws Exception { try { // Load the configuration from client.properties first - logger.log(Level.INFO, "Envoy was started at " + new Date()); final Properties properties = new Properties(); properties.load(Startup.class.getClassLoader().getResourceAsStream("client.properties")); config.load(properties); @@ -76,6 +75,8 @@ public final class Startup extends Application { EnvoyLog.setFileLevelBarrier(config.getFileLevelBarrier()); EnvoyLog.setConsoleLevelBarrier(config.getConsoleLevelBarrier()); + logger.log(Level.INFO, "Envoy was started at " + new Date()); + // Initialize the local database if (config.isIgnoreLocalDB()) { localDB = new TransientLocalDB(); diff --git a/src/main/java/envoy/client/ui/controller/ChatScene.java b/src/main/java/envoy/client/ui/controller/ChatScene.java index 5f675f9..1bec268 100644 --- a/src/main/java/envoy/client/ui/controller/ChatScene.java +++ b/src/main/java/envoy/client/ui/controller/ChatScene.java @@ -238,7 +238,7 @@ public final class ChatScene { messageTextArea.positionCaret(MAX_MESSAGE_LENGTH); messageTextArea.setScrollTop(Double.MAX_VALUE); } - designRemainingCharsLabel(); + updateRemainingCharsLabel(); } /** @@ -246,7 +246,7 @@ public final class ChatScene { * * @since Envoy Client v0.1-beta */ - private void designRemainingCharsLabel() { + private void updateRemainingCharsLabel() { final int currentLength = messageTextArea.getText().length(); final int remainingLength = MAX_MESSAGE_LENGTH - currentLength; remainingChars.setText(String.format("remaining chars: %d/%d", remainingLength, MAX_MESSAGE_LENGTH)); @@ -286,6 +286,6 @@ public final class ChatScene { // Clear text field and disable post button messageTextArea.setText(""); postButton.setDisable(true); - designRemainingCharsLabel(); + updateRemainingCharsLabel(); } }