December 13th, 2007
One of the many interesting talks I attended at the JavaPolis 2007 conference was the Swinging RIA talk. At the end of the talk Chet Haase announced the brand new Java Scene Graph library. Scene Graph gives you a new way to implement your visual output in Swing. It will replace the Jazz library that provides the Java2D stuff in the current JavaFX implementation. In the current release, the API is a little bit verbose but I expect this to change as the API is not final yet.

How does Scene Graph work? With Scene Graph, instead of subclassing a Swing component and providing your Java2D drawing instructions in a custom paint() method, you build up a data structure that declares your visual output, i.e old Java2D is the procedural approach to do graphics, whereas Scene Graph is the declarative approach.
How does this look in practice? In Scene Graph you amazingly build up a scene graph! Each scene graph is composed of nodes and each node represents a graphics operation, e.g.
- Painting a primitive
- Performing an effect
- Doing a transformation
- Playing an animation
So, for painting text, instead of
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g.create();
g2.setFont(new Font("Arial", Font.BOLD, 128));
g2.setRenderingHint(KEY_TEXT_ANTIALIASING, VALUE_TEXT_ANTIALIAS_ON);
g2.drawString("Java2D", 50, 150);
g2.dispose();
}
you will have
SGText result = new SGText();
result.setText("Scene");
result.setFont(new Font("Arial", Font.BOLD, 128));
result.setAntialiasingHint(VALUE_TEXT_ANTIALIAS_ON);
result.setLocation(new Point(50, 180));
My impression is that a programmer familiar with Java2D is immediately productive with the Scene Graph library. Great! And as a bonus he gets good effect and animation support for free! Wow! I hope this is just a first step to:
- Powerful effect libraries
- Good animation libraries
- Visual scene graph tools
- Integrations into existing visual tools like PhotoShop
- …
Another thing that makes building good-looking Swing applications easy! Good!
No Comments » |
JavaFX, Javapolis, Rich Internet Applications, Swing |
Permalink
Posted by Daniel
December 13th, 2007
This morning, I attended the second keynote at JavaPolis 2007 in Antwerp. Although it was not the “big” keynote (that one was held by James Gosling the day before), it was definitely the more interesting one to me. This is why:
First, the Java community was hit by two extremely cool Flex demonstrations: at the beginning, Bruce Eckel and his co-speakers showed a Flex-based data manager framework that allows transparent and smooth synchronization of client-side and server-side business data, even between multiple clients and with clustered server nodes. Data changed on one client gets synchronized to the server (for example: to all cluster nodes) and then back to all connected clients. Not only does it allow the application to determine the “transaction commit point”, but it also provides support for conflict handling (again, the conflict reconciliation handling can be fully controlled by the application). Whenever a client goes offline, data changes are locally tracked and synched back to the server as soon as the connection is re-established. Failed cluster nodes get updated as soon as they rejoin the cluster. In addition, the data manager can also be used with Ajax applications. Although the demo application looked quite “ugly” (for a Flex demo …), the technical brilliance led to spontaneous applause …
The second rocking Flex demo was Parleys.com beta: well-know for slick and smooth video and slide show streaming, Parleys.com is about to get a face-up. Well it’s more like a revolution. While it was based on Ajax in version 1.0, the new technology chosen is Flex. Of course, the visual effects are extremely slick and appealing. But what is way more interesting to me from a RIA point of view is the integration of the online, browser-based version with an offline Parleys.com client application based on AIR. When both clients are running, the browser-based one automatically gets enhanced by features available in the offline client - such as offline video availability - by smoothly adding new buttons and actions to the online client. That really rocks from a user experience and integration point of view! The new Parleys.com version is about to be released in Q1/2008.
But there is a fight-back from the Java side: also worth mentioning here is the Java approach of browser-based RIA that was demonstrated in the IRIS sample application. First showed to the public at the last JavaOne, this application does not stand behind the Flex-based ones in any way when it comes to visual effects. The IRIS approach smoothly integrates Java applets with an ajaxified Web application. It was almost impossible to say what feature was powered by the applet and what was done using Ajax - and what was done by tightly combining these two technologies even for a single user interaction. The revival of the applets!
To me, all these demos really show to me that RIA is still steadily increasing in importance. There is way more than just adding a few fancy Ajax effects to static web page - and the big vendors and technology owners are pushing the car forward. And the desktop is really moving back into the RIA world - it is no longer all about pure (and old) browser technologies, but about JNLP, applets, AIR & Co.
But there was also another unexpected “flasher” in that keynote: JavaME. JavaME? Isn’t it dead? No, it’s not! Sun showed up with the new Netbeans Mobility 6.0 that extremely simplifies the development of JavaME-based games. But not only games, also business applications are finally showing up in the JavaME space (and are supported in a graphical way by the mobility tool). Using the SVG-rendering facility available in the MSA (Mobile Service Architecture), these UIs now can really look awesome (forget these old and ugly “text-based” mobile UIs …). And by adding JavaFX Mobile to the scene, Sun is pushing the Java mobile stack even further. As with Google’s Android, Sun aims to provide a complete software stack based on a Linux kernel that offers Java-based APIs to all phone capabilities which are then used by all the device vendors, third party RIA software service providers and the community to develop new-class mobile RIA applications. It will be very interesting to see whether Sun or Google (or both?) will make the deal with their approach. In the end, I think the device vendors are going to decide this battle: every cool software platform is only worth noting if there are a big bunch of devices available that ship the software by default.
A few resources:
All this mobile stuff now really seems to shake a leg. Very exciting!
1 Comment |
AJAX, Adobe AIR, Adobe Flex, General, Java, JavaFX, Javapolis, Rich Internet Applications |
Permalink
Posted by Christian