Skip to main content
main-content

Über dieses Buch

Enough about learning the fundamentals of the intriguing JavaFX platform; it's now time to start implementing visually stunning and dynamic Java-based rich Internet applications (RIAs) for your desktop or mobile front end. This book will show you what the JavaFX platform can really do for Java desktop and mobile front ends. It presents a number of excellent visual effects and techniques that will make any JavaFX application stand out—whether it's animation, multimedia, or a game. The techniques shown in this book are invaluable for competing in today's market, and they'll help set your RIAs apart from your competitor's.

Create visual effects that perform well. Add subtle animations to bring any application to life. Use the graphical power of the JavaFX platform.

Inhaltsverzeichnis

Frontmatter

Chapter 1. JavaFX Design Considerations

This book was written to demonstrate how JavaFX can be used to create visually rich applications. It does so by presenting a number of techniques and explaining how they work in JavaFX. Before we explore the code, it is worth our time to look at the design of applications. Design is the process of planning what the application will do, how it will look, and how it will be implemented. This chapter starts with some thoughts on creating the content of applications in general, and ends with specifics related to working with JavaFX.

Lucas L. Jordan

Chapter 2. Effect: Particle Systems

Particle systems are used in many video games and other animations. A particle system is a general term for any visual effect that uses a large number of small, simple, animated nodes to create a larger, complex effect. This technique produces animations that are hard to reproduce using a single vector, raster image, or other method. Examples of particle systems include fire, magic spells, sparks, and moving water. This chapter covers the basic principles of particle systems in 2D space, and how they are implemented in JavaFX. There are a number of examples, each building on the previous one. You’ll find it very helpful to have the example code on hand when reading this chapter.

Lucas L. Jordan

Chapter 3. Effect: Visual Transitions

Visual transitions are animations that introduce a new visual component to the scene, usually by replacing a component already in the scene. A good example of a visual transition is a fade-out on TV—it is a visual effect that informs the viewer that something is ending and something new has started.

Lucas L. Jordan

Chapter 4. Effect: Animated Lighting

As you glance around any room, it becomes apparent that though every object is illuminated subtly from many angles, one light source tends to dominate the others. The light from this main source makes one side of an object appear bright and the other side dark, often with a smooth gradient transitioning between the two. The human eye uses this difference between the light and dark to estimate an object’s size and shape. When light moves across an object, the eye and brain get a chance to confirm the guesses, providing certainty about the nature of the object.

Lucas L. Jordan

Chapter 5. Effect: Advanced Interpolators

Animations are pictures that change over time; these changes are composed of transformations and color changes. In either case, the rates at which these changes take place dictate much about the appearance of the animation, and of course, the rates themselves can change over time. Imagine the trivial animation of a rectangle moving from the top of the screen to the bottom. If the box moves down at a constant rate of 2 pixels per second, it would appear to be gently lowering. However, if the box drops 2 pixels the first second, 4 pixels the next second, then 8, 16, and so on, the box would seem to be freely falling. The difference between an object being lowered and an object falling can have a big effect on the impact of the animation.

Lucas L. Jordan

Chapter 6. Effect: Physics

A physics engine is a software library that simulates how objects move in the real world. Adding physics to an application provides a way to create animations that appeal to the user’s sense of realism. While it is possible to create animations that have a life-like quality without implementing physics, cracking open that high school physics book will provide consistency throughout your application. However, if the thought of implementing “real life” in your application feels a little out of scope, you can make use of a third-party library. This chapter will explore what a physics engine can do, and how to use an excellent open-source library to add physics-based effects to a JavaFX application.

Lucas L. Jordan

Chapter 7. Effect: Animated Image Sequences

Not all animations in an application are dynamic. It is often desirable to create the animations in a dedicated tool and then play the animation in the app. JavaFX has good support for video, for example, but sometimes video is too heavy of a solution. Or perhaps you want to have an animation sequence with partial transparency or be able to specify exactly which frames of the animation are visible when. In these cases, animating a sequence of image files can produce desirable results, and as a bonus, most animation software supports exporting image sequences directly.

Lucas L. Jordan

Chapter 8. Effect: Animated Gradients

Colors are obviously a key component of any graphical application. Modern monitors are able to display millions of colors, and the designers of software have taken advantage of that. One important aspect of colors within an application is how they blend together, and a number of graphical libraries provide a mechanism to display the many grades of colors between any two colors. In general, this feature is called a gradient. Gradients can be used to create remarkable subtlety, be it the shine of a button or a slight sense of depth. While displaying solid colors or gradients is an excellent first step, some remarkable things can happen when these components are animated.

Lucas L. Jordan

Chapter 9. Effect: Audio Visualizer

I have always been amazed how the human mind is capable of connecting sounds we hear with something that we see. When my cat meows, I hear the sound and see the motion of the cat, and somehow these two different sensory experiences are combined into a single event. Computers have been used for years to visualize audio data, and being able to see the data update as you hear the sound being analyzed provides insight into sounds that would not be possible by just listening alone. JavaFX is an excellent tool for graphics, and Java has passable media support; this chapter will show how to combine these tools to create our own live graphical representations of audio.

Lucas L. Jordan

Chapter 10. Effects: Physics and Particles

Particles are capable of creating some eye-catching animations that produce vibrant and fluid effects. Physics engines, on the other hand, create animations that satisfy our sense of motion. Combining these two excellent effects offers the best of both worlds, and this chapter explores two examples of intertwining physics with particles.

Lucas L. Jordan

Chapter 11. Pulling It All Together: Clown Cannon

Throughout this book I have presented techniques and examples in isolation so that you can examine details of the implementation. They represent the experience that I have gained from trial and error when working with JavaFX. But an application is more than just the sum of its features and effects, which is why, in this chapter, we will explore an entire application from start to finish. We will look at the design process, the workflow, and the implementation of an example application.

Lucas L. Jordan

Backmatter

Weitere Informationen

Premium Partner

Neuer Inhalt

BranchenIndex Online

Die B2B-Firmensuche für Industrie und Wirtschaft: Kostenfrei in Firmenprofilen nach Lieferanten, Herstellern, Dienstleistern und Händlern recherchieren.

Whitepaper

- ANZEIGE -

Product Lifecycle Management im Konzernumfeld – Herausforderungen, Lösungsansätze und Handlungsempfehlungen

Für produzierende Unternehmen hat sich Product Lifecycle Management in den letzten Jahrzehnten in wachsendem Maße zu einem strategisch wichtigen Ansatz entwickelt. Forciert durch steigende Effektivitäts- und Effizienzanforderungen stellen viele Unternehmen ihre Product Lifecycle Management-Prozesse und -Informationssysteme auf den Prüfstand. Der vorliegende Beitrag beschreibt entlang eines etablierten Analyseframeworks Herausforderungen und Lösungsansätze im Product Lifecycle Management im Konzernumfeld.
Jetzt gratis downloaden!

Bildnachweise