Java FX Script - From Takeoff To Cruising Altitude

84
JavaFX Script From Takeoff to Cruising Altitude... Matthew J. McCullough Ambient Ideas, LLC

description

Matthew McCullough's presentation to the Boulder Java Users Group on JavaFX Script

Transcript of Java FX Script - From Takeoff To Cruising Altitude

Page 1: Java FX Script - From Takeoff To Cruising Altitude

JavaFX ScriptFrom Takeoff to Cruising Altitude...

Matthew J. McCulloughAmbient Ideas, LLC

Page 2: Java FX Script - From Takeoff To Cruising Altitude

Deployments

Page 3: Java FX Script - From Takeoff To Cruising Altitude
Page 4: Java FX Script - From Takeoff To Cruising Altitude
Page 5: Java FX Script - From Takeoff To Cruising Altitude

A quick review of terms

Page 6: Java FX Script - From Takeoff To Cruising Altitude
Page 7: Java FX Script - From Takeoff To Cruising Altitude

JavaFX Script

Page 8: Java FX Script - From Takeoff To Cruising Altitude

JavaFX Mobile

JavaFX Script

Page 9: Java FX Script - From Takeoff To Cruising Altitude

•Complete Mobile Phone Stack

•Think “Google Android”

JavaFX Mobile

Page 10: Java FX Script - From Takeoff To Cruising Altitude

•Formerly known as F3

•A new Java-like scripting language specifically for RIAs

•Think Silverlight, Flex, or AIR

JavaFX Script

Page 11: Java FX Script - From Takeoff To Cruising Altitude

The write once, run anywhere portability of Java technology has helped make it the world's most widely deployed application platform. Now, Sun is introducing JavaFX Script, a highly productive scripting language that enables content developers to leverage the enormous popularity of Java to create rich applications and services for deployment on the widest range of platforms - from mobile devices to set-top boxes and Blu-ray Discs to desktops.

Page 12: Java FX Script - From Takeoff To Cruising Altitude

Hello RIA WorldCode Demo

Page 13: Java FX Script - From Takeoff To Cruising Altitude
Page 14: Java FX Script - From Takeoff To Cruising Altitude

Competing withother Runtimes

Page 15: Java FX Script - From Takeoff To Cruising Altitude

*Ajax has behavior issues on browsers other than Firefox, Safari, & Internet Explorer*AIR to support Linux at a later date

Page 16: Java FX Script - From Takeoff To Cruising Altitude

Product Browser Desktop Platforms

*Ajax has behavior issues on browsers other than Firefox, Safari, & Internet Explorer*AIR to support Linux at a later date

Page 17: Java FX Script - From Takeoff To Cruising Altitude

Product Browser Desktop Platforms

Ajax ✔ 3*

*Ajax has behavior issues on browsers other than Firefox, Safari, & Internet Explorer*AIR to support Linux at a later date

Page 18: Java FX Script - From Takeoff To Cruising Altitude

Product Browser Desktop Platforms

Ajax ✔ 3*

Adobe Flash ✔ 4

*Ajax has behavior issues on browsers other than Firefox, Safari, & Internet Explorer*AIR to support Linux at a later date

Page 19: Java FX Script - From Takeoff To Cruising Altitude

Product Browser Desktop Platforms

Ajax ✔ 3*

Adobe Flash ✔ 4

Adobe Flex ✔ 4

*Ajax has behavior issues on browsers other than Firefox, Safari, & Internet Explorer*AIR to support Linux at a later date

Page 20: Java FX Script - From Takeoff To Cruising Altitude

Product Browser Desktop Platforms

Ajax ✔ 3*

Adobe Flash ✔ 4

Adobe Flex ✔ 4

Adobe AIR ✔ 2*

*Ajax has behavior issues on browsers other than Firefox, Safari, & Internet Explorer*AIR to support Linux at a later date

Page 21: Java FX Script - From Takeoff To Cruising Altitude

Product Browser Desktop Platforms

Ajax ✔ 3*

Adobe Flash ✔ 4

Adobe Flex ✔ 4

Adobe AIR ✔ 2*

Microsoft Silverlight ✔ 2

*Ajax has behavior issues on browsers other than Firefox, Safari, & Internet Explorer*AIR to support Linux at a later date

Page 22: Java FX Script - From Takeoff To Cruising Altitude

Product Browser Desktop Platforms

Ajax ✔ 3*

Adobe Flash ✔ 4

Adobe Flex ✔ 4

Adobe AIR ✔ 2*

Microsoft Silverlight ✔ 2

Sun JavaFX Script ✔ ✔ 4+

*Ajax has behavior issues on browsers other than Firefox, Safari, & Internet Explorer*AIR to support Linux at a later date

Page 23: Java FX Script - From Takeoff To Cruising Altitude
Page 24: Java FX Script - From Takeoff To Cruising Altitude

Applets are Back&

WebStart is Hot

Page 25: Java FX Script - From Takeoff To Cruising Altitude

JavaFX Interest Poll

JavaFWhat?Not At AllNot VerySomewhatVery

Source: Java.net JavaFX Poll, August 2007

Page 26: Java FX Script - From Takeoff To Cruising Altitude

JavaFX Interest Poll

JavaFWhat?Not At AllNot VerySomewhatVery

Source: Java.net JavaFX Poll, August 2007

70%

Page 27: Java FX Script - From Takeoff To Cruising Altitude
Page 28: Java FX Script - From Takeoff To Cruising Altitude

Source: TIOBE Programming Community Index for December 2007

Page 29: Java FX Script - From Takeoff To Cruising Altitude

Source: TIOBE Programming Community Index for December 2007

Page 30: Java FX Script - From Takeoff To Cruising Altitude
Page 31: Java FX Script - From Takeoff To Cruising Altitude

Mouse EventsCode Demo

Page 32: Java FX Script - From Takeoff To Cruising Altitude

Just Show MeSomething Cool

Page 33: Java FX Script - From Takeoff To Cruising Altitude

Music PinboardDemo

Page 34: Java FX Script - From Takeoff To Cruising Altitude
Page 35: Java FX Script - From Takeoff To Cruising Altitude

Consumer JRE Size

•Current JRE download is 12MB

•Reduced Footprint through Java SE 6 Update N

•Goal of 2MB

Page 36: Java FX Script - From Takeoff To Cruising Altitude

Idea Source: Danny Coward, JAZOON 07, Zurich

Consumer JRE Size

Page 37: Java FX Script - From Takeoff To Cruising Altitude

Consumer JRE Micro Bundles

•Back-to-Basics JRE

•Starts with hello world support

•Downloads additional parts as needed

Source: Java SE 6 Update N Early Access Program & Jim Weaver’s JavaFX Blog

Page 38: Java FX Script - From Takeoff To Cruising Altitude

Consumer JRE Performance

•Quick Starter for cold starts

•Prefetches portions of JRE into memory

•Graphics rendering hardware acceleration

Source: Java SE 6 Update N Early Access Program

Page 39: Java FX Script - From Takeoff To Cruising Altitude
Page 40: Java FX Script - From Takeoff To Cruising Altitude

The Language

Page 41: Java FX Script - From Takeoff To Cruising Altitude

Interpreted vs. Compiled

Page 42: Java FX Script - From Takeoff To Cruising Altitude

Interpreted

‣ Starting point for language

‣ Proof of Concept only

‣ In process of deprecation

‣ But has current IDE Support

Page 43: Java FX Script - From Takeoff To Cruising Altitude

Compiled

‣Official language tool, javafxc

‣Built on top of javac

‣Open Source

‣Work In Progress, but very usable

Page 44: Java FX Script - From Takeoff To Cruising Altitude

‣Automatic binding of form element to data model

‣Core JDK has no equivalent

‣Libraries such as Swinglabs only partially accomplish this for Swing

‣Built on Beans Binding JSR 295 library

Bind Operator

Page 45: Java FX Script - From Takeoff To Cruising Altitude
Page 46: Java FX Script - From Takeoff To Cruising Altitude

Bean BindingCode Demo

Page 47: Java FX Script - From Takeoff To Cruising Altitude

‣ DO, DOLATER currently in interpreter

Threads

Page 48: Java FX Script - From Takeoff To Cruising Altitude

Threads

“(Working on SwingWorker wrapper in compiler) so it is as easy (possibly easier) to use as AJAX's XMLHttpRequest”

-Tom Ball

Page 49: Java FX Script - From Takeoff To Cruising Altitude

‣Swing based rendering on PC devices

‣Other rendering engine for smaller devices such as Blu-Ray

The Compatibilty Secret

Page 50: Java FX Script - From Takeoff To Cruising Altitude

Effect

‣Objectifying nodes

‣Binding nodes together

‣Adding behavior to composite nodes

‣Standalone Java library

SceneGraph

Composite Node

TextField Box

Radial Gradient SimpleLabel

Page 51: Java FX Script - From Takeoff To Cruising Altitude

JavaFX 2D TutorialCode Demo

Page 52: Java FX Script - From Takeoff To Cruising Altitude

Animation

‣ Interpreted:picks.opacity = [0, .01..1] dur 1000 linear

‣ Compiled:Key frames, timeline

Page 53: Java FX Script - From Takeoff To Cruising Altitude

As many as 500 lines of Swing code equivalent to 10 of JavaFX

Animation

Page 54: Java FX Script - From Takeoff To Cruising Altitude

‣Next step in JavaFX animation

‣Advanced capabilities

‣Currently in compiler in rough state

Keyframe Animation

Page 55: Java FX Script - From Takeoff To Cruising Altitude

BounceCode Demo

Page 56: Java FX Script - From Takeoff To Cruising Altitude

GuitarCode Demo

Page 57: Java FX Script - From Takeoff To Cruising Altitude

JavaFX 2D TutorialCode Demo

Page 58: Java FX Script - From Takeoff To Cruising Altitude

Specifically, we are working on a new 3D scene graph, as part of the JavaFX player, that will complement the 2D Scenario scene graph. Its initial focus will be 3D effects, casual games, and simple 3D viewing applications...

Java3D’s Successor

Source: http://forums.java.net/jive/thread.jspa?threadID=36022&tstart=0

Page 59: Java FX Script - From Takeoff To Cruising Altitude
Page 60: Java FX Script - From Takeoff To Cruising Altitude

Mix & Match

Page 61: Java FX Script - From Takeoff To Cruising Altitude

The Perfect Blend

•Leverages all existing Java libraries

•Retro-capable back to JRE 1.5

•Browser, Desktop, and Phone

•Groovy, JRuby, Scala, Jaskell, Jython

Page 62: Java FX Script - From Takeoff To Cruising Altitude

Mix & Match GroovyCode Demo

Page 63: Java FX Script - From Takeoff To Cruising Altitude
Page 64: Java FX Script - From Takeoff To Cruising Altitude

IDEs

‣ NetBeans

‣ Eclipse

‣ IntelliJ

‣ ReportMill

Page 65: Java FX Script - From Takeoff To Cruising Altitude

NetBeans JavaFX Plugin

Page 66: Java FX Script - From Takeoff To Cruising Altitude

Previewing Results

‣ Live preview of code changes

‣ No compile cycle delay for testing

‣ But uses Interpreter...

Page 67: Java FX Script - From Takeoff To Cruising Altitude

NetBeans Demo

Page 68: Java FX Script - From Takeoff To Cruising Altitude

ReportMill JFXBuilder

•Most advanced demos

•Representative of future tools from Sun

Page 69: Java FX Script - From Takeoff To Cruising Altitude
Page 70: Java FX Script - From Takeoff To Cruising Altitude

ReportMillPath Animation Demo

Page 71: Java FX Script - From Takeoff To Cruising Altitude
Page 72: Java FX Script - From Takeoff To Cruising Altitude

Designers vs. Coders

Page 73: Java FX Script - From Takeoff To Cruising Altitude

Sun’s JavaFX Tools are turning the workflow sideways

James Gosling

Source: http://www.regdeveloper.co.uk/2008/01/24/javafx_tools_adobe/

“”

Page 74: Java FX Script - From Takeoff To Cruising Altitude

Our architecture is more like the coder does this part and the artist does this part, and then the artist can do the plugging in [of the design] themselves. They can update the artwork and the [developer] guy can update the code, and they are talking to the tool together. It's not conditional on the other.

James Gosling

Source: http://www.regdeveloper.co.uk/2008/01/24/javafx_tools_adobe/

Page 75: Java FX Script - From Takeoff To Cruising Altitude

Sun Microsystems is working on interoperability between design tools from Adobe Systems and its upcoming JavaFX tools for application developers building rich application interfaces and rich-internet applications (RIAs).

James Gosling, Sun vice president and fellow, told Register Developer that Sun is working to ensure interoperability - rather than provide its own design tools.

We are putting a lot of effort into interoperability with the Adobe tools - a lot of the Adobe tools are wired into the neurons of the artists of the world. We are not trying to be a completely isolated island that has all the tools for everybody.

James Gosling

Source: http://www.regdeveloper.co.uk/2008/01/24/javafx_tools_adobe/

“”

Page 76: Java FX Script - From Takeoff To Cruising Altitude
Page 77: Java FX Script - From Takeoff To Cruising Altitude

Q&A

Page 78: Java FX Script - From Takeoff To Cruising Altitude

Q&A

Email questions to:[email protected]

Slides & Source Code at:www.AmbientIdeas.com/engineering/engineering-training.html

Page 79: Java FX Script - From Takeoff To Cruising Altitude
Page 80: Java FX Script - From Takeoff To Cruising Altitude

•James Weaver’s JavaFX Bloghttp://learnjavafx.typepad.com

•Sun JavaFX Script Homepagehttp://www.sun.com/software/javafx/script/index.jsp

•ReportMill JFXBuilderhttp://www.reportmill.com/jfx/

•Planet JFXhttp://jfx.wikia.com/wiki/Main_Page

Resources

Page 81: Java FX Script - From Takeoff To Cruising Altitude

•JavaFX Language Reference, Nightly Buildhttp://openjfx.java.sun.com/current-build/doc/JavaFX-Language.html

•Project SceneGraphhttps://scenegraph.dev.java.net/

•Comparing Flex and Ajax Dev Modelshttp://www.adobe.com/newsletters/edge/february2008/articles/article4/

•Swinging in Groovyhttp://groovy.dzone.com/tips/swinging-groovy-fun

Resources

Page 82: Java FX Script - From Takeoff To Cruising Altitude

•Rich Green @ Java One San Fran

•“Meant for building Rich Internet Applications (RIAs)”

•“For content professionals”

•“All based on Swing and Java 2D”

Quotes

Page 83: Java FX Script - From Takeoff To Cruising Altitude

• Danny Coward, JAZOON 07, Zurich

• Visual Tools, Visual Developers

• Only occasionally dropping down to script level coding

• Meant for animated, simple, client apps that are highly branded

• Not used much by technical java developers

Quotes

Page 84: Java FX Script - From Takeoff To Cruising Altitude

•Chris Oliver, creator of JavaFX Script

• Created Motorola equivalent site in 3 days

Quotes