Beispiel #1
0
  /** {@inheritDoc} */
  public int setCursor(int x, int y) {
    try {
      terminalIO.setCursor(y, x);
      cursorOffset = getOffset(x, y);
    } catch (IOException e) {
      e.printStackTrace();
    }

    return cursorOffset;
  }
Beispiel #2
0
  /** {@inheritDoc} */
  public void sync(int offset, int length) {
    try {
      final int y = offset / getWidth();
      final int x = offset % getWidth();
      terminalIO.setCursor(y, x);

      final TelnetIO telnetIO = terminalIO.getTelnetIO();

      int offs = offset;
      for (int i = 0; i < length; i++) {
        telnetIO.write(buffer[offs++]);
      }
      if (terminalIO.isAutoflushing()) {
        terminalIO.flush();
      }
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }