]> git.mxchange.org Git - jaddressbook-lib.git/blobdiff - Addressbook/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java
Renamed some classes/interfaces to make it clear they belong only to this project...
[jaddressbook-lib.git] / Addressbook / src / org / mxchange / addressbook / client / gui / AddressbookFrame.java
index 7a72c690b6babaa807e0d7abf28fa6126c952d30..244c73f266f34ac0b93d872f406245ce9822c6fa 100644 (file)
@@ -46,12 +46,12 @@ import javax.swing.border.TitledBorder;
 import javax.swing.table.TableModel;
 import org.mxchange.addressbook.BaseAddressbookSystem;
 import org.mxchange.addressbook.application.AddressbookApplication;
-import org.mxchange.jcore.contact.Contact;
-import org.mxchange.jcore.contact.Gender;
 import org.mxchange.addressbook.exceptions.ContactAlreadyAddedException;
-import org.mxchange.addressbook.manager.contact.ManageableContact;
+import org.mxchange.addressbook.manager.contact.ManageableAddressbookContact;
 import org.mxchange.addressbook.model.contact.ContactTableModel;
 import org.mxchange.jcore.client.Client;
+import org.mxchange.jcore.contact.Contact;
+import org.mxchange.jcore.contact.Gender;
 import org.mxchange.jcore.exceptions.FrameAlreadyInitializedException;
 
 /**
@@ -211,7 +211,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                this.getLogger().trace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N
 
                // Get and cast manager instance
-               ManageableContact manager = (ManageableContact) this.getClient().getManager();
+               ManageableAddressbookContact manager = (ManageableAddressbookContact) this.getClient().getManager();
 
                // Has the user entered own data?
                if (manager.isOwnContactAdded()) {
@@ -241,7 +241,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
         * you may not want.
         *
         * @throws
-        * org.mxchange.addressbook.exceptions.FrameAlreadyInitializedException If
+        * org.mxchange.jcore.exceptions.FrameAlreadyInitializedException If
         * this method has been called twice
         */
        @Override
@@ -298,6 +298,30 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                this.getLogger().trace("EXIT!"); //NOI18N
        }
 
+       /**
+        * Adds a new menu item with given key to menu instance
+        *
+        * @param menu Menu instance to add item to
+        * @param key Message key part
+        * @param listener Listener instance
+        */
+       private void addMenuItem (final JMenu menu, final String key, final ActionListener listener) {
+               // Trace message
+               this.getLogger().trace(MessageFormat.format("menu={0},key={1},listener={2} - CALLED!", menu, key, listener)); //NOI18N
+               
+               // New instance
+               JMenuItem item = this.initMenuItemWithTooltip(key);
+               
+               // Add listener
+               item.addActionListener(listener);
+               
+               // Add item -> menu
+               menu.add(item);
+               
+               // Trace message
+               this.getLogger().trace("EXIT!"); //NOI18N
+       }
+
        /**
         * Adds a JTextField with label and tool tip to given panel
         *
@@ -644,7 +668,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                        @Override
                        public void actionPerformed (final ActionEvent e) {
                                try {
-                                       ManageableContact manager = (ManageableContact) self.getClient().getManager();
+                                       ManageableAddressbookContact manager = (ManageableAddressbookContact) self.getClient().getManager();
                                        manager.doEnterOwnData();
                                } catch (final ContactAlreadyAddedException ex) {
                                        // Already added, log away
@@ -669,7 +693,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                         */
                        @Override
                        public void actionPerformed (final ActionEvent e) {
-                               ManageableContact manager = (ManageableContact) self.getClient().getManager();
+                               ManageableAddressbookContact manager = (ManageableAddressbookContact) self.getClient().getManager();
                                manager.doChangeOwnData();
                        }
                });
@@ -687,7 +711,7 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                         */
                        @Override
                        public void actionPerformed (final ActionEvent e) {
-                               ManageableContact manager = (ManageableContact) self.getClient().getManager();
+                               ManageableAddressbookContact manager = (ManageableAddressbookContact) self.getClient().getManager();
                                manager.doAddOtherAddress();
                        }
                });
@@ -702,30 +726,6 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                this.getLogger().trace("EXIT!"); //NOI18N
        }
 
-       /**
-        * Adds a new menu item with given key to menu instance
-        *
-        * @param menu Menu instance to add item to
-        * @param key Message key part
-        * @param listener Listener instance
-        */
-       private void addMenuItem (final JMenu menu, final String key, final ActionListener listener) {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("menu={0},key={1},listener={2} - CALLED!", menu, key, listener)); //NOI18N
-
-               // New instance
-               JMenuItem item = this.initMenuItemWithTooltip(key);
-
-               // Add listener
-               item.addActionListener(listener);
-
-               // Add item -> menu
-               menu.add(item);
-
-               // Trace message
-               this.getLogger().trace("EXIT!"); //NOI18N
-       }
-
        /**
         * Initializes name panel
         *