Added a dialog box that displays when no simulations are selected.
This commit is contained in:
parent
eaed44864c
commit
cd255e1828
@ -23,9 +23,6 @@ import javax.swing.ListSelectionModel;
|
|||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.table.DefaultTableCellRenderer;
|
import javax.swing.table.DefaultTableCellRenderer;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import net.sf.openrocket.aerodynamics.Warning;
|
import net.sf.openrocket.aerodynamics.Warning;
|
||||||
import net.sf.openrocket.aerodynamics.WarningSet;
|
import net.sf.openrocket.aerodynamics.WarningSet;
|
||||||
@ -48,6 +45,9 @@ import net.sf.openrocket.startup.Application;
|
|||||||
import net.sf.openrocket.startup.Preferences;
|
import net.sf.openrocket.startup.Preferences;
|
||||||
import net.sf.openrocket.unit.UnitGroup;
|
import net.sf.openrocket.unit.UnitGroup;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class SimulationPanel extends JPanel {
|
public class SimulationPanel extends JPanel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(SimulationPanel.class);
|
private static final Logger log = LoggerFactory.getLogger(SimulationPanel.class);
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
@ -130,9 +130,11 @@ public class SimulationPanel extends JPanel {
|
|||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
int[] selection = simulationTable.getSelectedRows();
|
int[] selection = simulationTable.getSelectedRows();
|
||||||
if (selection.length == 0)
|
if (selection.length == 0) {
|
||||||
return; // TODO: LOW: "None selected" dialog
|
JOptionPane.showMessageDialog(simulationTable, "No simulations selected.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Simulation[] sims = new Simulation[selection.length];
|
Simulation[] sims = new Simulation[selection.length];
|
||||||
for (int i = 0; i < selection.length; i++) {
|
for (int i = 0; i < selection.length; i++) {
|
||||||
selection[i] = simulationTable.convertRowIndexToModel(selection[i]);
|
selection[i] = simulationTable.convertRowIndexToModel(selection[i]);
|
||||||
@ -512,7 +514,6 @@ public class SimulationPanel extends JPanel {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ListSelectionModel getSimulationListSelectionModel() {
|
public ListSelectionModel getSimulationListSelectionModel() {
|
||||||
return simulationTable.getSelectionModel();
|
return simulationTable.getSelectionModel();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user