]> git.mxchange.org Git - addressbook-swing.git/blob - Addressbook/src/org/mxchange/addressbook/client/gui/SwingClient.java
88dfb96b58fef366eceaa729e52064b8e69ca5be
[addressbook-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.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
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 application instance\r
39      * @param application \r
40      */\r
41     public SwingClient (final AddressbookApplication application) {\r
42         super();\r
43 \r
44         // Set application instance\r
45         this.setApplication(application);\r
46 \r
47         // Init frame instance\r
48         this.frame = new AddressbookFrame(this);\r
49     }\r
50 \r
51     @Override\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
54     }\r
55 \r
56     @Override\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
59     }\r
60 \r
61     @Override\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
64     }\r
65 \r
66     @Override\r
67     public void doUserMenuChoice () throws UnhandledUserChoiceException {\r
68         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
69     }\r
70 \r
71     @Override\r
72     public char enterChar (final char[] validChars, String message) {\r
73         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
74     }\r
75 \r
76     @Override\r
77     public int enterInt (final int minimum, final int maximum, final String message) {\r
78         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
79     }\r
80 \r
81     @Override\r
82     public String enterString (final int minLength, final int maxLength, final String message, final boolean allowEmpty) {\r
83         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
84     }\r
85 \r
86     @Override\r
87     public Menu getMenu (final String menuType) {\r
88         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
89     }\r
90 \r
91     /**\r
92      * Returns a Swing menu item\r
93      * \r
94      * @param accessKey Key to access the menu\r
95      * @param text Text to show to user\r
96      * @return A SelectableMenuItem\r
97      * @todo Make sure the access key is unique\r
98      */\r
99     @Override\r
100     public SelectableMenuItem getMenuItem (final char accessKey, final String text) {\r
101         // Returns null as the menu is now no longer controlled here.\r
102         return null;\r
103     }\r
104 \r
105     /**\r
106      * Inizializes this client\r
107      */\r
108     @Override\r
109     public void initClient () {\r
110         // Init contact manager here\r
111         this.initContactManager();\r
112         \r
113         // Now start the frame\r
114         this.frame.initFrame(this);\r
115     }\r
116 \r
117     @Override\r
118     public void outputMessage (final String message) {\r
119         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
120     }\r
121 \r
122     @Override\r
123     public void showCurrentMenu () {\r
124         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
125     }\r
126 \r
127     @Override\r
128     public void showEntry (final SelectableMenuItem item) {\r
129         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
130     }\r
131 \r
132     @Override\r
133     public void showWelcome () {\r
134         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
135     }\r
136 \r
137     @Override\r
138     public void userChooseChangeContactData (final Contact contact) throws UnhandledUserChoiceException {\r
139         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.\r
140     }\r
141 \r
142     /**\r
143      * Fills menu map with swing menus\r
144      */\r
145     @Override\r
146     protected final void fillMenuMap () {\r
147         // Nothing to fill here as the Swing frame is handling this all\r
148         throw new UnsupportedOperationException("Not implemented.");\r
149     }\r
150 }\r