src/main/java/de/dfki/lt/loot/digraph/io/GraphPrinterFactory.java
public static void dot2png(Path dotGraphPath) {

    System.out.format("converting %s ..." , dotGraphPath);
    Process process;
    try {
      if (System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) {
        String command = String.format("%s -Tgif %2$s -o\"%2$s.gif\" -Kdot",
            WIN_DOT, dotGraphPath);
        process = Runtime.getRuntime().exec(command);
      } else {
        String[] command = { "sh", "-c",
            "dot -Tpng '" + dotGraphPath + "' -o'" + dotGraphPath + ".png' -Kdot"
        };
        process = Runtime.getRuntime().exec(command);
      }
      SRRunnable err = new SRRunnable(process.getErrorStream());
      SRRunnable out = new SRRunnable(process.getInputStream());
      Thread e = new Thread(err);
      e.run();
      Thread o = new Thread(out);
      o.run();
      System.out.println(" : " + process.waitFor() +
          "|" + err.toString() + "|" + out.toString());
    } catch (InterruptedException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
/**
   * Creates a .gif or .png image for the given .dot graph.
   *
   * @param dotGraphPath
   *          the path to the .dot graph
   */
Creates a .gif or .png image for the given .dot graph.
@param dotGraphPath
the path to the .dot graph
Creates a . gif or . png image for the given . dot graph . @param dotGraphPath the path to the . dot graph
public static void dot2png(Path dotGraphPath) {
    System.out.format("converting %s ..." , dotGraphPath);
    Process process;
    try {
      if (System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) {
        String command = String.format("%s -Tgif %2$s -o\"%2$s.gif\" -Kdot",
            WIN_DOT, dotGraphPath);
        process = Runtime.getRuntime().exec(command);
      } else {
        String[] command = { "sh", "-c",
            "dot -Tpng '" + dotGraphPath + "' -o'" + dotGraphPath + ".png' -Kdot"
        };
        process = Runtime.getRuntime().exec(command);
      }
      SRRunnable err = new SRRunnable(process.getErrorStream());
      SRRunnable out = new SRRunnable(process.getInputStream());
      Thread e = new Thread(err);
      e.run();
      Thread o = new Thread(out);
      o.run();
      System.out.println(" : " + process.waitFor() +
          "|" + err.toString() + "|" + out.toString());
    } catch (InterruptedException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
public static void dot2png ( Path dotGraphPath ) { System . out . format ( "converting %s ..." , dotGraphPath ) ; Process process ; try { if ( System . getProperty ( "os.name" ) . toLowerCase ( ) . indexOf ( "win" ) >= 0 ) { String command = String . format ( "%s -Tgif %2$s -o\"%2$s.gif\" -Kdot" , WIN_DOT , dotGraphPath ) ; process = Runtime . getRuntime ( ) . exec ( command ) ; } else { String [ ] command = { "sh" , "-c" , "dot -Tpng '" + dotGraphPath + "' -o'" + dotGraphPath + ".png' -Kdot" } ; process = Runtime . getRuntime ( ) . exec ( command ) ; } SRRunnable err = new SRRunnable ( process . getErrorStream ( ) ) ; SRRunnable out = new SRRunnable ( process . getInputStream ( ) ) ; Thread e = new Thread ( err ) ; e . run ( ) ; Thread o = new Thread ( out ) ; o . run ( ) ; System . out . println ( " : " + process . waitFor ( ) + "|" + err . toString ( ) + "|" + out . toString ( ) ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } }
Creates a .gif or .png image for the given .dot graph.
Creates a . gif or . png image for the given . dot graph .