2 * Copyright (C) 2015 Roland Haeder
\r
4 * This program is free software: you can redistribute it and/or modify
\r
5 * it under the terms of the GNU General Public License as published by
\r
6 * the Free Software Foundation, either version 3 of the License, or
\r
7 * (at your option) any later version.
\r
9 * This program is distributed in the hope that it will be useful,
\r
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 * GNU General Public License for more details.
\r
14 * You should have received a copy of the GNU General Public License
\r
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
17 package org.mxchange.addressbook.client.gui;
\r
19 import org.mxchange.addressbook.FrameAlreadyInitializedException;
\r
20 import org.mxchange.addressbook.UnhandledUserChoiceException;
\r
21 import org.mxchange.addressbook.application.Application;
\r
22 import org.mxchange.addressbook.client.BaseClient;
\r
23 import org.mxchange.addressbook.client.Client;
\r
24 import org.mxchange.addressbook.contact.Contact;
\r
25 import org.mxchange.addressbook.menu.Menu;
\r
26 import org.mxchange.addressbook.menu.item.SelectableMenuItem;
\r
30 * @author Roland Haeder
\r
32 public class SwingClient extends BaseClient implements Client {
\r
34 * Swing frame instance
\r
36 private final ClientFrame frame;
\r
39 * Constructor with an Application instance.
\r
41 * @param application Application instance
\r
43 public SwingClient (final Application application) {
\r
46 // Set application instance
\r
47 this.setApplication(application);
\r
49 // Init frame instance
\r
50 this.frame = AddressbookFrame.getSelfInstance(this);
\r
54 public void displayAddressBox (final Contact contact) {
\r
55 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
59 public void displayNameBox (final Contact contact) {
\r
60 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
64 public void displayOtherDataBox (final Contact contact) {
\r
65 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
69 public void doChangeOwnAddressData (Contact contact) {
\r
70 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
74 public void doChangeOwnNameData (Contact contact) {
\r
75 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
79 public void doChangeOwnOtherData (Contact contact) {
\r
80 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
84 public Contact doEnterOwnData () {
\r
85 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
89 public void doShutdown () {
\r
93 // @TODO Add other shutdown stuff
\r
97 public void doUserMenuChoice () throws UnhandledUserChoiceException {
\r
98 // Not implemented here
\r
102 public char enterChar (final char[] validChars, String message) {
\r
103 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
107 public int enterInt (final int minimum, final int maximum, final String message) {
\r
108 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
112 public String enterString (final int minLength, final int maxLength, final String message, final boolean allowEmpty) {
\r
113 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
117 public Menu getMenu (final String menuType) {
\r
118 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
122 * Returns a Swing menu item
\r
124 * @param accessKey Key to access the menu
\r
125 * @param text Text to show to user
\r
126 * @return A SelectableMenuItem
\r
129 public SelectableMenuItem getMenuItem (final char accessKey, final String text) {
\r
130 // Returns null as the menu is now no longer controlled here.
\r
135 * Inizializes this client
\r
138 public void initClient () {
\r
139 // Init contact manager here
\r
140 this.initContactManager();
\r
144 this.frame.initFrame();
\r
145 } catch (final FrameAlreadyInitializedException ex) {
\r
146 this.getLogger().catching(ex);
\r
150 // Now start the frame
\r
151 this.frame.setupFrame(this);
\r
155 public void outputMessage (final String message) {
\r
156 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
160 public void showCurrentMenu () {
\r
161 // Not implemented here
\r
165 public void showEntry (final SelectableMenuItem item) {
\r
166 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
170 public void showWelcome () {
\r
171 // Not implemented here
\r
175 public void userChooseChangeContactData (final Contact contact) throws UnhandledUserChoiceException {
\r
176 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
180 * Fills menu map with swing menus
\r
183 protected final void fillMenuMap () {
\r
184 // Nothing to fill here as the Swing frame is handling this all
\r
185 throw new UnsupportedOperationException("Not implemented.");
\r