Package org.fusesource.jansi
Class WindowsAnsiOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.fusesource.jansi.AnsiOutputStream
-
- org.fusesource.jansi.WindowsAnsiOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public final class WindowsAnsiOutputStream extends AnsiOutputStream
Deprecated.useWindowsAnsiPrintStream
, which does not suffer from encoding issuesA Windows ANSI escape processor, that uses JNA to access native platform API's to change the console attributes.- Since:
- 1.0
- See Also:
WindowsAnsiPrintStream
-
-
Field Summary
Fields Modifier and Type Field Description private static short[]
ANSI_BACKGROUND_COLOR_MAP
Deprecated.private static short[]
ANSI_FOREGROUND_COLOR_MAP
Deprecated.private static short
BACKGROUND_BLACK
Deprecated.private static short
BACKGROUND_CYAN
Deprecated.private static short
BACKGROUND_MAGENTA
Deprecated.private static short
BACKGROUND_WHITE
Deprecated.private static short
BACKGROUND_YELLOW
Deprecated.private long
console
Deprecated.private static short
FOREGROUND_BLACK
Deprecated.private static short
FOREGROUND_CYAN
Deprecated.private static short
FOREGROUND_MAGENTA
Deprecated.private static short
FOREGROUND_WHITE
Deprecated.private static short
FOREGROUND_YELLOW
Deprecated.private org.fusesource.jansi.internal.Kernel32.CONSOLE_SCREEN_BUFFER_INFO
info
Deprecated.private boolean
negative
Deprecated.private short
originalColors
Deprecated.private short
savedX
Deprecated.private short
savedY
Deprecated.private static long
stderr_handle
Deprecated.private static long
stdout_handle
Deprecated.-
Fields inherited from class org.fusesource.jansi.AnsiOutputStream
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, RESET_CODE, REST_CODE, state, WHITE, YELLOW
-
-
Constructor Summary
Constructors Constructor Description WindowsAnsiOutputStream(java.io.OutputStream os)
Deprecated.WindowsAnsiOutputStream(java.io.OutputStream os, boolean stdout)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private void
applyAttribute()
Deprecated.private void
applyCursorPosition()
Deprecated.private void
getConsoleInfo()
Deprecated.private short
invertAttributeColors(short attributes)
Deprecated.protected void
processAttributeRest()
Deprecated.processSGR 0
corresponding toReset / Normal
protected void
processChangeWindowTitle(java.lang.String label)
Deprecated.processOSC 2;text BEL
corresponding toChange Window title
protected void
processCursorDown(int count)
Deprecated.processCSI n B
corresponding toCUD – Cursor Down
protected void
processCursorLeft(int count)
Deprecated.processCSI n D
corresponding toCUB – Cursor Back
protected void
processCursorRight(int count)
Deprecated.processCSI n C
corresponding toCUF – Cursor Forward
protected void
processCursorTo(int row, int col)
Deprecated.processCSI n ; m H
corresponding toCUP – Cursor Position
orCSI n ; m f
corresponding toHVP – Horizontal and Vertical Position
protected void
processCursorToColumn(int x)
Deprecated.processCSI n G
corresponding toCHA – Cursor Horizontal Absolute
protected void
processCursorUp(int count)
Deprecated.processCSI n A
corresponding toCUU – Cursor Up
protected void
processDefaultBackgroundColor()
Deprecated.processSGR 49
corresponding toDefault background color
protected void
processDefaultTextColor()
Deprecated.processSGR 39
corresponding toDefault text color (foreground)
protected void
processDeleteLine(int optionInt)
Deprecated.ProcessCSI M
ANSI code, corresponding toDL – Delete Line
protected void
processEraseLine(int eraseOption)
Deprecated.ProcessCSI n K
ANSI code, corresponding toED – Erase in Line
protected void
processEraseScreen(int eraseOption)
Deprecated.ProcessCSI n J
ANSI code, corresponding toED – Erase in Display
protected void
processInsertLine(int optionInt)
Deprecated.ProcessCSI L
ANSI code, corresponding toIL – Insert Line
protected void
processRestoreCursorPosition()
Deprecated.ProcessCSI u
ANSI code, corresponding toRCP – Restore Cursor Position
protected void
processSaveCursorPosition()
Deprecated.ProcessCSI s
ANSI code, corresponding toSCP – Save Cursor Position
protected void
processSetAttribute(int attribute)
Deprecated.processSGR
other than0
(reset),30-39
(foreground),40-49
(background),90-97
(foreground high intensity) or100-107
(background high intensity)protected void
processSetBackgroundColor(int color, boolean bright)
Deprecated.processSGR 40-47
orSGR 100-107
corresponding toSet background color
either in normal mode or high intensity.protected void
processSetForegroundColor(int color, boolean bright)
Deprecated.processSGR 30-37
orSGR 90-97
corresponding toSet text color (foreground)
either in normal mode or high intensity.-
Methods inherited from class org.fusesource.jansi.AnsiOutputStream
close, processChangeIconName, processChangeIconNameAndWindowTitle, processCharsetSelect, processCursorDownLine, processCursorUpLine, processScrollDown, processScrollUp, processSetBackgroundColor, processSetBackgroundColorExt, processSetBackgroundColorExt, processSetForegroundColor, processSetForegroundColorExt, processSetForegroundColorExt, processUnknownExtension, processUnknownOperatingSystemCommand, write
-
-
-
-
Field Detail
-
stdout_handle
private static final long stdout_handle
Deprecated.
-
stderr_handle
private static final long stderr_handle
Deprecated.
-
console
private final long console
Deprecated.
-
FOREGROUND_BLACK
private static final short FOREGROUND_BLACK
Deprecated.- See Also:
- Constant Field Values
-
FOREGROUND_YELLOW
private static final short FOREGROUND_YELLOW
Deprecated.
-
FOREGROUND_MAGENTA
private static final short FOREGROUND_MAGENTA
Deprecated.
-
FOREGROUND_CYAN
private static final short FOREGROUND_CYAN
Deprecated.
-
FOREGROUND_WHITE
private static final short FOREGROUND_WHITE
Deprecated.
-
BACKGROUND_BLACK
private static final short BACKGROUND_BLACK
Deprecated.- See Also:
- Constant Field Values
-
BACKGROUND_YELLOW
private static final short BACKGROUND_YELLOW
Deprecated.
-
BACKGROUND_MAGENTA
private static final short BACKGROUND_MAGENTA
Deprecated.
-
BACKGROUND_CYAN
private static final short BACKGROUND_CYAN
Deprecated.
-
BACKGROUND_WHITE
private static final short BACKGROUND_WHITE
Deprecated.
-
ANSI_FOREGROUND_COLOR_MAP
private static final short[] ANSI_FOREGROUND_COLOR_MAP
Deprecated.
-
ANSI_BACKGROUND_COLOR_MAP
private static final short[] ANSI_BACKGROUND_COLOR_MAP
Deprecated.
-
info
private final org.fusesource.jansi.internal.Kernel32.CONSOLE_SCREEN_BUFFER_INFO info
Deprecated.
-
originalColors
private final short originalColors
Deprecated.
-
negative
private boolean negative
Deprecated.
-
savedX
private short savedX
Deprecated.
-
savedY
private short savedY
Deprecated.
-
-
Constructor Detail
-
WindowsAnsiOutputStream
public WindowsAnsiOutputStream(java.io.OutputStream os, boolean stdout) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
WindowsAnsiOutputStream
public WindowsAnsiOutputStream(java.io.OutputStream os) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
-
Method Detail
-
getConsoleInfo
private void getConsoleInfo() throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
applyAttribute
private void applyAttribute() throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
invertAttributeColors
private short invertAttributeColors(short attributes)
Deprecated.
-
applyCursorPosition
private void applyCursorPosition() throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
processEraseScreen
protected void processEraseScreen(int eraseOption) throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
ProcessCSI n J
ANSI code, corresponding toED – Erase in Display
- Overrides:
processEraseScreen
in classAnsiOutputStream
- Parameters:
eraseOption
- eraseOption- Throws:
java.io.IOException
- IOException
-
processEraseLine
protected void processEraseLine(int eraseOption) throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
ProcessCSI n K
ANSI code, corresponding toED – Erase in Line
- Overrides:
processEraseLine
in classAnsiOutputStream
- Parameters:
eraseOption
- eraseOption- Throws:
java.io.IOException
- IOException
-
processCursorLeft
protected void processCursorLeft(int count) throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
processCSI n D
corresponding toCUB – Cursor Back
- Overrides:
processCursorLeft
in classAnsiOutputStream
- Parameters:
count
- numer of characters to move left- Throws:
java.io.IOException
- IOException
-
processCursorRight
protected void processCursorRight(int count) throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
processCSI n C
corresponding toCUF – Cursor Forward
- Overrides:
processCursorRight
in classAnsiOutputStream
- Parameters:
count
- number of characters to move on- Throws:
java.io.IOException
- IOException
-
processCursorDown
protected void processCursorDown(int count) throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
processCSI n B
corresponding toCUD – Cursor Down
- Overrides:
processCursorDown
in classAnsiOutputStream
- Parameters:
count
- numer of line- Throws:
java.io.IOException
- IOException
-
processCursorUp
protected void processCursorUp(int count) throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
processCSI n A
corresponding toCUU – Cursor Up
- Overrides:
processCursorUp
in classAnsiOutputStream
- Parameters:
count
- number of lines- Throws:
java.io.IOException
- IOException
-
processCursorTo
protected void processCursorTo(int row, int col) throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
processCSI n ; m H
corresponding toCUP – Cursor Position
orCSI n ; m f
corresponding toHVP – Horizontal and Vertical Position
- Overrides:
processCursorTo
in classAnsiOutputStream
- Parameters:
row
- rowcol
- column- Throws:
java.io.IOException
- IOException
-
processCursorToColumn
protected void processCursorToColumn(int x) throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
processCSI n G
corresponding toCHA – Cursor Horizontal Absolute
- Overrides:
processCursorToColumn
in classAnsiOutputStream
- Parameters:
x
- the column- Throws:
java.io.IOException
- IOException
-
processSetForegroundColor
protected void processSetForegroundColor(int color, boolean bright) throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
processSGR 30-37
orSGR 90-97
corresponding toSet text color (foreground)
either in normal mode or high intensity.- Overrides:
processSetForegroundColor
in classAnsiOutputStream
- Parameters:
color
- the text colorbright
- is high intensity?- Throws:
java.io.IOException
- IOException
-
processSetBackgroundColor
protected void processSetBackgroundColor(int color, boolean bright) throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
processSGR 40-47
orSGR 100-107
corresponding toSet background color
either in normal mode or high intensity.- Overrides:
processSetBackgroundColor
in classAnsiOutputStream
- Parameters:
color
- the background colorbright
- is high intensity?- Throws:
java.io.IOException
- IOException
-
processDefaultTextColor
protected void processDefaultTextColor() throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
processSGR 39
corresponding toDefault text color (foreground)
- Overrides:
processDefaultTextColor
in classAnsiOutputStream
- Throws:
java.io.IOException
- IOException
-
processDefaultBackgroundColor
protected void processDefaultBackgroundColor() throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
processSGR 49
corresponding toDefault background color
- Overrides:
processDefaultBackgroundColor
in classAnsiOutputStream
- Throws:
java.io.IOException
- IOException
-
processAttributeRest
protected void processAttributeRest() throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
processSGR 0
corresponding toReset / Normal
- Overrides:
processAttributeRest
in classAnsiOutputStream
- Throws:
java.io.IOException
- IOException
-
processSetAttribute
protected void processSetAttribute(int attribute) throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
processSGR
other than0
(reset),30-39
(foreground),40-49
(background),90-97
(foreground high intensity) or100-107
(background high intensity)- Overrides:
processSetAttribute
in classAnsiOutputStream
- Parameters:
attribute
- attribute- Throws:
java.io.IOException
- IOException- See Also:
AnsiOutputStream.processAttributeRest()
,AnsiOutputStream.processSetForegroundColor(int)
,AnsiOutputStream.processSetForegroundColor(int, boolean)
,AnsiOutputStream.processSetForegroundColorExt(int)
,AnsiOutputStream.processSetForegroundColorExt(int, int, int)
,AnsiOutputStream.processDefaultTextColor()
,AnsiOutputStream.processDefaultBackgroundColor()
-
processSaveCursorPosition
protected void processSaveCursorPosition() throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
ProcessCSI s
ANSI code, corresponding toSCP – Save Cursor Position
- Overrides:
processSaveCursorPosition
in classAnsiOutputStream
- Throws:
java.io.IOException
- IOException
-
processRestoreCursorPosition
protected void processRestoreCursorPosition() throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
ProcessCSI u
ANSI code, corresponding toRCP – Restore Cursor Position
- Overrides:
processRestoreCursorPosition
in classAnsiOutputStream
- Throws:
java.io.IOException
- IOException
-
processInsertLine
protected void processInsertLine(int optionInt) throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
ProcessCSI L
ANSI code, corresponding toIL – Insert Line
- Overrides:
processInsertLine
in classAnsiOutputStream
- Parameters:
optionInt
- option- Throws:
java.io.IOException
- IOException
-
processDeleteLine
protected void processDeleteLine(int optionInt) throws java.io.IOException
Deprecated.Description copied from class:AnsiOutputStream
ProcessCSI M
ANSI code, corresponding toDL – Delete Line
- Overrides:
processDeleteLine
in classAnsiOutputStream
- Parameters:
optionInt
- option- Throws:
java.io.IOException
- IOException
-
processChangeWindowTitle
protected void processChangeWindowTitle(java.lang.String label)
Deprecated.Description copied from class:AnsiOutputStream
processOSC 2;text BEL
corresponding toChange Window title
- Overrides:
processChangeWindowTitle
in classAnsiOutputStream
- Parameters:
label
- window label
-
-