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.UnhandledUserChoiceException;
\r
20 import org.mxchange.addressbook.application.AddressbookApplication;
\r
21 import org.mxchange.addressbook.client.BaseClient;
\r
22 import org.mxchange.addressbook.client.Client;
\r
23 import org.mxchange.addressbook.contact.Contact;
\r
24 import org.mxchange.addressbook.menu.Menu;
\r
25 import org.mxchange.addressbook.menu.item.SelectableMenuItem;
\r
29 * @author Roland Haeder
\r
31 public class SwingClient extends BaseClient implements Client {
\r
33 * Swing frame instance
\r
35 private final ClientFrame frame;
\r
38 * Constructor with application instance
\r
39 * @param application
\r
41 public SwingClient (final AddressbookApplication application) {
\r
44 // Set application instance
\r
45 this.setApplication(application);
\r
47 // Init frame instance
\r
48 this.frame = new AddressbookFrame(this);
\r
52 public void displayAddressBox (final Contact contact) {
\r
53 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
57 public void displayNameBox (final Contact contact) {
\r
58 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
62 public void displayOtherDataBox (final Contact contact) {
\r
63 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
67 public void doShutdown () {
\r
71 // @TODO Add other shutdown stuff
\r
75 public void doUserMenuChoice () throws UnhandledUserChoiceException {
\r
76 // Not implemented here
\r
80 public char enterChar (final char[] validChars, String message) {
\r
81 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
85 public int enterInt (final int minimum, final int maximum, final String message) {
\r
86 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
90 public String enterString (final int minLength, final int maxLength, final String message, final boolean allowEmpty) {
\r
91 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
95 public Menu getMenu (final String menuType) {
\r
96 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
100 * Returns a Swing menu item
\r
102 * @param accessKey Key to access the menu
\r
103 * @param text Text to show to user
\r
104 * @return A SelectableMenuItem
\r
105 * @todo Make sure the access key is unique
\r
108 public SelectableMenuItem getMenuItem (final char accessKey, final String text) {
\r
109 // Returns null as the menu is now no longer controlled here.
\r
114 * Inizializes this client
\r
117 public void initClient () {
\r
118 // Init contact manager here
\r
119 this.initContactManager();
\r
121 // Now start the frame
\r
122 this.frame.initFrame(this);
\r
126 public void outputMessage (final String message) {
\r
127 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
131 public void showCurrentMenu () {
\r
132 // Not implemented here
\r
136 public void showEntry (final SelectableMenuItem item) {
\r
137 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
141 public void showWelcome () {
\r
142 // Not implemented here
\r
146 public void userChooseChangeContactData (final Contact contact) throws UnhandledUserChoiceException {
\r
147 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
\r
151 * Fills menu map with swing menus
\r
154 protected final void fillMenuMap () {
\r
155 // Nothing to fill here as the Swing frame is handling this all
\r
156 throw new UnsupportedOperationException("Not implemented.");
\r