Change build scripts
[jvcard.git] / src / com / googlecode / lanterna / terminal / ResizeListener.java
1 /*
2 * This file is part of lanterna (http://code.google.com/p/lanterna/).
3 *
4 * lanterna is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright (C) 2010-2015 Martin
18 */
19 package com.googlecode.lanterna.terminal;
20
21 import com.googlecode.lanterna.TerminalSize;
22
23 /**
24 * Listener interface that can be used to be alerted on terminal resizing
25 */
26 public interface ResizeListener {
27
28 /**
29 * The terminal has changed its size, most likely because the user has resized the window. This callback is
30 * invoked by something inside the lanterna library, it could be a signal handler thread, it could be the AWT
31 * thread, it could be something else, so please be careful with what kind of operation you do in here. Also,
32 * make sure not to take too long before returning. Best practice would be to update an internal status in your
33 * program to mark that the terminal has been resized (possibly along with the new size) and then in your main
34 * loop you deal with this at the beginning of each redraw.
35 * @param terminal Terminal that was resized
36 * @param newSize Size of the terminal after the resize
37 */
38 @SuppressWarnings("UnusedParameters")
39 void onResized(Terminal terminal, TerminalSize newSize);
40
41 }