Category Archives: JavaFX

JavaFX: Canvas/Nashorn Demo of the Week #2

Demo #2 – Star Field

This is the second example in a weekly series of demos of using JavaFX Canvas and Nashorn.

(I suspect you did not arrive here from a link in “JavaFX Links of the Week”!).

For this demo, I chose a classic “star field” animation where a field of stars moves directly at the camera, using the correct perspective, velocity and dimensions.  I even added a nice galaxy image in the background that fades in and out.

Again, the Nashorn script is amazingly simple.

Here is a short video of the demo in action:

As you can see, the frame rate (FPS) is, once again, fairly impressive and I can assure you this runs father smoother than in any browser I tried with their “native” HTML5 Canvas/JavaScript implementation.

The full source for this demo (including the Nashorn script, the images and sample BAT file) can be downloaded using this link: Star Field Demo (ZIP)

The Nashorn code is shown here for convenience:

/*
* This code is covered by the Bembrick Open World License (BOWL).
*
* This means this code is completely free of any restrictions on usage.
*
* Feel free to study it, modify it, redistribute it and even claim it as
* your own if you like!
*
* Courtesy of Bembrick Software Labs in the interest of promoting JavaFX.
*/

var Random               = Java.type("java.util.Random");
var File                 = Java.type("java.io.File");
var Image                = Java.type("javafx.scene.image.Image");
var Color                = Java.type("javafx.scene.paint.Color");
var Canvas               = Java.type("javafx.scene.canvas.Canvas");
var Border               = Java.type("javafx.scene.layout.Border");
var BorderStroke         = Java.type("javafx.scene.layout.BorderStroke");
var BorderStrokeStyle    = Java.type("javafx.scene.layout.BorderStrokeStyle");
var BorderWidths         = Java.type("javafx.scene.layout.BorderWidths");
var BorderPane           = Java.type("javafx.scene.layout.BorderPane");
var CornerRadii          = Java.type("javafx.scene.layout.CornerRadii");
var StackPane            = Java.type("javafx.scene.layout.StackPane");
var Scene                = Java.type("javafx.scene.Scene");
var Font                 = Java.type("javafx.scene.text.Font");
var FontSmoothingType    = Java.type("javafx.scene.text.FontSmoothingType");
var Text                 = Java.type("javafx.scene.text.Text");
var AnimationTimer       = Java.type("javafx.animation.AnimationTimer");
var PerformanceTracker   = Java.type("com.sun.javafx.perf.PerformanceTracker");
var AnimationTimerExtend = Java.extend(AnimationTimer);

var TITLE_STAGE = "Star Field by Bembrick Software Labs (JavaFX Canvas/Nashorn)";

var WIDTH = 1280;
var HEIGHT = 720;
var STAR_COUNT = 1000;
var radius = 1;

var centerX;
var centerY;

var stars = [];
var star;
var i;

var CANVAS = new Canvas(WIDTH, HEIGHT);
var BORDER_CANVAS = new Border(new BorderStroke(Color.BLACK, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(4)));
var focalLength = WIDTH;
var RAND = new Random(42);
var FONT = new Font("Sans Serif", 24);
var LABEL_FPS = new Text();
var IMAGE_BACKGROUND = new Image(fileToURL("background.jpg"));

var lastTime = 0;
var lastFpsUpdate = { time: 0, value: 0 };
var fps = 60;
var alpha = 0.0;
var delta = 0.0003;

initializeStars();

function randomLightRGB() {
return RAND.nextInt(255 - 175) + 175;
}

function randomLightColor() {
return Color.rgb(randomLightRGB(), randomLightRGB(), randomLightRGB());
}

function initializeStars(){
centerX = CANVAS.width / 2;
centerY = CANVAS.height / 2;

stars = [];
for (i = 0; i < STAR_COUNT; i++) {
star = {
x: Math.random() * CANVAS.width,
y: Math.random() * CANVAS.height,
z: Math.random() * CANVAS.width,
c: randomLightColor()
};
stars.push(star);
}
}

function moveStars(){
for (i = 0; i < STAR_COUNT; i++) {
star = stars[i];
star.z--;

if (star.z <= 0) {
star.z = CANVAS.width;
}
}
}

function drawStars() {
var pixelX, pixelY, pixelRadius;
var c = CANVAS.graphicsContext2D;

c.setFill(Color.BLACK);
c.fillRect(0,0, CANVAS.width, CANVAS.height);
c.setGlobalAlpha(alpha);
if (alpha > 0.8) {
delta = -0.0003;
} else if (alpha < 0.2) {
delta = 0.0003;
}
alpha += delta;
c.drawImage(IMAGE_BACKGROUND, 0, 0, CANVAS.width, CANVAS.height);
c.setGlobalAlpha(1.0);

for (i = 0; i < STAR_COUNT; i++) {
star = stars[i];
c.setFill(star.c);

pixelX = (star.x - centerX) * (focalLength / star.z);
pixelX += centerX;
pixelY = (star.y - centerY) * (focalLength / star.z);
pixelY += centerY;
pixelRadius = radius * (focalLength / star.z) * 1.5;

c.fillOval(pixelX, pixelY, pixelRadius, pixelRadius);
}
}

function renderFrame() {
moveStars();
drawStars();
}

function calculateFPS(now) {
var diff = now - lastTime;
var fps = 1000000000 / diff;

if (diff > 1500000) {
LABEL_FPS.setText("Frame Rate: " + Math.floor(tracker.getAverageFPS() + 0.5) + " FPS");
}

lastTime = now;

return fps;
}

function animate(now) {
fps = calculateFPS(now);

renderFrame();
}

var timer = new AnimationTimerExtend() {
handle: function handle(now) {
animate(now);
}
};

function fileToURL(file) {
return new File(file).toURI().toURL().toExternalForm();
}

var stack = new StackPane();
var pane = new BorderPane();
pane.setCenter(CANVAS);
pane.setBorder(BORDER_CANVAS);

LABEL_FPS.setManaged(false);
LABEL_FPS.setFont(FONT);
LABEL_FPS.setFontSmoothingType(FontSmoothingType.LCD);
LABEL_FPS.setFill(Color.AQUAMARINE);
LABEL_FPS.setX(20);
LABEL_FPS.setY(42);

stack.getChildren().add(pane);
stack.getChildren().add(LABEL_FPS);

$STAGE.scene = new Scene(stack);
$STAGE.title = TITLE_STAGE;
$STAGE.resizable = false;

var tracker = PerformanceTracker.getSceneTracker($STAGE.scene);

timer.start();

The command line to use to run the Nashorn script is:

jjs -fx -Djavafx.animation.fullspeed=true -scripting star-field.js

(but you may have to either fully specify the path to the jjs command which is located in your JRE bin folder or add it to your system path, use an alias etc.)

I hope to be able to post a new example every week and please use the Comments section below if you have any questions or comments to make in general.

Just my 2 bits,

Felix

JavaFX: Introducing FXMark – benchmarking & feature testing tool

FXMark_logo-500

Background

I actually forget how long it has been since I first announced that FXMark was being developed and that its release was “imminent”.

But it was certainly a long, long time ago…

Unfortunately, a number of personal and external issues basically “got in the way” of  FXMark being completed and released.

Fortunately though, on July 1, 2016, FXMark was finally released along with the launch of our business and website http://bembrick.com.au as a whole.

The blog containing details of the launch and releases is here.

What is FXMark?

We believe that FXMark is “The ultimate JavaFX benchmarking & feature testing tool!”

And, it’s FREE!

The question many people need answered is “What is JavaFX capable of?” and now FXMark can provide those answers.

There are no really good demos available that showcase the JavaFX scene graph features and performance with various combinations of types and numbers of nodes, effects, transitions and caching options.  This makes it a case of “trial and error” requiring lots of coding and testing to establish whether the features you want will actually perform to your expectations on certain platforms.

With FXMark, the developer can “try out” every possible capability of the scene graph & Canvas before they even begin coding their application which ensures they don’t waste time and effort building something that simply won’t run well on the desired platforms.

The demo video for FXMark is here:

Running FXMark

The archive which you download contains an example BAT file for running FXMark on Windows which simply executes the required command and can easily be adapted for use on other operating systems.

Basically, the command line needed to run FXMark is:

java -Djavafx.animation.fullspeed=true -jar fxmark-1.0.2.jar

(Please ensure to specify the correct filename/version of the JAR)

You may need to fully-qualify the path to the java.exe on your platform if the java command is not part of the OS command path or setup as an alias etc. The system property to set animations to “full speed” is required to effectively measure frame rates as without this property, JavaFX will cap the frame rate to 60 FPS.

I would suggest adding the following to your command line if performance is slow as the output will indicate whether hardware acceleration or software emulation is being used:

java -Dprism.verbose=true -Djavafx.animation.fullspeed=true -jar fxmark-1.0.0.jar

Note: JavaFX 8 (and therefore Java 8) is required to run FXMark.

FXMark Configuration

There are several ways of configuring FXMark as described here.

FXMark ships with a “standard” configuration file named fxmark-config.properties. This file initially has all system properties which are used for configuration set to their default values by specifying the key word $default.

The system properties are described below and can be specified on the command line to override the property values defined in the configuration file (if necessary). When specifying the properties on the command line (using the -D option), the prefix “fmark.” must be added such as “-Dfxmark.logging.file.mode=unique”.

Property Description Allowed Values Default Value
config.file.name Specifies the name of the configuration file to use. Use a fully qualified path name to specify a file that is not within the same directory as the FXMark JAR file. Otherwise, just specify the name of the file. Any valid path & file name fxmark-config.properties
logging.file.mode Specifies the logging mode where append means append to an existing file, overwrite means create a new file or overwrite an existing one and unique means that a unique file name will be created each time FXMark is run that includes a date stamp. append, overwrite, unique append
logging.level Specifies the logging level . The allowed values are ordered in terms of severity, meaning that specifying any particular value will cause all logging message at that severity level and above to be logged.

Of the allowed values, debug means debugging messages, config means messages related to congfiguration changes, warning means warning messages (not severe) and error means serious error messages.

debug, config, info, warning, error config
logging.console Specifies whether to log messages to the console. true, false true
logging.html Specifies whether to log messages to an HTML file. true, false true
logging.html.file Specifies the name of the HTML log file to use. Use a fully qualified path name to specify a file that is not within the same directory as the FXMark JAR file. Otherwise, just specify the name of the file. Any valid path & HTML file name fxmark-log.html
logging.text Specifies whether to log messages to a text file. true, false true
logging.text.file Specifies the name of the text log file to use. Use a fully qualified path name to specify a file that is not within the same directory as the FXMark JAR file. Otherwise, just specify the name of the file. Any valid path & text file name fxmark-log.txt
logging.stack.trace Specifies whether to log a stack trace along with error messages. true, false true

The Future: FXMark Pro

We are currently working on a greatly enhanced and commercial version of FXMark (named FXMark Pro) although a FREE version of standard FXMark will always be available.

New features planned for the Pro version include:

  1. FXMark Index (A general overall performance rating – the higher the better)
  2. Automated Mode (Able to run without user interaction)
  3. Configurable Test Suites (Repeatable tests to highlight particular features)
  4. Integration into your Build Pipeline
  5. Parsable Logs (Such as XML format)
  6. 3D Features Testing Mode (In addition to Scenegraph and Canvas modes)
  7. Custom Nashorn Scripts (To enable you to test your own Canvas animations)
  8. Possible JMH Integration
  9. Deterministic or Non-Deterministic Modes (Enables “consistent random” behaviour)

FXMark Pro Feature Breakdown

1. FXMark Index

The very name FXMark is derived from and pays homage to the classic 3D benchmarking tool named 3DMark. And, just like 3DMark, FXMark Pro will introduce its own concept of an “Index”.

The  will be a number that indicates the overall performance of JavaFX using the specified version of Java on the particular machine on which it is being run. The higher the index, the better the overall performance. It will be determined by FXMark running a series of tests of all aspects of JavaFX performance and using an algorithm to convert results of those test into an “index”.

While this index will be of interest & use to everyone, probably the most valuable use the FXMark Index is for OpenJFX developers to both identify & attempt to resolve performance regressions immediately after they have made a change to the project. Simply determine the FXMark Index prior to the change, compare it to the one after the change and then use the extensive logging output to commence issue resolution.

2. Automated Mode

With FXMark Pro, it will be possible to run the application in a completely “automated” manner by specifying a system property on the command line.

When running in automated mode, FXMark Pro will run a series of configured tests or test suites as discussed in point (3).

3. Configurable Test Suites

With FXMark Pro, it will be possible to define and configure individual tests or entire suites of tests where each test specification specifies the mode (Scenegraph, Canvas, 3D) , number of nodes, transitions, effects, caching hint, font smoothing type, velocity, number of particles and duration etc.

A test suite will be a specification for a sequence of individual tests to be run. In fact, the  FXMark Index itself will be just be one of those test suites (albeit a “standard” one).  You can define your own “index” test suite if you like.

When and which tests or test suites get run can be either selected at run-time when FXMark is run in standard “interactive” mode or by specifying them in the configuration file or on the command line when running in “automated” mode.

4. Integration into your Build Pipeline

It is hoped that it will be possible for FXMark Pro to be integrated into your build pipeline (such as by using Gradle/Maven etc.) in automated mode and in such a way that tests can be run (such as the FXMark Index) and the build “failed” if certain performance criteria are not met.

5. Parsable Logs

This new feature should greatly assist in analysing the logging output from FXMark Pro and when combined with the configurable test suites and the FXMark Index, being able to identify the causes of performance regressions and resolve them will be greatly enhanced.

FXMark can already produce text and HTML logs, but XML and/or JSON format logs are far more “parsable” and it is planned to provide both these logging formats in FXMark Pro.

It is also planned to log much more information other than FPS for example; basically anything that JavaFX will allow us to measure *will* be measured!

6. 3D Features Testing Mode

FXMark currently provides means to test the JavaFX Scenegraph and Canvas node but FXMark Pro will add a further option to configure and test all the 3D features of JavaFX.

7. Custom Nashorn Scripts

Nashorn is the new JavaScript engine included in Java 8 that is written in Java and runs on the JVM. Thanks to some very clever engineers, the performance of Nashorn is surprisingly good and certainly significantly faster than Rhino.

With FXMark Pro, the developer will be able to use their own Nashorn scripts to drive (at least) Canvas node animations and perhaps Scenegraph or 3D animations as well.

A Nashorn Script Editor will also be included.

This will enable the developer to test out their scripts and “fiddle” with them and immediately see the results in action and gauge their performance.

8. Possible JMH Integration

We are looking at the possibility of integrating  and JMH (“Java Microbenchmarking Harness”) to enable a far greater detailed level of testing and then enable the developer to utilise the standard artifacts from JMH with other tools etc.

9. Deterministic or Non-Deterministic Modes

FXMark Pro will introduce another configuration option for “deterministic” or “non-deterministic” random number generation modes.

This is important because all FXMark animations are driven by random numbers to determine node stroke colours/widths, dimensions, transition durations, effect parameters etc.

With “deterministic” mode, it is guaranteed that the exact same sequence of random numbers will be used for the same tests so that being able to truly repeat tests is achievable and the significance and validity of the FXMark Index or any test is improved.

With “non-deterministic” mode, a different sequence of random numbers will be used each time FXMark is run (which can be useful to test variety).

How much will FXMark Pro cost?

We estimate that the cost of a single license for FXMark Pro will be around $99.95.

BUT, if you purchase an FXMark Maintenance Subscription right now, you will get the first release of FXMark Pro absolutely FREE!

This annual subscription provides you with unlimited PRIORITY support for FXMark for 12 months which means that any support request will be responded to within 1 business day. Without this subscription, support requests will be responded to in the order in which they are received and may be anywhere from 1-4 business days.

We are planning to release FXMark Pro in the next 6-9 months so taking out this maintenance subscription NOW is excellent value!

Summary

Visit our website at http://bembrick.com.au/fxmark for all the details about this new product. Also visit the Online Store at http://bembrick.com.au/store to purchase a maintenance subscription.

The latest release of FXMark is available here.

Just my 2 bits,

Felix

JavaFX: Canvas/Nashorn Demo of the Week #1

Demo #1 – Parallax Trees

I have previously posted an example of using JavaFX Canvas and Nashorn and believe that these two technologies make for an awesome combination because it enables the developer to very easily adapt any web-based Canvas demo or animation to run with JavaFX.

Given this, I have decided to do exactly that and every week.  I hope these posts prove useful for JavaFX/Java developers just starting out with either Nashorn or the Canvas node itself.

For this demo, I chose a nice (and amazingly simple) demo of the “parallax effect” where two sets of trees, one of which is “near” to the camera and the other which is further into the distance, along with the very distant sky and a very close line of tall grass, all appear to be moving at different speeds as observed by someone driving by in a car for example.

It only took me about 20 minutes to completely convert the original HTML5 Canvas & JavaScript into this JavaFX Canvas & Nashorn version (which is one of the things that makes Nashorn so incredibly useful).

Here is a short video of the demo in action:

 

As you can see, the frame rate (FPS) is fairly impressive and I can assure you this runs father smoother than in any browser I tried with their “native” HTML5 Canvas/JavaScript implementation.

The full source for this demo (including the Nashorn script, the images and sample BAT file) can be downloaded using this link: Parallax Trees Demo (ZIP)

The Nashorn code is shown here for convenience:

/*
* This code is covered by the Bembrick Open World License (BOWL).
*
* This means this code is completely free of any restrictions on usage.
*
* Feel free to study it, modify it, redistribute it and even claim it as
* your own if you like!
*
* Courtesy of Bembrick Software Labs in the interest of promoting JavaFX.
*/

var File                 = Java.type("java.io.File");
var Image                = Java.type("javafx.scene.image.Image");
var Color                = Java.type("javafx.scene.paint.Color");
var Canvas               = Java.type("javafx.scene.canvas.Canvas");
var Border               = Java.type("javafx.scene.layout.Border");
var BorderStroke         = Java.type("javafx.scene.layout.BorderStroke");
var BorderStrokeStyle    = Java.type("javafx.scene.layout.BorderStrokeStyle");
var BorderWidths         = Java.type("javafx.scene.layout.BorderWidths");
var BorderPane           = Java.type("javafx.scene.layout.BorderPane");
var CornerRadii          = Java.type("javafx.scene.layout.CornerRadii");
var StackPane            = Java.type("javafx.scene.layout.StackPane");
var Scene                = Java.type("javafx.scene.Scene");
var Font                 = Java.type("javafx.scene.text.Font");
var FontSmoothingType    = Java.type("javafx.scene.text.FontSmoothingType");
var Text                 = Java.type("javafx.scene.text.Text");
var AnimationTimer       = Java.type("javafx.animation.AnimationTimer");
var PerformanceTracker   = Java.type("com.sun.javafx.perf.PerformanceTracker");
var AnimationTimerExtend = Java.extend(AnimationTimer);

var TITLE_STAGE = "Parallax Trees by Bembrick Software Labs (JavaFX Canvas/Nashorn)";

var WIDTH = 1000;
var HEIGHT = 440;
var VELOCITY_FAR_TREE = 10;
var VELOCITY_NEAR_TREE = 25;
var VELOCITY_SKY = 8;
var VELOCITY_GRASS = 75;
var IMAGE_TREE_NEAR = new Image(fileToURL("tree-near.png"));
var IMAGE_TREE_FAR = new Image(fileToURL("tree-far.png"));
var IMAGE_TREE_GRASS_1 = new Image(fileToURL("grass-1.png"));
var IMAGE_TREE_GRASS_2 = new Image(fileToURL("grass-2.png"));
var IMAGE_SKY = new Image(fileToURL("sky.png"));

var CANVAS = new Canvas(WIDTH, HEIGHT);
var BORDER_CANVAS = new Border(new BorderStroke(Color.DARKGREEN, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(4)));

var FONT = new Font("Sans Serif", 24);
var LABEL_FPS = new Text();

var lastTime = 0;
var lastFpsUpdate = { time: 0, value: 0 };
var skyOffset = 0;
var grassOffset = 0;
var treeFarOffset = 0;
var treeNearOffset = 0;
var fps = 60;

function renderFrame() {
var gc = CANVAS.graphicsContext2D;

gc.save();

skyOffset = skyOffset < CANVAS.width ? skyOffset + VELOCITY_SKY/fps : 0;
grassOffset = grassOffset < CANVAS.width ? grassOffset +  VELOCITY_GRASS/fps : 0;
treeFarOffset = treeFarOffset < CANVAS.width ? treeFarOffset + VELOCITY_FAR_TREE/fps : 0;
treeNearOffset = treeNearOffset < CANVAS.width ? treeNearOffset + VELOCITY_NEAR_TREE/fps : 0;

gc.save();
gc.translate(-skyOffset, 0);
gc.drawImage(IMAGE_SKY, 0, 0);
gc.drawImage(IMAGE_SKY, IMAGE_SKY.width - 2, 0);
gc.restore();

gc.save();
gc.translate(-treeFarOffset, 0);
gc.drawImage(IMAGE_TREE_FAR, 100, 240);
gc.drawImage(IMAGE_TREE_FAR, 1100, 240);
gc.drawImage(IMAGE_TREE_FAR, 400, 240);
gc.drawImage(IMAGE_TREE_FAR, 1400, 240);
gc.drawImage(IMAGE_TREE_FAR, 700, 240);
gc.drawImage(IMAGE_TREE_FAR, 1700, 240);
gc.restore();

gc.save();
gc.translate(-treeNearOffset, 0);
gc.drawImage(IMAGE_TREE_NEAR, 250, 220);
gc.drawImage(IMAGE_TREE_NEAR, 1250, 220);
gc.drawImage(IMAGE_TREE_NEAR, 800, 220);
gc.drawImage(IMAGE_TREE_NEAR, 1800, 220);
gc.restore();

gc.save();
gc.translate(-grassOffset, 0);
gc.drawImage(IMAGE_TREE_GRASS_1, 0, CANVAS.height - IMAGE_TREE_GRASS_1.height);
gc.drawImage(IMAGE_TREE_GRASS_1, IMAGE_TREE_GRASS_1.width - 5, CANVAS.height - IMAGE_TREE_GRASS_1.height);
gc.drawImage(IMAGE_TREE_GRASS_2, 0, CANVAS.height - IMAGE_TREE_GRASS_2.height);
gc.drawImage(IMAGE_TREE_GRASS_2, IMAGE_TREE_GRASS_2.width, CANVAS.height - IMAGE_TREE_GRASS_2.height);
gc.restore();
}

function calculateFPS(now) {
var diff = now - lastTime;
var fps = 1000000000 / diff;

if (diff > 1500000) {
LABEL_FPS.setText("Frame Rate: " + Math.floor(tracker.getAverageFPS() + 0.5) + " FPS");
}

lastTime = now;

return fps;
}

function animate(now) {
fps = calculateFPS(now);

renderFrame();
}

function fileToURL(file) {
return new File(file).toURI().toURL().toExternalForm();
}

var timer = new AnimationTimerExtend() {
handle: function handle(now) {
animate(now);
}
};

var stack = new StackPane();
var pane = new BorderPane();
pane.setCenter(CANVAS);
pane.setBorder(BORDER_CANVAS);

LABEL_FPS.setManaged(false);
LABEL_FPS.setFont(FONT);
LABEL_FPS.setFontSmoothingType(FontSmoothingType.LCD);
LABEL_FPS.setX(20);
LABEL_FPS.setY(42);

stack.getChildren().add(pane);
stack.getChildren().add(LABEL_FPS);

$STAGE.scene = new Scene(stack);
$STAGE.title = TITLE_STAGE;
$STAGE.resizable = false;

var tracker = PerformanceTracker.getSceneTracker($STAGE.scene);

timer.start();

The command line to use to run the Nashorn script is:

jjs -fx -Djavafx.animation.fullspeed=true -scripting parallax-trees.js

(but you may have to either fully specify the path to the jjs command which is located in your JRE bin folder or add it to your system path, use an alias etc.)

I hope to be able to post a new example every week and please use the Comments section below if you have any questions or comments to make in general.

Just my 2 bits,

Felix

JavaFX: Bembrick Software Labs is here!

Bembrick_logo-400

 FINALLY – Bembrick Software Labs is now up and running and online at http://bembrick.com.au

 

This is a business totally focused on JavaFX.  Totally committed to JavaFX.  Absolutely passionate about JavaFX.  A business that will do everything it can to make JavaFX the best product in its category, continue to evolve and be viable for the next 50 years! (at least).

Here is our official Mission Statement:

“To assist in facilitating, evolving & maturing JavaFX into THE premiere toolkit for building graphical applications of ANY kind on ANY platform”

This “mission” IS achievable, we choose to accept it and it WILL be accomplished!

It will be accomplished because of the following reasons:

  • We have the most passionate & talented staff required to get the job done
  • The JavaFX community is incredibly vibrant & full of amazing people, all of whom are also extremely passionate & talented
  • There are businesses like Gluon who are doing outstanding things making JavaFX available everywhere
  • There are dozens and dozens of 3rd-party libraries/projects/products that enhance the utility of JavaFX
  • The entire JavaFX “ecosystem” is huge and growing every day
  • The OpenJFX project is alive and well and will soon be thriving
  • Oracle themselves are committed to JavaFX both politically and financially (despite what the public perception may be)
  • JavaFX is already a great toolkit, is Java-based (or any JVM language) and, now, has a brand new business working tirelessly to make it even better!

Bembrick Software Labs was officially launched on July 1, 2016.  We are starting with one product FXMark – the ultimate JavaFX benchmarking and feature testing tool.  It is free but a significantly enhanced and commercial version FXMark Pro will follow.  We have a large number of other JavaFX products, resources, training courses etc. in the pipeline (check the website for details).

Here are all the important links related to the launch of Bembrick Software Labs:

The official corporate website URL is bembrick.com.au

The official corporate launch video is here.  This launch is “intentionally unconventional”.  It is quite long but I really believe you will find it very entertaining and it not only introduces the business but also tells you everything you need to know about Australia (and has some hopefully amusing parts and serious parts where required!).

The demo video for FXMark is here.

You can download the latest version of FXMark here (or from the website).

So, this is a very proud moment for me.  And I sincerely hope that my team and I can contribute as much as possible to the entire JavaFX “ecosystem”.

We will certainly be doing our utmost.  What will you do?

Just my 2 bits

Felix

JavaFX: Call To ARMs!

(Pun intended)

Background

Ah, the enigma that is JavaFX.

So much promise, so many features, so many positive attributes and yet (apparently) so little success. And, such ambivalence, apathy and lack of support by its creators. Is there a greater software conundrum in the world today?

So, “what gives”? And more importantly, what needs to be done to solve this easy-to-define yet difficult-to-fix problem?

The initial release of something referred to as “JavaFX” was way back in 2008, although it bares little resemblance to the product of the same name that exists today. The first “authentic” JavaFX version was not until the second major release in 2011 but JavaFX seems to be one of the slowest evolving products in the history of software development, which correlates directly with its very slow uptake rate with the intention of eventually completely replacing the incumbent standard Java GUI toolkit, Swing.

Even right at this moment, there is no official release of JavaFX for any mobile or embedded platform and is only officially supported (by Oracle) on the 3 major desktop operating systems. In a world rapidly shifting away from large, clunky machines on everyone’s actual desktop to a world of mobile phones, tablets, embedded devices, the whole Internet Of Things (IoT) phenomenon and even wearable technologies, how could a veritable dinosaur like JavaFX possibly be a viable toolkit for modern software development where the desktop is very quickly becoming the least utilised and important hardware platform?

On the surface, it would be obvious to leap straight to the conclusion that JavaFX is already dead as a door-nail (or extinct) and that it should not even be laid down on the table of potential frameworks to consider using to develop your next application.

But, I for one personally believe that not only is JavaFX worthy of being on that table but also that it has the potential (given the correct alignment of the planets) to be the best of those options on said table in almost every case!

Have I totally lost my mind?  How could this possibly be even remotely possible?

Well, let’s take a closer, more thorough look at JavaFX and then you can decide for yourself…

The Slight Rise and Near Demise of JavaFX

So, for reasons not necessary to detail precisely here, not many people really took any serious notice of JavaFX until version 2.0.  The major reason was that it was then possible to write your JavaFX code in the world’s long-standing, most popular programming language Java, rather than some esoteric, totally new and unfamiliar language (JavaFX Script).

And, it comes as no surprise that this is when a huge spike in both interest and actual adoption occurred.  JavaFX was on the rise and showed much promise with it’s potential to write applications for all major platforms of that time with modern features like video, audio, animations, embedded HTML5 browser and, of course, hardware acceleration and, most significantly, a common code base written in Java.

Then, came integration of JavaFX into the standard Java run-time platform and JDK and lots of shiny new features in the version labelled JavaFX 8 to be in alignment with the same version number of the Java language itself. This is when we started to see a growing and, soon after, thriving JavaFX community and lots of tangible and often spectacular examples of real world applications appearing all over the place.

JavaFX had not only arrived but had now risen to the dizzy heights where a large number of companies world-wide started to seriously consider JavaFX as a very worthy candidate to use for both in-house and commercial applications and actually select it over its competitors with the simultaneous emergence of a vast array of third-party and largely open source frameworks, tools and applications and highly talented and enthusiastic individuals willing to freely champion the JavaFX cause and produce outstanding code samples etc.

Unfortunately, somewhat earlier than this, a massive paradigm shift had already commenced, namely the aforementioned shift towards mobile and smaller, lower-powered hardware devices, most notably Apple’s iPhone and iPad and an plethora of similar Android-based devices.

With JavaFX not being capable of running on any of these devices (which, as stated were now becoming the main focus of both software companies and business/home users as well), it suddenly appeared to be facing an imminent and sudden death-by-irrelevance.

The Further Decline of JavaFX & The Low Point

Tragically, this paradigm shift was not the only factor that was apparently about to bring on the total annihilation of JavaFX. Now, it had the almost impossibly heavy burden of gaining a reputation and massive spread of FUD that the very creators of JavaFX (Oracle themselves) were going to completely walk away from their progeny and leave it technically orphaned.

And these suspicions were based on some very real and valid red flags, most notably the abandonment of an official release for ARM devices, the cessation of releases of the GUI design tool for JavaFX named Scene Builder, the confirmation by Oracle that there were no plans to officially support mobile platforms, the “letting go” of several Java evangelists from Oracle (many of whom were amongst the JavaFX elite) and the apparent apathy and tight-lipped or vague statements from Oracle regarding their future plans for JavaFX (if any).

We were now at the Low Point of JavaFX. (Help me Obi-Wan, you’re my only hope!)

JavaFX is Dead. Long Live JavaFX!

Being at the Low Point is obviously the least likely place the highly enthusiastic JavaFX community wanted JavaFX to be. But being at the bottom does have it advantages: it means that you know things can’t get any worse, and, if something did change, the only direction for JavaFX from then on was UP!

And, just as the Phoenix rises from the ashes, their was something of a “divinish” intervention and suddenly the community morale lifted and JavaFX was suddenly on the rise once more!

The “intervention” I refer to was the sudden emergence of the company named Gluon, guided by the highly experienced and talented hands of Java Champion Johan Vos.

Now, while Johan and I are probably unlikely to be sharing a beer any time soon, I have to hand it to the guy – he gets things done and done FAST. Johan was already a “legend” amongst the broader Java community (that group of 9-10 million people) having been the main person responsible for getting the Java language itself to run on Linux platforms for the first time. Let me tell you, this would have been no mean feat! It is testimony to the undoubted extremely high level skills of the man.

And thus a saviour for JavaFX was born. But not on Christmas Day (presumably!).

So why do I use the word “saviour” here? Well, mainly because it’s highly appropriate.  Gluon took over further development of Scene Builder and quickly released an updated and much improved version, but most significantly, finally there was a commercial entity that was passionately dedicated to getting JavaFX to run on “modern” platforms such as iOS and Android. Throw in RoboVM who successfully AOT compiled Java byte codes to native Objective-C to facilitate Java running on iOS and others who contributed to the Android port, and we were now ready to take on the world!

Sure, this fulfilment of the full WORA principle is not quite there yet, but it is not that far away…

Where To From Here?

Where JavaFX and its community goes to from here on depends mostly on where they actually want to go.

I have the feeling that just being able to produce what are basically Swing-like forms based apps with a few nice modern features added on and to have a single code base that can spawn binaries for all the new and traditional platforms would be “enough” for many members of the community.

But not for me.  We must aim higher. Much, much higher.

My own personal goal for JavaFX is to facilitate it maturing and evolving into THE premiere toolkit for cross-platform graphical apps of ANY kind.

Sure, we are quite a long way from that situation right now, but I see absolutely NO reason why (again, with the planets all aligning themselves) that the combined efforts of the growing and highly motivated JavaFX community cannot make this outcome a reality.

Winning: How Do We Do It?

Well, achieving my own personal “winning” goal (which I believe should be the goal of the entire JavaFX community) has to start with a truly authentic and firm belief that this goal is reachable, and not in 10 years but within no more than 18 months to a maximum of 2 years.

If not, the proverbial ship would have long sailed off over the horizon…

So let’s do just that, even if it’s based exclusively on the basis that if someone can’t prove it’s impossible then it IS possible. And trust me, I REALLY do believe it is entirely possible and I personally will be doing everything I can to convert any “non-believers” into true believers.

(These may sound like the words of Billy Graham, and whilst its widely known I am of the Christian faith, this has absolutely nothing to do with religion, alchemy or “hocus pocus” of any kind whatsoever and is purely scientific and mathematical (i.e. probability) in its nature. Note: I am not suggesting that religion is a form of “hocus pocus” by any means).

Getting everyone “on the same page” may not actually be as difficult as it might first appear, largely because there has been another recent spike in all manner of highly sophisticated and modern looking real-world apps being released and developed in-house in companies all over the world.  The actual number is not officially available but I would wager it is far higher than what most people would expect, simply because much of the action is happening behind “corporate firewalls” so non-Oracle employees rarely get to even know of their existence.

Also, there are already many high profile and highly charismatic gurus/evangelists of JavaFX that let their actions do the talking.

If you don’t already do so, I strongly suggest you subscribe to Oracle employee, lead developer of official JavaFX controls and main author of the highly polished (external) controls library ControlsFX Jonathan Giles’ blog on http://fxexperience.com and his weekly post containing (usually) links to all the articles/announcements related to JavaFX from the preceding week each Monday.

Once we have taken this first baby step towards our end goal, the next step is to stimulate, encourage and nurture collaboration from as many developers as possible.  Well, this may even be an automatic progression from the first step, as once the confidence and belief in people becomes tangible, it’s only natural for many people to immediately and keenly want to get their hands dirty and dive right in with any spare time that they may have to contribute to OpenJFX and/or in releasing their own libraries/tools/frameworks etc. to ramp up the velocity a notch or two.

For anyone who does not automatically make this progression then it’s up to people like me and all the other JavaFX bloggers out there to pump out as much valuable & inspiring content as possible and as frequently as possible to the extent that the community is literally flooded with great code samples, demo apps, tips & tricks, solutions to common gotchas and even just words of positivity that they fall under the spell and become assimilated into The Collective where “resistance becomes futile”.

The Competition

It goes without saying that to be “number one” at anything, you have to be able to beat all competitors.

So exactly who or what are the competitors to JavaFX?

Well, while many may disagree, I firmly believe that (thankfully) there is only one true competitor and that’s the comprehensive & presently very successful C++ based graphics (and general) toolkit Qt. Unlike some, I have never and probably will never see the web technology stack of HTML5, CSS 3 and JavaScript as even a remotely a true competitor to JavaFX.  The two can and do co-exist peacefully, essentially because they mostly fill different niches. I have often said that “HTML5 is for building web sites, JavaFX is for building apps) and while the lines maybe somewhat blurred, I still believe these are fundamentally quite distinct concepts.

OK, so that we have identified out competitor, clearly we then need to get to know what they have that we don’t, what we can do better than they can do and any weaknesses they may have.

At the moment there are many things that Qt can do that JavaFX simply can’t even come close to.  For a start, the product is much more mature overall, much more feature-rich and also much more prevalent in the real world than JavaFX is.  The maturity & current lead in prevalence are largely irrelevant and clearly the main struggle will be to match the Qt feature set or even surpass it.

I would say that the biggest features that are in Qt but not in JavaFX and absolutely must be are:

  • Advanced 3D support via a 3D Canvas control
  • Support for WebGL (which they currently have both in their web view which is based on Blink rather than WebKit and also in the the 3D Canvas itself)
  • Better and more advanced support for mobile platforms
  • A web view that allows for true 3D graphics to enable not being restricted to supporting only limited versions of such key web technologies such as Google Maps
  • The capability to produce true high performance, sophisticated and graphics rich 2D & 3D games, scientific visualisations, animations etc.
  • An back-end-agnostic “maps” control that can be used outside the context of a browser
  • A GUI design tool in their Qt Creator IDE vastly superior to Scene Builder (currently)
  • Lots of 3rd party plug-ins or libraries for things like a true games and physics engines

Clearly there is some overlap there.  For example, simply switching to Blink as the basis of the JavaFX WebView or enabling hardware acceleration in the existing WebKit version would immediately buy us (for free) advanced 3D capabilities simply by supporting WebGL (which in turn is further supported by numerous JavaScript libraries that would also come for free).

But, it’s not the features of the Qt framework we have to address; the real key advantage that Qt has over JavaFX is the presence of The Qt Company which is a commercial entity that basically does nothing else other than developing, enhancing, supporting and providing other services of/for Qt. This is in stark contrast where we are now with JavaFX (More on that later).

Our Own Weaknesses

Obviously, another issue to address for beating your competitors is to identify and eradicate your own weaknesses.

I see the major weaknesses of the current JavaFX toolkit itself as:

  • Unexplained poor performance (possibly due to an inefficient rendering pipeline or heavy lifting that could be better done on the GPU happening on the CPU instead)
  • Poor/incomplete HTML5 compatibility in WebView
  • No real support for developing a full spectrum of applications, especially high performance games and 3D visualisations/animations etc.
  • A lack of easily integrated games or physics engines
  • Extremely rudimentary 3D support
  • Still not mature or fully viable support for mobile and embedded platforms

Our Own Strengths

Finally, to beat your competitors is to be aware of your own strengths and maximise their value to gain a tangible edge.

Thankfully, JavaFX has one very significant strength when compared to Qt and it is right under our noses: the Java language, platform & ecosystem themselves. Take it from someone who has done a fair amount of coding in both Java and C++, possibly the one issue on which Linus Torvalds and I see eye-to-eye is that C++ is a truly abhorrent programming language for so many reasons.

Sure, C++ has it’s niche and will be around forever but the tired old adage that C++ is better than Java because Java is soooo much slower has been addressed and dispelled years ago. Java’s performance has come along in leaps and bounds and is actually faster than C++ in certain circumstances owing to its ability to “adapt & improve” at run-time to the prevailing OS and hardware platform.

I think most people now don’t even both trying this ancient performance con to prove C++ is better than JavaFX because we have gone from the early days of Java where comments such as “It’s nowhere near as slow as Java” to “It’s not significantly slower than Java!”.

The real reasons why being able to code your application in Java is better than with C++ are:

  • Much better language design with OOP features not bolted-on to a pre-existing procedural language
  • WORA and the whole “cross platform compatibility” and “single code base” thing
  • Much more robustness due to the lack of pointers and large swathes of undefined behaviours in C++
  • Much greater productivity thanks mainly to automatic garbage collection but also due to more sophisticated IDEs and build pipeline tools
  • No need for multiple compilers, dialects etc. all of which are not totally compatible on different platforms (or even on the same platform)
  • Much cleaner and simpler language syntax than the almost impossible to ever fully understand or maximise utilisation of all features in C++
  • The plethora of mostly open-sourced, 3rd-party libraries available for just about every conceivable requirement

There’s really little need to go into any other strengths that JavaFX itself has as I believe it’s Java that is the most useful key to winning against Qt in the long run.  It really is a HUGE advantage.

The Impediments

What are the main impediments standing between us and achieving our goal?

Well, given that I am already not exactly Oracle’s favourite JavaFX personality (quite the opposite actually), I am not afraid to say what I think most people already realise anyway and that is that by far the biggest impediment is Oracle the company (and some of their staff).

For a start, Oracle has very, very clearly positioned themselves as a “cloud oriented” company now.  JavaFX has nothing to do with the cloud.  In fact, I would not be surprised if JavaFX is responsible for even a single dollar of revenue for Oracle each year. Also, the only product I am aware of that is either used by Oracle or is associated with Oracle that actually makes any use of JavaFX is JMC (Java Mission Control) as opposed to Java itself which is used extensively. One is certainly better than none! [Thanks to Marcus Hirt for this precious piece of information].

Nothing could make this any clearer than this relatively recent “word cloud” released by Oracle themselves:

unnamed

Can anyone actually even spot the word “Java”?  Obviously, just don’t bother looking for “JavaFX”. I often joke that Larry Ellison has probably never even heard of the word “JavaFX”:-)

One has to ask oneself, why would a so distinctly cloud focused company have any interest at all in JavaFX? Oracle are renowned for being one of the most profit focused corporations in the world, so I don’t even really understand why they maintain a (seemingly ever dwindling) team to develop JavaFX, each of whom must earn a fairly decent salary when they are not reaping any rewards financially or otherwise from the JavaFX product itself? You could be forgiven that being a worker on that team at the moment must feel something like a passenger on the Titanic, after it hit the iceberg.

And the other evidence already presented such as abandoning Scene Builder and official ARM support and the fact that I am struggling to see any major enhancements to JavaFX in Java/JavaFX 9 other than Jigsaw integration without doubt shows Oracle is only very slightly interested in JavaFX (at best) and that it is seemingly inevitable that ultimately (and maybe sooner rather than later) they will distance themselves from the whole product entirely.

But… on the flip side, this may turn out to actually be the best thing that could possibly ever happen to JavaFX.  After all, it amounts to removing the major impediment and puts the community in full control over the destiny of JavaFX.

My final word on Oracle is that whilst it’s true that overall the company is an impediment to the viability of JavaFX, I am absolutely certain that the developers past & present who have worked on the JavaFX team are some of the most outstandingly talented, dedicated and hard-working people you are ever likely to meet.  This is not about them.  They have not failed. They have done everything that they could possibly be expected to do and then some.  It must be a priority for the broader community to ensure we do not lose any more of these experts from the JavaFX ecosystem as they have the intimate knowledge down to the bare metal layers and this brains trust is vital to the success of JavaFX. I cannot stress this point enough and I would like to thank them all for the amazing work they have done and wish them everything of the best for the future.

The Strategy For Success

OK, so we have a lofty goal, a highly motivated and global collective of JavaFX & Java developers, we know who our competition is, we recognise our own weaknesses and capitalise on our strengths so how do we use all that to actually reach our goal in the shortest time possible?

Well I remember a saying from my childhood that my mother used to often quote that goes “Look after the pennies and the pounds will look after themselves”.  (This quote came from a time prior to 1966 when Australia adopted its own currency – the Aussie Dollar – over the old British Pound currency).

This saying seems to me to contain the key component of our winning strategy and that is that every individual must do their very best to contribute in some way and then the collective itself will just naturally improve and eventually succeed.

Some of the possibilities are:

  • Submitting bug reports to the broader OpenJDK project
  • Fixing bugs in said project (that relate to JavaFX of course)
  • Releasing your own JavaFX products or libraries
  • Starting a local JavaFX user group or Meetup in your town or city and then inviting JavaFX luminaries to speak and give presentations on particular topics
  • Spreading the word evangelist style that JavaFX is awesome and that everyone should jump on board the train
  • Inspiring your colleagues or employer to adopt JavaFX for their next project
  • Learning as much as you can about all the features of JavaFX and work up to becoming a “guru” who then passes on the knowledge to all your connections
  • Contributing to the work that Gluon are doing so well
  • Creating your own JavaFX blog and praise the heck out of it to everyone who subscribes
  • Attending JavaOne and any other Java or JavaFX related conferences globally and maybe even become a presenter

It would be helpful to have some kind of overall “coordinator” rather than a “leader” who manages and optimises the collaborative efforts. Which leads to my next chapter…

How Will Bembrick Software Labs Contribute?

Well, I guess I am the man to address this question:-)

Bembrick Software Labs is a small, agile start-up that I co-founded where I effectively function as Lead Developer as well as you could say CEO. But putting labels on my role(s) is not important. We are all essentially peers without the burden of a corporate hierarchy.

What is important is the various activities we are involved in and the ways we intend to contribute.

These include:

  • Building and releasing our own free and commercial products built with JavaFX
  • Providing top-notch support services to all our customers
  • Creating our own unique JavaFX training courses targeting multiple levels of expertise and providing them to the public or in-house within specific businesses
  • Providing JavaFX consultants and consultancy services for short-term contracts, problem resolution, assistance in getting started with JavaFX and cutting lots of code where required
  • Setting up a GitHub project to allow our JavaFX Feature/Platform Matrix (which will be known as FXMatrix) to be populated & maintained by the entire community instead of the original idea of hosting it as an Excel spreadsheet. Thanks to “Manuel” (sorry, I don’t know your surname) who suggested this brilliant idea in the Comments section in the original post at the link above
  • Updating this blog as often as possible with actual code samples, demos etc.
  • Enthusiastically promoting JavaFX to anyone who might be interested and/or be willing to get involved in some capacity
  • Offer to fulfil the role of “Coordinator” to oversee, manage and optimise the entire collaborative process

Conclusion

The number one priority is for all of us to get moving and moving as fast as possible, as soon as possible.

We have a goal which admittedly is setting a very high bar. But it’s all about believing in ourselves and each other and getting down and dirty.

I am not in this for financial gain as I am not and have never been motivated by money. What motivates me is helping others, creating something new even if it’s from nothing, solving the unsolvable problems, breaking new ground in technology and learning, learning, learning…

But, mostly my motivation right now is exactly as I said before, which I believe should be our official Mission Statement:

Facilitating, maturing and evolving JavaFX into THE premiere toolkit for cross-platform graphical apps of ANY kind.

IT IS ACHIEVABLE!

But… only if every one of us plays a role and contributes in some way.

How do you motivate yourself? Well, you could try to do what I do…

Every day visualise the day when the mission statement is fulfilled and you have played a role in producing the best product in its class in the entire world and you and everyone else actually benefits from your efforts. Be motivated by the desire to help other people and businesses achieve their own goals and not focus on yourself or purchasing your own private jet.

This is not to say you won’t be rewarded. The rewards may not be financial but they will be much, much better than anything money can buy.

Make it so. Number One, engage!

Just my 2 bits,

Felix

JavaFX: Time to Risk Everything

OK, so here I go…

We all have it – that “inner voice”.  It’s the part of your brain that pipes-up from time to time and tries to save your from making a costly mistake.

“Don’t do it Felix!  DON’T DO IT!” is what I am hearing now.  But being someone who is driven far more by emotion (heart) than logic (brain), (which may sound weird for someone whose job involves analysis and a reliance on logic), I am telling my inner voice to “shut up” and let the chips fall as they may.

This is a kind of “live or die” moment for me in respect to my place in the JavaFX community.  It’s “putting it all on the line” and Time to Risk Everything.

Why? What is so dramatic?

Well, a few weeks ago I posted in this blog here about an idea I had for a centralised reference document that specifies the current implementation status, performance and general notes regarding each major JavaFX feature on each of the currently supported platforms.

The motivation for such a document was two-fold:

  1. This information is currently very difficult or impossible to determine without trying each feature and platform yourself.
  2. The hope that such a document would make the lives of all JavaFX developers much, much easier and prevent them from wasting significant time/effort/money on trying to get certain features to work which may not even be implemented.

It was a proposal, even though I had already built, programmed and formatted an Excel spreadsheet and made it available via Dropbox for everyone to see.  The purpose of the initial post was to garner as much feedback as possible as to how it could be made better, who would find it useful and whether it was even a good idea in the first place.  I even followed it up with another post here a few days later in a desperate attempt to get developers to talk to me and share their thoughts and suggestions.

Well, nearly 3 weeks later, the grand total of comments I received in the Comments section below was…  wait for it… ZERO, NADA, ZILCH, NAUGHT!

Not a SINGLE comment!

However, I would like to recognise and thank the following people (in alphabetical order) for at least re-tweeting and/or liking the announcement I made on Twitter/Facebook and for some feedback and words of encouragement:

AOE Takashi
Alexander Casall
Carl Dea
Cesar Augusto Noguiera
Christopher Nahr
Hendrik Ebbers
Htet Myo Myint
Javier Godino
Jim Weaver
Jiri Pajzner
John Childress
Jovan Oilixua
Mani Sakar
Mark Heckler
Mike Tallent
Miroslav Kopecky
Peter Rogge
Richard Drexel
Sean Phillips

(If I omitted anyone, it was not intentional so sorry and thank you for helping me.)

So, if you’re keeping up, I don’t think I have actually said anything controversial or risky just yet. So let’s correct that now…

After creating the spreadsheet, I sent an email to 2 Oracle staff members (Kevin Rushforth who leads the JavaFX team and Jonathan Giles whose main claim to fame is his “JavaFX Links of the Week” post) as well as to Gluon co-founder and Java Champion Johan Vos.

Call me naive, stupid or just plain deluded, but I actually expected some feedback from all of them.

Well, yes, I did get some feedback… Johan sent a brief response indicating that he “intended to comment in the future” (but hasn’t) whilst I have still not heard anything at all from Kevin. The only real “feedback” came from Mr. Giles and what resulted was what I have to say is among the most offensive, disrespectful and hurtful conversations I have ever had with anyone.

So this is where I am putting my career on the line: publicly criticising  a staff member from the very company that inherited/enhanced and maintains JavaFX.  Many would refer to this as either a “career limiting move” or perhaps even a “career death notice” but I am going to keep going with my heart instead of my head…

Just for a bit of background, something about me is that I am completely independent of every other company and brand in the world, I have no financial or dependencies of any kind and am loyal only to myself, my business, my staff and my customers.  And…  I have a tendency to say what everyone is thinking but is too fearful (or wise) to say it themselves.  Also, I am extremely passionate about everything I get involved in (many say way too passionate), and, I NEVER GIVE UP!

It goes without saying that I am not expecting a job offer from Oracle any time soon and that a career in diplomacy is probably not in my future.  But if you want to hear from someone who tells it exactly as it is, adds no sugar coating or spin and is either fearless, brave or possibly deluded, then I am your man.

So what was it that Mr. Giles said that has me so fired up?

Well, for a start, nothing in what he said was positive.  Nothing.  And he did not include either of the two posts I made that week on the subject in his artwork “Links of the Week” post.  And, this is at least the 3rd time that posts I have made concerning JavaFX have magically been omitted from his masterpiece for highly questionable reasons.  Given that this weekly post is probably the most accessed resource for JavaFX developers world-wide to learn about new developments related to this technology, excluding my posts is not helping me and is certainly not helping the cause of JavaFX in general.

When I asked him why they were ignored this time, he “defended” himself (even though I was not attacking him) with several bizarre and downright insulting comments.

He basically threw the idea into the proverbial trash can on the basis of these 4 points of “criticism”:

  1. The document has “no value”.  Why?  Because it has no data in it.  (This point is significant as you will see later). He somehow seemed to miss the point that the post was to announce the idea of the document and seek feedback, not to make a production release of a completed resource.  I made it quite clear that I was not in a position to load with it “official” data but he described both posts as having “no value”.
  2. He indicated that he himself would not even download the spreadsheet because I had indicated it contained “some code” and therefore (seemingly in his mind) was a threat to international security.
  3. He stated that I was the only person who had ever complained about posting on JavaFX and then not having the post(s) appear in his weekly update.  To me, this is like saying that Ringo was the only member of The Beatles who was sometimes critcised for not being an exceptional percussionist (Hint: he was the only drummer in the band).
  4. He even complained that the (hundreds?) of hours he must devote each week to preparing his life’s work (i.e. said Links document) was not paid for by his employer and took him away from his family so basically I should not have the audacity to make any complaints about it given that he was being so incredibly “generous” with his time.

OK, so how did I respond?

Well it wouldn’t matter if it was the Queen of England, The Pope or even Ringo himself, I was not going to let anyone get away with such utter insulting, disrespectful and nonsensical comments.

Glossing over point (1) for the moment, on point (2) I challenged him to download the spreadsheet (if of course he could find the time in amongst all his charity work), disable macros and then go through all the code line-by-line. If he found anything other than innocuous code to keep cells in sync and load lists then by all means report me to the FBI.  I also pointed out that, being a Dropbox document, almost every modern browser would enable anyone to view the spreadsheet inside the browser where no macros would be run and that it therefore presented no security risk whatsoever.

I basically then pleaded with him to reconsider his perceived complete lack of worth of the posts or the document and to please include at least the original post in the following Links of the Week post.

Though I admit I probably would have experienced severe heart palpitations if he actually did include it, when he once again omitted both posts, I responded with the following email which addressed point (1) among others:

“Hi Jonathan,

Thanks for considering my request to re-evaluate my recent JavaFX posts in the hope that you would include them in this week’s Links of the Week.

Thank you for confirming that they were of “no value”.

Of course you are right… I mean a spreadsheet that has taken hours to design, program and format is clearly of “no value” when it contains no data.

I just have one question for you:

You work for Oracle whose flagship product is the Oracle DB. I have worked at companies where I know that they have had to fork out hundreds of thousands of dollars for Oracle DB Server licenses and other tools.

But… given that the DB is delivered to the customer initially devoid of any data, surely you should be giving away these licenses for free as, by your own definition, the Oracle DB itself is of “no value” without data in it.

Seems like something of a double standard or gross hypocrisy at the very least.

But, at least you have become an honorary member of the Avengers for saving the world by preventing me releasing my new killer virus via said spreadsheet that would have disabled the entire US power grid and disabled all their defense systems, leaving them open to annihilation from Russia, North Korea, Iran, ISIL etc.

Only I will ever know what a true hero you are Jonathan.

Felix”

Yes, for those that don’t recognise it, this is an example of sarcasm and satire which is a very common way for Aussies to converse with each other.  It is not meant to be offensive but rather said in the hope that the other party may think a bit more rationally about their actions.

He did not reply and I am not expecting a Christmas Card this year.

I found these comments particularly disturbing because they contained what seemed like thinly-veiled accusations that I would be so stupid and reckless to include malware in a public document that would end my career instantly, that I was basically just a “whinger” AND that I must have been expecting to make a whole heap of money from this.  Why else would I spend so many hours building it with no one funding it and when it took me away from my family for so long?  Of course, it could not possibly be just because I wanted to help others AND help JavaFX itself!

Surely Oracle employees should be encouraging and praising the efforts of members of the community who do such thankless tasks that have zero potential to earn them even a single dollar rather than basically trying to “vote them off the island”.

I honestly believe that a properly maintained document of this kind could be an extremely useful resource and of great utility value to all JavaFX developers.

So, now I have two choices: abandon the whole idea because no one who is privy to the data required could be bothered to enter it, or… do something that I bet Mr. Giles and co did not expect.

That’s right, I have decided that this will be a Bembrick Software Labs reference document and resource provided free of charge to anyone who wishes to either download the spreadsheet or simply view it in the browser.  I am not going to get down on my hands and knees and beg the likes of Mr. Giles to assist me, nor wait for someone “in the know” to type in a few lines of data.

Nope, what I am going to do is to populate and maintain the document myself.  Yes, that means that I personally will somehow have to get access to examples of all devices and platforms and write code to test each of the JavaFX features on each one and update the sheet whenever I find a change.  This will be a huge effort and will certainly not bring me any revenue whatsoever.

But who cares?  I don’t.  This document needs to exist and it needs to be maintained and if no one else (i.e. someone much more appropriate) is going to do it then it will be left to Felix to do the entire job.

All I ask is that you try to be patient as I write the required apps and acquire the required devices and run the tests etc. (which may take weeks) before passing judgement on the value of the document.  Then, I sincerely hope it saves you hours of time, avoiding trying to get non-existent features working and that it helps you architect your cross-platform solutions well before you have even written a single line of code.

Finally, please post a comment (positive or negative) if you have any thoughts or reactions to this post or this issue in general.

Just my 2 bits,

Felix

(Sounds of “The Last Post” can be heard in the background)…

 

JavaFX Feature Matrix: Bad Idea?

It’s been almost a week since I posted about a document that I had prepared that can be used to specify the implementation status, performance and general notes about major JavaFX features on all supported platforms.

I thought it was a good idea. In fact, it took me several hours to build the spreadsheet and, not being an Excel aficionado, it involved learning VBA and macros etc. so it was quite a bit of effort.

But… while several hundred people have viewed the actual blog post, I am somewhat dismayed that not one person provided any feedback by posting comments.  Not only that, but only a fraction of those who did access the post actually bothered to even take a look at the spreadsheet itself!

Just about the only “positive” reaction to the article was that quite a few people either liked or re-tweeted my Twitter tweet announcing this new resource.

Adding further insult to injury was that I emailed Kevin Rushforth from Oracle and Johan Vos from Gluon just to let them know of the availability of this document (in case they missed the announcement) and to ask them if they were willing to fill in the data, given that they are (as far as I can tell) the most qualified people to do so.

Neither has replied.

So how should I interpret this seemingly massive indifference to the whole concept of a reference document of this kind?

Well, I cannot help but feel very disappointed but also somewhat bewildered that it appears no one else thinks it’s a good idea.  Either that or everyone is just to busy to post feedback comments.

The problem is that I personally cannot populate the spreadsheet as I am not privy to the information required and, as a blank document, it is clearly of no use to anyone.

So, this is a somewhat desperate attempt to encourage feedback in the hope that I can get this whole concept up and running and all JavaFX developers will have a valuable tool to assist them to make the most of this awesome GUI toolkit.

I implore you, if you can somehow find the time and/or motivation, PLEASE post a comment on the blog post (or on this one) so that I can determine if there is actually any interest in the JavaFX community in having such a resource available to them.

The post in question is here JavaFX Feature/Platform Matrix.

Just my 2 bits,

Felix

JavaFX Feature/Platform Matrix

Background

Gosh, it’s hard to believe it’s been about 2 years since I posted anything on this blog!

Why have I been so slack (apparently)?  Well, to be honest, I have been keenly observing the activity that has been going on in “JavaFX World” and have had feelings ranging from utter dismay at some of the shenanigans happening at Oracle to sheer delight witnessing the rise of Gluon (with the very real potential to make JavaFX on mobile platforms viable) and the obvious increase in the number of talented developers pumping out their own JavaFX libraries & products.

I have continued to actively develop with JavaFX myself but I have been teetering on the fence for some time as to whether JavaFX was ever going to realise its potential and become viable and successful on all the major platforms.

It is with enormous pleasure that I have (finally) come to the conclusion that not only is JavaFX viable in the longer term but also that it has potential to achieve much greater success than it has so far.

As I posted on Twitter earlier this year, I am confident that what to the Chinese may be the Year of the Monkey, 2016 is also the Year of JavaFX.  That is, this will be the year when JavaFX firmly establishes itself as an incredibly good GUI toolkit for building a wide variety of applications on just about every device.  I will now try to do everything in my power to make this a reality and be a very strong evangelist and advocate for JavaFX on all the social media platforms I can.

Announcement

On the weekend I posted on Twitter that I was on the verge of releasing something that I believe will be a valuable tool for all JavaFX developers and I am happy to say that the moment has arrived!

So what is it?  Well, again on Twitter some time ago, I asked a question as to whether developers would find it useful to have some “centralised” document that specifies the status of implementation & performance for each of the main JavaFX features on all the platforms where it is currently supported or about to be supported.  And while the response was not exactly overwhelming, I decided to set up such a document myself and make it available through Dropbox.

Yes, it would probably be more appropriate for Oracle or even Gluon to host this document (and that may well eventuate), but for now, I am more than happy to host it and provide editing access to a few select people (i.e. those in the best position to be able to populate the data).

Initially I am going to grant editing privileges to Kevin Rusforth from Oracle and Johan Vos from Gluon.

The Matrix

No, not Keanu Reeves, but an Excel spreadsheet with each row representing a particular JavaFX feature and the columns indicating the implementation status, performance and general notes for all of the currently supported platforms.

This first release is intended more as a “taster” and may be changed significantly in response to feedback, which is exactly what I am seeking now.

Sample

Here is a screenshot of a small section of the spreadsheet with “dummy” values.  I am going to release the spreadsheet completely devoid of any data as I am not in a position to provide values for any of the fields.  Hopefully Kevin & Johan can find some time to populate the data with what they know once I grant them access.

javafx-feature-platform-matrix

JavaFX Feature/Platform Matrix

As you (hopefully) can see, each platform has 3 columns for each JavaFX feature: Implementation, Performance and Notes.

The Implementation column uses a drop-down list with the following options:

  • Not yet
  • Partial
  • Complete
  • Never

The Performance column uses a drop-down list with the following options:

  • Unusable
  • Poor
  • Good
  • Excellent

The Notes column is just a free text field.

The Platforms that I have included are:

  • Windows 7
  • Windows 10
  • MacOS X
  • Linux
  • iOS
  • Android
  • Embedded (e.g. Raspberry Pi)

The JavaFX Features I have specified are (in almost alphabetical order):

  • 3D
  • Animations
  • Audio
  • Canvas
  • Charts
  • Effects
  • Hi-DPI
  • Printing
  • Swing Embedding
  • SWT Embedding
  • Text (notes should specify what quality of text rendering is possible such as LCD)
  • Transforms
  • Video
  • Web View
  • Java 8 Lambdas
  • Java 8 Streams

Maintenance

The spreadsheet has 2 worksheets: Matrix and Change Log.

You may have noticed that the top heading in the Matrix sheet specifies who last updated the spreadsheet and when.  The idea is that whenever someone makes a change, they should add an entry in the Change Log sheet which looks like this:

change-log

Change Log Worksheet

The Matrix sheet title section automatically derives the details of the most recent change in the Change Log and includes them in the text.

Accessing the Matrix/Spreadsheet

The following is the URL that will take you to the directory containing the spreadsheet which enables you to download it (or view inside the browser if this feature is supported).  Only those granted editing privileges will actually be able to save any changes made in the document.

JavaFX Platform/Feature Matrix

Feedback

I invite anyone who reads this post to download and/or view the spreadsheet and use the comments section below to provide feedback on:

  • The JavaFX Features: have I got them all, are some irrelevant etc.
  • The different values for Implementation Status: is the list complete/appropriate?
  • The different values for Performance: is the list complete/appropriate?
  • The layout, design and usability of the spreadsheet itself
  • Anything that should be added (or removed)
  • Any bugs in the spreadsheet?
  • Is this whole concept a good idea and will it actually be used?
  • Any other general comments and feedback

Summary

I genuinely hope this new resource is found to be a helpful tool for all JavaFX developers who find it very difficult to know which features work where, how well and which features that will never be implemented on certain platforms.  Ideally this will obviate the need to spend hours trying to get something to work only to find out that it is not actually supported.

As I mentioned, I expect that many people will have useful suggestions on how to improve the matrix and what is being released now should be considered something akin to a “draft”.  Accordingly, I will not grant editing privileges to the individuals I mentioned until I have been able to digest what will hopefully be a lot of comments and implement anything which improves its usefulness.

Please take a look at this document and provide as much feedback as you can

Happy Year of JavaFX!

Just my 2 bits,

Felix

 

FXMark, JavaFX, Nashorn and LinkedIn spam fail!

Just a quick note to fill you in on some recent developments…

First, FXMark (my JavaFX benchmarking and demo software) has been further delayed because I grossly underestimated the length of time it would take to unpack dozens of boxes of “stuff” when moving from one house to another and also because much of my time recently has been devoted to caring for a very sick family member.  On the good news, the family member’s health has stabilised somewhat and I now have a lot more time to devote to completing FXMark.  Stay tuned for a release in June!

On the JavaFX front itself, I have been exploring lots of the new features and especially playing around with Nashorn and its combination with Canvas.  I hope to be able to post some really impressive samples soon too!

Finally, after years of being pestered to create a LinkedIn account, I finally decided to have a go using my iPhone while sitting on the train.  It’s an understatement to say that this did not work out the way I had hoped.  For some reason, it seems that everyone in my address book(s) got sent a request to link with me, many of whom will regard this request as total and utter spam (and correctly so!). I even received a request from myself on my main and secondary email addresses!

The worst and by far the most embarrassing recipient was the entire OpenJFX developer mailing list!  Ouch! #epicfail

To all the good people on that list I offer my sincerest apologies!

Just my 2 bits

Felix

JavaFX: Why it matters even more with Java 8

I have previously blogged about the annoying prevalence of FUD surrounding JavaFX and unfortunately this article by Paul Krill titled “Sorry, JavaFX — Java 8 won’t help you matter” published on InfoWorld a couple of weeks or so ago is just another example (and a particularly bad one at that).

Given the number of glaring technical anomalies in the article, I am still in two minds as to whether it was just another anti-JavaFX trolling attempt or if the author simply just didn’t do their research.  It’s also possible that it was just a slightly late April Fools Joke given that it was published on April 2!

Either way, I do get angry when a supposedly reputable site like InfoWorld publishes such nonsense-ridden guff about a technology that I personally have invested a significant amount of time and effort into.

The article doesn’t start well with the opening salvo:

“The rich client technology has devotees, but analysts doubt its viability as the RIA space loses ground to mobile apps”

So what does JavaFX have to do with the “RIA space”, whatever that might be?  Admittedly the Wikipedia article on RIAs doesn’t help here but JavaFX is not a technology that is predominantly designed to run inside a web browser and is therefore not a RIA technology.  The concept of RIA is now almost entirely related to HTML5 as the previous contenders for plugin-based alternatives (namely Flash and Silverlight) gradually disappear into obscurity.

Krill declares that JavaFX is apparently both a “rich client technology” and a RIA (which in my dictionary is not possible) and that (whichever one it is) it is losing ground to mobile apps.  Well, this rather confusing statement highlights the real problem with JavaFX, namely that many in the community don’t really understand what it is or what it can be used for.

JavaFX is a technology for building applications with a Graphical User Interface (GUI) using JVM-based languages and doesn’t really care where or how that application is deployed or launched.  Currently it runs on all the major desktop operating systems such as Windows, MacOS & Linux as well as on embedded platforms such as Raspberry Pi and BeagleBoard and also runs on the mobile operating systems iOS and Android (although there is no official release for mobile platforms yet).

The support for JavaFX on mobiles and tablets is growing rapidly through technologies such as RoboVM for iOS and by utilising Dalvik itself for Android.  The RoboVM website states “RoboVM translates Java bytecode into native ARM or x86 code” and the Android port utilises the Dalvik classes themselves (remembering that Android already uses Java).  The point is that with both of these solutions, the actual applications running on mobile devices are just as native as any other apps developed for those platforms so it is just plain silly to claim that JavaFX is “losing ground to mobile apps”.  The beauty though of course is that you can take your JavaFX code base and then run applications derived from it on desktop, embedded and mobile platforms.

The article goes on to quote John Rymer of Forrester Research as saying:

“I’m afraid JavaFX is too little, too late. JavaFX certainly didn’t accomplish Sun’s goal for it, which was to make Java the top environment for Web client and mobile development.”

Well, there’s actually no evidence to support the outlandish claim that JavaFX is “too little, too late” because all of the platforms that JavaFX either currently runs on or will soon run on are still very relevant and I am guessing that applications running on those platforms together comprise about 99% of all existing software!  And what it is this “Web client” that he speaks of?  Whatever that is, I am pretty sure that Oracle (who purchased Sun Microsystems) have zero plans for JavaFX to be the “top environment” for it.  Web client equals HTML (4 & 5) and that is it.  Period.

The next ludicrous remark in the article is:

“Like Adobe Flash and Microsoft Silverlight, JavaFX has been pushed to the background.”

WTF? This is another of the major misconceptions about JavaFX, that it is just a competitor for Flash or Silverlight.  Well, JavaFX is not and never was just a competitor for these now declining technologies.  It is an entirely different class of product and given that it is not reliant on being deployed to run inside a browser, HTML5 poses absolutely no threat to its future relevance (see here for a previous article of mine about this).  JavaFX is not being “pushed to the background”; it is in fact growing and growing very rapidly.  It is true however that both Flash and Silverlight are on the inevitable path to oblivion.  Updating Flash on my Ubuntu machine this morning for example gave me a message to say that Flash 11.2 on Linux is the last version to be release by Adobe.  I didn’t get any such messages about JavaFX when I upgraded to Java 8!

The article then quotes another “luminary” in Michael Cote of 451 Research who further discredits the message with the quote:

“I think the days of the RIA are long gone and have evolved into what we call mobile and tablets. HTML5, Android, and, of course, iOS handily won.”

This statement by itself would have perfectly acceptable had he not prefaced it with the declaration that he “sees JavaFX as a fading rich Internet application technology”.  Given that I have already pointed-out that JavaFX apps on mobiles and tablets are true native apps for those platforms, the implied negative connotations of this statement regarding JavaFX can be disregarded completely.

Krill himself then trumps the stupidity of all the previous claims in the article with this doozy:

“Oracle has demonstrated JavaFX on Android and iOS, though the Java runtime itself is not permitted on iOS devices.”

The problems with this one are twofold.  First, as explained, the Java runtime does not need to run on these devices for JavaFX apps to be deployed there.  Secondly, there is actually no reason in 2014 why the Java runtime would not be permitted to run on iOS devices.  The actual limitation is that Just-In-Time (JIT) compilation is not permitted on iOS which is a very important distinction.

Anyway, even if the reader of the article were able to distinguish FUD from fact, perhaps the main deficiency in an article with “Java 8” in the title is that it almost never mentions this latest and extremely significant update of the Java language and the improvements and enhancements in the version of JavaFX that is built-in to Java 8.  There is an absolute plethora of articles about the major and very important changes in Java 8 itself such as lambda expressions, streams, default methods in interfaces, the new date/time API and Nashorn (the high performance JVM-based JavaScript engine) and JavaFX has been updated to make use of many of these new features.

As for the new features of JavaFX 8 itself, Oracle’s page does a good job of describing them as:

  • The new Modena theme has been implemented in this release. For more information, see the blog at fxexperience.com.
  • The new SwingNode class enables developers to embed Swing content into JavaFX applications. See the SwingNode javadoc and Embedding Swing Content in JavaFX Applications.
  • The new UI Controls include the DatePicker and the TreeTableView controls.
  • The javafx.print package provides the public classes for the JavaFX Printing API. See the javadoc for more information.
  • The 3D Graphics features now include 3D shapes, camera, lights, subscene, material, picking, and antialiasing. The new Shape3D (Box, Cylinder, MeshView, and Sphere subclasses), SubScene, Material, PickResult, LightBase (AmbientLight and PointLight subclasses) , and SceneAntialiasing API classes have been added to the JavaFX 3D Graphics library. The Camera API class has also been updated in this release. See the corresponding class javadoc for javafx.scene.shape.Shape3D, javafx.scene.SubScene, javafx.scene.paint.Material, javafx.scene.input.PickResult, javafx.scene.SceneAntialiasing, and the Getting Started with JavaFX 3D Graphics document.
  • The WebView class provides new features and improvements. Review Supported Features of HTML5 for more information about additional HTML5 features including Web Sockets, Web Workers, and Web Fonts.
  • Enhanced text support including bi-directional text and complex text scripts such as Thai and Hindi in controls, and multi-line, multi-style text in text nodes.
  • Support for Hi-DPI displays has been added in this release.
  • The CSS Styleable* classes became public API. See the javafx.css javadoc for more information.
  • The new ScheduledService class allows to automatically restart the service.
  • JavaFX is now available for ARM platforms. JDK for ARM includes the base, graphics and controls components of JavaFX.

As you can see, it is very clear that both Java 8 and JavaFX 8 are major releases and that to say JavaFX is either “too little, too late” or “declining” is patently false.

On the contrary, JavaFX is growing and growing rapidly and has the very real potential to become the best toolkit for developing GUI applications and apps on a vast array of platforms from desktops and embedded to mobiles and tablets.

Since JavaFX 2, JavaFX has always mattered and now with Java 8, JavaFX most definitely matters even more!

Just my 2 bits

Felix

Follow

Get every new post delivered to your Inbox.

Join 179 other followers

%d bloggers like this: