This is not a current assignment. If you are currently enrolled in SE1020, do not do this assignment expecting to receive credit for it.

Lab 3: Media Player Handling Events

Objectives

* become familiar with event driven programming

  • become familiar with inner classes

Assignment

In this lab, you will continue the work you began on the Media Player in lab 2. In particular, you will add functionality to the various UI components.

Added Functionality

You should add the following functionality to your Media Player UI:

Basic UI

  • Clicking on Open Playlist calls JOptionPane.showMessageDialog() and displays “Opening playlist”
  • Clicking on Play puts “playing…” after the “Current Playlist:” text at the top of the window
  • Clicking on Stop puts “stopped” after the “Current Playlist:” text at the top of the window
  • Clicking on Next increases the amount completed shown in the progress bar
  • Clicking on Prev reduces the amount completed shown in the progress bar
  • Clicking on Playlist Manager makes the Playlist Manager UI window visible

Basic Playlist

You should add the following functionality to your Playlist Manager UI:

Basic Playlist

  • Clicking on Add, Remove, or Save button adds a line of text to the text area indicating which button was pressed.
  • Clicking on Cancel button or X in the upper right corner of the title bar makes the Playlist Manager UI window invisible.

Detailed Requirements

  1. Modify the MediaPlayerUI and PlaylistManagerUI classes so that the GUI components (e.g, buttons, text fields, etc…) that can be are declared locally in the constructors instead of object attributes. Note: some GUI components must be attributes since they need to be modified by the event handler in the inner class.
  2. Modify the MediaPlayerUI class so that it has a PlaylistManagerUI object as a field.
  3. Add an inner class to each UI class to handle the events as described above. Class Diagram
  4. Add a public method to the PlaylistManagerUI class called setVisible() This method should be called from the MediaPlayerUI object when the “Playlist Manager” button is clicked. Class Diagram
  5. Draw a sequence diagram for the Open Playlist button press on the Media Player UI.
  6. Draw a sequence diagram for the Cancel button press on the Playlist Manager UI.

Tip: use this EA file (zip'd to save space) as a starting point for the sequence diagrams you are required to generate.

FAST Data

You should indicate how much time (in minutes) you spend on this assignment in the FAST database. You are encouraged to log your activity as you work on the project. At a minimum, you should log all of the time spent on this assignment before the due date given above. All time spent on this assignment should be entered into the week 3 column (even if you worked on it in week 4).

Lab report

You should follow your instructor's instructions for your lab report.

Dr. Suri Dr. TaylorDr. Hornick

If you have any questions, consult your instructor.

se1020labs/lab3.txt · Last modified: 2010/03/09 20:55 (external edit)
 

This website is not owned or managed by the Milwaukee School of Engineering.

© 2003-2010 Dr. Christopher C. Taylor, et. al. • Office: L-343 • Phone: 277-7339 • npǝ˙ǝosɯ@ɹolʎɐʇ • -> RSS <-