org.fusesource.jansi.Ansi.bg()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中org.fusesource.jansi.Ansi.bg()方法的一些代码示例,展示了Ansi.bg()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ansi.bg()方法的具体详情如下:
包路径:org.fusesource.jansi.Ansi
类名称:Ansi
方法名:bg

Ansi.bg介绍

暂无

代码示例

代码示例来源:origin: org.fusesource.jansi/jansi

public Ansi bgBrightMagenta() {
  return this.bg(Color.MAGENTA);
}

代码示例来源:origin: org.apache.maven.plugins/maven-surefire-report-plugin

Ansi apply( Ansi ansi )
{
  if ( bold )
  {
    ansi.bold();
  }
  if ( color != null )
  {
    if ( bright )
    {
      ansi.fgBright( color );
    }
    else
    {
      ansi.fg( color );
    }
  }
  if ( bgColor != null )
  {
    if ( bgBright )
    {
      ansi.bgBright( bgColor );
    }
    else
    {
      ansi.bg( bgColor );
    }
  }
  return ansi;
}

代码示例来源:origin: org.fusesource.jansi/jansi

public Ansi bgDefault() {
  return this.bg(Color.DEFAULT);
}

代码示例来源:origin: org.apache.maven.shared/maven-shared-utils

Ansi apply( Ansi ansi )
{
  if ( bold )
  {
    ansi.bold();
  }
  if ( color != null )
  {
    if ( bright )
    {
      ansi.fgBright( color );
    }
    else
    {
      ansi.fg( color );
    }
  }
  if ( bgColor != null )
  {
    if ( bgBright )
    {
      ansi.bgBright( bgColor );
    }
    else
    {
      ansi.bg( bgColor );
    }
  }
  return ansi;
}

代码示例来源:origin: org.fusesource.jansi/jansi

public Ansi bgYellow() {
  return this.bg(Color.YELLOW);
}

代码示例来源:origin: org.fusesource.jansi/jansi

public Ansi bgGreen() {
  return this.bg(Color.GREEN);
}

代码示例来源:origin: org.fusesource.jansi/jansi

public Ansi bgMagenta() {
  return this.bg(Color.MAGENTA);
}

代码示例来源:origin: org.fusesource.jansi/jansi

public Ansi bgRed() {
  return this.bg(Color.RED);
}

代码示例来源:origin: org.apache.felix.karaf.shell/org.apache.felix.karaf.shell.commands

if (!invertMatch && color != ColorOption.never) {
  matcher2.appendReplacement(sb, Ansi.ansi()
    .bg(Ansi.Color.YELLOW)
    .fg(Ansi.Color.BLACK)
    .a(matcher2.group())

代码示例来源:origin: org.jledit/core

/**
 * Displays Text highlighting the text that was marked as highlighted.
 *
 * @param text
 */
protected void displayText(String text) {
  if (highLight != null && !highLight.isEmpty() && text.contains(highLight)) {
    String highLightedText = text.replaceAll(highLight, ansi().bold().bg(theme.getHighLightBackground()).fg(theme.getHighLightForeground()).a(highLight).boldOff().reset().toString());
    console.out().print(highLightedText);
  } else {
    console.out().print(text);
  }
}

代码示例来源:origin: org.fusesource.jansi/jansi

private static Ansi render(Ansi ansi, String name) {
  Code code = Code.valueOf(name.toUpperCase(Locale.ENGLISH));
  if (code.isColor()) {
    if (code.isBackground()) {
      ansi.bg(code.getColor());
    } else {
      ansi.fg(code.getColor());
    }
  } else if (code.isAttribute()) {
    ansi.a(code.getAttribute());
  }
  return ansi;
}

代码示例来源:origin: org.springframework.boot/spring-boot-cli

private Ansi applyCode(Ansi ansi, Code code) {
  if (code.isColor()) {
    if (code.isBackground()) {
      return ansi.bg(code.getColor());
    }
    return ansi.fg(code.getColor());
  }
  return ansi.a(code.getAttribute());
}

代码示例来源:origin: org.springframework.data/spring-yarn-boot-cli

private Ansi applyCode(Ansi ansi, Code code) {
  if (code.isColor()) {
    if (code.isBackground()) {
      return ansi.bg(code.getColor());
    }
    return ansi.fg(code.getColor());
  }
  return ansi.a(code.getAttribute());
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

private void render(final Ansi ansi, final Code code) {
  if (code.isColor()) {
    if (code.isBackground()) {
      ansi.bg(code.getColor());
    } else {
      ansi.fg(code.getColor());
    }
  } else if (code.isAttribute()) {
    ansi.a(code.getAttribute());
  }
}

代码示例来源:origin: org.jledit/core

/**
 * Refreshes the footer that displays the current line and column.
 */
public void redrawFooter() {
  saveCursorPosition();
  Ansi style = ansi();
  if (getTheme().getFooterBackground() != null) {
    style.bg(getTheme().getFooterBackground());
  }
  if (getTheme().getFooterForeground() != null) {
    style.fg(getTheme().getFooterForeground());
  }
  getConsole().out().print(style);
  getConsole().out().print(ansi().cursor(getTerminal().getHeight() + 1 - getFooterSize(), 1).eraseLine(Ansi.Erase.FORWARD));
  for (int i = 1; i <= helpLines.size(); i++) {
    String helpLine = helpLines.get(i - 1);
    int startColumn = (getTerminal().getWidth() - helpLine.length()) / 2;
    getConsole().out().print(ansi().cursor(getTerminal().getHeight() + 1 - getFooterSize() + i, 1).eraseLine(Ansi.Erase.FORWARD));
    getConsole().out().print(ansi().cursor(getTerminal().getHeight() + 1 - getFooterSize() + i, startColumn));
    getConsole().out().print(helpLine);
  }
  getConsole().out().print(ansi().reset());
  restoreCursorPosition();
}

代码示例来源:origin: org.jledit/core

public void redrawHeader() {
  saveCursorPosition();
  getConsole().out().print(ansi().cursor(1, 1));
  Ansi style = ansi();
  if (getTheme().getHeaderBackground() != null) {
    style.bg(getTheme().getHeaderBackground());
  }
  if (getTheme().getHeaderForeground() != null) {
    style.fg(getTheme().getHeaderForeground());
  }
  String textCoords = "L:" + getLine() + " C:" + getColumn();
  int displayFileLength = getTerminal().getWidth() - getTitle().length() - textCoords.length() - 1;
  getConsole().out().print(style.a(getTitle()).a(":").a(Strings.tryToTrimToSize(getDisplayAs(), displayFileLength)).a(isDirty() ? DIRTY_SIGN : "").eraseLine(Ansi.Erase.FORWARD));
  getConsole().out().print(ansi().cursor(1, getTerminal().getWidth() - textCoords.length()));
  getConsole().out().print(ansi().a(textCoords).reset());
  getConsole().out().print(ansi().cursor(getTerminal().getHeight(), 1));
  restoreCursorPosition();
}

代码示例来源:origin: org.jledit/core

Ansi style = ansi();
if (getTheme().getPromptBackground() != null) {
  style.bg(getTheme().getPromptBackground());

代码示例来源:origin: org.jledit/core

public String readLine(String message) throws IOException {
  String result = null;
  saveCursorPosition();
  Ansi style = ansi();
  if (getTheme().getPromptBackground() != null) {
    style.bg(getTheme().getPromptBackground());
  }
  if (getTheme().getPromptForeground() != null) {
    style.fg(getTheme().getPromptForeground());
  }
  for (int i = 1; i <= getFooterSize(); i++) {
    console.out().print(ansi().cursor(terminal.getHeight() - getFooterSize() + i, 1));
    console.out().print(style.eraseLine(Ansi.Erase.FORWARD));
  }
  console.out().print(ansi().cursor(terminal.getHeight(), 1));
  console.out().print(ansi().cursor(terminal.getHeight(), 1));
  console.out().print(style.a(message).bold().eraseLine(Ansi.Erase.FORWARD));
  flush();
  try {
    result = readLine();
  } finally {
    console.out().print(ansi().reset());
    restoreCursorPosition();
    redrawFooter();
  }
  return result;
}

相关文章