Java Reference
In-Depth Information
In this case, widthFactor specifies the scaling factor applied to the node's width, and
heightFactor specifies the scaling factor applied to the node's height. These factors can be
changed after a Scale instance has been created by using setX( ) and setY( ) , shown here:
final void setX(double widthFactor )
final void setY(double heightFactor )
As before, widthFactor specifies the scaling factor applied to the node's width, and
heightFactor specifies the scaling factor applied to the node's height. You might use these
methods to change the size of a control during program execution, possibly to draw atten-
tion to it.
Demonstrating Effects and Transforms
The following program demonstrates the use of effects and transforms. It does so by creat-
ing three buttons and a label. The buttons are called Rotate, Scale, and Blur. Each time one
of these buttons is pressed, the corresponding effect or transform is applied to the button.
Specifically, each time you press Rotate, the button is rotated by 15 degrees. Each time you
press Scale, the button size is changed. Each time you press Blur, the button is progress-
ively blurred. The label illustrates the reflection effect. When you examine the program,
you will see how easy it is to customize the look of your GUI. You might find it interesting
to experiment with it, trying different transforms or effects, or trying the effects on differ-
ent types of nodes other than buttons.
Search WWH ::




Custom Search