]> git.mxchange.org Git - jfinancials-swing.git/blob - Addressbook/src/org/mxchange/addressbook/client/gui/SwingClient.java
The NetBeans-created GUI was buggy, maybe because of the .form file. So I better...
[jfinancials-swing.git] / Addressbook / 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.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
27 \r
28 /**\r
29  *\r
30  * @author Roland Haeder\r
31  */\r
32 public class SwingClient extends BaseClient implements Client {\r
33     /**\r
34      * Swing frame instance\r
35      */\r
36     private final ClientFrame frame;\r
37 \r
38     /**\r
39      * Constructor with an Application instance.\r
40      * \r
41      * @param application Application instance\r
42      */\r
43     public SwingClient (final Application application) {\r
44         super();\r
45 \r
46         // Set application instance\r
47         this.setApplication(application);\r
48 \r
49         // Init frame instance\r
50         this.frame = AddressbookFrame.getSelfInstance(this);\r
51     }\r
52 \r
53     @Override\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
56     }\r
57 \r
58     @Override\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
61     }\r
62 \r
63     @Override\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
66     }\r
67 \r
68     @Override\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
71     }\r
72 \r
73     @Override\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
76     }\r
77 \r
78     @Override\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
81     }\r
82 \r
83     @Override\r
84     public Contact doEnterOwnData () {\r
85         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
86     }\r
87 \r
88     @Override\r
89     public void doShutdown () {\r
90         // Parent call\r
91         super.doShutdown();\r
92 \r
93         // @TODO Add other shutdown stuff\r
94     }\r
95 \r
96     @Override\r
97     public void doUserMenuChoice () throws UnhandledUserChoiceException {\r
98         // Not implemented here\r
99     }\r
100 \r
101     @Override\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
104     }\r
105 \r
106     @Override\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
109     }\r
110 \r
111     @Override\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
114     }\r
115 \r
116     @Override\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
119     }\r
120 \r
121     /**\r
122      * Returns a Swing menu item\r
123      * \r
124      * @param accessKey Key to access the menu\r
125      * @param text Text to show to user\r
126      * @return A SelectableMenuItem\r
127      */\r
128     @Override\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
131         return null;\r
132     }\r
133 \r
134     /**\r
135      * Inizializes this client\r
136      */\r
137     @Override\r
138     public void initClient () {\r
139         // Init contact manager here\r
140         this.initContactManager();\r
141 \r
142         try {\r
143             // Init frame\r
144             this.frame.initFrame();\r
145         } catch (final FrameAlreadyInitializedException ex) {\r
146             this.getLogger().catching(ex);\r
147             System.exit(1);\r
148         }\r
149 \r
150         // Now start the frame\r
151         this.frame.setupFrame(this);\r
152     }\r
153 \r
154     @Override\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
157     }\r
158 \r
159     @Override\r
160     public void showCurrentMenu () {\r
161         // Not implemented here\r
162     }\r
163 \r
164     @Override\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
167     }\r
168 \r
169     @Override\r
170     public void showWelcome () {\r
171         // Not implemented here\r
172     }\r
173 \r
174     @Override\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
177     }\r
178 \r
179     /**\r
180      * Fills menu map with swing menus\r
181      */\r
182     @Override\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
186     }\r
187 }\r