SlideShare une entreprise Scribd logo
1  sur  83
Télécharger pour lire hors ligne
JavaFX Your Way
Building JavaFX Applications with Alternative Languages
Stephen Chin
GXS
steveonjava@gmail.com
tweet: @steveonjava
Jonathan Giles
Oracle
Jonathan.giles@oracle.com
tweet: @jonathangiles
Meet the Presenters…
Steve Jonathan
2
Family Man
A reasonable facsimile of…
Motorcyclist
Challenge the Presenter…
Challenge the Presenter…
Disclaimer:
This is proof of
concept
THE FOLLOWING IS INTENDED TO OUTLINE ORACLE’S GENERAL
PRODUCT DIRECTION. IT IS INTENDED FOR INFORMATION
PURPOSES ONLY, AND MAY NOT BE INCORPORATED INTO ANY
CONTRACT. IT IS NOT A COMMITMENT TO DELIVER ANY
MATERIAL, CODE, OR FUNCTIONALITY, AND SHOULD NOT BE
RELIED UPON IN MAKING PURCHASING DECISION. THE
DEVELOPMENT, RELEASE, AND TIMING OF ANY FEATURES OR
FUNCTIONALITY DESCRIBED FOR ORACLE'S PRODUCTS REMAINS
AT THE SOLE DISCRETION OF ORACLE.
Disclaimer #2:
This is code-heavy
Overall Presentation Goal
Demonstrate the future potential of the JavaFX platform.
Agenda
> JavaFX 2.0 Announcement
> JavaFX in Java
> Explore alternative languages
 JRuby
 Clojure
 Groovy
 Scala
 +???
JavaFX 2.0 Announcement
• JavaFX Script is no longer required to write
JavaFX applications
• Benefits:
– Easier integration with business logic on JVM
– Access to generics, annotations, (closures), etc
– Java has great IDE support
• Downsides:
– JavaFX Script was kind to us
JavaFX With Java
JavaFX in Java
> JavaFX API follows JavaBeans approach
> Similar in feel to other UI toolkits (Swing, etc.)
> Researching approaches to minimize boilerplate
Binding
> Unquestionably the biggest JavaFX Script
innovation
> Will be 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
Rectangle rect = new Rectangle();
rect.setX(40);
rect.setY(40);
rect.setWidth(100);
rect.setHeight(200);
rect.addChangedListener(Rectangle.HOVER, new Listener() {
});
Observable Pseudo-Properties
Rectangle rect = new Rectangle();
rect.setX(40);
rect.setY(40);
rect.setWidth(100);
rect.setHeight(200);
rect.addChangedListener(Rectangle.HOVER, new Listener() {
});
The property we want to watch
Observable Pseudo-Properties
Rectangle rect = new Rectangle();
rect.setX(40);
rect.setY(40);
rect.setWidth(100);
rect.setHeight(200);
rect.addChangedListener(Rectangle.HOVER, new Listener() {
});
Only one listener used
regardless of data type
Observable Pseudo-Properties
Rectangle rect = new Rectangle();
rect.setX(40);
rect.setY(40);
rect.setWidth(100);
rect.setHeight(200);
rect.addChangedListener(Rectangle.HOVER, new Listener() {
public void handle(Bean bean, PropertyReference pr) {
}
});
Rectangle is a Bean
Observable Pseudo-Properties
Rectangle rect = new Rectangle();
rect.setX(40);
rect.setY(40);
rect.setWidth(100);
rect.setHeight(200);
rect.addChangedListener(Rectangle.HOVER, new Listener() {
public void handle(Bean bean, PropertyReference pr) {
}
});
Refers to the
Rectangle.hover ‘property’
Observable Pseudo-Properties
Rectangle rect = new Rectangle();
rect.setX(40);
rect.setY(40);
rect.setWidth(100);
rect.setHeight(200);
rect.addChangedListener(Rectangle.HOVER, new Listener() {
public void handle(Bean bean, PropertyReference pr) {
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 will also have an Observable Map
Example Application
public class HelloStage implements Runnable {
public void run() {
Stage stage = new Stage();
stage.setTitle("Hello Stage");
stage.setWidth(600);
stage.setHeight(450);
Scene scene = new Scene();
scene.setFill(Color.LIGHTGREEN);
stage.setScene(scene);
stage.setVisible(true);
}
public static void main(String[] args) {
FX.start(new HelloStage());
}
}
Summary
> The JVM has a modern UI toolkit coming to it
> Total port to Java – no hacks or kludges
> Many languages to choose from
> Alternate languages == exciting possibilities
> Choose the best language for your needs
Major Question
24
How can alternative languages make developing
JavaFX user interfaces easier & more productive?
JavaFX With JRuby
Why JRuby?
> Direct access to Java APIs
> Dynamic Typing
> Closures
> ‘Closure conversion’ for interfaces
Java in JRuby
- Accessing Properties
timeline.setAutoReverse(true)
timeline.autoReverse = true
timeline.auto_reverse = true
timeline.getKeyFrames().add(kf)
timeline.key_frames.add(kf)
timeline.key_frames.add kf
JRuby Example 1: Simple Stage
require 'java'
FX = Java::javafx.lang.FX
Stage = Java::javafx.stage.Stage
Scene = Java::javafx.scene.Scene
Color = Java::javafx.scene.paint.Color
class HelloStage
include java.lang.Runnable
def run
.....
end
end
FX.start(HelloStage.new);
stage = Stage.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
scene.content.add(rect)
timeline = Timeline.new
timeline.repeat_count = Timeline::INDEFINITE
timeline.auto_reverse = true
kv = KeyValue.new(rect.x(), 200);
kf = KeyFrame.new(Duration.valueOf(500), kv);
timeline.key_frames.add kf;
timeline.play();
JRuby Closure Conversion
rect.add_changed_listener(Rectangle::HOVER) do |bean, pr|
rect.fill = rect.hover ? Color::GREEN : Color::RED;
end
30
JRuby Swiby
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
}
31
32
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!
33
(def hello (fn [] "Hello world"))
(hello)
Clojure Syntax in One Slide
Symbols
> numbers – 2.178
> ratios – 355/113
> strings – “clojure”, “rocks”
> characters – a b c d
> 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}
34
(plus macros that are syntactic sugar wrapping the above)
Clojure GUI Example
(defn javafxapp []
(let [stage (Stage. "JavaFX Stage")
scene (Scene.)]
(.setFill scene Color/LIGHTGREEN)
(.setWidth stage 600)
(.setHeight stage 450)
(.setScene stage scene)
(.setVisible stage true)))
(javafxapp)
35
Clojure GUI Example
(defn javafxapp []
(let [stage (Stage. "JavaFX Stage")
scene (Scene.)]
(.setFill scene Color/LIGHTGREEN)
(.setWidth stage 600)
(.setHeight stage 450)
(.setScene stage scene)
(.setVisible stage true)))
(javafxapp)
36
Create a Function for
the Application
Clojure GUI Example
(defn javafxapp []
(let [stage (Stage. "JavaFX Stage")
scene (Scene.)]
(.setFill scene Color/LIGHTGREEN)
(.setWidth stage 600)
(.setHeight stage 450)
(.setScene stage scene)
(.setVisible stage true)))
(javafxapp)
37
Initialize the Stage and
Scene Variables
Clojure GUI Example
(defn javafxapp []
(let [stage (Stage. "JavaFX Stage")
scene (Scene.)]
(.setFill scene Color/LIGHTGREEN)
(.setWidth stage 600)
(.setHeight stage 450)
(.setScene stage scene)
(.setVisible stage true)))
(javafxapp)
38
Call Setter Methods
on Scene and Stage
Clojure GUI Example
(defn javafxapp []
(let [stage (Stage. "JavaFX Stage")
scene (Scene.)]
(.setFill scene Color/LIGHTGREEN)
(.setWidth stage 600)
(.setHeight stage 450)
(.setScene stage scene)
(.setVisible stage true)))
(javafxapp)
39
Java Constant Syntax
Java Method Syntax
Simpler Code Using doto
(defn javafxapp []
(let [stage (Stage. "JavaFX Stage")
scene (Scene.)]
(doto scene
(.setFill Color/LIGHTGREEN))
(doto stage
(.setWidth 600)
(.setHeight 450)
(.setScene scene)
(.setVisible true))))
(javafxapp)
40
Simpler Code Using doto
(defn javafxapp []
(let [stage (Stage. "JavaFX Stage")
scene (Scene.)]
(doto scene
(.setFill Color/LIGHTGREEN))
(doto stage
(.setWidth 600)
(.setHeight 450)
(.setScene scene)
(.setVisible true))))
(javafxapp)
41
doto form:
(doto symbol
(.method params))
equals:
(.method symbol params)
Refined Clojure GUI Example
(defn javafxapp []
(doto (Stage. "JavaFX Stage")
(.setWidth 600)
(.setHeight 450)
(.setScene (doto (Scene.)
(.setFill Color/LIGHTGREEN)
(.setContent (list (doto (Rectangle.)
(.setX 25)
(.setY 40)
(.setWidth 100)
(.setHeight 50)
(.setFill Color/RED))))))
(.setVisible true)))
(javafxapp)
42
Refined Clojure GUI Example
(defn javafxapp []
(doto (Stage. "JavaFX Stage")
(.setWidth 600)
(.setHeight 450)
(.setScene (doto (Scene.)
(.setFill Color/LIGHTGREEN)
(.setContent (list (doto (Rectangle.)
(.setX 25)
(.setY 40)
(.setWidth 100)
(.setHeight 50)
(.setFill Color/RED))))))
(.setVisible true)))
(javafxapp)
43
Let replaced with
inline declarations
Refined Clojure GUI Example
(defn javafxapp []
(doto (Stage. "JavaFX Stage")
(.setWidth 600)
(.setHeight 450)
(.setScene (doto (Scene.)
(.setFill Color/LIGHTGREEN)
(.setContent (list (doto (Rectangle.)
(.setX 25)
(.setY 40)
(.setWidth 100)
(.setHeight 50)
(.setFill Color/RED))))))
(.setVisible true)))
(javafxapp)
44
Doto allows nested
data structures
Refined Clojure GUI Example
(defn javafxapp []
(doto (Stage. "JavaFX Stage")
(.setWidth 600)
(.setHeight 450)
(.setScene (doto (Scene.)
(.setFill Color/LIGHTGREEN)
(.setContent (list (doto (Rectangle.)
(.setX 25)
(.setY 40)
(.setWidth 100)
(.setHeight 50)
(.setFill Color/RED))))))
(.setVisible true)))
(javafxapp)
45
Now a nested
Rectangle fits!
Closures in Clojure
46
> Inner classes can be created using proxy
(.addChangeListener rect Rectangle/HOVER
(proxy [BooleanListener] []
(handle [b, p, o]
(.setFill rect
(if (.isHover rect) Color/GREEN Color/RED)))))
Closures in Clojure
> Inner classes can be created using proxy
47
(.addChangeListener rect Rectangle/HOVER
(proxy [Listener] []
(handle [b, p]
(.setFill rect
(if (.isHover rect) Color/GREEN Color/RED)))))
Proxy form:
(proxy [class] [args] fs+)
f => (name [params*] body)
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
Example 1: Simple FX Script to Groovy
Step 1: Lazy conversion to Groovy
class HelloStage implements Runnable {
void run() {
Stage stage = new Stage();
stage.setTitle("Hello Stage (Groovy)“);
stage.setWidth(600);
stage.setHeight(450);
Scene scene = new Scene();
scene.setFill(Color.LIGHTSKYBLUE);
stage.setScene(scene);
stage.setVisible(true);
}
static void main(args) {
FX.start(new HelloStage());
}
}
Step 2: Slightly More Groovy
class HelloStage implements Runnable {
void run() {
new Stage(
title: "Hello Stage (Groovy)",
width: 600,
height: 450,
visible: true,
scene: new Scene(
fill: Color.LIGHTSKYBLUE,
)
);
}
static void main(args) {
FX.start(new HelloStage());
}
}
Slight Aside: Groovy Builders
> Groovy builders make writing custom DSLs easy
> For the next slide, I am using a builder I defined
> Hopefully the community will improve upon this
Step 3: Using a Groovy Builder
FxBuilder.build {
stage = stage(
title: "Hello World",
width: 600,
height: 450,
scene: scene(fill: Color.LIGHTSKYBLUE) {
...
}
)
stage.visible = true;
}
Step 4: With Content
FxBuilder.build {
stage = stage(
title: "Hello Rectangle (Groovy FxBuilder 2)",
width: 600,
height: 450,
scene: scene(fill: Color.LIGHTSKYBLUE) {
rectangle(
x: 25, y: 40,
width: 100, height: 50,
fill: Color.RED
)
}
)
stage.visible = true;
}
Example 2: 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 tween Interpolator.LINEAR,
rect2.y => 200.0 tween Interpolator.LINEAR,
circle1.radius => 200.0 tween Interpolator.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(
repeatCount: Timeline.INDEFINITE,
autoReverse: true
)
final KeyValue kv1 = new KeyValue (rect1.x(), 200);
final KeyValue kv2 = new KeyValue (rect2.y(), 200);
final KeyValue kv3 = new KeyValue (circle1.radius(), 200);
final KeyFrame kf = new KeyFrame(Duration.valueOf(750), kv1, kv2, kv3);
timeline.getKeyFrames().add(kf);
timeline.play();
Step 3: JavaFX Animation in Groovy
(Using Builders)
timeline = timeline(repeatCount: Timeline.INDEFINITE, autoReverse: true) {
keyframes {
keyframe(time: 750) {
keyvalue(target: rect1.y(), endValue: 200);
keyvalue(target: rect2.x(), endValue: 200);
keyvalue(target: circle1.radius(), endValue: 200);
}
}
}
timeline.play();
Groovy Closures
- With interface coercion
def f = {
bean, pr -> rect.setFill(rect.isHover() ? Color.GREEN : Color.RED);
} as Listener;
rect.addChangedListener(Rectangle.HOVER, f);
62
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
2001
• Scala Started
2003/2004
• Scala v1.0
2006
• Scala v2.0
2010
• Scala 2.8.0 (latest)
63
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!
64
Java vs. Scala DSL
public class HelloStage implements Runnable {
public void run() {
Stage stage = new 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) {
FX.start(new HelloStage());
}
}
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
})
}
}
}
65
22 Lines
545 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
})
}
}
}
66
67
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
68
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
69
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
70
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(50) {
values = List(
new KeyValue(rect1.x() -> 300),
new KeyValue(rect2.y() -> 500),
new KeyValue(rect2.width() -> 150)
)
}
)
}
71
Animation in Scala
72
Duration set by
Constructor Parameter
def timeline = new Timeline {
repeatCount = INDEFINITE
autoReverse = true
keyFrames = List(
new KeyFrame(50) {
values = List(
new KeyValue(rect1.x() -> 300),
new KeyValue(rect2.y() -> 500),
new KeyValue(rect2.width() -> 150)
)
}
)
}
Animation in Scala
73
Operator overloading for
animation syntax
def timeline = new Timeline {
repeatCount = INDEFINITE
autoReverse = true
keyFrames = List(
new KeyFrame(50) {
values = List(
new KeyValue(rect1.x() -> 300),
new KeyValue(rect2.y() -> 500),
new KeyValue(rect2.width() -> 150)
)
}
)
}
Closures in Scala
74
> Closures are also supported in Scala
> And they are 100% type-safe
rect.addChangedListener(Node.HOVER, (b, p, o) => {
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
75
rect.addChangedListener(Node.HOVER, (b, p) => {
rect.fill = if (rect.hover) Color.GREEN else Color.RED
})
Compact syntax
(params) => {body}
rect.addChangedListener(Node.HOVER, (b, p) => {
rect.fill = if (rect.hover) Color.GREEN else Color.RED
})
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
76
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
}
77
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
78
Fantom has a built-in
Duration type
And also supports
operator overloading
Announcing Project Visage
79
> 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/
> “Visage is a domain specific language (DSL)
designed for the express purpose of writing
user interfaces.”
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
}
}
}
80
Visage Android Workshop
Today @ 21:00 – 22:00
Room: BOF 2
Description:
Bring your Android device and learn how to build
and deploy Android market applications using the
Visage language.
Prizes will be awarded for finding defects
and helping the dev team make Visage
better.
81
Conclusion
> JavaFX as Java APIs is great
> Usable in alternate languages
> Over time improved support is possible
 Groovy Builders, Scala DSL, Visage
Remember: This is a proof of concept only – you
can not leave this session and do this today.
83
Stephen Chin
steveonjava@gmail.com
tweet: @steveonjava
Jonathan Giles
Jonathan.giles@oracle.com
tweet: @jonathangiles
Presentation will be posted at: http://steveonjava.com/

Contenu connexe

Tendances

Using Redux-Saga for Handling Side Effects
Using Redux-Saga for Handling Side EffectsUsing Redux-Saga for Handling Side Effects
Using Redux-Saga for Handling Side EffectsGlobalLogic Ukraine
 
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoDeveloper Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoThe Software House
 
Python decorators (中文)
Python decorators (中文)Python decorators (中文)
Python decorators (中文)Yiwei Chen
 
Codestrong 2012 breakout session hacking titanium
Codestrong 2012 breakout session   hacking titaniumCodestrong 2012 breakout session   hacking titanium
Codestrong 2012 breakout session hacking titaniumAxway Appcelerator
 
JavaScript Web Development
JavaScript Web DevelopmentJavaScript Web Development
JavaScript Web Developmentvito jeng
 
The Challenge of Bringing FEZ to PlayStation Platforms
The Challenge of Bringing FEZ to PlayStation PlatformsThe Challenge of Bringing FEZ to PlayStation Platforms
The Challenge of Bringing FEZ to PlayStation PlatformsMiguel Angel Horna
 
C++ game development with oxygine
C++ game development with oxygineC++ game development with oxygine
C++ game development with oxyginecorehard_by
 
Redux Sagas - React Alicante
Redux Sagas - React AlicanteRedux Sagas - React Alicante
Redux Sagas - React AlicanteIgnacio Martín
 
Kotlin Coroutines Reloaded
Kotlin Coroutines ReloadedKotlin Coroutines Reloaded
Kotlin Coroutines ReloadedRoman Elizarov
 
bullismo e scuola primaria
bullismo e scuola primariabullismo e scuola primaria
bullismo e scuola primariaimartini
 
The Ring programming language version 1.7 book - Part 93 of 196
The Ring programming language version 1.7 book - Part 93 of 196The Ring programming language version 1.7 book - Part 93 of 196
The Ring programming language version 1.7 book - Part 93 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 96 of 202
The Ring programming language version 1.8 book - Part 96 of 202The Ring programming language version 1.8 book - Part 96 of 202
The Ring programming language version 1.8 book - Part 96 of 202Mahmoud Samir Fayed
 
Programming with GUTs
Programming with GUTsProgramming with GUTs
Programming with GUTsKevlin Henney
 
The Ring programming language version 1.3 book - Part 85 of 88
The Ring programming language version 1.3 book - Part 85 of 88The Ring programming language version 1.3 book - Part 85 of 88
The Ring programming language version 1.3 book - Part 85 of 88Mahmoud Samir Fayed
 
Redux saga: managing your side effects. Also: generators in es6
Redux saga: managing your side effects. Also: generators in es6Redux saga: managing your side effects. Also: generators in es6
Redux saga: managing your side effects. Also: generators in es6Ignacio Martín
 
Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017Roman Elizarov
 

Tendances (20)

Using Redux-Saga for Handling Side Effects
Using Redux-Saga for Handling Side EffectsUsing Redux-Saga for Handling Side Effects
Using Redux-Saga for Handling Side Effects
 
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoDeveloper Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duo
 
Python decorators (中文)
Python decorators (中文)Python decorators (中文)
Python decorators (中文)
 
The Groovy Way
The Groovy WayThe Groovy Way
The Groovy Way
 
Codestrong 2012 breakout session hacking titanium
Codestrong 2012 breakout session   hacking titaniumCodestrong 2012 breakout session   hacking titanium
Codestrong 2012 breakout session hacking titanium
 
JavaScript Web Development
JavaScript Web DevelopmentJavaScript Web Development
JavaScript Web Development
 
The Challenge of Bringing FEZ to PlayStation Platforms
The Challenge of Bringing FEZ to PlayStation PlatformsThe Challenge of Bringing FEZ to PlayStation Platforms
The Challenge of Bringing FEZ to PlayStation Platforms
 
ZIO Queue
ZIO QueueZIO Queue
ZIO Queue
 
C++ game development with oxygine
C++ game development with oxygineC++ game development with oxygine
C++ game development with oxygine
 
Redux Sagas - React Alicante
Redux Sagas - React AlicanteRedux Sagas - React Alicante
Redux Sagas - React Alicante
 
Kotlin Coroutines Reloaded
Kotlin Coroutines ReloadedKotlin Coroutines Reloaded
Kotlin Coroutines Reloaded
 
bullismo e scuola primaria
bullismo e scuola primariabullismo e scuola primaria
bullismo e scuola primaria
 
The Ring programming language version 1.7 book - Part 93 of 196
The Ring programming language version 1.7 book - Part 93 of 196The Ring programming language version 1.7 book - Part 93 of 196
The Ring programming language version 1.7 book - Part 93 of 196
 
The Ring programming language version 1.8 book - Part 96 of 202
The Ring programming language version 1.8 book - Part 96 of 202The Ring programming language version 1.8 book - Part 96 of 202
The Ring programming language version 1.8 book - Part 96 of 202
 
Your code is not a string
Your code is not a stringYour code is not a string
Your code is not a string
 
Programming with GUTs
Programming with GUTsProgramming with GUTs
Programming with GUTs
 
The Ring programming language version 1.3 book - Part 85 of 88
The Ring programming language version 1.3 book - Part 85 of 88The Ring programming language version 1.3 book - Part 85 of 88
The Ring programming language version 1.3 book - Part 85 of 88
 
Redux saga: managing your side effects. Also: generators in es6
Redux saga: managing your side effects. Also: generators in es6Redux saga: managing your side effects. Also: generators in es6
Redux saga: managing your side effects. Also: generators in es6
 
Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017
 
Kpi driven-java-development-fn conf
Kpi driven-java-development-fn confKpi driven-java-development-fn conf
Kpi driven-java-development-fn conf
 

En vedette

Xml Introduction Practice
Xml Introduction PracticeXml Introduction Practice
Xml Introduction Practicequeenskimo
 
MySQL para Desenvolvedores de Games
MySQL para Desenvolvedores de GamesMySQL para Desenvolvedores de Games
MySQL para Desenvolvedores de GamesMySQL Brasil
 
Beginning Android Flash Development
Beginning Android Flash DevelopmentBeginning Android Flash Development
Beginning Android Flash DevelopmentStephen Chin
 
5 Ways to Get More Leads & Sales - M2Con Digital Marketing Conference
5 Ways to Get More Leads & Sales - M2Con Digital Marketing Conference5 Ways to Get More Leads & Sales - M2Con Digital Marketing Conference
5 Ways to Get More Leads & Sales - M2Con Digital Marketing ConferenceMannix Marketing, Inc.
 
JavaFX 2.0 and Alternative Languages
JavaFX 2.0 and Alternative LanguagesJavaFX 2.0 and Alternative Languages
JavaFX 2.0 and Alternative LanguagesStephen Chin
 
Social Networks and the Richness of Data
Social Networks and the Richness of DataSocial Networks and the Richness of Data
Social Networks and the Richness of Datalarsgeorge
 
JavaFX - Sketch Board to Production
JavaFX - Sketch Board to ProductionJavaFX - Sketch Board to Production
JavaFX - Sketch Board to ProductionYoav Aharoni
 
Blazing Data With Redis (and LEGOS!)
Blazing Data With Redis (and LEGOS!)Blazing Data With Redis (and LEGOS!)
Blazing Data With Redis (and LEGOS!)Justin Carmony
 
PlayNice.ly: Using Redis to store all our data, hahaha (Redis London Meetup)
PlayNice.ly: Using Redis to store all our data, hahaha (Redis London Meetup)PlayNice.ly: Using Redis to store all our data, hahaha (Redis London Meetup)
PlayNice.ly: Using Redis to store all our data, hahaha (Redis London Meetup)Adam Charnock
 
JavaFX 2 Rich Desktop Platform
JavaFX 2 Rich Desktop PlatformJavaFX 2 Rich Desktop Platform
JavaFX 2 Rich Desktop PlatformRajmahendra Hegde
 
Building RIA Applications with JavaFX
Building RIA Applications with JavaFXBuilding RIA Applications with JavaFX
Building RIA Applications with JavaFXMax Katz
 
Redis And python at pycon_2011
Redis And python at pycon_2011Redis And python at pycon_2011
Redis And python at pycon_2011sunilar0ra
 
Fun with ruby and redis, arrrrcamp edition, javier_ramirez, teowaki
Fun with ruby and redis, arrrrcamp edition, javier_ramirez, teowakiFun with ruby and redis, arrrrcamp edition, javier_ramirez, teowaki
Fun with ruby and redis, arrrrcamp edition, javier_ramirez, teowakijavier ramirez
 
JFXtras - JavaFX Controls, Layout, Services, and More
JFXtras - JavaFX Controls, Layout, Services, and MoreJFXtras - JavaFX Controls, Layout, Services, and More
JFXtras - JavaFX Controls, Layout, Services, and MoreStephen Chin
 
Redis/Lessons learned
Redis/Lessons learnedRedis/Lessons learned
Redis/Lessons learnedTit Petric
 
NoSQL Tel Aviv Meetup#1: Introduction to Polyglot Persistance
NoSQL Tel Aviv Meetup#1: Introduction to Polyglot PersistanceNoSQL Tel Aviv Meetup#1: Introduction to Polyglot Persistance
NoSQL Tel Aviv Meetup#1: Introduction to Polyglot PersistanceNoSQL TLV
 
JavaFX Layout Secrets with Amy Fowler
JavaFX Layout Secrets with Amy FowlerJavaFX Layout Secrets with Amy Fowler
JavaFX Layout Secrets with Amy FowlerStephen Chin
 

En vedette (20)

Xml Introduction Practice
Xml Introduction PracticeXml Introduction Practice
Xml Introduction Practice
 
MySQL para Desenvolvedores de Games
MySQL para Desenvolvedores de GamesMySQL para Desenvolvedores de Games
MySQL para Desenvolvedores de Games
 
Beginning Android Flash Development
Beginning Android Flash DevelopmentBeginning Android Flash Development
Beginning Android Flash Development
 
5 Ways to Get More Leads & Sales - M2Con Digital Marketing Conference
5 Ways to Get More Leads & Sales - M2Con Digital Marketing Conference5 Ways to Get More Leads & Sales - M2Con Digital Marketing Conference
5 Ways to Get More Leads & Sales - M2Con Digital Marketing Conference
 
JavaFX 2.0 and Alternative Languages
JavaFX 2.0 and Alternative LanguagesJavaFX 2.0 and Alternative Languages
JavaFX 2.0 and Alternative Languages
 
KeyValue Stores
KeyValue StoresKeyValue Stores
KeyValue Stores
 
Social Networks and the Richness of Data
Social Networks and the Richness of DataSocial Networks and the Richness of Data
Social Networks and the Richness of Data
 
JavaFX - Sketch Board to Production
JavaFX - Sketch Board to ProductionJavaFX - Sketch Board to Production
JavaFX - Sketch Board to Production
 
Blazing Data With Redis (and LEGOS!)
Blazing Data With Redis (and LEGOS!)Blazing Data With Redis (and LEGOS!)
Blazing Data With Redis (and LEGOS!)
 
PlayNice.ly: Using Redis to store all our data, hahaha (Redis London Meetup)
PlayNice.ly: Using Redis to store all our data, hahaha (Redis London Meetup)PlayNice.ly: Using Redis to store all our data, hahaha (Redis London Meetup)
PlayNice.ly: Using Redis to store all our data, hahaha (Redis London Meetup)
 
JavaFX 2 Rich Desktop Platform
JavaFX 2 Rich Desktop PlatformJavaFX 2 Rich Desktop Platform
JavaFX 2 Rich Desktop Platform
 
Building RIA Applications with JavaFX
Building RIA Applications with JavaFXBuilding RIA Applications with JavaFX
Building RIA Applications with JavaFX
 
Python redis talk
Python redis talkPython redis talk
Python redis talk
 
Redis And python at pycon_2011
Redis And python at pycon_2011Redis And python at pycon_2011
Redis And python at pycon_2011
 
Fun with ruby and redis, arrrrcamp edition, javier_ramirez, teowaki
Fun with ruby and redis, arrrrcamp edition, javier_ramirez, teowakiFun with ruby and redis, arrrrcamp edition, javier_ramirez, teowaki
Fun with ruby and redis, arrrrcamp edition, javier_ramirez, teowaki
 
JFXtras - JavaFX Controls, Layout, Services, and More
JFXtras - JavaFX Controls, Layout, Services, and MoreJFXtras - JavaFX Controls, Layout, Services, and More
JFXtras - JavaFX Controls, Layout, Services, and More
 
Redis/Lessons learned
Redis/Lessons learnedRedis/Lessons learned
Redis/Lessons learned
 
Redis, Resque & Friends
Redis, Resque & FriendsRedis, Resque & Friends
Redis, Resque & Friends
 
NoSQL Tel Aviv Meetup#1: Introduction to Polyglot Persistance
NoSQL Tel Aviv Meetup#1: Introduction to Polyglot PersistanceNoSQL Tel Aviv Meetup#1: Introduction to Polyglot Persistance
NoSQL Tel Aviv Meetup#1: Introduction to Polyglot Persistance
 
JavaFX Layout Secrets with Amy Fowler
JavaFX Layout Secrets with Amy FowlerJavaFX Layout Secrets with Amy Fowler
JavaFX Layout Secrets with Amy Fowler
 

Similaire à JavaFX Your Way - Devoxx Version

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 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 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 2011Stephen 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 Chinjaxconf
 
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
 
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
 
Hacking JavaFX with Groovy, Clojure, Scala, and Visage
Hacking JavaFX with Groovy, Clojure, Scala, and VisageHacking JavaFX with Groovy, Clojure, Scala, and Visage
Hacking JavaFX with Groovy, Clojure, Scala, and VisageStephen Chin
 
Greach, GroovyFx Workshop
Greach, GroovyFx WorkshopGreach, GroovyFx Workshop
Greach, GroovyFx WorkshopDierk König
 
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
 
Don't panic in Fortaleza - ScalaFX
Don't panic in Fortaleza - ScalaFXDon't panic in Fortaleza - ScalaFX
Don't panic in Fortaleza - ScalaFXAlain Béarez
 
The Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S GuideThe Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S GuideStephen Chin
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghStuart Roebuck
 
Julio Capote, Twitter
Julio Capote, TwitterJulio Capote, Twitter
Julio Capote, TwitterOntico
 
Vert.x - Reactive & Distributed [Devoxx version]
Vert.x - Reactive & Distributed [Devoxx version]Vert.x - Reactive & Distributed [Devoxx version]
Vert.x - Reactive & Distributed [Devoxx version]Orkhan Gasimov
 

Similaire à JavaFX Your Way - Devoxx Version (20)

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 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 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
 
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
 
JavaFX introduction
JavaFX introductionJavaFX introduction
JavaFX introduction
 
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]
 
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)
 
Hacking JavaFX with Groovy, Clojure, Scala, and Visage
Hacking JavaFX with Groovy, Clojure, Scala, and VisageHacking JavaFX with Groovy, Clojure, Scala, and Visage
Hacking JavaFX with Groovy, Clojure, Scala, and Visage
 
Groovy's Builder
Groovy's BuilderGroovy's Builder
Groovy's Builder
 
Greach, GroovyFx Workshop
Greach, GroovyFx WorkshopGreach, GroovyFx Workshop
Greach, GroovyFx Workshop
 
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...
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
Don't panic in Fortaleza - ScalaFX
Don't panic in Fortaleza - ScalaFXDon't panic in Fortaleza - ScalaFX
Don't panic in Fortaleza - ScalaFX
 
JavaFX
JavaFXJavaFX
JavaFX
 
I phone 12
I phone 12I phone 12
I phone 12
 
The Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S GuideThe Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S Guide
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup Edinburgh
 
Julio Capote, Twitter
Julio Capote, TwitterJulio Capote, Twitter
Julio Capote, Twitter
 
JavaFX Overview
JavaFX OverviewJavaFX Overview
JavaFX Overview
 
Vert.x - Reactive & Distributed [Devoxx version]
Vert.x - Reactive & Distributed [Devoxx version]Vert.x - Reactive & Distributed [Devoxx version]
Vert.x - Reactive & Distributed [Devoxx version]
 

Plus de Stephen Chin

DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2Stephen 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 CommunityStephen 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 GuideStephen Chin
 
DevOps Tools for Java Developers
DevOps Tools for Java DevelopersDevOps Tools for Java Developers
DevOps Tools for Java DevelopersStephen 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 LJCStephen Chin
 
RetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming ConsoleRetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming ConsoleStephen 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 WorkshopStephen Chin
 
Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)Stephen Chin
 
Confessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistConfessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistStephen Chin
 
Internet of Things Magic Show
Internet of Things Magic ShowInternet of Things Magic Show
Internet of Things Magic ShowStephen 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 UndeadStephen Chin
 
JCrete Embedded Java Workshop
JCrete Embedded Java WorkshopJCrete Embedded Java Workshop
JCrete Embedded Java WorkshopStephen Chin
 
Oracle IoT Kids Workshop
Oracle IoT Kids WorkshopOracle IoT Kids Workshop
Oracle IoT Kids WorkshopStephen Chin
 
OpenJFX on Android and Devices
OpenJFX on Android and DevicesOpenJFX on Android and Devices
OpenJFX on Android and DevicesStephen Chin
 
Java on Raspberry Pi Lab
Java on Raspberry Pi LabJava on Raspberry Pi Lab
Java on Raspberry Pi LabStephen 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 LegosStephen Chin
 
Devoxx4Kids NAO Workshop
Devoxx4Kids NAO WorkshopDevoxx4Kids NAO Workshop
Devoxx4Kids NAO WorkshopStephen Chin
 

Plus de 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
 
Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)
 
Confessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistConfessions of a Former Agile Methodologist
Confessions of a Former Agile Methodologist
 
Internet of Things Magic Show
Internet of Things Magic ShowInternet of Things Magic Show
Internet of Things Magic Show
 
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
 

Dernier

Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 

Dernier (20)

Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 

JavaFX Your Way - Devoxx Version

  • 1. JavaFX Your Way Building JavaFX Applications with Alternative Languages Stephen Chin GXS steveonjava@gmail.com tweet: @steveonjava Jonathan Giles Oracle Jonathan.giles@oracle.com tweet: @jonathangiles
  • 2. Meet the Presenters… Steve Jonathan 2 Family Man A reasonable facsimile of… Motorcyclist
  • 6. THE FOLLOWING IS INTENDED TO OUTLINE ORACLE’S GENERAL PRODUCT DIRECTION. IT IS INTENDED FOR INFORMATION PURPOSES ONLY, AND MAY NOT BE INCORPORATED INTO ANY CONTRACT. IT IS NOT A COMMITMENT TO DELIVER ANY MATERIAL, CODE, OR FUNCTIONALITY, AND SHOULD NOT BE RELIED UPON IN MAKING PURCHASING DECISION. THE DEVELOPMENT, RELEASE, AND TIMING OF ANY FEATURES OR FUNCTIONALITY DESCRIBED FOR ORACLE'S PRODUCTS REMAINS AT THE SOLE DISCRETION OF ORACLE.
  • 8. Overall Presentation Goal Demonstrate the future potential of the JavaFX platform.
  • 9. Agenda > JavaFX 2.0 Announcement > JavaFX in Java > Explore alternative languages  JRuby  Clojure  Groovy  Scala  +???
  • 10. JavaFX 2.0 Announcement • JavaFX Script is no longer required to write JavaFX applications • Benefits: – Easier integration with business logic on JVM – Access to generics, annotations, (closures), etc – Java has great IDE support • Downsides: – JavaFX Script was kind to us
  • 12. JavaFX in Java > JavaFX API follows JavaBeans approach > Similar in feel to other UI toolkits (Swing, etc.) > Researching approaches to minimize boilerplate
  • 13. Binding > Unquestionably the biggest JavaFX Script innovation > Will be supported via a PropertyBinding class > Lazy invocation for high performance > Static construction syntax for simple cases  e.g.: bindTo(<property>)
  • 14. Observable Pseudo-Properties > Supports watching for changes to properties > Implemented via anonymous inner classes > Will take advantage of closures in the future
  • 15. Observable Pseudo-Properties Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.addChangedListener(Rectangle.HOVER, new Listener() { });
  • 16. Observable Pseudo-Properties Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.addChangedListener(Rectangle.HOVER, new Listener() { }); The property we want to watch
  • 17. Observable Pseudo-Properties Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.addChangedListener(Rectangle.HOVER, new Listener() { }); Only one listener used regardless of data type
  • 18. Observable Pseudo-Properties Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.addChangedListener(Rectangle.HOVER, new Listener() { public void handle(Bean bean, PropertyReference pr) { } }); Rectangle is a Bean
  • 19. Observable Pseudo-Properties Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.addChangedListener(Rectangle.HOVER, new Listener() { public void handle(Bean bean, PropertyReference pr) { } }); Refers to the Rectangle.hover ‘property’
  • 20. Observable Pseudo-Properties Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.addChangedListener(Rectangle.HOVER, new Listener() { public void handle(Bean bean, PropertyReference pr) { rect.setFill(rect.isHover() ? Color.GREEN : Color.RED); } });
  • 21. 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 will also have an Observable Map
  • 22. Example Application public class HelloStage implements Runnable { public void run() { Stage stage = new Stage(); stage.setTitle("Hello Stage"); stage.setWidth(600); stage.setHeight(450); Scene scene = new Scene(); scene.setFill(Color.LIGHTGREEN); stage.setScene(scene); stage.setVisible(true); } public static void main(String[] args) { FX.start(new HelloStage()); } }
  • 23. Summary > The JVM has a modern UI toolkit coming to it > Total port to Java – no hacks or kludges > Many languages to choose from > Alternate languages == exciting possibilities > Choose the best language for your needs
  • 24. Major Question 24 How can alternative languages make developing JavaFX user interfaces easier & more productive?
  • 26. Why JRuby? > Direct access to Java APIs > Dynamic Typing > Closures > ‘Closure conversion’ for interfaces
  • 27. Java in JRuby - Accessing Properties timeline.setAutoReverse(true) timeline.autoReverse = true timeline.auto_reverse = true timeline.getKeyFrames().add(kf) timeline.key_frames.add(kf) timeline.key_frames.add kf
  • 28. JRuby Example 1: Simple Stage require 'java' FX = Java::javafx.lang.FX Stage = Java::javafx.stage.Stage Scene = Java::javafx.scene.Scene Color = Java::javafx.scene.paint.Color class HelloStage include java.lang.Runnable def run ..... end end FX.start(HelloStage.new); stage = Stage.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;
  • 29. JRuby Example 2 rect = Rectangle.new rect.x = 25 rect.y = 40 rect.width = 100 rect.height = 50 rect.fill = Color::RED scene.content.add(rect) timeline = Timeline.new timeline.repeat_count = Timeline::INDEFINITE timeline.auto_reverse = true kv = KeyValue.new(rect.x(), 200); kf = KeyFrame.new(Duration.valueOf(500), kv); timeline.key_frames.add kf; timeline.play();
  • 30. JRuby Closure Conversion rect.add_changed_listener(Rectangle::HOVER) do |bean, pr| rect.fill = rect.hover ? Color::GREEN : Color::RED; end 30
  • 31. JRuby Swiby 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 } 31
  • 32. 32 JavaFX With Clojure Artwork by Augusto Sellhorn http://sellmic.com/
  • 33. 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! 33 (def hello (fn [] "Hello world")) (hello)
  • 34. Clojure Syntax in One Slide Symbols > numbers – 2.178 > ratios – 355/113 > strings – “clojure”, “rocks” > characters – a b c d > 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} 34 (plus macros that are syntactic sugar wrapping the above)
  • 35. Clojure GUI Example (defn javafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFill scene Color/LIGHTGREEN) (.setWidth stage 600) (.setHeight stage 450) (.setScene stage scene) (.setVisible stage true))) (javafxapp) 35
  • 36. Clojure GUI Example (defn javafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFill scene Color/LIGHTGREEN) (.setWidth stage 600) (.setHeight stage 450) (.setScene stage scene) (.setVisible stage true))) (javafxapp) 36 Create a Function for the Application
  • 37. Clojure GUI Example (defn javafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFill scene Color/LIGHTGREEN) (.setWidth stage 600) (.setHeight stage 450) (.setScene stage scene) (.setVisible stage true))) (javafxapp) 37 Initialize the Stage and Scene Variables
  • 38. Clojure GUI Example (defn javafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFill scene Color/LIGHTGREEN) (.setWidth stage 600) (.setHeight stage 450) (.setScene stage scene) (.setVisible stage true))) (javafxapp) 38 Call Setter Methods on Scene and Stage
  • 39. Clojure GUI Example (defn javafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFill scene Color/LIGHTGREEN) (.setWidth stage 600) (.setHeight stage 450) (.setScene stage scene) (.setVisible stage true))) (javafxapp) 39 Java Constant Syntax Java Method Syntax
  • 40. Simpler Code Using doto (defn javafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (doto scene (.setFill Color/LIGHTGREEN)) (doto stage (.setWidth 600) (.setHeight 450) (.setScene scene) (.setVisible true)))) (javafxapp) 40
  • 41. Simpler Code Using doto (defn javafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (doto scene (.setFill Color/LIGHTGREEN)) (doto stage (.setWidth 600) (.setHeight 450) (.setScene scene) (.setVisible true)))) (javafxapp) 41 doto form: (doto symbol (.method params)) equals: (.method symbol params)
  • 42. Refined Clojure GUI Example (defn javafxapp [] (doto (Stage. "JavaFX Stage") (.setWidth 600) (.setHeight 450) (.setScene (doto (Scene.) (.setFill Color/LIGHTGREEN) (.setContent (list (doto (Rectangle.) (.setX 25) (.setY 40) (.setWidth 100) (.setHeight 50) (.setFill Color/RED)))))) (.setVisible true))) (javafxapp) 42
  • 43. Refined Clojure GUI Example (defn javafxapp [] (doto (Stage. "JavaFX Stage") (.setWidth 600) (.setHeight 450) (.setScene (doto (Scene.) (.setFill Color/LIGHTGREEN) (.setContent (list (doto (Rectangle.) (.setX 25) (.setY 40) (.setWidth 100) (.setHeight 50) (.setFill Color/RED)))))) (.setVisible true))) (javafxapp) 43 Let replaced with inline declarations
  • 44. Refined Clojure GUI Example (defn javafxapp [] (doto (Stage. "JavaFX Stage") (.setWidth 600) (.setHeight 450) (.setScene (doto (Scene.) (.setFill Color/LIGHTGREEN) (.setContent (list (doto (Rectangle.) (.setX 25) (.setY 40) (.setWidth 100) (.setHeight 50) (.setFill Color/RED)))))) (.setVisible true))) (javafxapp) 44 Doto allows nested data structures
  • 45. Refined Clojure GUI Example (defn javafxapp [] (doto (Stage. "JavaFX Stage") (.setWidth 600) (.setHeight 450) (.setScene (doto (Scene.) (.setFill Color/LIGHTGREEN) (.setContent (list (doto (Rectangle.) (.setX 25) (.setY 40) (.setWidth 100) (.setHeight 50) (.setFill Color/RED)))))) (.setVisible true))) (javafxapp) 45 Now a nested Rectangle fits!
  • 46. Closures in Clojure 46 > Inner classes can be created using proxy (.addChangeListener rect Rectangle/HOVER (proxy [BooleanListener] [] (handle [b, p, o] (.setFill rect (if (.isHover rect) Color/GREEN Color/RED)))))
  • 47. Closures in Clojure > Inner classes can be created using proxy 47 (.addChangeListener rect Rectangle/HOVER (proxy [Listener] [] (handle [b, p] (.setFill rect (if (.isHover rect) Color/GREEN Color/RED))))) Proxy form: (proxy [class] [args] fs+) f => (name [params*] body)
  • 49. Features of Groovy > Tight integration with Java  Very easy to port from Java to Groovy > Declarative syntax  Familiar to JavaFX Script developers > Builders
  • 50. Example 1: Simple FX Script to Groovy
  • 51. Step 1: Lazy conversion to Groovy class HelloStage implements Runnable { void run() { Stage stage = new Stage(); stage.setTitle("Hello Stage (Groovy)“); stage.setWidth(600); stage.setHeight(450); Scene scene = new Scene(); scene.setFill(Color.LIGHTSKYBLUE); stage.setScene(scene); stage.setVisible(true); } static void main(args) { FX.start(new HelloStage()); } }
  • 52. Step 2: Slightly More Groovy class HelloStage implements Runnable { void run() { new Stage( title: "Hello Stage (Groovy)", width: 600, height: 450, visible: true, scene: new Scene( fill: Color.LIGHTSKYBLUE, ) ); } static void main(args) { FX.start(new HelloStage()); } }
  • 53. Slight Aside: Groovy Builders > Groovy builders make writing custom DSLs easy > For the next slide, I am using a builder I defined > Hopefully the community will improve upon this
  • 54. Step 3: Using a Groovy Builder FxBuilder.build { stage = stage( title: "Hello World", width: 600, height: 450, scene: scene(fill: Color.LIGHTSKYBLUE) { ... } ) stage.visible = true; }
  • 55. Step 4: With Content FxBuilder.build { stage = stage( title: "Hello Rectangle (Groovy FxBuilder 2)", width: 600, height: 450, scene: scene(fill: Color.LIGHTSKYBLUE) { rectangle( x: 25, y: 40, width: 100, height: 50, fill: Color.RED ) } ) stage.visible = true; }
  • 56. Example 2: FX Script Animation in Groovy
  • 57. Step 1: JavaFX Script def timeline = Timeline { repeatCount: Timeline.INDEFINITE autoReverse: true keyFrames: [ KeyFrame { time: 750ms values : [ rect1.x => 200.0 tween Interpolator.LINEAR, rect2.y => 200.0 tween Interpolator.LINEAR, circle1.radius => 200.0 tween Interpolator.LINEAR ] } ]; } timeline.play();
  • 58. 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();
  • 59. Step 2: Java-ish Groovy Animations final Timeline timeline = new Timeline( repeatCount: Timeline.INDEFINITE, autoReverse: true ) final KeyValue kv1 = new KeyValue (rect1.x(), 200); final KeyValue kv2 = new KeyValue (rect2.y(), 200); final KeyValue kv3 = new KeyValue (circle1.radius(), 200); final KeyFrame kf = new KeyFrame(Duration.valueOf(750), kv1, kv2, kv3); timeline.getKeyFrames().add(kf); timeline.play();
  • 60. Step 3: JavaFX Animation in Groovy (Using Builders) timeline = timeline(repeatCount: Timeline.INDEFINITE, autoReverse: true) { keyframes { keyframe(time: 750) { keyvalue(target: rect1.y(), endValue: 200); keyvalue(target: rect2.x(), endValue: 200); keyvalue(target: circle1.radius(), endValue: 200); } } } timeline.play();
  • 61. Groovy Closures - With interface coercion def f = { bean, pr -> rect.setFill(rect.isHover() ? Color.GREEN : Color.RED); } as Listener; rect.addChangedListener(Rectangle.HOVER, f);
  • 63. What is Scala > Started in 2001 by Martin Odersky > Compiles to Java bytecodes > Pure object-oriented language > Also a functional programming language 2001 • Scala Started 2003/2004 • Scala v1.0 2006 • Scala v2.0 2010 • Scala 2.8.0 (latest) 63
  • 64. 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! 64
  • 65. Java vs. Scala DSL public class HelloStage implements Runnable { public void run() { Stage stage = new 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) { FX.start(new HelloStage()); } } 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 }) } } } 65 22 Lines 545 Characters 17 Lines 324 Characters
  • 66. 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 }) } } } 66
  • 67. 67 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
  • 68. 68 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
  • 69. 69 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
  • 70. 70 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
  • 71. Animation in Scala def timeline = new Timeline { repeatCount = INDEFINITE autoReverse = true keyFrames = List( new KeyFrame(50) { values = List( new KeyValue(rect1.x() -> 300), new KeyValue(rect2.y() -> 500), new KeyValue(rect2.width() -> 150) ) } ) } 71
  • 72. Animation in Scala 72 Duration set by Constructor Parameter def timeline = new Timeline { repeatCount = INDEFINITE autoReverse = true keyFrames = List( new KeyFrame(50) { values = List( new KeyValue(rect1.x() -> 300), new KeyValue(rect2.y() -> 500), new KeyValue(rect2.width() -> 150) ) } ) }
  • 73. Animation in Scala 73 Operator overloading for animation syntax def timeline = new Timeline { repeatCount = INDEFINITE autoReverse = true keyFrames = List( new KeyFrame(50) { values = List( new KeyValue(rect1.x() -> 300), new KeyValue(rect2.y() -> 500), new KeyValue(rect2.width() -> 150) ) } ) }
  • 74. Closures in Scala 74 > Closures are also supported in Scala > And they are 100% type-safe rect.addChangedListener(Node.HOVER, (b, p, o) => { rect.fill = if (rect.hover) Color.GREEN else Color.RED })
  • 75. Closures in Scala > Closures are also supported in Scala > And they are 100% type-safe 75 rect.addChangedListener(Node.HOVER, (b, p) => { rect.fill = if (rect.hover) Color.GREEN else Color.RED }) Compact syntax (params) => {body} rect.addChangedListener(Node.HOVER, (b, p) => { rect.fill = if (rect.hover) Color.GREEN else Color.RED })
  • 76. 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 76
  • 77. 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 } 77
  • 78. 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 78 Fantom has a built-in Duration type And also supports operator overloading
  • 79. Announcing Project Visage 79 > 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/ > “Visage is a domain specific language (DSL) designed for the express purpose of writing user interfaces.”
  • 80. 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 } } } 80
  • 81. Visage Android Workshop Today @ 21:00 – 22:00 Room: BOF 2 Description: Bring your Android device and learn how to build and deploy Android market applications using the Visage language. Prizes will be awarded for finding defects and helping the dev team make Visage better. 81
  • 82. Conclusion > JavaFX as Java APIs is great > Usable in alternate languages > Over time improved support is possible  Groovy Builders, Scala DSL, Visage Remember: This is a proof of concept only – you can not leave this session and do this today.
  • 83. 83 Stephen Chin steveonjava@gmail.com tweet: @steveonjava Jonathan Giles Jonathan.giles@oracle.com tweet: @jonathangiles Presentation will be posted at: http://steveonjava.com/

Notes de l'éditeur

  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. 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
  8. 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)
  9. 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.
  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
  11. 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