Package de.mhus.lib.core.console
Class VirtualConsole
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- java.io.PrintStream
-
- de.mhus.lib.core.console.Console
-
- de.mhus.lib.core.console.VirtualConsole
-
- All Implemented Interfaces:
IBase,Closeable,Flushable,Appendable,AutoCloseable
- Direct Known Subclasses:
JmxConsole
public class VirtualConsole extends Console
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classVirtualConsole.Props-
Nested classes/interfaces inherited from class de.mhus.lib.core.console.Console
Console.COLOR
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanechoprotected intheightprotected intwidth-
Fields inherited from class de.mhus.lib.core.console.Console
DEFAULT_HEIGHT, DEFAULT_WIDTH, history
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description VirtualConsole()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()protected voidfillInputBuffer(char c)Console.COLORgetBackgroundColor()intgetCursorX()intgetCursorY()Console.COLORgetForegroundColor()intgetHeight()PrintStreamgetInputWriter()StringgetMonoDisplayAsString()intgetWidth()booleanisBlink()booleanisBold()booleanisSupportBlink()booleanisSupportBold()booleanisSupportColor()booleanisSupportCursor()booleanisSupportSize()Return true if the console knows about the current size of the terminal.intread()Returns the next character from input stream of the console.ConsoleKeyreadKey()StringreadLine(LinkedList<String> history)StringreadPassword()voidreset()voidresize(int width, int height)voidsetBlink(boolean blink)voidsetBold(boolean bold)voidsetColor(Console.COLOR foreground, Console.COLOR background)voidsetCursor(int x, int y)protected voidwriteChar(char c)-
Methods inherited from class de.mhus.lib.core.console.Console
adaptTo, askQuestion, cr, create, createProgressBar, get, isAnsi, isInitialized, printLine, printLine, readLine, resetConsole, resetTerminal, set, setHeight, setWidth
-
Methods inherited from class java.io.PrintStream
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write
-
Methods inherited from class java.io.FilterOutputStream
write
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
VirtualConsole
public VirtualConsole() throws IOException- Throws:
IOException
-
-
Method Detail
-
reset
public void reset()
-
readLine
public String readLine(LinkedList<String> history)
-
read
public int read()
Description copied from class:ConsoleReturns the next character from input stream of the console. In some cases check for ALT key pressed and return character + 1000, see JLine ConsoleReader In case of error a value lesser 0 will be returned.
-
readKey
public ConsoleKey readKey()
-
readPassword
public String readPassword()
- Overrides:
readPasswordin classConsole
-
isSupportSize
public boolean isSupportSize()
Description copied from class:ConsoleReturn true if the console knows about the current size of the terminal.- Specified by:
isSupportSizein classConsole- Returns:
- True if support size
-
resize
public void resize(int width, int height)
-
isSupportCursor
public boolean isSupportCursor()
- Specified by:
isSupportCursorin classConsole
-
getCursorX
public int getCursorX()
- Specified by:
getCursorXin classConsole
-
getCursorY
public int getCursorY()
- Specified by:
getCursorYin classConsole
-
isSupportColor
public boolean isSupportColor()
- Specified by:
isSupportColorin classConsole
-
setColor
public void setColor(Console.COLOR foreground, Console.COLOR background)
-
getForegroundColor
public Console.COLOR getForegroundColor()
- Specified by:
getForegroundColorin classConsole
-
getBackgroundColor
public Console.COLOR getBackgroundColor()
- Specified by:
getBackgroundColorin classConsole
-
isSupportBlink
public boolean isSupportBlink()
- Specified by:
isSupportBlinkin classConsole
-
isSupportBold
public boolean isSupportBold()
- Specified by:
isSupportBoldin classConsole
-
getInputWriter
public PrintStream getInputWriter()
-
getMonoDisplayAsString
public String getMonoDisplayAsString()
-
fillInputBuffer
protected void fillInputBuffer(char c) throws IOException- Throws:
IOException
-
writeChar
protected void writeChar(char c)
-
-