예제 #1
0
 private final void printCharacters(final char c, final int num) throws IOException {
   if (num == 1) {
     printCharacter(c);
   } else {
     char[] chars = new char[num];
     Arrays.fill(chars, c);
     printCharacters(chars);
   }
 }
예제 #2
0
  /** Issue an audible keyboard bell, if {@link #getBellEnabled} return true. */
  public final void beep() throws IOException {
    if (!(getBellEnabled())) {
      return;
    }

    printCharacter(KEYBOARD_BELL);
    // need to flush so the console actually beeps
    flushConsole();
  }
예제 #3
0
  /** Output the specified character, both to the buffer and the output stream. */
  private final void putChar(final int c, final boolean print) throws IOException {
    buf.write((char) c);

    if (print) {
      // no masking...
      if (mask == null) {
        printCharacter(c);
      }
      // null mask: don't print anything...
      else if (mask.charValue() == 0) {;
      }
      // otherwise print the mask...
      else {
        printCharacter(mask.charValue());
      }

      drawBuffer();
    }
  }
예제 #4
0
 /** Clear the line and redraw it. */
 public final void redrawLine() throws IOException {
   printCharacter(RESET_LINE);
   flushConsole();
   drawLine();
 }