Started work on the ordering of flight points
This commit is contained in:
@@ -2100,9 +2100,6 @@ public class Dataset {
|
||||
int curIndex = flightPath.getFlightPoints().indexOf(flightPoint);
|
||||
flightPath.getFlightPoints().remove(flightPoint);
|
||||
int indexToAdd = index;
|
||||
if (curIndex < index){
|
||||
indexToAdd --;
|
||||
}
|
||||
flightPath.getFlightPoints().add(indexToAdd, flightPoint);
|
||||
|
||||
Connection c = null;
|
||||
|
||||
@@ -246,6 +246,29 @@ public class FlightRDController extends Controller {
|
||||
flightPathListView();
|
||||
}
|
||||
|
||||
public void movePointUp(){
|
||||
FlightPoint toMove = flightTableView.getSelectionModel().getSelectedItem();
|
||||
int toMoveIndex = flightTableView.getSelectionModel().getSelectedIndex();
|
||||
try{
|
||||
theDataSet.moveFlightPoint(toMove, toMoveIndex-1);
|
||||
} catch (DataException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
updateTable(currentPathIndex);
|
||||
|
||||
}
|
||||
|
||||
public void movePointDown(){
|
||||
FlightPoint toMove = flightTableView.getSelectionModel().getSelectedItem();
|
||||
int toMoveIndex = flightTableView.getSelectionModel().getSelectedIndex();
|
||||
try{
|
||||
theDataSet.moveFlightPoint(toMove, toMoveIndex+1);
|
||||
} catch (DataException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
updateTable(currentPathIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the table so that when the database is changed (deleted or edited) it still shows the correct data values.
|
||||
* @param currentPathIndex The index of the current path in the Path array list.
|
||||
|
||||
@@ -96,12 +96,8 @@ public class FlightSummaryController extends Controller {
|
||||
Airport sourceAirport = null;
|
||||
Airport destinationAirport = null;
|
||||
|
||||
System.out.println(firstPointICAO);
|
||||
System.out.println(lastPointICAO);
|
||||
|
||||
for (int i=0; i < airportList.size(); i++){
|
||||
Airport current = airportList.get(i);
|
||||
System.out.println(current.getICAO());
|
||||
if(current.getICAO().equals(firstPointICAO)){
|
||||
sourceAirport = current;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user