Chapter 4 PDF Flashcards

1
Q

What does JavaFX use

A

JavaFX uses a mixed performance/art metaphor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How is graphical output created in Java FX

A

We start with a window and then slowly add one or more scenes. To produce graphical output, we add a canvas to our scene and draw shapes and text on the canvas

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When our Java FX application begins what occurs

A

When our application begin, the window opens and displays whatever we have drawn onto the canvas

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the purpose of the Canvas class in JavaFX

A

The Canvas class provides an area on which we can draw shapes and text

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the function of the GraphicsContext class

A

The GraphicsContext class provides methods to draw shapes and text on the Canvas and to set the current color

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are some practical applications of the graphicsContext class Methods

A

The methods are available for drawing lines, rectangles, ovals and other shapes as well as displaying text and setting colors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is special about the GraphicsContext methods

A

They have a void return type so the method calls are standalone statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Give an example of the Stroke method in Java FX

A

The stroke method draws an outlined shape in the current stroke color

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Give an example of the fill method in Java FX

A

The fill method draws a solid shape in the current fill color

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the default background color for GraphicsContext method

A

The default background color is white

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does the color class define color

A

The color class defines colors using the RGB system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are all RGB colors composed of

A

All RBG color is composed of red, green,blue components. Each components value can range from 0 to 255 (00 to FF in hexadecimal)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the relation between the number value and the concentration of that component in the color

A

The higher the value, the higher the concentration of that component in the color

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How would you write the color white in hexadecimal

A

(FF,FF,FF)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the color black in hexadecimal

A

(00,00,00)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How would you define grey in hexadecimal

A

Grey consists of equal amounts of each component.

17
Q

How would you know if a grey is a light color (shade?) of grey

A

The higher the value of the components, the lighter the color of grey

18
Q

How would you know if a grey is a dark color (shade?) of grey

A

The closer the grey value gets to 00 (approaching black), the darker the color of grey

19
Q

How would you draw a square in JavaFX

A

To draw a square in Java FX, use strokeRect or fillRect with equal values for width and height

20
Q

How would you draw a circle in JavaFX

A

To draw a circle, use strokeOval or fillOval with equal values for width and height