Merge pull request #1855 from SiboVG/issue-1813
[#1813] Update previous selection on sim addition/deletion
This commit is contained in:
commit
eb8d7615ab
@ -275,6 +275,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
simulationTableModel.fireTableDataChanged();
|
simulationTableModel.fireTableDataChanged();
|
||||||
simulationTable.clearSelection();
|
simulationTable.clearSelection();
|
||||||
simulationTable.addRowSelectionInterval(n, n);
|
simulationTable.addRowSelectionInterval(n, n);
|
||||||
|
updatePreviousSelection();
|
||||||
|
|
||||||
openDialog(false, sim);
|
openDialog(false, sim);
|
||||||
}
|
}
|
||||||
@ -347,6 +348,7 @@ public class SimulationPanel extends JPanel {
|
|||||||
document.removeSimulation(selection[i]);
|
document.removeSimulation(selection[i]);
|
||||||
}
|
}
|
||||||
simulationTableModel.fireTableDataChanged();
|
simulationTableModel.fireTableDataChanged();
|
||||||
|
updatePreviousSelection();
|
||||||
takeTheSpotlight();
|
takeTheSpotlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1007,6 +1009,9 @@ public class SimulationPanel extends JPanel {
|
|||||||
} else {
|
} else {
|
||||||
simulationTable.clearSelection();
|
simulationTable.clearSelection();
|
||||||
for (int row : previousSelection) {
|
for (int row : previousSelection) {
|
||||||
|
if (row < 0 || row >= simulationTable.getRowCount()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
simulationTable.addRowSelectionInterval(row, row);
|
simulationTable.addRowSelectionInterval(row, row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user