Create a class that implements movieloader

Assignment Help JAVA Programming
Reference no: EM13671257

You will be completing the implementation of a program that displays ASCII art animations. You will begin with code that loads a movie data- le. Your job is to create the code that parses that data, stores it as a series of \frames" of a movie, and then displays that movie, frame by frame, as an animation.

Your program comes with a set of sample movie les; you can create your own as well. Each movie is stored as a text- le, with features as follows:

The rst line of the le consists of two integers; these give, in order, the width and height of a single frame of the movie. (Since the movie is made up of ASCII art, these measurements are character widths and line heights, respectively.)

The rest of the le consists of a sequence of ASCII art images, encoding an animation sequence. Each frame must have the height given at the start of le; if the height value is h, and there are F frames of the movie, then the overall le must have (Fh + 1) lines total, including the numbers at the top.

Each line of a frame does not need to be of the same width value given; speci cally, some lines may be shorter than that value (none will be longer). For instance, when a line in a frame is empty, it may consist only of a single space, or even just a line-break symbol; in general, we cannot assume that white-space to the right-hand side of a frame is actually lled.

To complete this assignment, you will do the following things (not necessarily in order):

1. Fill in the empty Frame class that has been provided. Each object of this type will store data consisting of a single frame from an input le. The particular data structures and methods you implement in this class is up to you.

2. Create a class that implements Movie, an interface that is provided to you. Your class will consist of a data-structure that can hold a collection of frame data objects. It will also have two methods that can return frames of the movie, one at a time, in either front-to-back or back-to-front order, allowing movies to be played forwards or backwards. In either direction, a movie must terminate and display a still image when it reaches either end of its sequence of images. That is, when it reaches the end of the movie, the last frame of the movie should be displayed as a xed image, and if we play it backward, it should end by displaying the rst frame of the movie as a xed image. You may wish to extend an existing Java data- structure class for this purpose (or you many not). However you do it, you must implement the interface given, without any changes to that interface.

3. Create a class that implements MovieLoader, an interface that is provided to you. Your class must contain two methods, at least: one that takes in a le containing ASCII animation data, as described above, and one that returns a \movie" object containing that data in a playable form. You may wish to extend an existing Java data-structure class for this purpose (or you may not). However you do it, you must implement the interface given, without any changes to that interface.

4. Modify the existing ASCIIMator class. At present, that class allows you to choose and open a text- le (once the le has been opened, it can be referenced using the global inFile variable). When various buttons are pressed, some partial functionality is available. Your modi cations will ensure:

Until a le is loaded, pressing any of the buttons at the bottom of the screen will do nothing. When we load a new le, the rst frame of that movie will be displayed. When we press the step-forward button, `>'', the movie will advance by a single frame; similarly the step-back button, `<'', will rewind by one frame. The two play buttons, `>>'' and `<<'', will cause the movie to play in animated fashion, forward or backward, respectively.

Any playing of the movie, either automatically or manually frame-by-frame, will display a xed image (either the last or rst frame) whenever the movie reaches one end.

When displaying frames of a movie, each frame will have a border along each side, consisting of `|'' characters, as seen in the image at the start of this document.

Pressing the `X'' button will stop movie play, freezing the display in place until some other button is pressed.

Making these changes will involve, at the very least, modifying the existing actionPerformed() method. You may make other changes to the class, as needed.

Reference no: EM13671257

Questions Cloud

Explain what the boiling point of the solution is : A solution is prepared by dissolving 4.9g sucrose in 175g water. Explain what the boiling point of this solution is. Sucrose is s non electrolyte.
Devise a benchmarking review for anthonys orchard : Devise a benchmarking review for Anthony's Orchard. To do this, discuss recommended strategies and measures that will be useful to measure progress towards the objective in your gap analysis.
Explain the strong acid trifluoromethane sulfuric acid : Explain what is the pH of 355.0mL of an aqueous solution containing 0.607 g of the strong acid trifluoromethane sulfuric acid(CF3SO3H)
Explain why does bromination of acetanilide stop : Write the mechanistic equations for each step in the preparation ofp-bromoaniline from aniline showing how all intermediates areformed. Explain why does bromination of acetanilide stop at the monobromostage
Create a class that implements movieloader : Fill in the empty Frame class that has been provided. Each object of this type will store data consisting of a single frame from an input le.
Explain how many grams of carbon present in caffeine : The chemical formula for caffeine isC8H10N4O2. Explain how many grams of carbon are present in a 12.46 gram sample of caffeine
Explain the same heat capacities as pure water : Find out q for the acid-base reaction, presuming that the liquid a have densities of 1.00 g/mL and the same heat capacities as pure water
Find a necessary and sufficient condition on the parameters : Find a necessary and sufficient condition on the parameters for corr
State an overall balanced equation for the reaction : State an overall balanced equation for the reaction that takes place when aqueous nickel (ll) chloride reacts with zinc to make zinc chloride and nickel.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a java program that prints the numbers from 1 to 125

Write a Java Program that prints the numbers from 1 to 125. But for multiles of three print "Batman" instead of the number and for the multiples of five print "Superman". For instances which are multiples of both three and five "JusticeLeague".

  Write a method in java that uses a switch statement

Write a method in JAVA that uses a switch statement and takes a person's age using an integer parameter , then checks if the age is valid (0-110), and then RETURNS a string based on the age

  Write a server for multiple clients

Write a server for multiple clients. The client sends loan information (annual interest rate, number of years, and loan amount) to the server. The server computes monthly payment and total payment and sends them back to the client.

  Define java implementation to implement the requirements

Produce a Java implementation to implement the requirements of Question 1, that is, to perform the 32-bits two complement and 32-bit floating-point conversion of a given number.

  Write a program that prompts the user for a start date

write a program that prompts the user for a start date and an end date and then prints all of the dates between them (inclusive), with seven tab-separated dates on each line.

  Write a java class

Write a Java class called PQueue that extends the provided abstract QueueADT class.

  Write java program to print price of table-furniture company

Write down the Java program for furniture company. Ask user to select P for Pine, O for Oak or M for Mahogany. Illustrate the price of table produced with chosen wood.

  Java program for creating a order menu

Assume your consulting company has been hired to construct a program that meets the following requirements.

  Write a program that reads a list of real numbers.

Write a program that reads a list of real numbers. After the program ends it should print out only the unique numbers

  Pass in the number of gallons on board

public float usefulLoad() // this is the grossWeight - emptyWeight public float usefulLoadWithFuel( in gallons ) // this is the useful load - gallons x 6. The programmer user will pass in the number of gallons on board.

  Problem on java progamming

Which parts of the assignment were you not able to complete fully? For each, explain why you were unable to complete this part and what steps you took to attempt to complete it.

  Prepare address book java application

Prepare an application that reads the contents of your address book file and prepare a user guide that includes a description of the functionality of your overall address book system.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd