Exemplo n.º 1
0
  @Override
  public String generateCode() {
    Attribute attr = getAttribute();
    FColor fColor = getForegroundColor();
    BColor bColor = getBackgroundColor();

    if ((attr == Attribute.NONE) && (fColor == FColor.NONE) && (bColor == BColor.NONE)) return "";
    else
      return Ansi.PREFIX
          + attr.toString()
          + Ansi.SEPARATOR
          + fColor.toString()
          + Ansi.SEPARATOR
          + bColor.toString()
          + Ansi.POSTFIX;
  }
Exemplo n.º 2
0
 @Override
 public String generateCode(Attribute attr, FColor fg, BColor bg) {
   return Ansi.PREFIX
       + attr.toString()
       + Ansi.SEPARATOR
       + fg.toString()
       + Ansi.SEPARATOR
       + bg.toString()
       + Ansi.POSTFIX;
 }