[bugfix] refixed motor loading code.

This commit is contained in:
Daniel_M_Williams 2015-11-29 17:42:14 -05:00
parent 1a036904c0
commit b1108a0c83
3 changed files with 8 additions and 7 deletions

View File

@ -382,10 +382,10 @@ public class BodyTube extends SymmetricComponent implements MotorMount, Coaxial
}else if( !this.equals( newMotorInstance.getMount())){ }else if( !this.equals( newMotorInstance.getMount())){
throw new BugException(" attempt to add a MotorInstance to a second mount, when it's already owned by another mount!"); throw new BugException(" attempt to add a MotorInstance to a second mount, when it's already owned by another mount!");
} }
this.motors.set(fcid,newMotorInstance);
} }
this.isActingMount=true; this.isActingMount=true;
this.motors.set(fcid,newMotorInstance);
} }

View File

@ -275,7 +275,7 @@ public class InnerTube extends ThicknessRingComponent implements Clusterable, Ra
@Override @Override
public void setMotorInstance(final FlightConfigurationID fcid, final MotorInstance newMotorInstance){ public void setMotorInstance(final FlightConfigurationID fcid, final MotorInstance newMotorInstance){
if((null == newMotorInstance)||(newMotorInstance.equals( MotorInstance.EMPTY_INSTANCE ))){ if((null == newMotorInstance)||(newMotorInstance== MotorInstance.EMPTY_INSTANCE )){
this.motors.set( fcid, null); this.motors.set( fcid, null);
}else{ }else{
if( null == newMotorInstance.getMount()){ if( null == newMotorInstance.getMount()){
@ -283,10 +283,10 @@ public class InnerTube extends ThicknessRingComponent implements Clusterable, Ra
}else if( !this.equals( newMotorInstance.getMount())){ }else if( !this.equals( newMotorInstance.getMount())){
throw new BugException(" attempt to add a MotorInstance to a second mount, when it's already owned by another mount!"); throw new BugException(" attempt to add a MotorInstance to a second mount, when it's already owned by another mount!");
} }
this.motors.set(fcid, newMotorInstance);
} }
this.isActingMount = true; this.isActingMount = true;
this.motors.set(fcid,newMotorInstance);
} }
@Override @Override

View File

@ -54,13 +54,16 @@ import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.border.BevelBorder; import javax.swing.border.BevelBorder;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener; import javax.swing.event.TreeSelectionListener;
import javax.swing.event.ChangeEvent;
import javax.swing.tree.DefaultTreeSelectionModel; import javax.swing.tree.DefaultTreeSelectionModel;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreeSelectionModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.miginfocom.swing.MigLayout; import net.miginfocom.swing.MigLayout;
import net.sf.openrocket.aerodynamics.WarningSet; import net.sf.openrocket.aerodynamics.WarningSet;
import net.sf.openrocket.document.OpenRocketDocument; import net.sf.openrocket.document.OpenRocketDocument;
@ -111,9 +114,6 @@ import net.sf.openrocket.util.StateChangeListener;
import net.sf.openrocket.util.TestRockets; import net.sf.openrocket.util.TestRockets;
import net.sf.openrocket.utils.ComponentPresetEditor; import net.sf.openrocket.utils.ComponentPresetEditor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class BasicFrame extends JFrame implements PropertyChangeListener { public class BasicFrame extends JFrame implements PropertyChangeListener {
private static final Logger log = LoggerFactory.getLogger(BasicFrame.class); private static final Logger log = LoggerFactory.getLogger(BasicFrame.class);
@ -755,6 +755,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
//// Debug log //// Debug log
item = new JMenuItem(trans.get("main.menu.help.debugLog")); item = new JMenuItem(trans.get("main.menu.help.debugLog"));
item.setIcon(Icons.HELP_DEBUG_LOG); item.setIcon(Icons.HELP_DEBUG_LOG);
menu.setMnemonic(KeyEvent.VK_D);
item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.help.debugLog.desc")); item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.help.debugLog.desc"));
item.addActionListener(new ActionListener() { item.addActionListener(new ActionListener() {
@Override @Override