Ejemplo n.º 1
0
  private void doWriteString(String string) {
    myTerminalTextBuffer.lock();
    try {
      wrapLines();
      scrollY();

      myTerminalTextBuffer.writeString(myCursorX, myCursorY, string);
      myCursorX += string.length();
      finishText();
    } finally {
      myTerminalTextBuffer.unlock();
    }
  }
Ejemplo n.º 2
0
  @Override
  public void fillScreen(final char c) {
    myTerminalTextBuffer.lock();
    try {
      final char[] chars = new char[myTerminalWidth];
      Arrays.fill(chars, c);
      final String str = new String(chars);

      for (int row = 1; row <= myTerminalHeight; row++) {
        myTerminalTextBuffer.writeString(0, row, str);
      }
    } finally {
      myTerminalTextBuffer.unlock();
    }
  }