Examples of Ansi


Examples of org.fusesource.jansi.Ansi

   }

   @Override
   public void clear()
   {
      print(new Ansi().cursor(0, 0).eraseScreen().toString());
   }
View Full Code Here

Examples of org.fusesource.jansi.Ansi

      return screenBuffer.getWidth();
   }

   public String escapeCode(final int code, final String value)
   {
      return new Ansi().a(value).fg(Ansi.Color.BLUE).toString();
   }
View Full Code Here

Examples of org.fusesource.jansi.Ansi

   public String renderColor(final Color color, final String output) {
      if (!config.isColorEnabled()) {
         return output;
      }

      Ansi ansi = new Ansi();

      switch (color) {
      case BLACK:
         ansi.fg(Ansi.Color.BLACK);
         break;
      case BLUE:
         ansi.fg(Ansi.Color.BLUE);
         break;
      case CYAN:
         ansi.fg(Ansi.Color.CYAN);
         break;
      case GREEN:
         ansi.fg(Ansi.Color.GREEN);
         break;
      case MAGENTA:
         ansi.fg(Ansi.Color.MAGENTA);
         break;
      case RED:
         ansi.fg(Ansi.Color.RED);
         break;
      case WHITE:
         ansi.fg(Ansi.Color.WHITE);
         break;
      case YELLOW:
         ansi.fg(Ansi.Color.YELLOW);
         break;
      case BOLD:
         ansi.a(Ansi.Attribute.INTENSITY_BOLD);
         break;
      case ITALIC:
         ansi.a(Ansi.Attribute.ITALIC);
         ansi.a(Ansi.Attribute.INTENSITY_FAINT);
         break;

      default:
         return output;
      }

      return ansi.render(output).reset().toString();
   }
View Full Code Here

Examples of org.fusesource.jansi.Ansi

    @Override
    public String getContent(String content) {
        String in = super.getContent(content);

        Ansi ansi = Ansi.ansi();
        ansi.fg(color);

        if (bold)
            ansi.a(Ansi.Attribute.INTENSITY_BOLD);

        ansi.a(in);

        if (bold)
            ansi.a(Ansi.Attribute.INTENSITY_BOLD_OFF);

        ansi.fg(Ansi.Color.DEFAULT);

        return ansi.toString();
    }
View Full Code Here

Examples of org.fusesource.jansi.Ansi

    }

    @Override
    protected void printClear() {
        AnsiConsole.systemInstall();
        Ansi ansi = Ansi.ansi();
        System.out.println( ansi.eraseScreen() );
        System.out.println( ansi.cursor(0, 0) );
        AnsiConsole.systemUninstall();
    }
View Full Code Here

Examples of org.fusesource.jansi.Ansi

    }

    @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();
    }
View Full Code Here

Examples of org.fusesource.jansi.Ansi

    }

    @Override
    protected void printClear() {
        AnsiConsole.systemInstall();
        Ansi ansi = Ansi.ansi();
        System.out.println( ansi.eraseScreen() );
        System.out.println( ansi.cursor(0, 0) );
        AnsiConsole.systemUninstall();
    }
View Full Code Here

Examples of org.fusesource.jansi.Ansi

   }

   @Override
   public void clearLine()
   {
      print(new Ansi().eraseLine(Ansi.Erase.ALL).toString());
   }
View Full Code Here

Examples of org.fusesource.jansi.Ansi

   }

   @Override
   public void cursorLeft(final int x)
   {
      print(new Ansi().cursorLeft(x).toString());
   }
View Full Code Here

Examples of org.fusesource.jansi.Ansi

      if (!colorEnabled)
      {
         return output;
      }

      Ansi ansi = new Ansi();

      switch (color)
      {
      case BLACK:
         ansi.fg(Ansi.Color.BLACK);
         break;
      case BLUE:
         ansi.fg(Ansi.Color.BLUE);
         break;
      case CYAN:
         ansi.fg(Ansi.Color.CYAN);
         break;
      case GREEN:
         ansi.fg(Ansi.Color.GREEN);
         break;
      case MAGENTA:
         ansi.fg(Ansi.Color.MAGENTA);
         break;
      case RED:
         ansi.fg(Ansi.Color.RED);
         break;
      case WHITE:
         ansi.fg(Ansi.Color.WHITE);
         break;
      case YELLOW:
         ansi.fg(Ansi.Color.YELLOW);
         break;
      case BOLD:
         ansi.a(Ansi.Attribute.INTENSITY_BOLD);
         break;
      case ITALIC:
         ansi.a(Ansi.Attribute.ITALIC);
         ansi.a(Ansi.Attribute.INTENSITY_FAINT);
         break;

      default:
         return output;
      }

      return ansi.render(output).reset().toString();
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.