RouteConverter r = RouteConverter.getInstance();
r.getBatchPositionAugmenter().addData(new int[]{row}, true, true, true);
}
public void run() {
RouteConverter r = RouteConverter.getInstance();
boolean hasInsertedRowInMapCenter = false;
List<NavigationPosition> insertedPositions = new ArrayList<NavigationPosition>();
int[] rowIndices = revert(table.getSelectedRows());
// append to table if there is nothing selected
boolean areRowsSelected = rowIndices.length > 0; // TODO complicated logic, unify with BaseMapView#getAddRow
if (!areRowsSelected)
rowIndices = new int[]{table.getRowCount()};
for (int row : rowIndices) {
int insertRow = row > positionsModel.getRowCount() - 1 ? row : row + 1;
NavigationPosition center = areRowsSelected ? calculateCenter(row) :
positionsModel.getRowCount() > 0 ? calculateCenter(positionsModel.getRowCount() - 1) : null;
if (center == null) {
// only insert row in map center once
if (hasInsertedRowInMapCenter)
continue;
center = r.getMapCenter();
hasInsertedRowInMapCenter = true;
}
insertedPositions.add(insertRow(insertRow, center));
}