Updated the path so that it will update when the 2nd point becomes the 1st point
This commit is contained in:
Binary file not shown.
@@ -467,7 +467,6 @@ public class Dataset {
|
|||||||
while (IDResult.next()) {
|
while (IDResult.next()) {
|
||||||
nextID = Integer.parseInt(IDResult.getString("seq")) + 1;//for some reason sqlite3 stores incremental values as a string...
|
nextID = Integer.parseInt(IDResult.getString("seq")) + 1;//for some reason sqlite3 stores incremental values as a string...
|
||||||
}
|
}
|
||||||
System.out.println(nextID);
|
|
||||||
stmt.close();
|
stmt.close();
|
||||||
stmt = c.createStatement();
|
stmt = c.createStatement();
|
||||||
String insertAirportQuery = "INSERT INTO `" + this.name + "_Airport` (`Name`, `City`, `Country`, `IATA/FFA`," +
|
String insertAirportQuery = "INSERT INTO `" + this.name + "_Airport` (`Name`, `City`, `Country`, `IATA/FFA`," +
|
||||||
@@ -1610,7 +1609,6 @@ public class Dataset {
|
|||||||
stmt.close();
|
stmt.close();
|
||||||
|
|
||||||
int index = flightPath.getFlightPoints().indexOf(flightPoint);
|
int index = flightPath.getFlightPoints().indexOf(flightPoint);
|
||||||
System.out.println(index);
|
|
||||||
|
|
||||||
if (index == 0){
|
if (index == 0){
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ public class FlightRDController extends Controller {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
updateTable(currentPathIndex);
|
updateTable(currentPathIndex);
|
||||||
|
updatePaths();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,6 +268,7 @@ public class FlightRDController extends Controller {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
updateTable(currentPathIndex);
|
updateTable(currentPathIndex);
|
||||||
|
updatePaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -281,6 +283,24 @@ public class FlightRDController extends Controller {
|
|||||||
flightTableView.refresh();
|
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.
|
* Will link to the flight analyser when implemented.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user