- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- org.jline.utils.AnsiWriter
-
- org.jline.terminal.impl.jansi.win.WindowsAnsiWriter
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public final class WindowsAnsiWriter extends AnsiWriter
A Windows ANSI escape processor, that uses JNA to access native platform API's to change the console attributes.- Since:
- 1.0
- Author:
- Hiram Chirino, Joris Kuipers
-
-
Field Summary
-
Fields inherited from class org.jline.utils.AnsiWriter
ATTRIBUTE_BLINK_FAST, ATTRIBUTE_BLINK_OFF, ATTRIBUTE_BLINK_SLOW, ATTRIBUTE_CONCEAL_OFF, ATTRIBUTE_CONCEAL_ON, ATTRIBUTE_INTENSITY_BOLD, ATTRIBUTE_INTENSITY_FAINT, ATTRIBUTE_INTENSITY_NORMAL, ATTRIBUTE_ITALIC, ATTRIBUTE_NEGATIVE_Off, ATTRIBUTE_NEGATIVE_OFF, ATTRIBUTE_NEGATIVE_ON, ATTRIBUTE_UNDERLINE, ATTRIBUTE_UNDERLINE_DOUBLE, ATTRIBUTE_UNDERLINE_OFF, BLACK, BLUE, CYAN, ERASE_LINE, ERASE_LINE_TO_BEGINING, ERASE_LINE_TO_END, ERASE_SCREEN, ERASE_SCREEN_TO_BEGINING, ERASE_SCREEN_TO_END, GREEN, MAGENTA, RED, WHITE, YELLOW
-
Fields inherited from class java.io.FilterWriter
out
-
-
Constructor Summary
Constructors Constructor Description WindowsAnsiWriter(Writer out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidprocessAttributeRest()processSGR 0corresponding toReset / Normalprotected voidprocessChangeWindowTitle(String title)processOSC 2;text BELcorresponding toChange Window titleprotected voidprocessCursorDown(int count)processCSI n Bcorresponding toCUD – Cursor Downprotected voidprocessCursorDownLine(int count)processCSI n Ecorresponding toCNL – Cursor Next Lineprotected voidprocessCursorLeft(int count)processCSI n Dcorresponding toCUB – Cursor Backprotected voidprocessCursorRight(int count)processCSI n Ccorresponding toCUF – Cursor Forwardprotected voidprocessCursorTo(int row, int col)processCSI n ; m Hcorresponding toCUP – Cursor PositionorCSI n ; m fcorresponding toHVP – Horizontal and Vertical Positionprotected voidprocessCursorToColumn(int x)processCSI n Gcorresponding toCHA – Cursor Horizontal Absoluteprotected voidprocessCursorUp(int count)processCSI n Acorresponding toCUU – Cursor Upprotected voidprocessCursorUpLine(int count)processCSI n Fcorresponding toCPL – Cursor Previous Lineprotected voidprocessDefaultBackgroundColor()processSGR 49corresponding toDefault background colorprotected voidprocessDefaultTextColor()processSGR 39corresponding toDefault text color (foreground)protected voidprocessDeleteLine(int optionInt)ProcessCSI sANSI code, corresponding toDL – Delete Lineprotected voidprocessEraseLine(int eraseOption)ProcessCSI n KANSI code, corresponding toED – Erase in Lineprotected voidprocessEraseScreen(int eraseOption)ProcessCSI n JANSI code, corresponding toED – Erase in Displayprotected voidprocessInsertLine(int optionInt)ProcessCSI sANSI code, corresponding toIL – Insert Lineprotected voidprocessRestoreCursorPosition()ProcessCSI uANSI code, corresponding toRCP – Restore Cursor Positionprotected voidprocessSaveCursorPosition()ProcessCSI sANSI code, corresponding toSCP – Save Cursor Positionprotected voidprocessSetAttribute(int attribute)processSGRother than0(reset),30-39(foreground),40-49(background),90-97(foreground high intensity) or100-107(background high intensity)protected voidprocessSetBackgroundColorExt(int paletteIndex)processSGR 48corresponding toextended set background colorwith a palette of 255 colors.protected voidprocessSetForegroundColorExt(int paletteIndex)processSGR 38corresponding toextended set text color (foreground)with a palette of 255 colors.-
Methods inherited from class org.jline.utils.AnsiWriter
close, processChangeIconName, processChangeIconNameAndWindowTitle, processCharsetSelect, processScrollDown, processScrollUp, processSetBackgroundColor, processSetBackgroundColor, processSetBackgroundColorExt, processSetForegroundColor, processSetForegroundColor, processSetForegroundColorExt, processUnknownExtension, processUnknownOperatingSystemCommand, write, write, write
-
Methods inherited from class java.io.FilterWriter
flush
-
-
-
-
Constructor Detail
-
WindowsAnsiWriter
public WindowsAnsiWriter(Writer out) throws IOException
- Throws:
IOException
-
-
Method Detail
-
processEraseScreen
protected void processEraseScreen(int eraseOption) throws IOExceptionDescription copied from class:AnsiWriterProcessCSI n JANSI code, corresponding toED – Erase in Display- Overrides:
processEraseScreenin classAnsiWriter- Parameters:
eraseOption- the erase option- Throws:
IOException- if an error occurs
-
processEraseLine
protected void processEraseLine(int eraseOption) throws IOExceptionDescription copied from class:AnsiWriterProcessCSI n KANSI code, corresponding toED – Erase in Line- Overrides:
processEraseLinein classAnsiWriter- Parameters:
eraseOption- the erase option- Throws:
IOException- if an error occurs
-
processCursorUpLine
protected void processCursorUpLine(int count) throws IOExceptionDescription copied from class:AnsiWriterprocessCSI n Fcorresponding toCPL – Cursor Previous Line- Overrides:
processCursorUpLinein classAnsiWriter- Parameters:
count- line count- Throws:
IOException- if an error occurs
-
processCursorDownLine
protected void processCursorDownLine(int count) throws IOExceptionDescription copied from class:AnsiWriterprocessCSI n Ecorresponding toCNL – Cursor Next Line- Overrides:
processCursorDownLinein classAnsiWriter- Parameters:
count- line count- Throws:
IOException- if an error occurs
-
processCursorLeft
protected void processCursorLeft(int count) throws IOExceptionDescription copied from class:AnsiWriterprocessCSI n Dcorresponding toCUB – Cursor Back- Overrides:
processCursorLeftin classAnsiWriter- Parameters:
count- the count- Throws:
IOException- if an error occurs
-
processCursorRight
protected void processCursorRight(int count) throws IOExceptionDescription copied from class:AnsiWriterprocessCSI n Ccorresponding toCUF – Cursor Forward- Overrides:
processCursorRightin classAnsiWriter- Parameters:
count- the count- Throws:
IOException- if an error occurs
-
processCursorDown
protected void processCursorDown(int count) throws IOExceptionDescription copied from class:AnsiWriterprocessCSI n Bcorresponding toCUD – Cursor Down- Overrides:
processCursorDownin classAnsiWriter- Parameters:
count- the count- Throws:
IOException- if an error occurs
-
processCursorUp
protected void processCursorUp(int count) throws IOExceptionDescription copied from class:AnsiWriterprocessCSI n Acorresponding toCUU – Cursor Up- Overrides:
processCursorUpin classAnsiWriter- Parameters:
count- the count- Throws:
IOException- if an error occurs
-
processCursorTo
protected void processCursorTo(int row, int col) throws IOExceptionDescription copied from class:AnsiWriterprocessCSI n ; m Hcorresponding toCUP – Cursor PositionorCSI n ; m fcorresponding toHVP – Horizontal and Vertical Position- Overrides:
processCursorToin classAnsiWriter- Parameters:
row- the rowcol- the column- Throws:
IOException- if an error occurs
-
processCursorToColumn
protected void processCursorToColumn(int x) throws IOExceptionDescription copied from class:AnsiWriterprocessCSI n Gcorresponding toCHA – Cursor Horizontal Absolute- Overrides:
processCursorToColumnin classAnsiWriter- Parameters:
x- the column- Throws:
IOException- if an error occurs
-
processSetForegroundColorExt
protected void processSetForegroundColorExt(int paletteIndex) throws IOExceptionDescription copied from class:AnsiWriterprocessSGR 38corresponding toextended set text color (foreground)with a palette of 255 colors.- Overrides:
processSetForegroundColorExtin classAnsiWriter- Parameters:
paletteIndex- the text color in the palette- Throws:
IOException- if an error occurs
-
processSetBackgroundColorExt
protected void processSetBackgroundColorExt(int paletteIndex) throws IOExceptionDescription copied from class:AnsiWriterprocessSGR 48corresponding toextended set background colorwith a palette of 255 colors.- Overrides:
processSetBackgroundColorExtin classAnsiWriter- Parameters:
paletteIndex- the background color in the palette- Throws:
IOException- if an error occurs
-
processDefaultTextColor
protected void processDefaultTextColor() throws IOExceptionDescription copied from class:AnsiWriterprocessSGR 39corresponding toDefault text color (foreground)- Overrides:
processDefaultTextColorin classAnsiWriter- Throws:
IOException- if an error occurs
-
processDefaultBackgroundColor
protected void processDefaultBackgroundColor() throws IOExceptionDescription copied from class:AnsiWriterprocessSGR 49corresponding toDefault background color- Overrides:
processDefaultBackgroundColorin classAnsiWriter- Throws:
IOException- if an error occurs
-
processAttributeRest
protected void processAttributeRest() throws IOExceptionDescription copied from class:AnsiWriterprocessSGR 0corresponding toReset / Normal- Overrides:
processAttributeRestin classAnsiWriter- Throws:
IOException- if an error occurs
-
processSetAttribute
protected void processSetAttribute(int attribute) throws IOExceptionDescription copied from class:AnsiWriterprocessSGRother than0(reset),30-39(foreground),40-49(background),90-97(foreground high intensity) or100-107(background high intensity)- Overrides:
processSetAttributein classAnsiWriter- Parameters:
attribute- the attribute to set- Throws:
IOException- if an error occurs- See Also:
AnsiWriter.processAttributeRest(),AnsiWriter.processSetForegroundColor(int),AnsiWriter.processSetForegroundColor(int, boolean),AnsiWriter.processSetForegroundColorExt(int),AnsiWriter.processSetForegroundColorExt(int, int, int),AnsiWriter.processDefaultTextColor(),AnsiWriter.processDefaultBackgroundColor()
-
processSaveCursorPosition
protected void processSaveCursorPosition() throws IOExceptionDescription copied from class:AnsiWriterProcessCSI sANSI code, corresponding toSCP – Save Cursor Position- Overrides:
processSaveCursorPositionin classAnsiWriter- Throws:
IOException- if an error occurs
-
processRestoreCursorPosition
protected void processRestoreCursorPosition() throws IOExceptionDescription copied from class:AnsiWriterProcessCSI uANSI code, corresponding toRCP – Restore Cursor Position- Overrides:
processRestoreCursorPositionin classAnsiWriter- Throws:
IOException- if an error occurs
-
processInsertLine
protected void processInsertLine(int optionInt) throws IOExceptionDescription copied from class:AnsiWriterProcessCSI sANSI code, corresponding toIL – Insert Line- Overrides:
processInsertLinein classAnsiWriter- Parameters:
optionInt- the option- Throws:
IOException- if an error occurs
-
processDeleteLine
protected void processDeleteLine(int optionInt) throws IOExceptionDescription copied from class:AnsiWriterProcessCSI sANSI code, corresponding toDL – Delete Line- Overrides:
processDeleteLinein classAnsiWriter- Parameters:
optionInt- the option- Throws:
IOException- if an error occurs
-
processChangeWindowTitle
protected void processChangeWindowTitle(String title)
Description copied from class:AnsiWriterprocessOSC 2;text BELcorresponding toChange Window title- Overrides:
processChangeWindowTitlein classAnsiWriter- Parameters:
title- the title
-
-