Professional Documents
Culture Documents
JavaFX
The Future of Mobile Applications
Ophir Radnitz
Consultant, AlphaCSP
Agenda
• Java’s story on the client
• JavaFX Script
• A Quick Dive Into JavaFX
• JavaFX Mobile
• Looking Ahead
• Demo
3
Agenda
• Java’s story on the client
• JavaFX Script
• A Quick Dive Into JavaFX
• JavaFX Mobile
• Looking Ahead
• Demo
4
The RiA Arena: Scene
• Universal availability
• Vector graphics and animation
• Multimedia
• Data & services consumption
• Responsiveness
• Components & widgets
• Access to local resources
5
The RiA Arena: Players
• Adobe AIR
– Formerly Apollo
– Flex, Flash
• Microsoft SilverLight
– Flash competitor
• Ajax
• OpenLaszlo
6
Current Java UI Availability
• Swing
– Desktop deployment
– WebStart
– Applets
• Web
• Phonetop
7
JavaFX, The Big Picture
8
Recent Developments
• Performance
– Hardware acceleration
– Painters caching
• Graphics
– Subpixel anti-aliasing
– Multi-stop gradients
• Beans binding
9
The Consumer JRE
• QuickStarter
• Java Kernel
• Deployment Toolkit
• Installer Improvements
• Nimbus Look & Feel
• Graphic acceleration for Windows
10
Agenda
• Java’s story on the client
• JavaFX Script
• A Quick Dive Into JavaFX
• JavaFX Mobile
• Looking Ahead
• Demo
11
What is JavaFX Script?
• DSL for UI
– Designed for rich content application
12
JavaFX Script History
13
JavaFX Script Evolution
• Originally resembled a modeling language
– UML-like notations
– Attribute cardinality
14
Language Features
• Statically typed
• Declarative syntax
• First-class functions (closures)
• List comprehensions
• Encapsulation features
– Classes , packages
– Inheritance
– Separate compilation & deployment units
15
Available Tools
• JavaFX Pad
• JavaFX Builder
• IDE plugins
– IntelliJ IDEA (IntelliJFX)
– NetBeans (JavaFX)
– Eclipse (JavaFX)
16
Agenda
• Java’s story on the client
• JavaFX script
• A Quick Dive Into JavaFX
• JavaFX Mobile
• Looking Ahead
• Demo
17
Basic Stuff
var s = “JavaEdge";
s.toUpperCase(); -> “JAVAEDGE”
s.substring(1); -> “ avaEdge "
var n = 1.5;
n.intValue(); ->1
(1.5).intValue(); -> 1
s.substring(n); -> " avaEdge "
var b = true;
b instanceof Boolean; -> true
18
Collections (1 of 4)
var weekDays = ["Sun“,"Mon","Tue","Wed","Thur"];
var days = [weekDays, ["Fri“,"Sat”]];
function factor(n) {
return product([1..n]);
}
19
Collections (2 of 4)
var numbers = [1,2,3,4];
20
Collections (3 of 4)
var x = [1,2,3];
var x = [1,2,3];
21
Collections (4 of 4)
var x = [1,2,3];
22
List Comprehensions
select n*n from n in [1..100]
function factors(n) {
return select i from i in [1..n/2] where n % i == 0;
}
23
Formatting
import java.util.Date;
24
Operators
var x = 2; import java.lang.Math;
var y = 4; Math.max(x, y); -> 4
var a = true;
var b = false; sizeof [x,y]; -> 2
[x,y][indexof . == 0]; -> 2
x == y; -> false
x <> y; -> true if a then x else y; -> 2
a and b; -> false
a or b; -> true x instanceof Number; -> true
not a; -> false
25
Classes
class Person {
attribute name: String;
attribute parent: Person inverse Person.children;
attribute children: Person* inverse Person.parent;
26
Objects
var avi = Person {
name: “Avi"
children: [Person {
name: “Itzik"
},
Person {
name: “Esav"
}]
};
27
Objects (with variables)
var avi = Person {
var: me
name: “Avi“
var child1 = Person {
name: “Itzik“
parent: me
}
var child2 = Person {
name: “Esav“
}
children: [child1, child2]
};
28
Attributes (properties)
class X {
attribute a: Number;
attribute b: Number;
}
attribute X.a = 5;
attribute X.b = 2;
29
Binding
class X {
attribute a: Number;
attribute b: Number;
attribute c: Number;
}
attribute X.a = 10;
attribute X.b = bind a + 10;
attribute X.c = bind b + 10;
30
Triggers
class X {
attribute numbers: Number*;
}
trigger on new X {
insert [3,4] into this. numbers;
}
31
UI
import javafx.ui.*;
Frame {
title: "Welcome to JavaEdge"
width: 200
height: 50
content: Label {
text: “Catching up on JavaFX"
}
visible: true
}
32
Animation
class Cell extends Rect {
attribute red : Number;
attribute col : Color;
}
33
Agenda
• Java’s story on the client
• JavaFX script
• A Quick Dive Into JavaFX
• Demo
• JavaFX Mobile
• Looking Ahead
• Demo
34
Demo
JavaFX Pad
35
Agenda
• Java’s story on the client
• JavaFX script
• A Quick Dive Into JavaFX
• Demo
• JavaFX Mobile
• Looking Ahead
• Demo
36
The Mobile Space
• The most ubiquitous application platform
– Over 1.8 billion mobile phones
37
The MSA Stack (JSR 248 & 249)
Security & Graphics Comms Personal Application
Commerce Information Connectivity
JSR 226 JSR 180
SVG SIP
Frameworks Applications
Messaging
Application APIs
Browser
UI Toolkit
Media Player
Application Manager
PIM & Phone Apps
Advanced Graphics Engine
Telephony Framework
Multimedia Framework
Software Update
Security Framework Native OS
System Libraries Low-Level Services
Java VM & Libraries
Linux Kernel
39
Write Once…
• “Write once run anywhere” – for UI too
– Desktop
– Web
– Mobile
– Embedded
40
Google Android
41
Agenda
• Java’s story on the client
• JavaFX script
• A Quick Dive Into JavaFX
• Demo
• JavaFX Mobile
• Looking Ahead
• Demo
42
Issues To Be Resolved
• Compiler
– in progress
• Tools!
– Some available
– Not prime time ready yet
JavaFX (conceptually)
JavaFX Compiler
46
Agenda
• Java’s story on the client
• JavaFX script
• A Quick Dive Into JavaFX
• Demo
• JavaFX Mobile
• The Near Future
• Demo
47
Demo
JFXBuilder
48