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:
parent
bedcf4ecb5
commit
5faec59816
@ -30,21 +30,23 @@ public class CurrentRocket {
|
|||||||
return rocketDocument;
|
return rocketDocument;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void notifySimsChanged() {
|
||||||
|
if ( handler != null ) {
|
||||||
|
handler.simsChangedMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void addNewSimulation() {
|
public void addNewSimulation() {
|
||||||
Rocket rocket = rocketDocument.getRocket();
|
Rocket rocket = rocketDocument.getRocket();
|
||||||
Simulation newSim = new Simulation(rocket);
|
Simulation newSim = new Simulation(rocket);
|
||||||
newSim.setName(rocketDocument.getNextSimulationName());
|
newSim.setName(rocketDocument.getNextSimulationName());
|
||||||
rocketDocument.addSimulation(newSim);
|
rocketDocument.addSimulation(newSim);
|
||||||
if ( handler != null ) {
|
notifySimsChanged();
|
||||||
handler.simsChangedMessage();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteSimulation( int simulationPos ) {
|
public void deleteSimulation( int simulationPos ) {
|
||||||
rocketDocument.removeSimulation( simulationPos );
|
rocketDocument.removeSimulation( simulationPos );
|
||||||
if ( handler != null ) {
|
notifySimsChanged();
|
||||||
handler.simsChangedMessage();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String addNewMotorConfig() {
|
public String addNewMotorConfig() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user