int[] selectedTableRowIndices = table.getSelectedRows();
List<PeriodAnalysisDataPoint> inputDataPoints = new ArrayList<PeriodAnalysisDataPoint>();
for (int row : selectedTableRowIndices) {
int modelRow = table.convertRowIndexToModel(row);
PeriodAnalysisDataPoint dataPoint = model
.getDataPointFromRow(modelRow);
if (!refinedDataPoints.contains(dataPoint)) {
inputDataPoints.add(dataPoint);
freqs.add(dataPoint.getFrequency());
} else {
String msg = String.format("Top Hit with frequency %s"
+ " and power %s"
+ " has previously been used.",
NumericPrecisionPrefs.formatOther(dataPoint
.getFrequency()), NumericPrecisionPrefs
.formatOther(dataPoint.getPower()));
MessageBox.showErrorDialog(parent, algorithm
.getRefineByFrequencyName(), msg);
freqs.clear();
break;
}
if (resultantDataPoints.contains(dataPoint)) {
String msg = String.format("Top Hit with frequency %s"
+ " and power %s"
+ " was generated by %s so cannot be used.",
dataPoint.getFrequency(), dataPoint.getPower(),
algorithm.getRefineByFrequencyName());
MessageBox.showErrorDialog(parent, algorithm
.getRefineByFrequencyName(), msg);
freqs.clear();
break;