...and they shall know me by my speling errors.

Danno Ferrin (aka shemnon) on stuff that matters to him.

JavaOne 2013: Dogfooding the Future Java

Last week I presented two talks at JavaOne 2013. The first talk I gave on Monday was “Styling Your Custom Components with CSS in JavaFX.” My second talk on Tuesday was “Building and Deploying JavaFX Applications with Gradle or Maven (or Ant!).” Since these two sessions were very technical in nature I created demo applications for both and the source for these are on Bitbucket. One repo for the custom CSS presentation and another one for the deployment build tools talk. Since each talk dealt with different perspectives in the same talk I created a separate git branch for one, so keep your eye out for the branches.

Dogfood

Not only were my samples written for JavaFX, but the presentation itself was written with JavaFX and used JavaFX technologies for every pixel the presentation put on the screen. The whole dogfood slide deck thing isn’t new (it’s been done before and will not doubt be done again) but it is an important milestone for a graphics stack that it is capable of running an essential task for a conference presentation.

I made this decision 5 days before I was supposed to present, mostly because I really like the style that GitHub has for the markdown highlighting of code based text. I couldn’t find an acceptable Keynote template that replicated that, so I realized that I had already written code for the two most basic parts: a markdown renderer and a deck control. Combine those with Java 8 Lambda syntax and the end result clocks in at only 313 lines of code (the whole build is in the preso branch of each repo). Not that we are playing golf or anything, but I estimate the lambda free code would clock in somewhere between 350-400 lines of code for a lines of code code savings of 10-20%. I know, I know, Groovy could do it in fewer lines and if I used tabs instead of spaces I could save even more space on my hard drive. But those are left as an exercise to the reader.

New and Exciting JavaFX 8 Features

The whole stack also includes the features I talked about as well as new JavaFX 8 features (some are both). The deck control uses the newly exposed CSS styling APIs. The Markdown node uses the new TextFlow API (which interestingly enough had no conference coverage I could see). I packaged the apps up into runtime-free applications, so you will need to install a current build of Java 8. The CSS Presentation is available as a Windows EXE MSI and zip and as a MacOSX DMG. The deployment presentation is also available as a Windows EXE, MSI, zip, and Mac DMG. Don’t forget to install a Java 8 Early access build first.

One last surprise came when I attempted to upload my slides to the speaker portal. Apparently it only accepts PDF files and not markdown files. So this presented another opportunity to use yet another new feature in JavaFX 8: printing. Over the course of an afternoon I wired up a print button and printed my slides out to PDF. So now I have a PDF version of my slides generated from JavaFX (CSS and deployment). Talk about dogfood.

Buzz is the Word

So, in summary, the source files for my JavaOne persecutions are on BitBucket, the binaries are on Bintray (congrats on the Duke’s Choice award). And there are lots of neat new Java 8 features used: Lambdas, JavaFX Printing, TextFlow, CSSMetaData, javafxpackager, and a MarkDown renderer. And of course it is all built with my Gradle plugin.

Comments