]> git.mxchange.org Git - jaddressbook-lib.git/blob - src/org/mxchange/addressbook/client/gui/SwingClient.java
9ea4e8816fd677c7c6eac04c316cf04134291fe2
[jaddressbook-lib.git] / src / org / mxchange / addressbook / client / gui / SwingClient.java
1 /*\r
2  * Copyright (C) 2015 Roland Haeder\r
3  *\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
8  *\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
13  *\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
16  */\r
17 package org.mxchange.addressbook.client.gui;\r
18 \r
19 import org.mxchange.addressbook.UnhandledUserChoiceException;\r
20 import org.mxchange.addressbook.application.Application;\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
26 \r
27 /**\r
28  *\r
29  * @author Roland Haeder\r
30  */\r
31 public class SwingClient extends BaseClient implements Client {\r
32     /**\r
33      * Swing frame instance\r
34      */\r
35     private final ClientFrame frame;\r
36 \r
37     /**\r
38      * Constructor with an Application instance.\r
39      * \r
40      * @param application Application instance\r
41      */\r
42     public SwingClient (final Application application) {\r
43         super();\r
44 \r
45         // Set application instance\r
46         this.setApplication(application);\r
47 \r
48         // Init frame instance\r
49         this.frame = AddressbookFrame.getSelfInstance(this);\r
50     }\r
51 \r
52     @Override\r
53     public void displayAddressBox (final Contact contact) {\r
54         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
55     }\r
56 \r
57     @Override\r
58     public void displayNameBox (final Contact contact) {\r
59         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
60     }\r
61 \r
62     @Override\r
63     public void displayOtherDataBox (final Contact contact) {\r
64         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
65     }\r
66 \r
67     @Override\r
68     public void doChangeOwnAddressData (Contact contact) {\r
69         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
70     }\r
71 \r
72     @Override\r
73     public void doChangeOwnNameData (Contact contact) {\r
74         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
75     }\r
76 \r
77     @Override\r
78     public void doChangeOwnOtherData (Contact contact) {\r
79         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
80     }\r
81 \r
82     @Override\r
83     public Contact doEnterOwnData () {\r
84         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
85     }\r
86 \r
87     @Override\r
88     public void doShutdown () {\r
89         // Parent call\r
90         super.doShutdown();\r
91 \r
92         // @TODO Add other shutdown stuff\r
93     }\r
94 \r
95     @Override\r
96     public void doUserMenuChoice () throws UnhandledUserChoiceException {\r
97         // Not implemented here\r
98     }\r
99 \r
100     @Override\r
101     public char enterChar (final char[] validChars, String message) {\r
102         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
103     }\r
104 \r
105     @Override\r
106     public int enterInt (final int minimum, final int maximum, final String message) {\r
107         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
108     }\r
109 \r
110     @Override\r
111     public String enterString (final int minLength, final int maxLength, final String message, final boolean allowEmpty) {\r
112         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
113     }\r
114 \r
115     @Override\r
116     public Menu getMenu (final String menuType) {\r
117         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
118     }\r
119 \r
120     /**\r
121      * Returns a Swing menu item\r
122      * \r
123      * @param accessKey Key to access the menu\r
124      * @param text Text to show to user\r
125      * @return A SelectableMenuItem\r
126      */\r
127     @Override\r
128     public SelectableMenuItem getMenuItem (final char accessKey, final String text) {\r
129         // Returns null as the menu is now no longer controlled here.\r
130         return null;\r
131     }\r
132 \r
133     /**\r
134      * Inizializes this client\r
135      */\r
136     @Override\r
137     public void initClient () {\r
138         // Init contact manager here\r
139         this.initContactManager();\r
140 \r
141         // Init frame\r
142         this.frame.initFrame();\r
143 \r
144         // Now start the frame\r
145         this.frame.setupFrame(this);\r
146     }\r
147 \r
148     @Override\r
149     public void outputMessage (final String message) {\r
150         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
151     }\r
152 \r
153     @Override\r
154     public void showCurrentMenu () {\r
155         // Not implemented here\r
156     }\r
157 \r
158     @Override\r
159     public void showEntry (final SelectableMenuItem item) {\r
160         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
161     }\r
162 \r
163     @Override\r
164     public void showWelcome () {\r
165         // Not implemented here\r
166     }\r
167 \r
168     @Override\r
169     public void userChooseChangeContactData (final Contact contact) throws UnhandledUserChoiceException {\r
170         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
171     }\r
172 \r
173     /**\r
174      * Fills menu map with swing menus\r
175      */\r
176     @Override\r
177     protected final void fillMenuMap () {\r
178         // Nothing to fill here as the Swing frame is handling this all\r
179         throw new UnsupportedOperationException("Not implemented.");\r
180     }\r
181 }\r