Mandelbrot on fire

So I have been experimenting with SwingWorker, as promised, and this:

is the result.

source code and binaries provided. To run the demo you'll need SwingWorker.jar and a JDK5.0 JVM. If you have JavaWebStart (JDK 5.0) installed then press here

Then run the stuff as this:

java -cp MANDELBROT.jar:SwingWorker.jar -jar MANDELBROT.jar
Once upon a time Mandelbrot fractals where fashionable. I remember programming them a long time ago, and I also remember how slow to compute they were. I thought that math would be a nice thing to do in a SwingWorker. The fact is that I can navigate the Mandelbrot fractal (and zoom and pan it) quite fast in my current computer (a Pentium IV)!!. Things have improved a lot since then!!

The examples

By building this simple demo I've seen some do's and don'ts with SwingWorker. I'll post on this later this week.

Keep swinging,
Antonio

UPDATE:
The correct command line is
java -cp swing-worker.jar:MANDELBROT.jar org.jdesktop.swingworker.demos.mandelbrot.MandelbrotViewController

Comentarios:

Great App ! It remind me a rainy afternoon 16 or 17 years ago when, after a class math, I implemented a drawing algorithm for Mandelbroot as well. At that time it was in BASIC on my 8088 PC (maybe a 286 ?) It took several hours to display the graph. And I did not implement the zooming facility :-) Now on my dual G5 it's less than a second. I don't even have the time to read the text. Should be nice to include a timer indicating the time needed to compute the graph Thanks for having shared your code

Enviado por Sebastien Stormacq en agosto 11, 2005 a las 12:36 PM CEST #

Yes!! I used to see it in scales of green!!

Of course, if you have a dual core CPU then things are faster, because usually the computing Thread is executed in a CPU while the rendering one is executed in the other CPU.

Regarding the timer suggestion, thanks!! I think it's a very good idea. The stuff is too fast to be seen. It's not good usability to show/hide stuff in a GUI so quickly. It's an improvement for the next release ;-).

Enviado por Antonio en agosto 12, 2005 a las 01:13 PM CEST #

Enviar un comentario:
Los comentarios han sido deshabilitados.
About

swinger

Search

Archives
« abril 2014
lunmarmiéjueviesábdom
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Hoy