public abstract class AbstractTerminal extends Object implements Terminal
Modifier | Constructor and Description |
---|---|
protected |
AbstractTerminal() |
Modifier and Type | Method and Description |
---|---|
void |
addResizeListener(ResizeListener listener)
Adds a
ResizeListener 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.
|
void |
removeResizeListener(ResizeListener listener)
Removes a
ResizeListener from the list of listeners to be notified when the terminal has changed size |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearScreen, disableSGR, enableSGR, enquireTerminal, enterPrivateMode, exitPrivateMode, flush, getTerminalSize, putCharacter, resetColorAndSGR, setBackgroundColor, setCursorPosition, setCursorVisible, setForegroundColor
pollInput, readInput
public void addResizeListener(ResizeListener listener)
Terminal
ResizeListener
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 Terminal
listener
- Listener object to be called when the terminal has been changedResizeListener
public void removeResizeListener(ResizeListener listener)
Terminal
ResizeListener
from the list of listeners to be notified when the terminal has changed sizeremoveResizeListener
in interface Terminal
listener
- Listener object to removeResizeListener
protected void onResized(int columns, int rows)
columns
- Number of columns in the new sizerows
- Number of rows in the new sizepublic TextGraphics newTextGraphics() throws IOException
Terminal
.flush()
after any operation, so you'll need to do that on your own.newTextGraphics
in interface Terminal
IOException
Copyright © 2016. All rights reserved.