Deck 13: Java-Fx: Graphics, Effects, and Media
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/40
Play
Full screen (f)
Deck 13: Java-Fx: Graphics, Effects, and Media
1
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;
A) import.javafx.scene.Paint.color;
B) import.javafx.scene.paint.Color;
C) import.javafx.paint.color;
D) import.javafx.scene.Color;
B
2
The setInterpolator method allows you to specify how a transition begins and ends.
True
3
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)
A) (639, 0)
B) (0, 639)
C) (0, 479)
D) (479, 0)
C
4
Which effect class do you use to increase an image's brightness?
A) Glow
B) Reflection
C) ColorAdjust
D) SepiaTone
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
5
Which class is used to move a node from one position on the screen to another?
A) AnimationTransition
B) MoveTransition
C) RotateTransition
D) TranslateTransition
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
6
Which class specifies the amount of time an animation should last?
A) Time
B) Clock
C) Duration
D) TimeSpan
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
7
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
8
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
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
9
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
10
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
11
The FillTransition class works only with objects of the Shape class or one of its subclasses.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
12
To create a circle, you need to specify only the X and Y coordinates of the center point.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
13
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);
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
14
Which class creates an animation in which a node rotates?
A) Rotate
B) RotateTransition
C) NodeRotation
D) NodeRotate
A) Rotate
B) RotateTransition
C) NodeRotation
D) NodeRotate
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
15
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
16
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
17
The following statement will draw the string "Welcome!" starting at the top left corner of the screen.
Text welcomeText = new Text(0, 0, "Welcome!");
Text welcomeText = new Text(0, 0, "Welcome!");
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
18
To animate a node with the ScaleTransition class, you specify starting and ending
A) sizes
B) colors
C) angles
D) scale factors
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
19
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
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
20
The Rotate class creates a rotating animation.
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 classes are used to play videos?
A) MediaView
B) Media
C) MediaPlayer
D) VideoPlayer
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
22
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
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
23
Which transition class causes a node to become larger or smaller?
A) FillTransition
B) SizeTransition
C) ScaleTransition
D) TranslateTransition
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
24
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!");
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
25
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.
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
26
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 decrease 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.
(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 decrease 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
27
Select all that apply. Which of the following are possible states of a MediaPlayer object?
A) READY
B) PLAYING
C) PAUSED
D) STOPPED
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
28
To combine several effects, use the Effect class's __________ method.
A) setInput
B) combineEffect
C) addEffect
D) None of these; you cannot combine effects.
A) setInput
B) combineEffect
C) addEffect
D) None of these; you cannot combine effects.
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
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
Any time a user presses a key, a __________ event occurs.
A) KEY_TYPED
B) KEY_PRESSED
C) KEY_RELEASED
D) KEY_EVENT
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
31
Select all that apply. Which of the following classes are used to play an audio file?
A) MediaView
B) Media
C) MediaPlayer
D) AudioPlayer
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
32
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
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
33
Which of the following is a subclass of Node?
A) Media
B) MediaPlayer
C) Both of these
D) Neither of these
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
34
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)
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
35
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);
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
36
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
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
37
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
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
38
Select all that apply. Which of the following are mouse event types?
A) MOUSE_CLICKED
B) MOUSE_MOVED
C) MOUSE_LIFTED
D) MOUSE_PRESSED
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
39
Select all that apply. Which of the following are transition classes?
A) FadeTransition
B) StrokeTransition
C) RotateTransition
D) RunTransition
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
40
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);
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