Introducere in Daniel Nastase, trainer LEC
Agenda <ul><li>De ce JavaFx ? </li></ul><ul><li>Bazele limbajului JavaFx (din perspectiva unui developer de Java) </li></u...
<ul><li>Integrare java – backend </li></ul><ul><li>Portabilitate </li></ul><ul><li>Suport CSS & Softuri editare grafica </...
Variabile <ul><li>Variabilele nu au tip ! </li></ul>def numeConstanta = 0 var numeVariabila = “text” numeVariabila = 90 de...
String <ul><li>def nume = ‘Daniel’;  </li></ul><ul><li>var s = “Salut {nume}”;  </li></ul>def s1 = “acesta este un text” d...
Tipul de date duration <ul><li>5ms; // 5  milsecunde </li></ul><ul><li>10s; // 10  secunde </li></ul><ul><li>30m; // 30  m...
<ul><li>function add(argOne: Integer, argTwo: Integer) : Integer {  </li></ul><ul><li>result = argOne + argTwo; println(&q...
Sequences  (arrays) def  zile  = [&quot;Mon&quot;,&quot;Tue&quot;,&quot;Wed&quot;,&quot;Thu&quot;,&quot;Fri&quot;];   def ...
Sequences  (arrays) <ul><li>def seq1 = [1,2,3,4,5]; </li></ul><ul><li>def seq2 = [1,2,3,4,5]; </li></ul><ul><li>println(se...
Structuri de control <ul><li>if else </li></ul><ul><li>for  </li></ul><ul><li>while </li></ul><ul><li>throw - cath - final...
Replace Triggers  & Bind <ul><li>Replace Triggers </li></ul><ul><li>var password = “ test1 &quot;  on replace  oldValue { ...
“Constructorul” <ul><li>class  Address {  </li></ul><ul><li>var street: String;  </li></ul><ul><li>var city: String;  </li...
Noi modificatori de acces <ul><li>public </li></ul><ul><li>private </li></ul><ul><li>protected </li></ul><ul><li>defaults ...
Mostenire multipla !!! <ul><li>mixin  class MyNameMixin {  </li></ul><ul><li>var firstName = &quot;John&quot;;  </li></ul>...
Doua metode cu aceasi semnatura ? <ul><li>Initial se verifica daca metoda apelata exista in clasa curenta, iar daca nu exi...
Charts
Transformari
javafx.com
learnjavafx.typepad.com
Essential JavaFx
http://java.sun.com/javafx/1.2/docs/api/
google.com  :p
Upcoming SlideShare
Loading in...5
×

Introducere In Java Jx

536

Published on

A treia prezentare din cadrul Lec Technology Meetings - edita 1

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
536
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Tipul returnat poate fi omis daca este null, nu mai trebuie sa punem void
  • Paranteze patrate in loc de acolade
  • Din ce stiu eu nu exista un alt limbaj de scripting care sa aiba thow – catch implementat
  • Pentru exemplu cu Replace Triggers listenerul se apeleaza de doua ori
  • Va reamintesc ca in aceasta prezentare vom sublinia doar lucrurile care sunt diferite de limbajul Java. De exemplu definirea unei clase se face 90% la fel, mostenirea se face tot folosind extends si asa mai departe. Nu mai exista keyword-ul new
  • Introducere In Java Jx

    1. 1. Introducere in Daniel Nastase, trainer LEC
    2. 2. Agenda <ul><li>De ce JavaFx ? </li></ul><ul><li>Bazele limbajului JavaFx (din perspectiva unui developer de Java) </li></ul><ul><li>Aplicatie construita de la 0 </li></ul><ul><li>Resurse </li></ul>
    3. 3. <ul><li>Integrare java – backend </li></ul><ul><li>Portabilitate </li></ul><ul><li>Suport CSS & Softuri editare grafica </li></ul><ul><li>vs Java – PRODUCTIVIATE </li></ul>
    4. 4. Variabile <ul><li>Variabilele nu au tip ! </li></ul>def numeConstanta = 0 var numeVariabila = “text” numeVariabila = 90 def numOne : Number = 1.0 def numTwo : Integer = 1
    5. 5. String <ul><li>def nume = ‘Daniel’; </li></ul><ul><li>var s = “Salut {nume}”; </li></ul>def s1 = “acesta este un text” def s2 = ‘acesta este alt text’ Nu mai trebuie comparate folosind metoda equals(String) ! concatenare
    6. 6. Tipul de date duration <ul><li>5ms; // 5 milsecunde </li></ul><ul><li>10s; // 10 secunde </li></ul><ul><li>30m; // 30 minute </li></ul><ul><li>1h; // 1 ora </li></ul>
    7. 7. <ul><li>function add(argOne: Integer, argTwo: Integer) : Integer { </li></ul><ul><li>result = argOne + argTwo; println(&quot;{argOne} + {argTwo} = {result}&quot;); return result; </li></ul><ul><li>} </li></ul>Functii
    8. 8. Sequences (arrays) def zile = [&quot;Mon&quot;,&quot;Tue&quot;,&quot;Wed&quot;,&quot;Thu&quot;,&quot;Fri&quot;]; def zileSapt = [ zile , [&quot;Sat&quot;,&quot;Sun&quot;]]; reuniune def num = [1..100]; definire interval def numMaiMariCa2 = nums[n | n > 2]; conditie var lungime = sizeof zile; aflare lungime insert &quot;Tue&quot; into zile ; adaugare element insert &quot;Thu&quot; before zile [2]; delete &quot;Sun&quot; from zile ; eliminare element delete zile [0]; delete zile ;
    9. 9. Sequences (arrays) <ul><li>def seq1 = [1,2,3,4,5]; </li></ul><ul><li>def seq2 = [1,2,3,4,5]; </li></ul><ul><li>println(seq1 == seq2) ; true </li></ul><ul><li>def seq1 = [1,2,3,4,5]; </li></ul><ul><li>def seq2 = [1,3,2,4,5]; </li></ul><ul><li>println(seq1 == seq2); false </li></ul><ul><li>seq[a..b] </li></ul><ul><li>seq[a..] </li></ul>
    10. 10. Structuri de control <ul><li>if else </li></ul><ul><li>for </li></ul><ul><li>while </li></ul><ul><li>throw - cath - finally </li></ul><ul><li>var s = &quot;The answer is {if (answer) &quot;Yes“ </li></ul><ul><li>else &quot;No&quot;}&quot;; // s = 'The answer is Yes' – </li></ul><ul><li>expresii embedded </li></ul>
    11. 11. Replace Triggers & Bind <ul><li>Replace Triggers </li></ul><ul><li>var password = “ test1 &quot; on replace oldValue { </li></ul><ul><li>println(&quot; ALERT! Parola s-a schimbat !&quot;); </li></ul><ul><li>println(“ Val veche : {oldValue}&quot;); </li></ul><ul><li>println(“ Val noua : {password}&quot;); </li></ul><ul><li>}; </li></ul><ul><li>password = “ test2 &quot;; </li></ul><ul><li>Bining </li></ul><ul><li>password = &quot;bar&quot;; </li></ul><ul><li>var x = 0; </li></ul><ul><li>def y = bind x; </li></ul><ul><li>x = 1; </li></ul><ul><li>println(y); // y este acum 1 </li></ul><ul><li>x = 47; </li></ul><ul><li>println(y); // y este acum 47 </li></ul>
    12. 12. “Constructorul” <ul><li>class Address { </li></ul><ul><li>var street: String; </li></ul><ul><li>var city: String; </li></ul><ul><li>var state: String; </li></ul><ul><li>var zip: String; </li></ul><ul><li>} </li></ul>class Customer { var firstName: String; var lastName: String; var phoneNum: String; var address: Address; } def customer = Customer { firstName: &quot;John&quot;; lastName: &quot;Doe&quot;; phoneNum: &quot;(408) 555-1212&quot; address: Address { street: &quot;1 Main Street&quot;; city: &quot;Santa Clara&quot;; state: &quot;CA&quot;; zip: &quot;95050&quot;; } }
    13. 13. Noi modificatori de acces <ul><li>public </li></ul><ul><li>private </li></ul><ul><li>protected </li></ul><ul><li>defaults </li></ul><ul><li>public-read  </li></ul><ul><li>public-init </li></ul>
    14. 14. Mostenire multipla !!! <ul><li>mixin class MyNameMixin { </li></ul><ul><li>var firstName = &quot;John&quot;; </li></ul><ul><li>var lastName = &quot;Doe&quot;; </li></ul><ul><li>function printName(){ </li></ul><ul><li> println(&quot;My name is: {firstName} {lastName}&quot;);} </li></ul><ul><li>} </li></ul><ul><li>mixin class MyAddressMixin { </li></ul><ul><li>var address = &quot;1 Main Street, Anytown USA&quot;; function printAddress(){ </li></ul><ul><li>println(&quot;My address is: {address}&quot;);} </li></ul><ul><li>} </li></ul><ul><li>class MyContact extends MyNameMixin, MyAddressMixin { } </li></ul>
    15. 15. Doua metode cu aceasi semnatura ? <ul><li>Initial se verifica daca metoda apelata exista in clasa curenta, iar daca nu exista va fi apelata metoda primului parinte din declaratia clasei. </li></ul><ul><li>class MyContact extends MyNameMixin , MyAddressMixin { } </li></ul>
    16. 16. Charts
    17. 17. Transformari
    18. 18. javafx.com
    19. 19. learnjavafx.typepad.com
    20. 20. Essential JavaFx
    21. 21. http://java.sun.com/javafx/1.2/docs/api/
    22. 22. google.com :p

    ×