SlideShare una empresa de Scribd logo
1 de 80
Descargar para leer sin conexión
Raphael Marques

Mestrando em Informática da UFPB
jose.raphael.marques@gmail.com
raphaelmarques.wordpress.com
   JavaFX é a melhor forma para criar conteúdo
    rico expressivo. Baseado na Plataforma Java,
    JavaFX oferece uma atraente combinação de
    onipresença, capacidade, expressividade e
    performance.




                                                   3
4
5
   Uma família de tecnologias
     JavaFX Runtime
     JavaFX Script
     JavaFX Tools

   Para quem?
     Designers
     Desenvolvedores


                                 6
7
8
9
10
JavaScript   HTML 5


                      11
13
14
15
16
17
18
   Uma única plataforma RIA para todas as telas
   Mercado de amplo alcance
   Fluxo de trabalho designer-desenvolvedor
   Runtime poderoso
   Liberdade do browser
   Compatibilidade com tecnologias Java
                                                   20
   Tipos de dados básicos (não podem ser null)
       Integer
       Number
       Boolean
       Duration

   String
   Sequence
   Function
                                                  22
var string1 = "raphael";
var string2 : String = "raphael";
var integer1 = 3;
var integer2 : Integer = 3;
var number1 = 3.0;
var number2 : Number = 3;
var number3 = 3 as Number;
var number4 = integer1 + number1;

                                    23
TIPAGEM ESTÁTICA
       VS
TIPAGEM DINÂMICA
                   24
println("raphael marques");
//raphael marques

println('raphael marques');
//raphael marques

println("raphael 'marques'");
//raphael 'marques'

println('raphael "marques"');
//raphael "marques"
                                25
var s1 = "raphael";
var s2 = "marques";
println("{s1} {s2}");
//raphael marques

"o valor de x eh: {x}"
"o valor de x eh: {objeto.getX()}"



                                     26
var x = 3;        var x : Integer = 3;
var y = 3.0;      var y : Number = 3.0;
var z: Integer;   var z: Integer = 0;
var w = x + y;    var w: Number = x + y;
var a = false;    var a : Boolean = false;
var b = x < y;    var b : Boolean = x < y;

                                             27
   Integer e Number:      Boolean:
    +                       and
    -                       or
    *                       not
    /
     mod



                                       28
var   t1 : Duration = 1ms;
var   t2 = 1s;
var   t3 = 1m;
var   t4 = 1h;
println("{t1} {t2} {t3} {t4}");
//1ms 500ms 60000ms 3600000ms
println(1s + 500ms);   //1500.0ms
println(1s / 500ms);   //2.0
println(1s*2);         //2000.0ms
println(1s/2);         //500.0ms

                                    29
30
def PI = 3.1416;
function calcArea(raio: Number): Number{
  return PI * raio * raio;
}
var raio = 5;
var area = calcArea(raio);




                                           31
def PI = 3.1416;
function calcArea(raio: Number) {
  return PI * raio * raio;
}
var raio = 5;
var area = calcArea(raio);




                                    32
def PI = 3.1416;
function calcArea(raio: Number) {
  PI * raio * raio;
}
var raio = 5;
var area = calcArea(raio);




                                    33
def PI = 3.1416;
var calcArea = function (raio: Number){
   PI * raio * raio;
};
var calcPerimetro = function(raio: Number){
   2 * PI * raio;
};
var calc = calcArea;
println(calc(5));
calc = calcPerimetro;
println(calc(5));

                                              34
def PI = 3.1416;
var calcArea = function (raio: Number){
   PI * raio * raio;
};
var calcPerimetro = function(raio: Number){
   2 * PI * raio;
};
var calc: function (Number): Number = calcArea;
println(calc(5));
calc = calcPerimetro;
println(calc(5));

                                                  35
class A{
   var x = 0;
   function getx(){
       x;
   }
}
var a = A{x:1};
var b = A{x:2};
var f = a.getx;
var g = b.getx;
println(f()); //1
println(g()); //2


                      36
   JavaFX
     http://javafx.com/

   JavaFX Developer Home
     http://java.sun.com/javafx/

   JavaFX Programing (with Passion!)
     http://www.javapassion.com/javafx/



                                           38
   Windows, Linux, Mac OS X e Solaris x86

   JavaFX 1.2 SDK

   Netbeans IDE 6.5.1 para JavaFX 1.2
   JavaFX 1.2 Production Suite
     Plugin para Adobe Illustrator e Adobe Photoshop
     Media Factory
      ▪ JavaFX Graphics Viewer e SVG Converter
                                                        39
40
41
var x = 1;
var y = bind x;
var z = bind y * 2;
println("{x} {y} {z}");   //1 1 2
x = 2;
println("{x} {y} {z}");   //2 2 4




                                    42
var a = 1;
var b = bind a with inverse;

println("{a} {b}");   //1 1

a = 2;
println("{a} {b}");   //2 2

b = 3;
println("{a} {b}");   //3 3

                               43
var x = 10;
var y = 20;
var rect1 = Rectangle{
   x: bind x;
   y: bind y;
};
var rect2 = bind Rectangle{
   x: x;
   y: y;
};
                              44
var x = 10;
var y = 20;
var lado = 100;                 lado
                        y
var rect = Rectangle{
  x: bind x
                                       lado
  y: bind y
  width: bind lado
  height: bind lado
}                           x


                                         45
var x = 10;                 lado/2

var y = 20;
var lado = 100;
                        y
                                     lado
var rect = Rectangle{
  x: bind x – lado/2
  y: bind y – lado/2
  width: bind lado
  height: bind lado
}                                x


                                            46
var x = 10;
var y = 20;                 lado/2
var lado = 50;
                        y
                                     lado
var rect = Rectangle{
  x: bind x – lado/2
  y: bind y – lado/2
  width: bind lado
  height: bind lado
}                             x


                                            47
def PI = 3.1416;
var raio = 5;
bound function calcArea(){
  PI * raio * raio;
}
var area = bind calcArea();
println(area);           // 78.53999
raio = 10;
println(area);           // 314.15997
                                        48
var a = 1 on replace old{
 println("changing");
 println("old: {old}");
 println("new: {a}");
};
a = 3;
//changing
//old: 0
//new: 1
//changing
//old: 1
//new: 3
                            49
public class HelloWorldSwing{
  public static void main(String[] args){
     JFrame frame =
            new JFrame("HelloWorld Swing");
     JLabel label =
            new JLabel("Hello World");
     frame.getContentPane().add(label);
     frame.setDefaultCloseOperation(
            JFrame.EXIT_ON_CLOSE);
     frame.pack();
     frame.setVisible(true);
  }
}
                                              51
Stage {
  title: "Hello World em JavaFX"
  width: 250 height: 80
  scene: Scene {
      content: Text {
        content: "Hello World!"
        x: 10 y: 30
        font : Font {
           size : 24
        }
      }
  }
}

                                   52
Stage {
  title: "Hello World em JavaFX"
  width: 250 height: 80
  scene: Scene {
      content: Text {
        content: "Hello World!"
        x: 10 y: 30
        font : Font {
           size : 24
        }
      }
  }
}

                                   53
Stage {
  title: "Hello World em JavaFX"
  width: 250 height: 80
  scene: Scene {
      content: Text {
        content: "Hello World!"
        x: 10 y: 30
        font : Font {
           size : 24
        }
      }
  }
}

                                   54
Stage {
  title: "Hello World em JavaFX"
  width: 250 height: 80
  scene: Scene {
      content: Text {
        content: "Hello World!"
        x: 10 y: 30
        font : Font {
           size : 24
        }
      }
  }
}

                                   55
Stage {
  title: "Hello World em JavaFX"
  width: 250 height: 80
  scene: Scene {
      content: Text {
        content: "Hello World!"
        x: 10 y: 30
        font : Font {
           size : 24
        }
      }
  }
}

                                   56
Stage{
  title: "Declarar eh facil!"
  width: 250
  height: 250
}




                                57
Stage{
  title: "Declarar eh facil!"
  scene: Scene{
      width: 250
      height: 250
  }
}




                                58
Stage{
  ...
  scene: Scene{
      ...
      content: [
          Rectangle{
            x: 45 y: 45
            width: 160 height: 160
            arcWidth: 15 arcHeight: 15
            fill: Color.GREEN
          }
      ]
  }
}

                                         59
Stage{
  ...
  scene: Scene{
      ...
      content: [
          Rectangle{
            x: 45 y: 45
            width: 160 height: 160
            arcWidth: 15 arcHeight: 15
            fill: Color.GREEN
          }
      ]
  }
}

                                         60
Stage{
  ...
  scene: Scene{
      ...
      content: [
          Rectangle{
            x: 45 y: 45
            width: 160 height: 160
            arcWidth: 15 arcHeight: 15
            fill: Color.GREEN
          }
      ]
  }
}

                                         61
Stage{
  ...
  scene: Scene{
      ...
      content: [
          Rectangle{
            x: 45 y: 45
            width: 160 height: 160
            arcWidth: 15 arcHeight: 15
            fill: Color.GREEN
          }
      ]
  }
}

                                         62
...
content: [
    Rectangle{
      ...
    }
    Circle{
      centerX: 125 centerY: 125
      radius: 90
      fill: Color.WHITE
      stroke: Color.RED
    }
]
...

                                  63
...
content: [
    Rectangle{
      ...
    }
    Circle{
      centerX: 125 centerY: 125
      radius: 90
      fill: Color.WHITE
      stroke: Color.RED
    }
]
...

                                  64
...
content: [
    Circle{
      ...
    }
    Rectangle{
      ...
    }
]
...
                 65
...
content: [
    Circle{
      ...
    }
    Rectangle{
      ...
      opacity: 0.6
    }
]
...
                     66
...
Rectangle{
    ...
    transforms: Rotate{
        pivotX: 125 pivotY: 125
        angle: 15
    }
}
...


                                  67
...
Rectangle{
     ...
    rotate: 15
}
...




                 68
...
Rectangle{
    ...
    effect: Lighting{
        surfaceScale: 5
    }
}
...



                          69
ImageView{
  image: Image{
     url: "{__DIR__}imagem.png"
  }
  rotate: 15
  scaleX: 2
}


                                  70
71
...
Group{
    translateX: 15           Group
    translateY: 15
    content: [
       Text{
               ...
       }                    Translate
       Circle{
               ...
       }
    ]
}
...                  Text               Circle


                                                 72
73
var x: Number;             var px: Number;
var y: Number;             var py: Number;
...
Rectangle{
    x: bind x
    y: bind y
    ...
    onMousePressed: function(e: MouseEvent){
         px = x;
         py = y;
    }
    onMouseDragged: function(e: MouseEvent){
         x = px + e.dragX;
         y = px + e.dragY;
    }
}
...
                                               74
var x: Number;             var px: Number;
var y: Number;             var py: Number;
...
Rectangle{
    x: bind x
    y: bind y
    ...
    onMousePressed: function(e: MouseEvent){
         px = x;
         py = y;
    }
    onMouseDragged: function(e: MouseEvent){
         x = px + e.dragX;
         y = px + e.dragY;
    }
}
...
                                               75
var x: Number;             var px: Number;
var y: Number;             var py: Number;
...
Rectangle{
    x: bind x
    y: bind y
    ...
    onMousePressed: function(e: MouseEvent){
         px = x;
         py = y;
    }
    onMouseDragged: function(e: MouseEvent){
         x = px + e.dragX;
         y = px + e.dragY;
    }
}
...
                                               76
var x: Number;             var px: Number;
var y: Number;             var py: Number;
...
Rectangle{
    x: bind x
    y: bind y
    ...
    onMousePressed: function(e: MouseEvent){
         px = x;
         py = y;
    }
    onMouseDragged: function(e: MouseEvent){
         x = px + e.dragX;
         y = px + e.dragY;
    }
}
...
                                               77
var x: Number;             var px: Number;
var y: Number;             var py: Number;
...
Rectangle{
    x: bind x
    y: bind y
    ...
    onMousePressed: function(e: MouseEvent){
         px = x;
         py = y;
    }
    onMouseDragged: function(e: MouseEvent){
         x = px + e.dragX;
         y = px + e.dragY;
    }
}
...
                                               78
79
80

Más contenido relacionado

La actualidad más candente

Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision DetectionJenchoke Tachagomain
 
Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2MEJenchoke Tachagomain
 
computer graphics practicals
computer graphics practicalscomputer graphics practicals
computer graphics practicalsManoj Chauhan
 
Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”Platonov Sergey
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignmentAbdullah Al Shiam
 
C Code and the Art of Obfuscation
C Code and the Art of ObfuscationC Code and the Art of Obfuscation
C Code and the Art of Obfuscationguest9006ab
 
Bartosz Milewski, “Re-discovering Monads in C++”
Bartosz Milewski, “Re-discovering Monads in C++”Bartosz Milewski, “Re-discovering Monads in C++”
Bartosz Milewski, “Re-discovering Monads in C++”Platonov Sergey
 
Fertile Ground: The Roots of Clojure
Fertile Ground: The Roots of ClojureFertile Ground: The Roots of Clojure
Fertile Ground: The Roots of ClojureMike Fogus
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.Mike Fogus
 
ACM Distinguished Program: Cooperative Testing and Analysis: Human-Tool, Tool...
ACM Distinguished Program: Cooperative Testing and Analysis: Human-Tool, Tool...ACM Distinguished Program: Cooperative Testing and Analysis: Human-Tool, Tool...
ACM Distinguished Program: Cooperative Testing and Analysis: Human-Tool, Tool...Tao Xie
 
Travel management
Travel managementTravel management
Travel management1Parimal2
 
openFrameworks 007 - utils
openFrameworks 007 - utilsopenFrameworks 007 - utils
openFrameworks 007 - utilsroxlu
 
The Macronomicon
The MacronomiconThe Macronomicon
The MacronomiconMike Fogus
 
Adventures In Data Compilation
Adventures In Data CompilationAdventures In Data Compilation
Adventures In Data CompilationNaughty Dog
 
Creating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector GraphicsCreating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector GraphicsDavid Keener
 
Why learn new programming languages
Why learn new programming languagesWhy learn new programming languages
Why learn new programming languagesJonas Follesø
 

La actualidad más candente (20)

Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
 
Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2ME
 
computer graphics practicals
computer graphics practicalscomputer graphics practicals
computer graphics practicals
 
Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignment
 
C Code and the Art of Obfuscation
C Code and the Art of ObfuscationC Code and the Art of Obfuscation
C Code and the Art of Obfuscation
 
Bartosz Milewski, “Re-discovering Monads in C++”
Bartosz Milewski, “Re-discovering Monads in C++”Bartosz Milewski, “Re-discovering Monads in C++”
Bartosz Milewski, “Re-discovering Monads in C++”
 
Fertile Ground: The Roots of Clojure
Fertile Ground: The Roots of ClojureFertile Ground: The Roots of Clojure
Fertile Ground: The Roots of Clojure
 
Advance java
Advance javaAdvance java
Advance java
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.
 
ACM Distinguished Program: Cooperative Testing and Analysis: Human-Tool, Tool...
ACM Distinguished Program: Cooperative Testing and Analysis: Human-Tool, Tool...ACM Distinguished Program: Cooperative Testing and Analysis: Human-Tool, Tool...
ACM Distinguished Program: Cooperative Testing and Analysis: Human-Tool, Tool...
 
Travel management
Travel managementTravel management
Travel management
 
openFrameworks 007 - utils
openFrameworks 007 - utilsopenFrameworks 007 - utils
openFrameworks 007 - utils
 
OpenGL Starter L01
OpenGL Starter L01OpenGL Starter L01
OpenGL Starter L01
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
The Macronomicon
The MacronomiconThe Macronomicon
The Macronomicon
 
Adventures In Data Compilation
Adventures In Data CompilationAdventures In Data Compilation
Adventures In Data Compilation
 
Creating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector GraphicsCreating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector Graphics
 
Why learn new programming languages
Why learn new programming languagesWhy learn new programming languages
Why learn new programming languages
 
EcmaScript 6
EcmaScript 6 EcmaScript 6
EcmaScript 6
 

Destacado

JavaFX: A nova biblioteca gráfica da plataforma Java
JavaFX: A nova biblioteca gráfica da plataforma JavaJavaFX: A nova biblioteca gráfica da plataforma Java
JavaFX: A nova biblioteca gráfica da plataforma JavajesuinoPower
 
Aplicações desktop (GUI) e aplicações ricas para internet (RIA)
Aplicações desktop (GUI) e aplicações ricas para internet (RIA)Aplicações desktop (GUI) e aplicações ricas para internet (RIA)
Aplicações desktop (GUI) e aplicações ricas para internet (RIA)Raphael Marques
 
Desenvolvimento rápido de aplicações com JEE e JavaFX
Desenvolvimento rápido de aplicações com JEE e JavaFXDesenvolvimento rápido de aplicações com JEE e JavaFX
Desenvolvimento rápido de aplicações com JEE e JavaFXjesuinoPower
 
Criando aplicações java fx em minutos
Criando aplicações java fx em minutosCriando aplicações java fx em minutos
Criando aplicações java fx em minutosBruno Oliveira
 
Boas práticas na criação de aplicações sérias com JavaFX - TDC 2014 SP
Boas práticas na criação de aplicações sérias com JavaFX - TDC 2014 SPBoas práticas na criação de aplicações sérias com JavaFX - TDC 2014 SP
Boas práticas na criação de aplicações sérias com JavaFX - TDC 2014 SPjesuinoPower
 
JavaFX 2.1 - следующее поколение клиентской Java
JavaFX 2.1 - следующее поколение клиентской JavaJavaFX 2.1 - следующее поколение клиентской Java
JavaFX 2.1 - следующее поколение клиентской JavaAlexander_K
 
JavaFX 2.0 and Alternative Languages
JavaFX 2.0 and Alternative LanguagesJavaFX 2.0 and Alternative Languages
JavaFX 2.0 and Alternative LanguagesStephen Chin
 
01 - JavaFX. Введение в JavaFX
01 - JavaFX. Введение в JavaFX01 - JavaFX. Введение в JavaFX
01 - JavaFX. Введение в JavaFXRoman Brovko
 
Refatoração: Como deixar seu código livre de maus Cheiros
Refatoração: Como deixar seu código livre de maus CheirosRefatoração: Como deixar seu código livre de maus Cheiros
Refatoração: Como deixar seu código livre de maus CheirosPedro Hos
 

Destacado (20)

JavaFX: A nova biblioteca gráfica da plataforma Java
JavaFX: A nova biblioteca gráfica da plataforma JavaJavaFX: A nova biblioteca gráfica da plataforma Java
JavaFX: A nova biblioteca gráfica da plataforma Java
 
Introdução ao JavaFX
Introdução ao JavaFXIntrodução ao JavaFX
Introdução ao JavaFX
 
Aplicações desktop (GUI) e aplicações ricas para internet (RIA)
Aplicações desktop (GUI) e aplicações ricas para internet (RIA)Aplicações desktop (GUI) e aplicações ricas para internet (RIA)
Aplicações desktop (GUI) e aplicações ricas para internet (RIA)
 
JavaFX 1.2
JavaFX 1.2JavaFX 1.2
JavaFX 1.2
 
JavaFX
JavaFXJavaFX
JavaFX
 
Classes Internas
Classes InternasClasses Internas
Classes Internas
 
Desenvolvimento rápido de aplicações com JEE e JavaFX
Desenvolvimento rápido de aplicações com JEE e JavaFXDesenvolvimento rápido de aplicações com JEE e JavaFX
Desenvolvimento rápido de aplicações com JEE e JavaFX
 
Operadores Java
Operadores JavaOperadores Java
Operadores Java
 
Criando aplicações java fx em minutos
Criando aplicações java fx em minutosCriando aplicações java fx em minutos
Criando aplicações java fx em minutos
 
Boas práticas na criação de aplicações sérias com JavaFX - TDC 2014 SP
Boas práticas na criação de aplicações sérias com JavaFX - TDC 2014 SPBoas práticas na criação de aplicações sérias com JavaFX - TDC 2014 SP
Boas práticas na criação de aplicações sérias com JavaFX - TDC 2014 SP
 
O direito ambiental e sua autonomia atual
O direito ambiental e sua autonomia atualO direito ambiental e sua autonomia atual
O direito ambiental e sua autonomia atual
 
JavaFX 2.1 - следующее поколение клиентской Java
JavaFX 2.1 - следующее поколение клиентской JavaJavaFX 2.1 - следующее поколение клиентской Java
JavaFX 2.1 - следующее поколение клиентской Java
 
JavaFX technology
JavaFX technologyJavaFX technology
JavaFX technology
 
JavaFX 2.0 overview
JavaFX 2.0 overviewJavaFX 2.0 overview
JavaFX 2.0 overview
 
JavaFX 2.0 and Alternative Languages
JavaFX 2.0 and Alternative LanguagesJavaFX 2.0 and Alternative Languages
JavaFX 2.0 and Alternative Languages
 
01 - JavaFX. Введение в JavaFX
01 - JavaFX. Введение в JavaFX01 - JavaFX. Введение в JavaFX
01 - JavaFX. Введение в JavaFX
 
JavaFX introduction
JavaFX introductionJavaFX introduction
JavaFX introduction
 
JavaFX Advanced
JavaFX AdvancedJavaFX Advanced
JavaFX Advanced
 
Introduction to JavaFX 2
Introduction to JavaFX 2Introduction to JavaFX 2
Introduction to JavaFX 2
 
Refatoração: Como deixar seu código livre de maus Cheiros
Refatoração: Como deixar seu código livre de maus CheirosRefatoração: Como deixar seu código livre de maus Cheiros
Refatoração: Como deixar seu código livre de maus Cheiros
 

Similar a Mini-curso JavaFX Aula1

JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011Stephen Chin
 
Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...
Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...
Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...Naresha K
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manualUma mohan
 
JavaFX Your Way - Devoxx Version
JavaFX Your Way - Devoxx VersionJavaFX Your Way - Devoxx Version
JavaFX Your Way - Devoxx VersionStephen Chin
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manualVivek Kumar Sinha
 
JavaFX 2.0 With Alternative Languages [Portuguese]
JavaFX 2.0 With Alternative Languages [Portuguese]JavaFX 2.0 With Alternative Languages [Portuguese]
JavaFX 2.0 With Alternative Languages [Portuguese]Stephen Chin
 
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...Stephen Chin
 
Gremlin's Graph Traversal Machinery
Gremlin's Graph Traversal MachineryGremlin's Graph Traversal Machinery
Gremlin's Graph Traversal MachineryMarko Rodriguez
 
DataStax | Graph Computing with Apache TinkerPop (Marko Rodriguez) | Cassandr...
DataStax | Graph Computing with Apache TinkerPop (Marko Rodriguez) | Cassandr...DataStax | Graph Computing with Apache TinkerPop (Marko Rodriguez) | Cassandr...
DataStax | Graph Computing with Apache TinkerPop (Marko Rodriguez) | Cassandr...DataStax
 
Java Fx Overview Tech Tour
Java Fx Overview Tech TourJava Fx Overview Tech Tour
Java Fx Overview Tech TourCarol McDonald
 
Kotlin, smarter development for the jvm
Kotlin, smarter development for the jvmKotlin, smarter development for the jvm
Kotlin, smarter development for the jvmArnaud Giuliani
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to GoJaehue Jang
 
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티JaeYeoul Ahn
 

Similar a Mini-curso JavaFX Aula1 (20)

Groovy's Builder
Groovy's BuilderGroovy's Builder
Groovy's Builder
 
JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011
 
Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...
Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...
Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...
 
Javafx Overview 90minutes
Javafx Overview 90minutesJavafx Overview 90minutes
Javafx Overview 90minutes
 
Javafx Overview 90minutes
Javafx Overview 90minutesJavafx Overview 90minutes
Javafx Overview 90minutes
 
Javafx Overview 90minutes
Javafx Overview 90minutesJavafx Overview 90minutes
Javafx Overview 90minutes
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
JavaFX Your Way - Devoxx Version
JavaFX Your Way - Devoxx VersionJavaFX Your Way - Devoxx Version
JavaFX Your Way - Devoxx Version
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manual
 
JavaFX 2.0 With Alternative Languages [Portuguese]
JavaFX 2.0 With Alternative Languages [Portuguese]JavaFX 2.0 With Alternative Languages [Portuguese]
JavaFX 2.0 With Alternative Languages [Portuguese]
 
Myraytracer
MyraytracerMyraytracer
Myraytracer
 
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...
 
Gremlin's Graph Traversal Machinery
Gremlin's Graph Traversal MachineryGremlin's Graph Traversal Machinery
Gremlin's Graph Traversal Machinery
 
DataStax | Graph Computing with Apache TinkerPop (Marko Rodriguez) | Cassandr...
DataStax | Graph Computing with Apache TinkerPop (Marko Rodriguez) | Cassandr...DataStax | Graph Computing with Apache TinkerPop (Marko Rodriguez) | Cassandr...
DataStax | Graph Computing with Apache TinkerPop (Marko Rodriguez) | Cassandr...
 
Fact, Fiction, and FP
Fact, Fiction, and FPFact, Fiction, and FP
Fact, Fiction, and FP
 
Java Fx Overview Tech Tour
Java Fx Overview Tech TourJava Fx Overview Tech Tour
Java Fx Overview Tech Tour
 
SVGo workshop
SVGo workshopSVGo workshop
SVGo workshop
 
Kotlin, smarter development for the jvm
Kotlin, smarter development for the jvmKotlin, smarter development for the jvm
Kotlin, smarter development for the jvm
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
 

Más de Raphael Marques

Introdução a Informática - Arquitetura
Introdução a Informática - ArquiteturaIntrodução a Informática - Arquitetura
Introdução a Informática - ArquiteturaRaphael Marques
 
O que você produz além de código?
O que você produz além de código?O que você produz além de código?
O que você produz além de código?Raphael Marques
 
Aplicações desktop (GUI) e aplicações ricas para internet (RIA)
Aplicações desktop (GUI) e aplicações ricas para internet (RIA)Aplicações desktop (GUI) e aplicações ricas para internet (RIA)
Aplicações desktop (GUI) e aplicações ricas para internet (RIA)Raphael Marques
 
Slides de PDI 2009 - Raphael Update 5
Slides de PDI 2009 - Raphael Update 5Slides de PDI 2009 - Raphael Update 5
Slides de PDI 2009 - Raphael Update 5Raphael Marques
 
slides PDI 2007 leonardo
slides PDI 2007 leonardoslides PDI 2007 leonardo
slides PDI 2007 leonardoRaphael Marques
 
Slides PDI 2009 Raphael versao4
Slides PDI 2009 Raphael versao4Slides PDI 2009 Raphael versao4
Slides PDI 2009 Raphael versao4Raphael Marques
 

Más de Raphael Marques (11)

Sistemas numéricos
Sistemas numéricosSistemas numéricos
Sistemas numéricos
 
Windows explorer
Windows explorerWindows explorer
Windows explorer
 
Interface do windows
Interface do windowsInterface do windows
Interface do windows
 
Internet
InternetInternet
Internet
 
Introdução a Informática - Arquitetura
Introdução a Informática - ArquiteturaIntrodução a Informática - Arquitetura
Introdução a Informática - Arquitetura
 
O que você produz além de código?
O que você produz além de código?O que você produz além de código?
O que você produz além de código?
 
Aplicações desktop (GUI) e aplicações ricas para internet (RIA)
Aplicações desktop (GUI) e aplicações ricas para internet (RIA)Aplicações desktop (GUI) e aplicações ricas para internet (RIA)
Aplicações desktop (GUI) e aplicações ricas para internet (RIA)
 
Slides de PDI 2009 - Raphael Update 5
Slides de PDI 2009 - Raphael Update 5Slides de PDI 2009 - Raphael Update 5
Slides de PDI 2009 - Raphael Update 5
 
slides PDI 2007 leonardo
slides PDI 2007 leonardoslides PDI 2007 leonardo
slides PDI 2007 leonardo
 
Slides PDI 2009 Raphael versao4
Slides PDI 2009 Raphael versao4Slides PDI 2009 Raphael versao4
Slides PDI 2009 Raphael versao4
 
Minicurso Java && Cl
Minicurso Java && ClMinicurso Java && Cl
Minicurso Java && Cl
 

Último

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 

Último (20)

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 

Mini-curso JavaFX Aula1

  • 1. Raphael Marques Mestrando em Informática da UFPB jose.raphael.marques@gmail.com raphaelmarques.wordpress.com
  • 2.
  • 3. JavaFX é a melhor forma para criar conteúdo rico expressivo. Baseado na Plataforma Java, JavaFX oferece uma atraente combinação de onipresença, capacidade, expressividade e performance. 3
  • 4. 4
  • 5. 5
  • 6. Uma família de tecnologias  JavaFX Runtime  JavaFX Script  JavaFX Tools  Para quem?  Designers  Desenvolvedores 6
  • 7. 7
  • 8. 8
  • 9. 9
  • 10. 10
  • 11. JavaScript HTML 5 11
  • 12.
  • 13. 13
  • 14. 14
  • 15. 15
  • 16. 16
  • 17. 17
  • 18. 18
  • 19.
  • 20. Uma única plataforma RIA para todas as telas  Mercado de amplo alcance  Fluxo de trabalho designer-desenvolvedor  Runtime poderoso  Liberdade do browser  Compatibilidade com tecnologias Java 20
  • 21.
  • 22. Tipos de dados básicos (não podem ser null)  Integer  Number  Boolean  Duration  String  Sequence  Function 22
  • 23. var string1 = "raphael"; var string2 : String = "raphael"; var integer1 = 3; var integer2 : Integer = 3; var number1 = 3.0; var number2 : Number = 3; var number3 = 3 as Number; var number4 = integer1 + number1; 23
  • 24. TIPAGEM ESTÁTICA VS TIPAGEM DINÂMICA 24
  • 25. println("raphael marques"); //raphael marques println('raphael marques'); //raphael marques println("raphael 'marques'"); //raphael 'marques' println('raphael "marques"'); //raphael "marques" 25
  • 26. var s1 = "raphael"; var s2 = "marques"; println("{s1} {s2}"); //raphael marques "o valor de x eh: {x}" "o valor de x eh: {objeto.getX()}" 26
  • 27. var x = 3; var x : Integer = 3; var y = 3.0; var y : Number = 3.0; var z: Integer; var z: Integer = 0; var w = x + y; var w: Number = x + y; var a = false; var a : Boolean = false; var b = x < y; var b : Boolean = x < y; 27
  • 28. Integer e Number:  Boolean: +  and -  or *  not /  mod 28
  • 29. var t1 : Duration = 1ms; var t2 = 1s; var t3 = 1m; var t4 = 1h; println("{t1} {t2} {t3} {t4}"); //1ms 500ms 60000ms 3600000ms println(1s + 500ms); //1500.0ms println(1s / 500ms); //2.0 println(1s*2); //2000.0ms println(1s/2); //500.0ms 29
  • 30. 30
  • 31. def PI = 3.1416; function calcArea(raio: Number): Number{ return PI * raio * raio; } var raio = 5; var area = calcArea(raio); 31
  • 32. def PI = 3.1416; function calcArea(raio: Number) { return PI * raio * raio; } var raio = 5; var area = calcArea(raio); 32
  • 33. def PI = 3.1416; function calcArea(raio: Number) { PI * raio * raio; } var raio = 5; var area = calcArea(raio); 33
  • 34. def PI = 3.1416; var calcArea = function (raio: Number){ PI * raio * raio; }; var calcPerimetro = function(raio: Number){ 2 * PI * raio; }; var calc = calcArea; println(calc(5)); calc = calcPerimetro; println(calc(5)); 34
  • 35. def PI = 3.1416; var calcArea = function (raio: Number){ PI * raio * raio; }; var calcPerimetro = function(raio: Number){ 2 * PI * raio; }; var calc: function (Number): Number = calcArea; println(calc(5)); calc = calcPerimetro; println(calc(5)); 35
  • 36. class A{ var x = 0; function getx(){ x; } } var a = A{x:1}; var b = A{x:2}; var f = a.getx; var g = b.getx; println(f()); //1 println(g()); //2 36
  • 37.
  • 38. JavaFX  http://javafx.com/  JavaFX Developer Home  http://java.sun.com/javafx/  JavaFX Programing (with Passion!)  http://www.javapassion.com/javafx/ 38
  • 39. Windows, Linux, Mac OS X e Solaris x86  JavaFX 1.2 SDK  Netbeans IDE 6.5.1 para JavaFX 1.2  JavaFX 1.2 Production Suite  Plugin para Adobe Illustrator e Adobe Photoshop  Media Factory ▪ JavaFX Graphics Viewer e SVG Converter 39
  • 40. 40
  • 41. 41
  • 42. var x = 1; var y = bind x; var z = bind y * 2; println("{x} {y} {z}"); //1 1 2 x = 2; println("{x} {y} {z}"); //2 2 4 42
  • 43. var a = 1; var b = bind a with inverse; println("{a} {b}"); //1 1 a = 2; println("{a} {b}"); //2 2 b = 3; println("{a} {b}"); //3 3 43
  • 44. var x = 10; var y = 20; var rect1 = Rectangle{ x: bind x; y: bind y; }; var rect2 = bind Rectangle{ x: x; y: y; }; 44
  • 45. var x = 10; var y = 20; var lado = 100; lado y var rect = Rectangle{ x: bind x lado y: bind y width: bind lado height: bind lado } x 45
  • 46. var x = 10; lado/2 var y = 20; var lado = 100; y lado var rect = Rectangle{ x: bind x – lado/2 y: bind y – lado/2 width: bind lado height: bind lado } x 46
  • 47. var x = 10; var y = 20; lado/2 var lado = 50; y lado var rect = Rectangle{ x: bind x – lado/2 y: bind y – lado/2 width: bind lado height: bind lado } x 47
  • 48. def PI = 3.1416; var raio = 5; bound function calcArea(){ PI * raio * raio; } var area = bind calcArea(); println(area); // 78.53999 raio = 10; println(area); // 314.15997 48
  • 49. var a = 1 on replace old{ println("changing"); println("old: {old}"); println("new: {a}"); }; a = 3; //changing //old: 0 //new: 1 //changing //old: 1 //new: 3 49
  • 50.
  • 51. public class HelloWorldSwing{ public static void main(String[] args){ JFrame frame = new JFrame("HelloWorld Swing"); JLabel label = new JLabel("Hello World"); frame.getContentPane().add(label); frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); } } 51
  • 52. Stage { title: "Hello World em JavaFX" width: 250 height: 80 scene: Scene { content: Text { content: "Hello World!" x: 10 y: 30 font : Font { size : 24 } } } } 52
  • 53. Stage { title: "Hello World em JavaFX" width: 250 height: 80 scene: Scene { content: Text { content: "Hello World!" x: 10 y: 30 font : Font { size : 24 } } } } 53
  • 54. Stage { title: "Hello World em JavaFX" width: 250 height: 80 scene: Scene { content: Text { content: "Hello World!" x: 10 y: 30 font : Font { size : 24 } } } } 54
  • 55. Stage { title: "Hello World em JavaFX" width: 250 height: 80 scene: Scene { content: Text { content: "Hello World!" x: 10 y: 30 font : Font { size : 24 } } } } 55
  • 56. Stage { title: "Hello World em JavaFX" width: 250 height: 80 scene: Scene { content: Text { content: "Hello World!" x: 10 y: 30 font : Font { size : 24 } } } } 56
  • 57. Stage{ title: "Declarar eh facil!" width: 250 height: 250 } 57
  • 58. Stage{ title: "Declarar eh facil!" scene: Scene{ width: 250 height: 250 } } 58
  • 59. Stage{ ... scene: Scene{ ... content: [ Rectangle{ x: 45 y: 45 width: 160 height: 160 arcWidth: 15 arcHeight: 15 fill: Color.GREEN } ] } } 59
  • 60. Stage{ ... scene: Scene{ ... content: [ Rectangle{ x: 45 y: 45 width: 160 height: 160 arcWidth: 15 arcHeight: 15 fill: Color.GREEN } ] } } 60
  • 61. Stage{ ... scene: Scene{ ... content: [ Rectangle{ x: 45 y: 45 width: 160 height: 160 arcWidth: 15 arcHeight: 15 fill: Color.GREEN } ] } } 61
  • 62. Stage{ ... scene: Scene{ ... content: [ Rectangle{ x: 45 y: 45 width: 160 height: 160 arcWidth: 15 arcHeight: 15 fill: Color.GREEN } ] } } 62
  • 63. ... content: [ Rectangle{ ... } Circle{ centerX: 125 centerY: 125 radius: 90 fill: Color.WHITE stroke: Color.RED } ] ... 63
  • 64. ... content: [ Rectangle{ ... } Circle{ centerX: 125 centerY: 125 radius: 90 fill: Color.WHITE stroke: Color.RED } ] ... 64
  • 65. ... content: [ Circle{ ... } Rectangle{ ... } ] ... 65
  • 66. ... content: [ Circle{ ... } Rectangle{ ... opacity: 0.6 } ] ... 66
  • 67. ... Rectangle{ ... transforms: Rotate{ pivotX: 125 pivotY: 125 angle: 15 } } ... 67
  • 68. ... Rectangle{ ... rotate: 15 } ... 68
  • 69. ... Rectangle{ ... effect: Lighting{ surfaceScale: 5 } } ... 69
  • 70. ImageView{ image: Image{ url: "{__DIR__}imagem.png" } rotate: 15 scaleX: 2 } 70
  • 71. 71
  • 72. ... Group{ translateX: 15 Group translateY: 15 content: [ Text{ ... } Translate Circle{ ... } ] } ... Text Circle 72
  • 73. 73
  • 74. var x: Number; var px: Number; var y: Number; var py: Number; ... Rectangle{ x: bind x y: bind y ... onMousePressed: function(e: MouseEvent){ px = x; py = y; } onMouseDragged: function(e: MouseEvent){ x = px + e.dragX; y = px + e.dragY; } } ... 74
  • 75. var x: Number; var px: Number; var y: Number; var py: Number; ... Rectangle{ x: bind x y: bind y ... onMousePressed: function(e: MouseEvent){ px = x; py = y; } onMouseDragged: function(e: MouseEvent){ x = px + e.dragX; y = px + e.dragY; } } ... 75
  • 76. var x: Number; var px: Number; var y: Number; var py: Number; ... Rectangle{ x: bind x y: bind y ... onMousePressed: function(e: MouseEvent){ px = x; py = y; } onMouseDragged: function(e: MouseEvent){ x = px + e.dragX; y = px + e.dragY; } } ... 76
  • 77. var x: Number; var px: Number; var y: Number; var py: Number; ... Rectangle{ x: bind x y: bind y ... onMousePressed: function(e: MouseEvent){ px = x; py = y; } onMouseDragged: function(e: MouseEvent){ x = px + e.dragX; y = px + e.dragY; } } ... 77
  • 78. var x: Number; var px: Number; var y: Number; var py: Number; ... Rectangle{ x: bind x y: bind y ... onMousePressed: function(e: MouseEvent){ px = x; py = y; } onMouseDragged: function(e: MouseEvent){ x = px + e.dragX; y = px + e.dragY; } } ... 78
  • 79. 79
  • 80. 80