E-Book, Englisch, 621 Seiten
Chin / Vos / Weaver The Definitive Guide to Modern Java Clients with JavaFX
1. ed
ISBN: 978-1-4842-4926-0
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
Cross-Platform Mobile and Cloud Development
E-Book, Englisch, 621 Seiten
ISBN: 978-1-4842-4926-0
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
- Create modern client applications in Java using the latest JavaFX and Java 13
- Buildenterprise clients that will enable integration with existing cloud services
- Use advanced visualization and 3D features
- Deploy on desktop, mobile, and embedded devices
Autoren/Hrsg.
Weitere Infos & Material
1;Table of Contents;4
2;About the Authors;14
3;About the Contributors;15
4;About the Technical Reviewer;19
5;Foreword;20
6;Chapter 1: Getting Started with Client Java;22
6.1;Java Client Technology in Action;22
6.1.1;Java Client in Business;23
6.2;Gaming and 3D;24
6.3;Mobile Conference Apps;26
6.4;A Modern Approach to Client Java;27
6.4.1;Target Mobile First;27
6.4.2;Build for the Cloud;29
6.4.3;Package Your Platform;31
6.5;Setting Up Your Environment;32
6.5.1;Mac OS X JDK Installation;33
6.5.2;Windows JDK Installation;34
6.5.3;Linux JDK Installation;38
6.5.4;JavaFX Installation;38
6.6;Your First Modern Java Client;40
6.6.1;Coding Client Apps with IntelliJ IDEA;40
6.6.2;Rapid Application Development with Scene Builder;46
6.7;The Path to Modern Client Development;53
7;Chapter 2: JavaFX Fundamentals;54
7.1;JavaFX Stage and Scene Graph;54
7.1.1;JavaFX Is Single-Threaded;55
7.1.2;Hierarchical Node Structure;55
7.2;A Simple Shape Example;57
7.3;Color;59
7.4;Text Is a Shape;60
7.5;The JavaFX Coordinate System;60
7.6;Layout Controls;61
7.6.1;StackPane;61
7.6.2;AnchorPane;62
7.6.3;GridPane;62
7.6.4;FlowPane and TilePane;63
7.6.5;BorderPane;63
7.6.6;SplitPane;64
7.6.7;HBox, VBox, and ButtonBar;64
7.7;Make a Scene;64
7.8;Enhancing the MyShapes Application;65
7.8.1;Linear Gradient;65
7.8.2;DropShadow;66
7.8.3;Reflection;67
7.9;Configuring Actions;68
7.10;Animation;69
7.11;JavaFX Properties;71
7.11.1;Property Listeners;72
7.11.1.1;Invalidation Listeners;72
7.11.1.2;Change Listeners;74
7.11.2;Binding;75
7.11.2.1;Unidirectional Binding;75
7.11.2.2;Bidirectional Binding;76
7.11.2.3;Fluent API and Bindings API;76
7.12;Using FXML;78
7.12.1;Controller Class;81
7.12.1.1;JavaFX Application Class;83
7.12.1.2;Adding CSS;84
7.12.1.3;Using Scene Builder;86
7.13;Putting It All Together;87
7.13.1;Master-Detail UI;87
7.13.1.1;The Model;90
7.13.2;Observable Lists;92
7.13.2.1;Implementing ListView Selection;93
7.13.2.2;Using Multiple Selection;93
7.13.2.3;ListView and Sort;94
7.13.3;Person UI Application Actions;95
7.13.3.1;Delete a Person;95
7.13.3.2;Add a Person;96
7.13.3.3;Update a Person;97
7.14;Key Point Summary;100
8;Chapter 3: Properties and Bindings;102
8.1;Key Concepts;103
8.1.1;Observable and InvalidationListener;104
8.1.2;ObservableValue and ChangeListener;104
8.1.3;WritableValue and ReadOnlyProperty;105
8.1.4;JavaFX Properties;105
8.2;Creating Bindings;110
8.2.1;JavaFX Bindings;110
8.2.2;Create Bindings by Direct Extension;111
8.3;Type-Specific Specializations;113
8.4;Factory Methods in Bindings;116
8.5;Create Bindings with the Fluent API;119
8.6;Observable Collections;125
8.6.1;Factory and Utility Methods in FXCollections;125
8.6.2;Change Listeners for Observable Collections;130
8.6.2.1;Change Events in ListChangeListener;133
8.6.2.2;Change Events in MapChangeListener;138
8.6.2.3;Change Events in SetChangeListener;141
8.6.2.4;Change Events in ArrayChangeListener;143
8.6.3;Create Bindings for Observable Collections;145
8.7;JavaFX Beans;146
8.7.1;Eagerly Instantiated Property;147
8.7.2;Half-Lazily Instantiated Property;149
8.7.3;Fully Lazily Instantiated Property;150
8.7.4;Selection Bindings;151
8.7.5;Adapting Java Beans;154
8.8;Summary;161
8.9;Resources;162
9;Chapter 4: JavaFX Controls Deep Dive;163
9.1;The UI Controls Module;164
9.2;What Is a UI Control?;164
9.3;JavaFX Basic Controls;165
9.3.1;Labeled Controls;165
9.3.1.1;Label;166
9.3.1.2;Button;167
9.3.1.3;CheckBox;168
9.3.1.4;Hyperlink;169
9.3.1.5;ToggleButton;169
9.3.1.6;RadioButton;171
9.3.2;Text Input Controls;171
9.3.2.1;TextFormatter;172
9.3.2.2;TextField, PasswordField, and TextArea;173
9.3.3;Other Simple Controls;174
9.3.3.1;ProgressBar and ProgressIndicator;174
9.3.3.2;Slider;175
9.4;Container Controls;176
9.4.1;Accordion and TitledPane;176
9.4.2;ButtonBar;177
9.4.3;ScrollPane;178
9.4.4;SplitPane;180
9.4.5;TabPane;181
9.4.6;ToolBar;183
9.5;Other Controls;184
9.5.1;HTMLEditor;184
9.5.2;Pagination;185
9.5.3;ScrollBar;186
9.5.4;Separator;186
9.5.5;Spinner;187
9.5.6;Tooltip;188
9.6;Popup Controls;189
9.6.1;Menu-Based Controls;189
9.6.1.1;Menu and MenuItem;189
9.6.1.2;MenuBar;191
9.6.1.3;MenuButton and SplitMenuButton;192
9.6.1.4;ContextMenu;194
9.6.1.5;ChoiceBox;196
9.6.2;ComboBox-Based Controls;197
9.6.2.1;ComboBox;198
9.6.2.2;ColorPicker;199
9.6.2.3;DatePicker;200
9.7;JavaFX Dialogs;201
9.7.1;Alert;201
9.7.2;ChoiceDialog;202
9.7.3;TextInputDialog;203
9.7.4;Dialog and DialogPane;204
9.8;Advanced Controls;205
9.8.1;ListView;205
9.8.1.1;Cells and Cell Factories;206
9.8.1.1.1;Cell Editing;208
9.8.1.1.2;Pre-built Cell Factories;210
9.8.2;TreeView;211
9.8.3;TableView;212
9.8.3.1;TableColumn and TreeTableColumn;214
9.8.3.1.1;Nested Columns;217
9.8.3.2;Cell Factories in TableView;218
9.8.4;TreeTableView;218
9.9;Selection and Focus Models;220
9.9.1;SelectionModel;220
9.9.2;FocusModel;221
9.10;Summary;222
9.10.1;Acknowledgments;222
10;Chapter 5: Mastering Visual and CSS Design;223
10.1;Introduction to Cascading Style Sheets;223
10.1.1;Selectors Based on Class Name;226
10.1.2;Selectors Based on Custom Style Classes;226
10.1.3;Selectors Based on Object ID;226
10.2;Applying CSS Styles;227
10.2.1;Loading CSS Stylesheets;227
10.2.2;Applying CSS Styles to JavaFX Nodes;228
10.3;Advanced CSS Techniques;231
10.3.1;Using Descendant Selectors;231
10.3.2;Using Pseudo-classes;232
10.3.3;Using Imports;233
10.3.4;Font Loading in the Stylesheet;233
10.3.5;Reusing Styles;233
10.3.6;Using Advanced Color Definitions;234
10.3.7;Using Linear Gradients;234
10.3.8;Using Radial Gradients;235
10.3.9;Using Image Pattern;236
10.3.10;Using RGB Color Definitions;237
10.3.11;Using HSB Color Definitions;238
10.3.12;Using Color Functions;239
10.3.13;Using Effect Definitions;240
10.3.13.1;Drop Shadow;240
10.3.13.2;Inner Shadow;240
10.3.14;Useful Tips and Tricks;241
10.3.14.1;Study Modena Stylesheet;241
10.3.14.2;Define Themes Based on Modena;241
10.3.14.3;Define Icons Using CSS;243
10.3.14.4;CSS Reusability by Using Color Constants;243
10.3.14.5;Using Transparent Colors;243
10.4;Advanced CSS API;245
10.5;CSS in JavaFX Applications: Summary;253
11;Chapter 6: High-Performance Graphics;255
11.1;Using Canvas;256
11.2;Giving Life to a Canvas Application;262
11.3;Particle Systems;267
11.4;Fractals;278
11.5;High Performance;291
11.6;Conclusion;304
12;Chapter 7: Bridging Swing and JavaFX;305
12.1;Integrating JavaFX into Swing;305
12.1.1;JFXPanel: Swing Component with JavaFX Inside;306
12.1.2;Threading;311
12.1.3;Interaction Between Swing and JavaFX;313
12.1.4;Drag and Drop with JavaFX and Swing;321
12.1.5;JavaFX 3D Integrated in Swing;324
12.1.6;Integrating Swing into JavaFX;326
12.1.6.1;Migration Strategies;328
12.1.7;Large-Scale Integrations;328
12.2;Conclusion;329
13;Chapter 8: JavaFX 3D;330
13.1;Prerequisites;330
13.2;Getting Started with Shapes;331
13.2.1;Shape3D;337
13.2.2;Sphere;338
13.2.3;Box;338
13.2.4;Cylinder;339
13.2.5;Creating User-Defined 3D Shapes;339
13.3;Camera;353
13.3.1;ParallelCamera;354
13.3.2;PerspectiveCamera;354
13.4;Light;358
13.4.1;Understanding the LightBase Class;359
13.4.2;Understanding the AmbientLight Class;359
13.4.3;Understanding the PointLight Class;359
13.5;Material;365
13.5.1;Understanding the PhongMaterial Class;366
13.5.2;Adding Texture to 3D Shapes;370
13.6;Interacting with JavaFX 3D Scenes;375
13.6.1;Understanding the PickResult Class;376
13.7;Third-Party Software: FXyz 3D;381
13.7.1;FXyz 3D Sample;382
13.7.2;Conclusion;384
14;Chapter 9: JavaFX, the Web, and Cloud Infrastructure;385
14.1;Integrating with the Web;387
14.1.1;Displaying a Web Page;387
14.1.2;Adding Navigation and History;388
14.1.3;Showing Loading Progress;391
14.1.4;Executing JavaScript;392
14.1.5;Registering Java Callbacks;398
14.1.6;FXML and the Model View ViewModel Pattern;400
14.1.7;Writing a Controller for HTML;402
14.1.8;Adding the HTML View;406
14.1.9;HTML Data Binding Explained;408
14.1.10;Displaying a Map with DukeScript;412
14.1.11;From Web Sites to APIs;414
14.2;Building for the Cloud;414
14.2.1;Architecture of a JavaFX Cloud Application;415
14.2.2;Use Case: Querying OpenWeather;415
14.3;Conclusion;427
15;Chapter 10: Packaging Apps for the Desktop;428
15.1;Web vs. Desktop Applications;428
15.2;Evolutions in Application Deployment;430
15.3;The jpackage Tool;432
15.3.1;What Is jpackage?;432
15.3.2;Using jpackage;434
15.3.2.1;Jpackage Usage;435
15.3.2.2;Jpackage Options;435
15.3.2.3;Requirements;440
15.3.2.3.1;Inno Setup;440
15.3.2.4;Samples;441
15.3.2.4.1;Non-modular Application: Sample1;441
15.3.2.4.2;Instructions for Windows;441
15.3.2.4.3;Modifying the Installer;444
15.3.2.4.4;Mac OS X;445
15.3.2.4.5;Modifying the Installer;447
15.3.2.4.6;Linux;448
15.3.2.4.7;Modular Application: Sample2;449
15.3.2.4.8;Windows;450
15.3.2.4.9;Mac OS X;451
15.3.2.4.10;Linux;452
15.3.2.5;Gradle Projects;453
15.4;Using Graal’s Native;455
15.4.1;Requirements;456
15.4.2;The Code;457
15.4.3;Maven Project;458
15.4.4;Gradle Project;460
15.4.5;Build the Project;461
15.4.6;Compile;462
15.4.6.1;Link;463
15.4.6.2;Run;464
15.5;Conclusion;465
16;Chapter 11: Native Mobile Apps for iOS and Android;467
16.1;Why JavaFX on Mobile;468
16.1.1;Different Approaches for Mobile Apps;469
16.1.2;OS-Specific Native Controls;470
16.1.3;Mobile Web Sites;470
16.1.4;Device Native Rendering;470
16.2;Hello, JavaFX on iOS;472
16.2.1;Client Plugins to Reduce Complexity;472
16.2.2;The Development Flow;473
16.2.3;The Code;475
16.2.3.1;Requirements;480
16.2.3.2;Build the Project;481
16.2.3.2.1;Compile;483
16.2.3.2.2;Link;484
16.2.3.2.3;Run;484
16.3;How Does It Work?;486
16.4;Using the Plugin Options;487
16.4.1;bundlesList;488
16.4.2;resourcesList;488
16.4.3;reflectionList;489
16.4.4;jniList;489
16.4.5;delayInitList;489
16.4.6;releaseSymbolsList;489
16.5;Creating Real Mobile-Looking Apps;489
16.5.1;Different Stylesheets;490
16.5.2;Mobile-Specific Controls;494
16.5.2.1;The Code;495
16.5.2.2;Build the Project;502
16.6;Summary;505
17;Chapter 12: JavaFX 11 on Raspberry Pi;506
17.1;Intro to Raspberry Pi;506
17.2;Getting Started with a Raspberry Pi;507
17.2.1;Initial Kit;507
17.2.1.1;Raspberry Pi;507
17.2.1.2;Power Adaptor;508
17.2.1.3;SD Card;508
17.2.1.4;Monitor;508
17.2.1.5;Install SD;508
17.2.1.6;Raspberry Pi Configuration;510
17.2.1.6.1;Raspi-config;511
17.2.1.7;Remote Connection via SSH;514
17.2.2;Installing Java 11;515
17.2.2.1;Java 11 for ARM;516
17.2.2.1.1;Testing Java 11;517
17.2.3;Installing JavaFX 11;518
17.2.3.1;Running JavaFX Applications Locally;519
17.2.4;Running JavaFX Applications Remotely;524
17.2.4.1;Java Remote Platform;525
17.2.4.2;Gradle SSH Plugin;528
17.2.5;Working with Dependencies;531
17.2.5.1;The DIY In-Car Navigation System;531
17.2.5.2;Bill of Materials;531
17.2.5.2.1;Setup for GPIO;532
17.2.5.2.2;GPIO Connections;533
17.2.5.2.3;Required GPS Software;534
17.2.5.2.4;NMEA Readings;536
17.2.5.2.5;GPIO and Java;543
17.2.5.3;The UI;547
17.2.5.3.1;Gluon Maps;547
17.2.5.3.2;Afterburner;549
17.2.5.3.3;Scene Builder;549
17.2.5.3.4;The Application Class;559
17.2.6;Deploy and Test;563
17.2.6.1;Next Challenge;565
17.3;Conclusions;565
18;Chapter 13: Machine Learning and JavaFX;566
18.1;What Is Machine Learning;566
18.2;Supervised Learning;567
18.3;Unsupervised Learning;567
18.4;Artificial Neural Networks;567
18.5;Convolutional Neural Networks;569
18.6;Eclipse DeepLearning4J: Java API for Neural Networks;571
18.7;Training Neural Networks from a JavaFX Application;574
18.8;Read an Image from JavaFX to a Neural Network;580
18.9;Detecting Objects in a Video;584
19;Chapter 14: Scientific Applications Using JavaFX;594
19.1;JavaFX for Space Exploration;594
19.2;JavaFX for Quantum Computing;596
19.3;Using JShell;599
19.3.1;Using JShell;601
19.3.2;About ND4J;605
19.3.3;Using ND4J in JShell;609
19.3.4;USING JavaFX in JShell;613
19.3.4.1;Starting Stand-Alone JavaFX Code;614
19.3.4.2;JavaFX Applications in JShell;617
19.3.4.3;JavaFX Libraries in JShell;620
19.4;Conclusion;624
20;Index;625




