Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Java fx or swing can be used for this GUI. The GUI The GUI will have four sections: an Add Town section, an Add Road

Java fx or swing can be used for this GUI. image text in transcribedThe GUI

The GUI will have four sections: an Add Town section, an Add Road section, a Find Connection section, and an administration section. There will be four ComboBoxes each containing the same list of Towns. On startup the graph will be empty.

Add a Town Button

The user may add a new Town by typing its name in the textfield. If the textfield is blank when the Add Town button is selected, the GUI should show an error message. When a new Town is added, the TownGraphManager will add it to the graph, and the Towns name will be added to the four ComboBoxes.

Add a Road Button

To add a road, a town must be selected from each of the two ComboBoxes in the Add Road section, an integer distance entered, and a road name entered. When the Add Road button is selected, the edge is created and entered in the graph.

Find Connection Button

Display all the available towns in the ComboBoxes (in alpha order by name). When the user selects the towns, display the name in the ComboBoxes. When the user selects the Find Connection button, the TownGraphManagers shortestPath method is called. The resulting list of roads connecting towns, and the distance along each road, is displayed in the text area.

Read File Button

The Towns.txt files hold information for individual Towns and Roads, and is in the following format:

road-name,miles;town-name;town-name

For example:

I-94,282;Chicago;Detroit

Notice that the road-name and miles are separated by a comma, while the road information and the two towns are separated by semi-colons.

Exit Button

The program will terminate

Travelling Student Add Town Town Name: Add Town Add Road Road Name: Select towns for road distance Add Road Find Connection Find connection from Bethesda to Find Connection Bethesda Boyds Clarksburg Frederick Read File Olney Poolesville Potomac Find Connection Find connection from Bethesda | Find Connection Bethesda via 1270-S to Rockville 7 mi Rockville via 1270-SC to Gaithersburg 7 mi Gaithersburg via 1270-C to Germantown 6 mi Germantown via 1270-NC to Clarksburg 5 mi Read File Exit Travelling Student Add Town Town Name: Add Town Add Road Road Name: Select towns for road distance Add Road Find Connection Find connection from Bethesda to Find Connection Bethesda Boyds Clarksburg Frederick Read File Olney Poolesville Potomac Find Connection Find connection from Bethesda | Find Connection Bethesda via 1270-S to Rockville 7 mi Rockville via 1270-SC to Gaithersburg 7 mi Gaithersburg via 1270-C to Germantown 6 mi Germantown via 1270-NC to Clarksburg 5 mi Read File Exit

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_2

Step: 3

blur-text-image_3

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students explore these related Databases questions