From 84353c66d62ce000d79a8a99a1dd1bac77bbd6e7 Mon Sep 17 00:00:00 2001 From: kske Date: Sat, 21 Dec 2019 10:02:25 +0100 Subject: [PATCH] Added Javadoc since tags as requested by @delvh --- src/main/java/envoy/client/ui/Theme.java | 3 +++ src/main/java/envoy/client/ui/settings/SettingsPanel.java | 6 ++++++ src/main/java/envoy/client/ui/settings/SettingsScreen.java | 6 +++--- .../envoy/client/ui/settings/ThemeCustomizationPanel.java | 6 ++++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/java/envoy/client/ui/Theme.java b/src/main/java/envoy/client/ui/Theme.java index c498655..3e6c39e 100644 --- a/src/main/java/envoy/client/ui/Theme.java +++ b/src/main/java/envoy/client/ui/Theme.java @@ -35,6 +35,7 @@ public class Theme implements Serializable { * @param selectionColor the section color * @param typingMessageColor the color of currently typed messages * @param userNameColor the color of user names + * @since Envoy v0.2-alpha */ public Theme(String themeName, Color backgroundColor, Color cellColor, Color interactableForegroundColor, Color interactableBackgroundColor, Color messageColorChat, Color dateColorChat, Color selectionColor, Color typingMessageColor, Color userNameColor) { @@ -58,6 +59,7 @@ public class Theme implements Serializable { * * @param name the name of the {@link Theme} * @param other the {@link Theme} to copy + * @since Envoy v0.2-alpha */ public Theme(String name, Theme other) { themeName = name; @@ -67,6 +69,7 @@ public class Theme implements Serializable { /** * @return a {@code Map} of all colors defined for this theme * with their names as keys + * @since Envoy v0.2-alpha */ public Map getColors() { return colors; } diff --git a/src/main/java/envoy/client/ui/settings/SettingsPanel.java b/src/main/java/envoy/client/ui/settings/SettingsPanel.java index 56e1957..9b8f239 100644 --- a/src/main/java/envoy/client/ui/settings/SettingsPanel.java +++ b/src/main/java/envoy/client/ui/settings/SettingsPanel.java @@ -5,11 +5,16 @@ import java.awt.event.ActionListener; import javax.swing.JPanel; /** + * Serves as an interface between {@link SettingsScreen} and different + * {@link JPanel}s with actual settings that are defined as sub classes of this + * class.
+ *
* Project: envoy-client
* File: SettingsPanel.java
* Created: 20 Dec 2019
* * @author Kai S. K. Engelbart + * @since Envoy v0.2-alpha */ public abstract class SettingsPanel extends JPanel { @@ -18,6 +23,7 @@ public abstract class SettingsPanel extends JPanel { /** * @return an {@link ActionListener} that should be invoked when the OK button * is pressed in the {@link SettingsScreen} + * @since Envoy v0.2-alpha */ public abstract ActionListener getOkButtonAction(); } diff --git a/src/main/java/envoy/client/ui/settings/SettingsScreen.java b/src/main/java/envoy/client/ui/settings/SettingsScreen.java index 740750d..d283d6b 100644 --- a/src/main/java/envoy/client/ui/settings/SettingsScreen.java +++ b/src/main/java/envoy/client/ui/settings/SettingsScreen.java @@ -25,6 +25,7 @@ import envoy.client.util.EnvoyLog; * @author Leon Hofmeister * @author Maximilian Käfer * @author Kai S. K. Engelbart + * @since Envoy v0.2-alpha */ public class SettingsScreen extends JDialog { @@ -87,8 +88,7 @@ public class SettingsScreen extends JDialog { logger.log(Level.FINEST, "Selected settings panel: " + option); // Remove previous settings panel - if (settingsPanel != null) - contentPanel.remove(settingsPanel); + if (settingsPanel != null) contentPanel.remove(settingsPanel); try { settingsPanel = panels.get(option).getDeclaredConstructor().newInstance(); @@ -99,7 +99,7 @@ public class SettingsScreen extends JDialog { repaint(); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { - e.printStackTrace(); + logger.log(Level.SEVERE, "Failed to invoke constructor of SettingsPanel " + option, e); } } }); diff --git a/src/main/java/envoy/client/ui/settings/ThemeCustomizationPanel.java b/src/main/java/envoy/client/ui/settings/ThemeCustomizationPanel.java index 57780f3..6a1aa66 100644 --- a/src/main/java/envoy/client/ui/settings/ThemeCustomizationPanel.java +++ b/src/main/java/envoy/client/ui/settings/ThemeCustomizationPanel.java @@ -17,11 +17,15 @@ import envoy.client.ui.Theme; import envoy.client.util.EnvoyLog; /** + * Displays GUI components that allow changing the current {@Theme} and creating + * new ones.
+ *
* Project: envoy-client
* File: ThemeCustomizationPanel.java
* Created: 20 Dec 2019
* * @author Kai S. K. Engelbart + * @since Envoy v0.2-alpha */ public class ThemeCustomizationPanel extends SettingsPanel { @@ -42,6 +46,8 @@ public class ThemeCustomizationPanel extends SettingsPanel { * Initializes a {@link ThemeCustomizationPanel} that enables the user to change * the current {@link Theme} and create new themes as part of the * {@link SettingsScreen}. + * + * @since Envoy v0.2-alpha */ public ThemeCustomizationPanel() { temporaryTheme = new Theme("temporaryTheme", Settings.getInstance().getThemes().get(Settings.getInstance().getCurrentTheme()));