[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:
parent
0979cff505
commit
ab643d5ab5
@ -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,12 +345,6 @@ 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.
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user