Package org.fusesource.jansi.internal.Kernel32

Examples of org.fusesource.jansi.internal.Kernel32.COORD


public class WindowsTerminalWidthHeight {

  public static void main(String[] _) {

         long                       console_ = GetStdHandle(STD_OUTPUT_HANDLE);
         CONSOLE_SCREEN_BUFFER_INFO screen_  = new CONSOLE_SCREEN_BUFFER_INFO();

         if (GetConsoleScreenBufferInfo(console_, screen_) == 0 ) {

             System.out.println("something went the other way, maybe even the wrong way.");
             return;
View Full Code Here


  protected void processEraseScreen(int eraseOption) throws IOException {
    getConsoleInfo();
    int[] written = new int[1];
    switch(eraseOption) {
    case ERASE_SCREEN:
      COORD topLeft = new COORD();
      topLeft.x = 0;
      topLeft.y = info.window.top;
      int screenLength = info.window.height() * info.size.x;
      FillConsoleOutputCharacterW(console, ' ', screenLength, topLeft, written);
      break;
    case ERASE_SCREEN_TO_BEGINING:
      COORD topLeft2 = new COORD();
      topLeft2.x = 0;
      topLeft2.y = info.window.top;
      int lengthToCursor = (info.cursorPosition.y - info.window.top) * info.size.x
        + info.cursorPosition.x;
      FillConsoleOutputCharacterW(console, ' ', lengthToCursor, topLeft2, written);
View Full Code Here

  protected void processEraseLine(int eraseOption) throws IOException {
    getConsoleInfo();
    int[] written = new int[1];
    switch(eraseOption) {
    case ERASE_LINE:
      COORD leftColCurrRow = info.cursorPosition.copy();
      leftColCurrRow.x = 0;
      FillConsoleOutputCharacterW(console, ' ', info.size.x, leftColCurrRow, written);
      break;
    case ERASE_LINE_TO_BEGINING:
      COORD leftColCurrRow2 = info.cursorPosition.copy();
      leftColCurrRow2.x = 0;
      FillConsoleOutputCharacterW(console, ' ', info.cursorPosition.x, leftColCurrRow2, written);
      break;
    case ERASE_LINE_TO_END:
      int lengthToLastCol = info.size.x - info.cursorPosition.x;
View Full Code Here

TOP

Related Classes of org.fusesource.jansi.internal.Kernel32.COORD

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.