FX Experience Has Gone Read-Only

I've been maintaining FX Experience for a really long time now, and I love hearing from people who enjoy my weekly links roundup. One thing I've noticed recently is that maintaining two sites (FX Experience and JonathanGiles.net) takes more time than ideal, and splits the audience up. Therefore, FX Experience will become read-only for new blog posts, but weekly posts will continue to be published on JonathanGiles.net. If you follow @FXExperience on Twitter, I suggest you also follow @JonathanGiles. This is not the end - just a consolidation of my online presence to make my life a little easier!

tl;dr: Follow me on Twitter and check for the latest news on JonathanGiles.net.

Top 10 Changes in JavaFX 1.3

A few weeks ago we started assembling our own Top 10 change list for JavaFX 1.3. Stephen posted an excellent list of his own. Here’s our take! Over the next several weeks we will be writing about each of these topics in greater detail and link them back to this page. So without futher ado…

10. Amble Font
We’ve added some standard fonts to JavaFX which are available to all devices: desktop, mobile and tv. What this means to you is a single consistent set of fonts which look consistent on all platforms. Happiness all around!

09. Multiline Text Input
Finally(!!), JavaFX 1.3 brings support for multiline text input to the venerable TextBox. TextBox already worked for single-line single-style text input, and in 1.3 we added the ability for the TextBox to also support multiple lines of text!

08. ChoiceBox
One of the most hotly asked for new Controls was a ComboBox. ChoiceBox is a close cousin (and in our experience is used more frequently). The ChoiceBox is essentially a non-editable ComboBox. You can put any kind of data item in the ChoiceBox and let the user choose an item.

07. Layout Enhancements
A lot of work went into enhancing and simplifying the layout system in JavaFX 1.3. The majority of porting issues you will face going from 1.2 to 1.3 will be in the area of layout. It is faster, simpler, and ready for business.

06. Preview Controls
In 1.3 we have added a number of preview controls. Please try them out! They absolutely will change when they become final controls (including moving from the com.javafx.preview package in which they live), but we wanted to get them out as soon as possible so you can have a play and provide input into their continued development. In 1.3 the main preview controls are Menus (MenuItem, PopupMenu, MenuBar, etc) and TreeView. Try them out!

05. Custom List Cells
In JavaFX 1.2 we released a very lightweight ListView Control. It barely made the 1.2 release at all. In 1.3 we’ve extended it to support completely customizable cells. One of my major regrets was that ListView is still single selection in 1.3 (bummer). That being said, the ListView’s cell virtualization absolutely rocks.

04. Lazy Scenegraph
We’ve made the scenegraph lazier! What this means for you is much better performance. “Bind storms” have been eliminated from all bounds related aspects of the scenegraph, so now we don’t compute bounds unless you ask for them. We’ve seen major improvements in applications which once were limited by such bind storms.

03. JavaFX Compiler Rewrite
The JavaFX Compiler team has done it again! The JavaFX Compiler has seen some major improvements in this release, both in the type of code being generated and how those changes effect applications. The semantics of “bind” have been better defined, and all binding is now “lazy” to help quell bind storms (lazy binding means that a value is not recomputed when its inputs have changed, only when it is asked for a new value). We sometimes refer to this as “compiled bind” because in previous releases bindings were essentially interpreted whereas in 1.3 the compiler generates more bytecode for each binding which gives hotspot more to work with and, critically, reduces the dynamic footprint of a Node by 6-10x!

02. CSS
The biggest feature for the JavaFX UI Controls team in the 1.3 release is without a doubt the CSS support that was reengineered from the ground up, extended, and improved. It is also now available on all three platforms — desktop, mobile, and tv. We’re really excited about this support as it gives developers and designers much more freedom in how to style controls and really makes some very common use cases much, much simpler.

01. TV
Finally, in JavaFX 1.3 we have added an emulator for TV which allows you to develop JavaFX applications for the TV or TV set top boxes. This is the FX Experience #1 top change for JavaFX 1.3 as it completes the promise of having a platform targeting all three screens (desktop, mobile, tv). The TV implementation is based on the new prism 3D accelerated pipeline. We’re very excited to see where this leads and to put more heat into this and our other platforms in future releases.

If you haven’t yet, download JavaFX 1.3!

Seeking: Awesome JavaFX developer to join our team

So, my team at Sun has an opening for a guru in rich-text user interface controls. This is a big project and it’s getting a huge push. As detailed in the job spec:

This is a software staff engineering position requiring the ability to design, test, implement and maintain rich-text user interface controls. The person in this role is expected to identify areas for improvement and modification of Sun’s platform products and contribute to Sun’s overall product strategy. This person will work closely with others within the team and across teams to accomplish project objectives. May assume a leadership role in projects, including such activities as leading projects, participator in product planning and technology evaluation and related activities. May use technical leadership and influence to negotiate product design features or applications, both internally, and with open source groups as needed.

We really want to get this position filled now, so if you are keen, or know someone that is keen – apply! Working in the JavaFX team, and of course in particular the team I’m in, is a great deal of fun, and you get to work with people who really are smart and enthused about what they’re doing. You’ll learn a lot, and get to really sink your teeth into a growing technology and platform. Of course, the thrill of seeing your code used around the world is a pretty cool thing too.

So, if you have what we need, apply today, and I look forward to working with you!

Encapsulation Idiom in JavaFX

One of the gratifying things about being involved in building a new platform on top of a new language is discovering new language idioms. As an industry we’d managed to put together quite a long list of patterns and best practices for Java, but since JavaFX introduces some new concepts (such as object literal notation) and makes other things really easy to do (binding, closures) it creates an environment where we need to discover the best practices and patterns that make for effective programming in JavaFX.

One such idiom has to do with encapsulation. I was presented with the following problem in a recent email. The developer wanted to create a chunk of scenegraph which looked differently depending on some flag. There would be 10 such flags with 10 such chunks of scenegraph. (more…)

Vancouver Olympics Chooses JavaFX

Vancouver Olympics Chooses JavaFX

Some really great news I’ve had to keep under my hat for the past few months is that the Vancouver Olympics website has chosen JavaFX for a really cool visualization. It is an exceptionally well done application with stunning UI and does a terrific job showing off the potential of JavaFX in data visualization scenarios.

Vancouver Olympics JavaFX Application

Vancouver Olympics JavaFX Application

Go and check out the application running live. It has data going back many years showing how many metals were won by different countries over time, which athletes won which metals, and so on. It is built and delivered on the publicly shipping release of JavaFX. Really exciting for JavaFX!

That Infernal Scenegraph Warning Message: Part Deux

Stuart Marks has written up part II of the three-part series on the scenegraph warning message that you have seen in JavaFX1.2. I covered and linked to the first version previously. It really is a terrific read, and details some of the subtle semantics of bind. Stuart always does such an excellent job describing these subtle issues.

In my earlier post on this topic I hinted that we had found a resolution to the issue surrounding the warning message, I hinted further in some of my replies to comments, and I even left it as sort of a cliffhanger as to what the resolution was. So, here’s the resolution.

We’ve decided that when a node is added to a group, that node is automatically removed from the group that previously owned it, if any. (Let’s call this the “auto-remove” feature.) We’ve also decided to turn off the warning message by default, but to have it be enabled optionally, possibly via a system property, for debugging purposes. Finally, we’ve relaxed the enforcement of some scene graph invariants in cases where the group’s content sequence is bound.

During the development of our current release, we kept running into this issue. A couple of us wrote code that we thought was reasonable, yet it surprised us when the warning message came out! We had a few hallway conversations from time to time, but a clear-cut answer never emerged. Finally, we realized that we had to get the interested parties in a room and have a knock-down, drag-out meeting to resolve the issue. And so on October 7, 2009, Amy Fowler, Kevin Rushforth, Richard Bair, and I got into a conference room to decide the issue. Three hours later — with no breaks! — we had decided. Actually, it was a great meeting, without a lot of conflict. There were just a lot of issues to cover. Each of us came into the meeting with our initial opinions, but the issues were so close that I think each one of us switched sides at least once during the meeting.