]> git.mxchange.org Git - addressbook-swing.git/blob - Addressbook/src/org/mxchange/addressbook/client/BaseClient.java
Initial commit
[addressbook-swing.git] / Addressbook / src / org / mxchange / addressbook / client / BaseClient.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;\r
18 \r
19 import org.mxchange.addressbook.BaseFrameworkSystem;\r
20 \r
21 /**\r
22  * A general client\r
23  *\r
24  * @author Roland Haeder\r
25  */\r
26 public class BaseClient extends BaseFrameworkSystem {\r
27 \r
28     /**\r
29      * Current menu choice\r
30      */\r
31     private String currentMenu;\r
32 \r
33     /**\r
34      * Application is not running by default\r
35      */\r
36     private boolean isRunning;\r
37 \r
38     /**\r
39      * No instances can be created of this class\r
40      */\r
41     protected BaseClient () {\r
42         super();\r
43     }\r
44 \r
45     /**\r
46      * Disables running state, so the main loop can abort.\r
47      */\r
48     public void disableIsRunning () {\r
49         this.isRunning = false;\r
50     }\r
51 \r
52     public void enableIsRunning () {\r
53         this.isRunning = true;\r
54     }\r
55 \r
56     /**\r
57      * Current menu choice\r
58      * @return the currentMenu\r
59      */\r
60     public String getCurrentMenu () {\r
61         return this.currentMenu;\r
62     }\r
63 \r
64     /**\r
65      * Current menu choice\r
66      * @param currentMenu the currentMenu to set\r
67      */\r
68     public void setCurrentMenu (final String currentMenu) {\r
69         this.currentMenu = currentMenu;\r
70     }\r
71 \r
72     public boolean isApplicationRunning () {\r
73         // In console client, 0 may have been used\r
74         return this.isRunning;\r
75     }\r
76 }\r