SlideShare a Scribd company logo
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and Visage  Stephen Chin Chief Agile Methodologist, GXS steveonjava@gmail.com tweet: @steveonjava
About the Presenter Stephen Chin Java Champion Family Man Chief Agile Methodologist, GXS Author, Pro JavaFX Platform OSCON Java Conference Chair Motorcyclist
Pro JavaFX 2 Platform Coming Soon! Coming 2nd half of this year All examples rewritten in Java Will cover the new JavaFX 2.0 APIs 3
Disclaimer: This is code-heavy THE FOLLOWING IS INTENDED TO STIMULATE CREATIVE USE OF JVM LANGUAGES. AFTER WATCHING THIS PRESENTATION YOU MAY FEEL COMPELLED TO START LEARNING A NEW JVM LANGUAGE AND WANT TO APPLY IT AT YOUR WORKPLACE. THE PRESENTER IS NOT LIABLE FOR ANY INNOVATION, BREAKTHROUGHS, OR NP-COMPLETE SOLUTIONS THAT MAY RESULT.
JavaFX With Java
JavaFX 2.0 Product Timeline CYQ1 2011 CYQ3 2011 CYQ2 2011 JavaFX 2.0 EA (Early Access) JavaFX 2.0 Beta JavaFX 2.0 GA (General Availability) Copyright 2010 Oracle JavaFX Beta Available Now!
Programming Languages JavaFX 2.0 APIs are now in Java Pure Java APIs for all of JavaFX Expose JavaFX Binding, Sequences as Java APIs Embrace all JVM languages JRuby, Clojure, Groovy, Scala Fantom, Mira, Jython, etc. JavaFX Script is no longer supported by Oracle Existing JavaFX Script based applications will continue to run Visage is the open-source successor to the JavaFX Script language
JavaFX in Java JavaFX API follows JavaBeans approach Similar in feel to other UI toolkits (Swing, etc) Uses builder pattern to minimize boilerplate
Example Application public class HelloStage extends Application {   @Override public void start(Stage stage) {     stage.setTitle("Hello Stage"); stage.setWidth(600);     stage.setHeight(450); Group root = new Group();     Scene scene = new Scene(root); scene.setFill(Color.LIGHTGREEN); stage.setScene(scene); stage.setVisible(true);   }   public static void main(String[] args) {     launch(HelloStage.class, args);   } }
Binding Unquestionably the biggest JavaFX Script innovation Supported via a PropertyBinding class Lazy invocation for high performance Static construction syntax for simple cases e.g.: bindTo(<property>)
Observable Pseudo-Properties Supports watching for changes to properties Implemented via anonymous inner classes Will take advantage of closures in the future
Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() { });
Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() { }); The property we want to watch
Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() { }); Only one listener used with generics to specify the data type
Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() {   public void changed(ObservableValue<? extends Boolean> property, Boolean oldValue, Boolean value) {  } }); Refers to the Rectangle.hoverProperty()
Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() {   public void changed(ObservableValue<? extends Boolean> property, Boolean oldValue, Boolean value) {     rect.setFill(rect.isHover() ? Color.GREEN : Color.RED);   } });
Sequences in Java Replaced with an Observable List Public API is based on JavaFX sequences Internal code can use lighter collections API JavaFX 2.0 also has an Observable Map
JavaFX With JRuby
Why JRuby? ,[object Object]
Dynamic Typing
Closures
‘Closure conversion’ for interfaces,[object Object]
JRuby Example 1: Simple Stage require 'java' Application = Java::javafx.application.Application Stage = Java::javafx.stage.Stage Scene = Java::javafx.scene.Scene Color = Java::javafx.scene.paint.Color class HelloStage< Application   def start(stage)     .....   end end Application.launch(HelloStage.new); stage.title = 'Hello Stage (JRuby)' stage.width = 600 stage.height = 450 scene = Scene.new scene.fill = Color::LIGHTGREEN stage.scene = scene stage.visible = true;
JRuby Example 2 rect = Rectangle.new rect.x = 25 rect.y = 40 rect.width = 100 rect.height = 50 rect.fill = Color::RED root.children.add(rect) timeline = Timeline.new timeline.cycle_count= Timeline::INDEFINITE timeline.auto_reverse = true kv = KeyValue.new(rect.xProperty, 200); kf = KeyFrame.new(Duration.valueOf(500), kv); timeline.key_frames.addkf; timeline.play();
JRuby Closure Conversion rect.hoverProperty.addListener() do |prop, oldVal, newVal| rect.fill = rect.hover ? Color::GREEN : Color::RED; end 23
JRubySwiby require 'swiby' class HelloWorldModel attr_accessor :saying end model = HelloWorldModel.new model.saying = "Hello World" Frame {   title "Hello World“   width 200   content {     Label {       text bind(model,:saying)     }   }   visible true } 24
25 JavaFX With Clojure Artwork by Augusto Sellhorn http://sellmic.com/
A Little About      Clojure Started in 2007 by Rich Hickey Functional Programming Language Derived from LISP Optimized for High Concurrency … and looks nothing like Java! 26 (def hello (fn [] "Hello world")) (hello)
Clojure Syntax in One Slide Symbols numbers – 2.178 ratios – 355/113 strings – “clojure”, “rocks” characters –     symbols – a b c d keywords – :alpha :beta boolean – true, false null - nil Collections (commas optional) Lists (1, 2, 3, 4, 5) Vectors [1, 2, 3, 4, 5] Maps {:a 1, :b 2, :c 3, :d 4} Sets #{:a :b :c :d :e} 27 (plus macros that are syntactic sugar wrapping the above)
Clojure GUI Example (defnjavafxapp []   (let [stage (Stage. "JavaFX Stage")         scene (Scene.)]     (.setFill scene Color/LIGHTGREEN)     (.setWidth stage 600)     (.setHeight stage 450)     (.setScene stage scene)     (.setVisible stage true))) (javafxapp) 28
Clojure GUI Example (defnjavafxapp[]   (let [stage (Stage. "JavaFX Stage")         scene (Scene.)]     (.setFill scene Color/LIGHTGREEN)     (.setWidth stage 600)     (.setHeight stage 450)     (.setScene stage scene)     (.setVisible stage true))) (javafxapp) 29 Create a Function for the Application
Clojure GUI Example (defnjavafxapp [] (let [stage (Stage. "JavaFX Stage")         scene (Scene.)]     (.setFill scene Color/LIGHTGREEN)     (.setWidth stage 600)     (.setHeight stage 450)     (.setScene stage scene)     (.setVisible stage true))) (javafxapp) 30 Initialize the Stage and Scene Variables
Clojure GUI Example (defnjavafxapp []   (let [stage (Stage. "JavaFX Stage")         scene (Scene.)]     (.setFill scene Color/LIGHTGREEN)     (.setWidth stage 600)     (.setHeight stage 450)     (.setScene stage scene)     (.setVisible stage true))) (javafxapp) 31 Call Setter Methods on Scene and Stage
Clojure GUI Example (defnjavafxapp []   (let [stage (Stage. "JavaFX Stage")         scene (Scene.)]     (.setFillscene Color/LIGHTGREEN)     (.setWidthstage 600)     (.setHeightstage 450)     (.setScenestage scene)     (.setVisiblestage true))) (javafxapp) 32 Java Constant Syntax Java Method Syntax
Simpler Code Using doto (defnjavafxapp []   (let [stage (Stage. "JavaFX Stage")         scene (Scene.)]     (doto scene       (.setFillColor/LIGHTGREEN))     (doto stage       (.setWidth600)       (.setHeight450)       (.setScene scene)       (.setVisibletrue)))) (javafxapp) 33
Simpler Code Using doto (defnjavafxapp []   (let [stage (Stage. "JavaFX Stage")         scene (Scene.)]     (doto scene       (.setFillColor/LIGHTGREEN))     (doto stage       (.setWidth 600)       (.setHeight 450)       (.setScene scene)       (.setVisible true)))) (javafxapp) 34 doto form: (doto symbol    (.method params))  equals: (.method symbol params)
Refined Clojure GUI Example (defnjavafxapp []   (doto (Stage. "JavaFX Stage")     (.setWidth600)     (.setHeight450)     (.setScene (doto (Scene.)       (.setFillColor/LIGHTGREEN)       (.setContent (list (doto (Rectangle.)         (.setX25)         (.setY40)         (.setWidth100)         (.setHeight50)         (.setFillColor/RED))))))     (.setVisibletrue))) (javafxapp) 35
Refined Clojure GUI Example (defnjavafxapp []   (doto(Stage. "JavaFX Stage")     (.setWidth 600)     (.setHeight 450)     (.setScene (doto(Scene.)       (.setFillColor/LIGHTGREEN)       (.setContent (list (doto (Rectangle.)         (.setX 25)         (.setY 40)         (.setWidth 100)         (.setHeight 50)         (.setFillColor/RED))))))     (.setVisible true))) (javafxapp) 36 Let replaced with inline declarations
Refined Clojure GUI Example (defnjavafxapp []   (doto (Stage. "JavaFX Stage")     (.setWidth 600)     (.setHeight 450)     (.setScene (doto (Scene.)       (.setFillColor/LIGHTGREEN)       (.setContent (list (doto (Rectangle.)         (.setX 25)         (.setY 40)         (.setWidth 100)         (.setHeight 50)         (.setFillColor/RED))))))     (.setVisible true))) (javafxapp) 37 Doto allows nested data structures
Refined Clojure GUI Example (defnjavafxapp []   (doto (Stage. "JavaFX Stage")     (.setWidth 600)     (.setHeight 450)     (.setScene (doto (Scene.)       (.setFillColor/LIGHTGREEN)       (.setContent (list (doto (Rectangle.)         (.setX 25)         (.setY 40)         (.setWidth 100)         (.setHeight 50)         (.setFillColor/RED))))))     (.setVisible true))) (javafxapp) 38 Now a nested Rectangle fits!
Closures in Clojure 39 Inner classes can be created using proxy (.addListenerhoverProperty   (proxy [ChangeListener] [] (changed [p, o, v]       (.setFillrect         (if (.isHoverrect) Color/GREEN Color/RED)))))
Closures in Clojure Inner classes can be created using proxy 40 Proxy form: (proxy [class] [args] fs+)  f => (name [params*] body) (.addListenerhoverProperty   (proxy[ChangeListener][] (changed [p, o, v]       (.setFillrect         (if (.isHoverrect) Color/GREEN Color/RED)))))
JavaFX With Groovy
Features of Groovy Tight integration with Java Very easy to port from Java to Groovy Declarative syntax Familiar to JavaFX Script developers Builders
Step 1: Lazy conversion to Groovy class HelloStage extends Application {  void start(stage) {     stage.setTitle("Hello Stage (Groovy)"); stage.setWidth(600);     stage.setHeight(450);     Group root = new Group();     Scene scene = new Scene(root);     scene.setFill(Color.LIGHTSKYBLUE);     stage.setScene(scene); stage.setVisible(true);   } static void main(args) {     launch(HelloStage.class, args);   } }
Step 2: Slightly More Groovy class HelloStage extends Application {     void start(stage) {        stage.setTitle("Hello Stage (Groovy)"); stage.setScene(new Scene(             width: 600,             height: 450,             fill: Color.LIGHTSKYBLUE            root: new Group()         ));         stage.setVisible(true);     }     static void main(args) {         launch(HelloStage.class, args);     } }
Introducing GroovyFX Groovy DSL for JavaFX Started by James Clark In Alpha 1.0 State http://groovy.codehaus.org/GroovyFX
Step 3: Using GroovyFX GroovyFX.start ({    def sg = new SceneGraphBuilder();     def stage = sg.stage(         title: "Hello World",           width: 600,           height: 450,        visible: true    ) {         scene(fill: Color.LIGHTSKYBLUE) {             ...         }     ) }
Step 4: With Content GroovyFX.start ({    def sg = new SceneGraphBuilder();     def stage = sg.stage(         title: "Hello World",           width: 600,           height: 450,        visible: true    ) {         scene(fill: Color.LIGHTSKYBLUE) { rectangle(                 x: 25, y: 40,                 width: 100, height: 50,                 fill: Color.RED ) })}
FX Script Animation in Groovy
Step 1: JavaFX Script def timeline = Timeline { repeatCount: Timeline.INDEFINITE autoReverse: true keyFrames: [ KeyFrame {       time: 750ms       values : [         rect1.x => 200.0 tweenInterpolator.LINEAR,         rect2.y => 200.0 tweenInterpolator.LINEAR,         circle1.radius => 200.0 tweenInterpolator.LINEAR       ]     }   ]; } timeline.play();
Step 1a: JavaFX Script Simplification def timeline = Timeline { repeatCount: Timeline.INDEFINITE autoReverse: true   keyFrames: at (750ms) {     rect1.x => 200.0 tween Interpolator.LINEAR;     rect2.y => 200.0 tween Interpolator.LINEAR;     circle1.radius => 200.0 tween Interpolator.LINEAR;   } } timeline.play();
Step 2: Java-ish Groovy Animations final Timeline timeline = new Timeline(   cycleCount: Timeline.INDEFINITE, autoReverse: true ) final KeyValue kv1 = new KeyValue (rect1.xProperty(), 200); final KeyValue kv2 = new KeyValue (rect2.yProperty(), 200); final KeyValue kv3 = new KeyValue (circle1.radiusProperty(), 200); final KeyFramekf = new KeyFrame(Duration.valueOf(750), kv1, kv2, kv3); timeline.getKeyFrames().add(kf); timeline.play();
Step 3: GroovyFX Animation timeline = timeline(cycleCount: Timeline.INDEFINITE, autoReverse: true) {   at 750.ms {    change (rect1, "y") {      to 200    }    change (rect2, "x") {      to 200    }     change (circle, "radius") {      to 200    }  } } timeline.play();
Groovy Closures  - With interface coercion def f = {    p, o, v -> rect.setFill(rect.isHover() ? Color.GREEN : Color.RED); } as ChangeListener; rect.hoverProperty().addListener(f);
54 JavaFX With Scala
What is Scala Started in 2001 by Martin Odersky Compiles to Java bytecodes Pure object-oriented language Also a functional programming language 55
Why Scala? Shares many language features with JavaFX Script that make GUI programming easier: Static type checking – Catch your errors at compile time Closures – Wrap behavior and pass it by reference Declarative – Express the UI by describing what it should look like Scala also supports DSLs! 56
Java vs. Scala DSL public class HelloStage extends Application {   public void start(Stage stage) {     stage.setTitle("Hello Stage"); stage.setWidth(600); stage.setHeight(450);     Scene scene = new Scene(); scene.setFill(Color.LIGHTGREEN);     Rectangle rect = new Rectangle(); rect.setX(25); rect.setY(40); rect.setWidth(100); rect.setHeight(50); rect.setFill(Color.RED); stage.add(rect); stage.setScene(scene); stage.setVisible(true);   }   public static void main(String[] args) {     Launcher.launch(HelloStage.class, args);   } } object HelloJavaFX extends JavaFXApplication {   def stage = new Stage {     title = "Hello Stage"     width = 600     height = 450     scene = new Scene {       fill = Color.LIGHTGREEN       content = List(new Rectangle {         x = 25         y = 40         width = 100         height = 50         fill = Color.RED       })     }   } } 57 21 Lines 541 Characters 17 Lines 324 Characters
object HelloJavaFX extends JavaFXApplication {   def stage = new Stage {     title = "Hello Stage"     width = 600     height = 450     scene = new Scene {       fill = Color.LIGHTGREEN       content = List(new Rectangle {         x = 25         y = 40         width = 100         height = 50         fill = Color.RED       })     }   } } 58
59 object HelloJavaFX extends JavaFXApplication {   def stage = new Stage {     title = "Hello Stage"     width = 600     height = 450     scene = new Scene {       fill = Color.LIGHTGREEN       content = List(new Rectangle {         x = 25         y = 40         width = 100         height = 50         fill = Color.RED       })     }   } } object HelloJavaFX extends JavaFXApplication {   def stage = new Stage {     title = "Hello Stage"     width = 600     height = 450     scene = new Scene {       fill = Color.LIGHTGREEN       content = List(new Rectangle {         x = 25         y = 40         width = 100         height = 50         fill = Color.RED       })     }   } } Base class for JavaFX applications
60 object HelloJavaFX extends JavaFXApplication { def stage = new Stage {     title = "Hello Stage"     width = 600     height = 450     scene = new Scene {       fill = Color.LIGHTGREEN       content = List(new Rectangle {         x = 25         y = 40         width = 100         height = 50         fill = Color.RED       })     }   } } Declarative Stage definition
61 object HelloJavaFX extends JavaFXApplication {   def stage = new Stage { title = "Hello Stage"     width = 600     height = 450     scene = new Scene {       fill = Color.LIGHTGREEN       content = List(new Rectangle {         x = 25         y = 40         width = 100         height = 50         fill = Color.RED       })     }   } } Inline property definitions
62 object HelloJavaFX extends JavaFXApplication {   def stage = new Stage {     title = "Hello Stage"     width = 600     height = 450     scene = new Scene {       fill = Color.LIGHTGREEN       content = List(new Rectangle {         x = 25         y = 40         width = 100         height = 50         fill = Color.RED       })     }   } } List Construction Syntax
Animation in Scala def timeline = new Timeline { repeatCount = INDEFINITE autoReverse = true keyFrames = List(       new KeyFrame(time: 50) {         values = List(           new KeyValue(rect1.xProperty -> 300),           new KeyValue(rect2.yProperty -> 500),           new KeyValue(rect2.widthProperty -> 150)         )       }     )   } 63
def timeline = new Timeline { repeatCount = INDEFINITE autoReverse = true keyFrames = List(       new KeyFrame(time: 50) {         values = List(           new KeyValue(rect1.xProperty -> 300),           new KeyValue(rect2.yProperty -> 500),           new KeyValue(rect2.widthProperty -> 150)         )       }     )   } Animation in Scala 64 Duration set by Constructor Parameter
Animation in Scala 65 def timeline = new Timeline { repeatCount = INDEFINITE autoReverse = true keyFrames = List(       new KeyFrame(time: 50) {         values = List(           new KeyValue(rect1.xProperty -> 300),           new KeyValue(rect2.yProperty -> 500),           new KeyValue(rect2.widthProperty -> 150)         )       }     )   } Operator overloading for animation syntax
Closures in Scala 66 Closures are also supported in Scala And they are 100% type-safe rect.hoverProperty.addListener((p, o, v) => { rect.fill = if (rect.hover) Color.GREEN else Color.RED })
Closures in Scala Closures are also supported in Scala And they are 100% type-safe 67 rect.hoverProperty.addListener((p, o, v) => { rect.fill = if (rect.hover) Color.GREEN else Color.RED }) Compact syntax (params) => {body}
Other JVM Languages to Try Jython Started by Jim Hugunin High Performance Python Mirah Invented by Charles Nutter Originally called Duby Local Type Inference, Static and Dynamic Typing Fantom Created by Brian and Andy Frank Originally called Fan Built-in Declarative Syntax Portable to Java and .NET Local Type Inference, Static and Dynamic Typing 68
Fantom Code Example Void main() {   Stage {     title= "Hello Stage"     width= 600     height= 450    Scene {       fill= Color.LIGHTGREEN       Rectangle {         x= 25         y= 40         width= 100         height= 50         fill= Color.RED       }     }   }.open } 69
timeline := Timeline {   repeatCount = Timeline.INDEFINITE   autoReverse = true KeyFrame {    time = 50ms KeyValue(rect1.x()-> 300),     KeyValue(rect2.y() -> 500),     KeyValue(rect2.width() -> 150) } } Animation in Fantom 70 Fantom has a built-in Duration type And also supports operator overloading
Announcing Project Visage 71 ,[object Object],Visage project goals: Compile to JavaFX Java APIs Evolve the Language (Annotations, Maps, etc.) Support Other Toolkits Come join the team! For more info: http://visage-lang.org/
How about JavaFX on…  Visage Stage {   title: "Hello Stage"   width: 600   height: 450  scene: Scene {     fill: Color.LIGHTGREEN     content: Rectangle {       x: 25       y: 40       width: 100       height: 50       fill: Color.RED     }   } } 72
How about JavaFX on…  Visage Stage {   title: "Hello Stage"   width: 600   height: 450 scene: Scene {     fill: Color.LIGHTGREEN content: Rectangle {       x: 25       y: 40       width: 100       height: 50       fill: Color.RED     }   } } 73
How about JavaFX on…  Visage Stage {   title: "Hello Stage"   width: 600   height: 450  Scene {     fill: Color.LIGHTGREEN     Rectangle {       x: 25       y: 40       width: 100       height: 50       fill: Color.RED     }   } } 74
Visage on Android Curious? Drop by room 4 after this talk to find out more…

More Related Content

What's hot

EcmaScript 6 - The future is here
EcmaScript 6 - The future is hereEcmaScript 6 - The future is here
EcmaScript 6 - The future is here
Sebastiano Armeli
 
Django Celery - A distributed task queue
Django Celery - A distributed task queueDjango Celery - A distributed task queue
Django Celery - A distributed task queue
Alex Eftimie
 
Introduction to kotlin coroutines
Introduction to kotlin coroutinesIntroduction to kotlin coroutines
Introduction to kotlin coroutines
NAVER Engineering
 
Europython 2011 - Playing tasks with Django & Celery
Europython 2011 - Playing tasks with Django & CeleryEuropython 2011 - Playing tasks with Django & Celery
Europython 2011 - Playing tasks with Django & Celery
Mauro Rocco
 
Physical web
Physical webPhysical web
Physical web
Jeff Prestes
 
An Introduction to Celery
An Introduction to CeleryAn Introduction to Celery
An Introduction to Celery
Idan Gazit
 
Home Automation with Android Things and the Google Assistant
Home Automation with Android Things and the Google AssistantHome Automation with Android Things and the Google Assistant
Home Automation with Android Things and the Google Assistant
Nilhcem
 
ECMAScript 6
ECMAScript 6ECMAScript 6
ECMAScript 6
Piotr Lewandowski
 
ES6: The Awesome Parts
ES6: The Awesome PartsES6: The Awesome Parts
ES6: The Awesome Parts
Domenic Denicola
 
Celery - A Distributed Task Queue
Celery - A Distributed Task QueueCelery - A Distributed Task Queue
Celery - A Distributed Task Queue
Duy Do
 
"Full Stack frameworks or a story about how to reconcile Front (good) and Bac...
"Full Stack frameworks or a story about how to reconcile Front (good) and Bac..."Full Stack frameworks or a story about how to reconcile Front (good) and Bac...
"Full Stack frameworks or a story about how to reconcile Front (good) and Bac...
Fwdays
 
Kotlin Coroutines. Flow is coming
Kotlin Coroutines. Flow is comingKotlin Coroutines. Flow is coming
Kotlin Coroutines. Flow is coming
Kirill Rozov
 
When Bad Things Come In Good Packages
When Bad Things Come In Good PackagesWhen Bad Things Come In Good Packages
When Bad Things Come In Good Packages
Saumil Shah
 
200819 NAVER TECH CONCERT 03_화려한 코루틴이 내 앱을 감싸네! 코루틴으로 작성해보는 깔끔한 비동기 코드
200819 NAVER TECH CONCERT 03_화려한 코루틴이 내 앱을 감싸네! 코루틴으로 작성해보는 깔끔한 비동기 코드200819 NAVER TECH CONCERT 03_화려한 코루틴이 내 앱을 감싸네! 코루틴으로 작성해보는 깔끔한 비동기 코드
200819 NAVER TECH CONCERT 03_화려한 코루틴이 내 앱을 감싸네! 코루틴으로 작성해보는 깔끔한 비동기 코드
NAVER Engineering
 
Puppet at janrain
Puppet at janrainPuppet at janrain
Puppet at janrain
Puppet
 
Django Celery
Django Celery Django Celery
Django Celery
Mat Clayton
 
"Wix Engineering Media AI Photo Studio", Mykola Mykhailych
"Wix Engineering Media AI Photo Studio", Mykola Mykhailych"Wix Engineering Media AI Photo Studio", Mykola Mykhailych
"Wix Engineering Media AI Photo Studio", Mykola Mykhailych
Fwdays
 
Découvrir dtrace en ligne de commande.
Découvrir dtrace en ligne de commande.Découvrir dtrace en ligne de commande.
Découvrir dtrace en ligne de commande.
CocoaHeads France
 
Kotlin Coroutines Reloaded
Kotlin Coroutines ReloadedKotlin Coroutines Reloaded
Kotlin Coroutines Reloaded
Roman Elizarov
 
API Python Chess: Distribution of Chess Wins based on random moves
API Python Chess: Distribution of Chess Wins based on random movesAPI Python Chess: Distribution of Chess Wins based on random moves
API Python Chess: Distribution of Chess Wins based on random moves
Yao Yao
 

What's hot (20)

EcmaScript 6 - The future is here
EcmaScript 6 - The future is hereEcmaScript 6 - The future is here
EcmaScript 6 - The future is here
 
Django Celery - A distributed task queue
Django Celery - A distributed task queueDjango Celery - A distributed task queue
Django Celery - A distributed task queue
 
Introduction to kotlin coroutines
Introduction to kotlin coroutinesIntroduction to kotlin coroutines
Introduction to kotlin coroutines
 
Europython 2011 - Playing tasks with Django & Celery
Europython 2011 - Playing tasks with Django & CeleryEuropython 2011 - Playing tasks with Django & Celery
Europython 2011 - Playing tasks with Django & Celery
 
Physical web
Physical webPhysical web
Physical web
 
An Introduction to Celery
An Introduction to CeleryAn Introduction to Celery
An Introduction to Celery
 
Home Automation with Android Things and the Google Assistant
Home Automation with Android Things and the Google AssistantHome Automation with Android Things and the Google Assistant
Home Automation with Android Things and the Google Assistant
 
ECMAScript 6
ECMAScript 6ECMAScript 6
ECMAScript 6
 
ES6: The Awesome Parts
ES6: The Awesome PartsES6: The Awesome Parts
ES6: The Awesome Parts
 
Celery - A Distributed Task Queue
Celery - A Distributed Task QueueCelery - A Distributed Task Queue
Celery - A Distributed Task Queue
 
"Full Stack frameworks or a story about how to reconcile Front (good) and Bac...
"Full Stack frameworks or a story about how to reconcile Front (good) and Bac..."Full Stack frameworks or a story about how to reconcile Front (good) and Bac...
"Full Stack frameworks or a story about how to reconcile Front (good) and Bac...
 
Kotlin Coroutines. Flow is coming
Kotlin Coroutines. Flow is comingKotlin Coroutines. Flow is coming
Kotlin Coroutines. Flow is coming
 
When Bad Things Come In Good Packages
When Bad Things Come In Good PackagesWhen Bad Things Come In Good Packages
When Bad Things Come In Good Packages
 
200819 NAVER TECH CONCERT 03_화려한 코루틴이 내 앱을 감싸네! 코루틴으로 작성해보는 깔끔한 비동기 코드
200819 NAVER TECH CONCERT 03_화려한 코루틴이 내 앱을 감싸네! 코루틴으로 작성해보는 깔끔한 비동기 코드200819 NAVER TECH CONCERT 03_화려한 코루틴이 내 앱을 감싸네! 코루틴으로 작성해보는 깔끔한 비동기 코드
200819 NAVER TECH CONCERT 03_화려한 코루틴이 내 앱을 감싸네! 코루틴으로 작성해보는 깔끔한 비동기 코드
 
Puppet at janrain
Puppet at janrainPuppet at janrain
Puppet at janrain
 
Django Celery
Django Celery Django Celery
Django Celery
 
"Wix Engineering Media AI Photo Studio", Mykola Mykhailych
"Wix Engineering Media AI Photo Studio", Mykola Mykhailych"Wix Engineering Media AI Photo Studio", Mykola Mykhailych
"Wix Engineering Media AI Photo Studio", Mykola Mykhailych
 
Découvrir dtrace en ligne de commande.
Découvrir dtrace en ligne de commande.Découvrir dtrace en ligne de commande.
Découvrir dtrace en ligne de commande.
 
Kotlin Coroutines Reloaded
Kotlin Coroutines ReloadedKotlin Coroutines Reloaded
Kotlin Coroutines Reloaded
 
API Python Chess: Distribution of Chess Wins based on random moves
API Python Chess: Distribution of Chess Wins based on random movesAPI Python Chess: Distribution of Chess Wins based on random moves
API Python Chess: Distribution of Chess Wins based on random moves
 

Similar to JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and Visage

JavaFX 2.0 and Alternative Languages
JavaFX 2.0 and Alternative LanguagesJavaFX 2.0 and Alternative Languages
JavaFX 2.0 and Alternative Languages
Stephen Chin
 
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
Stephen Chin
 
JavaFX Your Way - Devoxx Version
JavaFX Your Way - Devoxx VersionJavaFX Your Way - Devoxx Version
JavaFX Your Way - Devoxx Version
Stephen Chin
 
JavaFX Your Way: Building JavaFX Applications with Alternative Languages
JavaFX Your Way: Building JavaFX Applications with Alternative LanguagesJavaFX Your Way: Building JavaFX Applications with Alternative Languages
JavaFX Your Way: Building JavaFX Applications with Alternative Languages
Stephen Chin
 
JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011
Stephen Chin
 
JavaFX 2.0 With Alternative Languages [Portuguese]
JavaFX 2.0 With Alternative Languages [Portuguese]JavaFX 2.0 With Alternative Languages [Portuguese]
JavaFX 2.0 With Alternative Languages [Portuguese]
Stephen Chin
 
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen ChinHacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
jaxconf
 
Greach, GroovyFx Workshop
Greach, GroovyFx WorkshopGreach, GroovyFx Workshop
Greach, GroovyFx Workshop
Dierk König
 
JavaFX introduction
JavaFX introductionJavaFX introduction
JavaFX introduction
José Maria Silveira Neto
 
Groovy's Builder
Groovy's BuilderGroovy's Builder
Groovy's Builder
Yasuharu Nakano
 
Don't panic in Fortaleza - ScalaFX
Don't panic in Fortaleza - ScalaFXDon't panic in Fortaleza - ScalaFX
Don't panic in Fortaleza - ScalaFX
Alain Béarez
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
Skills Matter
 
JavaFX Overview
JavaFX OverviewJavaFX Overview
JavaFX Overview
José Maria Silveira Neto
 
XML-Free Programming
XML-Free ProgrammingXML-Free Programming
XML-Free Programming
Stephen Chin
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
Kiyotaka Oku
 
jrubykaigi2010-lt-rubeus
jrubykaigi2010-lt-rubeusjrubykaigi2010-lt-rubeus
jrubykaigi2010-lt-rubeus
Takeshi AKIMA
 
Griffon @ Svwjug
Griffon @ SvwjugGriffon @ Svwjug
Griffon @ Svwjug
Andres Almiray
 
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
Stephen Chin
 
Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...
Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...
Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...
Naresha K
 
Intro to JavaFX & Widget FX
Intro to JavaFX & Widget FXIntro to JavaFX & Widget FX
Intro to JavaFX & Widget FX
Stephen Chin
 

Similar to JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and Visage (20)

JavaFX 2.0 and Alternative Languages
JavaFX 2.0 and Alternative LanguagesJavaFX 2.0 and Alternative Languages
JavaFX 2.0 and Alternative Languages
 
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
 
JavaFX Your Way - Devoxx Version
JavaFX Your Way - Devoxx VersionJavaFX Your Way - Devoxx Version
JavaFX Your Way - Devoxx Version
 
JavaFX Your Way: Building JavaFX Applications with Alternative Languages
JavaFX Your Way: Building JavaFX Applications with Alternative LanguagesJavaFX Your Way: Building JavaFX Applications with Alternative Languages
JavaFX Your Way: Building JavaFX Applications with Alternative Languages
 
JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011
 
JavaFX 2.0 With Alternative Languages [Portuguese]
JavaFX 2.0 With Alternative Languages [Portuguese]JavaFX 2.0 With Alternative Languages [Portuguese]
JavaFX 2.0 With Alternative Languages [Portuguese]
 
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen ChinHacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
 
Greach, GroovyFx Workshop
Greach, GroovyFx WorkshopGreach, GroovyFx Workshop
Greach, GroovyFx Workshop
 
JavaFX introduction
JavaFX introductionJavaFX introduction
JavaFX introduction
 
Groovy's Builder
Groovy's BuilderGroovy's Builder
Groovy's Builder
 
Don't panic in Fortaleza - ScalaFX
Don't panic in Fortaleza - ScalaFXDon't panic in Fortaleza - ScalaFX
Don't panic in Fortaleza - ScalaFX
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
JavaFX Overview
JavaFX OverviewJavaFX Overview
JavaFX Overview
 
XML-Free Programming
XML-Free ProgrammingXML-Free Programming
XML-Free Programming
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
 
jrubykaigi2010-lt-rubeus
jrubykaigi2010-lt-rubeusjrubykaigi2010-lt-rubeus
jrubykaigi2010-lt-rubeus
 
Griffon @ Svwjug
Griffon @ SvwjugGriffon @ Svwjug
Griffon @ Svwjug
 
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
 
Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...
Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...
Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...
 
Intro to JavaFX & Widget FX
Intro to JavaFX & Widget FXIntro to JavaFX & Widget FX
Intro to JavaFX & Widget FX
 

More from Stephen Chin

DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2
Stephen Chin
 
10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community
Stephen Chin
 
Java Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive GuideJava Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive Guide
Stephen Chin
 
DevOps Tools for Java Developers
DevOps Tools for Java DevelopersDevOps Tools for Java Developers
DevOps Tools for Java Developers
Stephen Chin
 
Java Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJCJava Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJC
Stephen Chin
 
RetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming ConsoleRetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming Console
Stephen Chin
 
JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)
Stephen Chin
 
Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)
Stephen Chin
 
Devoxx4Kids Lego Workshop
Devoxx4Kids Lego WorkshopDevoxx4Kids Lego Workshop
Devoxx4Kids Lego Workshop
Stephen Chin
 
Confessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistConfessions of a Former Agile Methodologist
Confessions of a Former Agile Methodologist
Stephen Chin
 
Zombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadZombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the Undead
Stephen Chin
 
JCrete Embedded Java Workshop
JCrete Embedded Java WorkshopJCrete Embedded Java Workshop
JCrete Embedded Java Workshop
Stephen Chin
 
Oracle IoT Kids Workshop
Oracle IoT Kids WorkshopOracle IoT Kids Workshop
Oracle IoT Kids Workshop
Stephen Chin
 
OpenJFX on Android and Devices
OpenJFX on Android and DevicesOpenJFX on Android and Devices
OpenJFX on Android and Devices
Stephen Chin
 
Java on Raspberry Pi Lab
Java on Raspberry Pi LabJava on Raspberry Pi Lab
Java on Raspberry Pi Lab
Stephen Chin
 
Java 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and LegosJava 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and Legos
Stephen Chin
 
DukeScript
DukeScriptDukeScript
DukeScript
Stephen Chin
 
Devoxx4Kids NAO Workshop
Devoxx4Kids NAO WorkshopDevoxx4Kids NAO Workshop
Devoxx4Kids NAO Workshop
Stephen Chin
 
Raspberry Pi Gaming 4 Kids - Dutch Version
Raspberry Pi Gaming 4 Kids - Dutch VersionRaspberry Pi Gaming 4 Kids - Dutch Version
Raspberry Pi Gaming 4 Kids - Dutch Version
Stephen Chin
 
Raspberry pi gaming 4 kids
Raspberry pi gaming 4 kidsRaspberry pi gaming 4 kids
Raspberry pi gaming 4 kids
Stephen Chin
 

More from Stephen Chin (20)

DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2
 
10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community
 
Java Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive GuideJava Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive Guide
 
DevOps Tools for Java Developers
DevOps Tools for Java DevelopersDevOps Tools for Java Developers
DevOps Tools for Java Developers
 
Java Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJCJava Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJC
 
RetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming ConsoleRetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming Console
 
JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)
 
Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)
 
Devoxx4Kids Lego Workshop
Devoxx4Kids Lego WorkshopDevoxx4Kids Lego Workshop
Devoxx4Kids Lego Workshop
 
Confessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistConfessions of a Former Agile Methodologist
Confessions of a Former Agile Methodologist
 
Zombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadZombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the Undead
 
JCrete Embedded Java Workshop
JCrete Embedded Java WorkshopJCrete Embedded Java Workshop
JCrete Embedded Java Workshop
 
Oracle IoT Kids Workshop
Oracle IoT Kids WorkshopOracle IoT Kids Workshop
Oracle IoT Kids Workshop
 
OpenJFX on Android and Devices
OpenJFX on Android and DevicesOpenJFX on Android and Devices
OpenJFX on Android and Devices
 
Java on Raspberry Pi Lab
Java on Raspberry Pi LabJava on Raspberry Pi Lab
Java on Raspberry Pi Lab
 
Java 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and LegosJava 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and Legos
 
DukeScript
DukeScriptDukeScript
DukeScript
 
Devoxx4Kids NAO Workshop
Devoxx4Kids NAO WorkshopDevoxx4Kids NAO Workshop
Devoxx4Kids NAO Workshop
 
Raspberry Pi Gaming 4 Kids - Dutch Version
Raspberry Pi Gaming 4 Kids - Dutch VersionRaspberry Pi Gaming 4 Kids - Dutch Version
Raspberry Pi Gaming 4 Kids - Dutch Version
 
Raspberry pi gaming 4 kids
Raspberry pi gaming 4 kidsRaspberry pi gaming 4 kids
Raspberry pi gaming 4 kids
 

Recently uploaded

Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Jeffrey Haguewood
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 

Recently uploaded (20)

Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 

JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and Visage

  • 1. JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and Visage Stephen Chin Chief Agile Methodologist, GXS steveonjava@gmail.com tweet: @steveonjava
  • 2. About the Presenter Stephen Chin Java Champion Family Man Chief Agile Methodologist, GXS Author, Pro JavaFX Platform OSCON Java Conference Chair Motorcyclist
  • 3. Pro JavaFX 2 Platform Coming Soon! Coming 2nd half of this year All examples rewritten in Java Will cover the new JavaFX 2.0 APIs 3
  • 4. Disclaimer: This is code-heavy THE FOLLOWING IS INTENDED TO STIMULATE CREATIVE USE OF JVM LANGUAGES. AFTER WATCHING THIS PRESENTATION YOU MAY FEEL COMPELLED TO START LEARNING A NEW JVM LANGUAGE AND WANT TO APPLY IT AT YOUR WORKPLACE. THE PRESENTER IS NOT LIABLE FOR ANY INNOVATION, BREAKTHROUGHS, OR NP-COMPLETE SOLUTIONS THAT MAY RESULT.
  • 6. JavaFX 2.0 Product Timeline CYQ1 2011 CYQ3 2011 CYQ2 2011 JavaFX 2.0 EA (Early Access) JavaFX 2.0 Beta JavaFX 2.0 GA (General Availability) Copyright 2010 Oracle JavaFX Beta Available Now!
  • 7. Programming Languages JavaFX 2.0 APIs are now in Java Pure Java APIs for all of JavaFX Expose JavaFX Binding, Sequences as Java APIs Embrace all JVM languages JRuby, Clojure, Groovy, Scala Fantom, Mira, Jython, etc. JavaFX Script is no longer supported by Oracle Existing JavaFX Script based applications will continue to run Visage is the open-source successor to the JavaFX Script language
  • 8. JavaFX in Java JavaFX API follows JavaBeans approach Similar in feel to other UI toolkits (Swing, etc) Uses builder pattern to minimize boilerplate
  • 9. Example Application public class HelloStage extends Application { @Override public void start(Stage stage) { stage.setTitle("Hello Stage"); stage.setWidth(600); stage.setHeight(450); Group root = new Group(); Scene scene = new Scene(root); scene.setFill(Color.LIGHTGREEN); stage.setScene(scene); stage.setVisible(true); } public static void main(String[] args) { launch(HelloStage.class, args); } }
  • 10. Binding Unquestionably the biggest JavaFX Script innovation Supported via a PropertyBinding class Lazy invocation for high performance Static construction syntax for simple cases e.g.: bindTo(<property>)
  • 11. Observable Pseudo-Properties Supports watching for changes to properties Implemented via anonymous inner classes Will take advantage of closures in the future
  • 12. Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() { });
  • 13. Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() { }); The property we want to watch
  • 14. Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() { }); Only one listener used with generics to specify the data type
  • 15. Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() { public void changed(ObservableValue<? extends Boolean> property, Boolean oldValue, Boolean value) { } }); Refers to the Rectangle.hoverProperty()
  • 16. Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() { public void changed(ObservableValue<? extends Boolean> property, Boolean oldValue, Boolean value) { rect.setFill(rect.isHover() ? Color.GREEN : Color.RED); } });
  • 17. Sequences in Java Replaced with an Observable List Public API is based on JavaFX sequences Internal code can use lighter collections API JavaFX 2.0 also has an Observable Map
  • 19.
  • 22.
  • 23. JRuby Example 1: Simple Stage require 'java' Application = Java::javafx.application.Application Stage = Java::javafx.stage.Stage Scene = Java::javafx.scene.Scene Color = Java::javafx.scene.paint.Color class HelloStage< Application def start(stage) ..... end end Application.launch(HelloStage.new); stage.title = 'Hello Stage (JRuby)' stage.width = 600 stage.height = 450 scene = Scene.new scene.fill = Color::LIGHTGREEN stage.scene = scene stage.visible = true;
  • 24. JRuby Example 2 rect = Rectangle.new rect.x = 25 rect.y = 40 rect.width = 100 rect.height = 50 rect.fill = Color::RED root.children.add(rect) timeline = Timeline.new timeline.cycle_count= Timeline::INDEFINITE timeline.auto_reverse = true kv = KeyValue.new(rect.xProperty, 200); kf = KeyFrame.new(Duration.valueOf(500), kv); timeline.key_frames.addkf; timeline.play();
  • 25. JRuby Closure Conversion rect.hoverProperty.addListener() do |prop, oldVal, newVal| rect.fill = rect.hover ? Color::GREEN : Color::RED; end 23
  • 26. JRubySwiby require 'swiby' class HelloWorldModel attr_accessor :saying end model = HelloWorldModel.new model.saying = "Hello World" Frame { title "Hello World“ width 200 content { Label { text bind(model,:saying) } } visible true } 24
  • 27. 25 JavaFX With Clojure Artwork by Augusto Sellhorn http://sellmic.com/
  • 28. A Little About Clojure Started in 2007 by Rich Hickey Functional Programming Language Derived from LISP Optimized for High Concurrency … and looks nothing like Java! 26 (def hello (fn [] "Hello world")) (hello)
  • 29. Clojure Syntax in One Slide Symbols numbers – 2.178 ratios – 355/113 strings – “clojure”, “rocks” characters – symbols – a b c d keywords – :alpha :beta boolean – true, false null - nil Collections (commas optional) Lists (1, 2, 3, 4, 5) Vectors [1, 2, 3, 4, 5] Maps {:a 1, :b 2, :c 3, :d 4} Sets #{:a :b :c :d :e} 27 (plus macros that are syntactic sugar wrapping the above)
  • 30. Clojure GUI Example (defnjavafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFill scene Color/LIGHTGREEN) (.setWidth stage 600) (.setHeight stage 450) (.setScene stage scene) (.setVisible stage true))) (javafxapp) 28
  • 31. Clojure GUI Example (defnjavafxapp[] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFill scene Color/LIGHTGREEN) (.setWidth stage 600) (.setHeight stage 450) (.setScene stage scene) (.setVisible stage true))) (javafxapp) 29 Create a Function for the Application
  • 32. Clojure GUI Example (defnjavafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFill scene Color/LIGHTGREEN) (.setWidth stage 600) (.setHeight stage 450) (.setScene stage scene) (.setVisible stage true))) (javafxapp) 30 Initialize the Stage and Scene Variables
  • 33. Clojure GUI Example (defnjavafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFill scene Color/LIGHTGREEN) (.setWidth stage 600) (.setHeight stage 450) (.setScene stage scene) (.setVisible stage true))) (javafxapp) 31 Call Setter Methods on Scene and Stage
  • 34. Clojure GUI Example (defnjavafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFillscene Color/LIGHTGREEN) (.setWidthstage 600) (.setHeightstage 450) (.setScenestage scene) (.setVisiblestage true))) (javafxapp) 32 Java Constant Syntax Java Method Syntax
  • 35. Simpler Code Using doto (defnjavafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (doto scene (.setFillColor/LIGHTGREEN)) (doto stage (.setWidth600) (.setHeight450) (.setScene scene) (.setVisibletrue)))) (javafxapp) 33
  • 36. Simpler Code Using doto (defnjavafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (doto scene (.setFillColor/LIGHTGREEN)) (doto stage (.setWidth 600) (.setHeight 450) (.setScene scene) (.setVisible true)))) (javafxapp) 34 doto form: (doto symbol (.method params)) equals: (.method symbol params)
  • 37. Refined Clojure GUI Example (defnjavafxapp [] (doto (Stage. "JavaFX Stage") (.setWidth600) (.setHeight450) (.setScene (doto (Scene.) (.setFillColor/LIGHTGREEN) (.setContent (list (doto (Rectangle.) (.setX25) (.setY40) (.setWidth100) (.setHeight50) (.setFillColor/RED)))))) (.setVisibletrue))) (javafxapp) 35
  • 38. Refined Clojure GUI Example (defnjavafxapp [] (doto(Stage. "JavaFX Stage") (.setWidth 600) (.setHeight 450) (.setScene (doto(Scene.) (.setFillColor/LIGHTGREEN) (.setContent (list (doto (Rectangle.) (.setX 25) (.setY 40) (.setWidth 100) (.setHeight 50) (.setFillColor/RED)))))) (.setVisible true))) (javafxapp) 36 Let replaced with inline declarations
  • 39. Refined Clojure GUI Example (defnjavafxapp [] (doto (Stage. "JavaFX Stage") (.setWidth 600) (.setHeight 450) (.setScene (doto (Scene.) (.setFillColor/LIGHTGREEN) (.setContent (list (doto (Rectangle.) (.setX 25) (.setY 40) (.setWidth 100) (.setHeight 50) (.setFillColor/RED)))))) (.setVisible true))) (javafxapp) 37 Doto allows nested data structures
  • 40. Refined Clojure GUI Example (defnjavafxapp [] (doto (Stage. "JavaFX Stage") (.setWidth 600) (.setHeight 450) (.setScene (doto (Scene.) (.setFillColor/LIGHTGREEN) (.setContent (list (doto (Rectangle.) (.setX 25) (.setY 40) (.setWidth 100) (.setHeight 50) (.setFillColor/RED)))))) (.setVisible true))) (javafxapp) 38 Now a nested Rectangle fits!
  • 41. Closures in Clojure 39 Inner classes can be created using proxy (.addListenerhoverProperty (proxy [ChangeListener] [] (changed [p, o, v] (.setFillrect (if (.isHoverrect) Color/GREEN Color/RED)))))
  • 42. Closures in Clojure Inner classes can be created using proxy 40 Proxy form: (proxy [class] [args] fs+) f => (name [params*] body) (.addListenerhoverProperty (proxy[ChangeListener][] (changed [p, o, v] (.setFillrect (if (.isHoverrect) Color/GREEN Color/RED)))))
  • 44. Features of Groovy Tight integration with Java Very easy to port from Java to Groovy Declarative syntax Familiar to JavaFX Script developers Builders
  • 45. Step 1: Lazy conversion to Groovy class HelloStage extends Application { void start(stage) { stage.setTitle("Hello Stage (Groovy)"); stage.setWidth(600); stage.setHeight(450); Group root = new Group(); Scene scene = new Scene(root); scene.setFill(Color.LIGHTSKYBLUE); stage.setScene(scene); stage.setVisible(true); } static void main(args) { launch(HelloStage.class, args); } }
  • 46. Step 2: Slightly More Groovy class HelloStage extends Application { void start(stage) { stage.setTitle("Hello Stage (Groovy)"); stage.setScene(new Scene( width: 600, height: 450, fill: Color.LIGHTSKYBLUE root: new Group() )); stage.setVisible(true); } static void main(args) { launch(HelloStage.class, args); } }
  • 47. Introducing GroovyFX Groovy DSL for JavaFX Started by James Clark In Alpha 1.0 State http://groovy.codehaus.org/GroovyFX
  • 48. Step 3: Using GroovyFX GroovyFX.start ({ def sg = new SceneGraphBuilder(); def stage = sg.stage( title: "Hello World", width: 600, height: 450, visible: true ) { scene(fill: Color.LIGHTSKYBLUE) { ... } ) }
  • 49. Step 4: With Content GroovyFX.start ({ def sg = new SceneGraphBuilder(); def stage = sg.stage( title: "Hello World", width: 600, height: 450, visible: true ) { scene(fill: Color.LIGHTSKYBLUE) { rectangle( x: 25, y: 40, width: 100, height: 50, fill: Color.RED ) })}
  • 50. FX Script Animation in Groovy
  • 51. Step 1: JavaFX Script def timeline = Timeline { repeatCount: Timeline.INDEFINITE autoReverse: true keyFrames: [ KeyFrame { time: 750ms values : [ rect1.x => 200.0 tweenInterpolator.LINEAR, rect2.y => 200.0 tweenInterpolator.LINEAR, circle1.radius => 200.0 tweenInterpolator.LINEAR ] } ]; } timeline.play();
  • 52. Step 1a: JavaFX Script Simplification def timeline = Timeline { repeatCount: Timeline.INDEFINITE autoReverse: true keyFrames: at (750ms) { rect1.x => 200.0 tween Interpolator.LINEAR; rect2.y => 200.0 tween Interpolator.LINEAR; circle1.radius => 200.0 tween Interpolator.LINEAR; } } timeline.play();
  • 53. Step 2: Java-ish Groovy Animations final Timeline timeline = new Timeline( cycleCount: Timeline.INDEFINITE, autoReverse: true ) final KeyValue kv1 = new KeyValue (rect1.xProperty(), 200); final KeyValue kv2 = new KeyValue (rect2.yProperty(), 200); final KeyValue kv3 = new KeyValue (circle1.radiusProperty(), 200); final KeyFramekf = new KeyFrame(Duration.valueOf(750), kv1, kv2, kv3); timeline.getKeyFrames().add(kf); timeline.play();
  • 54. Step 3: GroovyFX Animation timeline = timeline(cycleCount: Timeline.INDEFINITE, autoReverse: true) { at 750.ms { change (rect1, "y") { to 200 } change (rect2, "x") { to 200 } change (circle, "radius") { to 200 } } } timeline.play();
  • 55. Groovy Closures - With interface coercion def f = { p, o, v -> rect.setFill(rect.isHover() ? Color.GREEN : Color.RED); } as ChangeListener; rect.hoverProperty().addListener(f);
  • 56. 54 JavaFX With Scala
  • 57. What is Scala Started in 2001 by Martin Odersky Compiles to Java bytecodes Pure object-oriented language Also a functional programming language 55
  • 58. Why Scala? Shares many language features with JavaFX Script that make GUI programming easier: Static type checking – Catch your errors at compile time Closures – Wrap behavior and pass it by reference Declarative – Express the UI by describing what it should look like Scala also supports DSLs! 56
  • 59. Java vs. Scala DSL public class HelloStage extends Application { public void start(Stage stage) { stage.setTitle("Hello Stage"); stage.setWidth(600); stage.setHeight(450); Scene scene = new Scene(); scene.setFill(Color.LIGHTGREEN); Rectangle rect = new Rectangle(); rect.setX(25); rect.setY(40); rect.setWidth(100); rect.setHeight(50); rect.setFill(Color.RED); stage.add(rect); stage.setScene(scene); stage.setVisible(true); } public static void main(String[] args) { Launcher.launch(HelloStage.class, args); } } object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } 57 21 Lines 541 Characters 17 Lines 324 Characters
  • 60. object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } 58
  • 61. 59 object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } Base class for JavaFX applications
  • 62. 60 object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } Declarative Stage definition
  • 63. 61 object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } Inline property definitions
  • 64. 62 object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } List Construction Syntax
  • 65. Animation in Scala def timeline = new Timeline { repeatCount = INDEFINITE autoReverse = true keyFrames = List( new KeyFrame(time: 50) { values = List( new KeyValue(rect1.xProperty -> 300), new KeyValue(rect2.yProperty -> 500), new KeyValue(rect2.widthProperty -> 150) ) } ) } 63
  • 66. def timeline = new Timeline { repeatCount = INDEFINITE autoReverse = true keyFrames = List( new KeyFrame(time: 50) { values = List( new KeyValue(rect1.xProperty -> 300), new KeyValue(rect2.yProperty -> 500), new KeyValue(rect2.widthProperty -> 150) ) } ) } Animation in Scala 64 Duration set by Constructor Parameter
  • 67. Animation in Scala 65 def timeline = new Timeline { repeatCount = INDEFINITE autoReverse = true keyFrames = List( new KeyFrame(time: 50) { values = List( new KeyValue(rect1.xProperty -> 300), new KeyValue(rect2.yProperty -> 500), new KeyValue(rect2.widthProperty -> 150) ) } ) } Operator overloading for animation syntax
  • 68. Closures in Scala 66 Closures are also supported in Scala And they are 100% type-safe rect.hoverProperty.addListener((p, o, v) => { rect.fill = if (rect.hover) Color.GREEN else Color.RED })
  • 69. Closures in Scala Closures are also supported in Scala And they are 100% type-safe 67 rect.hoverProperty.addListener((p, o, v) => { rect.fill = if (rect.hover) Color.GREEN else Color.RED }) Compact syntax (params) => {body}
  • 70. Other JVM Languages to Try Jython Started by Jim Hugunin High Performance Python Mirah Invented by Charles Nutter Originally called Duby Local Type Inference, Static and Dynamic Typing Fantom Created by Brian and Andy Frank Originally called Fan Built-in Declarative Syntax Portable to Java and .NET Local Type Inference, Static and Dynamic Typing 68
  • 71. Fantom Code Example Void main() { Stage { title= "Hello Stage" width= 600 height= 450 Scene { fill= Color.LIGHTGREEN Rectangle { x= 25 y= 40 width= 100 height= 50 fill= Color.RED } } }.open } 69
  • 72. timeline := Timeline { repeatCount = Timeline.INDEFINITE autoReverse = true KeyFrame { time = 50ms KeyValue(rect1.x()-> 300), KeyValue(rect2.y() -> 500), KeyValue(rect2.width() -> 150) } } Animation in Fantom 70 Fantom has a built-in Duration type And also supports operator overloading
  • 73.
  • 74. How about JavaFX on… Visage Stage { title: "Hello Stage" width: 600 height: 450 scene: Scene { fill: Color.LIGHTGREEN content: Rectangle { x: 25 y: 40 width: 100 height: 50 fill: Color.RED } } } 72
  • 75. How about JavaFX on… Visage Stage { title: "Hello Stage" width: 600 height: 450 scene: Scene { fill: Color.LIGHTGREEN content: Rectangle { x: 25 y: 40 width: 100 height: 50 fill: Color.RED } } } 73
  • 76. How about JavaFX on… Visage Stage { title: "Hello Stage" width: 600 height: 450 Scene { fill: Color.LIGHTGREEN Rectangle { x: 25 y: 40 width: 100 height: 50 fill: Color.RED } } } 74
  • 77. Visage on Android Curious? Drop by room 4 after this talk to find out more…
  • 78. Conclusion You can write JavaFX applications in pure Java JavaFX is also usable in alternate languages Over time improved support is possible Groovy Builders, Scala DSL, Visage
  • 79. 77 Stephen Chin steveonjava@gmail.com tweet: @steveonjava

Editor's Notes

  1. There are two kinds of listener: ‘changedListener’ and ‘ChangingListener’. Being informed of the change before it happens allow for it to be vetoed.It is also possible to either watch a single property, or all properties belonging to a bean.Note that the value passed to the callback is the old value. This is to ensure that we aren’t eagerly computing the new value when it might not be required. To get the new value, you can call the function on the bean or via the propertyReference
  2. There are two kinds of listener: ‘changedListener’ and ‘ChangingListener’. Being informed of the change before it happens allow for it to be vetoed.It is also possible to either watch a single property, or all properties belonging to a bean.Note that the value passed to the callback is the old value. This is to ensure that we aren’t eagerly computing the new value when it might not be required. To get the new value, you can call the function on the bean or via the propertyReference
  3. There are two kinds of listener: ‘changedListener’ and ‘ChangingListener’. Being informed of the change before it happens allow for it to be vetoed.It is also possible to either watch a single property, or all properties belonging to a bean.Note that the value passed to the callback is the old value. This is to ensure that we aren’t eagerly computing the new value when it might not be required. To get the new value, you can call the function on the bean or via the propertyReference
  4. There are two kinds of listener: ‘changedListener’ and ‘ChangingListener’. Being informed of the change before it happens allow for it to be vetoed.It is also possible to either watch a single property, or all properties belonging to a bean.Note that the value passed to the callback is the old value. This is to ensure that we aren’t eagerly computing the new value when it might not be required. To get the new value, you can call the function on the bean or via the propertyReference
  5. There are two kinds of listener: ‘changedListener’ and ‘ChangingListener’. Being informed of the change before it happens allow for it to be vetoed.It is also possible to either watch a single property, or all properties belonging to a bean.Note that the value passed to the callback is the old value. This is to ensure that we aren’t eagerly computing the new value when it might not be required. To get the new value, you can call the function on the bean or via the propertyReference
  6. There are two kinds of listener: ‘changedListener’ and ‘ChangingListener’. Being informed of the change before it happens allow for it to be vetoed.It is also possible to either watch a single property, or all properties belonging to a bean.Note that the value passed to the callback is the old value. This is to ensure that we aren’t eagerly computing the new value when it might not be required. To get the new value, you can call the function on the bean or via the propertyReference
  7. Slight conversion to Groovy. This can be compiled by the Groovy compiler and run, but basically there is only one line difference (the ‘static void main’ line)
  8. This is the same code as the previous slide, taking advantage of some of the Groovy syntax tricks. This is getting to look a lot more like JavaFX Script.
  9. This DSL handles running on the EDT, and can actually be run as-is – there is no need for a class declaration, or anything else to ensure that we’re on the EDT. This is getting us fairly close to the simple JavaFX Script at the beginning
  10. This DSL handles running on the EDT, and can actually be run as-is – there is no need for a class declaration, or anything else to ensure that we’re on the EDT. This is getting us fairly close to the simple JavaFX Script at the beginning