JavaFX for Business Application Developers                          Michael HeinrichsMontag, 8. Oktober 2012
“Coo                               k                          kodo ing Eggs”                              mut (      b    ...
The following is intended to outline our general product                            direction. It is intended for informat...
• Sample Application                          • Process Overview                          • Defining the View              ...
Sample ApplicationMontag, 8. Oktober 2012
JACPMontag, 8. Oktober 2012
Just A                          J Another C                                    Conference P                               ...
Montag, 8. Oktober 2012
Java EE                                       JavaDB                          RESTful WS                            Jersey...
Process OverviewMontag, 8. Oktober 2012
UX                          DesignerMontag, 8. Oktober 2012
UX                                     Developer                          DesignerMontag, 8. Oktober 2012
UX                                     Developer                          Designer                                      pa...
UX                                                                                Graphical                               ...
Graphical                          Developer                                                                              ...
Developer                           package com.oracle.conferenceplanner.controller;                           import   co...
UX                                                                                Graphical                               ...
UX                                                                                                                        ...
UX                                                                                                                        ...
Developer                                                                                       package com.oracle.confere...
Defining the viewMontag, 8. Oktober 2012
Montag, 8. Oktober 2012
Stage                            Scene                          ScenegraphMontag, 8. Oktober 2012
JFrame                          Name                   JFXPanel : JComponent                          Adress              ...
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
Hooking up ControllersMontag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
LayoutsMontag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
Top                          Left    Center   Right                                 BottomMontag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
•child.setLayoutX(10);                          •vBox.setAlignment(Pos.CENTER);                          •VBox.setMargin(c...
Data BindingMontag, 8. Oktober 2012
Java EE                                       JavaDB                          RESTful WS                            Jersey...
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
Styling with CSSMontag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
Montag, 8. Oktober 2012
SummaryMontag, 8. Oktober 2012
Montag, 8. Oktober 2012
UX                                                                                Graphical                               ...
Developer                                                                                       package com.oracle.confere...
• http://blog.netopyr.com                           @net0pyr                          • JavaFX Website                    ...
Montag, 8. Oktober 2012
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.   Insert Information Protection Policy Classification...
Upcoming SlideShare
Loading in …5
×

JavaFX for Business Application Developers

4,155 views

Published on

Slides from my session at JavaOne 2012.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,155
On SlideShare
0
From Embeds
0
Number of Embeds
1,687
Actions
Shares
0
Downloads
78
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

JavaFX for Business Application Developers

  1. 1. JavaFX for Business Application Developers Michael HeinrichsMontag, 8. Oktober 2012
  2. 2. “Coo k kodo ing Eggs” mut ( b CC B y Y 2.0 ) “charles bridge” by hodgers (CC BY-SA 2.0)Montag, 8. Oktober 2012
  3. 3. 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.Montag, 8. Oktober 2012
  4. 4. • Sample Application • Process Overview • Defining the View • Data Binding • Styling with CSSMontag, 8. Oktober 2012
  5. 5. Sample ApplicationMontag, 8. Oktober 2012
  6. 6. JACPMontag, 8. Oktober 2012
  7. 7. Just A J Another C Conference P PlannerMontag, 8. Oktober 2012
  8. 8. Montag, 8. Oktober 2012
  9. 9. Java EE JavaDB RESTful WS Jersey JavaFX UIMontag, 8. Oktober 2012
  10. 10. Process OverviewMontag, 8. Oktober 2012
  11. 11. UX DesignerMontag, 8. Oktober 2012
  12. 12. UX Developer DesignerMontag, 8. Oktober 2012
  13. 13. UX Developer 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); } }; } @OverrideMontag, 8. Oktober 2012
  14. 14. 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); } }; } @OverrideMontag, 8. Oktober 2012
  15. 15. Graphical Developer 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); } }; } @OverrideMontag, 8. Oktober 2012
  16. 16. 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.*; 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); } }; } @OverrideMontag, 8. Oktober 2012
  17. 17. 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); } }; } @OverrideMontag, 8. Oktober 2012
  18. 18. UX Graphical Developer Designer Designer <?xml version="1.0" encoding="UTF-8"?> package com.oracle.conferenceplanner.controller; <?import com.oracle.conferenceplanner.view.*?> import com.oracle.conferenceplanner.Env; <?import java.lang.*?> import com.oracle.conferenceplanner.Messages; <?import java.util.*?> import com.oracle.conferenceplanner.entities.Session; <?import javafx.geometry.*?> import com.oracle.conferenceplanner.entities.Speaker; <?import javafx.scene.control.*?> import com.oracle.conferenceplanner.view.GenericListCell; <?import javafx.scene.layout.*?> import com.sun.javafx.util.MessageBus; <?import javafx.scene.paint.*?> import java.net.URL; <?import javafx.scene.shape.*?> import java.util.Collection; import java.util.ResourceBundle; <SplitPane dividerPositions="0.3" focusTraversable="true" import javafx.animation.Animation; xmlns:fx="http://javafx.com/fxml" import javafx.animation.PauseTransitionBuilder; fx:controller="com.oracle.conferenceplanner.controller.MainScreen"> import javafx.beans.value.ChangeListener; <items> import javafx.beans.value.ObservableValue; <AnchorPane> import javafx.concurrent.Service; <children> import javafx.concurrent.Task; <VBox spacing="10.0" AnchorPane.bottomAnchor="0.0" import javafx.event.ActionEvent; AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" import javafx.event.EventHandler; AnchorPane.topAnchor="0.0"> import javafx.fxml.FXML; <children> import javafx.fxml.Initializable; <TextField fx:id="searchField" minHeight="-Infinity" import javafx.scene.control.*; onKeyTyped="#handleSearchBoxTyped" promptText="Search" /> import javafx.scene.input.KeyEvent; <HBox spacing="10.0"> import javafx.util.Callback; <children> import javafx.util.Duration; <ToggleButton fx:id="toggleSession" selected="true" text="Session"> /** <toggleGroup> * <ToggleGroup fx:id="toggleSearch" /> * @author Michael Heinrichs </toggleGroup> */ </ToggleButton> public class MainScreen implements Initializable { <ToggleButton fx:id="toggleSpeaker" text="Speaker" toggleGroup="$toggleSearch" /> @FXML private TextField searchField; </children> @FXML private ToggleGroup toggleSearch; </HBox> @FXML private Toggle toggleSession; <StackPane VBox.vgrow="ALWAYS"> @FXML private ProgressIndicator progressIndicator; <children> @FXML private ListView searchResultList; <ListView fx:id="searchResultList" /> <ProgressIndicator fx:id="progressIndicator" private final Service<Collection<?>> dataFetcher = new maxHeight="-Infinity" maxWidth="-Infinity" visible="false" /> Service<Collection<?>>() { </children> @Override </StackPane> protected Task<Collection<?>> createTask() { </children> final String currentSearchString = searchField.getText(); </VBox> final boolean getSessions = </children> toggleSearch.getSelectedToggle().equals(toggleSession); <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 { </AnchorPane> return getSessions? <AnchorPane> Session.findLike(Env.getInstance <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); AnchorPane.topAnchor="0.0"> } <children> }; <fx:include source="session_details.fxml"/> } <fx:include source="speaker_details.fxml"/> </children> @OverrideMontag, 8. Oktober 2012
  19. 19. 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;Montag, 8. Oktober 2012
  20. 20. 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 DesignerMontag, 8. Oktober 2012
  21. 21. Defining the viewMontag, 8. Oktober 2012
  22. 22. Montag, 8. Oktober 2012
  23. 23. Stage Scene ScenegraphMontag, 8. Oktober 2012
  24. 24. JFrame Name JFXPanel : JComponent Adress Scene Mail Scenegraph OK CancelMontag, 8. Oktober 2012
  25. 25. Montag, 8. Oktober 2012
  26. 26. Montag, 8. Oktober 2012
  27. 27. Hooking up ControllersMontag, 8. Oktober 2012
  28. 28. Montag, 8. Oktober 2012
  29. 29. Montag, 8. Oktober 2012
  30. 30. Montag, 8. Oktober 2012
  31. 31. Montag, 8. Oktober 2012
  32. 32. Montag, 8. Oktober 2012
  33. 33. LayoutsMontag, 8. Oktober 2012
  34. 34. Montag, 8. Oktober 2012
  35. 35. Montag, 8. Oktober 2012
  36. 36. Top Left Center Right BottomMontag, 8. Oktober 2012
  37. 37. Montag, 8. Oktober 2012
  38. 38. Montag, 8. Oktober 2012
  39. 39. Montag, 8. Oktober 2012
  40. 40. Montag, 8. Oktober 2012
  41. 41. Montag, 8. Oktober 2012
  42. 42. •child.setLayoutX(10); •vBox.setAlignment(Pos.CENTER); •VBox.setMargin(child, new Insets(10));Montag, 8. Oktober 2012
  43. 43. Data BindingMontag, 8. Oktober 2012
  44. 44. Java EE JavaDB RESTful WS Jersey JavaFX UIMontag, 8. Oktober 2012
  45. 45. Montag, 8. Oktober 2012
  46. 46. Montag, 8. Oktober 2012
  47. 47. Styling with CSSMontag, 8. Oktober 2012
  48. 48. Montag, 8. Oktober 2012
  49. 49. Montag, 8. Oktober 2012
  50. 50. Montag, 8. Oktober 2012
  51. 51. Montag, 8. Oktober 2012
  52. 52. Montag, 8. Oktober 2012
  53. 53. Montag, 8. Oktober 2012
  54. 54. SummaryMontag, 8. Oktober 2012
  55. 55. Montag, 8. Oktober 2012
  56. 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); } }; } @OverrideMontag, 8. Oktober 2012
  57. 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 DesignerMontag, 8. Oktober 2012
  58. 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.netMontag, 8. Oktober 2012
  59. 59. Montag, 8. Oktober 2012
  60. 60. Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8Montag, 8. Oktober 2012

×