Lab 7

Introduction

Congratulations! If you're reading this, it means you've decided to stick it out to the very end. You've survived audiences, swimming fish and more bouncing shapes than anyone cares to count. Up until now, we've told you what to do -- but times they are a changin'. It's time for you the CSE115 students to stand up and be counted. To say, "We are sick of the monarchy! We are tired of having projects that all look the same! We are not just numbers! NO! We are programmers!" Rise up little programmers and read on...


Extra Credit

To encourage you to be creative we are holding a contest for lab 7 submissions. The grand prize is 10 points extra credit (up to a maximum of 100 total points) on your exam average!

There are 2 categories: 1) Overall best GUI and 2) Most creative. For the most creative category, you must write a creative story about your GUI, include it as story.txt in the zip file you submit.

Second place contestants will receive 8 points extra credit while third place gets 5 points extra credit on their exam average.

The competition is open across all sections of the course.

To compete in this competition, you should decide whether you want to be in the creative competition or the technical competition, and complete your Lab 7 program.

After the labs are graded, those submissions that have successfully completed all the requirements of the lab will be eligible to be judged.

To be judged, you will be required to present your program and its technical or creative merit in front of the Spring 2006 contest judging panel. A sign-up sheet for presentations will be available - tentative date is Friday, April 21st for presentations.

Good luck to all!


New Concepts Covered

The following are the new concepts covered in this lab.


Assignment Specification

Here's your chance to be creative. The assignment specification is simple: create a "kick ass" graphical user interface that accomplishes some minor task. Use your imagination, artistic ability, and programming skill to make something that wows your friends and the TAs. Think moving shapes, changing colors, and 3-D rotating fractal landscapes. We've shown you how to create color changing and crazily swimming fish. What will you make?

To provide some direction we require the following elements:

By creating a GUI we hope that you will get a solid grasp of NGP. Use your creativity!


Helpful Hints

Make sure to do the reading listed below. Don't hesitate to also examine the CSE115.FishBowl code in the Classlibs.jar file.

Read the Classes' Public Interfaces section below.

Before coding, you should draw a picture of what you want your GUI to look like. From this, determine which graphical components you will need and which graphical containers you will need to format them. Also, you should draw yourself a class hierarchy diagram to understand which objects have to communicate and in what way. If you know exactly what you are doing before you start coding, you should have no problem writing it.


Preparatory work

In order to be able to carry out the tasks required during your lab session, you must come prepared. Do the following before coming to your lab session:

Reading

Review the NGP code (and class notes) that were discussed in class.


Lab tasks

At your lab session your teaching assistant will briefly discuss how to carry out each of the tasks below. She or he will also be available to answer questions you might have. You must carry out each of the following tasks.

Create a new project in Eclipse

This time, there's no skeleton. You must create your own project from scratch. Here are the steps you need to follow:

  1. You're going to be developing your code in a project called "Lab7." To create a new Java project in Eclipse, under the File menu, select New -> Project.
  2. Select "Java Project" and click Next. Name your project "Lab7." If you see that the Java compiler being used is 1.4 in the "JDK Compliance" section, click the "Use a project specific compliance" button and select "5.0" from the dropdown menu. Then click Finish. You will see the new project pop up in the Package Explorer.




  3. Now right click on the project, and select New -> Package.
  4. Name the package "lab7." Then click Finish. All of your work will be in the lab7 package.



    Congratulations: your project, along with a new package, is officially created! But, in order for you to use CSE115-specific libraries, such as the CSE115 and NGP packages, you must explicitly tell your project to include them. Steps 5-8 will explain this process.

  5. Right-click on your project folder and select "Properties."
  6. In the left pane of the "Properties for Lab7" window, select "Java Build Path."
  7. In the right pane of the "Properties for Lab7" window, click the "Libraries" tab.
  8. Click "Add External JARs..." This is where the magic happens. Navigate to /projects/CSE115/Classlibs/Spring2006/ in the JAR Selection dialog and double click Classlibs.jar. Click OK on the Properties window. You're done!

Note if you complete this process at home: If you want your project to work on coldplay (so it gets graded), you will need to do the following:

  1. Select File->Open File
  2. When the file dialog box appears, navigate into your workspace and find a file in your Lab7 project named .classpath. Open this file.
  3. Inside the file, look for the line that says: <classpathentry kind="lib" path="C:\projects\CSE115\Classlibs\Spring2006\Classlibs.jar"/> and delete the "C:" from it. If your default drive is E: or F:, you will see those and should delete them all the same.
  4. Save the .classpath file and close it.

Lab Design

Once again you are required to design your solution to the lab. Create a file called Lab7.dia in the Lab7 project and submit it with your project's jar file.

Use your picture of your GUI and the Classes' Public Interfaces to decide what has been written and what you need to create.

Once again, remember to design and code iteratively.


Skeleton Classes

This is a listing of the classes that you need to fill in for this assignment.


Name:
App

Purpose:
This class models an application. When you write your program you should fill in this class so that it contains all objects that you want created when the program starts.

Methods:
App();
Constructs the application.
void main(String[] args);
The entry point of the program. Main is the first thing run for the application.


Classes' Public Interfaces

Really

the only stuff you need to read are the NGP Javadocs. You may also want to check out the CSE115 JavaDocs, for additional useful classes.


Submission Directions

After you are finished writing your code, jar the Lab7 project and submit the resulting jar file, Lab7.jar.

You must follow all directions about filenames exactly, otherwise your work will not be graded.

Now you are ready to submit your work. Use the electronic submission program that corresponds to your recitation.


Due Dates

Due 11:59:59pm on Monday April 10th for all sections.