diff --git a/swing/src/net/sf/openrocket/gui/dialogs/motor/thrustcurve/MotorFilterPanel.java b/swing/src/net/sf/openrocket/gui/dialogs/motor/thrustcurve/MotorFilterPanel.java index 31ebf72bd..421c4f3c8 100644 --- a/swing/src/net/sf/openrocket/gui/dialogs/motor/thrustcurve/MotorFilterPanel.java +++ b/swing/src/net/sf/openrocket/gui/dialogs/motor/thrustcurve/MotorFilterPanel.java @@ -344,8 +344,6 @@ public abstract class MotorFilterPanel extends JPanel { ((SwingPreferences) Application.getPreferences()).putBoolean("motorFilterLimitLength", limitLength); if ( mountLength != null & limitLength ) { lengthSlider.setValueAt(1, (int) Math.min(1000,Math.round(1000*mountLength))); - } else { - lengthSlider.setValueAt(1, 1000); } } @@ -363,8 +361,6 @@ public abstract class MotorFilterPanel extends JPanel { i--; } diameterSlider.setValueAt(1, i-1); - } else { - diameterSlider.setValueAt(1, diameterValues.length-1); } } diff --git a/swing/src/net/sf/openrocket/gui/main/flightconfigpanel/MotorConfigurationPanel.java b/swing/src/net/sf/openrocket/gui/main/flightconfigpanel/MotorConfigurationPanel.java index 538eb9709..0bb128a4b 100644 --- a/swing/src/net/sf/openrocket/gui/main/flightconfigpanel/MotorConfigurationPanel.java +++ b/swing/src/net/sf/openrocket/gui/main/flightconfigpanel/MotorConfigurationPanel.java @@ -49,11 +49,15 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel private final JButton selectMotorButton, removeMotorButton, selectIgnitionButton, resetIgnitionButton; + private final MotorChooserDialog motorChooserDialog; protected FlightConfigurableTableModel configurationTableModel; MotorConfigurationPanel(final FlightConfigurationPanel flightConfigurationPanel, Rocket rocket) { super(flightConfigurationPanel,rocket); + motorChooserDialog = new MotorChooserDialog(SwingUtilities.getWindowAncestor(flightConfigurationPanel)); + + { //// Select motor mounts JPanel subpanel = new JPanel(new MigLayout("")); @@ -177,13 +181,12 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel MotorConfiguration config = mount.getMotorConfiguration().get(id); - MotorChooserDialog dialog = new MotorChooserDialog( - mount, - id, - SwingUtilities.getWindowAncestor(flightConfigurationPanel)); - dialog.setVisible(true); - Motor m = dialog.getSelectedMotor(); - double d = dialog.getSelectedDelay(); + motorChooserDialog.setMotorMountAndConfig(mount, id); + + motorChooserDialog.setVisible(true); + + Motor m = motorChooserDialog.getSelectedMotor(); + double d = motorChooserDialog.getSelectedDelay(); if (m != null) { config = new MotorConfiguration(); @@ -257,7 +260,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel } c.setBorder(b); } - + @Override public Component getTableCellRendererComponent(JTable table,Object value, boolean isSelected, boolean hasFocus, int row,int column) { switch (column) { @@ -289,7 +292,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel label.add(ignitionLabel); label.validate(); return label; -// label.setText(motorString + " " + ignitionString); + // label.setText(motorString + " " + ignitionString); } private String getMotorSpecification(MotorMount mount, MotorConfiguration motorConfig) {