Class WinConsoleOutput
- java.lang.Object
-
- xyz.cofe.term.win.WinConsoleOutput
-
- All Implemented Interfaces:
AutoCloseable
public class WinConsoleOutput extends Object implements AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description WinConsoleOutput(com.sun.jna.platform.win32.WinNT.HANDLE outputHandle)WinConsoleOutput(com.sun.jna.platform.win32.WinNT.HANDLE outputHandle, boolean closeHandle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()voidbufferSize(int width, int height)voidclose()voidcursor(int x, int y)CharAttributesgetCharAttributes()Optional<CodePage>getCodePageOptional()CursorInfogetCursorInfo()com.sun.jna.platform.win32.WinNT.HANDLEgetHandle()LargestSizegetLargestSize()Retrieves the size of the largest possible console window, based on the current font and the size of the display.ScreenBufferInfogetScreenBufferInfo()ScreenBufferModegetScreenBufferMode()voidsetCharAttributes(CharAttributes attributes)voidsetCodePage(CodePage codePage)voidsetCursorInfo(CursorInfo cursorInfo)voidsetScreenBufferMode(ScreenBufferMode mode)voidwindowRect(int left, int top, int right, int bottom)intwrite(String text)
-
-
-
Method Detail
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getHandle
public com.sun.jna.platform.win32.WinNT.HANDLE getHandle()
-
getScreenBufferMode
public ScreenBufferMode getScreenBufferMode()
-
setScreenBufferMode
public void setScreenBufferMode(ScreenBufferMode mode)
-
setCodePage
public void setCodePage(CodePage codePage)
-
getCursorInfo
public CursorInfo getCursorInfo()
-
setCursorInfo
public void setCursorInfo(CursorInfo cursorInfo)
-
getScreenBufferInfo
public ScreenBufferInfo getScreenBufferInfo()
-
getCharAttributes
public CharAttributes getCharAttributes()
-
setCharAttributes
public void setCharAttributes(CharAttributes attributes)
-
write
public int write(String text)
-
cursor
public void cursor(int x, int y)
-
activate
public void activate()
-
getLargestSize
public LargestSize getLargestSize()
Retrieves the size of the largest possible console window, based on the current font and the size of the display.The function does not take into consideration the size of the console screen buffer, which means that the window size returned may be larger than the size of the console screen buffer. The GetConsoleScreenBufferInfo function can be used to determine the maximum size of the console window, given the current screen buffer size, the current font, and the display size.
Получает размер максимально возможного окна консоли на основе текущего шрифта и размера экрана.
Функция не учитывает размер экранного буфера консоли, а это означает, что возвращаемый размер окна может быть больше, чем размер экранного буфера консоли. Функцию GetConsoleScreenBufferInfo можно использовать для определения максимального размера окна консоли с учетом текущего размера экранного буфера, текущего шрифта и размера экрана.
- Returns:
- size
-
bufferSize
public void bufferSize(int width, int height)
-
windowRect
public void windowRect(int left, int top, int right, int bottom)
-
-