Commit | Line | Data |
---|---|---|
daa4106c | 1 | /* |
df8de03f KL |
2 | * Jexer - Java Text User Interface |
3 | * | |
e16dda65 | 4 | * The MIT License (MIT) |
df8de03f | 5 | * |
a2018e99 | 6 | * Copyright (C) 2017 Kevin Lamonte |
df8de03f | 7 | * |
e16dda65 KL |
8 | * Permission is hereby granted, free of charge, to any person obtaining a |
9 | * copy of this software and associated documentation files (the "Software"), | |
10 | * to deal in the Software without restriction, including without limitation | |
11 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
12 | * and/or sell copies of the Software, and to permit persons to whom the | |
13 | * Software is furnished to do so, subject to the following conditions: | |
df8de03f | 14 | * |
e16dda65 KL |
15 | * The above copyright notice and this permission notice shall be included in |
16 | * all copies or substantial portions of the Software. | |
df8de03f | 17 | * |
e16dda65 KL |
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
21 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
24 | * DEALINGS IN THE SOFTWARE. | |
7b5261bc KL |
25 | * |
26 | * @author Kevin Lamonte [kevin.lamonte@gmail.com] | |
27 | * @version 1 | |
df8de03f KL |
28 | */ |
29 | package jexer.session; | |
30 | ||
31 | /** | |
32 | * TSessionInfo provides a default session implementation. The username is | |
33 | * blank, language is "en_US", with a 80x24 text window. | |
34 | */ | |
7b5261bc | 35 | public final class TSessionInfo implements SessionInfo { |
df8de03f KL |
36 | |
37 | /** | |
7b5261bc | 38 | * User name. |
df8de03f KL |
39 | */ |
40 | private String username = ""; | |
41 | ||
42 | /** | |
7b5261bc | 43 | * Language. |
df8de03f KL |
44 | */ |
45 | private String language = "en_US"; | |
46 | ||
47 | /** | |
7b5261bc | 48 | * Text window width. |
df8de03f KL |
49 | */ |
50 | private int windowWidth = 80; | |
51 | ||
52 | /** | |
7b5261bc | 53 | * Text window height. |
df8de03f KL |
54 | */ |
55 | private int windowHeight = 24; | |
56 | ||
57 | /** | |
7b5261bc | 58 | * Username getter. |
df8de03f KL |
59 | * |
60 | * @return the username | |
61 | */ | |
62 | public String getUsername() { | |
7b5261bc | 63 | return this.username; |
df8de03f KL |
64 | } |
65 | ||
66 | /** | |
7b5261bc | 67 | * Username setter. |
df8de03f KL |
68 | * |
69 | * @param username the value | |
70 | */ | |
7b5261bc KL |
71 | public void setUsername(final String username) { |
72 | this.username = username; | |
df8de03f KL |
73 | } |
74 | ||
75 | /** | |
7b5261bc | 76 | * Language getter. |
df8de03f KL |
77 | * |
78 | * @return the language | |
79 | */ | |
80 | public String getLanguage() { | |
7b5261bc | 81 | return this.language; |
df8de03f KL |
82 | } |
83 | ||
84 | /** | |
7b5261bc | 85 | * Language setter. |
df8de03f KL |
86 | * |
87 | * @param language the value | |
88 | */ | |
7b5261bc KL |
89 | public void setLanguage(final String language) { |
90 | this.language = language; | |
df8de03f KL |
91 | } |
92 | ||
93 | /** | |
7b5261bc | 94 | * Text window width getter. |
c8496dac KL |
95 | * |
96 | * @return the window width | |
df8de03f KL |
97 | */ |
98 | public int getWindowWidth() { | |
7b5261bc | 99 | return windowWidth; |
df8de03f KL |
100 | } |
101 | ||
102 | /** | |
7b5261bc | 103 | * Text window height getter. |
c8496dac KL |
104 | * |
105 | * @return the window height | |
df8de03f KL |
106 | */ |
107 | public int getWindowHeight() { | |
7b5261bc | 108 | return windowHeight; |
df8de03f | 109 | } |
c8496dac KL |
110 | |
111 | /** | |
7b5261bc | 112 | * Re-query the text window size. |
c8496dac KL |
113 | */ |
114 | public void queryWindowSize() { | |
7b5261bc | 115 | // NOP |
c8496dac KL |
116 | } |
117 | ||
df8de03f | 118 | } |