COMP 1006/1406 Building Graphical User Interface Assignment 3 Answer

Assignment 3Graphical user interfacesFor this assignment, you will build a graphical user interface to attach to the electronic store model that you have developed over the previous two assignments. You can use your own model classes from the previous assignment, or you can download the model classes included within the zip file on the assignment page and incorporate those into your IntelliJ project as a starting point. You should ensure you understand the Model/View/Controller paradigm before beginning the assignment. Your assignment must maintain a separation between the GUI and the underlying electronic store model. You must also continue to apply the principles of OOP, such as encapsulation. A recording showing a demonstration of how the GUI should work is included on the assignment page.1. The GUIAn example of what the graphical user interface window should include is given in the picture below. The code for this view should be created in a class called ElectronicStoreView. You should make the GUI window non-resizable. The ratio of the window width/height should be approximately 2:1 (e.g., 800 wide, 400 high). It does not have to look exactly as the picture but should closely match.2. When the Application StartsCreate a class called ElectronicStoreApp, which will represent the controller component of your program. This class should extend from the JavaFX Application class. When the application starts, your controller should create an instance of ElectronicStore, as well as an instance of your view defined in part 1. To create the ElectronicStore instance, you must use the static createStore() method from the ElectronicStore.java file included on the assignment page and save the returned ElectronicStore instance in a variable within the ElectronicStoreApp. If you are using your own code as a base, you can copy/paste the createStore() method from the example. The ElectronicStore instance will represent the model that the GUI application will interact with.When the application starts, the window title must include the name of the store. The ‘Add to Cart’, ‘Remove from Cart’, and ‘Complete Sale’ buttons should initially be disabled. The ‘# Sales’, ‘Revenue’, and “$ / Sale” TextFields should be initialized to default values representing the starting state of an electronic store. The store stock ListView should display all the items currently in stock within the electronic store model. The most popular items ListView should show 3 products that exist in the store’s stock. At this point, all products will have an equal popularity since no sales have taken place. The image below shows an example of what the initial window should look like:
3. Event HandlingYou must add event handling to the ElectronicStoreApp class to meet the requirements outlined below.Store Stock:If an item has been selected inside of the Store Stock ListView, the ‘Add to Cart’ button should be enabled. If no item has been selected, the button should be disabled.When an item in the Store Stock ListView has been selected and the ‘Add to Cart’ button is clicked, one unit of the selected item should be added to the current cart (see requirements for Current Cart below).If a product does not have any items left in stock (i.e., they have all been sold or added to the current cart), it should not be displayed in the Store Stock ListView. Note that when a product is added to the cart, the amount of that product available in stock should decrease.Current Cart:The Current Cart ListView should show the quantity and product information for each product that has been added to the cart (e.g., 3 x Server Desktop PC with 4.0ghz CPU, 32GB RAM, 500GB SSD drive). Each added product should only show up once in this list. The number at the start of the entry will indicate how many times the product has been added to the list.If no products have been added into the cart, the ‘Complete Sale’ button should be disabled. If products are in the cart, the button should be enabled.The total dollar amount in brackets beside ‘Current Cart’, representing the total value of all products in the current cart, should be updated each time a product is added to the cart or removed from the cart.If an item in the Current Cart ListView has been selected, the ‘Remove from Cart’ button should be enabled. If no item in the Current Car ListView is selected, the ‘Remove from Cart’ button should be disabled.If an item in the Current Cart ListView is selected and the ‘Remove from Cart’ button is clicked, the quantity of that product in the cart should be reduced by 1 and the quantity in stock should be increased by 1.Complete Sale:When there is at least one product in the current cart and the ‘Complete Sale’ button is clicked, those items should be sold. You must update the ‘# Sales’ (increase by 1), the ‘Revenue’ (increase by the total value of the cart), and the ‘$ / Sale’ fields on the GUI window and the related variables in the underlying model.The total dollar amount listed in brackets beside ‘Current Cart’ should be reset to $0.00 when a sale is completed.Most Popular Items:The most popular items ListView should show the 3 products that have sold the most units. You do not need to worry about ties between products.The most popular items list view should only account for products that have officially been sold (i.e., it should not account for items that are added to the cart).Reset Store:1) When the ‘Reset Store’ button is clicked, the model should be reset to its initial state (i.e., the electronic store model should be recreated). The GUI should also update to show the reset state of the store.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
Open chat
1
You can contact our live agent via WhatsApp! Via + 1 929 473-0077

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 20% with the discount code GURUH