if (fromIndex == 0 && toIndex == 0)
break;
List<NavigationPosition> positions = positionsModel.getPositions(fromIndex, toIndex);
positionsModel.remove(fromIndex, toIndex);
NavigationFormat format = formatAndRoutesModel.getFormat();
@SuppressWarnings({"unchecked"})
BaseRoute<BaseNavigationPosition, BaseNavigationFormat> target =
format.createRoute(selectedRoute.getCharacteristics(), getRouteName(selectedRoute, routeInsertIndex), positions);
formatAndRoutesModel.addPositionList(routeInsertIndex, target);
}
final int selectedRow = max(selectedRows[selectedRows.length - 1] - 1, 0);
invokeLater(new Runnable() {