Java Reference
In-Depth Information
effects that are available, and how they can be applied to your application to
make a more compelling visual experience. They include
Shadowing including DropShadow , InnerShadow , and Shadow .
Lighting including DistantLight , PointLight , and SpotLight .
Gradients including LinearGradient and RadialGradient . Technically,
these do not belong to the effects package, but are used in a similar fash-
ion and are thus grouped with this chapter.
Blurs including GaussianBlur and MotionBlur .
Reflection.
Blending including Blend and BlendMode .
PerspectiveTransform.
Glow.
Bloom.
DisplacementMap.
Color Adjustment Effects including SepiaTone and ColorAdjust .
Effects
In the JavaFX node-centric approach, the library classes that are used to create
content (e.g., Text , Rectangle , ImageView , CustomNode , etc.) are all ultimately
derived from the javafx.scene.Node class. As a result, they all share a set of
common instance variables defined by Node , one of the most important being a
variable called effect . By assigning a value to an instance's effect variable,
you, in essence, apply an effect to that object.
The JavaFX runtime, by default, contains packages and classes under the
javafx.scene.effect hierarchy, which represent the range of available effects that
can be applied. They include, among others, classes for 2D and 3D lighting,
blurring, shadowing, color adjusting, blending, glowing, toning, inverting,
reflecting, blooming, and flooding operations. They are suitable for those of us
who are not artistically inclined and offer an alternative in many cases to utiliz-
ing sophisticated image manipulation software.
In an effort to expose you to as many of the classes as possible, we'll spend a
good part of this chapter applying individual effects first to simple shapes and
later on to images and see how their appearance changes. It should, at minimum,
serve as a reference for how to use a particular effect. Of course in the real world,
you'll likely want to combine a host of effects together. So let's get started.
 
Search WWH ::




Custom Search