I just found an interesting article about Javascript Canvas that brought me to the actual implementation and I got an idea it would be cool to extend Echo with this ability. It would be cool to have a component, that will have a plain AWT style Graphics and its methods are converted into <canvas> element and associated JavaScript.
Has anyone thought about the same thing ? Isn't there an existing component doing this ?
Yes, this would be very cool indeed. No, I don't believe an existing Echo2
component exists already. The Echo2ChartDisplay widget is a wrapper around
the the JFreeChart library, if that is what you might be thinking of. This primarily
renders bar, line, and pie charts, not arbitrary elements.
Also, any AWT drawing library could be used to render into image and
sent to the browser. Still, no interactivity in that approach.
Here are a couple of candidate libraries that do cross-platform drawing:
http://www.openjacob.org/draw2d.html
which is a high level library over the following:
http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm
http://dojotoolkit.org/ (see dojo.gfx)