Package xyz.cofe.term.common.nix
Class NixAbstractConsole
- java.lang.Object
-
- xyz.cofe.term.common.nix.NixAbstractConsole
-
- All Implemented Interfaces:
AutoCloseable,Console
- Direct Known Subclasses:
NixConsole
public abstract class NixAbstractConsole extends Object implements Console
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanclosed
-
Constructor Summary
Constructors Constructor Description NixAbstractConsole()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidclose(com.googlecode.lanterna.terminal.ExtendedTerminal terminal)PositiongetCursorPosition()Возвращает позицию курсораSizegetSize()Возвращает размер терминалаprotected voidinit(com.googlecode.lanterna.terminal.ExtendedTerminal terminal)protected abstract <R> RmouseHistory(Function<List<com.googlecode.lanterna.input.MouseAction>,R> history)protected abstract Optional<InputEvent>pollFromQueue()protected abstract voidputToQueue(InputEvent event)Optional<InputEvent>read()Чтение событие вводаprotected Optional<InputEvent>read(com.googlecode.lanterna.input.KeyStroke ks)Optional<InputEvent>readSync()Синхронное-блокируемое чтение данныхvoidsetBackground(Color color)Устанавливает цвет фонаvoidsetCursorPosition(int x, int y)Устанавливает позицию курсораvoidsetCursorPosition(Position position)Устанавливает позицию курсораvoidsetCursorVisible(boolean visible)Установить видимость курсораvoidsetForeground(Color color)Устанавливает цвет текстаvoidsetSize(Size size)Устанавливает размер терминалаvoidsetTitle(String title)Устанавливает заголовокprotected voidterminal(Consumer<com.googlecode.lanterna.terminal.ExtendedTerminal> term)protected abstract <R> Rterminal(Function<com.googlecode.lanterna.terminal.ExtendedTerminal,R> term)voidwrite(String text)Запись текста в позицию курсора-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.AutoCloseable
close
-
-
-
-
Method Detail
-
terminal
protected void terminal(Consumer<com.googlecode.lanterna.terminal.ExtendedTerminal> term)
-
terminal
protected abstract <R> R terminal(Function<com.googlecode.lanterna.terminal.ExtendedTerminal,R> term)
-
init
protected void init(com.googlecode.lanterna.terminal.ExtendedTerminal terminal)
-
close
protected void close(com.googlecode.lanterna.terminal.ExtendedTerminal terminal)
-
putToQueue
protected abstract void putToQueue(InputEvent event)
-
pollFromQueue
protected abstract Optional<InputEvent> pollFromQueue()
-
setTitle
public void setTitle(String title)
Description copied from interface:ConsoleУстанавливает заголовок
-
getCursorPosition
public Position getCursorPosition()
Description copied from interface:ConsoleВозвращает позицию курсора- Specified by:
getCursorPositionin interfaceConsole- Returns:
- позиция курсора
-
setCursorPosition
public void setCursorPosition(Position position)
Description copied from interface:ConsoleУстанавливает позицию курсора- Specified by:
setCursorPositionin interfaceConsole- Parameters:
position- позиция курсора
-
setCursorPosition
public void setCursorPosition(int x, int y)Description copied from interface:ConsoleУстанавливает позицию курсора- Specified by:
setCursorPositionin interfaceConsole- Parameters:
x- координатыy- координаты
-
getSize
public Size getSize()
Description copied from interface:ConsoleВозвращает размер терминала
-
setSize
public void setSize(Size size)
Description copied from interface:ConsoleУстанавливает размер терминала
-
setForeground
public void setForeground(Color color)
Description copied from interface:ConsoleУстанавливает цвет текста- Specified by:
setForegroundin interfaceConsole- Parameters:
color- цвет
-
setBackground
public void setBackground(Color color)
Description copied from interface:ConsoleУстанавливает цвет фона- Specified by:
setBackgroundin interfaceConsole- Parameters:
color- цвет
-
setCursorVisible
public void setCursorVisible(boolean visible)
Description copied from interface:ConsoleУстановить видимость курсора- Specified by:
setCursorVisiblein interfaceConsole- Parameters:
visible- true - курсор видим
-
write
public void write(String text)
Description copied from interface:ConsoleЗапись текста в позицию курсора
-
mouseHistory
protected abstract <R> R mouseHistory(Function<List<com.googlecode.lanterna.input.MouseAction>,R> history)
-
read
public Optional<InputEvent> read()
Description copied from interface:ConsoleЧтение событие ввода
-
readSync
public Optional<InputEvent> readSync()
Синхронное-блокируемое чтение данных- Returns:
- прочитанное значение
-
read
protected Optional<InputEvent> read(com.googlecode.lanterna.input.KeyStroke ks)
-
-