Instructions: Answer as many of the following questions as you can during the lab period. If you are unable to complete the assignment during the lab period it is strongly recommended that you complete it on your own.
Getting Ready: Before going any further, you should:
BuzzyDriver.java
BuzzyWindow.java
BuzzyWindow?
setupLayout()
method in the BuzzyWindow class?
setupWindow()
method in the BuzzyWindow class?
BuzzyComponent.java
BuzzyComponent?
BuzzyDriver
paint() method,
send the setStroke(STROKE) message to g2.
(i.e., call the setStroke() method of
g2 passing it STROKE).
BuzzyDriver
paint() method, send a message
to g2 that instructs it to use GOLD paint
(i.e., send the setPaint(GOLD) message to g2).
paint() method, send a message
to g2 that instructs it to fill the HELMET
object.
BuzzyDriver
paint() method, send a message
to g2 that instructs it to stroke the HELMET
object.
draw() method, send a message
to g2 that instructs it to set the color
to Color.BLACK.
BuzzyDriver
visor to be
an Arc2D.Float object with the parameters
(40,25,35,30,315,90,Arc2D.PIE).
paint() method, send messages
to g2 that instruct it to set the color to gray,
fill the visor, set the color to black, and draw the visor.
BuzzyDriver
GeneralPath class instead of the Path2D.Float
class.
body
object instructing it to "move the pen to" the point (20,50).
That is, send the moveTo(20,50) message to
body.
body
object instructing it to "draw a line to" the point (20,70).
body
object instructing it to "draw a line to" the points (20,90),
(10,90), (10,100), (80,100), (80,90), (40,90), (40,70),
and (40,50).
body
object instructing it to "close the path".
paint() method, send messages
to g2 that instruct it to set the color to purple,
fill the body, set the color to black, and draw the body.
BuzzyDriver
antenna to be
a QuadCurve2D.Float object with the parameters
(10,0,40,10,30,25).
paint() method that draws the antenna
in black "underneath" (i.e., visually underneath) the helmet.
paint() method, check to see if
the Image object named mars
is null, and if it isn't,
send the drawImage(mars, 100, 100, null) to g2.
BuzzyDriver.
drawImage() so that the upper-left
corner of the image is rendered at (0,0).
paint() method,
instruct the g2 object to draw the String
literal "JMU" at the location (20,40). (Note: The String
should be drawn in black.)
drawString(),
set the font used by g2 to the object named
SLANTED.
BuzzyDriver.
Copyright 2011