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

  If there are 4 command line arguments

If there are 4 command line arguments (a b c filename.dat) then the engine should take a,b,c and store the resulting x1 and x2 in filename.dat working in silent mode (no use of screen)

  Implement security so that all users can view the informatio

Implement security so that all users can view the information about the projects, but only authenticated users

  Write a functions that takes an array of doubles

1. Write a function that is passed a single integer and then calculates the factorial of that number. A factorial is the product of the integer times all of the integers below it stopping at 1. So n!= n*(n-1)*(n-2).......3.2.1

  Program that counts the number of occurrences of lowercase

Write a program that counts the number of occurrences of lowercase and uppercase vowels in entered lines of text. Use a two-dimensional array to store the vowel counts. The array's first column holds the counts for the lowercase vowels, and the secon..

  All your code should be in the main method

Write a Java test program, all your code should be in the main method, that asks the user for two numbers representing an investment value and interest rate

  What is overloading and what is overriding

What is overloading and what is overriding? Please use code to explain it.

  Minimal spanning tree decreasing edge dismissal

Minimal Spanning Tree Decreasing Edge Dismissal, Reverse-delete algorithm. Develop an implementation that computes the MST

  What is relationship between hashing and digital signatures

The security advantages of using two-factor authentication, such as the integrated fingerprint reader in the more recent iPhone models, particularly to support internet services (such as online banking)

  Java application to permit user to enter ten numbers

Write down Java application which permits a user to enter 10 numbers (double precision) into the array and then sorts and displays numbers from lowest to highest.

  Uses a loop to populate a one-dimensional array

Write the following program that creates and uses a loop to populate a one-dimensional array that holds the even numbers between 1 and 12; creates and uses a loop to populate a second one-dimensional array that holds the odd numbers between 1 and 12;..

  Create a java program to calculate the circumference

Create a Java program based on the geometric shapes. The program should begin by prompting you for the shape you want to calculate the circumference.

  Calculate payback period and net present value

Calculate payback period (PBP), net present value (NPV), and internal rate of return (IRR). Which project do you recommend for development? Support your recommendation.

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