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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  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.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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