[Major] Removed Rocket FlightConfiguration event code

# FlightConfigurations have stubs of eventListening and dispatching code.
  - Removed code from FlightConfigurations
  - Removed code from calling classes
This commit is contained in:
Daniel_M_Williams 2015-12-23 23:25:03 -05:00
parent 0979cff505
commit ab643d5ab5
5 changed files with 3 additions and 29 deletions

View File

@ -27,7 +27,7 @@ import net.sf.openrocket.util.StateChangeListener;
* @author Sampo Niskanen <sampo.niskanen@iki.fi>
* @author Daniel Williams <equipoise@gmail.com>
*/
public class FlightConfiguration implements FlightConfigurableParameter<FlightConfiguration>, ChangeSource, ComponentChangeListener, Monitorable {
public class FlightConfiguration implements FlightConfigurableParameter<FlightConfiguration>, Monitorable {
private static final Logger log = LoggerFactory.getLogger(FlightConfiguration.class);
public final static String DEFAULT_CONFIGURATION_NAME = "Default Configuration";
@ -269,14 +269,6 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
//////////////// Listeners ////////////////
@Override
public void addChangeListener(StateChangeListener listener) {
}
@Override
public void removeChangeListener(StateChangeListener listener) {
}
// for outgoing events only
protected void fireChangeEvent() {
this.modID++;
@ -353,13 +345,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
return this.getName();
}
@Override
public void componentChanged(ComponentChangeEvent cce) {
// update according to incoming events
updateStages();
updateMotors();
}
/**
* Add a motor instance to this configuration.
*

View File

@ -32,7 +32,6 @@ public class StageSelector extends JPanel implements StateChangeListener {
updateButtons();
configuration.addChangeListener(this);
}
private void updateButtons() {
@ -65,7 +64,6 @@ public class StageSelector extends JPanel implements StateChangeListener {
public StageAction(final int stage) {
this.stageNumber = stage;
configuration.addChangeListener(this);
stateChanged(null);
}

View File

@ -401,7 +401,6 @@ public class ComponentAnalysisDialog extends JDialog implements StateChangeListe
theta.addChangeListener(this);
aoa.addChangeListener(this);
roll.addChangeListener(this);
configuration.addChangeListener(this);
this.stateChanged(null);
@ -415,7 +414,6 @@ public class ComponentAnalysisDialog extends JDialog implements StateChangeListe
aoa.removeChangeListener(ComponentAnalysisDialog.this);
mach.removeChangeListener(ComponentAnalysisDialog.this);
roll.removeChangeListener(ComponentAnalysisDialog.this);
configuration.removeChangeListener(ComponentAnalysisDialog.this);
//System.out.println("SETTING NAN VALUES");
rocketPanel.setCPAOA(Double.NaN);
rocketPanel.setCPTheta(Double.NaN);

View File

@ -43,12 +43,7 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
this.flightConfigurationPanel = flightConfigurationPanel;
this.rocket = rocket;
table = initializeTable();
rocket.getSelectedConfiguration().addChangeListener( new StateChangeListener() {
@Override
public void stateChanged(EventObject e) {
FlightConfigurablePanel.this.synchronizeConfigurationSelection();
}
});
installTableListener();
synchronizeConfigurationSelection();
}

View File

@ -118,8 +118,6 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe
this.add(tabs, "spanx, grow, wrap rel");
this.rocket.getSelectedConfiguration().addChangeListener(this);
}
private void addConfiguration() {
@ -146,7 +144,6 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe
}
}
rocket.setFlightConfiguration(newId, newConfig);
rocket.addComponentChangeListener( newConfig);
// Create a new simulation for this configuration.
createSimulationForNewConfiguration();