Hi,

I found a thread on the eclipse developers' list

http://dev.eclipse.org/mhonarc/lists/eclipse-dev/msg08814.html

where Greg talks about switching Pivot from Java2D to SWT. As someone with experience with Java2D and SWT from building Swing and Eclipse apps, respectively, I think this is a bad idea. Here's why.

First, Java2D is built-in to the JRE. SWT adds another dependency, and it's a biggie. On my installation of Eclipse, the Cocoa SWT jar file is 1.9 megabytes.

Second, can SWT applets be built?  I don't know...

Third, Java2D drawing can be transparently accelerated with Direct3D or OpenGL (to the best of my knowledge, this is not enabled by default to maintain pixel-accurate backwards and cross-platform compatibility).

Fourth, Java2D offers the VolatileImage, which is an image buffer that can be backed by video RAM.

Fifth, Java2D offers subpixel drawing. All of the drawing operations and graphics primitives of the SWT GC class are defined with int parameters. Java2D offers subpixel float and double specifications for drawing and rectangles, etc.

Finally, a migration means that any custom component skins or anything that uses Graphics2D will need to be ported, and if the SWT drawing API doesn't support a Java2D feature that Joe User used, he's not going to be a happy camper.

I'm curious to hear other views on this matter. Who wants to stick with Java2D? Who wants to switch to SWT? Who wants ice cream?

Cheers,

Michael

Reply via email to