From 5faec5981630b0b6c236326491dee9ea610d3e71 Mon Sep 17 00:00:00 2001 From: Kevin Ruland Date: Mon, 4 Jun 2012 19:02:56 +0000 Subject: [PATCH] Make separate method for notifySimsChanged since this is useful without creating or deleting a simulation (for example when a simulation is done executing). --- .../net/sf/openrocket/android/CurrentRocket.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/android/src/net/sf/openrocket/android/CurrentRocket.java b/android/src/net/sf/openrocket/android/CurrentRocket.java index 887a54a11..1539b10ff 100644 --- a/android/src/net/sf/openrocket/android/CurrentRocket.java +++ b/android/src/net/sf/openrocket/android/CurrentRocket.java @@ -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() {