From 965aa5a2d21c1812548df69ef94756f0face8322 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Sat, 21 Dec 2019 22:28:22 +0100 Subject: [PATCH] Delete SettingsScreen.java --- .../java/envoy/client/ui/SettingsScreen.java | 156 ------------------ 1 file changed, 156 deletions(-) delete mode 100644 src/main/java/envoy/client/ui/SettingsScreen.java diff --git a/src/main/java/envoy/client/ui/SettingsScreen.java b/src/main/java/envoy/client/ui/SettingsScreen.java deleted file mode 100644 index 7d5de28..0000000 --- a/src/main/java/envoy/client/ui/SettingsScreen.java +++ /dev/null @@ -1,156 +0,0 @@ -package envoy.client.ui; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.FlowLayout; - -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JPanel; -import javax.swing.border.EmptyBorder; - -/** - * Project: envoy-client
- * File: SettingsScreen.java
- * Created: 31 Oct 2019
- * - * @author Leon Hofmeister - */ -public class SettingsScreen extends JDialog { - - private static final long serialVersionUID = -4476913491263077107L; - private final JPanel contentPanel = new JPanel(); - public static boolean enterToSend = true; - - // TODO: Add a JPanel with all the Information necessary: - // change (Picture,Username, Email, Password) and toggle(light/dark mode, - // "ctrl+enter"/"enter" - // to send a message directly) - /** - * Open the Settings screen. - * Only suited for Dev/Error mode. - * Avoid usage. - * - * @since Envoy v0.1-alpha - */ - public static void open() { open(new SettingsScreen()); } - - /** - * Opens the Settings screen.
- * Use preferably since everyone is already initialised.
- * It personalises the screen more. - * - * @param username The name of the User - * @param Email The Email that is associated with that Account - * @since Envoy v0.1-alpha - */ - public static void open(String username) {// , String Email) {AUSKLAMMERN, WENN ANMELDUNG PER - // EMAIL IMPLEMENTIERT IST! - open(new SettingsScreen(username)); - } - - public static void open(SettingsScreen dialog) { - dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - dialog.setModal(true); - dialog.setVisible(true); - } - - /** - * Builds the Settings screen.
- * Use only as Dev/Error Mode.
- * Avoid usage. - * - * @since Envoy v0.1-alpha - */ - public SettingsScreen() { - setBackground(Color.BLACK); - setBounds(100, 100, 450, 300); - getContentPane().setLayout(new BorderLayout()); - contentPanel.setBackground(Color.BLACK); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel, BorderLayout.CENTER); - contentPanel.setLayout(new BorderLayout(0, 0)); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBackground(Color.BLACK); - getContentPane().add(buttonPane, BorderLayout.SOUTH); - buttonPane.setLayout(new BorderLayout(0, 0)); - { - JButton okButton = new JButton("Save"); - okButton.setActionCommand("OK"); - buttonPane.add(okButton, BorderLayout.EAST); - getRootPane().setDefaultButton(okButton); - okButton.addActionListener((evt) -> { - // Hier später die Daten abspeichern, wenn Datenmodell implementiert ist - dispose(); - }); - } - { - JButton cancelButton = new JButton("Cancel"); - cancelButton.setActionCommand("Cancel"); - buttonPane.add(cancelButton, BorderLayout.WEST); - - cancelButton.addActionListener((evt) -> { dispose(); }); - } - } - } - - /** - * Builds the Settings screen.
- * Use preferreably since everyone is already initialised.
- * It personalises the screen more. - * - * @param Username The name of the User - * @param Email The Email that is associated with that Account - * @since Envoy v0.1-alpha - */ - public SettingsScreen(String Username) {// , String Email, String hashedPwd) {AUSKLAMMERN, WENN ANMELDUNG PER EMAIL - // IMPLEMENTIERT IST! - setBackground(Color.BLACK); - setBounds(100, 100, 450, 300); - getContentPane().setLayout(new BorderLayout()); - contentPanel.setBackground(Color.BLACK); - contentPanel.setLayout(new FlowLayout()); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel, BorderLayout.CENTER); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBackground(Color.BLACK); - getContentPane().add(buttonPane, BorderLayout.SOUTH); - buttonPane.setLayout(new BorderLayout(0, 0)); - { - JButton okButton = new JButton("Save"); - okButton.setActionCommand("OK"); - buttonPane.add(okButton, BorderLayout.EAST); - getRootPane().setDefaultButton(okButton); - okButton.addActionListener((evt) -> { - // Hier später die Daten abspeichern, wenn Datenmodell implementiert ist - dispose(); - }); - } - { - JButton cancelButton = new JButton("Cancel"); - cancelButton.setActionCommand("Cancel"); - buttonPane.add(cancelButton, BorderLayout.WEST); - - cancelButton.addActionListener((evt) -> { dispose(); }); - } - } - } - - /** - * @return true if Enter should be used to send a message instead of ctrl+enter - * @since Envoy v0.1-alpha - */ - public static boolean isEnterToSend() { return enterToSend; } - - /** - * @param enterToSend
- * toggles whether a message should be sent via - *
- * buttonpress "enter" or "ctrl"+"enter" - * @since Envoy v0.1-alpha - */ - public static void setEnterToSend(boolean enterForSend) { enterToSend = enterForSend; } - // TODO: Should be changed to private, but later to avoid warnings -}