Question: 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

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.
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.
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
Get step-by-step solutions from verified subject matter experts
