首页 > 代码库 > 构造graphviz
构造graphviz
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的缓冲 否则读取文件错误
}
You can also reference:http://bitsy.googlecode.com/svn/trunk/Itsybitsy/src/arbolB/ArbolB.java
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。