Fixed bug with flight pages and an empty dataset

main
Liam Beckett 9 years ago
parent 04481661c4
commit e51aaaa7f2

Binary file not shown.

@ -115,6 +115,7 @@ public class FlightRDController extends Controller {
* Used to load the table for the Flight points initially from the MenuController
*/
public void load() {
if (theDataSet != null) {
theDataSet = getParent().getCurrentDataset();
try {
currentPathId = theDataSet.getFlightPaths().get(0).getID(); //Sets the default to the 1st Path
@ -136,6 +137,7 @@ public class FlightRDController extends Controller {
ArrayList<FlightPoint> flightPoints = flightPaths.get(0).getFlight();
flightTableView.setItems(FXCollections.observableArrayList(flightPoints));
}
}
/**
* Will take the inputs from the text fields and adds the point to the current flight path.
@ -318,7 +320,9 @@ public class FlightRDController extends Controller {
@Override
public void loadOnce(){
if (theDataSet != null) {
flightPathListView();
}
}
}

@ -177,11 +177,12 @@ public class FlightSummaryController extends Controller {
* Used to load the page from the MenuController.
*/
public void load() {
if (theDataSet != null) {
try {
theDataSet = getParent().getCurrentDataset();
ArrayList<FlightPath> flightPaths;
flightPaths = theDataSet.getFlightPaths();
for(int i = 0; i<flightPaths.size(); i++ ){
for (int i = 0; i < flightPaths.size(); i++) {
int pathID = flightPaths.get(i).getID();
String pathSource = flightPaths.get(i).departsFrom();
String pathDestin = flightPaths.get(i).arrivesAt();
@ -190,13 +191,12 @@ public class FlightSummaryController extends Controller {
}
flightPathListView.setItems(flightList);
flightSummaryListView();
} catch (Exception e) {
e.printStackTrace();
}
if (theDataSet.getFlightPaths().size() > 0){
if (theDataSet.getFlightPaths().size() > 0) {
map = new Map(mapView, theDataSet.getFlightPaths().get(0).getRoutePath());
}else{
} else {
map = new Map(mapView, new RoutePath());
}
flightPathListView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() {
@ -208,6 +208,7 @@ public class FlightSummaryController extends Controller {
}
});
}
}
/**
* Removes the selected path from the list view of paths and from the database.
*/

Loading…
Cancel
Save