DOAG 2012 DevelopmentBonn | 14. Juni 2012
1 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
Entwicklung mit JavaFXWolfgang Weigend
Sen. Leitender Systemberater
Java Technologie und Architektur
Java Pioneered Rich Client ApplicationsBut developers had to learn multiple technologies
2 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
JavaFX Simplifies Application DevelopmentDevelopers Focus on Capabilities Instead of Technologies
3 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
JavaFX is the Evolution of Java as a Rich Client Platform
It is designed to provide a modern Java environment designed to provide a lightweight, hardware accelerated UI platform that meets tomorrow’s needs
4 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
Where does JavaFX fit in the Java Platform?
ServersServersServersServers DesktopDesktopDesktopDesktop EmbeddedEmbeddedEmbeddedEmbedded TVTVTVTV MobileMobileMobileMobile CardCardCardCard
BD-J
5 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
Java Card
Java EE Java TV
BD-J
JavaFX MSA
Java Language
Java SE Java ME
Key APIs
Platform
Language
Java Platform
JavaFX Runtime Architecture
6 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
JavaFX Architecture Components
• 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
• UI Toolkit: Ties Prism and Glass together and makes them available to the JavaFX APIs
Design Objectives
Oracle’s next generation Java client solution
• Built on Java in Java
• Modular architecture
JavaFX – Moving Client Forward
7 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
• Modular architecture
• Migration path for Java client UI technologies
• Advanced tooling
• Delivering on the cross-platform promise
Recent JavaFX Product Releases
• JavaFX 2 Platform– General Availability for Windows (October 2011)
– JavaFX 2.1 Developer Preview for Linux
– General Availability for Mac OS X with JavaFX 2.1
8 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
• Development tools
– NetBeans 7.1 General Availability
– JavaFX Scene Builder (Developer Preview)
Goals for 2012
Announced at JavaOne 2011
Open Source
�OpenJFX Project under
OpenJDK�
�
Convergence
�Common license with
Java SE (in place)�
�
Standardization
�Oracle committed to
JavaFX standardization
9 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
�First phase to focus on
UI Controls� �JavaFX to be included
in Java SE by JDK 8
�JavaFX for Java SE
Embedded (ARM)
� �JSR to be submitted
through JCP
Java APIs and FXML
Java APIs for JavaFX
• End-to-end Java development
• Java language features - generics, annotations, multi-threading
• Fluent API for UI construction
• Alternative JVM supported languages
FXML
• Scriptable, XML-based markup language for defining UI
• Convenient alternative to developing UI programmatically in Java
• Easy to learn and intuitive for developers
10 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
• Alternative JVM supported languages (e.g. Groovy, Scala) with JavaFX
• Leverage sophisticated Java IDEs, debuggers and profilers
• Java APIs preserve convenient JavaFX Script features (e.g., bind)
• Easy to learn and intuitive for developers familiar with web technologies or other markup based UI technologies
• Powerful scripting feature allows embedding scripts within FXML. Any JVM scripting language can be used, including JavaScript, Groovy, and Scala
Graphics and Media
Media
• Stable media framework based on GStreamer
• VP6, H.264*, MP3, AAC* playback of Web multimedia content
• Low latency audio
• New hardware accelerated graphics pipeline (Prism)
• New windowing toolkit (Glass) for Prism
• Java2D software pipeline under
New Graphics Pipeline
11 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
• Low latency audio
• Alpha channel support
• Performance improvements
• Full screen video
• Java2D software pipeline under Prism
• High-level support for making rich graphics simple
• Shadows, Blurs, Reflections, Effects,
2D transforms
• 3D Transforms today; Full 3D objects
in future
* Feature introduced in JavaFX 2.1
WebView and Swing Interoperability
• Embed Web content in JavaFX applications
• HTML rendering based on Webkit
• Hardware accelerated
WebView Component
• Embed JavaFX content into existing Swing applications
• Extend existing Swing applications with new
Swing and SWT Interop.
• Faster loading of JavaFX Web applications based on Prism
• Pre-loader for
Browser Plug-In
12 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
• Hardware accelerated rendering using PRISM
• DOM access and manipulation
JavaFX features such as WebView and high-performance graphics
• Applies to SWT* applications as well
improved user experience with JavaFX Web applications
* Feature introduced in JavaFX 2.1
JavaFX UI Controls
– Accordion
– Button
– CheckBox
– ChoiceBox
– Charts
– ContextMenu
– MenuBar
– MenuButton
– PasswordField
– ProgressBar
– ProgressIndicator
– RadioButton
– SplitPane
– TableView
– TabPane
– TextArea
– TextField
– TitledPane
13 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
– ContextMenu
– Hyperlink
– HTMLEditor
– Label
– ListView
– Menu / MenuItem
– RadioButton
– ScrollBar
– ScrollPane
– Separator
– Slider
– SplitMenuButton
– TitledPane
– ToggleButton
– Tooltip
– ToolBar
– TreeView
Open Source and Standardization
• JavaFX source code being contributed as part of OpenJFXhttp://openjdk.java.net/projects/openjfx/
– Source code being contributed in phases
– Open sourced as of March 2012
• UI Controls
14 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
• Scene Graph
• JemmyFX
• Functional tests
• Oracle is committed to standardize JavaFX through JCP– One or more JSRs will be submitted
– Expected to be become part of the Java SE specification
Distribution and Support
• JavaFX Distribution– JavaFX Runtime can be distributed with third party applications*
– Applies to JavaFX 2.0.2 and later
• JavaFX Platform Commercial Support
15 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
• JavaFX Platform Commercial Support
– JavaFX is now part of the Java SE technologies covered through Oracle Premier Support
– Applies to JavaFX 2.0 and later
* As per the terms and conditions of the Binary Code License for Java SE Platform products
Hello World in JavaFXProgramming in Javapublic class JavaFXExample extends Application {
@Override public void start(Stage stage){
Scene scene = new Scene(
LabelBuilder.create()
.text("Hello World!")
.layoutX(25)
16 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
.build());
stage.setTitle("Welcome to JavaFX!");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Hello World in JavaFXProgramming in FXML and JavaFXML<BorderPane>
<center>
<Label text=”%helloworld"/>
</center>
</BorderPane>
Java
17 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
Javapublic class FXMLExample extends Application {
@Override public void start(Stage stage) throws Exception {
stage.setTitle("FXML Example");
Parent root = FXMLLoader.load(getClass().getResource(“example.fxml"),
ResourceBundle.getBundle(“r.fxml_example"));
stage.setScene(new Scene(root));
stage.show();
}
public static void main(String[] args) { launch(args); }
}Note: Example is for illustration and not syntactically accurate
Standard Java Tools for Easy Development
• Source editor with improved syntactic
highlighting, code completion, refactoring etc.
• Full debugger and profiler support
• Project wizard for easy creation of JavaFX
applications
18 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
applications
Other Java IDE’s
• Source editor with syntactic highlighting,
code completion, refactoring etc.
• Full debugger and Profiler support
JavaFX Scene Builder 1.0Developer Preview
19 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
http://otn.oracle.com/java/javafx
JavaFX Scene Builder
• UI layout tool for JavaFX
• FXML visual editor
• Can be used standalone or with all major Java IDEs
– Tighter integration with NetBeans IDE
20 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
– Tighter integration with NetBeans IDE
• Preview mode
• CSS support
• Supported on Windows and Mac OS X
About JavaFX Scene Builder 1.0
• JavaFX Scene Builder 1.0 (Developer Preview)
• Build Information Version: 1.0-b40, Changeset: 84c73a2bd972, Date: 2012-05-29 12:58 +0200
• JavaFX version 2.2.0-beta-b10
• Operating System: Windows XP, x86, 5.1
21 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
• Operating System: Windows XP, x86, 5.1
• Java Version 1.7.0_03, Oracle Corporation, 1.7.0_03-b05
JavaFX and Open Sourcehttp://openjdk.java.net/projects/openjfx
22 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
OpenJFX•UI Controls•Scenegraph•JemmyFX•Functional tests
Community Involvement
The third party developer community has shown interest in JavaFX. Here are a few projects:
• e(fx)clipse: plugins for Eclipse and for OSGi
• DataFX: data source and cell factories for JavaFX UI controls
• ScalaFX, GroovyFX: Scala and Groovy bindings for JavaFX
23 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
• ScalaFX, GroovyFX: Scala and Groovy bindings for JavaFX
• JFX Flow, eFX, JRebirth: application development
frameworks
• FXForms2: automatic form generation
• JFXtras: UI controls and extensions for JavaFX
JavaFX Future Directions
• Tighter Integration with Java SE
• Migration Path for Java Client UI Technologies
• Optimized Web Services Support
• Advanced Tooling
Oracle’s Next Generation Java Client Solution
24 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
• Advanced Tooling
• Support for Modern Device Interactions
• Delivering on the Cross Platform Promise
JavaFX Roadmap
2011 2012 2013 2014
JavaFX 2.0• Windows GA
• Mac OS X Dev. Preview
JavaFX 2.0.2 JavaFX 2.2
JavaFX 2.1• Linux Dev. Preview
JavaFX 3.0• Included in JDK 8
• Concurrent OS support(Windows, Mac OS, Linux)
JavaFX 2.1• Windows GA
• Mac OS X SDK GA
25 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
Scene Builder GA
NetBeans.next• Java SE 8 support
• JavaFX 3 support
• more
JavaFXScene Builder EA
NetBeans 7.1• JavaFX 2 Support
GA: General Availability
JavaFX 2.0.2• JDK 7 co-install
JavaFX 2.2• Mac OS X GA
• Linux GA
• Windows GA
Scene Builder• Mac & Windows
Dev. Preview
Resources
• Downloads: http://otn.oracle.com/javafx
• OpenJFX: http://openjdk.java.net/projects/openjfx/
• Oracle Premier Supporthttp://www.oracle.com/us/support/software/premier/
• Blogs
26 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
• Blogs– http://blogs.oracle.com/javafx
– http://fxexperience.com
• OTN Forum: https://forums.oracle.com/forums/forum.jspa?forumID=1385
• Twitter: @javafx4you
The preceding is intended to outline our 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,
27 Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
Top Related