Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

implement java model (behaviors, states, events and relationships) Source code: ================================= public interface RemoteControl { public void homeBtn(); public void internetBtn(); public void navRightBtn(); public

implement java model (behaviors, states, events and relationships)

Source code:

=================================

public interface RemoteControl {

public void homeBtn();

public void internetBtn();

public void navRightBtn();

public void navUpBtn();

public void navDownBtn();

public void playBtn();

public void stopBtn();

public void pauseBtn();

public void fFwdBtn();

public void fRevBtn();

public void skipSceneFwdBtn();

public void skipSceneRevBtn();

public void ejectBtn();

public void closeDrawerBtn();

public void openDrawerBtn();

public void acceptBtn();

public void powerBtn();

}

======================

public class DVDPlayer implements RemoteControl {

public void processRemoteCMD() {

powerBtn(); }

public void displayResultionDisplay() { playBtn();

}

public void homeBtn() { System.out.println("Here is the HOME Button"); System.out.println(" "); internetBtn();

}

public void internetBtn() { System.out.println("Now we are in internet menu"); System.out.println("Please click on Right Navigation button"); System.out.println(" "); navRightBtn();

}

public void navRightBtn() { System.out.println("Now we are in Right Navigation"); System.out.println("Now we are going to Up Navigation"); System.out.println(" "); navUpBtn();

}

public void navUpBtn() { System.out.println("We are in Up Navigation menu"); System.out.println("Cliking on Down Navigation menu"); System.out.println(" "); navDownBtn(); }

public void navDownBtn() { System.out.println("Now we are in Down Navigation menu"); System.out.println("Please press the play button to start"); System.out.println(" "); playBtn();

}

public void playBtn() { System.out.println("Now we are playing"); fFwdBtn();

}

public void stopBtn() { System.out.println("Stopped the play"); ejectBtn();

}

public void pauseBtn() { System.out.println("We just pause play"); stopBtn();

}

public void fFwdBtn() { System.out.println("We are in fast forward stage"); fRevBtn();

}

public void fRevBtn() {

System.out.println("We are in fast Reverse stage"); skipSceneFwdBtn();

}

public void skipSceneFwdBtn() { System.out.println("Now we are in skip Scene forward"); skipSceneRevBtn();

}

public void skipSceneRevBtn() { System.out.println("Now we are in skip Scene Reverse"); pauseBtn();

}

public void ejectBtn() { System.out.println("Removed the CD."); openDrawerBtn();

}

public void closeDrawerBtn() { System.out.println("close the Drawer");

}

public void openDrawerBtn() { System.out.println("Now we are in opned the Drawer"); acceptBtn();

}

public void acceptBtn() { System.out.println("accept the CD."); closeDrawerBtn();

}

public void powerBtn() { System.out.println("Start the power button"); homeBtn(); }

}

====================

import java.util.Scanner;

public class DVDSimulationDisplay {

static String value = null;

public static void displayCMD() { DVDPlayer dvdPlayer = new DVDPlayer(); if (value.equalsIgnoreCase("1")) { dvdPlayer.displayResultionDisplay(); } else { dvdPlayer.processRemoteCMD(); }

}

public static void main(String a[]) {

System.out.println("Here are the DVD Player Remote methods"); System.out.println(" ");

System.out.println("please select displayResultionDisplay -1 and processRemoteCMD -2"); System.out.println(" ");

Scanner sc = new Scanner(System.in);

value = sc.nextLine();

DVDSimulationDisplay.displayCMD();

}

}

You are to design and then build a software simulation of a DVD player that also has WIFI capability and can connect to Netflix and play streaming video (we will keep it to Netflix at the moment). You are given the complete specification for the remote control until. It is modeled in the Analysis Classification model provided to you. Your task will be:

In assignment #4 to complete the analysis and design of the DVDPLayer class which is the model (in the MV two-tier arvchitecture) so that we can test out its functioning against the remote control before actually building the hardware DVD Player.

Implement the classes RemoteControl and DVDPlayer to demonstrate that the remote control can correctly and completely control the DVD player. For output of the DVD player functioning you can either direct status messages to the console, or build a GUI to demonstrate the DVD status. In either case, this is a view and must be totally separate from the DVDPlayer class.

System Requirements:

The remote control has been chosen. The following descriptions provide what is expected behaviour from the DVD player when each button is pressed:

HomeBtn: places the DVD player into home state and displays the home screen. If connected to the inetrnet, the connection is terminated. If a DVD is playing, it is stopped.

InternetBtn: If at home screen and internet service is available, connect to the last internet site visited (ex. Netflix). If there is no last site, go to list of sites screen. If no internet service is available, do nothing.

NavRightBtn: Move the cursor display to the right

NavLeftBtn: Move the cursor display to the left

NavUpBtn: Move the cursor display up one line

NavDownBtn: Move the cursor display down one line

PlayBtn: if a DVD is inserted and we are not in internet mode, begin playing the DVD. If

connected to an internet site, play (or select) the highlighted item (ex. Movie)

StopBtn: if playing a DVD, stop playing. If streaming an Internet movie stop and return to the

movie select screen.

PauseBtn: Pause playing the DVD or Internet movie

FFwdBtn: Fast-forward the DVD or Internet movie

FRevBtn: Fast-reverse the DVD or Internet movie

SkipSceneFwdBtn: skip one sceen forward on the DVD; if an internet movie, play in fast-forward

SkipSceneRevBtn: skip one sceen backward on the DVD; if an internet movie, play in fast-reverse

EjectBtn: If a DVD is in the drawer, open the drawer.

CloseDrawerBtn: Close the drawer if open.

OpenDrawerBtn: Open the drawer if closed.

AcceptBtn: (Internet only) Accept the highlighted item on the Internet site

PowerBtn: If DVD is currently ON, turn it OFF. If it is OFF, turn it ON.

In this part, you implement your model in Java. This part will not be marked according to how well the implementation behaves according to the description of the DVD. It will be marked according to how well you implemented your model from assignment #4. You must:

Accurately implement your model (behaviors, states, events and relationships)

Keep the model separate from the view no view code in the model; no model code in the view

You may use either a GUI or console for the view (or a combination). For example, you can have

a window GUI representing the buttons of the remote, while displaying text on the console advising what the DVD is doing. Do not incorporate input/output into the console if you use a GUI for the remote.

You may

o Make minor adjustments to your model while implementing: you may discover that you identified attributes that are, in fact, redundent or unnecessary. You may also discover the need for attributes you did not identify in the model. Also methods may be identifed in your model that you now find unnecssary, or introduce methods that are not in the model because you discovered they were necessary.

o Any deviations from the model must be well documented (i.e. why you removed the characteristic, or why you introduced a characteristic)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

c. What groups were least represented? Why do you think this is so?

Answered: 1 week ago