Professional Documents
Culture Documents
Presenting with
LOGO
http://docs.oracle.com/javase/8/javafx/get-started-tutorial/
http://docs.oracle.com/javase/8/javaseclienttechnologies.htm
JavaFX Glossary
Glass Windowing Toolkit: Provides native operating services, such as
managing the windows, timers, and surfaces
Prism: Graphics pipeline that can run on hardware and software renderers
Quantum Toolkit: Ties Prism and Glass together and makes them
available to the JavaFX APIs
8
10
FXML
Media
12
Embed JavaFX
content into existing
Swing applications
Extend existing Swing
applications with new
JavaFX features such
as WebView and
high-performance
graphics
Applies to SWT
applications as well
Browser Plugin
Faster loading of
JavaFX Web
applications based on
Prism
Pre-loader for
improved user
experience with
JavaFX Web
applications
13
14
root.getChildren().add(c1);
stage.setVisible(true);
Scene Graph
Directed Acyclic Graph
Parents and children
Representation of the GUI components
18
19
Media
JavaFX supports both visual and audio media
Cross-platform JavaFX media file format (fxm, mp3)
Platform specific formats supported via native players
20
WebView
Web page as a Node in scenegraph
Effects can be applied
21
Charts
22
http://download.oracle.com/otndocs/products/javafx/2/samples/Ensemble/index.html
Effects...
GaussianBlur
InnerShadow
Reflection
SepiaTone
23
Transforms
Rectangle rect=new Rectangle(0,0,60,60);
rect.setFill(Color.DODGERBLUE);
rect.setArcWidth(10);
rect.setArcHeight(10);
rect.setRotate(45);
rect.setScaleX(2);
rect.setScaleY(0.5);
Shear shear = new Shear(0.7, 0);
rect.getTransforms().add(shear);
rect.setTranslateX(40);
rect.setTranslateY(10);
24
Binding
Creates a dependency between a property and a
changeable value
High level API
Easy to use
Covers most common situations
25
Properties
Basis for high level binding API
Concrete types for all primitives, String and Object
DoubleProperty, StringProperty, etc
Simple API
bind / unbind
bindBidirectional / unbindBidirectional
isBound
26
28
Animated Transitions
Pre-defined, single-purpose animations
Fade, Path, Pause, Rotate, Scale, Translate
Can specify to, from and by values
Container transitions
Parallel, sequential
Can be nested arbitarily
29
30
32
JavaFX is
33
JavaFX Roadmap
JavaFX 2.0
JavaFX 2.1
Windows GA
Mac OS X Dev. Preview
Mac OS X GA
Linux Dev. Preview
2011
2011
2012
2012
Included in JDK 8
Concurrent OS support
(Windows, Mac OS, Linux)
2014
2014
2013
2013
JavaFX 2.0.2
JavaFX 2.2
JDK 7 co-install
Linux GA
JavaFX
Scene Builder EA
34
JavaFX 3.0
JavaFX
Scene Builder GA
NetBeans 7.1
NetBeans
Resources
JavaFX website: http://javafx.com
Open source project
http://openjdk.java.net/projects/openjfx/
Blogs
http://fxexperience.com
http://blogs.oracle.com/javafx
Twitter: @javafx4you
35
Node
Parent
(abstract)
Group
Region
Control
Group effects and transforms to be applied to a collection of child nodes. Will not resize
Region class for nodes that can be styled with CSS and layout children. Will resize auto
Control class for high-level skinnable nodes designed for user interaction.
TabSample project
37
Bindings
Binding one GUI component to another
btn.prefWidthProperty().bind(scene.widthProperty()); (TabsSample)
Binding GUI component to Worker (TimesControllerTask)
lblStatus.textProperty().bind(getReviewsTask.messageProperty());
btnGo.disableProperty().bind(getReviewsTask.runningProperty());
lstView.itemsProperty().bind(getReviewsTask.valueProperty());
38
39
Concurrency in javaFX
The javafx.concurrent package consists of the Worker interface and two concrete
implementations, Task and Service classes.
The Worker interface provides APIs that are useful for a background worker to
communicate with the UI.
The Task class is a fully observable implementation of the
java.util.concurrent.FutureTask class. The Task class enables developers to
implement asynchronous tasks in JavaFX applications. The Task class defines a onetime object that cannot be reused.
The Service class executes tasks. If you need a reusable Worker object, use the
Service class.
40
Worker
(Interface)
Task
Service
41
42
Web Services
http://www.programmableweb.com/
http://www.faroo.com/
http://www.faroo.com/hp/api/api.html
http://www.faroo.com/api?
q=iphone&start=1&length=10&l=en&src=web&f=json
http://jsonviewer.stack.hu/
43
What is JavaFX?
Its a language for creating graphical user
interfaces...
What is JavaFX?
Its a language for creating graphical user
interfaces...
Regions: Slider