Successfully reported this slideshow.

Presentasi Java Fx

2,922 views

Published on

Published in: Technology, News & Politics
  • Be the first to comment

  • Be the first to like this

Presentasi Java Fx

  1. 1. Pengenalan JavaFX <ul><li>Andik Nur Achmad </li></ul>Sun Campus Ambassador [email_address] http://andique.wordpress.com
  2. 2. Arsitektur JavaFX Apa itu JavaFX? Agenda JavaFX Script Selanjutnya ... JavaFX Demo!
  3. 3. Pengenalan: Apa itu JavaFX?
  4. 4. Bagaimana aplikasi internet saat ini?
  5. 5. Rich Internet Application (RIA)
  6. 6. Perkembangan Rich Internet Application (RIA)
  7. 7. Apa yang bisa kita buat dengan JavaFX? <ul><li>Video playback </li></ul><ul><li>Aplikasi bisnis yang interaktif </li></ul><ul><li>Mash-up dengan web service berbasis REST </li></ul><ul><li>Dan, </li></ul><ul><li>Aplikasi yang bisa berjalan di desktop, browser, mobile, dan tv </li></ul>
  8. 8. Arsitektur JavaFX
  9. 9. Developer's Point of View
  10. 10. Designer's Point of View
  11. 11. Consumer's Point of View
  12. 12. Kompetitor
  13. 13. Scene Shape <ul><li>javafx.scene.shape </li></ul><ul><ul><li>Ellipse </li></ul></ul><ul><ul><li>Polyline </li></ul></ul><ul><ul><li>Arc </li></ul></ul><ul><ul><li>Path </li></ul></ul><ul><ul><li>ShapeSubtract </li></ul></ul><ul><ul><li>QuadCurve </li></ul></ul><ul><ul><li>DelegateShape </li></ul></ul><ul><ul><li>ClosePath </li></ul></ul><ul><ul><li>CubicCurve </li></ul></ul><ul><ul><li>Shape </li></ul></ul><ul><ul><li>LineTo </li></ul></ul><ul><ul><li>SVGPath </li></ul></ul><ul><ul><li>Polygon </li></ul></ul><ul><ul><li>Line </li></ul></ul><ul><ul><li>Circle </li></ul></ul><ul><ul><li>ArcTo </li></ul></ul><ul><ul><li>PathElement </li></ul></ul><ul><ul><li>HlineTo </li></ul></ul><ul><ul><li>VlineTo </li></ul></ul><ul><ul><li>CurveTo </li></ul></ul><ul><ul><li>QuadTo </li></ul></ul><ul><ul><li>ShapeIntersect </li></ul></ul><ul><ul><li>MoveTo </li></ul></ul><ul><ul><li>Rectangle </li></ul></ul>
  14. 14. Circle <ul><li>import javafx.scene.geometry.*; </li></ul><ul><li>import javafx.scene.paint.*; </li></ul><ul><li>Circle { </li></ul><ul><li>centerX: 100 </li></ul><ul><li>centerY: 100 </li></ul><ul><li>radius: 50 </li></ul><ul><li>fill: Color.BLACK </li></ul><ul><li>} </li></ul>
  15. 15. Rectangle <ul><li>import javafx.scene.geometry.*; </li></ul><ul><li>import javafx.scene.paint.*; </li></ul><ul><li>Rectangle { </li></ul><ul><li>x: 50 </li></ul><ul><li>y: 50 </li></ul><ul><li>width: 200 </li></ul><ul><li>height: 100 </li></ul><ul><li>arcWidth: 20 </li></ul><ul><li>arcHeight: 20 </li></ul><ul><li>fill: Color.BLACK </li></ul><ul><li>} </li></ul>
  16. 16. Ellipse <ul><li>import javafx.scene.geometry.*; </li></ul><ul><li>import javafx.scene.paint.*; </li></ul><ul><li>Ellipse { </li></ul><ul><li>centerX: 50 </li></ul><ul><li>centerY: 50 </li></ul><ul><li>radiusX: 50 </li></ul><ul><li>radiusY: 25 </li></ul><ul><li>fill: Color.BLACK </li></ul><ul><li>} </li></ul>
  17. 17. ShapeIntersect <ul><li>import javafx.scene.geometry.*; </li></ul><ul><li>import javafx.scene.paint.*; </li></ul><ul><li>ShapeIntersect { </li></ul><ul><li>fill: Color.BLACK </li></ul><ul><li>a: Rectangle { width: 100 height: 50 } </li></ul><ul><li>b: Ellipse { </li></ul><ul><li>centerX: 100 </li></ul><ul><li>centerY: 25 </li></ul><ul><li>radiusX: 50 </li></ul><ul><li>radiusY: 25 </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  18. 18. ShapeSubtract <ul><li>import javafx.scene.geometry.*; </li></ul><ul><li>import javafx.scene.paint.*; </li></ul><ul><li>ShapeSubtract { </li></ul><ul><li>fill: Color.BLACK </li></ul><ul><li>a: Rectangle { width: 100 height: 50 } </li></ul><ul><li>b: Ellipse { </li></ul><ul><li>centerX: 100 </li></ul><ul><li>centerY: 25 </li></ul><ul><li>radiusX: 50 </li></ul><ul><li>radiusY: 25 </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  19. 19. Animation Framework <ul><li>javafx.animation </li></ul><ul><ul><li>Interpolatable </li></ul></ul><ul><ul><li>Interpolator </li></ul></ul><ul><ul><li>KeyFrame </li></ul></ul><ul><ul><li>KeyValue </li></ul></ul><ul><ul><li>SimpleInterpolator </li></ul></ul><ul><ul><li>Timeline </li></ul></ul>
  20. 20. JavaFX Script Language <ul><li>Declarative syntax </li></ul><ul><ul><li>GUI </li></ul></ul><ul><ul><li>Swing </li></ul></ul><ul><ul><li>Data binding </li></ul></ul><ul><li>Statically typed </li></ul><ul><ul><li>and code structuring, reuse, and encapsulation features that enable creating and maintaining very large programs in the Java programming language. </li></ul></ul>
  21. 21. Script <ul><li>Sebuah “script&quot; satu atau lebih deklarasi atau ekspresi </li></ul><ul><li>import java.lang.System; </li></ul><ul><li>var ten : Integer = 10; </li></ul><ul><li>System.out.println(&quot;Twice {ten} is {2 * ten}.&quot;); </li></ul><ul><li>// Twice 10 is 20. </li></ul>
  22. 22. Class <ul><li>class Knight { </li></ul><ul><li>attribute health = 100; </li></ul><ul><li>attribute strength = 10; </li></ul><ul><li>function die(){ </li></ul><ul><li>health = 0 </li></ul><ul><li>} </li></ul><ul><li>function hurt(amount: Integer){ </li></ul><ul><li>strength -= amount </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  23. 23. Objects <ul><li>var myKnight = Knight {} </li></ul><ul><li>var superKnight = Knight { </li></ul><ul><li>health: 150; </li></ul><ul><li>strength: 15; </li></ul><ul><li>} </li></ul><ul><li>myKnight.hurt(superKnight.strength); </li></ul><ul><li>// myKight.health = 85 </li></ul>
  24. 24. Basic Data Types <ul><li>JavaFX </li></ul><ul><ul><li>String </li></ul></ul><ul><ul><li>Boolean </li></ul></ul><ul><ul><li>Number </li></ul></ul><ul><ul><li>Integer </li></ul></ul><ul><ul><li>Duration </li></ul></ul><ul><li>Java </li></ul><ul><ul><li>java.lang.String </li></ul></ul><ul><ul><li>java.lang.Boolean </li></ul></ul><ul><ul><li>java.lang.Number </li></ul></ul><ul><ul><li>byte, short, int, long, BigInteger </li></ul></ul><ul><ul><li>N/A </li></ul></ul>
  25. 25. String Examples <ul><li>var s1 = &quot;Java&quot;; </li></ul><ul><li>var s2 = &quot;FX&quot;; </li></ul><ul><li>var s3 = &quot;Java{s2}&quot;; // s3 = &quot;JavaFX&quot; </li></ul><ul><li>var s4 = &quot;{s1}{s2}&quot;; // s4 = &quot;JavaFX&quot; </li></ul>
  26. 26. Boolean Examples <ul><li>var cool = true; </li></ul><ul><li>var s = &quot;Java{ if (cool)&quot;FX&quot; else &quot;Script&quot;}&quot;; </li></ul><ul><li>//s = &quot;JavaFX&quot; </li></ul><ul><li>var a = true; // a = true </li></ul><ul><li>var b = false; // b = false </li></ul><ul><li>var c = a and b; // c = false </li></ul><ul><li>var d = a or b; // d = true </li></ul><ul><li>var e = not a; // e = false </li></ul>
  27. 27. Duration Examples <ul><li>var t1 = 5ms; // 5 milliseconds </li></ul><ul><li>var t2 = 10s; // 10 seconds </li></ul><ul><li>var t3 = 30m; // 30 minutes </li></ul><ul><li>var t4 = 1h; // 1 hour </li></ul><ul><li>var t5 = t1 + t2 + t3 + t4; </li></ul><ul><li>// 1 hour 30 min 10 secs and 5 millisecs </li></ul>
  28. 28. Sequences Examples <ul><li>var x = [1,2,3]; </li></ul><ul><li>// array initialization </li></ul><ul><li>insert 10 into x; </li></ul><ul><li>// [1, 2, 3, 10] </li></ul><ul><li>insert 12 before x[1]; </li></ul><ul><li>// [1, 12, 2, 3, 10] </li></ul><ul><li>delete 12 from x; </li></ul><ul><li>// [1, 2, 3, 10] </li></ul><ul><li>insert [1..10] into x; </li></ul><ul><li>// [1, 2, 3, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] </li></ul>
  29. 29. demo
  30. 30. <ul><li>Download Java FX & IDE Plugins untuk Netbeans or Eclipse </li></ul><ul><li>Bergabung dengan OpenJFX Java.net Project </li></ul><ul><li>Belajar dari Java FX Tutorials </li></ul><ul><li>Berpartisipasi dalam Java FX Forums </li></ul>http://openjfx.dev.java.net Java FX Selanjut-nya
  31. 31. JavaFX Resources <ul><li>Java FX Project Site: http://openjfx.dev.java.net </li></ul><ul><ul><li>Java.net: Download early versions of Java FX </li></ul></ul><ul><ul><li>IDE Plugins, Tutorials, Forums, FAQs </li></ul></ul><ul><ul><li>“ Getting Started With the JavaFX Script Language” </li></ul></ul><ul><ul><li>“ JavaFX Script 2D Graphics Tutorial” </li></ul></ul><ul><ul><li>“ The JavaFX Script Programming Language Reference” </li></ul></ul><ul><li>Planet FX Wiki: http://jfx.wikia.com/wiki/Main_Page </li></ul><ul><ul><li>Open-source documentation site for Java FX </li></ul></ul><ul><li>Chris Oliver's Blog: http://blogs.sun.com/chrisoliver/ </li></ul><ul><ul><li>Latest news, other informal information </li></ul></ul><ul><ul><li>Source code for lots of demos (Space Invaders, Calculator) </li></ul></ul><ul><li>Sun's Java FX Site: </li></ul><ul><ul><li>http://www.sun.com/software/javafx/ </li></ul></ul><ul><ul><li>http://www.javafx.com </li></ul></ul>
  32. 32. JavaFX Resources <ul><li>Free online course at http://www.javapassion.com/ </li></ul>
  33. 33. Terima Kasih <ul><li>Andik Nur Achmad </li></ul>Original slide by Silveira Neto Sun Campus Ambassador [email_address] http://andique.wordpress.com

×