Added Javadoc since tags as requested by @delvh
This commit is contained in:
		@@ -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<String, Color>} of all colors defined for this theme
 | 
			
		||||
	 *         with their names as keys
 | 
			
		||||
	 * @since Envoy v0.2-alpha
 | 
			
		||||
	 */
 | 
			
		||||
	public Map<String, Color> getColors() { return colors; }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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.<br>
 | 
			
		||||
 * <br>
 | 
			
		||||
 * Project: <strong>envoy-client</strong><br>
 | 
			
		||||
 * File: <strong>SettingsPanel.java</strong><br>
 | 
			
		||||
 * Created: <strong>20 Dec 2019</strong><br>
 | 
			
		||||
 *
 | 
			
		||||
 * @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();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
 
 | 
			
		||||
@@ -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.<br>
 | 
			
		||||
 * <br>
 | 
			
		||||
 * Project: <strong>envoy-client</strong><br>
 | 
			
		||||
 * File: <strong>ThemeCustomizationPanel.java</strong><br>
 | 
			
		||||
 * Created: <strong>20 Dec 2019</strong><br>
 | 
			
		||||
 *
 | 
			
		||||
 * @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()));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user