Homework 5
Home Up

 

CS4984 HOMEWORK #5

DUE: April 26, 2001 (Firm deadline, no extension)

 

Problem #1

Write a derived class ScaledImagePlayer that extends the base class ImagePlayer to allow a scaled image to be displayed with the scaling ratio specified via a parameter to the constructor ScaledImagePlayer(double ratio). Use the tester application ScaledImagePlayerTester to test your implemented class. The only method that needs to be overridden is the update() method in which you display the scaled image instead of the unscaled image as implemented in ImagePlayer.java.

Hint: you still use a JLabel to hold an ImageIcon except that the ImageIcon is created from a scaled image obtained by calling the getScaledInstance method from the Image class. 


Problem #2

Modify the "MediaListManager" class in Homework #4 that, in addition to the specified add/delete/modify buttons, also contains a play button which upon pressed will display/play the currently selected item in a pop-up window based on the media type (video, audio, image or text) of the selected media item. Multiple items can be played in multiple pop-up windows simultaneously until terminated by the user. There is no need to perform text search for a selected text item or to perform scaling for a selected image item in this homework.

Note: This problem will be graded only for the play functionality (i.e., the add/delete/modify functionality will not be checked again), so you can just put one button named "play" at the bottom of the GUI display if you don't have a completed MediaListManager program from Homework #4 in hand to do the extension.     

Use the same tester application "HwFourTest.java" to test your modified "MediaListManager" class as in Homework #4.


Copyright © 2000-2001 First Principles. All rights reserved.
For problems or questions regarding this web contact webmaster.
Last updated: 07 June 2001 23:06:27 -0400.