Java Code Examples for org.fusesource.jansi.Ansi#eraseLine()

The following examples show how to use org.fusesource.jansi.Ansi#eraseLine() . 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: AnsiConsole.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void draw(Ansi ansi) {
    String prefix = StringUtils.getCommonPrefix(new String[]{text, displayedText});
    if (prefix.length() < displayedText.length()) {
        ansi.cursorLeft(displayedText.length() - prefix.length());
    }
    if (prefix.length() < text.length()) {
        ColorMap.Color color = colorMap.getStatusBarColor();
        color.on(ansi);
        ansi.a(text.substring(prefix.length()));
        color.off(ansi);
    }
    if (displayedText.length() > text.length()) {
        ansi.eraseLine(Ansi.Erase.FORWARD);
    }
    displayedText = text;
}
 
Example 2
Source File: AnsiConsole.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void draw(Ansi ansi) {
    String prefix = StringUtils.getCommonPrefix(new String[]{text, displayedText});
    if (prefix.length() < displayedText.length()) {
        ansi.cursorLeft(displayedText.length() - prefix.length());
    }
    if (prefix.length() < text.length()) {
        ColorMap.Color color = colorMap.getStatusBarColor();
        color.on(ansi);
        ansi.a(text.substring(prefix.length()));
        color.off(ansi);
    }
    if (displayedText.length() > text.length()) {
        ansi.eraseLine(Ansi.Erase.FORWARD);
    }
    displayedText = text;
}
 
Example 3
Source File: AnsiConsole.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void draw(Ansi ansi) {
    String prefix = StringUtils.getCommonPrefix(new String[]{text, displayedText});
    if (prefix.length() < displayedText.length()) {
        ansi.cursorLeft(displayedText.length() - prefix.length());
    }
    if (prefix.length() < text.length()) {
        ColorMap.Color color = colorMap.getStatusBarColor();
        color.on(ansi);
        ansi.a(text.substring(prefix.length()));
        color.off(ansi);
    }
    if (displayedText.length() > text.length()) {
        ansi.eraseLine(Ansi.Erase.FORWARD);
    }
    displayedText = text;
}
 
Example 4
Source File: AnsiConsole.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void draw(Ansi ansi) {
    String prefix = StringUtils.getCommonPrefix(new String[]{text, displayedText});
    if (prefix.length() < displayedText.length()) {
        ansi.cursorLeft(displayedText.length() - prefix.length());
    }
    if (prefix.length() < text.length()) {
        ColorMap.Color color = colorMap.getStatusBarColor();
        color.on(ansi);
        ansi.a(text.substring(prefix.length()));
        color.off(ansi);
    }
    if (displayedText.length() > text.length()) {
        ansi.eraseLine(Ansi.Erase.FORWARD);
    }
    displayedText = text;
}
 
Example 5
Source File: AnsiConsole.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void onDeactivate(Ansi ansi) {
    if (displayedText.length() > 0) {
        ansi.cursorLeft(displayedText.length());
        ansi.eraseLine(Ansi.Erase.FORWARD);
        displayedText = "";
    }
}
 
Example 6
Source File: AnsiConsole.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void onDeactivate(Ansi ansi) {
    if (displayedText.length() > 0) {
        ansi.cursorLeft(displayedText.length());
        ansi.eraseLine(Ansi.Erase.FORWARD);
        displayedText = "";
    }
}
 
Example 7
Source File: AnsiConsole.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void onDeactivate(Ansi ansi) {
    if (displayedText.length() > 0) {
        ansi.cursorLeft(displayedText.length());
        ansi.eraseLine(Ansi.Erase.FORWARD);
        displayedText = "";
    }
}
 
Example 8
Source File: AnsiConsole.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void onDeactivate(Ansi ansi) {
    if (displayedText.length() > 0) {
        ansi.cursorLeft(displayedText.length());
        ansi.eraseLine(Ansi.Erase.FORWARD);
        displayedText = "";
    }
}