CPSC 211 10S Term Project Part 4:
Implementing a GUI for a Music Library Application

DUE: Tuesday July 27, 20:00

Assignment Overview

In part four of the project (aka assignment four), you will complete the music library application.

Specifically, you will implement a graphical user interface (GUI) for the application. We will provide code for the core application (i.e. a solution to assignment 3). If you wish, you may use the code you developed in part three of the project as a base. The objective of part four of the project is to:

As with the earlier parts of the project, you are encouraged, but not required, to work with a partner. If you choose to work with a partner it need not be the same partner you worked with for earlier parts of the project.

There are three deliverables for this project:

The requirements for the music library system remain unchanged from the third part of the project. The requirements are reproduced here for ease of reference.

Requirements for the Music Library Application

Basically, you need to be able to do everything in your GUI that you can currently do using the provided SimpleTextInterface class. The following is the list of requirements: All requirements and constraints from the previous two assignments apply here (e.g., alphabetical and track ordering, as required), but most of these are taken care of in the provided code.

Make sure your GUI gracefully recovers from potential errors and presents the user with error messages when appropriate. For example, when trying to add a Song to the Library with a path that is already associated with another Song, you should let the user know that the program was unsuccessful. For some cases, you may decide that it is impossible to provide an error message due to constraints in the provided code. In these situations, write a note in your README file (see Deliverables) explaining what the constraint is and how it could be worked around by changing the core application.

Deliverables

You must build your GUI using the Java Swing library.

You may change the classes from the third part of the project as you are building your GUI (though you shouldn't need to)

You must include with the files you hand in a README.txt file that describes how to use your GUI. This description does not have to be extensive, but needs to describe to the TA who marks your code how to invoke the functionality you are to implement.

Starter Code

A solution for project part three is available here (CPSC211-A4-SuppliedFiles.zip). You can load the zip file as you have been doing in the earlier parts of the project. Remember, you can use your own implementation from the third part of the project if you prefer, but there is additional functionality in this zip file that you should take advantage of.

Most, if not all, of your work will be done in GUI.java, which can be found in the “ca.ubc.cs211.mp3.ui” package. This class has been started for you – you are provided with a relatively bare bones program window with a player widget inside. When you first run the program, your window will look like this:

In the top portion of the application frame sits a special MP3 player widget (called player) that has been implemented for you. In the bottom (dark grey) portion of the frame, a second JPanel has been added (called bottomPanel) for you to populate with other widgets/components that you need to implement your GUI. Feel free to also use menus, pop-ups, input boxes, or any other Swing functionality you’d like.

To use the player widget, you need to tell it what Song object you want to control. This can be done as follows:

   player.setCurrentSong(s);
where s is the Song object you wish to control, and player is the name of the player widget. After calling this method, the control buttons and playback slider should become enabled for use.

If you would like to build extensions to the project, either on the player widget itself or in the functionality of the overall music library, feel free – bonuses will be given for great work. It is strongly suggested you complete the basic requirements before trying anything fancy.

A suggestion for a nice bonus would be to allow multiple songs to be played in succession; i.e., when one song finishes, the "next song" (which may differ depending on your current view) will start. If you wish to do this extension, have a look at how the looping functionality of the player widget works – this will help you greatly in determining when songs finish playing.

Grading

The following criteria will be used to grade this assignment:

Handing in the Assignment

You should develop the assignment with your partner, but in the end only one of you will submit the final version for both of you. Do not submit more than one copy for each group. The person who will submit the project should do the following:
  1. If you have not done so, create a directory named cs211 inside your home directory. Inside cs211 create another directory named part4.
  2. Go to Eclipse. From Eclipse, select the Java project in the PackageExplorer that contains your implementation of part four of the project, say it is called "Assignment Four".
  3. With "Assignment Four highlighted, right-click in the PackageExplorer and select Export. Expand the General category and select Archive File. Press Next. Save the archive to /211/part4.
  4. Copy the cover page for this assignment in the directory part4 and fill it in. Make sure that your partner has also filled in his/her part in the cover page.
  5. When you are ready to hand in, use:
       handin cs211 part4 
    
  6. Now check that the handin process was successful with the command:
       handin -c cs211 part4 
    
    You will see a list of all the files that were submitted. Check that you have submitted the necessary files and that you haven't submitted any extraneous files.

Demonstration in the lab

In the July 28 lab, you will have 10-15 minutes to demonstrate your GUI to a TA. You will be expected to demonstrate all of the functionality of the music library application listed in the requirements section above in a logical and coherent way. This means you must plan an order in which to show the functionality.

You should not miss this lab. If you develop the assignment with a partner who is in a different lab, you need to decide in which lad you'll give the presentation. You can only present the project in one lab and both partners have to be at the presentation. Demonstrating your project in an important part of the project evaluation. If you miss your lab for any medical reason, it is your responsibility to contact your TA and determine how to provide the demonstration.

Eclipse Short-cuts

Here is a listing of Eclipse short-cuts you might find useful. Please note these were tested on a Windows and not a Linux machine.
Quick Fix (lightbulb) F1
Show declaration F3
Code completion Ctrl-space
Rename a program element Alt-shift-r
Format the code Alt-shift-f
Find all references of a program elementCtrl-shift-g

Last Updated: 07/15/2009 05:34 PM