Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Importância do JavaFX no Mercado Embedded

A Importância do JavaFX no Mercado Embedded

Palestra apresentada no The Developers Conference 2013 (TDC2013) em Porto Alegre

Bruno Borges

October 26, 2013
Tweet

More Decks by Bruno Borges

Other Decks in Technology

Transcript

  1. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 A importância do JavaFX para o mercado Embedded Bruno Borges Principal Product Manager Oracle Latin America
  2. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Bruno Borges Oracle Product Manager Desenvolvedor, Gamer Entusiasta em Java Embedded e JavaFX Twitter: @brunoborges
  3. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13
  4. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Uso de PCs na Indústria
  5. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Peças antigas, custo alto de manutenção
  6. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Raspberry.Pi – Custo de US$ 35,00
  7. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Mercado para Embarcados
  8. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Interfaces Touch Screen
  9. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 FX
  10. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13
  11. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13
  12. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13
  13. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 DEMO Projeto Ensemble
  14. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13
  15. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 JavaFX 3D
  16. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 17 Criando Formas e Materiais Primitivos
  17. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Colocando Textura em uma Esfera 18
  18. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Colocando Textura em uma Esfera 19
  19. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 DEMO JavaFX 3D
  20. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Colocando Textura em uma Esfera 21
  21. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 JavaFX é o sucessor do Java Swing
  22. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Disponível para... Windows, Linux, Mac OS X E em Preview... ARM* Apple iOS* (usando RoboVM) Android* (prototipo) Standalone para Java 6 JavaFX 2.2 vem junto com JDK 7u6+ Parte do ClassPath a partir do Java SE 8
  23. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Arquitetura Prism – renderização Direct3D em Windows OpenGL em Linux/Mac/Embedded Public API JavaFX API Scene Graph
  24. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 OpenJFX JavaFX open sourced! http://openjdk.java.net/projects/openjfx/
  25. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 DEMO App JavaFX escrita em Javascript
  26. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Criando sua primeira aplicação JavaFX
  27. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 JavaFX Scene Builder 1.1 GA bit.ly/javafxdownload
  28. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Your First JavaFX App for RaspberryPi
  29. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 16 Scene Graph  Responsável pela UI  Estrutura em Árvore  Possui um nó raiz  Vários nós branch e leaf
  30. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Scene Graph Root Node – único sem um “parent” Branch Node – deriva de javafx.scene.Parent Pode possuir outros nós Leaf Node – não possui filhos Shapes, Images, Text, WebView, Media, Controls, Charts, etc...
  31. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Sua primeira aplicação JavaFX public class MyApplication extends Application { @Override public void start(Stage stage) throws Exception { URL fxml = getClass().getResource("MyApplication.fxml"); Parent root = FXMLLoader.load(fxml); Scene scene = new Scene(root); stage.setScene(scene); stage.setFullScreen(true); stage.show(); } public static void main(String[] args) { launch(args); } }
  32. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Properties no Swing // Java Swing private static final String VALUE_PROPERTY = "value"; private double value = 0; public double getValue() { return value; } public void setValue(double newValue) { double oldValue = value; value = newValue; firePropertyChange(VALUE_PROPERTY, oldValue, value); }
  33. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Properties no JavaFX // JavaFX DoubleProperty value = new SimpleDoubleProperty(0); public double getValue() { return value.get(); } public void setValue(double newValue){ value.set(newValue); } public DoubleProperty valueProperty() { return value; }
  34. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Bindings Binding unidirecional bind(); Binding bi-direcional bindBidirectional();
  35. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Bindings IntegerProperty number1 = new SimpleIntegerProperty(1); IntegerProperty number2 = new SimpleIntegerProperty(2); DoubleProperty number3 = new SimpleDoubleProperty(0.5); NumberBinding sum1 = number1.add(number2); NumberBinding result1 = number1 .add(number2) .multiply(number3); NumberBinding sum2 = Bindings.add(number1, number2); NumberBinding result2 = Bindings .add(number1, multiply(number2, number3));
  36. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Limite de Velocidade 60 FPS
  37. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 DEMO JavaFX com NetBeans 7.4
  38. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Suporte a Dispositivos Embedded
  39. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Raspberry Pi Configurations for JavaFX applications CPU Overclock 900~950MHz Memory split 128MB for video Framebuffer framebuffer_width=1280 framebuffer_height=720
  40. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 CPU Overclock for JavaFX applications $ cat /proc/cpuinfo Processor : ARMv6-compatible processor rev 7 (v6l) BogoMIPS : 697.95 … $ sudo raspi-config bit.ly/raspioverclock
  41. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 CPU Overclock for JavaFX applications $ cat /proc/cpuinfo Processor : ARMv6-compatible processor rev 7 (v6l) BogoMIPS : 697.95 … $ sudo raspi-config
  42. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 CPU Overclock for JavaFX applications $ cat /proc/cpuinfo Processor : ARMv6-compatible processor rev 7 (v6l) BogoMIPS : 697.95 … $ sudo raspi-config
  43. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Memory Split for JavaFX applications 128mb best performance 64mb may work $ sudo raspi-config
  44. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Memory Split for JavaFX applications 128mb best performance 64mb may work $ sudo raspi-config
  45. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Video Framebuffer for JavaFX applications Edit /boot/config.txt Enable (uncomment) these options, with these values: framebuffer_width=1280 framebuffer_height=720
  46. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Exiting a JavaFX Application on Raspberry.Pi Connect over SSH and kill the java process $ killall -9 java Enable the debug environment variable to enable control-C exit command $ export JAVA_DEBUG=1 $ java -cp Stopwatch.jar stopwatch.MainScreen
  47. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Final parameters for JavaFX on Raspy Do not show virtual keyboard (optional) -Dcom.sun.javafx.isEmbedded=false Send video to the framebuffer (required!) -Djavafx.platform=eglfb
  48. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Perguntas?
  49. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 Obrigado! @brunoborges
  50. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13 The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  51. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

    Insert Information Protection Policy Classification from Slide 13