Gail Anderson, Paul Anderson9780137042791, 0-13-704279-5
JavaFX is a scripting language which provides built-in properties for manipulating objects within a 2D coordinate system. A competing technology to Microsoft’s Silverlight, JavaFX provides the tools to fill and pen stroke colors, and create special effects, shapes and lines. It also manipulates images and play videos and sound and defines animations that affect objects over time. This complete introduction for any level doesn’t bury you with details. It starts quickly with an introduction to the power of JavaFX key features–scene node graphs, nodes as components, the coordinate system, layout options, colors and gradients, custom classes with inheritance, animation, binding, and event handlers. It then shows step-by-step how these features could be used in a real JavaFX application and will help an application look professionally designed. Commissioned by JavaFX product team and reviewed by renowned Java author, Brian Goetz, this guide is intended as the first and most accessible book for people new to JavaFX.
The Andersons are working directly with the JavaFX team at Sun for a complete and authoritative guide Gets you started on building rich Web apps quickly without having to sort through unnecessary details or search the Web for answers Focuses on most useful features and shows how to build apps that tap the full potential of JavaFX
Table of contents :
Contents……Page 4
Preface……Page 12
Acknowledgments……Page 16
1.1 What Is JavaFX?……Page 18
JavaFX SDK……Page 19
1.3 Where to Get JavaFX……Page 20
Create a NetBeans Project……Page 21
Edit JavaFX Source Code……Page 24
Compile and Run……Page 25
Execution Models……Page 26
2.1 Introducing JavaFX……Page 30
2.2 Project GuitarTuner……Page 31
The Scene Graph Metaphor……Page 32
Hierarchical Scene Graph……Page 33
Stage and Scene……Page 34
Object Literals……Page 35
Type Inference……Page 36
Shapes……Page 37
Sequences……Page 38
Extending CustomNode……Page 39
JavaFX Script Artifacts……Page 41
Gradients……Page 43
Color……Page 45
Rectangles with Arcs……Page 46
DropShadows……Page 47
Binding……Page 48
Mouse Events……Page 49
Animations……Page 50
2.7 Source Code for Project GuitarTuner……Page 53
3.1 Variables and Types……Page 60
JavaFX Types……Page 61
Printing Variables……Page 63
3.2 Operators……Page 64
Unary Operators……Page 65
Logical Operators……Page 66
Block Expressions……Page 67
For Expressions……Page 68
Binding Expressions……Page 69
Bidirectional Binding……Page 70
Sequence Literals……Page 71
Printing Sequences……Page 72
Creating Sequences with for……Page 73
Inserting Items into Sequences……Page 74
Deleting Items from Sequences……Page 75
Predicates……Page 76
Binding Sequences……Page 77
Passing Arguments to Functions……Page 78
Returning Values from Functions……Page 79
Bound Functions……Page 80
Program Arguments……Page 81
Function Types……Page 82
Classes……Page 84
Object Literals……Page 85
Using public-init……Page 86
Using public-read……Page 87
Using this……Page 88
Using Java Objects……Page 89
Binding with Object Literals……Page 90
3.7 Inheritance……Page 92
Using super……Page 93
Abstract Base Classes……Page 95
As Operator……Page 97
Mixin Inheritance……Page 98
On Replace with Variables……Page 100
On Replace with Sequences……Page 101
On Replace with isInitialized……Page 102
3.9 Script Files and Packages……Page 103
Function Scope……Page 104
Access Modifiers……Page 105
Packages……Page 106
Try, Catch, Finally……Page 108
Throwing Exceptions……Page 109
3.11 JavaFX Keywords……Page 110
4.1 Setting the Stage……Page 112
Node……Page 113
Cursor……Page 118
Group……Page 119
4.2 Shapes……Page 120
Circle……Page 124
Arc……Page 125
QuadCurve……Page 126
Line……Page 127
SVGPath……Page 128
ShapeIntersect/ShapeSubtract……Page 130
Text……Page 132
4.3 Paths……Page 133
4.4 Layout Components……Page 136
HBox and VBox Layout Components……Page 137
Flow and Tile Layout Components……Page 138
Stack Layout Component……Page 140
Point2D……Page 141
Bounding Rectangles……Page 142
TextBox……Page 146
UI Components……Page 148
Popup Windows……Page 151
SwingCheckBox……Page 152
SwingComboBoxItem……Page 153
SwingLabel……Page 154
SwingListItem……Page 155
SwingToggleButton……Page 157
SwingTextField……Page 158
Pizzas Are Circles……Page 159
Toppings Are Circles……Page 161
Selecting Pizza Size with SwingRadioButton……Page 162
Selecting Toppings with SwingCheckBox……Page 163
Integrating with Bound Functions and Binding……Page 164
Cascading Style Sheets (CSS)……Page 165
Skinnable TextButton Component……Page 169
Skinnable ChoiceDialog Component……Page 175
6.1 Project Piano……Page 184
6.2 PianoKey Components……Page 186
Class PianoKey……Page 187
Subclass WhiteKey……Page 188
Single Key Application……Page 190
Subclass BlackKey……Page 193
Two Key Application……Page 195
6.3 Building the Keyboard……Page 197
6.4 SwingButtons and Animation……Page 200
6.5 Adding Help and Improving Visual Effects……Page 205
6.6 Source Code for Project Piano……Page 211
What You Will Learn……Page 222
7.1 Timelines……Page 223
Animation Basics—Moving an Object……Page 225
Animating Multiple Targets……Page 228
Animating Multiple Targets Independently……Page 229
Animating Groups……Page 231
Animation and Binding……Page 233
Using action with a Digital Clock Display……Page 235
Using action with a Progress Bar……Page 237
7.3 Transitions……Page 242
Transition Basics—Simple Movement……Page 243
ScaleTransition……Page 244
Rotate and Fade Transitions……Page 245
Compound Transitions……Page 248
Creating a Path……Page 250
PathTransition……Page 252
7.5 Chutes and Ladders……Page 254
Class PathBall (PathBall.fx)……Page 255
Main Program (Main.fx)……Page 259
8.1 Using Image……Page 266
Class Image……Page 267
8.2 Using ImageView……Page 269
Scaling……Page 273
Transformation and Effects Menagerie……Page 275
8.3 Building a Wall of Photos……Page 281
8.4 Mouse Dragging……Page 287
8.5 Animated Photo Carousel……Page 290
Photo Carousel Scene Graph……Page 291
CarouselPhoto Animation……Page 292
CarouselPhoto Custom Node……Page 293
Carousel Custom Node……Page 296
Main Script……Page 299
9.1 JavaFX Pull Parsers……Page 302
XML Parsing……Page 303
JSON Parsing……Page 310
Animated Photo Carousel……Page 312
Using HttpRequest……Page 313
Interesting Photos……Page 318
9.4 Flickr: Searching with Tags……Page 325
9.5 Flickr: Getting User Photos……Page 329
10.1 JavaFX Mobile—What Does It Mean?……Page 332
Mobile Emulator……Page 334
Discovering Your Environment……Page 336
Orientation Changes……Page 338
Mouse and Key Events……Page 340
User Input……Page 343
10.2 Making a JavaFX Application Mobile Ready……Page 344
Detecting Orientation Changes……Page 346
Reducing the Number and Size of Images……Page 347
Adjusting the Animation……Page 348
10.3 Mobile-Only Applications……Page 349
Grouping Elements Together……Page 351
C……Page 354
E……Page 355
I……Page 356
N……Page 357
P……Page 358
S……Page 359
T……Page 360
X……Page 361
Reviews
There are no reviews yet.