JavaFX 8
自己紹介•hakurai•Backlog開発チーム@ヌーラボ•関ジャバ•hoge駆動•奈良模型愛好会
JavaFX 8での新機能• RichText• Printing for JavaFX• 3D API• (Lambda)
What is JavaFX• Swingに換わる新しいGUI フレームワーク• XML(FXML)による画面定義• CSSによるスタイリング• アニメーション/エフェクト• データバインディング
RichText• TextFlow• 書式付きテキスト用のレイアウト• 子ノードのTextなどをレイアウトする
TextFlow サンプルString family = "Helvetica";double size = 20;TextFlow textFlow = new TextFlow();Text text1 = new Text("Hello ...
TextFlow サンプルString family = "Helvetica";double size = 64;TextFlow textFlow = new TextFlow();Text text1 = new Text("Hello ...
Textにスタイルを追加text1.setStyle("-fx-stroke: rgb(255, 0, 0);-fx-fill: rgba(255, 0, 0, 0.2);");text2.setStyle("-fx-fill: green;-fx...
• Printer• PrinterJobPrinting for JavaFX
• Shape3d• Box(直方体)• Cylinder(円柱)• Sphere(球体)• MeshView(メッシュ)• TriangleMesh3D API
• SubScene• DrawMode• Material(材質)• LightBase(光源)• PointLight(点光源)• AmbientLight(環境光)3D API
Box / Cylinder / Sphere サンプルBox box = new Box(100, 100, 100);Cylinder cylinder = new Cylinder(50, 100, 30);Sphere sphere =...
Box / Cylinder / Sphere サンプル
Material サンプルBox box = new Box(100, 100, 100);box.setMaterial(new PhongMaterial(Color.RED));Cylinder cylinder = new Cylind...
Material サンプル
MeshView / TriangleMesh サンプル• 三次元オブジェクトの形状を三角メッシュで描画
MeshView / TriangleMesh• 三角メッシュ• Points(頂点)• Faces(面)• TextCoords(UVテクスチャ座標)• FaceSmoothingGroups
MeshView / TriangleMesh• 実はこれも三角メッシュ
MeshView / TriangleMesh• 実はこれも三角メッシュ
Loader Support (OpenJDKWiki)• Many 3D file formats exist, such as:• Obj, Maya, 3D Studio Max, Collada, KRML• We will not pr...
apps/experiments/ 3DViewer• 読み込み *.ma *.ase *.obj *.dae• 書き出し *.fxml
Lambda• イベントリスナ• Bindings
イベントリスナtopicMessageService.setOnSucceeded(new EventHandler<WorkerStateEvent>() {@Overridepublic void handle(WorkerStateEve...
イベントリスナtopicMessageService.setOnSucceeded(new EventHandler<WorkerStateEvent>() {@Overridepublic void handle(WorkerStateEve...
イベントリスナtopicMessageService.setOnSucceeded(workerStateEvent -> {Posts newPosts = (Posts) workerStateEvent.getSource().getVa...
BindingsunreadPostsCount.bind(createLongBinding( () -> {messageList.stream().filter( m -> m.getId() > maxUnreadId.get() ).c...
JavaFX8
JavaFX8
JavaFX8
Upcoming SlideShare
Loading in...5
×

JavaFX8

1,219

Published on

Published in: Technology, Design
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,219
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "JavaFX8"

  1. 1. JavaFX 8
  2. 2. 自己紹介•hakurai•Backlog開発チーム@ヌーラボ•関ジャバ•hoge駆動•奈良模型愛好会
  3. 3. JavaFX 8での新機能• RichText• Printing for JavaFX• 3D API• (Lambda)
  4. 4. What is JavaFX• Swingに換わる新しいGUI フレームワーク• XML(FXML)による画面定義• CSSによるスタイリング• アニメーション/エフェクト• データバインディング
  5. 5. RichText• TextFlow• 書式付きテキスト用のレイアウト• 子ノードのTextなどをレイアウトする
  6. 6. TextFlow サンプルString family = "Helvetica";double size = 20;TextFlow textFlow = new TextFlow();Text text1 = new Text("Hello ");text1.setFont(Font.font(family, size));Text text2 = new Text("Bold");text2.setFont(Font.font(family, FontWeight.BOLD, size));Text text3 = new Text(" ITALIC");text3.setFont(Font.font(family, FontPosture.ITALIC, size));textFlow.getChildren().addAll(text1, text2, text3);
  7. 7. TextFlow サンプルString family = "Helvetica";double size = 64;TextFlow textFlow = new TextFlow();Text text1 = new Text("Hello ");text1.setFont(Font.font(family, size));Text text2 = new Text("Bold");text2.setFont(Font.font(family, FontWeight.BOLD, size));Text text3 = new Text(" ITALIC");text3.setFont(Font.font(family, FontPosture.ITALIC, size));textFlow.getChildren().addAll(text1, text2, text3);太字イタリック
  8. 8. Textにスタイルを追加text1.setStyle("-fx-stroke: rgb(255, 0, 0);-fx-fill: rgba(255, 0, 0, 0.2);");text2.setStyle("-fx-fill: green;-fx-effect: dropshadow(gaussian, gray, 8, 0.5, 8,8);");text3.setStyle("-fx-underline: true;-fx-fill: transparent;-fx-stroke: linear-gradient(from 0% 0% to 100% 100%, repeat, black 0%, blue 50%);-fx-stroke-width: 1;");
  9. 9. • Printer• PrinterJobPrinting for JavaFX
  10. 10. • Shape3d• Box(直方体)• Cylinder(円柱)• Sphere(球体)• MeshView(メッシュ)• TriangleMesh3D API
  11. 11. • SubScene• DrawMode• Material(材質)• LightBase(光源)• PointLight(点光源)• AmbientLight(環境光)3D API
  12. 12. Box / Cylinder / Sphere サンプルBox box = new Box(100, 100, 100);Cylinder cylinder = new Cylinder(50, 100, 30);Sphere sphere = new Sphere(50);
  13. 13. Box / Cylinder / Sphere サンプル
  14. 14. Material サンプルBox box = new Box(100, 100, 100);box.setMaterial(new PhongMaterial(Color.RED));Cylinder cylinder = new Cylinder(50, 100, 30);cylinder.setMaterial(new PhongMaterial(Color.YELLOW));Sphere sphere = new Sphere(50);sphere.setMaterial(new PhongMaterial(Color.GREEN));
  15. 15. Material サンプル
  16. 16. MeshView / TriangleMesh サンプル• 三次元オブジェクトの形状を三角メッシュで描画
  17. 17. MeshView / TriangleMesh• 三角メッシュ• Points(頂点)• Faces(面)• TextCoords(UVテクスチャ座標)• FaceSmoothingGroups
  18. 18. MeshView / TriangleMesh• 実はこれも三角メッシュ
  19. 19. MeshView / TriangleMesh• 実はこれも三角メッシュ
  20. 20. Loader Support (OpenJDKWiki)• Many 3D file formats exist, such as:• Obj, Maya, 3D Studio Max, Collada, KRML• We will not provide a loader as part of the JavaFX runtime• We will make sample code available for one or two popular format
  21. 21. apps/experiments/ 3DViewer• 読み込み *.ma *.ase *.obj *.dae• 書き出し *.fxml
  22. 22. Lambda• イベントリスナ• Bindings
  23. 23. イベントリスナtopicMessageService.setOnSucceeded(new EventHandler<WorkerStateEvent>() {@Overridepublic void handle(WorkerStateEvent workerStateEvent) {Posts newPosts = (Posts) workerStateEvent.getSource().getValue();appendPosts(newPosts);}});
  24. 24. イベントリスナtopicMessageService.setOnSucceeded(new EventHandler<WorkerStateEvent>() {@Overridepublic void handle(WorkerStateEvent workerStateEvent) {Posts newPosts = (Posts) workerStateEvent.getSource().getValue();appendPosts(newPosts);}});
  25. 25. イベントリスナtopicMessageService.setOnSucceeded(workerStateEvent -> {Posts newPosts = (Posts) workerStateEvent.getSource().getValue();appendPosts(newPosts);});
  26. 26. BindingsunreadPostsCount.bind(createLongBinding( () -> {messageList.stream().filter( m -> m.getId() > maxUnreadId.get() ).count()},maxUnreadId, messageList));
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×