Deck 13: Graphics and Java 2D

ملء الشاشة (f)
exit full mode
سؤال
Which of the following statements is false?

A) A BufferedImage object uses the image stored in its associated TexturePaint object as the fill texture for a filled-in shape.
B) Class BufferedImage can be used to produce images in color and gray scale.
C) Class GradientPath draws a shape in a gradually changing color.
D) All of the above are true.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Method getFont of class Graphics returns ________.

A) the current font name as a string
B) the font size in points
C) a Graphics object representing the current font
D) a Font object representing the current font
سؤال
Which of the following properly create and initialize a Font object?
A) Font f = new Font();
B) Font f = new Font("Serif", Font.Bold + Font.Italic, 19);
C) Font f = new Font(Font.Bold, 20, "SansSerif");
D) Font f = new Font(20, Font.Bold, "Monospaced");

A) A and B.
B) B and C.
C) B.
D) D.
سؤال
In the Java coordinate system, the point (0, 0) is ________.

A) The lower-right corner of the screen.
B) The upper-right corner of the screen.
C) The lower-left corner of the screen.
D) The upper-left corner of the screen.
سؤال
Consider the Java code segment below:
Polygon poly2 = new Polygon();
Poly2.addPoint(100, 30);
Poly2.addPoint(100, 130);
Which of the following will create a polygon that is a square?

A) poly2.addPoint(100, 60); poly2.addPoint(100, 130);
B) poly2.addPoint(200, 130); poly2.addPoint(200, 30);
C) poly2.addPoint(200, 60); poly2.addPoint(200, 130);
D) poly2.addPoint(100, 130); poly2.addPoint(100, 230);
سؤال
The Java statement:

A) draws a rectangle that appears to be raised (the top and left edges of the rectangle are slightly darker than the rectangle).
B) draws a rectangle that appears to be lowered (the bottom and right edges of the rectangle are slightly darker than the rectangle).
C) draws a rectangle that appears to be raised (the bottom and right edges of the rectangle are slightly darker than the rectangle).
D) draws a rectangle that appears to be lowered (the top and left edges of the rectangle are slightly darker than the rectangle).
G)draw3DRect(290, 100, 90, 55, true);
سؤال
Which of the following statements about the Graphics object is true?
A) The Graphics object is an argument to class Component's repaint method.
B) The Graphics object is instantiated by the user.
C) The Graphics object is the argument to a lightweight GUI component's paintComponent method.
D) The Graphics class is abstract.
E) The Graphics object manages a graphics context.

A) A, C, E.
B) C, D, E.
C) A, B, D, E.
D) All are true.
سؤال
A general path is ________.

A) a set of polylines that do not result in a closed shape
B) a shape constructed from straight lines and complex curves
C) the shape of the curve in a font's characters
D) represented by an object of class GraphicsPath
سؤال
The Java statement:

A) Draws a filled oval with its center at coordinates x=290, y=100, with height=90 and width=55.
B) Draws a filled oval with its leftmost point at coordinates x=290, y=100, with height=90 and width=55.
C) Draws a filled oval bounded by a rectangle with its upper-left corner at coordinates x=290, y=100, with width=90 and height=55.
D) Draws a filled oval bounded by a rectangle with its upper-left corner at coordinates x=290, y=100, with height=90 and width=55.
G)fillOval(290, 100, 90, 55);
سؤال
Which of the following statements about arcs is false?

A) An arc is drawn as a part of an oval.
B) Arcs sweep from a starting angle the number of degrees specified by their arc angle.
C) Arcs that sweep clockwise are measured in positive degrees.
D) None of the above statements are false.
سؤال
Consider the code segment below:
Int xValues[] = {100, 150, 200, 100};
Int yValues[] = {30, 130, 30, 30};

A) A rectangle.
B) A triangle.
C) A V with its corner at the top.
D) A square.
G)drawPolyline(xValues, yValues, 4); What kind of figure does it draw?
سؤال
The fact that class Graphics is abstract contributes to Java's portability because ________.

A) drawing is performed differently on every platform that supports Java. A subclass of Graphics must be created that uses the drawing capabilities of the current platform.
B) objects of non-abstract classes can only be instantiated on the Windows platform.
C) drawing should not be performed on non-Linux platforms.
D) Class Graphics is not abstract.
سؤال
Which of the following statements about the Java 2D API is true?

A) A Graphics2D object is instantiated to draw Java 2D figures.
B) Class Graphics2D is a subclass of class Graphics.
C) To access Graphics2D capabilities, cast the Graphics reference passed to paintComponent to a Graphics2D reference.
D) All of the above are true.
سؤال
GeneralPath method lineTo ________.

A) draws a line from the previous point in the GeneralPath object to the current point
B) draws a line with an arrow head to point to a GeneralPath object
C) moves the drawing origin around a line
D) specifies the first point in a GeneralPath object
سؤال
Class FontMetrics declares methods that can be used to obtain the following font metrics ________.

A) ascent, descent and height
B) ascent, descent and leading
C) height and leading
D) All of the above.
سؤال
The Graphics2D method(s) that determine(s) the color and texture for the shape to display is/are:

A) setStroke
B) setPaint
C) setTexture and setColor
D) setTexturePaint
سؤال
The JColorChooser dialog allows colors to be chosen by all but which of the following?

A) Swatches.
B) Hue, saturation, brightness.
C) Gradient, cycle, brightness.
D) Red, Green, Blue.
سؤال
Which of the following are valid Java statements?
A) Color c = new Color(0, 255, 0);
B) Color c = new Color(0.0f, 1.0f, 0.0f);
C) Color c = new Color(0.0d, 1.0d, 0.0d);
D) setGreen;

A) All of the above.
B) A, B, C.
C) A, B, D.
D) A, B.
سؤال
Which of the following is correct for font metrics?

A) height = descent + ascent + leading.
B) The amount the character dips below the baseline is the ascent.
C) The amount the character can be above the baseline is the leading.
D) The amount the character rises above the baseline is the descent.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/19
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 13: Graphics and Java 2D
1
Which of the following statements is false?

A) A BufferedImage object uses the image stored in its associated TexturePaint object as the fill texture for a filled-in shape.
B) Class BufferedImage can be used to produce images in color and gray scale.
C) Class GradientPath draws a shape in a gradually changing color.
D) All of the above are true.
A
2
Method getFont of class Graphics returns ________.

A) the current font name as a string
B) the font size in points
C) a Graphics object representing the current font
D) a Font object representing the current font
D
3
Which of the following properly create and initialize a Font object?
A) Font f = new Font();
B) Font f = new Font("Serif", Font.Bold + Font.Italic, 19);
C) Font f = new Font(Font.Bold, 20, "SansSerif");
D) Font f = new Font(20, Font.Bold, "Monospaced");

A) A and B.
B) B and C.
C) B.
D) D.
C
4
In the Java coordinate system, the point (0, 0) is ________.

A) The lower-right corner of the screen.
B) The upper-right corner of the screen.
C) The lower-left corner of the screen.
D) The upper-left corner of the screen.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
5
Consider the Java code segment below:
Polygon poly2 = new Polygon();
Poly2.addPoint(100, 30);
Poly2.addPoint(100, 130);
Which of the following will create a polygon that is a square?

A) poly2.addPoint(100, 60); poly2.addPoint(100, 130);
B) poly2.addPoint(200, 130); poly2.addPoint(200, 30);
C) poly2.addPoint(200, 60); poly2.addPoint(200, 130);
D) poly2.addPoint(100, 130); poly2.addPoint(100, 230);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
6
The Java statement:

A) draws a rectangle that appears to be raised (the top and left edges of the rectangle are slightly darker than the rectangle).
B) draws a rectangle that appears to be lowered (the bottom and right edges of the rectangle are slightly darker than the rectangle).
C) draws a rectangle that appears to be raised (the bottom and right edges of the rectangle are slightly darker than the rectangle).
D) draws a rectangle that appears to be lowered (the top and left edges of the rectangle are slightly darker than the rectangle).
G)draw3DRect(290, 100, 90, 55, true);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which of the following statements about the Graphics object is true?
A) The Graphics object is an argument to class Component's repaint method.
B) The Graphics object is instantiated by the user.
C) The Graphics object is the argument to a lightweight GUI component's paintComponent method.
D) The Graphics class is abstract.
E) The Graphics object manages a graphics context.

A) A, C, E.
B) C, D, E.
C) A, B, D, E.
D) All are true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
8
A general path is ________.

A) a set of polylines that do not result in a closed shape
B) a shape constructed from straight lines and complex curves
C) the shape of the curve in a font's characters
D) represented by an object of class GraphicsPath
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
9
The Java statement:

A) Draws a filled oval with its center at coordinates x=290, y=100, with height=90 and width=55.
B) Draws a filled oval with its leftmost point at coordinates x=290, y=100, with height=90 and width=55.
C) Draws a filled oval bounded by a rectangle with its upper-left corner at coordinates x=290, y=100, with width=90 and height=55.
D) Draws a filled oval bounded by a rectangle with its upper-left corner at coordinates x=290, y=100, with height=90 and width=55.
G)fillOval(290, 100, 90, 55);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
10
Which of the following statements about arcs is false?

A) An arc is drawn as a part of an oval.
B) Arcs sweep from a starting angle the number of degrees specified by their arc angle.
C) Arcs that sweep clockwise are measured in positive degrees.
D) None of the above statements are false.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
11
Consider the code segment below:
Int xValues[] = {100, 150, 200, 100};
Int yValues[] = {30, 130, 30, 30};

A) A rectangle.
B) A triangle.
C) A V with its corner at the top.
D) A square.
G)drawPolyline(xValues, yValues, 4); What kind of figure does it draw?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
12
The fact that class Graphics is abstract contributes to Java's portability because ________.

A) drawing is performed differently on every platform that supports Java. A subclass of Graphics must be created that uses the drawing capabilities of the current platform.
B) objects of non-abstract classes can only be instantiated on the Windows platform.
C) drawing should not be performed on non-Linux platforms.
D) Class Graphics is not abstract.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
13
Which of the following statements about the Java 2D API is true?

A) A Graphics2D object is instantiated to draw Java 2D figures.
B) Class Graphics2D is a subclass of class Graphics.
C) To access Graphics2D capabilities, cast the Graphics reference passed to paintComponent to a Graphics2D reference.
D) All of the above are true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
14
GeneralPath method lineTo ________.

A) draws a line from the previous point in the GeneralPath object to the current point
B) draws a line with an arrow head to point to a GeneralPath object
C) moves the drawing origin around a line
D) specifies the first point in a GeneralPath object
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
15
Class FontMetrics declares methods that can be used to obtain the following font metrics ________.

A) ascent, descent and height
B) ascent, descent and leading
C) height and leading
D) All of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
16
The Graphics2D method(s) that determine(s) the color and texture for the shape to display is/are:

A) setStroke
B) setPaint
C) setTexture and setColor
D) setTexturePaint
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
17
The JColorChooser dialog allows colors to be chosen by all but which of the following?

A) Swatches.
B) Hue, saturation, brightness.
C) Gradient, cycle, brightness.
D) Red, Green, Blue.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
18
Which of the following are valid Java statements?
A) Color c = new Color(0, 255, 0);
B) Color c = new Color(0.0f, 1.0f, 0.0f);
C) Color c = new Color(0.0d, 1.0d, 0.0d);
D) setGreen;

A) All of the above.
B) A, B, C.
C) A, B, D.
D) A, B.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
19
Which of the following is correct for font metrics?

A) height = descent + ascent + leading.
B) The amount the character dips below the baseline is the ascent.
C) The amount the character can be above the baseline is the leading.
D) The amount the character rises above the baseline is the descent.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 19 في هذه المجموعة.