Stuart Axon
2009-08-24 11:36:35 UTC
Hi
I wanted to see if there were differences between cairo + python and cairo + java.
[bottom line: there is :)]
If they weren't very different I was thinking of trying the java bindings via jython to get shoebot in the browser working...
Differences included:
Imports come from
org.gnome.gtk
not
gtk
event handling is also different (using Event objects, which native cairo does not).
I also briefly looked at IronPython and noted the same sort of differences.
In future ctypes is coming to both Jython and Ironpython, meaning that you could do something connect to native cairo from Jython in a java applet.
For now, the other options people have mentioned are probably the easiest for getting things working in a browser:
Jython + Java2D backend
or connect to canvas somehow.
A possible idea for a backend could be a Processing backend via jython, but I suspect we'd be opening a whole different can of worms there :)
If anyone knows how easy it is to make alternate graphical backends then I'm definitely interested, however I don't have any knowledge of Java2D so far.
Notes on porting javacairo to pythoncairo are here:
[http://www.stuartaxon.com/2009/08/21/using-java2python-to-port-a-javacairo-tutorial/]
Best Regards
Stuart
I wanted to see if there were differences between cairo + python and cairo + java.
[bottom line: there is :)]
If they weren't very different I was thinking of trying the java bindings via jython to get shoebot in the browser working...
Differences included:
Imports come from
org.gnome.gtk
not
gtk
event handling is also different (using Event objects, which native cairo does not).
I also briefly looked at IronPython and noted the same sort of differences.
In future ctypes is coming to both Jython and Ironpython, meaning that you could do something connect to native cairo from Jython in a java applet.
For now, the other options people have mentioned are probably the easiest for getting things working in a browser:
Jython + Java2D backend
or connect to canvas somehow.
A possible idea for a backend could be a Processing backend via jython, but I suspect we'd be opening a whole different can of worms there :)
If anyone knows how easy it is to make alternate graphical backends then I'm definitely interested, however I don't have any knowledge of Java2D so far.
Notes on porting javacairo to pythoncairo are here:
[http://www.stuartaxon.com/2009/08/21/using-java2python-to-port-a-javacairo-tutorial/]
Best Regards
Stuart