From 1f445b2268497ec1a6cc34d01e64f88fdb8b196f Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Wed, 17 Oct 2012 09:26:18 -0500 Subject: [PATCH] Wired in remove deployment configuration. --- .../flightconfiguration/RecoveryConfigurationPanel.java | 6 +++++- .../net/sf/openrocket/rocketcomponent/RecoveryDevice.java | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/src/net/sf/openrocket/gui/dialogs/flightconfiguration/RecoveryConfigurationPanel.java b/core/src/net/sf/openrocket/gui/dialogs/flightconfiguration/RecoveryConfigurationPanel.java index 624b70831..ef3eb16f4 100644 --- a/core/src/net/sf/openrocket/gui/dialogs/flightconfiguration/RecoveryConfigurationPanel.java +++ b/core/src/net/sf/openrocket/gui/dialogs/flightconfiguration/RecoveryConfigurationPanel.java @@ -82,7 +82,7 @@ public class RecoveryConfigurationPanel extends JPanel { resetDeploymentButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - //resetDeployment; + resetDeployment(); } }); this.add(resetDeploymentButton,"sizegroup button, wrap"); @@ -94,6 +94,10 @@ public class RecoveryConfigurationPanel extends JPanel { d.setVisible(true); } + private void resetDeployment() { + selectedComponent.setDeploymentConfiguration(rocket.getDefaultConfiguration().getMotorConfigurationID(), null); + } + private void updateButtonState() { boolean buttonsEnabled = selectedComponent != null; selectDeploymentButton.setEnabled(buttonsEnabled); diff --git a/core/src/net/sf/openrocket/rocketcomponent/RecoveryDevice.java b/core/src/net/sf/openrocket/rocketcomponent/RecoveryDevice.java index da472a47f..1a543a696 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/RecoveryDevice.java +++ b/core/src/net/sf/openrocket/rocketcomponent/RecoveryDevice.java @@ -124,7 +124,12 @@ public abstract class RecoveryDevice extends MassObject { } public void setDeploymentConfiguration( String configID, DeploymentConfiguration config ) { - deploymentConfigurations.put(configID, config); + if ( config == null ) { + deploymentConfigurations.remove(configID); + } else { + deploymentConfigurations.put(configID, config); + + } } public DeployEvent getDefaultDeployEvent() {