Module com.googlecode.lanterna
Package com.googlecode.lanterna.terminal
Class IOSafeTerminalAdapter.Extended
- java.lang.Object
-
- com.googlecode.lanterna.terminal.IOSafeTerminalAdapter
-
- com.googlecode.lanterna.terminal.IOSafeTerminalAdapter.Extended
-
- All Implemented Interfaces:
Scrollable,InputProvider,ExtendedTerminal,IOSafeExtendedTerminal,IOSafeTerminal,Terminal,java.io.Closeable,java.lang.AutoCloseable
- Enclosing class:
- IOSafeTerminalAdapter
public static class IOSafeTerminalAdapter.Extended extends IOSafeTerminalAdapter implements IOSafeExtendedTerminal
This class exposes methods for converting an extended terminal into an IOSafeExtendedTerminal.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.googlecode.lanterna.terminal.IOSafeTerminalAdapter
IOSafeTerminalAdapter.Extended
-
-
Field Summary
Fields Modifier and Type Field Description private ExtendedTerminalbackend-
Fields inherited from class com.googlecode.lanterna.terminal.IOSafeTerminalAdapter
exceptionHandler
-
-
Constructor Summary
Constructors Constructor Description Extended(ExtendedTerminal backend, IOSafeTerminalAdapter.ExceptionHandler exceptionHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeiconify()De-iconifies the terminal, which likely means restoring it from minimized state with most window managersvoidiconify()Iconifies the terminal, this likely means minimizing the window with most window managersvoidmaximize()Maximizes the terminal, so that it takes up all available spacevoidpopTitle()Replaces the terminal title with the top element from the title stack managed by the terminal (the element is removed from the stack as expected)voidpushTitle()Saves the current window title on a stack managed internally by the terminal.voidscrollLines(int firstLine, int lastLine, int distance)Scroll a range of lines of this Scrollable according to given distance.voidsetMouseCaptureMode(MouseCaptureMode mouseCaptureMode)Enabled or disables capturing of mouse event.voidsetTerminalSize(int columns, int rows)Attempts to resize the terminal through dtterm extensions "CSI 8 ; rows ; columns ; t".voidsetTitle(java.lang.String title)This methods sets the title of the terminal, which is normally only visible if you are running the application in a terminal emulator in a graphical environment.voidunmaximize()Restores the terminal back to its previous size, after having been maximized-
Methods inherited from class com.googlecode.lanterna.terminal.IOSafeTerminalAdapter
addResizeListener, bell, clearScreen, close, createDoNothingOnExceptionAdapter, createDoNothingOnExceptionAdapter, createRuntimeExceptionConvertingAdapter, createRuntimeExceptionConvertingAdapter, disableSGR, enableSGR, enquireTerminal, enterPrivateMode, exitPrivateMode, flush, getCursorPosition, getTerminalSize, newTextGraphics, pollInput, putCharacter, putString, readInput, removeResizeListener, resetColorAndSGR, setBackgroundColor, setCursorPosition, setCursorPosition, setCursorVisible, setForegroundColor
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.googlecode.lanterna.terminal.IOSafeTerminal
bell, clearScreen, close, disableSGR, enableSGR, enquireTerminal, enterPrivateMode, exitPrivateMode, flush, getCursorPosition, getTerminalSize, pollInput, putCharacter, putString, readInput, resetColorAndSGR, setBackgroundColor, setCursorPosition, setCursorPosition, setCursorVisible, setForegroundColor
-
Methods inherited from interface com.googlecode.lanterna.terminal.Terminal
addResizeListener, newTextGraphics, removeResizeListener
-
-
-
-
Field Detail
-
backend
private final ExtendedTerminal backend
-
-
Constructor Detail
-
Extended
public Extended(ExtendedTerminal backend, IOSafeTerminalAdapter.ExceptionHandler exceptionHandler)
-
-
Method Detail
-
setTerminalSize
public void setTerminalSize(int columns, int rows)Description copied from interface:ExtendedTerminalAttempts to resize the terminal through dtterm extensions "CSI 8 ; rows ; columns ; t". This isn't widely supported, which is why the method is not exposed through the common Terminal interface.- Specified by:
setTerminalSizein interfaceExtendedTerminal- Specified by:
setTerminalSizein interfaceIOSafeExtendedTerminal- Parameters:
columns- New size (columns)rows- New size (rows)
-
setTitle
public void setTitle(java.lang.String title)
Description copied from interface:ExtendedTerminalThis methods sets the title of the terminal, which is normally only visible if you are running the application in a terminal emulator in a graphical environment.- Specified by:
setTitlein interfaceExtendedTerminal- Specified by:
setTitlein interfaceIOSafeExtendedTerminal- Parameters:
title- Title to set on the terminal
-
pushTitle
public void pushTitle()
Description copied from interface:ExtendedTerminalSaves the current window title on a stack managed internally by the terminal.- Specified by:
pushTitlein interfaceExtendedTerminal- Specified by:
pushTitlein interfaceIOSafeExtendedTerminal
-
popTitle
public void popTitle()
Description copied from interface:ExtendedTerminalReplaces the terminal title with the top element from the title stack managed by the terminal (the element is removed from the stack as expected)- Specified by:
popTitlein interfaceExtendedTerminal- Specified by:
popTitlein interfaceIOSafeExtendedTerminal
-
iconify
public void iconify()
Description copied from interface:ExtendedTerminalIconifies the terminal, this likely means minimizing the window with most window managers- Specified by:
iconifyin interfaceExtendedTerminal- Specified by:
iconifyin interfaceIOSafeExtendedTerminal
-
deiconify
public void deiconify()
Description copied from interface:ExtendedTerminalDe-iconifies the terminal, which likely means restoring it from minimized state with most window managers- Specified by:
deiconifyin interfaceExtendedTerminal- Specified by:
deiconifyin interfaceIOSafeExtendedTerminal
-
maximize
public void maximize()
Description copied from interface:ExtendedTerminalMaximizes the terminal, so that it takes up all available space- Specified by:
maximizein interfaceExtendedTerminal- Specified by:
maximizein interfaceIOSafeExtendedTerminal
-
unmaximize
public void unmaximize()
Description copied from interface:ExtendedTerminalRestores the terminal back to its previous size, after having been maximized- Specified by:
unmaximizein interfaceExtendedTerminal- Specified by:
unmaximizein interfaceIOSafeExtendedTerminal
-
setMouseCaptureMode
public void setMouseCaptureMode(MouseCaptureMode mouseCaptureMode)
Description copied from interface:ExtendedTerminalEnabled or disables capturing of mouse event. This is not recommended to use as most users are not familiar with the fact that terminal emulators allow capturing mouse input. You can decide which events you want to capture but be careful since different terminal emulators will support these modes differently. Mouse capture mode will be automatically disabled when the application exits through a shutdown hook.- Specified by:
setMouseCaptureModein interfaceExtendedTerminal- Specified by:
setMouseCaptureModein interfaceIOSafeExtendedTerminal- Parameters:
mouseCaptureMode- Which mouse events to capture, pass innullto disable mouse input capturing
-
scrollLines
public void scrollLines(int firstLine, int lastLine, int distance)Description copied from interface:ScrollableScroll a range of lines of this Scrollable according to given distance. If scroll-range is empty (firstLine > lastLine || distance == 0) then this method does nothing. Lines that are scrolled away from are cleared. If absolute value of distance is equal or greater than number of lines in range, then all lines within the range will be cleared.- Specified by:
scrollLinesin interfaceIOSafeExtendedTerminal- Specified by:
scrollLinesin interfaceScrollable- Parameters:
firstLine- first line of the range to be scrolled (top line is 0)lastLine- last (inclusive) line of the range to be scrolleddistance- if > 0: move lines up, else if < 0: move lines down.
-
-