本文整理汇总了Java中org.fusesource.jansi.Ansi.newline方法的典型用法代码示例。如果您正苦于以下问题:Java Ansi.newline方法的具体用法?Java Ansi.newline怎么用?Java Ansi.newline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.fusesource.jansi.Ansi
的用法示例。
在下文中一共展示了Ansi.newline方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: format
import org.fusesource.jansi.Ansi; //导入方法依赖的package包/类
@Override
public synchronized String format(final LogRecord record) {
final boolean exception = record.getThrown() != null;
final Ansi sbuf = prefix(record);
sbuf.a(record.getLevel().getLocalizedName());
sbuf.a(" - ");
sbuf.a(formatMessage(record));
if (!exception) {
suffix(sbuf, record);
}
sbuf.newline();
if (exception) {
try {
final StringWriter sw = new StringWriter();
final PrintWriter pw = new PrintWriter(sw);
record.getThrown().printStackTrace(pw);
pw.close();
sbuf.a(sw.toString());
} catch (final Exception ex) {
// no-op
} finally {
suffix(sbuf, record);
}
}
return sbuf.toString();
}
示例2: redraw
import org.fusesource.jansi.Ansi; //导入方法依赖的package包/类
public void redraw() {
boolean hasTextOnBottomLine = textCursor.row == 0 && textCursor.col > 0;
if (writePos.row == 0 && writtenText.equals(text) && !hasTextOnBottomLine) {
// Does not need to be redrawn
return;
}
Ansi ansi = createAnsi();
if (hasTextOnBottomLine) {
int staleStatusChars = writePos.row > 0 ? 0 : writtenText.length();
writePos.copyFrom(textCursor);
positionCursorAt(writePos, ansi);
if (staleStatusChars > textCursor.col) {
ansi.eraseLine(Ansi.Erase.FORWARD);
}
ansi.newline();
newLineWritten(writePos);
writtenText = "";
} else {
writePos.bottomLeft();
positionCursorAt(writePos, ansi);
}
if (text.length() > 0) {
ColorMap.Color color = colorMap.getStatusBarColor();
color.on(ansi);
ansi.a(text);
color.off(ansi);
}
if (text.length() < writtenText.length()) {
ansi.eraseLine(Ansi.Erase.FORWARD);
}
write(ansi);
charactersWritten(writePos, text.length());
writtenText = text;
}
示例3: doEndLine
import org.fusesource.jansi.Ansi; //导入方法依赖的package包/类
@Override
protected void doEndLine(CharSequence endOfLine) {
Ansi ansi = createAnsi();
positionCursorAt(writePos, ansi);
if (writePos.row == statusBarCursor.row && statusBarCursor.col > writePos.col) {
ansi.eraseLine(Ansi.Erase.FORWARD);
}
ansi.newline();
write(ansi);
newLineWritten(writePos);
}
示例4: onDeactivate
import org.fusesource.jansi.Ansi; //导入方法依赖的package包/类
public void onDeactivate(Ansi ansi) {
if (width > 0) {
ansi.newline();
extraEol = true;
}
}