وبلاگ بلیان

JavaFX 9 by Example

معرفی کتاب «JavaFX 9 by Example» نوشتهٔ Dea, Carl;Heckler, Mark;Grunwald, Gerrit;Llamas, Jose Pereda، منتشرشده توسط نشر APress : Imprint Apress در سال 2017. این کتاب در 8 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است.

Create media-rich client applications using JavaFX 9 and the Java 9 platform. Learn to create GUI-based applications for mobile devices, desktop PCs, and even the web. Incorporate media such as audio and video into your applications. Interface with hardware devices such as Arduino and Leap Motion. Respond to gesture control through devices such as the Leap Motion Controller. Take advantage of the new HTTP2 API to make RESTful web requests and WebSockets calls. New to this edition are examples of creating stylized text and loading custom fonts, guidance for working with Scene Builder to create visual layouts, and new content on developing iOS and Android applications using Gluon mobile. The book also covers advanced topics such as custom controls, JavaFX 3D, gesture devices, printing, and animation. Best of all, the book is full of working code that you can adapt and extend to all your future projects. Is your goal to develop visually exciting applications in the Java language? Then this is the book you want at your side. JavaFX 9 by Example is chock-full of engaging, fun-to-work examples that bring you up to speed on the major facets of JavaFX 9. You'll learn to create applications that look good, are fun to use, and that take advantage of the medium to present data of all types in ways that engage the user and lead to increased productivity. The book: Has been updated with new content on modular development, new APIs, and an example using the Scene Builder tool Is filled with fun and practical code examples that you can modify and drop into your own projects Includes an example using Arduino and an accelerometer sensor to track motion in 3D Helps you create JavaFX applications for iOS and Android devices What You'll Learn Work with touch-based interfaces Interpret gesture-based events Use shapes, color, text, and UI controls animation to create a simple click and point game Add audio and video to your projects Utilize JavaFX 3D Create custom controls using CSS, SVG, and Canvas APIs Organize code into modules using Java Platform Module System (Project Jigsaw) Who This Book Is For Java developers developing visual and media-rich applications to run on PCs, phones, tablets, Arduino controllers, and more. This includes developers tasked with creating visualizations of data from statistical analysis and from sensor networks. Any developer wanting to develop a polished user-interface in Java will find much to like in this book. Contents at a Glance......Page 4 Contents......Page 6 About the Authors......Page 19 About the Technical Reviewer......Page 21 Acknowledgments......Page 22 Introduction......Page 23 Downloading Required Software......Page 26 Installing the JDK on Microsoft Windows......Page 28 Installing the JDK on MacOS X......Page 32 Fedora, CentOS, Oracle Linux, or Red Hat Enterprise Linux OSes......Page 36 Red Hat Alternatives......Page 37 Default Java......Page 38 Setting Environment Variables......Page 39 Setup Windows Environment Variables......Page 41 Setting Up MacOS X/Linux Environment Variables......Page 44 Installing Gradle......Page 47 Installing the NetBeans IDE......Page 48 Creating a JavaFX HelloWorld Application......Page 54 Using the NetBeans IDE......Page 55 Using an Editor and the Terminal (the Command-Line Prompt)......Page 59 Using Gradle on the Command-Line Prompt......Page 63 Walking Through the HelloWorld Source Code......Page 66 JavaFX Node......Page 67 Packaging a JavaFX Application......Page 68 Downloading the Book’s Source Code......Page 69 Summary......Page 70 Chapter 2: JavaFX and Jigsaw......Page 71 Benefits......Page 72 Java 9 Migration Path......Page 73 The jdeps Analysis Tool......Page 74 JAR Hell......Page 76 OSGi......Page 77 Maven/Gradle......Page 78 Getting Started......Page 79 What Is the Module Path?......Page 80 Requires......Page 81 Module Types......Page 82 Application Module (Explicit Modules)......Page 83 JavaFX Platform Module Graph......Page 84 Automatic Modules (JAR Files Loaded as Named Modules)......Page 86 Create a Module Definition......Page 87 Create Main Application Code......Page 88 Copy Resources......Page 89 Package Application as JAR......Page 90 Display Module Description......Page 91 Summary......Page 92 JavaFX Lines......Page 93 Drawing Lines......Page 98 Drawing Shapes......Page 102 A Complex Shape Example......Page 103 The Cubic Curve......Page 107 The Ice Cream Cone......Page 108 The Donut......Page 110 An Example of Color......Page 112 Linear Gradient......Page 116 Radial Gradient......Page 117 Reflective Cycle Gradients......Page 118 Drawing Text......Page 119 Changing Text Fonts......Page 121 Applying Text Effects......Page 124 Summary......Page 125 Lambda......Page 126 Syntax......Page 127 Variable Capture......Page 129 Functional Interfaces......Page 130 Aggregate Operations......Page 131 An Example Case: Cats Large and Small......Page 134 Code for the Example......Page 135 Explanation of the Code......Page 139 Properties......Page 140 Types of JavaFX Properties......Page 141 Read-Only Properties......Page 142 JavaFX JavaBean......Page 143 Property Change Support......Page 144 Binding......Page 145 High-Level Binding......Page 146 A Logon Dialog Example......Page 147 Login Dialog Source Code......Page 149 Explanation of the Code......Page 153 The start() Method......Page 154 Summary......Page 157 Layouts......Page 158 An HBox Example......Page 159 Code Walkthrough......Page 161 A VBox Example......Page 163 Code Walkthrough......Page 165 BorderPane......Page 167 GridPane......Page 168 A Form-Type Application Example......Page 169 Code Walkthrough......Page 171 Scene Builder......Page 173 Launching Scene Builder......Page 174 A Code Walkthrough......Page 192 Summary......Page 193 Labels......Page 194 Custom Fonts......Page 196 Example: Working with Third-Party Font Packs as Icons......Page 197 Getting Started......Page 198 Compiling the Example......Page 203 How It Works......Page 204 Using a ComboBox Control......Page 205 Using a TextField Control......Page 206 The Private showIconDisplay() Method......Page 207 Button......Page 208 Check Box......Page 209 Radio Button......Page 210 Button Fun Instructions......Page 212 Source Code of ButtonFun.java......Page 213 How It Works......Page 219 Creating Menus and Menu Items......Page 221 Invoking a Selected MenuItem......Page 222 Example: Working with Menus......Page 223 How It Works......Page 225 Context Menus......Page 226 Working with ListViews......Page 227 Example: Hero Picker......Page 228 How It Works......Page 231 What Is a Cell Factory?......Page 232 Making Table Cells Editable......Page 233 Edit a Table Cell as a ComboBox......Page 234 Example: Bosses and Employees Working with Tables......Page 235 Domain Objects......Page 236 GUI Code......Page 238 How It Works......Page 241 Creating a Background Task......Page 244 Example: File Copy Progress Dialog (BackgroundProcesses)......Page 245 How It Works......Page 248 Summary......Page 249 Working with Images......Page 250 Loading Images......Page 251 Displaying Images......Page 253 Features/Instructions......Page 254 UML: Class Diagram......Page 256 File Descriptions......Page 257 PhotoViewer.java......Page 258 ImageViewButtons.java......Page 273 ImageInfo.java......Page 275 photo-viewer.css......Page 276 What Are Keyframes?......Page 278 JavaFX Transition Classes......Page 279 Source Code......Page 280 Compound Transitions......Page 284 PhotoViewer2 Example......Page 285 Summary......Page 287 JavaFX Printing......Page 288 Printer and PrinterJob......Page 291 Query Printer Attributes......Page 293 Configuring a Print Job......Page 295 Printing a Web Page......Page 297 Example WebDocPrinter Application......Page 298 Source Code......Page 300 How Does It Work?......Page 304 Summary......Page 305 Media Events......Page 306 An MP3 Player Example......Page 308 The Stop, Play, and Pause Buttons......Page 309 MP3 Audio Player Source Code......Page 310 How It Works......Page 324 The Audio Player Application’s Instance Variables......Page 325 Setting Up the Stage Window......Page 326 The Spectrum Area Chart Visualization (the Scene.lookup() Method)......Page 327 Creating a Custom Button Panel......Page 328 Using a Slider Control to Show Play Progress......Page 330 Media Metadata......Page 331 Rewinding (the OnEndOfMedia Event)......Page 332 Updating the Visualization Using the AudioSpectrumListener Interface......Page 333 Quitting (the Close Button)......Page 336 VP6 .flv......Page 337 A Video Player Example......Page 338 Video Player Source Code......Page 339 Setting Up the Stage Window for Full-Screen Mode......Page 343 The MediaView Node......Page 344 Closed Captioning Video Example......Page 346 Summary......Page 348 Chapter 10: JavaFX on the Web......Page 349 JavaFX Web and HTTP2 APIs......Page 350 WebEngine’s load() Method......Page 352 Obtaining an org.w3c.dom.Document (DOM) Object......Page 353 The JavaScript Bridge......Page 354 Communicating from JavaScript to Java......Page 355 Java 9 Module jdk.incubator.httpclient......Page 357 HttpClient API......Page 358 HttpRequest API......Page 359 Making RESTful Requests......Page 361 Body Handlers......Page 362 HTTP POST Request......Page 363 Server-Side Sockets......Page 364 Client-Side Sockets......Page 365 Example: An HTML5 Analog Clock......Page 367 Analog Clock Source Code......Page 368 Inkscape and SVG......Page 371 WebEvents......Page 372 Weather Widget Example......Page 373 One-Liner: Reading an Input Stream into a String......Page 375 Source Code......Page 376 How It Works......Page 385 Enhancements......Page 386 Summary......Page 387 A Very Basic 3D Scene Example......Page 388 Adding a Primitive Example......Page 390 Simple Translate and Rotate Example......Page 392 Multiple Primitive Transformation Example......Page 393 All Together Now: Grouped Primitives......Page 394 Interacting with Your Scene......Page 395 Primitive Picking for Primitives......Page 396 First Person Movement Using the Keyboard......Page 397 First Person Camera Movement Using the Mouse......Page 398 Beyond the Basics......Page 400 “Winding” and Wuthering......Page 401 MeshViews and DrawMode......Page 404 Roll Camera!......Page 409 Hit the Lights......Page 410 Summary......Page 411 The Arduino Board......Page 412 Programming the Arduino......Page 414 Arduino Web Editor......Page 415 Windows......Page 417 Running the IDE......Page 419 The Blink Example......Page 421 Orientation Visualizer Example......Page 422 JavaFX, the Charting API, and Orientation......Page 427 Creating the Module Project......Page 428 Serial Communications......Page 430 How It Works......Page 433 The JavaFX Charts API......Page 435 Building and Running the Project......Page 441 How It Works......Page 442 Adding More Functionality......Page 446 Building and Running the Project......Page 448 How It Works......Page 449 Summary......Page 451 JavaFXPorts Under the Hood......Page 452 Getting Started with JavaFXPorts......Page 453 Hello Mobile World Example......Page 454 How Does It Work?......Page 456 Submitting the App to the Stores......Page 458 The Gluon IDE Plug-Ins......Page 459 Charm Glisten......Page 460 Creating the Project......Page 462 Adding the Model......Page 468 Adding the Service......Page 471 Modifying the Main View......Page 474 Modifying the Board View......Page 478 Deploy to Mobile......Page 485 Summary......Page 486 Recognizing Gestures in Your Application......Page 487 Example: Animating Shapes Along a Path Using Touch Events......Page 489 How Does It Work?......Page 492 Touching, Rotating, and Zooming in 3D......Page 493 The Leap Motion Controller......Page 496 How It Works......Page 497 Getting Started with the Leap SDK......Page 498 The Hands Tracking Example......Page 499 The LeapListener Class......Page 500 The 3D Model Classes......Page 503 The Application Class......Page 505 Building and Running the Project......Page 507 Summary......Page 509 Theming......Page 510 Native Look and Feels......Page 512 Web and Mobile Look and Feels......Page 514 Applying the JavaFX CSS Theme......Page 516 Using the setUserAgentStylesheet(String URL) Method......Page 517 Using Scene’s getStylesheets().add(String URL) Method......Page 518 An Example of Switching Themes......Page 519 The Look N Feel Chooser Example Application Code......Page 520 How It Works......Page 523 JavaFX CSS Styling......Page 524 CSS class Type Selectors......Page 525 Pseudo-Class Selectors......Page 526 A Selector Styling Example......Page 527 How It Works......Page 529 Styling a Node by Inlining JavaFX CSS Styling Properties......Page 530 Obeying the JavaFX CSS Rules......Page 531 Custom Controls......Page 532 The LED Custom Control......Page 533 Structure of the LED Custom Control Example Code......Page 534 The Properties of the LED Control......Page 535 The Initialization Code of the LED Control......Page 538 The LED Control CSS File......Page 539 Resizing the LED Control......Page 540 How It Works......Page 541 Summary......Page 542 Java 9 Features......Page 543 Deploying Applications......Page 544 JavaFX Printing......Page 545 Project Lambda......Page 546 Properties and Bindings......Page 547 JavaFX Tools......Page 548 Enterprise GUI Frameworks......Page 549 Custom UIs......Page 550 JavaFX Media......Page 553 JavaFX on the Web......Page 554 JavaFX 3D......Page 555 JavaFX Gaming......Page 556 Java IoT and JavaFX Embedded......Page 557 JavaFX Communities......Page 558 Applications......Page 559 Java/JavaFX Books and Magazines......Page 561 Tutorials, Courses, Consulting Firms, and Demos......Page 562 Tools, Applications, and Libraries......Page 563 Videos and Presentations on JavaFX......Page 565 Index......Page 568 Create media-rich client applications using JavaFX 9 and the Java 9 platform. Learn to create GUI-based applications for mobile devices, desktop PCs, and even the web. Incorporate media such as audio and video into your applications. Interface with hardware devices such as Arduino and Leap Motion. Respond to gesture control through devices such as the Leap Motion Controller. Take advantage of the new HTTP2 API to make RESTful web requests and WebSockets calls. New to this edition are examples of creating stylized text and loading custom fonts, guidance for working with Scene Builder to create visual layouts, and new content on developing iOS and Android applications using Gluon mobile. The book also covers advanced topics such as custom controls, JavaFX 3D, gesture devices, printing, and animation. Best of all, the book is full of working code that you can adapt and extend to all your future projects. Is your goal to develop visually exciting applications in the Java language? Then this is the book you want at your side. JavaFX 9 by Example is chock-full of engaging, fun-to-work examples that bring you up to speed on the major facets of JavaFX 9. You'll learn to create applications that look good, are fun to use, and that take advantage of the medium to present data of all types in ways that engage the user and lead to increased productivity. The book: Has been updated with new content on modular development, new APIs, and an example using the Scene Builder tool Is filled with fun and practical code examples that you can modify and drop into your own projects Includes an example using Arduino and an accelerometer sensor to track motion in 3D Helps you create JavaFX applications for iOS and Android devices What You'll Learn: Work with touch-based interfaces Interpret gesture-based events Use shapes, color, text, and UI controls animation to create a si mple click and point game Add audio and video to your projects Utilize JavaFX 3D Create custom controls using CSS, SVG, and Canvas APIs Organize code into modules using Java Platform Module System (Project Jigsaw) Chapter 3: JavaFX Fundamentals; JavaFX Lines; Drawing Lines; Drawing Shapes; Drawing Complex Shapes; A Complex Shape Example; The Cubic Curve; The Ice Cream Cone; The Smile; The Donut; Painting Colors; An Example of Color; Gradient Color; Stop Color; Linear Gradient; Radial Gradient; Semitransparent Gradients; Reflective Cycle Gradients; Drawing Text; Changing Text Fonts; Applying Text Effects; Summary; Chapter 4: Lambdas and Properties; Lambda; Lambda Expressions; Syntax; Method Reference; Variable Capture; Functional Interfaces; Aggregate Operations; Default Methods
دانلود کتاب JavaFX 9 by Example