]> git.mxchange.org Git - addressbook-lib.git/blobdiff - Addressbook/src/org/mxchange/addressbook/client/gui/SwingClient.java
the contact manager instance only exists when initFrame() is called and not on object...
[addressbook-lib.git] / Addressbook / src / org / mxchange / addressbook / client / gui / SwingClient.java
index 83417e166f8e4f3e9aa468d2019aa1ad10e5ecd9..4a51c942ac06cfac31c83eccd2ca2410943b490c 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.addressbook.client.gui;\r
 \r
 import org.mxchange.addressbook.UnhandledUserChoiceException;\r
-import org.mxchange.addressbook.application.AddressbookApplication;\r
+import org.mxchange.addressbook.application.Application;\r
 import org.mxchange.addressbook.client.BaseClient;\r
 import org.mxchange.addressbook.client.Client;\r
 import org.mxchange.addressbook.contact.Contact;\r
@@ -29,21 +29,23 @@ import org.mxchange.addressbook.menu.item.SelectableMenuItem;
  * @author Roland Haeder\r
  */\r
 public class SwingClient extends BaseClient implements Client {\r
+    /**\r
+     * Swing frame instance\r
+     */\r
+    private final ClientFrame frame;\r
+\r
     /**\r
      * Constructor with application instance\r
      * @param application \r
      */\r
-    public SwingClient (final AddressbookApplication application) {\r
+    public SwingClient (final Application application) {\r
        super();\r
 \r
        // Set application instance\r
        this.setApplication(application);\r
 \r
-       // Init contact manager here\r
-       this.initContactManager(this);\r
-\r
-       // Fill menu map\r
-       this.fillMenuMap();\r
+       // Init frame instance\r
+       this.frame = new AddressbookFrame(this);\r
     }\r
 \r
     @Override\r
@@ -61,9 +63,17 @@ public class SwingClient extends BaseClient implements Client {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
     }\r
 \r
+    @Override\r
+    public void doShutdown () {\r
+       // Parent call\r
+       super.doShutdown();\r
+\r
+       // @TODO Add other shutdown stuff\r
+    }\r
+\r
     @Override\r
     public void doUserMenuChoice () throws UnhandledUserChoiceException {\r
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
+       // Not implemented here\r
     }\r
 \r
     @Override\r
@@ -92,7 +102,6 @@ public class SwingClient extends BaseClient implements Client {
      * @param accessKey Key to access the menu\r
      * @param text Text to show to user\r
      * @return A SelectableMenuItem\r
-     * @todo Make sure the access key is unique\r
      */\r
     @Override\r
     public SelectableMenuItem getMenuItem (final char accessKey, final String text) {\r
@@ -100,6 +109,18 @@ public class SwingClient extends BaseClient implements Client {
        return null;\r
     }\r
 \r
+    /**\r
+     * Inizializes this client\r
+     */\r
+    @Override\r
+    public void initClient () {\r
+       // Init contact manager here\r
+       this.initContactManager();\r
+       \r
+       // Now start the frame\r
+       this.frame.setupFrame(this);\r
+    }\r
+\r
     @Override\r
     public void outputMessage (final String message) {\r
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
@@ -107,7 +128,7 @@ public class SwingClient extends BaseClient implements Client {
 \r
     @Override\r
     public void showCurrentMenu () {\r
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
+       // Not implemented here\r
     }\r
 \r
     @Override\r
@@ -117,7 +138,7 @@ public class SwingClient extends BaseClient implements Client {
 \r
     @Override\r
     public void showWelcome () {\r
-       throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
+       // Not implemented here\r
     }\r
 \r
     @Override\r
@@ -131,6 +152,6 @@ public class SwingClient extends BaseClient implements Client {
     @Override\r
     protected final void fillMenuMap () {\r
        // Nothing to fill here as the Swing frame is handling this all\r
+       throw new UnsupportedOperationException("Not implemented.");\r
     }\r
-    \r
 }\r