Deck 14: Java-Fx: Graphics, Effects, and Media

Full screen (f)
exit full mode
Question
To create a circle, you need to specify only the X and Y coordinates of the center point.
Use Space or
up arrow
down arrow
to flip the card.
Question
Which class creates an animation in which a node rotates?

A) Rotate
B) RotateTransition
C) NodeRotation
D) NodeRotate
Question
The FillTransition class works only with objects of the Shape class or one of its subclasses.
Question
The setInterpolator method allows you to specify how a transition begins and ends.
Question
The following statement will draw the string "Welcome!" starting at the top left corner of the screen.
Text welcomeText = new Text(0, 0, "Welcome!");
Question
In a window that is 640px wide by 480px high, the top right X, Y coordinates would be (0, 480).
Question
A polygon, created by the Polygon class is, by default, filled with the color black.
Question
The __________ class specifies the amount of time an animation should last.

A) Time
B) Clock
C) Duration
D) TimeSpan
Question
JavaFX provides transition classes that allow the creation of animations by causing a node to change, over time, from one state to another.
Question
The Rotate class creates a rotating animation.
Question
To make a node half its original size, you pass the setScaleX method the value 2 and pass the setScaleY method the value 0.5.
Question
The __________ class is used to move a node from one position on the screen to another.

A) AnimationTransition
B) MoveTransition
C) RotateTransition
D) TranslateTransition
Question
To create an animation in which a node fades in or out over a period of time, use the __________ class.

A) Fade
B) FillTransition
C) FadeTransition
D) Fill
Question
Which effect class do you use to increase an image's brightness?

A) Glow
B) Reflection
C) ColorAdjust
D) SepiaTone
Question
The __________ arc type causes a straight line to be drawn from one endpoint of the arc to the other endpoint.

A) ArcType.ROUND
B) ArcType.CLOSED
C) ArcType.CHORD
D) ArcType.OPEN
Question
Which of the following import statements must be used in order to use the Color class?

A) import.javafx.scene.Paint.color;
B) import.javafx.scene.paint.Color;
C) import.javafx.paint.color;
D) import.javafx.scene.Color;
Question
Since the Node class's setEffect method only accepts one effect object as an argument, it is impossible to combine effects.
Question
Given a window that is 640 (width) by 480 (height), which of the following represents the lowest position on the left side?

A) (639, 0)
B) (0, 639)
C) (0, 479)
D) (479, 0)
Question
To animate a node with the ScaleTransition class, you specify starting and ending __________.

A) sizes
B) colors
C) angles
D) scale factors
Question
Which of the following creates a blue circle centered at X = 50, Y = 50 with a radius of 50?

A) Circle blueCircle = new Circle(50, 50, 50);
BlueCircle.setFill(Color.BLUE);
B) Circle blueCircle = new Circle(50, 50);
BlueCircle.setStroke(Color.BLUE);
C) Circle blueCircle = new Circle(50, 50, 50, Color.BLUE);
D) Circle blueCircle = new blueCircle(50);
BlueCircle.setColor(BLUE);
Question
Select all that apply. Which of the following are possible states of a MediaPlayer object?

A) READY
B) PLAYING
C) PAUSED
D) STOPPED
Question
What does the following code snippet do? Circle myCircle = new Circle(50, 50, 25);
TranslateTransition rtrans =
New TranslateTransition(new Duration(5000), myCircle);

A) It creates a circle with center point (50, 25), radius = 50, and duration = 5000 seconds.
B) It creates a circle with center point (50, 50), radius = 25, and duration = 5 seconds.
C) It creates a circle with center point (25, 50), radius = 25, and duration = 5 seconds.
D) It creates a circle with center point (50, 25), radius = 50, and duration = 50 seconds.
Question
Which of the following is a subclass of Node?

A) Media
B) MediaPlayer
C) Both of these
D) Neither of these
Question
Select all that apply. Which of the following are transition classes?

A) FadeTransition
B) StrokeTransition
C) RotateTransition
D) RunTransition
Question
Select all that apply. Which of the following are subclasses of the Animation class and the Transition class?

A) StrokeTransition
B) TextFillTransition
C) ReverseTransition
D) ScaleTransition
Question
Select all that apply. Which of the following are key events?

A) when a user rolls a mouse over the monitor
B) when a user presses a key
C) when a user presses and releases a key that produces a Unicode character
D) when a user releases a key
Question
Select all that apply. Which of the following are special effects that can be applied to nodes in a scene graph?

A) a shadow appears behind a node
B) a glow appears
C) a shadow appears inside the edges of a node
D) an image has a sepia tone appearance
Question
Any time a user presses a key, a __________ event occurs.

A) KEY_TYPED
B) KEY_PRESSED
C) KEY_RELEASED
D) KEY_EVENT
Question
All the transition classes inherit a method named __________ which allows you to specify how the animation begins and ends.

A) setFromTo
B) setInterpolator
C) setInterpreter
D) setStartEnd
Question
Which mouse event occurs when the user presses and releases the mouse button?

A) MOUSE_PRESSED
B) MOUSE_RELEASED
C) MOUSE_CLICKED
D) MOUSE_DRAGGED
Question
Which transition class causes a node to become larger or smaller?

A) FillTransition
B) SizeTransition
C) ScaleTransition
D) TranslateTransition
Question
Select all that apply. Which of the following are constructors of the Rectangle class?

A) Rectangle(width, height, stroke)
B) Rectangle(width, height)
C) Rectangle(X, Y, width, height)
D) Rectangle(width, height, fill)
Question
What does the following code snippet do when the animation is played, given that imageView has been created? FadeTransition ftrans = new FadeTransition
(new Duration(5000), imageView);
Ftrans.setFromValue(1.0);
Ftrans.setToValue(0.5);
Ftrans.play():

A) The image will be completely opaque when displayed and will decrease to 50% opacity over the five seconds of the animation.
B) The image will be completely invisible when displayed and will increase to 50% opacity over the five seconds of the animation.
C) The image will be completely opaque when displayed and will increase to 50% opacity over the five minutes of the animation.
D) The image will be 50% opaque when displayed and will increase to 100% over the five seconds of the animation.
Question
Select all that apply. Which of the following are mouse event types?

A) MOUSE_CLICKED
B) MOUSE_MOVED
C) MOUSE_LIFTED
D) MOUSE_PRESSED
Question
Select all that apply. Which of the following classes are used to play videos?

A) MediaView
B) Media
C) MediaPlayer
D) VideoPlayer
Question
Which of the following code snippets creates a Line and uses a RotateTransition object to animate it for seven seconds?

A) Line myLine = new Line(25, 50, 100, 50);
RotateTransition rtrans =
New RotateTransition(new Duration(7000), myLine);
B) Line myLine = new Line(25, 50, 100, 50);
RotateTransition rtrans =
New RotateTransition(new Duration(7), myLine);
C) Line myLine = new Line(25, 50, 100, 50);
RotateTransition rtrans =
New Duration(7000), myLine;
D) Line myLine = new Line(25, 50);
RotateTransition rtrans =
New RotateTransition(new Duration(7000), Line);
Question
Which of the following statements draws the string "Love to animate!" starting at coordinates (200, 50)?

A) Text myText = new myText(200, 50, "Love to animate!");
B) Text myText = new Text(50.0, 200.0, "Love to animate!");
C) Text myWords = new Text(200.0, 50.0, "Love to animate!");
D) Text Words = new Words(200, 50, "Love to animate!");
Question
To combine several effects, use the Effect class's __________ method.

A) setInput
B) combineEffect
C) addEffect
D) Effects cannot be combined.
Question
Select all that apply. Which of the following classes are used to play an audio file?

A) MediaView
B) Media
C) MediaPlayer
D) AudioPlayer
Question
Select all that apply. Which of the following will cause a counterclockwise rotation of a RotateTransition object, rtrans?

A) rtrans.setFromAngle(60.0);
Rtrans.setByAngle(15.0);
B) rtrans.setFromAngle(-60.0);
Rtrans.setByAngle(15.0);
C) rtrans.setFromAngle(60.0);
Rtrans.setByAngle(-15.0);
D) rtrans.setAngle(60.0, 15.0);
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/40
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 14: Java-Fx: Graphics, Effects, and Media
1
To create a circle, you need to specify only the X and Y coordinates of the center point.
False
2
Which class creates an animation in which a node rotates?

A) Rotate
B) RotateTransition
C) NodeRotation
D) NodeRotate
B
3
The FillTransition class works only with objects of the Shape class or one of its subclasses.
True
4
The setInterpolator method allows you to specify how a transition begins and ends.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
5
The following statement will draw the string "Welcome!" starting at the top left corner of the screen.
Text welcomeText = new Text(0, 0, "Welcome!");
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
6
In a window that is 640px wide by 480px high, the top right X, Y coordinates would be (0, 480).
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
7
A polygon, created by the Polygon class is, by default, filled with the color black.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
8
The __________ class specifies the amount of time an animation should last.

A) Time
B) Clock
C) Duration
D) TimeSpan
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
9
JavaFX provides transition classes that allow the creation of animations by causing a node to change, over time, from one state to another.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
10
The Rotate class creates a rotating animation.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
11
To make a node half its original size, you pass the setScaleX method the value 2 and pass the setScaleY method the value 0.5.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
12
The __________ class is used to move a node from one position on the screen to another.

A) AnimationTransition
B) MoveTransition
C) RotateTransition
D) TranslateTransition
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
13
To create an animation in which a node fades in or out over a period of time, use the __________ class.

A) Fade
B) FillTransition
C) FadeTransition
D) Fill
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
14
Which effect class do you use to increase an image's brightness?

A) Glow
B) Reflection
C) ColorAdjust
D) SepiaTone
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
15
The __________ arc type causes a straight line to be drawn from one endpoint of the arc to the other endpoint.

A) ArcType.ROUND
B) ArcType.CLOSED
C) ArcType.CHORD
D) ArcType.OPEN
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
16
Which of the following import statements must be used in order to use the Color class?

A) import.javafx.scene.Paint.color;
B) import.javafx.scene.paint.Color;
C) import.javafx.paint.color;
D) import.javafx.scene.Color;
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
17
Since the Node class's setEffect method only accepts one effect object as an argument, it is impossible to combine effects.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
18
Given a window that is 640 (width) by 480 (height), which of the following represents the lowest position on the left side?

A) (639, 0)
B) (0, 639)
C) (0, 479)
D) (479, 0)
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
19
To animate a node with the ScaleTransition class, you specify starting and ending __________.

A) sizes
B) colors
C) angles
D) scale factors
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
20
Which of the following creates a blue circle centered at X = 50, Y = 50 with a radius of 50?

A) Circle blueCircle = new Circle(50, 50, 50);
BlueCircle.setFill(Color.BLUE);
B) Circle blueCircle = new Circle(50, 50);
BlueCircle.setStroke(Color.BLUE);
C) Circle blueCircle = new Circle(50, 50, 50, Color.BLUE);
D) Circle blueCircle = new blueCircle(50);
BlueCircle.setColor(BLUE);
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
21
Select all that apply. Which of the following are possible states of a MediaPlayer object?

A) READY
B) PLAYING
C) PAUSED
D) STOPPED
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
22
What does the following code snippet do? Circle myCircle = new Circle(50, 50, 25);
TranslateTransition rtrans =
New TranslateTransition(new Duration(5000), myCircle);

A) It creates a circle with center point (50, 25), radius = 50, and duration = 5000 seconds.
B) It creates a circle with center point (50, 50), radius = 25, and duration = 5 seconds.
C) It creates a circle with center point (25, 50), radius = 25, and duration = 5 seconds.
D) It creates a circle with center point (50, 25), radius = 50, and duration = 50 seconds.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
23
Which of the following is a subclass of Node?

A) Media
B) MediaPlayer
C) Both of these
D) Neither of these
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
24
Select all that apply. Which of the following are transition classes?

A) FadeTransition
B) StrokeTransition
C) RotateTransition
D) RunTransition
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
25
Select all that apply. Which of the following are subclasses of the Animation class and the Transition class?

A) StrokeTransition
B) TextFillTransition
C) ReverseTransition
D) ScaleTransition
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
26
Select all that apply. Which of the following are key events?

A) when a user rolls a mouse over the monitor
B) when a user presses a key
C) when a user presses and releases a key that produces a Unicode character
D) when a user releases a key
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
27
Select all that apply. Which of the following are special effects that can be applied to nodes in a scene graph?

A) a shadow appears behind a node
B) a glow appears
C) a shadow appears inside the edges of a node
D) an image has a sepia tone appearance
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
28
Any time a user presses a key, a __________ event occurs.

A) KEY_TYPED
B) KEY_PRESSED
C) KEY_RELEASED
D) KEY_EVENT
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
29
All the transition classes inherit a method named __________ which allows you to specify how the animation begins and ends.

A) setFromTo
B) setInterpolator
C) setInterpreter
D) setStartEnd
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
30
Which mouse event occurs when the user presses and releases the mouse button?

A) MOUSE_PRESSED
B) MOUSE_RELEASED
C) MOUSE_CLICKED
D) MOUSE_DRAGGED
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
31
Which transition class causes a node to become larger or smaller?

A) FillTransition
B) SizeTransition
C) ScaleTransition
D) TranslateTransition
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
32
Select all that apply. Which of the following are constructors of the Rectangle class?

A) Rectangle(width, height, stroke)
B) Rectangle(width, height)
C) Rectangle(X, Y, width, height)
D) Rectangle(width, height, fill)
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
33
What does the following code snippet do when the animation is played, given that imageView has been created? FadeTransition ftrans = new FadeTransition
(new Duration(5000), imageView);
Ftrans.setFromValue(1.0);
Ftrans.setToValue(0.5);
Ftrans.play():

A) The image will be completely opaque when displayed and will decrease to 50% opacity over the five seconds of the animation.
B) The image will be completely invisible when displayed and will increase to 50% opacity over the five seconds of the animation.
C) The image will be completely opaque when displayed and will increase to 50% opacity over the five minutes of the animation.
D) The image will be 50% opaque when displayed and will increase to 100% over the five seconds of the animation.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
34
Select all that apply. Which of the following are mouse event types?

A) MOUSE_CLICKED
B) MOUSE_MOVED
C) MOUSE_LIFTED
D) MOUSE_PRESSED
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
35
Select all that apply. Which of the following classes are used to play videos?

A) MediaView
B) Media
C) MediaPlayer
D) VideoPlayer
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
36
Which of the following code snippets creates a Line and uses a RotateTransition object to animate it for seven seconds?

A) Line myLine = new Line(25, 50, 100, 50);
RotateTransition rtrans =
New RotateTransition(new Duration(7000), myLine);
B) Line myLine = new Line(25, 50, 100, 50);
RotateTransition rtrans =
New RotateTransition(new Duration(7), myLine);
C) Line myLine = new Line(25, 50, 100, 50);
RotateTransition rtrans =
New Duration(7000), myLine;
D) Line myLine = new Line(25, 50);
RotateTransition rtrans =
New RotateTransition(new Duration(7000), Line);
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
37
Which of the following statements draws the string "Love to animate!" starting at coordinates (200, 50)?

A) Text myText = new myText(200, 50, "Love to animate!");
B) Text myText = new Text(50.0, 200.0, "Love to animate!");
C) Text myWords = new Text(200.0, 50.0, "Love to animate!");
D) Text Words = new Words(200, 50, "Love to animate!");
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
38
To combine several effects, use the Effect class's __________ method.

A) setInput
B) combineEffect
C) addEffect
D) Effects cannot be combined.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
39
Select all that apply. Which of the following classes are used to play an audio file?

A) MediaView
B) Media
C) MediaPlayer
D) AudioPlayer
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
40
Select all that apply. Which of the following will cause a counterclockwise rotation of a RotateTransition object, rtrans?

A) rtrans.setFromAngle(60.0);
Rtrans.setByAngle(15.0);
B) rtrans.setFromAngle(-60.0);
Rtrans.setByAngle(15.0);
C) rtrans.setFromAngle(60.0);
Rtrans.setByAngle(-15.0);
D) rtrans.setAngle(60.0, 15.0);
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 40 flashcards in this deck.