Java Code Examples for com.googlecode.lanterna.graphics.TextGraphics#fill()

The following examples show how to use com.googlecode.lanterna.graphics.TextGraphics#fill() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VirtualScreen.java    From lanterna with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void drawFrame(
        TextGraphics graphics,
        TerminalSize realSize,
        TerminalSize virtualSize,
        TerminalPosition virtualScrollPosition) {

    if(realSize.getColumns() == 1 || realSize.getRows() <= 2) {
        return;
    }
    TerminalSize viewportSize = getViewportSize(realSize, virtualSize);

    graphics.setForegroundColor(TextColor.ANSI.WHITE);
    graphics.setBackgroundColor(TextColor.ANSI.BLACK);
    graphics.fill(' ');
    graphics.putString(0, graphics.getSize().getRows() - 1, "Terminal too small, use ALT+arrows to scroll");

    int horizontalSize = (int)(((double)(viewportSize.getColumns()) / (double)virtualSize.getColumns()) * (viewportSize.getColumns()));
    int scrollable = viewportSize.getColumns() - horizontalSize - 1;
    int horizontalPosition = (int)((double)scrollable * ((double)virtualScrollPosition.getColumn() / (double)(virtualSize.getColumns() - viewportSize.getColumns())));
    graphics.drawLine(
            new TerminalPosition(horizontalPosition, graphics.getSize().getRows() - 2),
            new TerminalPosition(horizontalPosition + horizontalSize, graphics.getSize().getRows() - 2),
            Symbols.BLOCK_MIDDLE);

    int verticalSize = (int)(((double)(viewportSize.getRows()) / (double)virtualSize.getRows()) * (viewportSize.getRows()));
    scrollable = viewportSize.getRows() - verticalSize - 1;
    int verticalPosition = (int)((double)scrollable * ((double)virtualScrollPosition.getRow() / (double)(virtualSize.getRows() - viewportSize.getRows())));
    graphics.drawLine(
            new TerminalPosition(graphics.getSize().getColumns() - 1, verticalPosition),
            new TerminalPosition(graphics.getSize().getColumns() - 1, verticalPosition + verticalSize),
            Symbols.BLOCK_MIDDLE);
}
 
Example 2
Source File: FullScreenTextGUITest.java    From lanterna with GNU Lesser General Public License v3.0 5 votes vote down vote up
private TextImage createBackground() {
    BasicTextImage image = new BasicTextImage(80, 25);
    TextGraphics graphics = image.newTextGraphics();
    graphics.setForegroundColor(TextColor.ANSI.WHITE);
    graphics.setBackgroundColor(TextColor.ANSI.BLUE);
    graphics.fill(' ');

    graphics.enableModifiers(SGR.BOLD);

    graphics.putString(7, 0, "Reminds you of some BIOS, doesn't it?");
    graphics.setCharacter(0, 1, Symbols.DOUBLE_LINE_TOP_LEFT_CORNER);
    graphics.drawLine(1, 1, 78, 1, Symbols.DOUBLE_LINE_HORIZONTAL);
    graphics.setCharacter(79, 1, Symbols.DOUBLE_LINE_TOP_RIGHT_CORNER);
    graphics.drawLine(79, 2, 79, 23, Symbols.DOUBLE_LINE_VERTICAL);
    graphics.setCharacter(79, 24, Symbols.DOUBLE_LINE_BOTTOM_RIGHT_CORNER);
    graphics.drawLine(1, 24, 78, 24, Symbols.DOUBLE_LINE_HORIZONTAL);
    graphics.setCharacter(0, 24, Symbols.DOUBLE_LINE_BOTTOM_LEFT_CORNER);
    graphics.drawLine(0, 2, 0, 23, Symbols.DOUBLE_LINE_VERTICAL);

    graphics.setCharacter(0, 17, Symbols.DOUBLE_LINE_T_SINGLE_RIGHT);
    graphics.drawLine(1, 17, 78, 17, Symbols.SINGLE_LINE_HORIZONTAL);
    graphics.setCharacter(79, 17, Symbols.DOUBLE_LINE_T_SINGLE_LEFT);
    graphics.setCharacter(40, 17, Symbols.SINGLE_LINE_T_UP);
    graphics.drawLine(40, 2, 40, 16, Symbols.SINGLE_LINE_VERTICAL);
    graphics.setCharacter(40, 1, Symbols.DOUBLE_LINE_T_SINGLE_DOWN);

    graphics.setCharacter(0, 20, Symbols.DOUBLE_LINE_T_SINGLE_RIGHT);
    graphics.drawLine(1, 20, 78, 20, Symbols.SINGLE_LINE_HORIZONTAL);
    graphics.setCharacter(79, 20, Symbols.DOUBLE_LINE_T_SINGLE_LEFT);
    
    graphics.putString(2, 18, "Esc : Quit");
    graphics.putString(42, 18, Symbols.ARROW_UP + " " + Symbols.ARROW_DOWN + " " + Symbols.ARROW_RIGHT + " " + 
            Symbols.ARROW_LEFT + "   : Select Item");
    graphics.putString(2, 19, "F10 : Save & Exit Setup");
    return image;
}
 
Example 3
Source File: TerminalColorTest.java    From lanterna with GNU Lesser General Public License v3.0 4 votes vote down vote up
public static void main(String[] args) throws IOException {
    Screen screen = new TestTerminalFactory(args).createScreen();
    screen.startScreen();

    TextGraphics writer = new ScreenTextGraphics(screen);
    writer.setForegroundColor(TextColor.ANSI.DEFAULT);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(10, 1, "Hello World");

    writer.setForegroundColor(TextColor.ANSI.BLACK);
    writer.setBackgroundColor(TextColor.ANSI.WHITE);
    writer.putString(11, 2, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.WHITE);
    writer.setBackgroundColor(TextColor.ANSI.BLACK);
    writer.putString(12, 3, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.BLACK);
    writer.setBackgroundColor(TextColor.ANSI.WHITE);
    writer.enableModifiers(SGR.BOLD);
    writer.putString(13, 4, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.WHITE);
    writer.setBackgroundColor(TextColor.ANSI.BLACK);
    writer.putString(14, 5, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.DEFAULT);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(15, 6, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.DEFAULT);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.disableModifiers(SGR.BOLD);
    writer.putString(16, 7, "Hello World");

    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(10, 10, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.WHITE);
    writer.putString(11, 11, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.BLACK);
    writer.putString(12, 12, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.MAGENTA);
    writer.putString(13, 13, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(14, 14, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.WHITE);
    writer.putString(15, 15, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.BLACK);
    writer.putString(16, 16, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.MAGENTA);
    writer.putString(17, 17, "Hello World");

    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(10, 20, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.WHITE);
    writer.putString(11, 21, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.BLACK);
    writer.putString(12, 22, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.MAGENTA);
    writer.putString(13, 23, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(14, 24, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.WHITE);
    writer.putString(15, 25, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.BLACK);
    writer.putString(16, 26, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.CYAN);
    writer.setBackgroundColor(TextColor.ANSI.BLUE);
    writer.putString(17, 27, "Hello World", SGR.BOLD);
    
    writer.setForegroundColor(TextColor.ANSI.DEFAULT);
    writer.setBackgroundColor(TextColor.ANSI.RED);
    writer.fill(' ');
    
    screen.refresh();

    try {
        Thread.sleep(5000);
    } catch(InterruptedException ignored) {
    }
    screen.stopScreen();
}
 
Example 4
Source File: TextGraphicsWriterTest.java    From lanterna with GNU Lesser General Public License v3.0 4 votes vote down vote up
public static void main(String[] args) throws IOException {
    Screen screen = new TestTerminalFactory(args).createScreen();
    screen.startScreen();

    TextGraphics writer = new ScreenTextGraphics(screen);
    writer.setForegroundColor(TextColor.ANSI.WHITE);
    writer.setBackgroundColor(TextColor.ANSI.BLUE);
    writer.fill(' ');
    TextGraphicsWriter tw = new TextGraphicsWriter(writer);

    String loremIpsum =
            "  Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod" +
            " tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim" +
            " veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid" +
            " ex ea commodi consequat. Quis aute iure reprehenderit in voluptate" +
            " velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint" +
            " obcaecat cupiditat non proident, sunt in culpa qui officia deserunt" +
            " mollit anim id est laborum.\n";
    // change all blanks behind full-stops or commas to underlined tabs:
    loremIpsum = loremIpsum.replaceAll("([.,]) ", "$1\033[4m\t\033[24m");
    // each occurrence of "dolor" gets its own background:
    loremIpsum = loremIpsum.replaceAll("(dolor)", "\033[45m$1\033[49m");
    // each 'o' is turned yellow.
    loremIpsum = loremIpsum.replaceAll("([o])", "\033[1;33m$1\033[22;39m");

    tw.putString("\033[m");
    tw.setWrapBehaviour(WrapBehaviour.SINGLE_LINE);
    writer.setTabBehaviour(TabBehaviour.ALIGN_TO_COLUMN_4);
    tw.putString("\n"+tw.getWrapBehaviour()+":\n");
    tw.putString(loremIpsum);

    tw.setWrapBehaviour(WrapBehaviour.CLIP);
    tw.putString("\n"+tw.getWrapBehaviour()+":\n");
    tw.putString(loremIpsum);

    tw.setWrapBehaviour(WrapBehaviour.CHAR);
    tw.putString("\n"+tw.getWrapBehaviour()+":\n");
    tw.putString(loremIpsum);

    tw.setWrapBehaviour(WrapBehaviour.WORD);
    tw.putString("\n"+tw.getWrapBehaviour()+":\n");
    tw.putString(loremIpsum);

    tw.setWrapBehaviour(WrapBehaviour.CLIP);
    writer.setTabBehaviour(TabBehaviour.IGNORE);
    tw.putString("\n"+tw.getWrapBehaviour()+" + TabBehaviour.IGNORE:\n");
    tw.putString(loremIpsum);

    tw.putString("\033[m");
    tw.setStyleable(false);
    tw.putString(tw.getWrapBehaviour()+" + Styleable turned off, so esc-sequences are visible:\n");
    tw.putString(loremIpsum);

    screen.refresh();
    screen.readInput();
    screen.stopScreen();
}
 
Example 5
Source File: DrawImageTest.java    From lanterna with GNU Lesser General Public License v3.0 4 votes vote down vote up
public static void main(String[] args) throws IOException {
    //Setup a standard Screen
    Screen screen = new TestTerminalFactory(args).createScreen();
    screen.startScreen();
    screen.setCursorPosition(null);

    //Create an 'image' that we fill with recognizable characters
    TextImage image = new BasicTextImage(5, 5);
    TextCharacter imageCharacter = new TextCharacter('X');
    TextGraphics textGraphics = image.newTextGraphics();
    textGraphics.drawRectangle(
            TerminalPosition.TOP_LEFT_CORNER,
            new TerminalSize(5, 5),
            imageCharacter.withBackgroundColor(TextColor.ANSI.RED));
    textGraphics.drawRectangle(
            TerminalPosition.OFFSET_1x1,
            new TerminalSize(3, 3),
            imageCharacter.withBackgroundColor(TextColor.ANSI.MAGENTA));
    textGraphics.setCharacter(2, 2,
            imageCharacter.withBackgroundColor(TextColor.ANSI.CYAN));

    TextGraphics screenGraphics = screen.newTextGraphics();
    screenGraphics.setBackgroundColor(TextColor.Indexed.fromRGB(50, 50, 50));
    screenGraphics.fill(' ');
    screenGraphics.drawImage(TerminalPosition.OFFSET_1x1, image);
    screenGraphics.drawImage(new TerminalPosition(8, 1), image, TerminalPosition.TOP_LEFT_CORNER, image.getSize().withRelativeColumns(-4));
    screenGraphics.drawImage(new TerminalPosition(10, 1), image, TerminalPosition.TOP_LEFT_CORNER, image.getSize().withRelativeColumns(-3));
    screenGraphics.drawImage(new TerminalPosition(13, 1), image, TerminalPosition.TOP_LEFT_CORNER, image.getSize().withRelativeColumns(-2));
    screenGraphics.drawImage(new TerminalPosition(17, 1), image, TerminalPosition.TOP_LEFT_CORNER, image.getSize().withRelativeColumns(-1));
    screenGraphics.drawImage(new TerminalPosition(22, 1), image);
    screenGraphics.drawImage(new TerminalPosition(28, 1), image, new TerminalPosition(1, 0), image.getSize());
    screenGraphics.drawImage(new TerminalPosition(33, 1), image, new TerminalPosition(2, 0), image.getSize());
    screenGraphics.drawImage(new TerminalPosition(37, 1), image, new TerminalPosition(3, 0), image.getSize());
    screenGraphics.drawImage(new TerminalPosition(40, 1), image, new TerminalPosition(4, 0), image.getSize());

    //Try to draw bigger than the image size, this should ignore the extra size
    screenGraphics.drawImage(new TerminalPosition(1, 7), image, TerminalPosition.TOP_LEFT_CORNER, image.getSize().withRelativeColumns(10));

    //0 size should draw nothing
    screenGraphics.drawImage(new TerminalPosition(8, 7), image, TerminalPosition.TOP_LEFT_CORNER, TerminalSize.ZERO);

    //Drawing with a negative source image offset will move the target position
    screenGraphics.drawImage(new TerminalPosition(8, 7), image, new TerminalPosition(-2, -2), image.getSize());

    screen.refresh();
    screen.readInput();
    screen.stopScreen();
}
 
Example 6
Source File: ScreenResizeTest.java    From lanterna with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void putStrings(String topTitle) throws IOException {
    TextGraphics writer = new ScreenTextGraphics(screen);
    writer.setForegroundColor(TextColor.ANSI.DEFAULT);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.fill(' ');

    writer.setForegroundColor(TextColor.ANSI.DEFAULT);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(0, 0, topTitle);
    writer.putString(10, 1, "Hello World");

    writer.setForegroundColor(TextColor.ANSI.BLACK);
    writer.setBackgroundColor(TextColor.ANSI.WHITE);
    writer.putString(11, 2, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.WHITE);
    writer.setBackgroundColor(TextColor.ANSI.BLACK);
    writer.putString(12, 3, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.BLACK);
    writer.setBackgroundColor(TextColor.ANSI.WHITE);
    writer.putString(13, 4, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.WHITE);
    writer.setBackgroundColor(TextColor.ANSI.BLACK);
    writer.putString(14, 5, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.DEFAULT);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(15, 6, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.DEFAULT);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(16, 7, "Hello World");

    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(10, 10, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.WHITE);
    writer.putString(11, 11, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.BLACK);
    writer.putString(12, 12, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.MAGENTA);
    writer.putString(13, 13, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(14, 14, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.WHITE);
    writer.putString(15, 15, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.BLACK);
    writer.putString(16, 16, "Hello World");
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.MAGENTA);
    writer.putString(17, 17, "Hello World");

    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(10, 20, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.WHITE);
    writer.putString(11, 21, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.BLACK);
    writer.putString(12, 22, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.BLUE);
    writer.setBackgroundColor(TextColor.ANSI.MAGENTA);
    writer.putString(13, 23, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(14, 24, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.WHITE);
    writer.putString(15, 25, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.GREEN);
    writer.setBackgroundColor(TextColor.ANSI.BLACK);
    writer.putString(16, 26, "Hello World", SGR.BOLD);
    writer.setForegroundColor(TextColor.ANSI.CYAN);
    writer.setBackgroundColor(TextColor.ANSI.BLUE);
    writer.putString(17, 27, "Hello World", SGR.BOLD);
    screen.refresh();
}
 
Example 7
Source File: ScreenTabTest.java    From lanterna with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void putStrings(String topTitle) throws IOException {
    TextGraphics writer = new ScreenTextGraphics(screen);
    writer.setForegroundColor(TextColor.ANSI.DEFAULT);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.fill(' ');

    writer.setForegroundColor(TextColor.ANSI.DEFAULT);
    writer.setBackgroundColor(TextColor.ANSI.DEFAULT);
    writer.putString(0, 0, topTitle, SGR.BLINK);
    writer.setTabBehaviour(TabBehaviour.CONVERT_TO_ONE_SPACE);
    writer.putString(10, 1, "TabBehaviour.CONVERT_TO_ONE_SPACE:    |\t|\t|\t|\t|");
    writer.setTabBehaviour(TabBehaviour.CONVERT_TO_TWO_SPACES);
    writer.putString(10, 2, "TabBehaviour.CONVERT_TO_TWO_SPACES:   |\t|\t|\t|\t|");
    writer.setTabBehaviour(TabBehaviour.CONVERT_TO_THREE_SPACES);
    writer.putString(10, 3, "TabBehaviour.CONVERT_TO_THREE_SPACES: |\t|\t|\t|\t|");
    writer.setTabBehaviour(TabBehaviour.CONVERT_TO_FOUR_SPACES);
    writer.putString(10, 4, "TabBehaviour.CONVERT_TO_FOUR_SPACES:  |\t|\t|\t|\t|");
    writer.setTabBehaviour(TabBehaviour.CONVERT_TO_EIGHT_SPACES);
    writer.putString(10, 5, "TabBehaviour.CONVERT_TO_EIGHT_SPACES: |\t|\t|\t|\t|");
    writer.setTabBehaviour(TabBehaviour.ALIGN_TO_COLUMN_4);
    writer.putString(10, 6, "TabBehaviour.ALIGN_TO_COLUMN_4:       |\t|\t|\t|\t|");
    writer.setTabBehaviour(TabBehaviour.ALIGN_TO_COLUMN_8);
    writer.putString(10, 7, "TabBehaviour.ALIGN_TO_COLUMN_8:       |\t|\t|\t|\t|");
    writer.putString(10, 9, "Default behaviour is: " + screen.getTabBehaviour());
    writer.putString(10, 10, "Testing Screen's tab replacement:");
    writer.putString(10, 11, "XXXXXXXXXXXXXXXX");
    screen.setCharacter(12, 11, new TextCharacter('\t'));
    screen.setTabBehaviour(TabBehaviour.CONVERT_TO_ONE_SPACE);
    screen.setCharacter(20, 11, new TextCharacter('\t'));
    screen.refresh();

    //Verify
    if(' ' != screen.getBackCharacter(new TerminalPosition(20, 11)).getCharacter()) {
        throw new IllegalStateException("Expected tab to be replaced with space");
    }
    if('X' != screen.getBackCharacter(new TerminalPosition(21, 11)).getCharacter()) {
        throw new IllegalStateException("Expected X in back buffer");
    }
    if(' ' != screen.getFrontCharacter(new TerminalPosition(20, 11)).getCharacter()) {
        throw new IllegalStateException("Expected tab to be replaced with space");
    }
    if('X' != screen.getFrontCharacter(new TerminalPosition(21, 11)).getCharacter()) {
        throw new IllegalStateException("Expected X in front buffer");
    }
}