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
* @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
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
* @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
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
\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
\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
@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