Fixed JUnitTests as well as added a few tweaks to the flight point moving
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -2098,11 +2098,6 @@ public class Dataset {
|
|||||||
int curIndex = flightPath.getFlightPoints().indexOf(flightPoint);
|
int curIndex = flightPath.getFlightPoints().indexOf(flightPoint);
|
||||||
flightPath.getFlightPoints().remove(flightPoint);
|
flightPath.getFlightPoints().remove(flightPoint);
|
||||||
int indexToAdd = index;
|
int indexToAdd = index;
|
||||||
if (curIndex < index){
|
|
||||||
indexToAdd --;
|
|
||||||
}else{
|
|
||||||
indexToAdd ++;
|
|
||||||
}
|
|
||||||
flightPath.getFlightPoints().add(indexToAdd, flightPoint);
|
flightPath.getFlightPoints().add(indexToAdd, flightPoint);
|
||||||
|
|
||||||
Connection c = null;
|
Connection c = null;
|
||||||
@@ -2118,7 +2113,7 @@ public class Dataset {
|
|||||||
}
|
}
|
||||||
stmt.close();
|
stmt.close();
|
||||||
|
|
||||||
if (index == 0){
|
if (index == 0 || curIndex == 0){
|
||||||
try {
|
try {
|
||||||
stmt = c.createStatement();
|
stmt = c.createStatement();
|
||||||
String query = "UPDATE `"+this.name+"_Flight_Path` SET `Source_Airport` = \""+flightPoint.getName().replace("\"", "\"\"")+"\" " +
|
String query = "UPDATE `"+this.name+"_Flight_Path` SET `Source_Airport` = \""+flightPoint.getName().replace("\"", "\"\"")+"\" " +
|
||||||
@@ -2129,7 +2124,7 @@ public class Dataset {
|
|||||||
System.err.println( e.getClass().getName() + ": " + e.getMessage() );
|
System.err.println( e.getClass().getName() + ": " + e.getMessage() );
|
||||||
}
|
}
|
||||||
flightPath.setDepartureAirport(flightPoint.getName());
|
flightPath.setDepartureAirport(flightPoint.getName());
|
||||||
}else if (index == flightPath.getFlightPoints().size() - 1){
|
}else if (index == flightPath.getFlightPoints().size() - 1 || curIndex == flightPath.getFlightPoints().size() - 1){
|
||||||
try {
|
try {
|
||||||
stmt = c.createStatement();
|
stmt = c.createStatement();
|
||||||
String query = "UPDATE `"+this.name+"_Flight_Path` SET `Destination_Airport` = \""+flightPoint.getName().replace("\"", "\"\"")+"\" " +
|
String query = "UPDATE `"+this.name+"_Flight_Path` SET `Destination_Airport` = \""+flightPoint.getName().replace("\"", "\"\"")+"\" " +
|
||||||
|
|||||||
Reference in New Issue
Block a user