diff --git a/src/main/java/envoy/client/ui/MessageListCell.java b/src/main/java/envoy/client/ui/MessageListCell.java index 21c216d..60a2ada 100644 --- a/src/main/java/envoy/client/ui/MessageListCell.java +++ b/src/main/java/envoy/client/ui/MessageListCell.java @@ -1,11 +1,22 @@ package envoy.client.ui; -import envoy.data.Message; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Map; + import javafx.scene.control.Label; import javafx.scene.control.ListCell; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.layout.HBox; +import javafx.scene.layout.VBox; +import envoy.data.Message; +import envoy.data.Message.MessageStatus; /** + * Displays a single message inside the message list. + *
* Project: envoy-client
* Project: envoy-client
* File: MessageListCell.java
* Created: 28.03.2020
@@ -15,13 +26,29 @@ import javafx.scene.control.ListCell;
*/
public class MessageListCell extends ListCell
* File: Startup.java
* Created: 26.03.2020
@@ -37,7 +39,10 @@ public final class Startup extends Application {
private static final Logger logger = EnvoyLog.getLogger(Startup.class);
/**
- * {@inheritDoc}
+ * Loads the configuration, initializes the client and the local database and
+ * delegates the rest of the startup process to {@link LoginScene}.
+ *
+ * @since Envoy Client v0.1-beta
*/
@Override
public void start(Stage stage) throws Exception {
@@ -69,13 +74,15 @@ public final class Startup extends Application {
if (config.isIgnoreLocalDB()) {
localDB = new TransientLocalDB();
new Alert(AlertType.WARNING, "Ignoring local database.\nMessages will not be saved!").showAndWait();
- } else try {
- localDB = new PersistentLocalDB(new File(config.getHomeDirectory(), config.getLocalDB().getPath()));
- } catch (final IOException e3) {
- logger.log(Level.SEVERE, "Could not initialize local database", e3);
- new Alert(AlertType.ERROR, "Could not initialize local database!\n" + e3).showAndWait();
- System.exit(1);
- return;
+ } else {
+ try {
+ localDB = new PersistentLocalDB(new File(config.getHomeDirectory(), config.getLocalDB().getPath()));
+ } catch (final IOException e3) {
+ logger.log(Level.SEVERE, "Could not initialize local database", e3);
+ new Alert(AlertType.ERROR, "Could not initialize local database!\n" + e3).showAndWait();
+ System.exit(1);
+ return;
+ }
}
// Initialize client and unread message cache
@@ -91,12 +98,13 @@ public final class Startup extends Application {
}
/**
- * {@inheritDoc}
+ * Closes the client connection and saves the local database and settings.
+ *
+ * @since Envoy Client v0.1-beta
*/
@Override
public void stop() {
try {
- // Save Settings and PersistentLocalDB on shutdown
logger.info("Closing connection...");
client.close();