Updated the path so that it will update when the 2nd point becomes the 1st point

main
Liam Beckett 9 years ago
parent 0e1442e401
commit 805eee58af

Binary file not shown.

@ -467,7 +467,6 @@ public class Dataset {
while (IDResult.next()) {
nextID = Integer.parseInt(IDResult.getString("seq")) + 1;//for some reason sqlite3 stores incremental values as a string...
}
System.out.println(nextID);
stmt.close();
stmt = c.createStatement();
String insertAirportQuery = "INSERT INTO `" + this.name + "_Airport` (`Name`, `City`, `Country`, `IATA/FFA`," +
@ -1610,7 +1609,6 @@ public class Dataset {
stmt.close();
int index = flightPath.getFlightPoints().indexOf(flightPoint);
System.out.println(index);
if (index == 0){
try {

@ -255,6 +255,7 @@ public class FlightRDController extends Controller {
e.printStackTrace();
}
updateTable(currentPathIndex);
updatePaths();
}
@ -267,6 +268,7 @@ public class FlightRDController extends Controller {
e.printStackTrace();
}
updateTable(currentPathIndex);
updatePaths();
}
/**
@ -281,6 +283,24 @@ public class FlightRDController extends Controller {
flightTableView.refresh();
}
private void updatePaths(){
try {
flightPathListView.getItems().clear();
ArrayList<FlightPath> flightPaths;
flightPaths = theDataSet.getFlightPaths();
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();
String flightPathDisplayName = Integer.toString(pathID) + "_" + pathSource + "_" + pathDestin;
flightList.add(flightPathDisplayName);
}
flightPathListView.setItems(flightList);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Will link to the flight analyser when implemented.
*/

Loading…
Cancel
Save