AA. Final Project - Improved JavaFX GUI Personal Lending Library Description: In this project we will...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
AA. Final Project - Improved JavaFX GUI Personal Lending Library Description: In this project we will improve our personal lending library tool by (1) adding the ability to delete items from the library, (2) creating a graphical user interface that shows the contents of the library and allows the user to add, delete, check out, or check in an item, (3) using a file to store the library contents so that they persist between program executions, and (4) removing the 100 item size restriction. Sample Run: The video final.swf on the course website shows a sample run of this program. Suggestions: You have the freedom to design your program however you want, provided that it meets the requirements and follows good design principles. However, if you would like some ideas of where to start, they are provided in this section. • • • Modify the Library class to use an ArrayList rather than an array (to eliminate the size limit) Rewrite all of the methods in the Library class that display error messages to throw exceptions Add the following methods to the Library class: о о public void delete(String title) - Removes the item with this title from the library (the ArrayList of Medialtems) public void save() - Writes all of the items out to the data file library.txt. For each Medialtem, write its title, format, whether or not it is on loan (true/false), who it is loaned to (or null, if not on loan), and the date is was loaned (or null, if not on loan). Write out some weird symbol in between each of these things - be sure to pick something that is not likely to appear in a title or someone's name. о public void open() - Reads in the data from library.txt, recreates the Medialtems, and puts them into the ArrayList. When you read in each line, you will need to tokenize it based on whatever symbol you picked. Then create a new Medialtem object and set the fields appropriately. • Create a JavaFX LibraryGUI class This class should have a Library object as one of its fields. In the LibraryGUI constructor you will need to call the library constructor method to initialize this field and then call its open() method to read in the items from the data file. Use a javafx.scene.control ListView class to display the contents of the library (see Chapter 16 of Liang, pp. 647-651. The code below shows one way to use the ListView control to display list of items. The control takes a data model (a sequence of items) as its data source. The code below shows how it is used: ListView { } width:w-200 height:h-50 effect: DropShadow {offsetY:3 offsetX:3} items: for (i in [1..50]) "Cloud {%5s i}" The snippet above would produce the ListView shown in the following figure: Cloud 1 Cloud 2 Cloud 3 Cloud 4 Cloud 5 Cloud 6 Cloud 7 Cloud 8 • Hints: Provide buttons for adding, deleting, checking in, and checking out items Attach action listeners to the buttons that use dialog boxes to get any required information from the user and then call the appropriate method in the library. If the user currently has an item selected in the list, assume this is the item they want to check in/check out/delete. When the user has an item in the list selected and they choose to check in, check out, or delete that item, you will need to get the item's title in order to pass it to the appropriate library method. To do this, you can use the following code: Object selected = list.getSelectedValue(); // gets the selected item String s selected.toString(); // converts that to a String String title = s.substring(0, s.lastIndexOf("(")); // extracts the title String title = title.trim(); // removes any trailing whitespace You will need to call the Library class's save method when the user closes the application. Rubric (Each item is worth four points, for a total of 52) • The contents of the library persist across program executions • The program allows the user to delete items • • • The library is not limited to a set number of items The entire program is handled through a graphical interface (e.g. the console is no longer used at all) The JavaFX GUI allows the user to see the contents of the library and add, delete, check in, and check out items • The JavaFX GUI indicates which items are on loan • The user can choose which item to check in, check out, or delete by selecting it in the list rather than typing in the title • The contents of the list are kept in sync with the contents of the library • • If an exception occurs, the program displays an appropriate error dialog box to the user If the user tries to do something nonsensical, such as checking in an item that is not checked out, they are notified with an error dialog • The program compiles • The program runs • • The program follows good coding conventions and design guidelines Note: If your program does not compile, you will receive a score of 0 on the entire assignment Note: If you program compiles but does not run, you will receive a score of 0 on the entire assignment Note: If your Eclipse project is not exported and uploaded to the eLearn drop box correctly, you will receive a score of 0 on the entire assignment Note: If you do not submit code that solves the problem for this particular assignment, you will not receive any points for the program's compiling, the program's running, or following standard coding conventions. Note: This assignment must be done using JavaFX. If it is not done using JavaFX, you will receive a score of 0 on the entire assignment AA. Final Project - Improved JavaFX GUI Personal Lending Library Description: In this project we will improve our personal lending library tool by (1) adding the ability to delete items from the library, (2) creating a graphical user interface that shows the contents of the library and allows the user to add, delete, check out, or check in an item, (3) using a file to store the library contents so that they persist between program executions, and (4) removing the 100 item size restriction. Sample Run: The video final.swf on the course website shows a sample run of this program. Suggestions: You have the freedom to design your program however you want, provided that it meets the requirements and follows good design principles. However, if you would like some ideas of where to start, they are provided in this section. • • • Modify the Library class to use an ArrayList rather than an array (to eliminate the size limit) Rewrite all of the methods in the Library class that display error messages to throw exceptions Add the following methods to the Library class: о о public void delete(String title) - Removes the item with this title from the library (the ArrayList of Medialtems) public void save() - Writes all of the items out to the data file library.txt. For each Medialtem, write its title, format, whether or not it is on loan (true/false), who it is loaned to (or null, if not on loan), and the date is was loaned (or null, if not on loan). Write out some weird symbol in between each of these things - be sure to pick something that is not likely to appear in a title or someone's name. о public void open() - Reads in the data from library.txt, recreates the Medialtems, and puts them into the ArrayList. When you read in each line, you will need to tokenize it based on whatever symbol you picked. Then create a new Medialtem object and set the fields appropriately. • Create a JavaFX LibraryGUI class This class should have a Library object as one of its fields. In the LibraryGUI constructor you will need to call the library constructor method to initialize this field and then call its open() method to read in the items from the data file. Use a javafx.scene.control ListView class to display the contents of the library (see Chapter 16 of Liang, pp. 647-651. The code below shows one way to use the ListView control to display list of items. The control takes a data model (a sequence of items) as its data source. The code below shows how it is used: ListView { } width:w-200 height:h-50 effect: DropShadow {offsetY:3 offsetX:3} items: for (i in [1..50]) "Cloud {%5s i}" The snippet above would produce the ListView shown in the following figure: Cloud 1 Cloud 2 Cloud 3 Cloud 4 Cloud 5 Cloud 6 Cloud 7 Cloud 8 • Hints: Provide buttons for adding, deleting, checking in, and checking out items Attach action listeners to the buttons that use dialog boxes to get any required information from the user and then call the appropriate method in the library. If the user currently has an item selected in the list, assume this is the item they want to check in/check out/delete. When the user has an item in the list selected and they choose to check in, check out, or delete that item, you will need to get the item's title in order to pass it to the appropriate library method. To do this, you can use the following code: Object selected = list.getSelectedValue(); // gets the selected item String s selected.toString(); // converts that to a String String title = s.substring(0, s.lastIndexOf("(")); // extracts the title String title = title.trim(); // removes any trailing whitespace You will need to call the Library class's save method when the user closes the application. Rubric (Each item is worth four points, for a total of 52) • The contents of the library persist across program executions • The program allows the user to delete items • • • The library is not limited to a set number of items The entire program is handled through a graphical interface (e.g. the console is no longer used at all) The JavaFX GUI allows the user to see the contents of the library and add, delete, check in, and check out items • The JavaFX GUI indicates which items are on loan • The user can choose which item to check in, check out, or delete by selecting it in the list rather than typing in the title • The contents of the list are kept in sync with the contents of the library • • If an exception occurs, the program displays an appropriate error dialog box to the user If the user tries to do something nonsensical, such as checking in an item that is not checked out, they are notified with an error dialog • The program compiles • The program runs • • The program follows good coding conventions and design guidelines Note: If your program does not compile, you will receive a score of 0 on the entire assignment Note: If you program compiles but does not run, you will receive a score of 0 on the entire assignment Note: If your Eclipse project is not exported and uploaded to the eLearn drop box correctly, you will receive a score of 0 on the entire assignment Note: If you do not submit code that solves the problem for this particular assignment, you will not receive any points for the program's compiling, the program's running, or following standard coding conventions. Note: This assignment must be done using JavaFX. If it is not done using JavaFX, you will receive a score of 0 on the entire assignment
Expert Answer:
Answer rating: 100% (QA)
Algorithm MediaItem Class Represents an item in the library Attributes Title Format Loan status boolean Loaned to if on loan Date loaned if on loan Library Class Manages a collection of MediaItems Att... View the full answer
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these programming questions
-
123 Compare the purely graphical properties of these two notations, and the ways in which the graphical properties of each display correspond to the information structure being defined. Describe...
-
for the equality test for M and N. The question concerns how to represent multisets of strings within ML. For each of the given data representations (a), (b) and (c) describe how you would implement...
-
Find the point (a, b) on the graph of y = ex where the value ab is the least.
-
Salska and colleagues (2008) studied height preferences among dating partners. In their first study, they reviewed Yahoo Personals for heterosexual individuals living within 250 miles of Los Angeles,...
-
Sketch a possible graph of sales of sunscreen in the northeastern US over a 3-year period, as a function of months since January 1 of the first year. Explain why your graph should be periodic. What...
-
Why does collusion pose unique prevention and detection challenges?
-
Grider Companys chart of accounts includes the following selected accounts. 101 Cash..........401 Sales 112 Accounts Receivable....414 Sales Discounts 120 Merchandise Inventory....505 Cost of Goods...
-
Part E Constants A rigid, uniform, horizontal bar of mass m and length is supported by two identical massless strings. (Figure 1)Both strings are vertical. String A is attached at a distance d < L/2...
-
The statements concern psychrometric chart. Which of the following statement(s) are correct (A) Constant relative humidity lines are uphill straight lines to the right (B) Constant wet bulb...
-
B. Solve completely: y" +3y' - 4y = 1
-
Find the uniform continuous probability for P(X>603) for U(0, 1,000) round to 3 decimal spaces.
-
You are the CEO of an adult education business. You have registered a corporation with 6 shares and sustain a total payroll of $120,000 for the next year. You have 2 partners. VP OF SALES e marketing...
-
Suppose you have the above data on AAPL and Netflix, compute the expected return and the standard deviation of an equally weighted portfolio invested in the two securities. Please round to three...
-
1.Apply effective communication, interpersonal, team and problem solving skills to address workplace issues. 2.Communicate human resources management information accurately and credibly in oral,...
-
Sun & Surf produces Bomber Jackets and Sweat suits using the same facilities. Bomber Jacket Sweat suit Selling Price $120 $86 Variable Costs $ 72 $45 Bomber Jackets take 1 Direct Labor Hour and 1...
-
The polar coordinates of a point are given. Find the rectangular coordinates of the point. (-1, - /3)
-
In this exercise we review some basics of attitudes toward risk when tastes are state-independent and, in part B, we also verify some of the numbers that appear in the graphs of part A of the chapter...
-
In Section B of the text, we developed a model of tastes for diversified goods and then applied a particular functional form for such tastes to derive results, some of which we suggested hold for...
-
Federal anti-trust laws prohibit many forms of collusion in price setting between firms. Labor unions, however, are exempt from anti-trust laws and are allowed to use market power to raise wages for...
-
Which firms look best for someone wishing to buy stocks on margin?
-
Which firm looks best for someone planning to pay cash to buy 100 shares?
-
Examine all of the views available in the drop-down box menu (Snapshot, Performance, Portfolio, and Nuts and Bolts) to answer the following questions: a. Which fund has the best expense ratio? b....
John Frieda PROfiller PlusThickening Shampoo For Thin Fine Hair 250ml - ISBN: B0BRNPBZJ8 - Free Book
Study smarter with the SolutionInn App