SlideShare a Scribd company logo
1 of 32
Download to read offline
2
Developing RIA with Java
                    Dan Vulpe
                    Software Engineer
                    Centric
                    @dvulpe
                    dvulpe@gmail.com
History

                                         Apr 2012       Aug 2012
                                        JavaFX         JavaFX
                             Oct 2011     2.1            2.2
                             JavaFX      LCD text       Canvas
                               2.0      UI elements   UI elements
 Dec 2008     Apr 2010
                             Java API   Video h264    Touch events
JavaFX 1.0   JavaFX 1.3      Windows        Mac          Linux
Scene graph design
                Scene




                Parent




       Parent   Parent   Parent




Leaf    Leaf     Leaf     Leaf    Leaf
Scene graph design
                Scene




                Parent




       Parent   Parent   Parent




Leaf    Leaf     Leaf     Leaf    Leaf
Nodes have Properties
•   parent

•   scene

•   translate (X,Y, Z)

•   scale (X,Y, Z)

•   opacity

•   ... see JavaDoc for javafx.scene.Node
Observable Properties

service.valueProperty().addListener(new ChangeListener<WorkItemUI>()
{
   @Override
   public void changed(ObservableValue<? extends WorkItemUI> value,
                                              WorkItemUI oldValue,
                                              WorkItemUI newValue) {
           itemsPane.getChildren().add(newValue);
    }
});
Binding

public void bindTo(WorkItemModel workItem) {
     title.bindBidirectional(workItem.title);
     issueType.bind(workItem.issueType);
     workItemInfo.bindBidirectional(workItem.workItemInfo);
     asignee.bindBidirectional(workItem.asignee);
     dueDate.bindBidirectional(workItem.dueDate);
     priority.bindBidirectional(workItem.priority);
 }
Hello JavaFX
Layouts
FXML
<VBox alignment="CENTER" prefHeight="250.0" prefWidth="450.0" spacing="5.0"
    xmlns:fx="http://javafx.com/fxml">
  <children>
    <Label text="Enter your credentials" textFill="WHITE"/>
    <GridPane fx:id="formContainer" hgap="10.0" vgap="10.0">
      <children>
        <Label text="Username" GridPane.columnIndex="0" GridPane.rowIndex="0"/>
        <Label text="Password" GridPane.columnIndex="0" GridPane.rowIndex="1" />
        <TextField GridPane.columnIndex="1" GridPane.rowIndex="0" />
        <TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
        <Button text="Log In" GridPane.columnIndex="1" GridPane.rowIndex="2" />
      </children>
    </GridPane>
  </children>
</VBox>
Scene Builder - Oracle
GUI Editor: Preview
CSS Styling
.root {
    -fx-font-size: 15px;
    -fx-base: #eee;
    -fx-font-family: "Trebuchet MS";
}

.workItem {
    -fx-border-radius: 5;
    -fx-background-radius: 5;
    -fx-effect: dropshadow(gaussian, #ccc, 10, 0.1, 5, 2);
    -fx-border-color: #666;
    -fx-border-weight: 1px;
    -fx-font-size: 1em;
    -fx-opacity: 0.9;
    -fx-base: #333;
}
Bindings
public class DemoController {
    @FXML
    private TextField textField;
    @FXML
    private Label label;
    @FXML
    private ListView<String> listView;
    @FXML
    private Pane rootPane;
    @FXML
    private Pane formPane;
    @FXML
    private Button aButton;

    public void setDataModel(DataModel dataModel) {
        label.textProperty().bind(dataModel.titleProperty());
        textField.textProperty().bindBidirectional(dataModel.textProperty());

        Bindings.bindContent(dataModel.aPlainList(), listView.getItems());

        aButton.disableProperty().bind(textField.textProperty().isEqualTo(""));
        formPane.prefWidthProperty().bind(rootPane.widthProperty().divide(2));
    }
}
Application Structure

  FXML
 (layout)



 FX CSS                                                 JavaFX
                           JavaFX Scene
 (styling)                                               Stage
             Rendered On                  Rendered On


  Java
Controller
Best Practices?
GUI components

External                                   Sends Actions To
            Business
Services                  Presenter                                      View
             Logic
 Client


                                 Updates                      Binds To


            Application
              State                            Model




     Core                                       UI
JavaFX approach


External           Business                       Sends Actions To
Services            Logic       Presenter                                       View
 Client



                                        Updates                      Binds To

                  Application
                    State
                                                      Model




           Core                                        UI
JavaFX approach


External           Business                                  Sends Actions To
Services            Logic                  Presenter                                       View
 Client



                                                   Updates                      Binds To

                  Application
                    State
                                                                 Model




           Core                                                   UI
                                 Async
                                Services
JavaFX approach


External           Business                                  Sends Actions To
Services            Logic                  Presenter                                       View
 Client



                                                   Updates                      Binds To

                  Application
                    State
                                                                 Model




           Core                                                   UI
                                 Async
                                Services
JavaFX approach
                                  Use
                                 Case 1


External           Business                                  Sends Actions To
Services            Logic                  Presenter                                       View
 Client



                                                   Updates                      Binds To

                  Application
                    State
                                                                 Model




           Core                                                   UI
                                 Async
                                Services
JavaFX approach
                                  Use
                                 Case 1


External           Business       Use                        Sends Actions To
Services            Logic        Case 2    Presenter                                       View
 Client



                                                   Updates                      Binds To

                  Application
                    State
                                                                 Model




           Core                                                   UI
                                 Async
                                Services
JavaFX approach
                                  Use
                                 Case 1


External           Business       Use                        Sends Actions To
Services            Logic        Case 2    Presenter                                       View
 Client

                                  Use
                                 Case 3            Updates                      Binds To

                  Application
                    State
                                                                 Model




           Core                                                   UI
                                 Async
                                Services
JavaFX approach
                                  Use
                                 Case 1


External           Business       Use                        Sends Actions To
Services            Logic        Case 2    Presenter                                       View
 Client

                                  Use
                                 Case 3            Updates                      Binds To

                  Application
                    State
                                                                 Model

                                  Use
                                 Case N

           Core                                                   UI
                                 Async
                                Services
DEMO
JavaFX App Structure

  FXML
 (layout)



 FX CSS                                                 JavaFX
                           JavaFX Scene
 (styling)                                               Stage
             Rendered On                  Rendered On


  Java
Controller
Swing Integration

  FXML
 (layout)
                                                            swing Component



 FX CSS                    JavaFX Scene                 JFXPanel
 (styling)
             Rendered On                  Rendered On


  Java
Controller
Deploy

•   applets

•   Java WebStart

•   standalone applications (natively packaged
    Windows, Mac)

•   ... using JavaFX SDK tools (ant tasks)
Why JavaFX?

•   available on the JVM (Java, JRuby, Scala, Groovy,
    Clojure)

•   portability (Mac, Linux, Windows)

•   scene-graph

•   rapid development
Resources


•   http://fxexperience.com

•   http://github.com/dvulpe/codecamp-javafx
?
Thank you!
Please fill in the feedback form!

More Related Content

What's hot

Spring 3 MVC CodeMash 2009
Spring 3 MVC   CodeMash 2009Spring 3 MVC   CodeMash 2009
Spring 3 MVC CodeMash 2009kensipe
 
E2.0 - Next Generation Portal and Content Management
E2.0 - Next Generation Portal and Content ManagementE2.0 - Next Generation Portal and Content Management
E2.0 - Next Generation Portal and Content Managementmuratc2a
 
Interfacing Banner BEIS With Identity Management - Summit 2012
Interfacing Banner BEIS With Identity Management - Summit 2012Interfacing Banner BEIS With Identity Management - Summit 2012
Interfacing Banner BEIS With Identity Management - Summit 2012joelavery
 
Implementing Applications with SOA and Application Integration Architecture
Implementing Applications with SOA and Application Integration ArchitectureImplementing Applications with SOA and Application Integration Architecture
Implementing Applications with SOA and Application Integration ArchitectureBob Rhubart
 
Connected Applications using WF and WCF
Connected Applications using WF and WCFConnected Applications using WF and WCF
Connected Applications using WF and WCFmaddinapudi
 
Oracle - Programatica2010
Oracle - Programatica2010Oracle - Programatica2010
Oracle - Programatica2010Agora Group
 
SPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA
 
Dave Carroll Application Services Salesforce
Dave Carroll Application Services SalesforceDave Carroll Application Services Salesforce
Dave Carroll Application Services Salesforcedeimos
 
Applications at Scale
Applications at ScaleApplications at Scale
Applications at ScaleServiceMesh
 
[S lide] java_sig-spring-framework
[S lide] java_sig-spring-framework[S lide] java_sig-spring-framework
[S lide] java_sig-spring-frameworkptlong96
 
DevOps for Mobile - DevOpsDays, NY, 2013
DevOps for Mobile - DevOpsDays, NY, 2013DevOps for Mobile - DevOpsDays, NY, 2013
DevOps for Mobile - DevOpsDays, NY, 2013Sanjeev Sharma
 
New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...
New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...
New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...InSync2011
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCIntroduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCFunnelll
 
Build Your Business Process On A Solid Foundation–Web Sphere Application Server
Build Your Business Process On A Solid Foundation–Web Sphere Application ServerBuild Your Business Process On A Solid Foundation–Web Sphere Application Server
Build Your Business Process On A Solid Foundation–Web Sphere Application ServerCarly Snodgrass
 
3 rad extensibility-srilakshmi_s_rajesh_k
3 rad extensibility-srilakshmi_s_rajesh_k3 rad extensibility-srilakshmi_s_rajesh_k
3 rad extensibility-srilakshmi_s_rajesh_kIBM
 
02 Ms Online Identity Session 1
02 Ms Online Identity   Session 102 Ms Online Identity   Session 1
02 Ms Online Identity Session 1Sivadon Chaisiri
 

What's hot (20)

Spring 3 MVC CodeMash 2009
Spring 3 MVC   CodeMash 2009Spring 3 MVC   CodeMash 2009
Spring 3 MVC CodeMash 2009
 
E2.0 - Next Generation Portal and Content Management
E2.0 - Next Generation Portal and Content ManagementE2.0 - Next Generation Portal and Content Management
E2.0 - Next Generation Portal and Content Management
 
Interfacing Banner BEIS With Identity Management - Summit 2012
Interfacing Banner BEIS With Identity Management - Summit 2012Interfacing Banner BEIS With Identity Management - Summit 2012
Interfacing Banner BEIS With Identity Management - Summit 2012
 
Introduction to Force.com
Introduction to Force.comIntroduction to Force.com
Introduction to Force.com
 
Implementing Applications with SOA and Application Integration Architecture
Implementing Applications with SOA and Application Integration ArchitectureImplementing Applications with SOA and Application Integration Architecture
Implementing Applications with SOA and Application Integration Architecture
 
Connected Applications using WF and WCF
Connected Applications using WF and WCFConnected Applications using WF and WCF
Connected Applications using WF and WCF
 
Oracle - Programatica2010
Oracle - Programatica2010Oracle - Programatica2010
Oracle - Programatica2010
 
SPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA Java Case Study
SPEC INDIA Java Case Study
 
Dave Carroll Application Services Salesforce
Dave Carroll Application Services SalesforceDave Carroll Application Services Salesforce
Dave Carroll Application Services Salesforce
 
Applications at Scale
Applications at ScaleApplications at Scale
Applications at Scale
 
[S lide] java_sig-spring-framework
[S lide] java_sig-spring-framework[S lide] java_sig-spring-framework
[S lide] java_sig-spring-framework
 
DevOps for Mobile - DevOpsDays, NY, 2013
DevOps for Mobile - DevOpsDays, NY, 2013DevOps for Mobile - DevOpsDays, NY, 2013
DevOps for Mobile - DevOpsDays, NY, 2013
 
New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...
New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...
New & Emerging _ Mick Andrew _ Adding mobile and web 2.0 UIs to existing appl...
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCIntroduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoC
 
July 7 Demo Deck
July 7 Demo DeckJuly 7 Demo Deck
July 7 Demo Deck
 
Build Your Business Process On A Solid Foundation–Web Sphere Application Server
Build Your Business Process On A Solid Foundation–Web Sphere Application ServerBuild Your Business Process On A Solid Foundation–Web Sphere Application Server
Build Your Business Process On A Solid Foundation–Web Sphere Application Server
 
3 rad extensibility-srilakshmi_s_rajesh_k
3 rad extensibility-srilakshmi_s_rajesh_k3 rad extensibility-srilakshmi_s_rajesh_k
3 rad extensibility-srilakshmi_s_rajesh_k
 
02 Ms Online Identity Session 1
02 Ms Online Identity   Session 102 Ms Online Identity   Session 1
02 Ms Online Identity Session 1
 
Nuno Godinho
Nuno GodinhoNuno Godinho
Nuno Godinho
 
SAP NetWeaver Cloud Platform - Virtual Bootcamp - Part 2
SAP NetWeaver Cloud Platform - Virtual Bootcamp - Part 2 SAP NetWeaver Cloud Platform - Virtual Bootcamp - Part 2
SAP NetWeaver Cloud Platform - Virtual Bootcamp - Part 2
 

Similar to Dan Vulpe - JavaFX 2 - Developing RIA with Java

Modernize your-java ee-app-server-infrastructure
Modernize your-java ee-app-server-infrastructureModernize your-java ee-app-server-infrastructure
Modernize your-java ee-app-server-infrastructurezslmarketing
 
Oracle ADF Overview
Oracle ADF OverviewOracle ADF Overview
Oracle ADF OverviewBahaa Farouk
 
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your applicationjavablend
 
Summer training in j2ee
Summer training in j2eeSummer training in j2ee
Summer training in j2eeDUCC Systems
 
Summer training java
Summer training javaSummer training java
Summer training javaArshit Rai
 
Summer training java
Summer training javaSummer training java
Summer training javaArshit Rai
 
Soa Based Integration
Soa Based IntegrationSoa Based Integration
Soa Based Integrationbslook
 
Presenter manual J2EE (specially for summer interns)
Presenter manual  J2EE (specially for summer interns)Presenter manual  J2EE (specially for summer interns)
Presenter manual J2EE (specially for summer interns)XPERT INFOTECH
 
Push to the limit - rich and pro-active user interfaces with ADF - V2 (UKOUG,...
Push to the limit - rich and pro-active user interfaces with ADF - V2 (UKOUG,...Push to the limit - rich and pro-active user interfaces with ADF - V2 (UKOUG,...
Push to the limit - rich and pro-active user interfaces with ADF - V2 (UKOUG,...Lucas Jellema
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 javatwo2011
 
MongoDB for Java Devs with Spring Data - MongoPhilly 2011
MongoDB for Java Devs with Spring Data - MongoPhilly 2011MongoDB for Java Devs with Spring Data - MongoPhilly 2011
MongoDB for Java Devs with Spring Data - MongoPhilly 2011MongoDB
 
Framework Engineering
Framework EngineeringFramework Engineering
Framework EngineeringYoungSu Son
 
N(i)2 technical architecture 2.0 (v1 1)
N(i)2 technical architecture 2.0 (v1 1)N(i)2 technical architecture 2.0 (v1 1)
N(i)2 technical architecture 2.0 (v1 1)kvz
 
Azure in Developer Perspective
Azure in Developer PerspectiveAzure in Developer Perspective
Azure in Developer Perspectiverizaon
 
Configurando Private Cloud con System Center 2012
Configurando Private Cloud con System Center 2012Configurando Private Cloud con System Center 2012
Configurando Private Cloud con System Center 2012Juanchi_43
 
WebBee rapid web app development teck stack
WebBee rapid web app development teck stackWebBee rapid web app development teck stack
WebBee rapid web app development teck stackALDAN3
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts frameworks4al_com
 

Similar to Dan Vulpe - JavaFX 2 - Developing RIA with Java (20)

Modernize your-java ee-app-server-infrastructure
Modernize your-java ee-app-server-infrastructureModernize your-java ee-app-server-infrastructure
Modernize your-java ee-app-server-infrastructure
 
Oracle ADF Overview
Oracle ADF OverviewOracle ADF Overview
Oracle ADF Overview
 
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
 
Summer training in j2ee
Summer training in j2eeSummer training in j2ee
Summer training in j2ee
 
Summer training java
Summer training javaSummer training java
Summer training java
 
Summer training java
Summer training javaSummer training java
Summer training java
 
Soa Based Integration
Soa Based IntegrationSoa Based Integration
Soa Based Integration
 
Presenter manual J2EE (specially for summer interns)
Presenter manual  J2EE (specially for summer interns)Presenter manual  J2EE (specially for summer interns)
Presenter manual J2EE (specially for summer interns)
 
Push to the limit - rich and pro-active user interfaces with ADF - V2 (UKOUG,...
Push to the limit - rich and pro-active user interfaces with ADF - V2 (UKOUG,...Push to the limit - rich and pro-active user interfaces with ADF - V2 (UKOUG,...
Push to the limit - rich and pro-active user interfaces with ADF - V2 (UKOUG,...
 
Introducing spring
Introducing springIntroducing spring
Introducing spring
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望
 
Jsf presentation
Jsf presentationJsf presentation
Jsf presentation
 
MongoDB for Java Devs with Spring Data - MongoPhilly 2011
MongoDB for Java Devs with Spring Data - MongoPhilly 2011MongoDB for Java Devs with Spring Data - MongoPhilly 2011
MongoDB for Java Devs with Spring Data - MongoPhilly 2011
 
Framework Engineering
Framework EngineeringFramework Engineering
Framework Engineering
 
N(i)2 technical architecture 2.0 (v1 1)
N(i)2 technical architecture 2.0 (v1 1)N(i)2 technical architecture 2.0 (v1 1)
N(i)2 technical architecture 2.0 (v1 1)
 
Azure in Developer Perspective
Azure in Developer PerspectiveAzure in Developer Perspective
Azure in Developer Perspective
 
Configurando Private Cloud con System Center 2012
Configurando Private Cloud con System Center 2012Configurando Private Cloud con System Center 2012
Configurando Private Cloud con System Center 2012
 
Configuring and deploying a private cloud with system center 2012
Configuring and deploying a private cloud with system center 2012Configuring and deploying a private cloud with system center 2012
Configuring and deploying a private cloud with system center 2012
 
WebBee rapid web app development teck stack
WebBee rapid web app development teck stackWebBee rapid web app development teck stack
WebBee rapid web app development teck stack
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
 

More from Codecamp Romania

Cezar chitac the edge of experience
Cezar chitac   the edge of experienceCezar chitac   the edge of experience
Cezar chitac the edge of experienceCodecamp Romania
 
Business analysis techniques exercise your 6-pack
Business analysis techniques   exercise your 6-packBusiness analysis techniques   exercise your 6-pack
Business analysis techniques exercise your 6-packCodecamp Romania
 
Bpm company code camp - configuration or coding with pega
Bpm company   code camp - configuration or coding with pegaBpm company   code camp - configuration or coding with pega
Bpm company code camp - configuration or coding with pegaCodecamp Romania
 
Andrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseAndrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseCodecamp Romania
 
2015 dan ardelean develop for windows 10
2015 dan ardelean   develop for windows 10 2015 dan ardelean   develop for windows 10
2015 dan ardelean develop for windows 10 Codecamp Romania
 
The case for continuous delivery
The case for continuous deliveryThe case for continuous delivery
The case for continuous deliveryCodecamp Romania
 
Stefan stolniceanu spritekit, 2 d or not 2d
Stefan stolniceanu   spritekit, 2 d or not 2dStefan stolniceanu   spritekit, 2 d or not 2d
Stefan stolniceanu spritekit, 2 d or not 2dCodecamp Romania
 
Sizing epics tales from an agile kingdom
Sizing epics   tales from an agile kingdomSizing epics   tales from an agile kingdom
Sizing epics tales from an agile kingdomCodecamp Romania
 
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...Codecamp Romania
 
Parallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowParallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowCodecamp Romania
 
Material design screen transitions in android
Material design screen transitions in androidMaterial design screen transitions in android
Material design screen transitions in androidCodecamp Romania
 
Kickstart your own freelancing career
Kickstart your own freelancing careerKickstart your own freelancing career
Kickstart your own freelancing careerCodecamp Romania
 
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu   the soft stuff is the hard stuff. the agile soft skills toolkitIonut grecu   the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkitCodecamp Romania
 
Diana antohi me against myself or how to fail and move forward
Diana antohi   me against myself  or how to fail  and move forwardDiana antohi   me against myself  or how to fail  and move forward
Diana antohi me against myself or how to fail and move forwardCodecamp Romania
 

More from Codecamp Romania (20)

Cezar chitac the edge of experience
Cezar chitac   the edge of experienceCezar chitac   the edge of experience
Cezar chitac the edge of experience
 
Cloud powered search
Cloud powered searchCloud powered search
Cloud powered search
 
Ccp
CcpCcp
Ccp
 
Business analysis techniques exercise your 6-pack
Business analysis techniques   exercise your 6-packBusiness analysis techniques   exercise your 6-pack
Business analysis techniques exercise your 6-pack
 
Bpm company code camp - configuration or coding with pega
Bpm company   code camp - configuration or coding with pegaBpm company   code camp - configuration or coding with pega
Bpm company code camp - configuration or coding with pega
 
Andrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseAndrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabase
 
Agility and life
Agility and lifeAgility and life
Agility and life
 
2015 dan ardelean develop for windows 10
2015 dan ardelean   develop for windows 10 2015 dan ardelean   develop for windows 10
2015 dan ardelean develop for windows 10
 
The bigrewrite
The bigrewriteThe bigrewrite
The bigrewrite
 
The case for continuous delivery
The case for continuous deliveryThe case for continuous delivery
The case for continuous delivery
 
Stefan stolniceanu spritekit, 2 d or not 2d
Stefan stolniceanu   spritekit, 2 d or not 2dStefan stolniceanu   spritekit, 2 d or not 2d
Stefan stolniceanu spritekit, 2 d or not 2d
 
Sizing epics tales from an agile kingdom
Sizing epics   tales from an agile kingdomSizing epics   tales from an agile kingdom
Sizing epics tales from an agile kingdom
 
Scale net apps in aws
Scale net apps in awsScale net apps in aws
Scale net apps in aws
 
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
 
Parallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowParallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflow
 
Material design screen transitions in android
Material design screen transitions in androidMaterial design screen transitions in android
Material design screen transitions in android
 
Kickstart your own freelancing career
Kickstart your own freelancing careerKickstart your own freelancing career
Kickstart your own freelancing career
 
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu   the soft stuff is the hard stuff. the agile soft skills toolkitIonut grecu   the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
 
Ecma6 in the wild
Ecma6 in the wildEcma6 in the wild
Ecma6 in the wild
 
Diana antohi me against myself or how to fail and move forward
Diana antohi   me against myself  or how to fail  and move forwardDiana antohi   me against myself  or how to fail  and move forward
Diana antohi me against myself or how to fail and move forward
 

Dan Vulpe - JavaFX 2 - Developing RIA with Java

  • 1. 2 Developing RIA with Java Dan Vulpe Software Engineer Centric @dvulpe dvulpe@gmail.com
  • 2. History Apr 2012 Aug 2012 JavaFX JavaFX Oct 2011 2.1 2.2 JavaFX LCD text Canvas 2.0 UI elements UI elements Dec 2008 Apr 2010 Java API Video h264 Touch events JavaFX 1.0 JavaFX 1.3 Windows Mac Linux
  • 3. Scene graph design Scene Parent Parent Parent Parent Leaf Leaf Leaf Leaf Leaf
  • 4. Scene graph design Scene Parent Parent Parent Parent Leaf Leaf Leaf Leaf Leaf
  • 5. Nodes have Properties • parent • scene • translate (X,Y, Z) • scale (X,Y, Z) • opacity • ... see JavaDoc for javafx.scene.Node
  • 6. Observable Properties service.valueProperty().addListener(new ChangeListener<WorkItemUI>() { @Override public void changed(ObservableValue<? extends WorkItemUI> value, WorkItemUI oldValue, WorkItemUI newValue) { itemsPane.getChildren().add(newValue); } });
  • 7. Binding public void bindTo(WorkItemModel workItem) { title.bindBidirectional(workItem.title); issueType.bind(workItem.issueType); workItemInfo.bindBidirectional(workItem.workItemInfo); asignee.bindBidirectional(workItem.asignee); dueDate.bindBidirectional(workItem.dueDate); priority.bindBidirectional(workItem.priority); }
  • 10. FXML <VBox alignment="CENTER" prefHeight="250.0" prefWidth="450.0" spacing="5.0" xmlns:fx="http://javafx.com/fxml"> <children> <Label text="Enter your credentials" textFill="WHITE"/> <GridPane fx:id="formContainer" hgap="10.0" vgap="10.0"> <children> <Label text="Username" GridPane.columnIndex="0" GridPane.rowIndex="0"/> <Label text="Password" GridPane.columnIndex="0" GridPane.rowIndex="1" /> <TextField GridPane.columnIndex="1" GridPane.rowIndex="0" /> <TextField GridPane.columnIndex="1" GridPane.rowIndex="1" /> <Button text="Log In" GridPane.columnIndex="1" GridPane.rowIndex="2" /> </children> </GridPane> </children> </VBox>
  • 11. Scene Builder - Oracle
  • 13. CSS Styling .root { -fx-font-size: 15px; -fx-base: #eee; -fx-font-family: "Trebuchet MS"; } .workItem { -fx-border-radius: 5; -fx-background-radius: 5; -fx-effect: dropshadow(gaussian, #ccc, 10, 0.1, 5, 2); -fx-border-color: #666; -fx-border-weight: 1px; -fx-font-size: 1em; -fx-opacity: 0.9; -fx-base: #333; }
  • 14. Bindings public class DemoController { @FXML private TextField textField; @FXML private Label label; @FXML private ListView<String> listView; @FXML private Pane rootPane; @FXML private Pane formPane; @FXML private Button aButton; public void setDataModel(DataModel dataModel) { label.textProperty().bind(dataModel.titleProperty()); textField.textProperty().bindBidirectional(dataModel.textProperty()); Bindings.bindContent(dataModel.aPlainList(), listView.getItems()); aButton.disableProperty().bind(textField.textProperty().isEqualTo("")); formPane.prefWidthProperty().bind(rootPane.widthProperty().divide(2)); } }
  • 15. Application Structure FXML (layout) FX CSS JavaFX JavaFX Scene (styling) Stage Rendered On Rendered On Java Controller
  • 17. GUI components External Sends Actions To Business Services Presenter View Logic Client Updates Binds To Application State Model Core UI
  • 18. JavaFX approach External Business Sends Actions To Services Logic Presenter View Client Updates Binds To Application State Model Core UI
  • 19. JavaFX approach External Business Sends Actions To Services Logic Presenter View Client Updates Binds To Application State Model Core UI Async Services
  • 20. JavaFX approach External Business Sends Actions To Services Logic Presenter View Client Updates Binds To Application State Model Core UI Async Services
  • 21. JavaFX approach Use Case 1 External Business Sends Actions To Services Logic Presenter View Client Updates Binds To Application State Model Core UI Async Services
  • 22. JavaFX approach Use Case 1 External Business Use Sends Actions To Services Logic Case 2 Presenter View Client Updates Binds To Application State Model Core UI Async Services
  • 23. JavaFX approach Use Case 1 External Business Use Sends Actions To Services Logic Case 2 Presenter View Client Use Case 3 Updates Binds To Application State Model Core UI Async Services
  • 24. JavaFX approach Use Case 1 External Business Use Sends Actions To Services Logic Case 2 Presenter View Client Use Case 3 Updates Binds To Application State Model Use Case N Core UI Async Services
  • 25. DEMO
  • 26. JavaFX App Structure FXML (layout) FX CSS JavaFX JavaFX Scene (styling) Stage Rendered On Rendered On Java Controller
  • 27. Swing Integration FXML (layout) swing Component FX CSS JavaFX Scene JFXPanel (styling) Rendered On Rendered On Java Controller
  • 28. Deploy • applets • Java WebStart • standalone applications (natively packaged Windows, Mac) • ... using JavaFX SDK tools (ant tasks)
  • 29. Why JavaFX? • available on the JVM (Java, JRuby, Scala, Groovy, Clojure) • portability (Mac, Linux, Windows) • scene-graph • rapid development
  • 30. Resources • http://fxexperience.com • http://github.com/dvulpe/codecamp-javafx
  • 31. ?
  • 32. Thank you! Please fill in the feedback form!