InputProvider, Terminal, Closeable, AutoCloseableDefaultVirtualTerminal, StreamBasedTerminalpublic abstract class AbstractTerminal extends Object implements Terminal
| Modifier | Constructor | Description |
|---|---|---|
protected |
AbstractTerminal() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addResizeListener(TerminalResizeListener listener) |
Adds a
TerminalResizeListener to be called when the terminal has changed size. |
TextGraphics |
newTextGraphics() |
Creates a new TextGraphics object that uses this Terminal directly when outputting.
|
protected void |
onResized(int columns,
int rows) |
Call this method when the terminal has been resized or the initial size of the terminal has been discovered.
|
protected void |
onResized(TerminalSize newSize) |
Call this method when the terminal has been resized or the initial size of the terminal has been discovered.
|
void |
removeResizeListener(TerminalResizeListener listener) |
Removes a
TerminalResizeListener from the list of listeners to be notified when the terminal has changed
size |
pollInput, readInputclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbell, clearScreen, close, disableSGR, enableSGR, enquireTerminal, enterPrivateMode, exitPrivateMode, flush, getCursorPosition, getTerminalSize, putCharacter, resetColorAndSGR, setBackgroundColor, setCursorPosition, setCursorPosition, setCursorVisible, setForegroundColorpublic void addResizeListener(TerminalResizeListener listener)
TerminalTerminalResizeListener to be called when the terminal has changed size. There is no guarantee that
this listener will really be invoked when the terminal has changed size, at all depends on the terminal emulator
implementation. Normally on Unix systems the WINCH signal will be sent to the process and lanterna can intercept
this.
There are no guarantees on what thread the call will be made on, so please be careful with what kind of operation you perform in this callback. You should probably not take too long to return.
addResizeListener in interface Terminallistener - Listener object to be called when the terminal has been changedTerminalResizeListenerpublic void removeResizeListener(TerminalResizeListener listener)
TerminalTerminalResizeListener from the list of listeners to be notified when the terminal has changed
sizeremoveResizeListener in interface Terminallistener - Listener object to removeTerminalResizeListenerprotected void onResized(int columns,
int rows)
columns - Number of columns in the new sizerows - Number of rows in the new sizeprotected void onResized(TerminalSize newSize)
newSize - Last discovered terminal sizepublic TextGraphics newTextGraphics() throws IOException
Terminal.flush() after any operation, so you'll need to do that on your own.newTextGraphics in interface TerminalIOException - If there was an I/O error when setting up the TextGraphics objectCopyright © 2020. All rights reserved.