當前位置: 首頁>>代碼示例>>Java>>正文


Java AnsiConsole.systemUninstall方法代碼示例

本文整理匯總了Java中org.fusesource.jansi.AnsiConsole.systemUninstall方法的典型用法代碼示例。如果您正苦於以下問題:Java AnsiConsole.systemUninstall方法的具體用法?Java AnsiConsole.systemUninstall怎麽用?Java AnsiConsole.systemUninstall使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.fusesource.jansi.AnsiConsole的用法示例。


在下文中一共展示了AnsiConsole.systemUninstall方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
public void main(String[] args) {

        //Activate ANSI on Windows
        AnsiConsole.systemInstall();
        System.setProperty("picocli.ansi", "true");

        //System Property gets set here, because picocli.trace must be set before CommandLine starts
        String input = String.join("", args);
        if (input.contains("-m")) {
            System.setProperty("picocli.trace", "DEBUG");
        } else if (input.contains("-v")) {
            System.setProperty("picocli.trace", "INFO");
        }

        CommandLine commandLine = new CommandLine(new CliMain(), new CliPropertiesFactory(apiController));
        commandLine.parseWithHandler(new CommandLine.RunLast(), System.err, args);
        AnsiConsole.systemUninstall();
    }
 
開發者ID:StuPro-TOSCAna,項目名稱:TOSCAna,代碼行數:19,代碼來源:CliMain.java

示例2: winScreen

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
/**
 * Draw a Win screen
 */
@Override
public void winScreen() {
    clear();
    show(" ");
    drawLifeInvader();
    drawSeparator();
    show("__   _____  _   _  __      _____  _  _   _", YELLOW);
    show("\\ \\ / / _ \\| | | | \\ \\    / / _ \\| \\| | | |", YELLOW);
    show(" \\ V / (_) | |_| |  \\ \\/\\/ / (_) | .` | |_|", YELLOW);
    show("  |_| \\___/ \\___/    \\_/\\_/ \\___/|_|\\_| (_)", YELLOW);
    AnsiConsole.systemUninstall();
}
 
開發者ID:KeydownR,項目名稱:lifeInvader-SchoolProject,代碼行數:16,代碼來源:CliView.java

示例3: main

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
public static void main(String[] args) {

        // On Windows without Cygwin or similar, picocli will not emit ANSI escape codes by default.
        // Force ANSI ON if no user preference, otherwise let user decide.
        Ansi ansi = System.getProperty("picocli.ansi") == null ? Ansi.ON : Ansi.AUTO;

        AnsiConsole.systemInstall(); // Jansi magic
        CommandLine.run(new WindowsJansiDemo(), System.err, ansi, args);
        AnsiConsole.systemUninstall();
    }
 
開發者ID:remkop,項目名稱:picocli,代碼行數:11,代碼來源:WindowsJansiDemo.java

示例4: print

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
/**
 * Prints a Uniform Fuzzy Hash in a visual way.
 * 
 * @param hash The Uniform Fuzzy Hash.
 * @param base The characters base which will be used to represent the blocks.
 * @param factorDivisor Amount of characters per factor size for each block.
 * @param lineWrap Amount of characters per line. If this argument is lower than 1, no line wrap
 *        is performed and the full representation is printed in one line.
 * @param concatenatePercent In case line wrap is performed, true to concatenate to each line
 *        its relative percent to the total length.
 */
public static void print(
        UniformFuzzyHash hash,
        char[] base,
        int factorDivisor,
        int lineWrap,
        boolean concatenatePercent) {

    // Representation.
    String representation = represent(hash, base, factorDivisor);
    List<String> wrappedRepresentation =
            wrapString(representation, lineWrap, concatenatePercent);

    // Print.
    final PrintStream printStream = System.out;

    if (printStream == AnsiConsole.out) {
        AnsiConsole.systemInstall();
    }

    printStream.println();

    for (String line : wrappedRepresentation) {
        printStream.println(line);
    }

    printStream.println();

    if (printStream == AnsiConsole.out) {
        AnsiConsole.systemUninstall();
    }

}
 
開發者ID:s3curitybug,項目名稱:similarity-uniform-fuzzy-hash,代碼行數:44,代碼來源:VisualRepresentation.java

示例5: disable

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
/**
 * Disables the logger and shutdowns the ansi console
 */
public void disable() {
    if(baseLogger instanceof MooLogger) {
        ((MooLogger) baseLogger).close();
    }
    AnsiConsole.systemUninstall();
    executor.shutdownNow();
}
 
開發者ID:Superioz,項目名稱:MooProject,代碼行數:11,代碼來源:ExtendedLogger.java

示例6: destroy

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
public void destroy(){
    AnsiConsole.systemUninstall();
    try {
        logWriter.close();
    }catch(IOException ex){
        System.out.println("Unable to close log file! Perhaps it was deleted?");
    }
}
 
開發者ID:Clout-Team,項目名稱:JarCraftinator,代碼行數:9,代碼來源:Logger.java

示例7: gameOverScreen

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
/**
 * Draw a game over screen
 */
@Override
public void gameOverScreen() {
    clear();
    show(" ");
    drawLifeInvader();
    drawSeparator();

    show("  ___   _   __  __ ___    _____   _____ ___   _", RED);
    show(" / __| /_\\ |  \\/  | __|  / _ \\ \\ / / __| _ \\ | |", RED);
    show("| (_ |/ _ \\| |\\/| | _|  | (_) \\ V /| _||   / |_|", RED);
    show(" \\___/_/ \\_\\_|  |_|___|  \\___/ \\_/ |___|_|_\\ (_)", RED);
    AnsiConsole.systemUninstall();
}
 
開發者ID:KeydownR,項目名稱:lifeInvader-SchoolProject,代碼行數:17,代碼來源:CliView.java

示例8: run

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
private boolean run(final String user, final String password, final String apiKey, final String epic) {
   InputStreamReader reader = new InputStreamReader(System.in);
   try(BufferedReader in = new BufferedReader(reader)) {
      AnsiConsole.systemInstall();
      System.out.println(ansi().eraseScreen());

      connect(user, password, apiKey);

      if(StringUtils.isNotBlank(epic)) {
         tradeableEpic = getTradeableEpic(epic);
      } else {
         tradeableEpic = getTradableEpicFromWatchlist();
      }

      subscribeToLighstreamerAccountUpdates();
      subscribeToLighstreamerHeartbeat();
      subscribeToLighstreamerPriceUpdates();
      subscribeToLighstreamerTradeUpdates();

      logStatusMessage("Press ENTER to BUY");
      ConversationContextV3 contextV3 = (ConversationContextV3) authenticationContext.getConversationContext();
      while(true) {
         if(new Date().getTime() + 5000 > contextV3.getAccessTokenExpiry()) {    // Refresh the access token 5 seconds before expiry
            logStatusMessage("Refreshing access token");
            contextV3 = refreshAccessToken(contextV3);
         }
         Thread.sleep(20);
         if (in.ready()) {
            in.readLine();
            createPosition();
         }
      }
   } catch (Exception e) {
      logStatusMessage("Failure: " + e.getMessage());
      return false;
   } finally {
      disconnect();
      AnsiConsole.systemUninstall();
   }
}
 
開發者ID:IG-Group,項目名稱:ig-webapi-java-sample,代碼行數:41,代碼來源:Application.java

示例9: exit

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
public static void exit(int status) {
  FancyPrinter.printND("@|bold WebDZ Finished!|@");
  if (FancyPrinter.isLogging) FancyPrinter.stopLoggingToFile();
  AnsiConsole.systemUninstall();

  System.exit(status);
}
 
開發者ID:Admicos,項目名稱:webdz,代碼行數:8,代碼來源:Main.java

示例10: handleException

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
public static void handleException(Exception e) {
  e.printStackTrace();
  if (FancyPrinter.isLogging) FancyPrinter.stopLoggingToFile();
  AnsiConsole.systemUninstall();

  System.exit(1);
}
 
開發者ID:Admicos,項目名稱:webdz,代碼行數:8,代碼來源:Main.java

示例11: render

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
@Override
public void render(List<JobRunResult> results, long timeElapsedSec) {
  AnsiConsole.systemInstall();
  try{
    createAnsiCode(results);
  }finally{
    AnsiConsole.systemUninstall();
  }    
}
 
開發者ID:detectiveframework,項目名稱:detective,代碼行數:10,代碼來源:ResultRenderAnsiConsoleImpl.java

示例12: setUseColors

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
public void setUseColors(boolean useColors) {
    this.useColors = useColors;
    if (useColors) {
        AnsiConsole.systemInstall();
        ansiInstalled = true;
    } else {
        AnsiConsole.systemUninstall();
        ansiInstalled = false;
    }
}
 
開發者ID:m-szalik,項目名稱:tjconsole,代碼行數:11,代碼來源:Output.java

示例13: close

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
@Override
public void close() throws IOException {
    if (ansiInstalled) {
        AnsiConsole.systemUninstall();
    }
    out.close();
}
 
開發者ID:m-szalik,項目名稱:tjconsole,代碼行數:8,代碼來源:Output.java

示例14: printClear

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
@Override
protected void printClear() {
    AnsiConsole.systemInstall();
    Ansi ansi = Ansi.ansi();
    System.out.println( ansi.eraseScreen() );
    System.out.println( ansi.cursor(0, 0) );
    AnsiConsole.systemUninstall();
}
 
開發者ID:sigmoidanalytics,項目名稱:spork-streaming,代碼行數:9,代碼來源:GruntParser.java

示例15: printCompared

import org.fusesource.jansi.AnsiConsole; //導入方法依賴的package包/類
/**
 * Prints a Uniform Fuzzy Hash in a visual way, coloring the blocks which are present in another
 * Uniform Fuzzy Hash with a different color to the ones which are not.
 * 
 * @param hash1 The Uniform Fuzzy Hash.
 * @param hash2 The Uniform Fuzzy Hash to which the first one will be compared.
 * @param base The characters base which will be used to represent the blocks.
 * @param factorDivisor Amount of characters per factor size for each block.
 * @param lineWrap Amount of characters per line. If this argument is lower than 1, no line wrap
 *        is performed and the full representation is printed in one line.
 * @param concatenatePercent In case line wrap is performed, true to concatenate to each line
 *        its relative percent to the total length.
 */
public static void printCompared(
        UniformFuzzyHash hash1,
        UniformFuzzyHash hash2,
        char[] base,
        int factorDivisor,
        int lineWrap,
        boolean concatenatePercent) {

    // Representations.
    String representation1 = representCompared(hash1, hash2, base, factorDivisor);
    String representation2 = representCompared(hash2, hash1, base, factorDivisor).replace(
            BLOCK_IN_FIRST_HASH_ANSI_CODE_FORMAT, BLOCK_IN_SECOND_HASH_ANSI_CODE_FORMAT);

    List<String> wrappedRepresentation1 =
            wrapStringRespectingAnsiCodeFormat(representation1, lineWrap, concatenatePercent);
    List<String> wrappedRepresentation2 =
            wrapStringRespectingAnsiCodeFormat(representation2, lineWrap, concatenatePercent);

    String wrapLengthSpaces = concatenatePercent
            ? spaces(lineWrap + formatAccumulatedWrapLength("", 0).length())
            : spaces(lineWrap);
    while (wrappedRepresentation1.size() < wrappedRepresentation2.size()) {
        wrappedRepresentation1.add(wrapLengthSpaces);
    }
    while (wrappedRepresentation2.size() < wrappedRepresentation1.size()) {
        wrappedRepresentation2.add(wrapLengthSpaces);
    }

    // Print.
    final PrintStream printStream = AnsiConsole.out;

    if (printStream == AnsiConsole.out) {
        AnsiConsole.systemInstall();
    }

    printStream.println();

    Iterator<String> iterator1 = wrappedRepresentation1.iterator();
    Iterator<String> iterator2 = wrappedRepresentation2.iterator();
    final int separation = 5;
    while (iterator1.hasNext()) {
        printStream.println(iterator1.next() + spaces(separation) + iterator2.next());
    }

    printStream.println();

    if (printStream == AnsiConsole.out) {
        AnsiConsole.systemUninstall();
    }

}
 
開發者ID:s3curitybug,項目名稱:similarity-uniform-fuzzy-hash,代碼行數:65,代碼來源:VisualRepresentation.java


注:本文中的org.fusesource.jansi.AnsiConsole.systemUninstall方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。