当前位置: 首页>>代码示例>>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;未经允许,请勿转载。