|
Project #5
(GUI) |
CMSC 132 |
|
Due Date: Wednesday
April 4, 6:00 pm |
Object-Oriented Programming
II |
|
Type of Project:
Closed |
Spring
2007 |
Objective
This project has several objectives. Those objectives are:
- Learn how to design and develop Graphical User Interfaces (GUI) using
Java.
- Practice Java inner classes.
- Practice using the Java API.
- Get a better understanding of the MVC model by designing the
view/controller associated with an application.
This project is considered a closed assignment. Make sure you read make
sure you read the
open/closed policy before continuing working on this project.
Unlike other projects, there will be no public/release/secret tests associated with this
project. TAs will examine the GUI functionality manually.
Project Clarifications
Any clarifications or corrections associated with this project will be
available at: clarifications.html
Overview
For this project you will complete the following task:
- Implement a Graphical User Interface (GUI) for an application that
implements a simplified version of iTunes (we called iTunesJr)
Your project will be graded as follows:
GUI Functionality
70 %
Java Construct Requirements
20 %
Style
10 %
For
this project:
-
No submit server testing is associated with this project.
-
You do not need to provide an UML diagram for this project, although you are
encouraged to create one for the GUI.
- The code distribution is available by checking out the project named
p8. The code distribution includes:
- A folder named src - In this folder you will find a package
named gui and a package named itunesJr.
- In the gui package you will find the shell for a class named
ItunesJrGUI. This class represents the GUI for the iTunesJr
application.
- ItunesJr.java - This class can be found in the gui package.
It represents the driver that will create
an instance of the MediaManagerSystem class and the one launching the GUI. Make
sure we can run your GUI by executing the main method of this class.
- The itunesJr package implements the logic (model component of
the MVC paradigm) that manages audio files (songs and podcasts).
Notice that the actual audio files (also refer to as media files) are
not handled by the database system. The system keeps track of the names
of the audio files which can then be used by a media player to actually
play the audio file. You do not need to worry about how play the audio
files. Documentation for this module can be found at
itunesJr model documentation.
- In the itunesJr package we have left a set of public tests (in
the PublicTests.java file) that could help you understand how the provided
code works.
Specifications
Defining a Song
For this project, a song is associated with the following information:
- name (title) of the song
- name of the artist (if there is more than one person associated with the
song then each name will be separated by a & character)
- name of the album associated with the song
- release date
- duration of the songs in seconds
- some general information about the song
- number of grammies the song has received (if any)
- genre (pop, rap, etc.) associated with the song
- number of times the song has been played
- name of the audio file with the song and the one a media player will use
Defining a Podcast
For this project, a podcast is an entity that contains information about
media files associated with a web site (url). A podcast is associated with the
following information:
- podcast's name
- url associated with the podcast
- release date for the podcast
- some general information about the podcast
- A list with information about each podcast entry. Each podcast entry
has the following information:
- name (title) of the entry
- author's name (if more than one person the each name will be
separated by a & character)
- date when the entry was released
- duration in seconds
- some general information about the podcast entry
- name of the audio file for this entry
- Any other field you understand is needed
Assumptions
- A title uniquely identifies a song or podcast entry.
- Artist names are unique (no two artists will have the same name).
- Album names are unique (no two albums will have the same name).
- Podcasts' names are unique.
- No genre is associated with a podcast entry.
MediaManagerSystem Class Modifications
You can add/modify the MediaManagerSystem class as you understand is
necessary (e.g., add methods, instance variables, etc.) in order to implement the GUI requirements,
however you don't need to. Keep in mind that the MediaManagerSystem
class provides methods you will not need to use for this project.
Graphical User Interface (GUI)
You must implement your GUI in the gui package. Notice that you don't need to implement a fancy and beautiful
interface in order to get full credit for the GUI. We
have provided a snapshot of a sample GUI just to give you an idea of how
your GUI could look like, but feel free to design your own.
Your GUI must satisfy the following
requirements:
GUI Requirements
- Any classes
associated with the GUI must appear in the gui package.
- You must define and use at least one inner class (not an
anonymous class) in your implementation of the GUI.
- You must define and use at least one one anonymous inner
class in your implementation of the GUI.
- You cannot read user input using System.in.
- You cannot generate results using System.out.
- If you want to provide access to all the functionality associated with
the MediaManagerSystem through the GUI that is fine with us. However,
you are not required to do so. For this project, your GUI should allow us to
complete the following tasks:
- Importing (loading) - Your gui should allow us to load the
contents of a text file containing songs and podcasts. Your GUI should
allow us to specify the name of the file to load.
- New Playlist - Your gui should allow us to create a playlist.
- Selecting a playlist - Your gui should provide a menu entry where
we can select a playlist from a list of playlists. Selecting a
playlist will display the songs associated with that particular playlist.
The list should be displayed using a JTable.
- All songs - Your gui should provide a mechanism to display all
the songs in the system. The list of songs should be displayed using a
JTable.
- Selecting a podcast - Your gui should provide a menu entry where
we can select a podcast from a list of podcasts. Selecting a
particular podcast will display the podcast entries associated with that
particular podcast. The list should be displayed using a JTable.
- Playing a song - Playing a song entry means that we should be
able to click on a song entry, press a play button and then see a message
similar to: "Playing: "<songTitle> where <songTitle> represents the title of
the song. For example, the Sample GUI below illustrates what should be
displayed after selecting a song. In addition to the play button, you
should have a stop button that when pressed changes the message from
"Playing: "<songTitle> to "Playing: None". Notice that no actual audio
playing will take place.
- Playing a podcast entry - We expected a behavior similar to the
one described for Playing a song.
- Adding a song to playlist - Your gui should provide a mechanism
to add a song to a playlist.
- Exiting the GUI - Your gui should provide an exit option
different from closing the gui window.
- For songs displayed in a JTable include the following values: Title,
Duration, Artist's name, Album name, Genre, and Description.
- For podcast entries displayed in a JTable include the following
values: Title, Duration, Artist's name, and Description.
- You must use at least the following components: JLabel, JScrollPane, JPanel, JFrame, JTable,
JMenu, JMenuItem, JButton
Style Requirements
- You must avoid code duplication. For example, if several
methods in your class share the same code fragment place that fragment
in a private method.
- You must follow Java conventions for identifiers. For example,
class/interface names must start with capitals.
- You must use meaningful variable names.
- You must indent your code using three or four spaces or by using the
Eclipse "Correct Indentation" option.
- You must use the same style for blocks of curly brackets ({ })
throughout your code.
Sample GUI
Notice that you don't need to implement a fancy and
beautiful interface in order to get full credit for the GUI component of this
project. Below we have provided a snapshot of a sample GUI just to give you and
idea of how your GUI could look like, but you do not need to implement this particular
GUI. Feel free to design your own.

Honors Section
Your gui should allow
us to search for songs that satisfy certain criteria. The result of processing
the search should be displayed using a JTable. The search possibilities are:
- Those songs that belong a specific artist.
- Those songs that belong to a specific genre.
- Those songs that have specific keywords in the title.
Submission
Submit your project using the submit project option associated with Eclipse.
Academic Integrity
Please make sure you read the academic integrity section of the syllabus so
you understand what is permissible in our programming projects. We want to
remind you that we check your project against other students' projects and any
case of academic dishonesty will be referred to the
University's Office of
Judicial Program