Skip to content

Commit

Permalink
Merge pull request #385 from jburel/issue_360
Browse files Browse the repository at this point in the history
handle case where ROI is not longer in table
  • Loading branch information
jburel authored Sep 16, 2024
2 parents 6bf96ec + 9466472 commit 0fd8322
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,20 @@ void selectROI(List<Long> roiIDs)
l.add(array[j]);
}
if (roiIDs.size() <= l.size()) table.clearSelection();
// Check the number of rows
int count = table.getModel().getRowCount();
while (i.hasNext()) {
id = i.next();
if (rowIDs.containsKey(id)) {
index = rowIDs.get(id);
if (!l.contains(index)) {
table.addRowSelectionInterval(index, index);
scrollToRow(index);
if (index >= count) {
table.clearSelection();
break;
} else {
if (!l.contains(index)) {
table.addRowSelectionInterval(index, index);
scrollToRow(index);
}
}
}
}
Expand Down

0 comments on commit 0fd8322

Please sign in to comment.