コード例 #1
0
ファイル: TermUtil.java プロジェクト: Ignifazius/avrora
 /**
  * The <code>printSeparator()</code> method prints a horizontal bar on the terminal that helps to
  * separate different sections of textual output. This implementation uses the '=' character,
  * providing a double-thick separator line and embeds a header string within the separating line.
  *
  * @param width the width of the horizontal separator bar
  * @param header the string to embed in the separator line
  */
 public static void printSeparator(int width, String header) {
   Terminal.print("=={ ");
   Terminal.print(header);
   Terminal.print(" }");
   Terminal.print(StringUtil.dup('=', width - 6 - header.length()));
   Terminal.nextln();
 }
コード例 #2
0
 /** @see VtResponse#appendDescription(Terminal) */
 @Override
 protected Terminal appendDescription(final Terminal term) {
   term.print("Cursor location: +");
   term.print(this.x);
   term.print('+');
   term.print(this.y);
   return term;
 }
コード例 #3
0
ファイル: TermUtil.java プロジェクト: Ignifazius/avrora
  /**
   * The <code>reportProportion()</code> method is a simply utility to print out a quantity's name
   * (such as "Number of instructions executed", the value (such as 2002), and the units (such as
   * cycles) in a colorized and standardized way.
   *
   * @param name the name of the quantity as a string
   * @param val the value of the quantity as a long integer
   * @param units the name of the units as a string
   */
  public static void reportProportion(String name, long val, long total, String units) {
    String sval = Long.toString(val);
    Terminal.printGreen(name);
    Terminal.print(": ");
    Terminal.printBrightCyan(sval);
    if (units != null && units.length() > 0) Terminal.print(' ' + units + ' ');
    else Terminal.print(" ");
    float pcnt = (100 * (float) val / total);

    Terminal.printBrightCyan(StringUtil.toFixedFloat(pcnt, 4));
    Terminal.println(" %");
  }
コード例 #4
0
ファイル: TermUtil.java プロジェクト: Ignifazius/avrora
 /**
  * The <code>reportQuantity()</code> method is a simply utility to print out a quantity's name
  * (such as "Number of instructions executed", the value (such as 2002), and the units (such as
  * cycles) in a colorized and standardized way.
  *
  * @param name the name of the quantity as a string
  * @param val the value of the quantity as a string
  * @param units the name of the units as a string
  */
 public static void reportQuantity(String name, String val, String units) {
   Terminal.printGreen(name);
   Terminal.print(": ");
   Terminal.printBrightCyan(val);
   Terminal.println(' ' + units);
 }