JavaEyes

Work on this exercise by yourself, but ask questions of your instructor, student assistants and classmates as desired.

Goals

The goals of this exercise are to:

The Exercise

You will check out a simple GUI program named JavaEyes from a central repository using Subclipse.

You will read the program, answer some questions about it, and modify it.

You will check your modified version back in using Subclipse.

Instructions Part 1 - Check Out the Project

  1. Open Eclipse. Switch the the SVN Repository Exploring perspective by choosing Window ~ Open Perspective ~ Other..., choosing SVN Repository Exploring, and clicking Open
  2. You'll get an SVN Repository view where your Package Explorer usually lives. Right-click in that view and select New ~ Repository Location...
  3. In the Add SVN Repository dialog box, enter:
  4. Eclipse should bring up this location in the SVN Repository view. If not, get help now.
  5. Right-click on JavaEyes and select Check Out... → Checkout As Project in the Workspace and choose Next to select default name.
  6. To work on the project, go back to the Java perspective (choose Window ~ Open perspective ~ Java).
  7. Consider: Checking out JavaEyes changed your Project Explorer view. (It may also have changed your Problems view, since JavaEyes intentionally has some errors.) How is your Project Explorer view different than it was before you checked out the JavaEyes project?

Instructions Part 2 - Read the code

  1. Run the program and play around with some of its features.
  2. There are a few written questions about JavaEyes on Homework 1. Use the Package Explorer to answer the first few questions now.

Instructions Part 3 - Modify the code

  1. Find the code that declares the eye (not eyeball) color. Change it to another (non-blue) color of your choice. Note that Eclipse has a great code completion feature that does much of the typing for you!
  2. Eclipse compiles on-the-fly. This means it can find compile-time errors automatically for you and suggest fixes. It also means that you never need a separate "build" or "compile" step before you run.
  3. Notice that an error message occasionally shows up in the console. Find and remove the source of this error (while keeping the rest of the program intact).
  4. Add a third eye that behaves just like the other two.
  5. One of the written problems on Homework 1 asks you about how you'd change the design of JavaEyes to add an eye that moves independently of the others. Please implement that design now, that is, write the code to do this. What you have the fourth eye do is up to you, depending on your experience and interest. Simplest is to have it just be static. More challenging and fun is for it to continually roll around clockwise, but feel free to show off your creativity!

Instructions Part 4 - Check the Project Back In to the Repository

  • If you created any new classes, you need to right-click on them in the Package Explorer, and choose Team → Add to Version Control
  • Right click on the JavaEyes project in the Eclipse Package Explorer, and choose Team → Commit...
  • You should noticed that the checkbox of any files you added are marked; if not, do so now.
  • Include a useful (or fun?) log comment.
  • Make sure any new files you want to add have a check next to them.
  • After you choose "OK" you should see log file notes in the Eclipse console window that verify your success.