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

  Implementation the two classes

Program Specifications: In the new implementation, the two classes, Student and Grades, are defined with the following operations/methods.

  Fixing errors in a java program

You coded the following on line ten of the class MyApplet.java:

  Algorithm analysis with advanced data structures

Algorithm Analysis with Advanced Data Structures, Your good friend, a Rock Star, asked you to create a Time Manager app for him, The Rock Star performs gigs at certain dates, all around the country - at most one gig per day

  Create a program that develops an amortization schedule

Create a program that develops an amortization schedule. Your program should be written as a Java applet.

  Write a method called makerow

Write a method called makeRow that is passed two arguments: an int and a String. It returns a String containing n copies of s, concatenated in a row. For instance, if we call the method with makeRow(5, "*"), the method returns *****.

  What violations and crimes would you definitely file

What if you were a parole officer and had to decide whether or not to file complaints against your parolees? What violations and crimes would you definitely file complaints for and what would you most likely overlook and why?

  The burn and distance traveled

The Burn and distance traveled and the "meters to go" should appear on two lines as shown in the sample output. Note that this print should be done within the while loop.

  Task 1 create a new project in eclipsecreate a package

task 1 create a new project in eclipse.create a package called lsquopeople within this project. download the start up

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Draw a uml diagram of each of the shapes

Draw a UML diagram of each of the Shapes, Rectangle and Square classes using the code that has been provided. Complete this using the examples that have been provide in the lecture slides.

  Design a program that asks the user to enter a series of 20

Number Analysis Program: Design a program that asks the user to enter a series of 20 numbers

  Write a program that plays a word game with the user

Write a program that plays a word game with the user. The program should ask the user to enter the following.

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