20 March 2010

Internal JavaFX Activity

Since many months have passed with the release of JavaFX 1.2, and some coverage on JavaFX 1.3 (SoMa) it is time to see what is currently happening with JavaFX. With this post I will mainly cover what is currently happening with SoMa.

Do note that any information in this post is subject to change and may not be entirely accurate. Also I have made the best educated guess possible considering what little information is released officially, and from the JavaFX Issues database despite many issues not being made publicly available. Some information has already been covered in some of my previous posts, and on other blogs.


Once again there are not much changes to see since much of this area has already been covered in some of my previous posts. To get the best picture listed below is the list of controls that will be included in SoMa (this is from a Devoxx presentation on JavaFX 1.3):

All the listed controls that have an appended asterisk are the new controls in SoMa. One may have noticed that the total number of built-in controls for JavaFX will double when SoMa is released. I have not taken into account the possibility that the unstable controls may triple the number when combined with the stable ones. The Separator control is a new addition to the SoMa controls line up.

What is currently unknown is what unstable controls will appear in SoMa. At present unstable controls could be placed in the com.javafx.preview.control package, which would make it easy to separate the unstable controls from the stable ones. This also means software developers can try out future controls sooner rather than waiting for the next JavaFX release. After all JavaFX's release policy is about regular releases with the chance for software developers to try out early access features, that help shape future releases involving the entire community.


Currently the biggest changes to the JavaFX API are with the upcoming TV support. One of the key API changes is the addition of TV keyboard and remote control support. CSS support will be widened to include additional CSS properties. Any class/mixin that is a Group will be able to automatically resize Resizable nodes to their preferred size during a layout pass. For performance metrics there is going to a PerformanceTracker API that can be used for both the Prism and Swing graphics rendering systems.

Other possible API changes are layout root functionality through unmanaged Parent nodes, use of third party native libraries with JavaFX Script, and a preview of drag n drop support.


If this is correct a beta version of SoMa has been released recently (as of 23rd Feb 2010) although it is not available publicly, and SoMa is in a feature freeze. Such news is good to hear considering the length of time it is taking to develop SoMa. Hopefully SoMa will not be released around the time of JavaOne in September, which shouldn't be the case provided there are no other major delays.

At the moment if things keeping chugging along at a reasonable pace with the development of SoMa (with the end in sight) there will be no need to think of this as another case of Duke Nukem Forever. Definition - an announced product that despite all reassurances that it is still alive and kicking ends up being cancelled in the end (takes forever to be released).

Prism appears to be a major inclusion in SoMa despite the impression that it wouldn't be included in time. Additional information has come to light about Prism with the fact that unlike Swing/Decora (the current rendering system) graphics rendering will be done through OpenGL for Desktop, and OpenGL ES for Mobile. Yet to be confirmed is if Prism will take advantage of the GPU for the graphics rendering instead of the CPU, and what Prism's relationship with Newt is.

With tooling it appears as though the JavaFX Authoring Tool will be available for Linux, and Prism will be utilised in the Authoring Tool. Currently there is a review going on with the redistribution of the JavaFX runtime. If the result of the review is favourable then this could mean standalone JavaFX applications can be done, as well as having the JavaFX runtime distributed with some of the major Linux distributions (eg Ubuntu).


Based on the current activity for JavaFX it is certainly moving forward. Nothing has been mentioned so far on what is happening with JavaFX Script and the mobile side of JavaFX. It is great to see that Prism is going to be included and that there will be a chance to try out preview controls early.

Now Oracle needs to reveal what is currently happening with JavaFX Mobile. This will become urgent since other major RIA players (Silverlight, Flash/Flex) have been making announcements about support for various mobile platforms. How is Oracle responding to this with JavaFX Mobile? What other mobile platforms (Android, Symbian, Blackberry) are going to be supported with JavaFX Mobile?

16 March 2010

Scripting In JavaFX Script

Scripting is all about direct/accessible programming that can be used to quickly create small to medium sized programs. When it comes to scripting it does not always mean a dynamic programming language has to be involved. Static languages like Scala can be treated as though they do provide programming in a scripting like way.

A static programming language could be used instead provided there is a program that can behave like an interpreter to handle the source files. Also the programming language must not impose any structural conditions (eg a class must be defined in the source file first) in order for a program to work. In the case of JavaFX Script one can include statements straight away in a fx file without having to define a class first, hence the script part of the name.

There is a class in the JavaFX API that can handle basic scripting in a limited way, which would act as a reasonable starting base for a basic JavaFX Script interpreter. The FXEvaluator class allows JavaFX Script source to be evaluated provided javafxc.jar is in the application's classpath. It should be noted however that the source is evaluated by FXEvaluator without any specified context. Therefore any state created created during the evaluation of the source cannot be used by other scripts.

Should JavaFX become fully open sourced, and have its own interpreter (to compliment the compiler) then it could have its own unique place with the major Linux distributions. Imagine JavaFX being bundled with future versions of Ubuntu for instance. JavaFX Script could secure its place in Linux by providing scripting for creating basic GUI applications since, the GUI support is built in, easy to create a GUI application with very few lines of code, and the programming language is very easy to pick up.

Currently no other scripting languages that are bundled with the major Linux distributions allow GUI applications to be easily created since they are designed to create console applications, hence the creation of GUI applications is an afterthought (done through extensions – eg libraries). Linux needs its own GUI scripting language, not one where GUI support is an afterthought. This could be a golden opportunity for JavaFX to significantly increase its rate of adoption, and have other people involved with improving the technology.

08 March 2010

JavaFX Composer Overview (Update)

Since the preview 2 release many changes have been made to JavaFX Composer. The majority of the changes are with the Data Source templates.

Changes Made

  • More properties exposed in the Properties window
  • Shapes, colours, effects are now available in the Palette window
  • HTTP Data Source now handles the HTTP Post method
  • JDBC Data Source now supports setting up CRUD instead of just reading from a DB table
  • When setting up animations one can now use an inherited state animation
  • Standard attribute names used for extracting data for each data source (in Data Source Customiser)
  • File Data Source now supports loading files from additional sources (local FS, resource from class path, storage using the Storage API)
  • Analyser added to identify design problems with a form

Improvements Needed

  • Remove irritating requirement to have an object selected first (in design pane) before having it moved, rotated, bring up an accompanying context menu etc
  • Display chart(s) in real time inside the design pane
  • When an event handler's name is renamed some refactoring needs to occur on every property that is affected by the change
  • Still there is no ability to add custom controls/nodes to the palette (absolutely essential)
  • Allow shapes to be visually resized/rotated/skewed inside the design pane
  • Display animations for affected objects inside the design pane (eg an animation preview like OO Impress)
  • Display all visual objects inside the design pane in real time based on their set properties
  • Provide facilities for easily creating custom controls (visual and non visual) in a visual way (eg wizards, templates in palette, design pane setup for designing a custom control)

In general the biggest improvement that needs to be made in the JavaFX Composer is to allow custom controls/nodes to be incorporated. Since JavaFX is designed to allow custom front ends to be developed why prevent people from using 3rd party content (eg controls, graphics)?

JavaFX composer doesn't stop custom graphics from being incorporated so why should custom controls be any different? After all JavaFX already has a standard system for developing custom controls (using MVC – Model/View/Controller), so it should be possible to use custom controls.

01 March 2010

JavaFX Mobile

Currently JavaFX Mobile is only available on Windows Mobile devices (ones that run Windows Mobile 6 or later). Although this was a reasonable start for JavaFX on the mobile side initially its biggest competitor (Flash) has made a bit of a head start. Flash is now being supported on a few major mobile platforms (Blackberry, Android, Windows Mobile). Mobile development is an area that JavaFX can excel in provided JavaFX is supported on a wide number of mobile platforms and devices.

What are Oracle's plans for JavaFX Mobile? What new capabilities are going to be added to JavaFX Mobile? No mention has been made by Oracle on when JavaFX Mobile tooling will be made available on Linux (eg emulators, libs). This is important if JavaFX is going to be supported on Android mobile devices. At JavaOne 2008 some JavaFX applications were demoed on an Android device.

So far nothing has been mentioned since on JavaFX support for Android. What is the current status on the JavaFX Mobile runtime for Android? If it is anything like the Java runtime for Windows Mobile (codenamed Captain America) it will eventually be released to the public, hopefully.

Oracle will need to announce significant plans for JavaFX Mobile that will keep its marketing on track, by making deals that will see JavaFX supported on more major mobile platforms. Without making JavaFX available on a wide range of devices Oracle is breaking JavaFX's marketing statement, “JavaFX enables developers and content creators to quickly develop interactive applications that can easily be deployed across the widest variety of client devices - from mobile devices to desktops, to next generation television devices”.

It may be necessary for Oracle to develop and support multiple JavaFX Mobile runtimes (in house) in order to accelerate the deployment of JavaFX on mobile devices. Oracle needs to put its actions, and money where its mouth is in order for JavaFX to excel in the mobile area.