Use a gui interface to control and display result of program

Assignment Help JAVA Programming
Reference no: EM13325809

Implement a program to:

- use a GUI interface to control and display the results of the program,
- read a text data file,
- instantiate appropriate classes,
- create an appropriate internal (multi-tree) data structure,
- display the structure in a convincing way using a JTextArea, and
- search the structure.

Elaboration:

The scenario is inspired by a Library Management System (LIMS). For the first version of the project, the LIMS is a very basic one, allowing just for the import of data from a text file and perfom some basic search operations.

The elements of the LIMS are: the Library itself (let's consider just one instance for now) that contains a collection of Authors. Each Author
includes a collection of Books he/she published.

Eventually (in the next versions of the project), there will be clients that will concurrently access the LIMS in order to borrow/return book
copies.

The Author and Book classes will have some attributes, mainly used for searching and sorting.

1. Required data structure - the data structure I want you to implement is a multi-tree with the following levels:

1. Library - Level 0
2. Author - Level 1
3. Book - Level 2

2. Use at least the following classes, you are free to define others in the spirit of this application.

Specifications for a few classes - you are free to add to this list.

- Library
- ArrayList as an instance variable data structure
- Author - index, a name, an address and list of a number of Books (accessed by links to instances of the Book class).
- ArrayList as an instance variable data structure
- Book - index, a title, a genre, author by index
3. Use the ArrayList class to hold instances of the classes defined in item 1. Be sure to use generics appropriately.
4. Use a text data file with the following format - which you may extend, and may be extended in the later projects. As a minimum, each item should be specified by a single line in the data file. The initial fields should be used during the instantiation of objects and your program should ignore later fields that are not used. For simplicity, let us assume that the fields are separated by colons. The specifications look something like the following, where the angle brackets are not part of the actual data file. I think we can assume that name, address, title and genre are strings.

- b:::::
- a:::
Your program should
- work if there are additional fields on some lines,
- ignore blank lines,
- ignore lines starting with a / (as comments),
- accept spaces within names and types, and
- ignore extra spaces around the :'s nicely.

1. All the classes should be provided with appropriate:
- constructors
- toString implementations
- additional methods
- instance variables connecting the class to appropriate instances of other classes

1. A GUI that will allow the user to do at least the following operations:
- Select the data file at run time, using JFileChooser starting at dot.
- Show the internal data structures in a text area
- Search for an item by index, title or genre. For example, the book whose title is "Java Basics".
- Resize nicely in a JFrame.

1. The GUI class(es) should be distinct from the other classes in the program. Hmm - this is the statement in the common syllabus, but I am not so sure this is always a good idea, nor exactly how appropriate this requirement is for this project. This is an interesting topic to explore in the Weekly Conference.

Deliverables

1. Java source code files
2. any configuration files used including your data file
3. a well-written document including the following sections:

1. Design: including a UML class diagram showing the type of the class relationships

2. User's Guide: description of how to set up and run your application

3. Test Plan: sample input and *expected* results, and including test data and results, with screen snapshots of some of your test cases

4. (optionally) Comments: design strengths and limitations, and suggestions for future improvement and alternative approaches

5. Lessons Learned

6. Use one of the following formats: MS Word doc, docx, OpenOffice odf, pdf, rtf.

Format

(The following is from the standard syllabus, but I really don't care about any of these details. Your document should be easy to read and convey the information about your project in a reasonable manner. If you wish to follow a style, I would suggest IEEE or ACM style rather than APA.)

Documentation format and length. The documentation describing and reflecting on your design and approach should be written using  Microsoft Word, and should be no more than five pages in length and no less than two pages. The font size should be 12 point. The page margins should be one inch. The paragraphs should be double spaced. All figures, tables, equations, and references should be properly labeled and formatted using APA style.

- Code format:
- header comment block, including the following information in each source code file:
- file name
- date
- author
- purpose
- appropriate comments within the code
- appropriate variable and function names
- correct indentation
Sample data file:
// sample data file for CMSC 335, Spring 2014
// Mihaela Dinsoreanu
// Jan 5, 2014
// Books format:
// b:::::
b : 10001 : Java Basics : Science : 11.50 : 20001
b : 10002 : Advanced Java : Science : 10.99 : 20001
// Authors format:
// a:::
a : 20001 : John Smith : Computers St. 50 Seattle
a : 20002 : Mary Jones : Literature Lane 25
------------------------------
Some more thoughts you might want to consider:

Generally, the project should be what call "in the Java spirit" - by which I mean defining and using classes, variables and methods appropriately.

Some examples:

1. You should ask yourself if it makes sense to instantiate a class more than once. This has implications for which variables should be local to a method, which methods should be instance vs class (static) and which variables should be instance vs class.

2. For example, if you are going to use a class like a Library class to contain everything, it makes sense to have more than one library, and
each library could have its own data file.

3. In a Library, some students have pointed out the there might be other types of publications besides Books. How should we handle these?

I suggest a single data structure to handle the lot - an ArrayList is most appropriate, but that structure is generic, so what kind of generic declaration should we use, perhaps ArrayList , but that seems like a too general structure since we don't really want stuff like JLabel or JButton this structure. Thus, we are lead to proposing another class, say LibraryElement, and the Book class should extend this class, and then we can use the following declaration: ArrayList to hold stuff that is just lying around.

Reference no: EM13325809

Questions Cloud

The initial temperature is 25.8 c and the final temperature : In order to measure the enthalpy change for this reaction, 1.25 g of NH4NO3 is dissolved in enough water to make 25.0mL of solution. The initial temperature is 25.8 C and the final temperature
Determine the horizontal velocity of the arrow : the next two questions refire to the following scenario. Determine the horizontal velocity of the arrow
Explain the mechanism for each step of the reaction scheme : Show the mechanism for each step of the following reaction scheme- 3-methyl-1-pentene in CH2Cl2 treated with HBr, then NaOH, 1/3 mol equivalent of BH3?tHF and then H2O2/NaOH
Find the angle that the net force makes : One component of a magnetic field has a magnitude of 0.054 T and points along the +x axis, Determine the angle that the net force makes with respect to the +x axis
Use a gui interface to control and display result of program : The scenario is inspired by a Library Management System (LIMS). For the first version of the project, the LIMS is a very basic one, allowing just for the import of data from a text file and perfom some basic search operations.
State the final pressure in atm of a 3.05 l system initially : What is the final pressure in atm of a 3.05 L system initially at 724 mm Hg and 298 K, that is compressed to a final volume of 2.51 L at 273 K?
Define equivalent of nanh2 : Give the structure of the products that you would expect from the reaction of 1-butyne with each of the following: a) 1 mol equivalent of BR2 b) 1 mole equivalent of HBr c) H2 in excess/Pt, then 3 mol equivalent of NaNH2 and then CH3I d) NaNH2 the..
Calculate how far did the spring compress : A block of mass 1.00kg slides along a horizontal table with speed V0 = 2.50m/s. How far did the spring compress when the block first momentary comes to rest
Explain what volume of the gas at stp would be produced : A mass of 0.0600 g of magnesium metal is completely reacted with excess hydrochloric acid. Write the balanced equation to answer the question. What volume of the gas at STP would be produced

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