Java Reference
In-Depth Information
effect: DropShadow {
effect: DropShadow {
offsetX: 3
offsetX: 5
offsetY: 15
offsetY: 20
}
radius: 3
}
Figure 6.3
Two Different DropShadow Instances
InnerShadow
Similar to
DropShadow
,
InnerShadow
instead renders a shadow inside, rather
than behind the content. It has the same instance variables as
DropShadow
, and
introduces one other called
choke
, which gives additional control over the
shadow effect. This time, we'll do our rendering on a
Rectangle
node to demon-
strate how
InnerShadow
might be used. The following chunk of code demonstrates
how a
Rectangle
instance might use
InnerShadow
.
Rectangle {
x: 10, y: 10
width: 200, height: 100
arcWidth: 20, arcHeight: 20
fill: Color.GRAY
effect: InnerShadow { offsetX: 3, offsetY: 3 }
}
Figure 6.4 displays what the content would look like.
Figure 6.4
An Example Applying the InnerShadow Effect on a Rectangle Node
Shadow
The last of the built-in shadow effects is
Shadow
, which can be used to create a
shadowy version of the original content. For example, if we replace the
Drop-
Shadow
effect found in Listing 6.1 with
Search WWH ::
Custom Search