Java Champion Stephen Chin on New Features and Functionality in JavaFX

   
By Janice J. Heiss  
Published February 2011

Articles Index

Photo of Stephen Chin
Stephen Chin
 

Downloads:
Download: Java FX

This series of interviews spotlights Java Champions individuals who have received special recognition from Java developers across industry, academia, Java User Groups (JUGs), and the larger community.

Bio: Java Champion Stephen Chin is Chief Agile Methodologist for GXS, a company that has for 20 years been in the supply chain and EDI (Electronic Data Interchange) marketplace. In his spare time, he works on various JavaFX projects, such as JFXtras, a collection of utilities, add-ons, and samples for the JavaFX language, Piccolo2D, a Zooming User Interface (ZUI) library for Java., and Visage, a DSL for building UIs based on JavaFX Script. Chin, along with James Weaver, Weiqi Gao, and Dean Iverson, is the author of Pro JavaFX 2 Platform: A Definitive Guide to Script, Desktop, and Mobile RIA with Java Technology.

As one of the most prolific and innovative JavaFX developers Chin gave two technical and a Birds of a Feather sessions at the 2010 JavaOne conference. His previous presentation at the 2009 JavaOne Conference qualified him for “Java Rock Star” status as one of the highest rated sessions at the Conference. We caught up with him to get an update on the rapidly developing changes in JavaFX.

Q: Tell us about your 2010 JavaOne sessions.

A: Jonathan Giles and I demonstrated how to leverage alternative languages such as JRuby, Groovy, Clojure, and Scala to build JavaFX 2.0 applications. It was a fun talk to prepare for, and the audience reaction was great. In the weeks following we have received lots of great feedback on the different language implementations, and have refined the talk for subsequent sessions. For the second talk, Jim Weaver and I provided the 2010 version of our enterprise JavaFX talk. We were able to extensively discuss enterprise JavaFX development as well as distill the new JavaFX 2.0 information down to something that makes sense to developers. We also added some examples of what the new JavaFX APIs could look like from Scala code.

The JFXtras BOF was extremely popular with standing room only. Dean Iverson and I talked about some of the new JFXtras components and features the team has been working on, and announced a new UI domain-specific language called Visage based on the JavaFX Script compiler codebase.

Q: Some were surprised by JavaOne announcements about JavaFX. What is your reaction?

A: Overall, I think the announcements show some very positive momentum for the future of JavaFX and rich client Java, but, of course there were some casualties. JavaFX Script, which was good to us, is not part of the future, but many of the promised improvements in JavaFX 2.0 are connected to language features of JavaFX Script such as binding and sequences, so hopefully they can maintain some of the benefits. JavaFX Mobile has not seen a lot of action since JavaOne 2009 and the mobile focus in the keynote was on Java ME and LWUIT.

 
"There is a lot to be excited about -- JavaFX has a new API face. All the JavaFX 2.0 APIs will be exposed via Java classes that will make it much easier to integrate Java server and client code."
 
Stephen Chin
Java Champion

There is a lot to be excited about -- JavaFX has a new API face. All the JavaFX 2.0 APIs will be exposed via Java classes that will make it much easier to integrate Java server and client code. This also opens up some huge possibilities for JVM language integration with JavaFX that Jonathan Giles and I explored in our JavaOne session.

Thomas Kurian announced a strategy to open source the JavaFX controls going forward. This is a huge move in the right direction for the platform that will improve life for us third-party control developers.

Oracle has published a proposed 2011 JavaFX 2.0 roadmap that includes some terrific things, many of which I have been campaigning for, like Multithreading Improvements, Texture Paint Grid Layout Container + CSS, HD Media, HTML5, WebView Controls, File and other Dialogs.

Visage

Q: Tell us about Visage, the new language project created to fill the gap left by JavaFX Script.

 
"Visage takes over where JavaFX Script left off, providing a statically typed declarative language with lots of features to make UI development a pleasure."
 
Stephen Chin
Java Champion

A: It’s a domain-specific language for writing user interfaces, which addresses the needs of UI developers. Visage takes over where JavaFX Script left off, providing a statically typed, declarative language with lots of features to make UI development a pleasure.

My favorite language features from Visage are the object literal syntax for quickly building scene graphs and the bind keyword for connecting your UI to the backend model. However, the language is built for UI development from the top down, including subtle details like null-safe dereferencing for exception-less code.

We have been adding a bunch of new features to Visage to make it even better. The first two that are available via a preview release are default properties and null-checked dereferences. Default properties lets you leave off the property tag where a default has been defined. For example, there is no reason to specify content on Groups and Containers when that is the most used child property.

Null-checked dereferences are the opposite of the Groovy Elvis operator. They are done with an exclamation mark preceding the dot (e.g., “variable!.property”), and will force the dereference to throw an NPE if the operand is null.

All of this work is being done in open source on top of the GPL’ed JavaFX Script compiler base, and we are looking for volunteers to help with the JavaFX 2.0 integration.

New Functionality in JavaFX 1.3

Q: Looking back a little, tell us about the functionality in JavaFX 1.3.

A: JavaFX 1.3 was a much bigger release behind the scenes than most people realized. The visible API changes, such as new controls, improved layouts, and the new TV emulator, were just the tip of the iceberg. The real value was in the behind-the-scenes changes, such as the compiler rewrite, new scene graph implementation (Prism), and enhanced CSS support. These dramatic improvements in the platform allow existing applications to run faster and more reliably, and they pave the way for dramatic new capabilities in future releases.

Apropos -- The Agile Product Portfolio Scheduler

Q: In May, you unveiled a new JavaFX tool called “Apropos” that you use for Product Portfolio Planning. What should developers know about it and where is it going?

A: Apropos, which stands for Agile Product Portfolio Scheduler, is designed to help companies doing large-scale Agile development with product planning across the entire organization. The Apropos concepts, such as the Product Portfolio Kanban, which I co-presented on at the Lean Software and Systems conference, are on the bleeding edge of Agile practices. The tool is built using the very latest JavaFX and JFXtras features, from dynamic charts to a flexible data grid. Apropos has received enough interest that Rally Software, one of the largest Agile Lifecycle Tool vendors in the industry, has decided to base their Roadmap Planning Tool on it. They unveiled a Rally-branded version of Apropos called Stratus at the Agile 2010 conference.

Q: What excites you about the future of JavaFX?

A: I am excited to see what the JavaFX core team will come up with for the JavaFX 2.0 release. They have a huge opportunity to restart and correct some mistakes made in earlier JavaFX releases. It should also be accessible to a much wider audience now that you can code with pure Java APIs (or as Jonathan and I have shown, just about any JVM language).

Pro JavaFX Platform

Q: You are a co-author, along with Jim Weaver, Weiqi Gao, and Dean Iverson, of a book titled Pro JavaFX 2 Platform: A Definitive Guide to Script, Desktop, and Mobile RIA with Java Technology. I understand you are writing a sequel -- tell us about it.

A: Pro JavaFX Platform was a lot of fun to write, and it has received a lot of positive feedback from both readers and JavaFX gurus. The goal of the sequel will be to completely revamp the content, taking advantage of the latest JavaFX technology advances to teach and demonstrate the platform’s potential. We plan to publish this in tandem with the next major JavaFX release.

Piccolo2D – A Zooming User Interface Library

Q: Tell us about Piccolo2D.

A: Piccolo2D is an open-source project supported by the original Piccolo team from the University of Maryland. The project began when several users of the Piccolo framework spoke with the team in Maryland and said, “You have this great technology, but you’re not actively developing it. Can we help you guys out by opening it up to the larger community and then help to make fixes and improvements to keep the project going?”

Most people probably do not know that Piccolo was actually used as the underlying scene graph in the original interpreted version of JavaFX. Piccolo is a two-dimensional scene graph that’s particularly well-suited for creating panning and zooming user interfaces, similar to what we see in Google Maps. Sometimes, you’ll have controls which kind of stick to the lens, such as the zoom bar, or maybe you’ll have some widgets that allow you to switch traffic on and off.

There are lots of applications for technology like this, such as visualizing graphs and creating presentation software, where you can have smooth transitions and navigate complex photo libraries.

There’s actually photo navigation software called Photo Mesa, created by folks from the Piccolo Project, and it’s a completely zooming-driven photo organizer for your computer. I did most of the work on Piccolo2D before starting on JavaFX. I’ve been noticeably absent from the project since I’ve been busy working on JavaFX.

See Also

Stephen Chin’s Blog
Silicon Valley JavaFX Users Group
JavaFX
Java.Net
Visage
Java Champions
Java Rock Stars
Piccolo2D