Package org.fusesource.jansi.io
Class WindowsAnsiProcessor
- java.lang.Object
-
- org.fusesource.jansi.io.AnsiProcessor
-
- org.fusesource.jansi.io.WindowsAnsiProcessor
-
public final class WindowsAnsiProcessor extends AnsiProcessor
A Windows ANSI escape processor, that uses JNA to access native platform API's to change the console attributes (see Jansi native Kernel32).The native library used is named
jansiand is loaded using HawtJNI RuntimeLibrary- Since:
- 1.19
-
-
Field Summary
-
Fields inherited from class org.fusesource.jansi.io.AnsiProcessor
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_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, os, RED, WHITE, YELLOW
-
-
Constructor Summary
Constructors Constructor Description WindowsAnsiProcessor(java.io.OutputStream ps)WindowsAnsiProcessor(java.io.OutputStream ps, boolean stdout)WindowsAnsiProcessor(java.io.OutputStream ps, long console)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidprocessAttributeReset()processSGR 0corresponding toReset / Normalprotected voidprocessChangeWindowTitle(java.lang.String label)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 MANSI 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 LANSI 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 voidprocessSetBackgroundColor(int color, boolean bright)processSGR 40-47orSGR 100-107corresponding toSet background coloreither in normal mode or high intensity.protected voidprocessSetBackgroundColorExt(int paletteIndex)processSGR 48corresponding toextended set background colorwith a palette of 255 colors.protected voidprocessSetBackgroundColorExt(int r, int g, int b)processSGR 48corresponding toextended set background colorwith a 24 bits RGB definition of the color.protected voidprocessSetForegroundColor(int color, boolean bright)processSGR 30-37orSGR 90-97corresponding toSet text color (foreground)either in normal mode or high intensity.protected voidprocessSetForegroundColorExt(int paletteIndex)processSGR 38corresponding toextended set text color (foreground)with a palette of 255 colors.protected voidprocessSetForegroundColorExt(int r, int g, int b)processSGR 38corresponding toextended set text color (foreground)with a 24 bits RGB definition of the color.-
Methods inherited from class org.fusesource.jansi.io.AnsiProcessor
getNextOptionInt, processChangeIconName, processChangeIconNameAndWindowTitle, processCharsetSelect, processCharsetSelect, processEscapeCommand, processOperatingSystemCommand, processScrollDown, processScrollUp, processSetBackgroundColor, processSetForegroundColor, processUnknownExtension, processUnknownOperatingSystemCommand
-
-
-
-
Constructor Detail
-
WindowsAnsiProcessor
public WindowsAnsiProcessor(java.io.OutputStream ps, long console) throws java.io.IOException- Throws:
java.io.IOException
-
WindowsAnsiProcessor
public WindowsAnsiProcessor(java.io.OutputStream ps, boolean stdout) throws java.io.IOException- Throws:
java.io.IOException
-
WindowsAnsiProcessor
public WindowsAnsiProcessor(java.io.OutputStream ps) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
processEraseScreen
protected void processEraseScreen(int eraseOption) throws java.io.IOExceptionDescription copied from class:AnsiProcessorProcessCSI n JANSI code, corresponding toED – Erase in Display- Overrides:
processEraseScreenin classAnsiProcessor- Parameters:
eraseOption- eraseOption- Throws:
java.io.IOException- IOException
-
processEraseLine
protected void processEraseLine(int eraseOption) throws java.io.IOExceptionDescription copied from class:AnsiProcessorProcessCSI n KANSI code, corresponding toED – Erase in Line- Overrides:
processEraseLinein classAnsiProcessor- Parameters:
eraseOption- eraseOption- Throws:
java.io.IOException- IOException
-
processCursorLeft
protected void processCursorLeft(int count) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessCSI n Dcorresponding toCUB – Cursor Back- Overrides:
processCursorLeftin classAnsiProcessor- Parameters:
count- count- Throws:
java.io.IOException- IOException
-
processCursorRight
protected void processCursorRight(int count) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessCSI n Ccorresponding toCUF – Cursor Forward- Overrides:
processCursorRightin classAnsiProcessor- Parameters:
count- count- Throws:
java.io.IOException- IOException
-
processCursorDown
protected void processCursorDown(int count) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessCSI n Bcorresponding toCUD – Cursor Down- Overrides:
processCursorDownin classAnsiProcessor- Parameters:
count- count- Throws:
java.io.IOException- IOException
-
processCursorUp
protected void processCursorUp(int count) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessCSI n Acorresponding toCUU – Cursor Up- Overrides:
processCursorUpin classAnsiProcessor- Parameters:
count- count- Throws:
java.io.IOException- IOException
-
processCursorTo
protected void processCursorTo(int row, int col) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessCSI n ; m Hcorresponding toCUP – Cursor PositionorCSI n ; m fcorresponding toHVP – Horizontal and Vertical Position- Overrides:
processCursorToin classAnsiProcessor- Parameters:
row- rowcol- col- Throws:
java.io.IOException- IOException
-
processCursorToColumn
protected void processCursorToColumn(int x) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessCSI n Gcorresponding toCHA – Cursor Horizontal Absolute- Overrides:
processCursorToColumnin classAnsiProcessor- Parameters:
x- the column- Throws:
java.io.IOException- IOException
-
processCursorUpLine
protected void processCursorUpLine(int count) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessCSI n Fcorresponding toCPL – Cursor Previous Line- Overrides:
processCursorUpLinein classAnsiProcessor- Parameters:
count- line count- Throws:
java.io.IOException- IOException
-
processCursorDownLine
protected void processCursorDownLine(int count) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessCSI n Ecorresponding toCNL – Cursor Next Line- Overrides:
processCursorDownLinein classAnsiProcessor- Parameters:
count- line count- Throws:
java.io.IOException- IOException
-
processSetForegroundColor
protected void processSetForegroundColor(int color, boolean bright) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessSGR 30-37orSGR 90-97corresponding toSet text color (foreground)either in normal mode or high intensity.- Overrides:
processSetForegroundColorin classAnsiProcessor- Parameters:
color- the text colorbright- is high intensity?- Throws:
java.io.IOException- IOException
-
processSetForegroundColorExt
protected void processSetForegroundColorExt(int paletteIndex) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessSGR 38corresponding toextended set text color (foreground)with a palette of 255 colors.- Overrides:
processSetForegroundColorExtin classAnsiProcessor- Parameters:
paletteIndex- the text color in the palette- Throws:
java.io.IOException- IOException
-
processSetForegroundColorExt
protected void processSetForegroundColorExt(int r, int g, int b) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessSGR 38corresponding toextended set text color (foreground)with a 24 bits RGB definition of the color.- Overrides:
processSetForegroundColorExtin classAnsiProcessor- Parameters:
r- redg- greenb- blue- Throws:
java.io.IOException- IOException
-
processSetBackgroundColor
protected void processSetBackgroundColor(int color, boolean bright) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessSGR 40-47orSGR 100-107corresponding toSet background coloreither in normal mode or high intensity.- Overrides:
processSetBackgroundColorin classAnsiProcessor- Parameters:
color- the background colorbright- is high intensity?- Throws:
java.io.IOException- IOException
-
processSetBackgroundColorExt
protected void processSetBackgroundColorExt(int paletteIndex) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessSGR 48corresponding toextended set background colorwith a palette of 255 colors.- Overrides:
processSetBackgroundColorExtin classAnsiProcessor- Parameters:
paletteIndex- the background color in the palette- Throws:
java.io.IOException- IOException
-
processSetBackgroundColorExt
protected void processSetBackgroundColorExt(int r, int g, int b) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessSGR 48corresponding toextended set background colorwith a 24 bits RGB definition of the color.- Overrides:
processSetBackgroundColorExtin classAnsiProcessor- Parameters:
r- redg- greenb- blue- Throws:
java.io.IOException- IOException
-
processDefaultTextColor
protected void processDefaultTextColor() throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessSGR 39corresponding toDefault text color (foreground)- Overrides:
processDefaultTextColorin classAnsiProcessor- Throws:
java.io.IOException- IOException
-
processDefaultBackgroundColor
protected void processDefaultBackgroundColor() throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessSGR 49corresponding toDefault background color- Overrides:
processDefaultBackgroundColorin classAnsiProcessor- Throws:
java.io.IOException- IOException
-
processAttributeReset
protected void processAttributeReset() throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessSGR 0corresponding toReset / Normal- Overrides:
processAttributeResetin classAnsiProcessor- Throws:
java.io.IOException- IOException
-
processSetAttribute
protected void processSetAttribute(int attribute) throws java.io.IOExceptionDescription copied from class:AnsiProcessorprocessSGRother than0(reset),30-39(foreground),40-49(background),90-97(foreground high intensity) or100-107(background high intensity)- Overrides:
processSetAttributein classAnsiProcessor- Parameters:
attribute- attribute- Throws:
java.io.IOException- IOException- See Also:
AnsiProcessor.processAttributeReset(),AnsiProcessor.processSetForegroundColor(int),AnsiProcessor.processSetForegroundColor(int, boolean),AnsiProcessor.processSetForegroundColorExt(int),AnsiProcessor.processSetForegroundColorExt(int, int, int),AnsiProcessor.processDefaultTextColor(),AnsiProcessor.processDefaultBackgroundColor()
-
processSaveCursorPosition
protected void processSaveCursorPosition() throws java.io.IOExceptionDescription copied from class:AnsiProcessorProcessCSI sANSI code, corresponding toSCP – Save Cursor Position- Overrides:
processSaveCursorPositionin classAnsiProcessor- Throws:
java.io.IOException- IOException
-
processRestoreCursorPosition
protected void processRestoreCursorPosition() throws java.io.IOExceptionDescription copied from class:AnsiProcessorProcessCSI uANSI code, corresponding toRCP – Restore Cursor Position- Overrides:
processRestoreCursorPositionin classAnsiProcessor- Throws:
java.io.IOException- IOException
-
processInsertLine
protected void processInsertLine(int optionInt) throws java.io.IOExceptionDescription copied from class:AnsiProcessorProcessCSI LANSI code, corresponding toIL – Insert Line- Overrides:
processInsertLinein classAnsiProcessor- Parameters:
optionInt- option- Throws:
java.io.IOException- IOException
-
processDeleteLine
protected void processDeleteLine(int optionInt) throws java.io.IOExceptionDescription copied from class:AnsiProcessorProcessCSI MANSI code, corresponding toDL – Delete Line- Overrides:
processDeleteLinein classAnsiProcessor- Parameters:
optionInt- option- Throws:
java.io.IOException- IOException
-
processChangeWindowTitle
protected void processChangeWindowTitle(java.lang.String label)
Description copied from class:AnsiProcessorprocessOSC 2;text BELcorresponding toChange Window title- Overrides:
processChangeWindowTitlein classAnsiProcessor- Parameters:
label- window title text
-
-