码迷,mamicode.com
首页 > 其他好文 > 详细

构造graphviz

时间:2014-08-09 18:22:08      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:style   http   color   java   io   strong   文件   ar   

public constructGraphviz(String InputPath, String OutputPath) throws IOException, InterruptedException
      {
            
             String dotPath = new String ();
            
            
            dotPath = GraphVizConfigure. ConfiAdd();
             String fileInputPath = InputPath;//输入为.txt的源文件
             String fileOutputPath = OutputPath;//输出为.jpg文件
             String tParam = "-Tjpg";
             String tOParam = "-o";
             String[] cmd = new String [5];
            cmd[0] = dotPath;
            cmd[1] = tParam;
            cmd[2] = fileInputPath;
            cmd[3] = tOParam;
            cmd[4] = fileOutputPath;
            Runtime rt = Runtime. getRuntime();
            rt.exec(cmd);
            Thread. sleep(600L);//注意此步骤很关键需要一个timer的缓冲 否则读取文件错误
      }

构造graphviz,布布扣,bubuko.com

构造graphviz

标签:style   http   color   java   io   strong   文件   ar   

原文地址:http://www.cnblogs.com/csytangresearch/p/3901252.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!