JavaFX 2.0 - リッチクライアントのためのUI基盤

Preview:

DESCRIPTION

 

Citation preview

リッチクライアントのための UI 基盤

Agenda

なぜ Java?

Key Features

What is JavaFX 2.0

基本構造

Conclusion

JavaFX 2.0 UI API of Java by Java for Java

=

JavaFX 2.0 ?

JavaFX Script

for Applicationfor Making API

JavaFX for Java

Adv. JavaFX の開発スピード

パフォーマンス

JavaFX を使える言語

JavaFX for Java

Dis. 記述量

複雑さ

言語でサポートした機能

宣言 バインド トリガー

関数型 型推論 I18N

基本構造

基本構造public class Hello extends Application { @Override public void start(Stage stage) { // コンテナ Group container = new Group(); // シーングラフのルート要素を生成し、コンテナを貼る Scene scene = new Scene(container, 100, 20); stage.setScene(scene);

// ラベルを生成しコンテナに貼る Label label = new Label("Hello, World!"); container.getChildren().add(label); stage.setVisible(true); } public static void main(String[] args) { Application.launch(Hello.class, null); }}

public class Hello extends Application { @Override public void start(Stage stage) { // コンテナ Group container = new Group(); // シーングラフのルート要素を生成し、コンテナを貼る Scene scene = new Scene(container, 100, 20); stage.setScene(scene);

// ラベルを生成しコンテナに貼る Label label = new Label("Hello, World!"); container.getChildren().add(label); stage.setVisible(true); } public static void main(String[] args) { Application.launch(Hello.class, null); }}

public class Hello extends Application { @Override public void start(Stage stage) { // コンテナ Group container = new Group(); // シーングラフのルート要素を生成し、コンテナを貼る Scene scene = new Scene(container, 100, 20); stage.setScene(scene);

// ラベルを生成しコンテナに貼る Label label = new Label("Hello, World!"); container.getChildren().add(label); stage.setVisible(true); } public static void main(String[] args) { Application.launch(Hello.class, null); }}

public class Hello extends Application { @Override public void start(Stage stage) { // コンテナ Group container = new Group(); // シーングラフのルート要素を生成し、コンテナを貼る Scene scene = new Scene(container, 100, 20); stage.setScene(scene);

// ラベルを生成しコンテナに貼る Label label = new Label("Hello, World!"); container.getChildren().add(label); stage.show(); } public static void main(String[] args) { Application.launch(Hello.class, null); }}

SceneGraph

Stage

StageScene

Scene

VBox

VBox

HBox

HBox

TableView

TableView

Label

TextBox

Button

Node

Control Pane Shape

SceneGraph の表現

構造 手続き

宣言的文法

XML

手続き型言語

SceneGraph の表現

FXML

<?import javafx.scene.control.*?><?import javafx.scene.layout.*?>

<FlowPane xmlns:fx="http://javafx.com/fxml"> <children> <Label text="Label" /> <TextBox fx:id="textBox" text="TextBox" /> <Button fx:id="button" text="Button" /> </children></FlowPane>

MVC

Model

View

ControllerEvent

Observer Pattern

MVC

Model

View

Controller

Bind

MVC

Model

View

Controller

Bind

// モデルDoubleProperty xProperty = new DoubleProperty();

Slider slider = new Slider(50, 300, 0);// モデルにスライダの値をバインドさせるxProperty.bind(slider.valueProperty());

Rectangle rect = new Rectangle(50, 10, 50, 30); // 四角の x座標にモデルをバインドさせるrect.xProperty().bind(xProperty);

Key Features

EffectEffect AppDesign

Animation

Effect

HTML5WebView view = new WebView();

WebEngine engine = view.getEngine();engine.load("http://google.com/");

Media

Media media = new Media(url);MediaPlayer player = new MediaPlayer(media);MediaView view = new MediaView(player);

player.play();

その他にも ...

Prism

非同期処理

JSONパーサー

Swing との連携

ConclusionJavaFX Script を捨てて ...

Desktop に集中JavaFX 1.x + αWebKit 付き

期待の新人 FXMLツール開発が促進 ?

リリース Q3Win Mac Linux

リッチクライアントのためのUI 基盤