Fixed the move up and down bugs on for the first and last points in a path.
This commit is contained in:
@@ -250,7 +250,9 @@ public class FlightRDController extends Controller {
|
|||||||
FlightPoint toMove = flightTableView.getSelectionModel().getSelectedItem();
|
FlightPoint toMove = flightTableView.getSelectionModel().getSelectedItem();
|
||||||
int toMoveIndex = flightTableView.getSelectionModel().getSelectedIndex();
|
int toMoveIndex = flightTableView.getSelectionModel().getSelectedIndex();
|
||||||
try{
|
try{
|
||||||
|
if (toMoveIndex != 0) {
|
||||||
theDataSet.moveFlightPoint(toMove, toMoveIndex - 1);
|
theDataSet.moveFlightPoint(toMove, toMoveIndex - 1);
|
||||||
|
}
|
||||||
} catch (DataException e) {
|
} catch (DataException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -263,7 +265,9 @@ public class FlightRDController extends Controller {
|
|||||||
FlightPoint toMove = flightTableView.getSelectionModel().getSelectedItem();
|
FlightPoint toMove = flightTableView.getSelectionModel().getSelectedItem();
|
||||||
int toMoveIndex = flightTableView.getSelectionModel().getSelectedIndex();
|
int toMoveIndex = flightTableView.getSelectionModel().getSelectedIndex();
|
||||||
try{
|
try{
|
||||||
|
if (toMoveIndex != flightTableView.getItems().size()-1) {
|
||||||
theDataSet.moveFlightPoint(toMove, toMoveIndex + 1);
|
theDataSet.moveFlightPoint(toMove, toMoveIndex + 1);
|
||||||
|
}
|
||||||
} catch (DataException e) {
|
} catch (DataException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user