CSE 115 - Spring 2007 - Banner
   CSE 115 - Spring 2007 - Introduction to Computer Science for Majors I
CSE 115 - Spring 2007 - Left Navigation CSE 115 - Spring 2007 - Lab 5

Lab 5

Introduction

We have now seen the association relationship in our examples. We have been using many graphical user interface tools to help us allow the user to manipulate our programs. In this lab, we will pull the hood off of some of the graphical issues by allowing you for the first time to design the look and feel of your program and allowing you to decide how the program will behave.


Objectives

The high-level objectives of this lab are to have you,
  • express the association relationship in code (i.e. you will write a class which knows another class)
  • place graphical components that you created on an Applet
  • design the functionality of a graphical widget on your own
  • use the graphics.DrawingCanvas and well as containers.Row and/or containers.Column to help create your program
The following are the new concepts covered in this lab:
  • assocation
  • graphical containment
  • creating action listeners of your own design

Assignment Specifications

You will create a program that has a drawing canvas on it. On this drawing canvas will appear an instance of the lab5lib.TripleShape. You will create two widgets to control the graphic in some way. You can create any two widgets you like from the following list, but you must create two distinct widgets. Each widget must also do a distinctly different thing with the graphic. You can not simply create two different widgets that do the same thing. You can look at the Javadocs for the lab5lib.TripleShape to see what types of things are available for you to do with the graphical object.

  • JButton
  • JCheckBox
  • JColorChooser
  • JComboBox
  • JList
  • JRadioButton
  • JSlider
  • JSpinner
  • JToggleButton
  • JMenu & JMenuBar & JMenuItem/JComboBoxMenuItem/JRadioButtonMenuItem
    • These all count as one componen

 

Helpful Hints

Read through the entire lab before you start working, so that you know what to expect. Make sure you save your work often, and keep track of what you are expected to submit.

Do not be afraid to refer to earlier labs to recall what things mean or what commands are available for you to use.


Reading

Make sure you have read to the end of chapter 4 before coming to lab. Also make sure you have reviewed your lecture notes.


Lab set-up tasks (If you are working at home see these directions for this lab)

At your lab session your teaching assistant will briefly discuss how to carry out each of the set-up tasks below. She or he will also be available to answer questions you might have. Before you start work on the lab itself, you must carry out each of the following set-up tasks. Your teaching assistant will guide you through this process. Refer back to other lab assignments if you do not remember how to complete these tasks.

Step 1: Log in

Step 2: Start Eclipse

Step 3: Check out Lab5 project from LabSkeletons repository

Step 4: Do the required lab work (instructions below)

Step 5: When finished, export your project and submit it (instructions below)


Lab Design

Once again, the TAs will help you to develop the appropriate class diagram for this assignment in recitation. Your submitted lab must implement the UML class diagram discussed in recitation. When running this lab, you must create a run configuration that will work for the size of your Applet. You are in control of the size for this project, so you will need to determine what size will work best for you. If you do not remember how to change your run configuration, refer back to previous labs.

You should be sure to check out all of the Javadocs for the Classlibs.jar, located here.

Build up the Code Incrementally

As we have said in the last several labs, it is important to build your code in small stages until you get to the finished product.  This is even more important now that your labwork is becoming a bit more substantial. You should write the part of the code so that Applet uses a Lab5Program first, then run it. Next, create the DrawingCanvas, and add it to the Lab5Program. Fix any syntax errors that exist. Once the syntax errors are fixed, run your code to make sure it functions correctly. Continue in this manner (add a little bit of code, run it and test it) until you have completed the required lab tasks.


What you hand in

When you are finished, you need to export your solution from the Eclipse environment so that you can submit it. You need to follow the same steps as you did for disconnecting from the repository in Lab 2 . If you are not sure how to do this, please refer back to those instructions. This time, you should name your Jar file Lab5.jar. This Jar file should contain all of your Java source code files as well as your UML diagram for your solution for this lab.

Starting with this submission, failure to submit your Java source code files will result in an automatic grade of 0 on the lab assignment. There were instructions for how to do this in Lab 2 - make sure you follow them. It is as simple as making sure the proper checkbox is selected, so make sure you do that. Also, labs that do not compile will be given an automatic grade of 20 starting with this lab - make sure your lab compiles!

Then you can submit the Lab5.jar file using the electronic submission program. If you do not remember how to use the the submission program, refer back to earlier labs.


Due dates

You have one week from the meeting of your lab to submit your solution.  The due dates are summarized in the table below. You are always welcome to submit early. If you submit more than once, the later submission will simply overwrite the previous one.

To check that your lab was submitted, you can always refer back to the Submit Inspector on the Resources page of the website. After you have entered your user name, your submissions will be shown. Clicking on the name of a file that is a zip file will show you the contents of the zip file so you can verify that you indeed zipped up all the correct files.

Date of lab Due date for electronic submission
Tuesday, February 20 Monday, February 26
Wednesday, February 21 Tuesday, February 27
Thursday, Feburary 22 Wednesday, February 28
Friday, February 23 Thursday, March 1

 

CSE 115 - Spring 2007 - Footer

 

 
Last modified: Thu Feb 15 15:52:12 2007
© Adrienne Decker