The document discusses the basics of JavaFX including variables, functions, sequences, control structures, classes, inheritance, and charts. It provides an overview of key JavaFX concepts and features from the perspective of a Java developer. Resources for learning more about JavaFX are also listed, including books, tutorials, and API documentation.
4. Variabile Variabilele nu au tip ! def numeConstanta = 0 var numeVariabila = ¡°text¡± numeVariabila = 90 def numOne : Number = 1.0 def numTwo : Integer = 1
5. String def nume = ¡®Daniel¡¯; var s = ¡°Salut {nume}¡±; def s1 = ¡°acesta este un text¡± def s2 = ¡®acesta este alt text¡¯ Nu mai trebuie comparate folosind metoda equals(String) ! concatenare
6. Tipul de date duration 5ms; // 5 milsecunde 10s; // 10 secunde 30m; // 30 minute 1h; // 1 ora
8. Sequences (arrays) def zile = ["Mon","Tue","Wed","Thu","Fri"]; def zileSapt = [ zile , ["Sat","Sun"]]; reuniune def num = [1..100]; definire interval def numMaiMariCa2 = nums[n | n > 2]; conditie var lungime = sizeof zile; aflare lungime insert "Tue" into zile ; adaugare element insert "Thu" before zile [2]; delete "Sun" from zile ; eliminare element delete zile [0]; delete zile ;
10. Structuri de control if else for while throw - cath - finally var s = "The answer is {if (answer) "Yes¡° else "No"}"; // s = 'The answer is Yes' ¨C expresii embedded
11. Replace Triggers & Bind Replace Triggers var password = ¡° test1 " on replace oldValue { println("ALERT! Parola s-a schimbat !"); println(¡° Val veche : {oldValue}"); println(¡° Val noua : {password}"); }; password = ¡° test2 "; Bining password = "bar"; var x = 0; def y = bind x; x = 1; println(y); // y este acum 1 x = 47; println(y); // y este acum 47
12. ¡°Constructorul¡± class Address { var street: String; var city: String; var state: String; var zip: String; } class Customer { var firstName: String; var lastName: String; var phoneNum: String; var address: Address; } def customer = Customer { firstName: "John"; lastName: "Doe"; phoneNum: "(408) 555-1212" address: Address { street: "1 Main Street"; city: "Santa Clara"; state: "CA"; zip: "95050"; } }
13. Noi modificatori de acces public private protected defaults public-read? public-init
14. Mostenire multipla !!! mixin class MyNameMixin { var firstName = "John"; var lastName = "Doe"; function printName(){ println("My name is: {firstName} {lastName}");} } mixin class MyAddressMixin { var address = "1 Main Street, Anytown USA"; function printAddress(){ println("My address is: {address}");} } class MyContact extends MyNameMixin, MyAddressMixin { }
15. Doua metode cu aceasi semnatura ? Initial se verifica daca metoda apelata exista in clasa curenta, iar daca nu exista va fi apelata metoda primului parinte din declaratia clasei. class MyContact extends MyNameMixin , MyAddressMixin { }
#11: Din ce stiu eu nu exista un alt limbaj de scripting care sa aiba thow ¨C catch implementat
#12: Pentru exemplu cu Replace Triggers listenerul se apeleaza de doua ori
#13: 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