SlideShare une entreprise Scribd logo
1  sur  58
Télécharger pour lire hors ligne
JavaFX for Business Application Developers
                        Michael Heinrichs

Freitag, 8. Juni 2012
“charles bridge” by
                        hodgers (CC BY-SA 2.0)
Freitag, 8. Juni 2012
“Coo
                             k
                        kodo ing Eggs”
                            mut (      b
                                  CC B y
                                      Y 2.0
                                              )




                                          “charles bridge” by
                                          hodgers (CC BY-SA 2.0)
Freitag, 8. Juni 2012
“Coo
                             k
                        kodo ing Eggs”
                            mut (      b
                                  CC B y
                                      Y 2.0
                                              )




                                          “charles bridge” by
                                          hodgers (CC BY-SA 2.0)
Freitag, 8. Juni 2012
The following 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.




Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
JavaFX is the evolution of the Java rich client platform,
                        designed to provide a lightweight, hardware accelerated
                              UI platform that meets tomorrow’s needs.




Freitag, 8. Juni 2012
JavaFX is Swing in cool!




Freitag, 8. Juni 2012
•Examples

                        • Sample Application
                        • Process Overview

                        • Defining the View
                        • Hooking up Controllers

                        • Styling with CSS
Freitag, 8. Juni 2012
Examples



Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Sample Application



Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Java EE
                                     JavaDB
                        RESTful WS



                          Jersey
                        JavaFX UI




Freitag, 8. Juni 2012
Process Overview



Freitag, 8. Juni 2012
UX                                                                                Graphical
                                   Developer
                        Designer                                                                            Designer


                                    package com.oracle.conferenceplanner.controller;

                                    import   com.oracle.conferenceplanner.Env;
                                    import   com.oracle.conferenceplanner.Messages;
                                    import   com.oracle.conferenceplanner.entities.Session;
                                    import   com.oracle.conferenceplanner.entities.Speaker;
                                    import   com.oracle.conferenceplanner.view.GenericListCell;
                                    import   com.sun.javafx.util.MessageBus;
                                    import   java.net.URL;
                                    import   java.util.Collection;
                                    import   java.util.ResourceBundle;
                                    import   javafx.animation.Animation;
                                    import   javafx.animation.PauseTransitionBuilder;
                                    import   javafx.beans.value.ChangeListener;
                                    import   javafx.beans.value.ObservableValue;
                                    import   javafx.concurrent.Service;
                                    import   javafx.concurrent.Task;
                                    import   javafx.event.ActionEvent;
                                    import   javafx.event.EventHandler;
                                    import   javafx.fxml.FXML;
                                    import   javafx.fxml.Initializable;
                                    import   javafx.scene.control.*;
                                    import   javafx.scene.input.KeyEvent;
                                    import   javafx.util.Callback;
                                    import   javafx.util.Duration;

                                    /**
                                     *
                                     * @author Michael Heinrichs
                                     */
                                    public class MainScreen implements Initializable {

                                        @FXML   private   TextField searchField;
                                        @FXML   private   ToggleGroup toggleSearch;
                                        @FXML   private   Toggle toggleSession;
                                        @FXML   private   ProgressIndicator progressIndicator;
                                        @FXML   private   ListView searchResultList;

                                        private final Service<Collection<?>> dataFetcher = new
                                    Service<Collection<?>>() {
                                            @Override
                                            protected Task<Collection<?>> createTask() {
                                                final String currentSearchString = searchField.getText();
                                                final boolean getSessions =
                                    toggleSearch.getSelectedToggle().equals(toggleSession);
                                                return new Task<Collection<?>>() {
                                                    @Override
                                                    protected Collection<?> call() throws Exception {
                                                        return getSessions?
                                                                Session.findLike(Env.getInstance
                                    ().getWebResource(), currentSearchString)
                                                                : Speaker.findLike(Env.getInstance
                                    ().getWebResource(), currentSearchString);
                                                    }
                                                };
                                            }

                                              @Override




                                   Java Code

Freitag, 8. Juni 2012
UX                                                                                                                                            Graphical
                                                                                               Developer
                        Designer                                                                                                                                        Designer


                        <?xml version="1.0" encoding="UTF-8"?>                                  package com.oracle.conferenceplanner.controller;
                                                                                                                                                                         .root {
                        <?import   com.oracle.conferenceplanner.view.*?>                        import   com.oracle.conferenceplanner.Env;                                   -fx-background-color: black;
                        <?import   java.lang.*?>                                                import   com.oracle.conferenceplanner.Messages;                              -fx-font-family: 'Impact';
                        <?import   java.util.*?>                                                import   com.oracle.conferenceplanner.entities.Session;                  /*    -fx-font-fill: #99C0D0;*/
                        <?import   javafx.geometry.*?>                                          import   com.oracle.conferenceplanner.entities.Speaker;                      -fx-font-fill: black;
                        <?import   javafx.scene.control.*?>                                     import   com.oracle.conferenceplanner.view.GenericListCell;              }
                        <?import   javafx.scene.layout.*?>                                      import   com.sun.javafx.util.MessageBus;                                 .label {
                        <?import   javafx.scene.paint.*?>                                       import   java.net.URL;                                                       -fx-text-fill: #7C5FDD;
                        <?import   javafx.scene.shape.*?>                                       import   java.util.Collection;                                           }
                                                                                                import   java.util.ResourceBundle;                                       .text-area {
                        <SplitPane dividerPositions="0.3" focusTraversable="true"               import   javafx.animation.Animation;                                         -fx-text-fill: #7C5FDD;
                        xmlns:fx="http://javafx.com/fxml"                                       import   javafx.animation.PauseTransitionBuilder;                        }
                        fx:controller="com.oracle.conferenceplanner.controller.MainScreen">     import   javafx.beans.value.ChangeListener;                              .text-field {
                          <items>                                                               import   javafx.beans.value.ObservableValue;                                 -fx-background-color: transparent;
                            <AnchorPane>                                                        import   javafx.concurrent.Service;                                          -fx-border-color: #7C5FDD;
                              <children>                                                        import   javafx.concurrent.Task;                                             -fx-text-fill: #D99C10;
                                <VBox spacing="10.0" AnchorPane.bottomAnchor="0.0"              import   javafx.event.ActionEvent;                                           -fx-prompt-text-fill: #7C5FDD;
                        AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"                import   javafx.event.EventHandler;                                          -fx-cursor: text;
                        AnchorPane.topAnchor="0.0">                                             import   javafx.fxml.FXML;                                               }
                                  <children>                                                    import   javafx.fxml.Initializable;
                                    <TextField fx:id="searchField" minHeight="-Infinity"        import   javafx.scene.control.*;                                         .toggle-button {
                        onKeyTyped="#handleSearchBoxTyped" promptText="Search" />               import   javafx.scene.input.KeyEvent;                                        -fx-background-color: #7C5FDD;
                                    <HBox spacing="10.0">                                       import   javafx.util.Callback;                                               -fx-background-radius: 0;
                                      <children>                                                import   javafx.util.Duration;                                               -fx-text-fill: black;
                                         <ToggleButton fx:id="toggleSession" selected="true"                                                                                 -fx-alignment: CENTER;
                        text="Session">                                                         /**                                                                          -fx-content-display: LEFT;
                                           <toggleGroup>                                         *                                                                       }
                                             <ToggleGroup fx:id="toggleSearch" />                * @author Michael Heinrichs
                                           </toggleGroup>                                        */                                                                      .toggle-button:selected {
                                         </ToggleButton>                                        public class MainScreen implements Initializable {                           -fx-background-color: #D99C10;
                                         <ToggleButton fx:id="toggleSpeaker" text="Speaker"                                                                              }
                        toggleGroup="$toggleSearch" />                                              @FXML   private   TextField searchField;
                                      </children>                                                   @FXML   private   ToggleGroup toggleSearch;                          .list-view {
                                    </HBox>                                                         @FXML   private   Toggle toggleSession;                                  -fx-background-color: transparent;
                                    <StackPane VBox.vgrow="ALWAYS">                                 @FXML   private   ProgressIndicator progressIndicator;               }
                                      <children>                                                    @FXML   private   ListView searchResultList;
                                         <ListView fx:id="searchResultList" />                                                                                           .list-view:vertical .list-cell {
                                         <ProgressIndicator fx:id="progressIndicator"               private final Service<Collection<?>> dataFetcher = new                   -fx-background-insets: 0, 5 0, 10 15, 0 25;
                        maxHeight="-Infinity" maxWidth="-Infinity" visible="false" />           Service<Collection<?>>() {                                                   -fx-padding: 15 20;
                                      </children>                                                       @Override                                                        }
                                    </StackPane>                                                        protected Task<Collection<?>> createTask() {
                                  </children>                                                               final String currentSearchString = searchField.getText();    .list-view:horizontal .list-cell {
                                </VBox>                                                                     final boolean getSessions =                                      -fx-background-insets: 0, 0 5, 5 20, 0 30;
                              </children>                                                       toggleSearch.getSelectedToggle().equals(toggleSession);                      -fx-padding: 10 25;
                              <padding>                                                                     return new Task<Collection<?>>() {                           }
                                <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />                    @Override
                              </padding>                                                                        protected Collection<?> call() throws Exception {        .list-cell {
                            </AnchorPane>                                                                           return getSessions?                                      -fx-background-color: black, #7C5FDD, black, black;
                            <AnchorPane>                                                                                    Session.findLike(Env.getInstance                 -fx-background-radius: 0, 10, 5, 0;
                              <children>                                                        ().getWebResource(), currentSearchString)                                }
                                <StackPane fx:id="detailsPane" AnchorPane.bottomAnchor="0.0"                                : Speaker.findLike(Env.getInstance
                        AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"                ().getWebResource(), currentSearchString);                               .list-cell .label {
                        AnchorPane.topAnchor="0.0">                                                             }                                                            -fx-text-fill: #7C5FDD;
                                  <children>                                                                };                                                           }
                                    <fx:include source="session_details.fxml"/>                         }
                                    <fx:include source="speaker_details.fxml"/>                                                                                          .list-cell .title {
                                  </children>                                                             @Override                                                          -fx-text-fill: #D99C10;




                             FXML                                                              Java Code                                                                               CSS

Freitag, 8. Juni 2012
Developer
                                                                                     package com.oracle.conferenceplanner.controller;

                                                                                     import  com.oracle.conferenceplanner.Env;
                                                                                     import  com.oracle.conferenceplanner.Messages;
                                                                                     import  com.oracle.conferenceplanner.entities.Session;
                                                                                     import  com.oracle.conferenceplanner.entities.Speaker;
                                                                                     import  com.oracle.conferenceplanner.view.GenericListCell;
                                                                                     import  com.sun.javafx.util.MessageBus;
                                                                                     import  java.net.URL;
                                                                                     import  java.util.Collection;
                                                                                     import  java.util.ResourceBundle;
                                                                                     import  javafx.animation.Animation;
                                                                                     import  javafx.animation.PauseTransitionBuilder;
                                                                                     import  javafx.beans.value.ChangeListener;
                                                                                     import  javafx.beans.value.ObservableValue;
                                                                                     import  javafx.concurrent.Service;
                                                                                     import  javafx.concurrent.Task;
                                                                                     import  javafx.event.ActionEvent;
                                                                                     import  javafx.event.EventHandler;
                                                                                     import  javafx.fxml.FXML;
                                                                                     import  javafx.fxml.Initializable;
                                                                                     import  javafx.scene.control.*;           .root {
                                                                                     import  javafx.scene.input.KeyEvent;          -fx-background-color: black;
                                                                                     import  javafx.util.Callback;                 -fx-font-family: 'Impact';
                                                                                     import  javafx.util.Duration;             /*    -fx-font-fill: #99C0D0;*/
                                                                                                                                   -fx-font-fill: black;
                                                                                      /**                                      }
                                   <?xml version="1.0" encoding="UTF-8"?>              *                                       .label {
                                                                                       * @author Michael Heinrichs                 -fx-text-fill: #7C5FDD;
                                   <?import com.oracle.conferenceplanner.view.*?>      */                                      }
                                   <?import java.lang.*?>                             public class MainScreen implements Initializable { {
                                                                                                                               .text-area
                                   <?import java.util.*?>                                                                          -fx-text-fill: #7C5FDD;
                                   <?import javafx.geometry.*?>                           @FXML private TextField searchField; }
                                   <?import javafx.scene.control.*?>                                                           .text-field {
                                                                                          @FXML private ToggleGroup toggleSearch;
                                   <?import javafx.scene.layout.*?>                       @FXML private Toggle toggleSession;      -fx-background-color: transparent;
                                   <?import javafx.scene.paint.*?>                                                                 -fx-border-color: #7C5FDD;
                                                                                          @FXML private ProgressIndicator progressIndicator;
                                   <?import javafx.scene.shape.*?>                        @FXML private ListView searchResultList; -fx-text-fill: #D99C10;
                                                                                                                                   -fx-prompt-text-fill: #7C5FDD;
                                   <SplitPane dividerPositions="0.3" focusTraversable="true"                                       -fx-cursor: text;
                                                                                          private final Service<Collection<?>> dataFetcher = new
                                   xmlns:fx="http://javafx.com/fxml"                  Service<Collection<?>>() {               }
                                   fx:controller="com.oracle.conferenceplanner.controller.MainScreen">
                                                                                              @Override
                                     <items>                                                                                   .toggle-button {
                                                                                              protected Task<Collection<?>> createTask() {
                                       <AnchorPane>                                                                                -fx-background-color: #7C5FDD;
                                                                                                  final String currentSearchString = searchField.getText();
                                         <children>                                               final boolean getSessions =      -fx-background-radius: 0;
                                           <VBox spacing="10.0" AnchorPane.bottomAnchor="0.0"                                      -fx-text-fill: black;
                                                                                      toggleSearch.getSelectedToggle().equals(toggleSession);
                                   AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"                                        -fx-alignment: CENTER;
                                                                                                  return new Task<Collection<?>>() {
                                   AnchorPane.topAnchor="0.0">                                        @Override                    -fx-content-display: LEFT;
                                             <children>                                               protected Collection<?> }call() throws Exception {
                                               <TextField fx:id="searchField" minHeight="-Infinity"        return getSessions?
                                   onKeyTyped="#handleSearchBoxTyped" promptText="Search" />                                   .toggle-button:selected {
                                                                                                                   Session.findLike(Env.getInstance
                                               <HBox spacing="10.0">                  ().getWebResource(), currentSearchString)    -fx-background-color: #D99C10;
                                                 <children>                                                                    }
                                                                                                                   : Speaker.findLike(Env.getInstance
                                                    <ToggleButton fx:id="toggleSession" selected="true"
                                                                                      ().getWebResource(), currentSearchString);
                                   text="Session">                                                    }                        .list-view {
                                                      <toggleGroup>                               };                               -fx-background-color: transparent;
                                                        <ToggleGroup fx:id="toggleSearch" /> }                                 }
                                                      </toggleGroup>
                                                    </ToggleButton>                           @Override                        .list-view:vertical .list-cell {
                                                    <ToggleButton fx:id="toggleSpeaker" text="Speaker"                             -fx-background-insets: 0, 5 0, 10 15, 0 25;
                                   toggleGroup="$toggleSearch" />                                                                  -fx-padding: 15 20;
                                                 </children>                                                                   }
                                               </HBox>
                                               <StackPane VBox.vgrow="ALWAYS">                                                 .list-view:horizontal .list-cell {
                                                 <children>                                                                        -fx-background-insets: 0, 0 5, 5 20, 0 30;
                                                    <ListView fx:id="searchResultList" />                                          -fx-padding: 10 25;
                                                    <ProgressIndicator fx:id="progressIndicator"                               }
                                   maxHeight="-Infinity" maxWidth="-Infinity" visible="false" />
                                                 </children>                                                                   .list-cell {
                                               </StackPane>                                                                        -fx-background-color: black, #7C5FDD, black, black;
                                             </children>                                                                           -fx-background-radius: 0, 10, 5, 0;
                                           </VBox>                                                                             }
                                         </children>
                                         <padding>                                                                             .list-cell .label {
                                           <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />                            -fx-text-fill: #7C5FDD;
                                         </padding>                                                                            }
                                       </AnchorPane>
                                       <AnchorPane>                                                                            .list-cell .title {
                                         <children>                                                                                -fx-text-fill: #D99C10;
                                           <StackPane fx:id="detailsPane" AnchorPane.bottomAnchor="0.0"
                                   AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
                                   AnchorPane.topAnchor="0.0">
                                             <children>
                                               <fx:include source="session_details.fxml"/>
                                               <fx:include source="speaker_details.fxml"/>
                                             </children>




                          UX                                                                                                                                                             Graphical
                                                                                        JavaFX
                        Designer                                                                                                                                                         Designer


Freitag, 8. Juni 2012
Defining the view



Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Stage




Freitag, 8. Juni 2012
Stage
                        Scene




Freitag, 8. Juni 2012
Stage
                          Scene




                        Scenegraph



Freitag, 8. Juni 2012
JFrame
                        Name
                        Adress
                        Mail




                          OK     Cancel

Freitag, 8. Juni 2012
JFrame
                        Name                   JFXPanel : JComponent
                        Adress
                        Mail




                          OK     Cancel

Freitag, 8. Juni 2012
JFrame
                        Name                   JFXPanel : JComponent
                        Adress                         Scene

                        Mail




                          OK     Cancel

Freitag, 8. Juni 2012
JFrame
                        Name                   JFXPanel : JComponent
                        Adress                         Scene

                        Mail




                                                    Scenegraph
                          OK     Cancel

Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Hooking up Controllers



Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Styling with CSS



Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Summary



Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
Freitag, 8. Juni 2012
UX                                                                                Graphical
                                   Developer
                        Designer                                                                            Designer


                                    package com.oracle.conferenceplanner.controller;

                                    import   com.oracle.conferenceplanner.Env;
                                    import   com.oracle.conferenceplanner.Messages;
                                    import   com.oracle.conferenceplanner.entities.Session;
                                    import   com.oracle.conferenceplanner.entities.Speaker;
                                    import   com.oracle.conferenceplanner.view.GenericListCell;
                                    import   com.sun.javafx.util.MessageBus;
                                    import   java.net.URL;
                                    import   java.util.Collection;
                                    import   java.util.ResourceBundle;
                                    import   javafx.animation.Animation;
                                    import   javafx.animation.PauseTransitionBuilder;
                                    import   javafx.beans.value.ChangeListener;
                                    import   javafx.beans.value.ObservableValue;
                                    import   javafx.concurrent.Service;
                                    import   javafx.concurrent.Task;
                                    import   javafx.event.ActionEvent;
                                    import   javafx.event.EventHandler;
                                    import   javafx.fxml.FXML;
                                    import   javafx.fxml.Initializable;
                                    import   javafx.scene.control.*;
                                    import   javafx.scene.input.KeyEvent;
                                    import   javafx.util.Callback;
                                    import   javafx.util.Duration;

                                    /**
                                     *
                                     * @author Michael Heinrichs
                                     */
                                    public class MainScreen implements Initializable {

                                        @FXML   private   TextField searchField;
                                        @FXML   private   ToggleGroup toggleSearch;
                                        @FXML   private   Toggle toggleSession;
                                        @FXML   private   ProgressIndicator progressIndicator;
                                        @FXML   private   ListView searchResultList;

                                        private final Service<Collection<?>> dataFetcher = new
                                    Service<Collection<?>>() {
                                            @Override
                                            protected Task<Collection<?>> createTask() {
                                                final String currentSearchString = searchField.getText();
                                                final boolean getSessions =
                                    toggleSearch.getSelectedToggle().equals(toggleSession);
                                                return new Task<Collection<?>>() {
                                                    @Override
                                                    protected Collection<?> call() throws Exception {
                                                        return getSessions?
                                                                Session.findLike(Env.getInstance
                                    ().getWebResource(), currentSearchString)
                                                                : Speaker.findLike(Env.getInstance
                                    ().getWebResource(), currentSearchString);
                                                    }
                                                };
                                            }

                                              @Override




Freitag, 8. Juni 2012
Developer
                                                                                     package com.oracle.conferenceplanner.controller;

                                                                                     import  com.oracle.conferenceplanner.Env;
                                                                                     import  com.oracle.conferenceplanner.Messages;
                                                                                     import  com.oracle.conferenceplanner.entities.Session;
                                                                                     import  com.oracle.conferenceplanner.entities.Speaker;
                                                                                     import  com.oracle.conferenceplanner.view.GenericListCell;
                                                                                     import  com.sun.javafx.util.MessageBus;
                                                                                     import  java.net.URL;
                                                                                     import  java.util.Collection;
                                                                                     import  java.util.ResourceBundle;
                                                                                     import  javafx.animation.Animation;
                                                                                     import  javafx.animation.PauseTransitionBuilder;
                                                                                     import  javafx.beans.value.ChangeListener;
                                                                                     import  javafx.beans.value.ObservableValue;
                                                                                     import  javafx.concurrent.Service;
                                                                                     import  javafx.concurrent.Task;
                                                                                     import  javafx.event.ActionEvent;
                                                                                     import  javafx.event.EventHandler;
                                                                                     import  javafx.fxml.FXML;
                                                                                     import  javafx.fxml.Initializable;
                                                                                     import  javafx.scene.control.*;           .root {
                                                                                     import  javafx.scene.input.KeyEvent;          -fx-background-color: black;
                                                                                     import  javafx.util.Callback;                 -fx-font-family: 'Impact';
                                                                                     import  javafx.util.Duration;             /*    -fx-font-fill: #99C0D0;*/
                                                                                                                                   -fx-font-fill: black;
                                                                                      /**                                      }
                                   <?xml version="1.0" encoding="UTF-8"?>              *                                       .label {
                                                                                       * @author Michael Heinrichs                 -fx-text-fill: #7C5FDD;
                                   <?import com.oracle.conferenceplanner.view.*?>      */                                      }
                                   <?import java.lang.*?>                             public class MainScreen implements Initializable { {
                                                                                                                               .text-area
                                   <?import java.util.*?>                                                                          -fx-text-fill: #7C5FDD;
                                   <?import javafx.geometry.*?>                           @FXML private TextField searchField; }
                                   <?import javafx.scene.control.*?>                                                           .text-field {
                                                                                          @FXML private ToggleGroup toggleSearch;
                                   <?import javafx.scene.layout.*?>                       @FXML private Toggle toggleSession;      -fx-background-color: transparent;
                                   <?import javafx.scene.paint.*?>                                                                 -fx-border-color: #7C5FDD;
                                                                                          @FXML private ProgressIndicator progressIndicator;
                                   <?import javafx.scene.shape.*?>                        @FXML private ListView searchResultList; -fx-text-fill: #D99C10;
                                                                                                                                   -fx-prompt-text-fill: #7C5FDD;
                                   <SplitPane dividerPositions="0.3" focusTraversable="true"                                       -fx-cursor: text;
                                                                                          private final Service<Collection<?>> dataFetcher = new
                                   xmlns:fx="http://javafx.com/fxml"                  Service<Collection<?>>() {               }
                                   fx:controller="com.oracle.conferenceplanner.controller.MainScreen">
                                                                                              @Override
                                     <items>                                                                                   .toggle-button {
                                                                                              protected Task<Collection<?>> createTask() {
                                       <AnchorPane>                                                                                -fx-background-color: #7C5FDD;
                                                                                                  final String currentSearchString = searchField.getText();
                                         <children>                                               final boolean getSessions =      -fx-background-radius: 0;
                                           <VBox spacing="10.0" AnchorPane.bottomAnchor="0.0"                                      -fx-text-fill: black;
                                                                                      toggleSearch.getSelectedToggle().equals(toggleSession);
                                   AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"                                        -fx-alignment: CENTER;
                                                                                                  return new Task<Collection<?>>() {
                                   AnchorPane.topAnchor="0.0">                                        @Override                    -fx-content-display: LEFT;
                                             <children>                                               protected Collection<?> }call() throws Exception {
                                               <TextField fx:id="searchField" minHeight="-Infinity"        return getSessions?
                                   onKeyTyped="#handleSearchBoxTyped" promptText="Search" />                                   .toggle-button:selected {
                                                                                                                   Session.findLike(Env.getInstance
                                               <HBox spacing="10.0">                  ().getWebResource(), currentSearchString)    -fx-background-color: #D99C10;
                                                 <children>                                                                    }
                                                                                                                   : Speaker.findLike(Env.getInstance
                                                    <ToggleButton fx:id="toggleSession" selected="true"
                                                                                      ().getWebResource(), currentSearchString);
                                   text="Session">                                                    }                        .list-view {
                                                      <toggleGroup>                               };                               -fx-background-color: transparent;
                                                        <ToggleGroup fx:id="toggleSearch" /> }                                 }
                                                      </toggleGroup>
                                                    </ToggleButton>                           @Override                        .list-view:vertical .list-cell {
                                                    <ToggleButton fx:id="toggleSpeaker" text="Speaker"                             -fx-background-insets: 0, 5 0, 10 15, 0 25;
                                   toggleGroup="$toggleSearch" />                                                                  -fx-padding: 15 20;
                                                 </children>                                                                   }
                                               </HBox>
                                               <StackPane VBox.vgrow="ALWAYS">                                                 .list-view:horizontal .list-cell {
                                                 <children>                                                                        -fx-background-insets: 0, 0 5, 5 20, 0 30;
                                                    <ListView fx:id="searchResultList" />                                          -fx-padding: 10 25;
                                                    <ProgressIndicator fx:id="progressIndicator"                               }
                                   maxHeight="-Infinity" maxWidth="-Infinity" visible="false" />
                                                 </children>                                                                   .list-cell {
                                               </StackPane>                                                                        -fx-background-color: black, #7C5FDD, black, black;
                                             </children>                                                                           -fx-background-radius: 0, 10, 5, 0;
                                           </VBox>                                                                             }
                                         </children>
                                         <padding>                                                                             .list-cell .label {
                                           <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />                            -fx-text-fill: #7C5FDD;
                                         </padding>                                                                            }
                                       </AnchorPane>
                                       <AnchorPane>                                                                            .list-cell .title {
                                         <children>                                                                                -fx-text-fill: #D99C10;
                                           <StackPane fx:id="detailsPane" AnchorPane.bottomAnchor="0.0"
                                   AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
                                   AnchorPane.topAnchor="0.0">
                                             <children>
                                               <fx:include source="session_details.fxml"/>
                                               <fx:include source="speaker_details.fxml"/>
                                             </children>




                          UX                                                                                                                                                             Graphical
                                                                                        JavaFX
                        Designer                                                                                                                                                         Designer


Freitag, 8. Juni 2012
• http://blog.netopyr.com, @net0pyr
                        • JavaFX Website
                         http://javafx.com

                        • OTN Forum
                         http://forums.oracle.com

                        • Bugs and Feature Requests
                         http://javafx-jira.kenai.com

                        • API Discussions
                         openjfx-dev@openjdk.java.net

Freitag, 8. Juni 2012

Contenu connexe

Dernier

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Dernier (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

En vedette

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

JavaFX for Business Application Developers

  • 1. JavaFX for Business Application Developers Michael Heinrichs Freitag, 8. Juni 2012
  • 2. “charles bridge” by hodgers (CC BY-SA 2.0) Freitag, 8. Juni 2012
  • 3. “Coo k kodo ing Eggs” mut ( b CC B y Y 2.0 ) “charles bridge” by hodgers (CC BY-SA 2.0) Freitag, 8. Juni 2012
  • 4. “Coo k kodo ing Eggs” mut ( b CC B y Y 2.0 ) “charles bridge” by hodgers (CC BY-SA 2.0) Freitag, 8. Juni 2012
  • 5. The following 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. Freitag, 8. Juni 2012
  • 7. JavaFX is the evolution of the Java rich client platform, designed to provide a lightweight, hardware accelerated UI platform that meets tomorrow’s needs. Freitag, 8. Juni 2012
  • 8. JavaFX is Swing in cool! Freitag, 8. Juni 2012
  • 9. •Examples • Sample Application • Process Overview • Defining the View • Hooking up Controllers • Styling with CSS Freitag, 8. Juni 2012
  • 19. Java EE JavaDB RESTful WS Jersey JavaFX UI Freitag, 8. Juni 2012
  • 21. UX Graphical Developer Designer Designer package com.oracle.conferenceplanner.controller; import com.oracle.conferenceplanner.Env; import com.oracle.conferenceplanner.Messages; import com.oracle.conferenceplanner.entities.Session; import com.oracle.conferenceplanner.entities.Speaker; import com.oracle.conferenceplanner.view.GenericListCell; import com.sun.javafx.util.MessageBus; import java.net.URL; import java.util.Collection; import java.util.ResourceBundle; import javafx.animation.Animation; import javafx.animation.PauseTransitionBuilder; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.concurrent.Service; import javafx.concurrent.Task; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.*; import javafx.scene.input.KeyEvent; import javafx.util.Callback; import javafx.util.Duration; /** * * @author Michael Heinrichs */ public class MainScreen implements Initializable { @FXML private TextField searchField; @FXML private ToggleGroup toggleSearch; @FXML private Toggle toggleSession; @FXML private ProgressIndicator progressIndicator; @FXML private ListView searchResultList; private final Service<Collection<?>> dataFetcher = new Service<Collection<?>>() { @Override protected Task<Collection<?>> createTask() { final String currentSearchString = searchField.getText(); final boolean getSessions = toggleSearch.getSelectedToggle().equals(toggleSession); return new Task<Collection<?>>() { @Override protected Collection<?> call() throws Exception { return getSessions? Session.findLike(Env.getInstance ().getWebResource(), currentSearchString) : Speaker.findLike(Env.getInstance ().getWebResource(), currentSearchString); } }; } @Override Java Code Freitag, 8. Juni 2012
  • 22. UX Graphical Developer Designer Designer <?xml version="1.0" encoding="UTF-8"?> package com.oracle.conferenceplanner.controller; .root { <?import com.oracle.conferenceplanner.view.*?> import com.oracle.conferenceplanner.Env; -fx-background-color: black; <?import java.lang.*?> import com.oracle.conferenceplanner.Messages; -fx-font-family: 'Impact'; <?import java.util.*?> import com.oracle.conferenceplanner.entities.Session; /* -fx-font-fill: #99C0D0;*/ <?import javafx.geometry.*?> import com.oracle.conferenceplanner.entities.Speaker; -fx-font-fill: black; <?import javafx.scene.control.*?> import com.oracle.conferenceplanner.view.GenericListCell; } <?import javafx.scene.layout.*?> import com.sun.javafx.util.MessageBus; .label { <?import javafx.scene.paint.*?> import java.net.URL; -fx-text-fill: #7C5FDD; <?import javafx.scene.shape.*?> import java.util.Collection; } import java.util.ResourceBundle; .text-area { <SplitPane dividerPositions="0.3" focusTraversable="true" import javafx.animation.Animation; -fx-text-fill: #7C5FDD; xmlns:fx="http://javafx.com/fxml" import javafx.animation.PauseTransitionBuilder; } fx:controller="com.oracle.conferenceplanner.controller.MainScreen"> import javafx.beans.value.ChangeListener; .text-field { <items> import javafx.beans.value.ObservableValue; -fx-background-color: transparent; <AnchorPane> import javafx.concurrent.Service; -fx-border-color: #7C5FDD; <children> import javafx.concurrent.Task; -fx-text-fill: #D99C10; <VBox spacing="10.0" AnchorPane.bottomAnchor="0.0" import javafx.event.ActionEvent; -fx-prompt-text-fill: #7C5FDD; AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" import javafx.event.EventHandler; -fx-cursor: text; AnchorPane.topAnchor="0.0"> import javafx.fxml.FXML; } <children> import javafx.fxml.Initializable; <TextField fx:id="searchField" minHeight="-Infinity" import javafx.scene.control.*; .toggle-button { onKeyTyped="#handleSearchBoxTyped" promptText="Search" /> import javafx.scene.input.KeyEvent; -fx-background-color: #7C5FDD; <HBox spacing="10.0"> import javafx.util.Callback; -fx-background-radius: 0; <children> import javafx.util.Duration; -fx-text-fill: black; <ToggleButton fx:id="toggleSession" selected="true" -fx-alignment: CENTER; text="Session"> /** -fx-content-display: LEFT; <toggleGroup> * } <ToggleGroup fx:id="toggleSearch" /> * @author Michael Heinrichs </toggleGroup> */ .toggle-button:selected { </ToggleButton> public class MainScreen implements Initializable { -fx-background-color: #D99C10; <ToggleButton fx:id="toggleSpeaker" text="Speaker" } toggleGroup="$toggleSearch" /> @FXML private TextField searchField; </children> @FXML private ToggleGroup toggleSearch; .list-view { </HBox> @FXML private Toggle toggleSession; -fx-background-color: transparent; <StackPane VBox.vgrow="ALWAYS"> @FXML private ProgressIndicator progressIndicator; } <children> @FXML private ListView searchResultList; <ListView fx:id="searchResultList" /> .list-view:vertical .list-cell { <ProgressIndicator fx:id="progressIndicator" private final Service<Collection<?>> dataFetcher = new -fx-background-insets: 0, 5 0, 10 15, 0 25; maxHeight="-Infinity" maxWidth="-Infinity" visible="false" /> Service<Collection<?>>() { -fx-padding: 15 20; </children> @Override } </StackPane> protected Task<Collection<?>> createTask() { </children> final String currentSearchString = searchField.getText(); .list-view:horizontal .list-cell { </VBox> final boolean getSessions = -fx-background-insets: 0, 0 5, 5 20, 0 30; </children> toggleSearch.getSelectedToggle().equals(toggleSession); -fx-padding: 10 25; <padding> return new Task<Collection<?>>() { } <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> @Override </padding> protected Collection<?> call() throws Exception { .list-cell { </AnchorPane> return getSessions? -fx-background-color: black, #7C5FDD, black, black; <AnchorPane> Session.findLike(Env.getInstance -fx-background-radius: 0, 10, 5, 0; <children> ().getWebResource(), currentSearchString) } <StackPane fx:id="detailsPane" AnchorPane.bottomAnchor="0.0" : Speaker.findLike(Env.getInstance AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" ().getWebResource(), currentSearchString); .list-cell .label { AnchorPane.topAnchor="0.0"> } -fx-text-fill: #7C5FDD; <children> }; } <fx:include source="session_details.fxml"/> } <fx:include source="speaker_details.fxml"/> .list-cell .title { </children> @Override -fx-text-fill: #D99C10; FXML Java Code CSS Freitag, 8. Juni 2012
  • 23. Developer package com.oracle.conferenceplanner.controller; import com.oracle.conferenceplanner.Env; import com.oracle.conferenceplanner.Messages; import com.oracle.conferenceplanner.entities.Session; import com.oracle.conferenceplanner.entities.Speaker; import com.oracle.conferenceplanner.view.GenericListCell; import com.sun.javafx.util.MessageBus; import java.net.URL; import java.util.Collection; import java.util.ResourceBundle; import javafx.animation.Animation; import javafx.animation.PauseTransitionBuilder; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.concurrent.Service; import javafx.concurrent.Task; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.*; .root { import javafx.scene.input.KeyEvent; -fx-background-color: black; import javafx.util.Callback; -fx-font-family: 'Impact'; import javafx.util.Duration; /* -fx-font-fill: #99C0D0;*/ -fx-font-fill: black; /** } <?xml version="1.0" encoding="UTF-8"?> * .label { * @author Michael Heinrichs -fx-text-fill: #7C5FDD; <?import com.oracle.conferenceplanner.view.*?> */ } <?import java.lang.*?> public class MainScreen implements Initializable { { .text-area <?import java.util.*?> -fx-text-fill: #7C5FDD; <?import javafx.geometry.*?> @FXML private TextField searchField; } <?import javafx.scene.control.*?> .text-field { @FXML private ToggleGroup toggleSearch; <?import javafx.scene.layout.*?> @FXML private Toggle toggleSession; -fx-background-color: transparent; <?import javafx.scene.paint.*?> -fx-border-color: #7C5FDD; @FXML private ProgressIndicator progressIndicator; <?import javafx.scene.shape.*?> @FXML private ListView searchResultList; -fx-text-fill: #D99C10; -fx-prompt-text-fill: #7C5FDD; <SplitPane dividerPositions="0.3" focusTraversable="true" -fx-cursor: text; private final Service<Collection<?>> dataFetcher = new xmlns:fx="http://javafx.com/fxml" Service<Collection<?>>() { } fx:controller="com.oracle.conferenceplanner.controller.MainScreen"> @Override <items> .toggle-button { protected Task<Collection<?>> createTask() { <AnchorPane> -fx-background-color: #7C5FDD; final String currentSearchString = searchField.getText(); <children> final boolean getSessions = -fx-background-radius: 0; <VBox spacing="10.0" AnchorPane.bottomAnchor="0.0" -fx-text-fill: black; toggleSearch.getSelectedToggle().equals(toggleSession); AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" -fx-alignment: CENTER; return new Task<Collection<?>>() { AnchorPane.topAnchor="0.0"> @Override -fx-content-display: LEFT; <children> protected Collection<?> }call() throws Exception { <TextField fx:id="searchField" minHeight="-Infinity" return getSessions? onKeyTyped="#handleSearchBoxTyped" promptText="Search" /> .toggle-button:selected { Session.findLike(Env.getInstance <HBox spacing="10.0"> ().getWebResource(), currentSearchString) -fx-background-color: #D99C10; <children> } : Speaker.findLike(Env.getInstance <ToggleButton fx:id="toggleSession" selected="true" ().getWebResource(), currentSearchString); text="Session"> } .list-view { <toggleGroup> }; -fx-background-color: transparent; <ToggleGroup fx:id="toggleSearch" /> } } </toggleGroup> </ToggleButton> @Override .list-view:vertical .list-cell { <ToggleButton fx:id="toggleSpeaker" text="Speaker" -fx-background-insets: 0, 5 0, 10 15, 0 25; toggleGroup="$toggleSearch" /> -fx-padding: 15 20; </children> } </HBox> <StackPane VBox.vgrow="ALWAYS"> .list-view:horizontal .list-cell { <children> -fx-background-insets: 0, 0 5, 5 20, 0 30; <ListView fx:id="searchResultList" /> -fx-padding: 10 25; <ProgressIndicator fx:id="progressIndicator" } maxHeight="-Infinity" maxWidth="-Infinity" visible="false" /> </children> .list-cell { </StackPane> -fx-background-color: black, #7C5FDD, black, black; </children> -fx-background-radius: 0, 10, 5, 0; </VBox> } </children> <padding> .list-cell .label { <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> -fx-text-fill: #7C5FDD; </padding> } </AnchorPane> <AnchorPane> .list-cell .title { <children> -fx-text-fill: #D99C10; <StackPane fx:id="detailsPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <children> <fx:include source="session_details.fxml"/> <fx:include source="speaker_details.fxml"/> </children> UX Graphical JavaFX Designer Designer Freitag, 8. Juni 2012
  • 27. Stage Scene Freitag, 8. Juni 2012
  • 28. Stage Scene Scenegraph Freitag, 8. Juni 2012
  • 29. JFrame Name Adress Mail OK Cancel Freitag, 8. Juni 2012
  • 30. JFrame Name JFXPanel : JComponent Adress Mail OK Cancel Freitag, 8. Juni 2012
  • 31. JFrame Name JFXPanel : JComponent Adress Scene Mail OK Cancel Freitag, 8. Juni 2012
  • 32. JFrame Name JFXPanel : JComponent Adress Scene Mail Scenegraph OK Cancel Freitag, 8. Juni 2012
  • 56. UX Graphical Developer Designer Designer package com.oracle.conferenceplanner.controller; import com.oracle.conferenceplanner.Env; import com.oracle.conferenceplanner.Messages; import com.oracle.conferenceplanner.entities.Session; import com.oracle.conferenceplanner.entities.Speaker; import com.oracle.conferenceplanner.view.GenericListCell; import com.sun.javafx.util.MessageBus; import java.net.URL; import java.util.Collection; import java.util.ResourceBundle; import javafx.animation.Animation; import javafx.animation.PauseTransitionBuilder; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.concurrent.Service; import javafx.concurrent.Task; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.*; import javafx.scene.input.KeyEvent; import javafx.util.Callback; import javafx.util.Duration; /** * * @author Michael Heinrichs */ public class MainScreen implements Initializable { @FXML private TextField searchField; @FXML private ToggleGroup toggleSearch; @FXML private Toggle toggleSession; @FXML private ProgressIndicator progressIndicator; @FXML private ListView searchResultList; private final Service<Collection<?>> dataFetcher = new Service<Collection<?>>() { @Override protected Task<Collection<?>> createTask() { final String currentSearchString = searchField.getText(); final boolean getSessions = toggleSearch.getSelectedToggle().equals(toggleSession); return new Task<Collection<?>>() { @Override protected Collection<?> call() throws Exception { return getSessions? Session.findLike(Env.getInstance ().getWebResource(), currentSearchString) : Speaker.findLike(Env.getInstance ().getWebResource(), currentSearchString); } }; } @Override Freitag, 8. Juni 2012
  • 57. Developer package com.oracle.conferenceplanner.controller; import com.oracle.conferenceplanner.Env; import com.oracle.conferenceplanner.Messages; import com.oracle.conferenceplanner.entities.Session; import com.oracle.conferenceplanner.entities.Speaker; import com.oracle.conferenceplanner.view.GenericListCell; import com.sun.javafx.util.MessageBus; import java.net.URL; import java.util.Collection; import java.util.ResourceBundle; import javafx.animation.Animation; import javafx.animation.PauseTransitionBuilder; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.concurrent.Service; import javafx.concurrent.Task; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.*; .root { import javafx.scene.input.KeyEvent; -fx-background-color: black; import javafx.util.Callback; -fx-font-family: 'Impact'; import javafx.util.Duration; /* -fx-font-fill: #99C0D0;*/ -fx-font-fill: black; /** } <?xml version="1.0" encoding="UTF-8"?> * .label { * @author Michael Heinrichs -fx-text-fill: #7C5FDD; <?import com.oracle.conferenceplanner.view.*?> */ } <?import java.lang.*?> public class MainScreen implements Initializable { { .text-area <?import java.util.*?> -fx-text-fill: #7C5FDD; <?import javafx.geometry.*?> @FXML private TextField searchField; } <?import javafx.scene.control.*?> .text-field { @FXML private ToggleGroup toggleSearch; <?import javafx.scene.layout.*?> @FXML private Toggle toggleSession; -fx-background-color: transparent; <?import javafx.scene.paint.*?> -fx-border-color: #7C5FDD; @FXML private ProgressIndicator progressIndicator; <?import javafx.scene.shape.*?> @FXML private ListView searchResultList; -fx-text-fill: #D99C10; -fx-prompt-text-fill: #7C5FDD; <SplitPane dividerPositions="0.3" focusTraversable="true" -fx-cursor: text; private final Service<Collection<?>> dataFetcher = new xmlns:fx="http://javafx.com/fxml" Service<Collection<?>>() { } fx:controller="com.oracle.conferenceplanner.controller.MainScreen"> @Override <items> .toggle-button { protected Task<Collection<?>> createTask() { <AnchorPane> -fx-background-color: #7C5FDD; final String currentSearchString = searchField.getText(); <children> final boolean getSessions = -fx-background-radius: 0; <VBox spacing="10.0" AnchorPane.bottomAnchor="0.0" -fx-text-fill: black; toggleSearch.getSelectedToggle().equals(toggleSession); AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" -fx-alignment: CENTER; return new Task<Collection<?>>() { AnchorPane.topAnchor="0.0"> @Override -fx-content-display: LEFT; <children> protected Collection<?> }call() throws Exception { <TextField fx:id="searchField" minHeight="-Infinity" return getSessions? onKeyTyped="#handleSearchBoxTyped" promptText="Search" /> .toggle-button:selected { Session.findLike(Env.getInstance <HBox spacing="10.0"> ().getWebResource(), currentSearchString) -fx-background-color: #D99C10; <children> } : Speaker.findLike(Env.getInstance <ToggleButton fx:id="toggleSession" selected="true" ().getWebResource(), currentSearchString); text="Session"> } .list-view { <toggleGroup> }; -fx-background-color: transparent; <ToggleGroup fx:id="toggleSearch" /> } } </toggleGroup> </ToggleButton> @Override .list-view:vertical .list-cell { <ToggleButton fx:id="toggleSpeaker" text="Speaker" -fx-background-insets: 0, 5 0, 10 15, 0 25; toggleGroup="$toggleSearch" /> -fx-padding: 15 20; </children> } </HBox> <StackPane VBox.vgrow="ALWAYS"> .list-view:horizontal .list-cell { <children> -fx-background-insets: 0, 0 5, 5 20, 0 30; <ListView fx:id="searchResultList" /> -fx-padding: 10 25; <ProgressIndicator fx:id="progressIndicator" } maxHeight="-Infinity" maxWidth="-Infinity" visible="false" /> </children> .list-cell { </StackPane> -fx-background-color: black, #7C5FDD, black, black; </children> -fx-background-radius: 0, 10, 5, 0; </VBox> } </children> <padding> .list-cell .label { <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> -fx-text-fill: #7C5FDD; </padding> } </AnchorPane> <AnchorPane> .list-cell .title { <children> -fx-text-fill: #D99C10; <StackPane fx:id="detailsPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <children> <fx:include source="session_details.fxml"/> <fx:include source="speaker_details.fxml"/> </children> UX Graphical JavaFX Designer Designer Freitag, 8. Juni 2012
  • 58. • http://blog.netopyr.com, @net0pyr • JavaFX Website http://javafx.com • OTN Forum http://forums.oracle.com • Bugs and Feature Requests http://javafx-jira.kenai.com • API Discussions openjfx-dev@openjdk.java.net Freitag, 8. Juni 2012

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n