Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to draw automata in java

i want to draw an automata with edges and circulaire states, something like this http://pop-art.inrialpes.fr/~girault/Cours/Automates/td5.html, have u an example for that

like image 517
Wassim Sboui Avatar asked Apr 28 '12 00:04

Wassim Sboui


2 Answers

JGraph is a library you can use that is native to Java and fairly easy to use, or you can generate a .dot file and let GraphViz take care of it for you.

like image 73
Christian Mann Avatar answered Sep 28 '22 05:09

Christian Mann


If you dont want to carry for things like representing the graph in a correct way such you try to not cross the lines, or to not have two or more nodes in the same position then i suggest you to use grail graph library so you can see the graph using yed works (I can provide you an example of it just write the regular expression you in comment), or if you want to draw the graph by yourself then you probably is good to learn about Layered graph drawing : http://en.wikipedia.org/wiki/Layered_graph_drawing and Coffman Graham algorithm http://en.wikipedia.org/wiki/Coffman%E2%80%93Graham_algorithm

like image 43
sm13294 Avatar answered Sep 28 '22 04:09

sm13294