Make separate method for notifySimsChanged since this is useful without creating or deleting a simulation (for example when a simulation is done executing).

This commit is contained in:
Kevin Ruland 2012-06-04 19:02:56 +00:00
parent bedcf4ecb5
commit 5faec59816

View File

@ -30,21 +30,23 @@ public class CurrentRocket {
return rocketDocument;
}
public void notifySimsChanged() {
if ( handler != null ) {
handler.simsChangedMessage();
}
}
public void addNewSimulation() {
Rocket rocket = rocketDocument.getRocket();
Simulation newSim = new Simulation(rocket);
newSim.setName(rocketDocument.getNextSimulationName());
rocketDocument.addSimulation(newSim);
if ( handler != null ) {
handler.simsChangedMessage();
}
notifySimsChanged();
}
public void deleteSimulation( int simulationPos ) {
rocketDocument.removeSimulation( simulationPos );
if ( handler != null ) {
handler.simsChangedMessage();
}
notifySimsChanged();
}
public String addNewMotorConfig() {