JavaFX 2

Animating Nodes in the Scene (Creating a User Interface in JavaFX) Part 2

Using the Transition Classes for Animation The javafx.transition package contains several classes whose purpose is to provide convenient ways to do commonly used animation tasks. For example, Table 2-1 contains a list of transition classes in that package. Table 2-1. Transition Classes in the javafx.transition Package for Animating Nodes Transition Class Name Description TranslateTransition Translates […]

Animating Nodes in the Scene (Creating a User Interface in JavaFX) Part 3

The Behavior of the MetronomePathTransition Program Go ahead and run the program, performing once again the same steps that you did in the "Examining the Behavior of the Metronome1 Program" exercise. Everything should function the same as it did in the MetronomeTransition example, except that the node is an ellipse instead of a circle, and […]

Animating Nodes in the Scene (Creating a User Interface in JavaFX) Part 4

Using the KeyFrame Action Event Handler We’re using a different technique in the timeline than demonstrated in the Metronome1 program earlier in the topic (see Figure 2-8 and Listing 2-5). Instead of interpolating two values over a period of time, we’re using the action event handler of the KeyFrame instance in our timeline. Take a […]

Forerunners of JavaFX 2.0 Binding (Properties and Bindings)

Heaven acts with vitality and persistence. In correspondence with this The superior person keeps himself vital without ceasing. —I Ching You downloaded the JavaFX 2.0 SDK and the JavaFX plugin for Netbeans. You wrote and ran your first JavaFX 2.0 GUI programs. You learned the fundamental building blocks of JavaFX 2.0: the Stage and Scene […]

A Motivating Example (Properties and Bindings) (JavaFX 2)

Let’s start with an example that shows off the capabilities of the Property interface through the use of a couple of instances of the SimpleIntegerProperty class. Listing 3-1. MotivatingExample.java                 In this example we created a SimpleIntegerProperty object called intProperty with an initial value of 1024. We then […]

Understanding Key Interfaces and Concepts (Properties and Bindings) (JavaFX 2)

Figure 3-1 is an UML diagram showing the key interfaces of the JavaFX 2.0 properties and bindings framework. It includes some interfaces that you have seen in the last section, and some that you haven’t seen. Figure 3-1. Key interfaces of the JavaFX 2.0 properties and bindings framework ■ Note We did not show you […]

Type-Specific Specializations of Key Interfaces (Properties and Bindings) (JavaFX 2)

We did not emphasize this fact in the last section because we believe its omission does not hurt the explanations there, but except for Observable and InvalidationListener, the rest of the interfaces are generic interfaces with a type parameter <T>. In this section we examine how these generic interfaces are specialized to the specific types […]

Creating Bindings (Properties and Bindings) (JavaFX 2)

We now turn our focus to the creation of new bindings out of existing properties and bindings. You learned in the "Understanding Key Interfaces and Concepts" section earlier in this topic that a binding is an observable value that has a list of dependencies which are also observable values. The JavaFX 2.0 properties and bindings […]

Understanding the JavaFX Beans Convention (Properties and Bindings) Part 1

JavaFX 2.0 introduces the concept of JavaFX Beans, a set of conventions that provide properties support for Java objects. In this section, we talk about the naming conventions for specifying JavaFX Beans properties, several ways of implementing JavaFX Beans properties, and finally the use of selection bindings. The JavaFX Beans Specification For many years Java […]

Understanding the JavaFX Beans Convention (Properties and Bindings) Part 2

Using Selection Bindings As you have seen in the "Understanding the Bindings Utility Class" subsection of the "Creating Bindings" section, the Bindings utility class contains seven selection operators. The method signatures of these operators are: These selection operators allow you to create bindings that observe deeply nested JavaFX Beans properties. Suppose that you have a […]