]> git.mxchange.org Git - jfinancials-swing.git/blobdiff - src/org/mxchange/addressbook/client/gui/AddressbookFrame.java
Some empty lines added/removed
[jfinancials-swing.git] / src / org / mxchange / addressbook / client / gui / AddressbookFrame.java
index c1c03468e319698de415c34c2db96626cfc89132..da6d4bde773d01a1c8c33e47548fe1dedc00351e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Roland Haeder
+ * Copyright (C) 2016 Roland Haeder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -78,7 +78,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         * <p>
         * @return Returns a singelton instance of this frame
         */
-       public static final ClientFrame getSelfInstance (final Client client) {
+       public static ClientFrame getSelfInstance (final Client client) {
                // Is it set?
                if (!(self instanceof ClientFrame)) {
                        // Create new instance
@@ -136,7 +136,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private AddressbookFrame (final Client client) {
                // Debug line
-               this.getLogger().logTrace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N
 
                // Set frame instance
                this.frame = new JFrame();
@@ -146,13 +146,13 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                this.setClient(client);
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        @Override
        public Contact doEnterOwnData () {
                // Trace message
-               this.getLogger().logTrace("CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // Is the "add contact" window visible?
                if (this.addContact.isVisible()) {
@@ -167,7 +167,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                this.addContact.setVisible(true);
 
                // Trace message
-               this.getLogger().logTrace("Returning null : EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("Returning null : EXIT!"); //NOI18N
 
                // Return value is not supported
                return null;
@@ -179,13 +179,13 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
        @Override
        public void doShutdown () {
                // Trace message
-               this.getLogger().logTrace("CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // First only show shutdown status
                this.updateStatus("shutdown"); //NOI18N
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -194,7 +194,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
        @Override
        public void enableMainWindow () {
                // Trace message
-               this.getLogger().logTrace("CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // Enable it again
                this.frame.setEnabled(true);
@@ -203,7 +203,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                this.frame.requestFocus();
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        @Override
@@ -234,12 +234,12 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
        @Override
        public void setupFrame (final Client client) throws IOException {
                // Debug line
-               this.getLogger().logTrace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N
 
                // Has the user entered own data?
                if (((ContactFacade) this.getClient().getFacade()).isOwnContactAdded()) {
                        // Debug message
-                       this.getLogger().logDebug("Disabling menus: isOwnContactAdded()=false"); //NOI18N
+                       this.getLoggerBeanLocal().logDebug("Disabling menus: isOwnContactAdded()=false"); //NOI18N
 
                        // Not entered yet, so disable "add" menu
                        this.addOwnItem.setEnabled(false);
@@ -255,7 +255,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                this.updateStatus("done"); //NOI18N
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -269,7 +269,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
        @Override
        public void init () throws FrameAlreadyInitializedException {
                // Debug line
-               this.getLogger().logTrace("CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // Has this frame been initialized?
                if (this.isInitialized()) {
@@ -284,7 +284,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                this.initialized = true;
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -294,7 +294,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         * @return Field isInitialized
         */
        @Override
-       public final boolean isInitialized () {
+       public boolean isInitialized () {
                return this.initialized;
        }
 
@@ -310,12 +310,12 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
        @Override
        public void shutdownApplication () {
                // Trace message
-               this.getLogger().logTrace("CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // To do this, the frame must be initialized
                if (!this.isInitialized()) {
                        // Not initalized, so bad call
-                       this.getLogger().logFatal("Bad call of shutdownApplication(). Please report this."); //NOI18N
+                       this.getLoggerBeanLocal().logFatal("Bad call of shutdownApplication(). Please report this."); //NOI18N
                        return;
                }
 
@@ -328,7 +328,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                }
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -340,7 +340,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private void addMenuItem (final JMenu menu, final String key, final ActionListener listener) {
                // Trace message
-               this.getLogger().logTrace(MessageFormat.format("menu={0},key={1},listener={2} - CALLED!", menu, key, listener)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("menu={0},key={1},listener={2} - CALLED!", menu, key, listener)); //NOI18N
 
                // New instance
                JMenuItem item = this.initMenuItemWithTooltip(key);
@@ -352,7 +352,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                menu.add(item);
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -364,7 +364,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private void addTextFieldWithLabelToPanel (final JPanel panel, final String key, final int fieldLength) {
                // Trace message
-               this.getLogger().logTrace(MessageFormat.format("panel={0},key={1},fieldLength={2} - CALLED!", panel, key, fieldLength)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("panel={0},key={1},fieldLength={2} - CALLED!", panel, key, fieldLength)); //NOI18N
 
                // Init label for given key
                JLabel label = new JLabel(this.getBundle().getString(String.format("AddressbookFrame.%s.text", key))); //NOI18N
@@ -378,7 +378,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                panel.add(field);
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -420,7 +420,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private void initAddCancelButtons () {
                // Trace message
-               this.getLogger().logTrace("CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // Init panel
                JPanel panel = new JPanel();
@@ -448,7 +448,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                this.addContact.add(panel);
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -456,7 +456,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private void initAddContactDialog () {
                // Trace message
-               this.getLogger().logTrace("CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // Instance dialog and set title
                this.addContact = new JDialog();
@@ -507,16 +507,16 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
 
                // Init 3 panels:
                // 1) "name" panel
-               initNameDataPanel(this.addContact);
+               this.initNameDataPanel(this.addContact);
 
                // 2) "address" panel
-               initAddressDataPanel(this.addContact);
+               this.initAddressDataPanel(this.addContact);
 
                // 3) "other" panel
-               initOtherDataPanel(this.addContact);
+               this.initOtherDataPanel(this.addContact);
 
                // 4) "Add" and "Cancel" buttons, combined they are unique for this dialog
-               initAddCancelButtons();
+               this.initAddCancelButtons();
 
                // x)Only for developing:
                /*
@@ -524,7 +524,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                 */ this.addContact.setVisible(true);
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -534,7 +534,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private void initAddressDataPanel (final JDialog dialog) {
                // Trace message
-               this.getLogger().logTrace("CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // Panel "address" input boxes
                JPanel addressPanel = new JPanel();
@@ -575,7 +575,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                dialog.add(addressPanel);
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -583,7 +583,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private void initComponents () {
                // Debug line
-               this.getLogger().logTrace("CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // Set default close operation
                this.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@@ -632,7 +632,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                this.initOtherDialogs();
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -644,13 +644,13 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private JMenuItem initMenuItemWithTooltip (final String key) {
                // Debug line
-               this.getLogger().logTrace(MessageFormat.format("key={0} - CALLED!", key)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("key={0} - CALLED!", key)); //NOI18N
 
                JMenuItem item = new JMenuItem(this.getBundle().getString(String.format("AddressbookFrame.menuItem.%s.text", key))); //NOI18N
                item.setToolTipText(this.getBundle().getString(String.format("AddressbookFrame.menuItem.%s.toolTipText", key))); //NOI18N
 
                // Trace message
-               this.getLogger().logTrace(MessageFormat.format("item={0} - EXIT!", item)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("item={0} - EXIT!", item)); //NOI18N
 
                // Return it
                return item;
@@ -661,7 +661,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private void initMenuSystem () {
                // Trace message
-               this.getLogger().logTrace("CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // Init menu bar, menu and item instances
                JMenuBar menuBar = new JMenuBar();
@@ -675,16 +675,16 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                // Add menu items:
                // 1.x) Exit program (should be last)
                this.addMenuItem(menu, "exitProgram", new ActionListener() { //NOI18N
-                       /**
-                        * If the user has performed this action
-                        * <p>
-                        * @param e An instance of an ActionEvent class
-                        */
-                       @Override
-                       public void actionPerformed (final ActionEvent e) {
-                               self.shutdownApplication();
-                       }
-               });
+                                        /**
+                                         * If the user has performed this action
+                                         * <p>
+                                         * @param e An instance of an ActionEvent class
+                                         */
+                                        @Override
+                                        public void actionPerformed (final ActionEvent e) {
+                                                self.shutdownApplication();
+                                        }
+                                });
 
                // Add menu -> menu bar
                menuBar.add(menu);
@@ -740,16 +740,16 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                // Init more menus:
                // 1) Add new contact
                this.addMenuItem(menu, "addNewContact", new ActionListener() { //NOI18N
-                       /**
-                        * If the user has performed this action
-                        * <p>
-                        * @param e An instance of an ActionEvent class
-                        */
-                       @Override
-                       public void actionPerformed (final ActionEvent e) {
-                               ((ContactFacade) self.getClient().getFacade()).doAddOtherAddress();
-                       }
-               });
+                                        /**
+                                         * If the user has performed this action
+                                         * <p>
+                                         * @param e An instance of an ActionEvent class
+                                         */
+                                        @Override
+                                        public void actionPerformed (final ActionEvent e) {
+                                                ((ContactFacade) self.getClient().getFacade()).doAddOtherAddress();
+                                        }
+                                });
 
                // Add menu -> menu bar
                menuBar.add(menu);
@@ -758,7 +758,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                this.frame.add(menuBar, BorderLayout.NORTH);
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -768,7 +768,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private void initNameDataPanel (final JDialog dialog) {
                // Trace message
-               this.getLogger().logTrace(MessageFormat.format("dialog={0} - CALLED!", dialog)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("dialog={0} - CALLED!", dialog)); //NOI18N
 
                // Panel "name" input boxes
                JPanel namePanel = new JPanel();
@@ -801,7 +801,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                dialog.add(namePanel);
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -812,7 +812,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private void initOtherDataPanel (final JDialog dialog) {
                // Trace message
-               this.getLogger().logTrace(MessageFormat.format("dialog={0} - CALLED!", dialog)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("dialog={0} - CALLED!", dialog)); //NOI18N
 
                // Panel "other" input boxes
                JPanel otherPanel = new JPanel();
@@ -846,7 +846,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                dialog.add(otherPanel);
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -854,14 +854,14 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private void initOtherDialogs () {
                // Trace message
-               this.getLogger().logTrace("CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // Init other windows:
                // 1) Add contact
-               initAddContactDialog();
+               this.initAddContactDialog();
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -869,7 +869,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private void initStatusPanel () {
                // Trace message
-               this.getLogger().logTrace("CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // Init status label (which needs to be updated
                this.statusLabel = new JLabel();
@@ -885,7 +885,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                this.frame.add(panel, BorderLayout.SOUTH);
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -893,7 +893,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private void initTable () {
                // Trace message
-               this.getLogger().logTrace("CALLED!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
 
                // Instance table model
                this.dataModel = new ContactTableModel(this.getClient().getFacade());
@@ -926,7 +926,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                this.frame.add(scroller, BorderLayout.CENTER);
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**
@@ -936,13 +936,13 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         */
        private void updateStatus (final String type) {
                // Trace message
-               this.getLogger().logTrace(MessageFormat.format("type={0} - CALLED!", type)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("type={0} - CALLED!", type)); //NOI18N
 
                // Set status message
                this.statusLabel.setText(this.getBundle().getString(String.format("AddressbookFrame.statusLabel.%s.text", type))); //NOI18N
 
                // Trace message
-               this.getLogger().logTrace("EXIT!"); //NOI18N
+               this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
        }
 
        /**