Beispiel #1
0
  public void resize(int width, int height) {
    defaultScreen.resize(width, height);
    alternateScreen.resize(width, height);
    history.resize(width, history.getHeight());

    if (cursorX >= width) cursorX = width - 1;
    if (cursorY >= height) cursorY = height - 1;
  }
Beispiel #2
0
 public void setScreen(boolean alternate) {
   int scrollTop = screen.getScrollTop();
   int scrollBottom = screen.getScrollBottom();
   if (alternate) {
     screen = alternateScreen;
   } else {
     screen = defaultScreen;
   }
   screen.setScrollRegion(scrollTop, scrollBottom);
 }
Beispiel #3
0
 public void tab() {
   cursorX = (cursorX + 8) & (~7);
   if (cursorX >= screen.getWidth()) {
     if ((mode & VTMODE_WRAPOFF) != 0) {
       cursorX = screen.getWidth() - 1;
     } else {
       cursorX = 0;
       lineFeed();
     }
   }
 }
Beispiel #4
0
 public void lineFeed() {
   if (cursorY != screen.getScrollBottom()) {
     cursorY++;
   } else {
     scroll(1);
   }
 }
Beispiel #5
0
  public void scroll(int amount) {
    if (screen.getScrollTop() == 0 && screen == defaultScreen && amount > 0) {
      while (amount > 0) {
        int[] line, copy;
        history.scroll(1, false, 0);
        copy = history.getLine(0);

        line = screen.getLine(0);
        for (int j = 0; j < line.length; j++) copy[j] = line[j];

        screen.scroll(1, true, attributes);
        amount--;
      }
    } else {
      screen.scroll(amount, true, attributes);
    }
  }
Beispiel #6
0
 public int dataAt(int column, int row) {
   int[] line = screen.getLine(row);
   return line[column];
 }