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
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.
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
Related
i need to draw a graph like this, the input is an adjacency matrix and the output is the graph in a window, the way of another color is the way with less weight but the most importan for me is to learn to draw a simple graph. Thank you
English is not my language sorry, maybe I did not express myself well
I found a library in python to draw a graph easily, it is called networkx and matplotlib
I'm looking for a graphic library that allow me to plot a pixel point in a specific color with the purpose of draw a fractal (mandelbrot set). I've read the basic math behind fractal and I understand it, the algorithm is not difficult.
But I don't know what graphic library could I use, I don't need anything sofisticated and complex, just print a pixel set with colors. What do you suggest me? Cairo? OpenGl?.
Note: I only have experience with pygtk. I was reading the Java API and found the the fillRect method and BufferedImages but it seem a little complicate.
Thanks ;)
Unless you want to compute 3D fractals (in which case a library like JOGL Java OpenGL can help), a simple java.awt.Graphics.setColor( java.awt.Color aColor) is enough.
(as show in this program).
In other word, the default awt library in Java should be up to the task: see "Graphics: setColor(Color c)".
I have implemented both mandelbrot and the flame fractal algorithm in native java (no openGL).
The most efficient way is to just store color in an int array or similar,
and then save it as an image file (png or jpg). It is much quicker than using Graphics.
I'm looking for the appropriate transformation to make a 2D image look like a 3D drawing. If I draw a "road" with parallel lines on a sheet of paper, and then tilt the top of the page away from you, so that the road appears to be disappearing into the distance is what I am looking for.
I'm using Java and would like an appropriate API/library. I don't believe "AffineTransformation" accomplishes this.
You don't want an AffineTransformation, as that will always preserve parallel lines, which isn't what you want here.
Luckily the Java Advanced Imaging API (javax.media.jai) has exactly what you want, in the shape of the PerspectiveTransform class (click that link for docs).
Your problem is not trivial, but certainly solvable. You can take any four-sided image and apply a 3D perspective transformation. Just don't expect it to be a one-liner.
I'm at home now (checking SO before going to sleep, of course :D), but I'm almost 100% certain this is the site I used to find the appropriate code in C#:
http://ryoushin.com/cmerighi/en-us/61,2007-10-29/Image_Distortion_Enhancements.aspx
Porting it to java should be fairly straightforward. Let me know if the link doesn't solve your answer and I'll edit my answer tomorrow with more info.
I can't give you a simple answer, but I can tell you that what you're looking to draw is called two-point perspective. With this information, maybe you will be able to find a library that takes a 3D object and produces a perspective view.
Here's a simple Java applet that I've seen previously that demonstrates 2-point perspective:
Link
Hope this helps!
I need a way for render a tree-like structures, similar to flowcharts.
Surprisingly, I can't find(or I'm doing wrong) a suitable tool.
First, I looked at SVG. But I couldn't find a way to draw a bounding box around the text
without using ECMAScript: I tried to do a simple thing drawing two text surrounded by boxes and linked by a line, centered by sides(some thing like O-O, where O is a box with text).And when you use ECMAScript, you heavily limit the tools that can be used for SVG rendering(for example you can't convert corrently such SVG to png or pdf with ImageMagick).
Second, I tried Asymptote, but it is quite heavy when you start manipulating with text(you need an LaTeX system installed and configured).
I look for a tool in which you can:
Programmatically access to font properties: baseline, ascent, descent, height
Computing height/width of a string(or the bounding box)
basic vector graphics functionality like drawing lines, shapes etc.
I don't think that's a hard stuff. For example, all such functionality exists for example in Java2D. Sure, I can use it as last resort and get raster graphics, but may be there is something handy to use?
Have you looked at GraphViz (http://www.graphviz.org/)? It does not really match your requirements since you give up some control and instead let the tool do the layout and rendering based on a declarative a description of a graph or tree, but I have found it to be the easiest way to generate tree-like output.
Not sure if it should be free?
Here's a commercial solution with an extensive API
http://www-01.ibm.com/software/integration/visualization/java/
Is there any good open source library in Java which can be used to draw 3D dynamic charts, like JFreeChart does it for 2D?
If you're up to coding to a more fundamental api (ie you have to draw your own lines to represent the chart values), two choices are:
1. java3d.dev.java.net/
(A display list abstraction)
2. kenai.com/projects/jogl/pages/Home
(A Java wrapper to OpenGL)
Can you define your use case, since JFreeChart can draw at least 3D line, bar and pie charts?
You can have a look at Surface Plotter. There is an online demo, it's LGPL, 100% pure java, and design for reuse.
I suggest you try http://www.jzy3d.org, which will really help you to do what you want.
Regards,
Martin