Wired in remove deployment configuration.

This commit is contained in:
kruland2607 2012-10-17 09:26:18 -05:00
parent 3a8d2d5560
commit 1f445b2268
2 changed files with 11 additions and 2 deletions

View File

@ -82,7 +82,7 @@ public class RecoveryConfigurationPanel extends JPanel {
resetDeploymentButton.addActionListener(new ActionListener() { resetDeploymentButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
//resetDeployment; resetDeployment();
} }
}); });
this.add(resetDeploymentButton,"sizegroup button, wrap"); this.add(resetDeploymentButton,"sizegroup button, wrap");
@ -94,6 +94,10 @@ public class RecoveryConfigurationPanel extends JPanel {
d.setVisible(true); d.setVisible(true);
} }
private void resetDeployment() {
selectedComponent.setDeploymentConfiguration(rocket.getDefaultConfiguration().getMotorConfigurationID(), null);
}
private void updateButtonState() { private void updateButtonState() {
boolean buttonsEnabled = selectedComponent != null; boolean buttonsEnabled = selectedComponent != null;
selectDeploymentButton.setEnabled(buttonsEnabled); selectDeploymentButton.setEnabled(buttonsEnabled);

View File

@ -124,7 +124,12 @@ public abstract class RecoveryDevice extends MassObject {
} }
public void setDeploymentConfiguration( String configID, DeploymentConfiguration config ) { public void setDeploymentConfiguration( String configID, DeploymentConfiguration config ) {
if ( config == null ) {
deploymentConfigurations.remove(configID);
} else {
deploymentConfigurations.put(configID, config); deploymentConfigurations.put(configID, config);
}
} }
public DeployEvent getDefaultDeployEvent() { public DeployEvent getDefaultDeployEvent() {