Java FX  primer … to get you started! Mark Nankman UX Architect TTU-F52 “ The most pervasive and powerful mobile platform ...
Agenda <ul><li>What is JavaFX? </li></ul><ul><li>History </li></ul><ul><li>Who is JavaFX meant for? </li></ul><ul><li>Appl...
JavaFX… <ul><li>Is a highly productive  scripting  language, </li></ul><ul><li>enables content developers to create rich m...
JavaFX History <ul><li>F3: Form Follows Function.  </li></ul><ul><li>developed by Chris Oliver around 2006. </li></ul><ul>...
Cross-Platform
JavaFX Stack
Who is JavaFX meant for? <ul><li>Rich media developers </li></ul><ul><li>RIA developers </li></ul>
Applications <ul><li>Rich cross-platform internet applications: </li></ul><ul><li>Mobile devices </li></ul><ul><li>Desktop...
Hello World
JavaFX Script Language <ul><li>Declarative syntax </li></ul><ul><ul><li>GUI </li></ul></ul><ul><ul><li>Swing </li></ul></u...
JavaFX Script language - script <ul><li>A “script&quot; is one or more declarations or functions. </li></ul><ul><li>Stage ...
JavaFX Script language - Class <ul><li>class  Knight { </li></ul><ul><li>public   var  health  = 100; </li></ul><ul><li>pu...
JavaFX Script language - Objects <ul><li>var  myKnight = Knight {} </li></ul><ul><li>var  superKnight = Knight { </li></ul...
JavaFX Script language - Basic Data Types <ul><li>JavaFX </li></ul><ul><li>String </li></ul><ul><li>Boolean </li></ul><ul>...
JavaFX Script language - String Examples <ul><li>var  s1 = &quot;Java&quot;; </li></ul><ul><li>var  s2 = &quot;FX&quot;; <...
JavaFX Script language - Boolean Examples <ul><li>var  cool = true; </li></ul><ul><li>var  s = &quot;Java{ if (cool)&quot;...
JavaFX Script language - Duration <ul><li>var  t1 = 5ms; // 5 milliseconds </li></ul><ul><li>var  t2 = 10s; // 10 seconds ...
JavaFX Script language - Sequences <ul><li>var  x = [1,2,3]; </li></ul><ul><li>// array initialization </li></ul><ul><li>i...
Designer-Developer workflow <ul><li>Designers produce pixels </li></ul><ul><li>UI Developers need shapes, UI elements, dim...
JavaFX Productivity Suite
Questions
Upcoming SlideShare
Loading in …5
×

JavaFX

1,995 views

Published on

A primer for JavaFX. Several slides were borrowed from other presentation that I found on slideshare. I hope I haven't broken any copyright rules in that respect.

Published in: Technology, News & Politics
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,995
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
76
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

JavaFX

  1. 1. Java FX primer … to get you started! Mark Nankman UX Architect TTU-F52 “ The most pervasive and powerful mobile platform is now the most expressive”
  2. 2. Agenda <ul><li>What is JavaFX? </li></ul><ul><li>History </li></ul><ul><li>Who is JavaFX meant for? </li></ul><ul><li>Applications </li></ul><ul><li>Hello World (demo) </li></ul><ul><li>JavaFX Script language </li></ul><ul><li>Designer-Developer workflow (demo) </li></ul><ul><li>Questions </li></ul>
  3. 3. JavaFX… <ul><li>Is a highly productive scripting language, </li></ul><ul><li>enables content developers to create rich media and content for deployment on Java environments, </li></ul><ul><li>Is a declarative , statically-typed programming language, </li></ul><ul><li>has first-class functions, </li></ul><ul><li>has declarative syntax, </li></ul><ul><li>has list-comprehensions, </li></ul><ul><li>has incremental dependency-based evaluation. </li></ul><ul><li>can make direct calls to Java APIs that are on the platform </li></ul><ul><li>Is NOT a replacement for Swing </li></ul>
  4. 4. JavaFX History <ul><li>F3: Form Follows Function. </li></ul><ul><li>developed by Chris Oliver around 2006. </li></ul><ul><li>F3 was changed to JavaFX Script, and it became open sourced at JavaOne 2007. </li></ul><ul><li>JavaFX 1.0 was released on December 4, 2008 </li></ul><ul><li>JavaFX 1.1 was released on February 20, 2009 </li></ul><ul><li>JavaFX 1.1.1 was released on March 21, 2009 </li></ul>
  5. 5. Cross-Platform
  6. 6. JavaFX Stack
  7. 7. Who is JavaFX meant for? <ul><li>Rich media developers </li></ul><ul><li>RIA developers </li></ul>
  8. 8. Applications <ul><li>Rich cross-platform internet applications: </li></ul><ul><li>Mobile devices </li></ul><ul><li>Desktop </li></ul><ul><li>TV </li></ul><ul><li>“ rich” : </li></ul><ul><li>Animations </li></ul><ul><li>Cinematic effects </li></ul><ul><li>Media streaming </li></ul>
  9. 9. Hello World
  10. 10. 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><ul><li>Incremental evaluation </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>
  11. 11. JavaFX Script language - script <ul><li>A “script&quot; is one or more declarations or functions. </li></ul><ul><li>Stage { </li></ul><ul><li>scene: Scene { </li></ul><ul><li>content: Text{content: “Hello World!”} </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>No main, classes or functions are mandatory. </li></ul>
  12. 12. JavaFX Script language - Class <ul><li>class Knight { </li></ul><ul><li>public var health = 100; </li></ul><ul><li>public var strength = 10; </li></ul><ul><li>public function die(){ </li></ul><ul><li>health = 0 </li></ul><ul><li>} </li></ul><ul><li>public function hurt(amount: Integer){ </li></ul><ul><li>strength -= amount </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  13. 13. JavaFX Script language - 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 = 75 </li></ul>
  14. 14. JavaFX Script language - Basic Data Types <ul><li>JavaFX </li></ul><ul><li>String </li></ul><ul><li>Boolean </li></ul><ul><li>Number </li></ul><ul><li>Integer </li></ul><ul><li>Duration </li></ul><ul><li>Java </li></ul><ul><li>java.lang.String </li></ul><ul><li>java.lang.Boolean </li></ul><ul><li>java.lang.Number </li></ul><ul><li>byte, short, int, long, BigInteger </li></ul><ul><li>N/A </li></ul>
  15. 15. JavaFX Script language - 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 = 'Hello Joe' </li></ul><ul><li>var s4 = &quot;{s1}{s2}&quot;; // s4 = &quot;JavaFX&quot; </li></ul>
  16. 16. JavaFX Script language - 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>
  17. 17. JavaFX Script language - Duration <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>
  18. 18. JavaFX Script language - Sequences <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>
  19. 19. Designer-Developer workflow <ul><li>Designers produce pixels </li></ul><ul><li>UI Developers need shapes, UI elements, dimensions… </li></ul><ul><li>What if designer could export the designs to a format a developer can work with? </li></ul><ul><li>The JavaFX Productivity Suite does just that! </li></ul>
  20. 20. JavaFX Productivity Suite
  21. 21. Questions

×