X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=Addressbook%2Fsrc%2Forg%2Fmxchange%2Faddressbook%2Fclient%2Fgui%2FSwingClient.java;h=8992b3a1ebb621a54afb9499d6f829e79033fe25;hb=ac52e6515a6d8e23aea65a40b1ac0d1d481d6dfe;hp=88dfb96b58fef366eceaa729e52064b8e69ca5be;hpb=27f135983830bf9fc71b909db6c0fb97c618fccc;p=jfinancials-swing.git diff --git a/Addressbook/src/org/mxchange/addressbook/client/gui/SwingClient.java b/Addressbook/src/org/mxchange/addressbook/client/gui/SwingClient.java index 88dfb96..8992b3a 100644 --- a/Addressbook/src/org/mxchange/addressbook/client/gui/SwingClient.java +++ b/Addressbook/src/org/mxchange/addressbook/client/gui/SwingClient.java @@ -16,8 +16,9 @@ */ package org.mxchange.addressbook.client.gui; +import org.mxchange.addressbook.FrameAlreadyInitializedException; import org.mxchange.addressbook.UnhandledUserChoiceException; -import org.mxchange.addressbook.application.AddressbookApplication; +import org.mxchange.addressbook.application.Application; import org.mxchange.addressbook.client.BaseClient; import org.mxchange.addressbook.client.Client; import org.mxchange.addressbook.contact.Contact; @@ -35,17 +36,18 @@ public class SwingClient extends BaseClient implements Client { private final ClientFrame frame; /** - * Constructor with application instance - * @param application + * Constructor with an Application instance. + * + * @param application Application instance */ - public SwingClient (final AddressbookApplication application) { + public SwingClient (final Application application) { super(); // Set application instance this.setApplication(application); // Init frame instance - this.frame = new AddressbookFrame(this); + this.frame = AddressbookFrame.getSelfInstance(this); } @Override @@ -64,10 +66,38 @@ public class SwingClient extends BaseClient implements Client { } @Override - public void doUserMenuChoice () throws UnhandledUserChoiceException { + 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 () { + // Parent call + super.doShutdown(); + + // @TODO Add other shutdown stuff + } + + @Override + public void doUserMenuChoice () throws UnhandledUserChoiceException { + // 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. @@ -94,7 +124,6 @@ public class SwingClient extends BaseClient implements Client { * @param accessKey Key to access the menu * @param text Text to show to user * @return A SelectableMenuItem - * @todo Make sure the access key is unique */ @Override public SelectableMenuItem getMenuItem (final char accessKey, final String text) { @@ -109,9 +138,17 @@ public class SwingClient extends BaseClient implements Client { public void initClient () { // Init contact manager here this.initContactManager(); - + + try { + // Init frame + this.frame.initFrame(); + } catch (final FrameAlreadyInitializedException ex) { + this.getLogger().catching(ex); + System.exit(1); + } + // Now start the frame - this.frame.initFrame(this); + this.frame.setupFrame(this); } @Override @@ -121,7 +158,7 @@ public class SwingClient extends BaseClient implements Client { @Override public void showCurrentMenu () { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + // Not implemented here } @Override @@ -131,7 +168,7 @@ public class SwingClient extends BaseClient implements Client { @Override public void showWelcome () { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + // Not implemented here } @Override