|
Description:
The team needs to write a Java applet to display a splash screen
for a future project. You need to specify the applet dimensions
at
width=550 and height=350. The applet needs to
be similar to the provided sample below. It will employ the
following graphics functions:
- drawLine (to create
lines in the lower left hand corner to go across the background.
Theses lines are orange and are 50 pixels apart)
-
drawRoundRect
(for the box around "Java Programming - CIS 226")
-
drawString (for
"Java Programming - CIS 226". Notice there are
two strings drawn on the screen, a yellow one and a black
one. The strings use font, "SansSerif", BOLD,
at 24 pt)
-
fillPolygon (for the triangles that are drawn across
the middle of the splash screen. One should be blue and
the other should be yellow) -- This is extra credit. To
do this we use the translate() method from the polygon
class. Covers advanced topics we have not discussed yet
(Designed to give advanced students a challenging assignment)
-
fillOval (for
the smiley face which is 100 pixels in diameter; the eyes
and nose which are 10 pixels in diameter)
-
drawArc (for
the smile in the smiley face)
-
You will need
the following code to create the gradient background:
Graphics2D
g2d = ( Graphics2D ) g;
g2d.setPaint(new GradientPaint(0, 0, Color.blue, 35, 100, new Color(216, 164, 0), true));
g2d.fill(new Rectangle2D.Double(0, 0, 550, 350));

Things you don't
have to really worry about are:
- The exact color (including background color).
- The exact on screen location for each shape - as long as it
looks similar to the example and it is readable, it is acceptable.
Hint: For
speed, you may want to break the project down to each member
in the team. Perhaps, one to do the coordination work, one to
do the coding, and one to look up sample code in the book.
Class Diagram:

Notes:
* Since you are competing for speed, if your team finishes the
work in-class, I will NOT read your source code (this is
to your advantage). If you turn the project in after today,
I will expect the normal rules to applied to your homework (source
code will be graded accordingly).
* If you miss the class, you can complete
this homework by yourself and turn it in the usual way. However,
I can only give you a maximum of 90% points only.
* Make sure you have all team members name on
ONE print out before submission.
Objectives:
* Be familiar with the environment in the lab to prepare for
the test.
* Understand sequential execution in programming.
* Be familiar with reference data type (object).
* Be familiar with graphics object (Graphics and Graphics2D).
* Have fun working groups and learn from one another.
|