Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GraphViz bloque = new GraphViz();
- bloque.addln(bloque.start_graph());
- String inicio = "L0:";
- String codigo1 = "t0 = true<br />t1=true<br />t2=t0 and t1<br />";
- String codigo2 = "if t2==true goto L1<br />goto L2<br />";
- String v="L1:";
- String f="L2:";
- //shape = \"Mrecord\"
- bloque.addln("subgraph clusterA {");
- bloque.addln("\"state0\" [ style = \"filled, bold\" penwidth = 1 fillcolor = \"white\" fontname = \"Courier New\" shape = \"Mrecord\" label = \"L0:\" ];");
- bloque.addln("\"state1\" [ style = \"filled, bold\" penwidth = 1 fillcolor = \"white\" fontname = \"Courier New\" shape = \"Mrecord\" label = <<table border=\"0\" cellborder=\"0\" cellpadding=\"3\" bgcolor=\"white\"><tr><td align=\"left\" port=\"r0\">t0=1*2</td></tr><tr><td align=\"left\" port=\"r1\">t1=t0+3</td></tr><tr><td align=\"left\" port=\"r2\">t2=t1+2</td></tr><tr><td align=\"left\" port=\"r3\">if t=true goto L1</td></tr><tr><td align=\"left\" port=\"r4\">goto L2</td></tr></table>> ];");
- bloque.addln("\"state2\" [ style = \"filled, bold\" penwidth = 1 fillcolor = \"white\" fontname = \"Courier New\" shape = \"Mrecord\" label = \"L1:\" ];");
- bloque.addln("\"state3\" [ style = \"filled, bold\" penwidth = 1 fillcolor = \"white\" fontname = \"Courier New\" shape = \"Mrecord\" label = <<table border=\"0\" cellborder=\"0\" cellpadding=\"3\" bgcolor=\"white\"><tr><td align=\"left\" port=\"r0\">t0=1*2</td></tr><tr><td align=\"left\" port=\"r1\">t1=t0+3</td></tr><tr><td align=\"left\" port=\"r2\">t2=t1+2</td></tr><tr><td align=\"left\" port=\"r3\">t3=t2+5</td></tr></table>> ];");
- bloque.addln("\"state4\" [ style = \"filled, bold\" penwidth = 1 fillcolor = \"white\" fontname = \"Courier New\" shape = \"Mrecord\" label = \"L2:\" ];");
- bloque.addln("state0 -> state1;");
- bloque.addln("state1 -> state2;");
- bloque.addln("state1 -> state4;");
- bloque.addln("state2 -> state3;");
- bloque.addln("state3 -> state0;");
- bloque.addln("state3 -> state4;");
- bloque.addln("}");
- bloque.addln(bloque.end_graph());
- String type = "png";
- File out = new File("C:\\Bloques_3D\\Bloque."+type);
- bloque.writeGraphToFile(bloque.getGraph(bloque.getDotSource(),type),out);
Add Comment
Please, Sign In to add comment