Wednesday, October 5, 2011

JavaOne 2011: Introduction to the JavaFX Scene Builder

After grabbing lunch from the Mason Street Cafe, I headed to Hotel Nikko's Nikko Ballroom III to attend "Introduction to the JavaFX Scene Builder" by Eric Le Ponner and Jean-Francois Denise (both of Oracle). I was a little surprised that this decently attended presentation wasn't much more full given the announcements this week that Java Swing will see no further enhancements and that the to-be-open-sourced-and-standardized JavaFX is the Java client of choice for the future. Attendees were only sitting in the front half of the room and there were plenty of empty seats between those present in in that front half. There may have been fifty of sixty attendees.

Poller initiated the presentation with descriptive information about he and his co-presenter. He then went into JavaFX Scene Builder's goals and benefits. JavaFX Scene Builder has multiple goals: "help designers and developers build JavaFX-based user interfaces", put "JavaFX 2.0 in action," and help developers "explore and learn about JavaFX objects." "Key Benefits" of the JavaFX Scene Builder are closely related to the goals and include "simple and intuitive interface" that "makes the tool productive even for non-programmers."

Denise spoke about new features of JavaFX 2.0. He mentioned the FXML format (not to be confused another FXML) and likened it to Adobe's MXML and Microsoft's XAML (and I note like OpenLaszlo's LZX). FXML is generated by serializing Java Objects as XML text. A JavaFX 2.0 application can be written either "fully coded in Java" or "partly coded in Java." The latter (partially coded in Java) is accomplished by using Java for logic and FXML for the scene graph.

As one would expect from a typical presentation on a GUI builder, much of this presentation focused on demonstration of JavaFX Scene Builder. The dragging and dropping of GUI elements or "widgets" was not particularly new or exciting (although it's nice to have available for JavaFX development), but I was more interested in seeing the generated FXML. Incidentally, Oracle provides an Introduction to FXML document for learning FXML.

In Denise's first demonstration of using the tool, he used JavaFX Scene Builder to design the Scene Graph and then used the IDE for almost everything else. The basic gist of this approach is that one uses JavaFX Scene Builder to generate FXML and then that generated FXML is accessed and used from a Java IDE such as NetBeans.

Poller showed a different demonstration. His demonstration showed off more fine-grained control of CSS presentation style. The good news is the ability to use standard CSS style syntax to specify JavaFX element appearance and to even specify by hand CSS syntax when necessary. The only negative I saw was that there was still some typing involved rather than relying on name completion when typing style information into a text field. Poller showed the CSS code generated and it looked like CSS one would write directly. He even created a rectangle with rounded corners (the "Holy Grail" of HTML/CSS presentation) as part of this demonstration. The reflection effect was also impressive and was all done graphically. The demonstration also involved setting values of opacity and that effect was also pleasing.

In a different demonstration, Poller showed how easy it was to graphically rotate an element. He then showed the ability to anchor multiple copies of the same object in different ways and how the anchor is maintained when the image is made larger. It was much more easily done than one would do by hand to specify this appearance control.

Poller gave us some task-aways. JavaFX Scene Builder supports "simple drag and drop positiiong of GUI elements," it is a "graphical FXML editor, it supports "strong mapping of JavaFX 2.0 APIs," supports setting and previewing "JavaFX properties and effects," and supports "CSS setting and previewing."

There were some great questions and comments in the Q&A section, which the presenters left appropriate time for. One attendee expressed exactly what I was thinking: the earlier JavaFX Scene Builder is released the better as it should save lots of time developing scene graphs. Another attendee asked a question I was wondering myself, "Will JavaFX Scene Builder be standalone only or would it be an IDE plugin?" The answer is that JavaFX Scene Builder is a standalone application, but it will have nice integration with NetBeans. Another attendee asked if JavaFX Scene Builder would be expanded to fully cover JavaFX and if custom components would be supported. It sounds like plans are to fully cover JavaFX presentation capabilities in JavaFX Scene Builder and there is a possibility of support for custom components in the future.

An attendee commented that the JavaFX books available for sale on site at the conference are all for JavaFX 1.2. He asked if there were enough differences between JavaFX 1.2 and JavaFX 2.0 to make it not worth it to purchase the JavaFX 1.2 books. The answer was clear: wait and buy a book on JavaFX 2.0 because the changes are significant and much of the JavaFX 1.2 stuff is "deprecated."

As was stated earlier this week, Oracle will be very soon issuing a private release of JavaFX Scene Builder followed by a public release anticipated for early 2012. I can hardly wait to get my hands on the JavaFX Scene Builder and start playing with it.