]> git.mxchange.org Git - addressbook-lib.git/blobdiff - Addressbook/src/org/mxchange/addressbook/client/gui/SwingClient.java
Introduced Gender enum which replaces the old char
[addressbook-lib.git] / Addressbook / src / org / mxchange / addressbook / client / gui / SwingClient.java
index 0914828179e3844ca20acb1e5cb488afc82990b6..634b0cf2cf4cca5c1bad26da82e637102ac59517 100644 (file)
@@ -20,6 +20,7 @@ import org.mxchange.addressbook.application.Application;
 import org.mxchange.addressbook.client.BaseClient;
 import org.mxchange.addressbook.client.Client;
 import org.mxchange.addressbook.contact.Contact;
+import org.mxchange.addressbook.contact.Gender;
 import org.mxchange.addressbook.exceptions.FrameAlreadyInitializedException;
 import org.mxchange.addressbook.exceptions.UnhandledUserChoiceException;
 import org.mxchange.addressbook.menu.Menu;
@@ -30,188 +31,201 @@ import org.mxchange.addressbook.menu.item.SelectableMenuItem;
  * @author Roland Haeder
  */
 public class SwingClient extends BaseClient implements Client {
-    /**
-     * Swing frame instance
-     */
-    private final ClientFrame frame;
-
-    /**
-     * Constructor with an Application instance.
-     * 
-     * @param application Application instance
-     */
-    public SwingClient (final Application application) {
-       super();
 
-       // Debug message
-       this.getLogger().trace("CALLED!");
-
-       // Set application instance
-       this.setApplication(application);
-
-       // Init frame instance
-       this.frame = AddressbookFrame.getSelfInstance(this);
-    }
-
-    @Override
-    public void displayAddressBox (final Contact contact) {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    @Override
-    public void displayNameBox (final Contact contact) {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    @Override
-    public void displayOtherDataBox (final Contact contact) {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    @Override
-    public void doChangeOwnAddressData (Contact contact) {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    @Override
-    public void doChangeOwnNameData (Contact contact) {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    @Override
-    public void doChangeOwnOtherData (Contact contact) {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    @Override
-    public Contact doEnterOwnData () {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    @Override
-    public void doShutdown () {
-       // Debug message
-       this.getLogger().trace("CALLED!");
+       /**
+        * Swing frame instance
+        */
+       private final ClientFrame frame;
 
-       // Parent call
-       super.doShutdown();
+       /**
+        * Constructor with an Application instance.
+        *
+        * @param application Application instance
+        */
+       public SwingClient (final Application application) {
+               super();
 
-       // Shutdown frame
-       this.frame.doShutdown();
+               // Debug message
+               this.getLogger().trace("CALLED!");
 
-       // @TODO Add other shutdown stuff
+               // Set application instance
+               this.setApplication(application);
 
-       // Debug message
-       this.getLogger().trace("EXIT!");
-    }
+               // Init frame instance
+               this.frame = AddressbookFrame.getSelfInstance(this);
+       }
 
-    @Override
-    public void doUserMenuChoice () throws UnhandledUserChoiceException {
-       // Debug message
-       //* NOISY-DEBUG: */ this.getLogger().trace("CALLED!");
-
-       // Not implemented here
-    }
-
-    @Override
-    public char enterChar (final char[] validChars, String message) {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    @Override
-    public int enterInt (final int minimum, final int maximum, final String message) {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    @Override
-    public String enterString (final int minLength, final int maxLength, final String message, final boolean allowEmpty) {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    @Override
-    public Menu getMenu (final String menuType) {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    /**
-     * Returns a Swing menu item
-     * 
-     * @param accessKey Key to access the menu
-     * @param text Text to show to user
-     * @return A SelectableMenuItem
-     */
-    @Override
-    public SelectableMenuItem getMenuItem (final char accessKey, final String text) {
-       // Debug message
-       this.getLogger().trace("CALLED!");
+       @Override
+       public void displayAddressBox (final Contact contact) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
 
-       // Returns null as the menu is now no longer controlled here.
-       return null;
-    }
+       @Override
+       public void displayNameBox (final Contact contact) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
 
-    /**
-     * Inizializes this client
-     */
-    @Override
-    public void init () {
-       // Debug message
-       this.getLogger().trace("CALLED!");
+       @Override
+       public void displayOtherDataBox (final Contact contact) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
 
-       // Init contact manager here
-       this.initContactManager();
+       @Override
+       public void doChangeOwnAddressData (Contact contact) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
 
-       try {
-           // Init frame
-           this.frame.init();
-       } catch (final FrameAlreadyInitializedException ex) {
-           this.getLogger().catching(ex);
-           System.exit(1);
+       @Override
+       public void doChangeOwnNameData (Contact contact) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
 
-       // Now start the frame
-       this.frame.setupFrame(this);
+       @Override
+       public void doChangeOwnOtherData (Contact contact) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
 
-       // Debug message
-       this.getLogger().trace("EXIT!");
-    }
+       /**
+        * Shows dialog to enter new contact
+        * 
+        * @return Returns finished Contact instance
+        */
+       @Override
+       public Contact doEnterOwnData () {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
 
-    @Override
-    public void outputMessage (final String message) {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
+       /**
+        * Shuts down this client
+        */
+       @Override
+       public void doShutdown () {
+               // Debug message
+               this.getLogger().trace("CALLED!");
 
-    @Override
-    public void showCurrentMenu () {
-       // Debug message
-       //* NOISY-DEBUG: */ this.getLogger().trace("CALLED!");
+               // Parent call
+               super.doShutdown();
+
+               // Shutdown frame
+               this.frame.doShutdown();
+
+               // @TODO Add other shutdown stuff
+               // Debug message
+               this.getLogger().trace("EXIT!");
+       }
+
+       @Override
+       public void doUserMenuChoice () throws UnhandledUserChoiceException {
+               // Debug message
+               //* NOISY-DEBUG: */ this.getLogger().trace("CALLED!");
+
+               // Not implemented here
+       }
+
+       @Override
+       public char enterChar (final char[] validChars, String message) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
 
-       // Not implemented here
-    }
+       @Override
+       public Gender enterGender (final String message) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
+       @Override
+       public int enterInt (final int minimum, final int maximum, final String message) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
+       @Override
+       public String enterString (final int minLength, final int maxLength, final String message, final boolean allowEmpty) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
+       @Override
+       public Menu getMenu (final String menuType) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
+       /**
+        * Returns a Swing menu item
+        *
+        * @param accessKey Key to access the menu
+        * @param text Text to show to user
+        * @return A SelectableMenuItem
+        */
+       @Override
+       public SelectableMenuItem getMenuItem (final char accessKey, final String text) {
+               // Debug message
+               this.getLogger().trace("CALLED!");
+
+               // Returns null as the menu is now no longer controlled here.
+               return null;
+       }
 
-    @Override
-    public void showEntry (final SelectableMenuItem item) {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
+       /**
+        * Inizializes this client
+        */
+       @Override
+       public void init () {
+               // Debug message
+               this.getLogger().trace("CALLED!");
+
+               // Init contact manager here
+               this.initContactManager();
+
+               try {
+                       // Init frame
+                       this.frame.init();
+               } catch (final FrameAlreadyInitializedException ex) {
+                       this.getLogger().catching(ex);
+                       System.exit(1);
+               }
+
+               // Now start the frame
+               this.frame.setupFrame(this);
+
+               // Debug message
+               this.getLogger().trace("EXIT!");
+       }
+
+       @Override
+       public void outputMessage (final String message) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
 
-    @Override
-    public void showWelcome () {
+       @Override
+       public void showCurrentMenu () {
        // Debug message
-       this.getLogger().trace("CALLED!");
-
-       // Not implemented here
-    }
-
-    @Override
-    public void userChooseChangeContactData (final Contact contact) throws UnhandledUserChoiceException {
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    /**
-     * Fills menu map with swing menus
-     */
-    @Override
-    protected final void fillMenuMap () {
-       // Nothing to fill here as the Swing frame is handling this all
-       throw new UnsupportedOperationException("Not implemented.");
-    }
+               //* NOISY-DEBUG: */ this.getLogger().trace("CALLED!");
+
+               // Not implemented here
+       }
+
+       @Override
+       public void showEntry (final SelectableMenuItem item) {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
+       @Override
+       public void showWelcome () {
+               // Debug message
+               this.getLogger().trace("CALLED!");
+
+               // Not implemented here
+       }
+
+       @Override
+       public void userChooseChangeContactData (final Contact contact) throws UnhandledUserChoiceException {
+               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+       }
+
+       /**
+        * Fills menu map with swing menus
+        */
+       @Override
+       protected final void fillMenuMap () {
+               // Nothing to fill here as the Swing frame is handling this all
+               throw new UnsupportedOperationException("Not implemented.");
+       }
 }