Java Reference
In-Depth Information
For our example, we apply the reflection effect to a rectangle and a circle object. Both objects
use a gradient paint against a black-filled scene. The Reflection class automatically blends
the background color and the gradient from the original object to product a nice reflective effect.
The Reflection class makes several properties available that provide control over the
way the reflections work. Here are some common properties that you may come across:
F fraction —a ratio between 0 to 1, which indicates how much of the original visual
node is reflected. A value of 1, for instance, means that all of the original object is
reflected. A value of 0 shows no reflection. For best results, apply this property with
a value between 0.25 to 0.75.
F topOpacity —a ratio indicating how opaque the reflection is at the top of the
reflected image. This number ranges from 0 to 1, where 0 is complete opacity
and 1 is complete transparency.
F bottomOpacity —a ratio indicating how opaque the reflection is at its bottom where
it starts to fade. This number has a range from 0 to 1, where 0 is complete opacity
and 1 is full transparency.
F topOffset —this is the distance between the bottom of the original node and the top
of the reflected image in pixels.
When you use the Reflection effect, the newly generated reflected image is attached to the
original node. The reflection is updated accordingly with any spatial or visual changes that
are applied to the properties of the original node.
The reflected portion of the image does not respond to
any mouse input gesture.
See also
F Adding depth with lighting and shadow effects
 
Search WWH ::




Custom Search