E-Book, Englisch, 336 Seiten
PremKumar / Mohan Beginning JavaFX
1. ed
ISBN: 978-1-4302-7198-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
E-Book, Englisch, 336 Seiten
ISBN: 978-1-4302-7198-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
The open source JavaFX platform offers a Java-based approach to rich Internet application (RIA) development-an alternative to Adobe Flash/Flex and Microsoft Silverlight. At over 100 million downloads, JavaFX is poised to be a significant player. Written by a JavaFX engineer and developer, this book is one of the first on the JavaFX platform to give you the following: The fundamentals of JavaFX scripting on desktop and mobile platforms Examples of RIAs using JavaFX Graphics Media and animation using JavaFX See how JavaFX gives you dynamic Java effects in your RIA development.
A. Lawrence Prem Kumar has more than 5 years of experience in Java and J2EE. Since 2005, he's worked for Sun Microsystems. Presently, he is working on Java FX, focusing particularly on Java FX graphics.
Autoren/Hrsg.
Weitere Infos & Material
1;Title Page;1
2;Copyright Page;2
3;Contents at a Glance;4
4;Table of Contents;5
5;About the Authors;14
6;About the Technical Reviewer;15
7;Acknowledgements;16
8;Introduction;17
9;Chapter 1: Introduction to RIA;18
9.1;The History of RIA;18
9.2;Key Characteristics of RIA;19
9.3;RIA Workflow;19
9.4;Why RIA;20
9.5;Some RIA Examples;22
9.6;Summary;24
10;Chapter 2: Introduction to JavaFX;25
10.1;Why JavaFX;25
10.2;Advantages of JavaFX;25
10.3;History of JavaFX;26
10.4;The JavaFX Platform;27
10.4.1;The Developer Bundle;27
10.4.2;The Designer Bundle;28
10.4.3;Standalone;28
10.5;JavaFX Platform Integration: The Bigger Picture;29
10.6;JavaFX Mobile: An Introduction;30
10.6.1;Advantages of JavaFX Mobile;30
10.7;Deployment and Distribution;31
10.8;Getting Started;32
10.8.1;What to Download;32
10.9;Writing Your First JavaFX Application;32
10.9.1;Running Your Application Using NetBeans;37
10.9.1.1;Standalone Mode;37
10.9.1.2;Browser/Java Web Start Mode;38
10.9.1.3;Mobile Emulator;41
10.9.2;Running the Application from the Command Line;43
10.9.2.1;Compiling the Application for Standalone Execution;43
10.9.2.2;Compiling the Application for Browser/Java Web Start Execution with JavaFX Packager;44
10.9.2.3;Building and Running the Application Using JavaFX Packager for the DESKTOP Profile;44
10.9.2.4;Building and Running the Application Using JavaFXPackager for the MOBILE Profile;45
10.10;Comments;46
10.11;Summary;47
11;Chapter 3: Data Types;48
11.1;Variable Declaration;48
11.2;var vs. def Declarations;49
11.2.1;Variable Naming;49
11.2.1.1;Reserved Keywords in JavaFX Script;50
11.2.2;Variable Declaration Syntax;50
11.2.3;Data Types;51
11.2.3.1;String;51
11.2.4;Integer;54
11.2.4.1;Decimal Number;54
11.2.4.2;Hexadecimal Number;54
11.2.4.3;Octal Number;55
11.2.5;Number;55
11.2.6;Boolean;56
11.2.7;Duration;57
11.3;Typecasting;58
11.4;Sequences;59
11.5;Default Values for Data Types;60
11.6;Summary;61
12;Chapter 4: Operators and Expressions;62
12.1;The Assignment Operator;63
12.2;The as Operator;64
12.3;Arithmetic Operators;65
12.3.1;The Modulus or Remainder Operator;66
12.3.2;The Arithmetic Assignment Operator;66
12.3.3;Operator Precedence;67
12.3.4;Unary Operators;67
12.3.5;The Increment and Decrement Operators: ++ and --;68
12.3.6;The Unary + and – Operators;69
12.3.7;The not Operator;70
12.3.8;Relational Operators;70
12.3.9;Logical Operators;71
12.3.10;Range Expressions;74
12.3.11;Block Expressions;76
12.4;Looping Expressions;77
12.4.1;While Loops;81
12.5;Break Expressions;81
12.5.1;Continue Expressions;82
12.5.2;The if-else Expression;83
12.5.3;Exception Handling;85
12.5.4;The new Expression;86
12.5.5;Differentiating Expressions;87
12.6;Summary;88
13;Chapter 5: Functions;89
13.1;How a Function Works;91
13.1.1;A Function with Neither an Argument nor a Return Value;91
13.1.2;A Function with Arguments but Without a Return Value;92
13.1.3;A Function Without an Argument but with a Return Value;93
13.1.4;A Function with Arguments and a Return Value;94
13.2;Variable Access within a Function;95
13.2.1;Script-Level Variables;95
13.2.2;Local Variables;96
13.3;Function Overloading;96
13.4;Recursive Functions;97
13.5;Anonymous Functions;98
13.6;The run() Function;100
13.6.1;Command-Line Arguments;101
13.7;Summary;103
14;Chapter 6: Class Definitions;104
14.1;Classes and Objects;104
14.1.1;Classes;104
14.1.2;Objects;105
14.2;Features of OOP;105
14.2.1;Data Abstraction;105
14.2.2;Encapsulation;105
14.2.3;Inheritance;105
14.2.4;Polymorphism;105
14.3;The Class Definition;106
14.3.1;Creating Object Literals;107
14.3.2;Initializing Class Attributes within an Object Literal;108
14.3.3;Calling the Members of the Class;108
14.3.4;Assigning Default Values to Data Members;110
14.3.5;The init Block;110
14.3.5.1;Order of Instance Initialization;112
14.3.6;The postinit Block;112
14.4;Modifying Class Objects;112
14.5;Objects as Function Arguments;113
14.6;Non-Member Functions Accessing the Object;114
14.7;Static Members;115
14.8;Sharing a Function Name Between Script-Level and Member Functions;117
14.9;Calling a Java Method That Is a JavaFX Reserved Word;118
14.10;The abstract Class;119
14.11;Summary;120
15;Chapter 7: Access Specifiers;121
15.1;The Script—The .fx File;122
15.2;The Script-Private Access Specifier;123
15.3;Packages;127
15.3.1;Statics in JavaFX Script;129
15.3.2;The package Access Specifier;130
15.3.3;Package Access with Class Members;133
15.3.4;Honoring Access Specifiers for Java Classes;135
15.4;The protected Access Specifier;136
15.5;The public Access Specifier;139
15.6;JavaFX Secondary Access Specifiers;143
15.6.1;public-read;143
15.6.2;public-init;146
15.6.3;Secondary Specifiers and def;148
15.7;Access Specifiers for Class Definitions;148
15.7.1;Script-private Classes;149
15.7.2;Package-accessible Classes;149
15.7.3;Protected Classes;150
15.7.4;Public Classes;151
15.8;Summary;151
16;Chapter 8: Inheritance;152
16.1;The Order of Initialization of Data Members;153
16.2;Overriding Data Members;154
16.3;Use of the super Keyword;155
16.4;Mixin Classes;156
16.4.1;Creating a Subclass from Multiple Mixin Classes;159
16.4.2;The Order of Initialization in Multiple Inheritance;160
16.5;Abstract Classes;161
16.5.1;Using a JavaFX Class to Extend a Java Abstract Class;162
16.6;Anonymous Implementation of Java Interfaces;163
16.7;Summary;164
17;Chapter 9: Data Binding;165
17.1;What Does Binding Mean?;165
17.2;Recalculation of Expressions;167
17.3;Binding with Conditional Expressions;168
17.4;Binding with for Expressions;169
17.5;Binding Block Expressions;171
17.6;Binding Functions;172
17.7;Bound Functions;174
17.8;Binding with Object Literals;175
17.9;Bidirectional Binding;179
17.10;Lazy vs. Eager Binding;182
17.11;Summary;184
18;Chapter 10: Sequences;185
18.1;The sizeof Operator;186
18.2;Accessing the Elements of a Sequence;186
18.3;Nested Sequences;187
18.4;Creating a Sequence Using a Range Expression;188
18.5;Excluding the End Value in the Sequence;189
18.6;Sequence Slicing;189
18.7;Using a Predicate to Create a Subset of a Sequence;190
18.8;Working with Sequences;191
18.8.1;Inserting an Element into a Sequence;191
18.8.2;Deleting an Element from a Sequence;192
18.8.3;Reversing a Sequence;194
18.9;Sequences as Function Parameters;194
18.10;Binding with Sequences;196
18.11;javafx.util.Sequences Utility Functions;197
18.12;Summary;198
19;Chapter 11: Triggers;199
19.1;Defining a Simple Trigger;199
19.2;A Trigger with Access to the Old Value;201
19.3;Using Triggers with bind;202
19.4;Implementing Binding Using Triggers;203
19.5;Validation Within the Trigger;205
19.6;Sequence Triggers;206
19.7;Nested Triggers;211
19.8;Summary;212
20;Chapter 12: Introduction to JavaFX UI Elements;213
20.1;Rendering Model: Immediate Mode vs. Retained Mode Rendering;214
20.1.1;Scene Graph;214
20.1.2;Scene;215
20.1.3;Stage;216
20.2;Coordinate System;216
20.3;Graphical API Summary;217
20.4;Node – The Base UI Element;218
20.5;Geometries;220
20.5.1;Stroke vs. Fill;220
20.5.1.1;Stroke Attributes;220
20.6;Writing your First UI;222
20.7;Paints;230
20.7.1;Solid Colors;230
20.7.2;Gradients;232
20.7.2.1;Linear Gradient;232
20.7.3;Radial Gradient;238
20.8;Input Handling;240
20.8.1;Keyboard Input;241
20.8.2;JavaFX Focus Sub-system;241
20.8.3;Mouse Input;242
20.8.4;BlocksMouse;243
20.9;Text Rendering;244
20.10;Image Rendering;248
20.10.1;Loading an Image;248
20.10.2;Rendering an image;254
20.11;Transformations;256
20.11.1;Translation;256
20.11.2;Rotation;259
20.11.2.1;Custom Node;261
20.11.3;Scaling & Shear;262
20.12;Controls & Layouts;265
20.13;StyleSheets;270
20.14;Charts;270
20.15;Effects;273
20.16;Bounds;273
20.16.1;Bounds Class;273
20.16.2;Node Bounds Variables;274
20.17;Summary;277
21;Chapter 13: Introduction to Animation;278
21.1;What is Animation?;278
21.2;Animation in JavaFX;278
21.2.1;Play, Pause, or Stop a Timeline;283
21.2.2;KeyFrame Attributes;285
21.2.2.1;KeyFrame.action;286
21.2.2.2;KeyFrame.canSkip;286
21.2.3;Simplified Syntax;291
21.2.4;Transitions;292
21.2.4.1;Path Transitions;293
21.2.4.2;Scale Transitions;298
21.2.4.3;Rotate Transitions;300
21.2.4.4;Translate Transitions;300
21.2.4.5;Fade Transitions;300
21.2.4.6;Parallel and Sequential Transitions;306
21.3;Summary;310
22;Index;311




