2 * Jexer - Java Text User Interface
4 * The MIT License (MIT)
6 * Copyright (C) 2019 Kevin Lamonte
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:
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
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.
26 * @author Kevin Lamonte [kevin.lamonte@gmail.com]
29 package jexer
.backend
;
32 * TSessionInfo provides a default session implementation. The username is
33 * blank, language is "en_US", with a 80x24 text window.
35 public class TSessionInfo
implements SessionInfo
{
37 // ------------------------------------------------------------------------
38 // Variables --------------------------------------------------------------
39 // ------------------------------------------------------------------------
44 private String username
= "";
49 private String language
= "en_US";
54 private int windowWidth
= 80;
59 private int windowHeight
= 24;
61 // ------------------------------------------------------------------------
62 // Constructors -----------------------------------------------------------
63 // ------------------------------------------------------------------------
68 public TSessionInfo() {
75 * @param width the number of columns
76 * @param height the number of rows
78 public TSessionInfo(final int width
, final int height
) {
79 this.windowWidth
= width
;
80 this.windowHeight
= height
;
83 // ------------------------------------------------------------------------
84 // SessionInfo ------------------------------------------------------------
85 // ------------------------------------------------------------------------
90 * @return the username
92 public String
getUsername() {
99 * @param username the value
101 public void setUsername(final String username
) {
102 this.username
= username
;
108 * @return the language
110 public String
getLanguage() {
111 return this.language
;
117 * @param language the value
119 public void setLanguage(final String language
) {
120 this.language
= language
;
124 * Text window width getter.
126 * @return the window width
128 public int getWindowWidth() {
133 * Text window height getter.
135 * @return the window height
137 public int getWindowHeight() {
142 * Re-query the text window size.
144 public void queryWindowSize() {