Lab Assignment 9 -- Demo and Writeup Due 6 p.m. Nov. 13 in the lab session
CS 5551, Fall Semester, 2006
15 Points
Topics: Toolbars, Actions, Icons

Reference: Chapter 7 (Toolbars), and Chapter 9 (Actions and Icons)

The assignment: Modify the program of the previous assignment to:
(1) have a toolbar that allows the user to select a shape to draw,
(2) define Actions that allow the user to select a shape to draw - an oval (axis-aligned ellipse) or rectangle, filled or unfilled, and
(3) use your own oval and rectangle icons on the toolbar.
The interface should look something like:

+------------------------------------------------------+
| File  Shape  Color                              Help |
+-------+----------------------------------------------+
|+-----+|                                              |
|| +-+ ||                                              |
|| | | ||                                              |
|| +-+ ||                                              |
||     ||                                              |
|+-----+|      < blank area for drawing >              |
|+-----+|                                              |
||  _  ||                                              |
|| / \ ||                                              |
|| \_/ ||                                              |
||     ||                                              |
|+-----+|                                              |
+-------+----------------------------------------------+
Where the figure on the left is supposed to be a toolbar with a rectangle icon on the top button and an oval icon on the bottom button.

Discussion: some useful code is in the ActionDemo program, which illustrates both Actions and the use of a toolbar. Here is the ActionDemo program file. Note that if you want to compile and use this program with the arrow icons, you also need to download the jlfgr-1_0.jar file. A zipped version of it can be downloaded from the Java look and feel Graphics Repositor. Of course it needs to be unzipped and put in the jars subdirectory where ActionDemo program file is.

As mentioned in class, there are (at least) two ways to make your own icon:

What to turn in: Turn in the following items from the Computer Science Lab Report Format:
1. (1 point) The Basic Information (your name, class, section, TA's name, assignment number, and date) can be on a separate cover sheet or as (highlighted) comments at the top of your main program file.
11. (5 points) Include the program listings. This listing should show good style, be appropriately commented, have the important/new parts highlighted, and include handwritten explanations if it helps the reader's understanding of the code.
13./14. (9 points) Do a demo of your modified program for the TA that demonstrates that the program works correctly.


Page URL: http://www.d.umn.edu /~ddunham/cs5551f06/assignments/lab9/assignment.html
Page Author: Doug Dunham
Last Modified: Thursday, 02-Nov-2006 17:59:29 CST
Comments to: ddunham@d.umn.edu