Upload
raphael-marques
View
4.004
Download
0
Embed Size (px)
Citation preview
Plataforma Java x Plataforma .NETEdição DF 2009
Visão geral da Java SE 6.0/7.0(AWT, Swing, ...)
JavaFX 1.2 para desktops e para Web
José Raphael Teixeira MarquesMestrando em Informática pela UFPB
Tema 4Aplicações desktop (GUI) e aplicações ricas para Internet (RIA)
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB)
Agenda
AWT / Swing
Java SE 6.0 / 7.0
JavaFX
JavaFX Script
Demonstração
Interface Gráfica com JavaFX
Os problemas
Por onde começar?
E o futuro?
Conclusão
2
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 3
AWT / Swing AWT (Abstract Window Toolkit)
Depende de código nativo
Visual do SO
Mais rápido
Mais simples
Swing
Independente de código nativo
100% Java
Pluggable Look and Feel
Mais complexo
Problema
Falta uma boa ferramenta para interfaces
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 4
Java SE 6.0 / 7.0
Java SE 6.0 Update 10
Java Kernel
Applets em processo separado do Browser
Scripting
JavaFX
Java SE 7.0
Melhorias em concorrência
Swing Application Framework
Java Media Components
G1 Garbage Collector
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 5
JavaFX
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 6
JavaFX
Uma única plataforma RIA para todas as telas
Mercado de amplo alcance
Workflow designer-desenvolvedor
Runtime poderoso
Liberdade do browser
Compatibilidade com tecnologias Java
Muito mais poderoso (e simples) que o Swing
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 7
JavaFX Script
Um Java melhorado
Orientada a objetos e funcional
Fácil leitura
Inferência de tipos
Sequences
Binding e triggers
Focado em criar interfaces
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 8
Demonstração
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 9
Interface gráfica com JavaFXpublic 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);
}
}
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 10
Interface gráfica com JavaFXStage {
title: "Hello World em JavaFX"
width: 250 height: 80
scene: Scene {
content: Text {
content: "Hello World!"
x: 10 y: 30
font : Font {
size : 24
}
}
}
}
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 11
Interface gráfica com JavaFX...
content: [
Circle {
centerX:125 centerY:125 radius:90
fill:Color.WHITE
stroke:Color.RED strokeWidth:2
}
Rectangle{
x:45 y:45 width:160 height:160
arcWidth:15 arcHeight:15
fill:Color.GREEN
opacity:0.8 rotate:15
effect:DropShadow{}
}
]
...
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 12
JavaFX Media
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 13
Suporte a SVG
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 14
Workflow designer-desenvolvedor
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB)
Formas e Preenchimentos
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 16
Efeitos
16
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 17
Controles
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 18
Controles
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 19
Charts
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 20
Skinnable Controls
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 21
Integração com JEE
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 22
Os problemas
Distribuição:
Carregamento do Applet
JavaWebStart em inglês
JavaFX Runtime online na 1ª vez
Java Runtime maior
JavaFX Script
As vezes é preciso escrever muito
Mudanças de sintaxe
Não permite binding com objetos Java
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 23
Por onde começar?
JavaFX
http://javafx.com/
JavaFX Programing (with Passion!)
http://www.javapassion.com/javafx/
JavaFX Developer Home
http://java.sun.com/javafx/
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 24
O que temos hoje?
Windows, Linux, Mac OS X e Solaris x86
Symbian OS, Windows Mobile e Android
JavaFX 1.2.1 SDK
Netbeans IDE 6.7.1 para JavaFX 1.2
JavaFX 1.2 Eclipse-plugin
JavaFX 1.2 Production Suite
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 25
DataBox
www.reportmill.com/dbox/
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 26
JFXtras
jfxtras.org
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 27
WidgetFX
widgetfx.org
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 28
TwitterFX
http://blogs.herod.net/javafx/twitterfx/
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 29
E o futuro?
Investimento da Sun/Oracle
Oracle quer a interface do OpenOffice em JavaFX
JavaFX Mobile e JavaFX TV
Java 7 + JavaFX 1.3 + JavaFX Autoring Tool
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 30
JavaFX Authoring Tool
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 31
JavaFX Authoring Tool
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 32
JavaFX Authoring Tool
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 33
JavaFX Authoring Tool
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 34
Conclusão
Prós:
JavaFX tem um grande potencial
Workflow designer-desenvolvedor
Ainda tem muito o que evoluir
Contras:
Problema na distribuição
Ainda tem muito o que evoluir
Dúvida:
JavaFX Authoring Tool?
Pla
tafo
rma
Java
x P
lata
form
a .N
ETEd
ição
DF
20
09
© 2009 JavaVersusDotNet.com.br, José Raphael Teixeira Marques (Mestrando em Informática pela UFPB) 35
Contato
Email:
Twitter:
@raphaelmarques
Blog:
Perguntas?