Ask Java Expert


Home >> Java

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.

Java, Programming

  • Category:- Java
  • Reference No.:- M91201307
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Java

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As