Rework the CustomExpression evaluation to use SimulationListeners. Removed the OpenR...
[debian/openrocket] / core / src / net / sf / openrocket / document / Simulation.java
index 162ee20d06f5ee01febae1c90a8c8af911495316..edb093c3b9b016c813ce61ba1ddf0858f42340ff 100644 (file)
@@ -60,7 +60,6 @@ public class Simulation implements ChangeSource, Cloneable {
        private SafetyMutex mutex = SafetyMutex.newInstance();
        
        private final Rocket rocket;
-       private final OpenRocketDocument document;
        
        private String name = "";
        
@@ -94,11 +93,7 @@ public class Simulation implements ChangeSource, Cloneable {
         * 
         * @param rocket        the rocket associated with the simulation.
         */
-       public Simulation(OpenRocketDocument doc, Rocket rocket) {
-               // It may seem silly to pass in the document and rocket, since usually when called we 
-               // use doc.getRocket, but I guess there is some reason; when cloning a simulation + rocket we don't need
-               // to make a duplicate of the undo data etc stored in the document. --Richard
-               this.document = doc;
+       public Simulation(Rocket rocket) {
                this.rocket = rocket;
                this.status = Status.NOT_SIMULATED;
                
@@ -109,7 +104,7 @@ public class Simulation implements ChangeSource, Cloneable {
        }
        
        
-       public Simulation(OpenRocketDocument doc, Rocket rocket, Status status, String name, SimulationOptions options,
+       public Simulation(Rocket rocket, Status status, String name, SimulationOptions options,
                        List<String> listeners, FlightData data) {
                
                if (rocket == null)
@@ -122,7 +117,6 @@ public class Simulation implements ChangeSource, Cloneable {
                        throw new IllegalArgumentException("options cannot be null");
                
                this.rocket = rocket;
-               this.document = doc;
                
                if (status == Status.UPTODATE) {
                        this.status = Status.LOADED;
@@ -152,13 +146,6 @@ public class Simulation implements ChangeSource, Cloneable {
                
        }
        
-       /*
-        * Return the parent document for this simulation
-        */
-       public OpenRocketDocument getDocument(){
-               return document;
-       }
-       
        /**
         * Return the rocket associated with this simulation.
         * 
@@ -423,7 +410,7 @@ public class Simulation implements ChangeSource, Cloneable {
        public Simulation duplicateSimulation(Rocket newRocket) {
                mutex.lock("duplicateSimulation");
                try {
-                       Simulation copy = new Simulation(document, newRocket);
+                       Simulation copy = new Simulation(newRocket);
                        
                        copy.name = this.name;
                        copy.options.copyFrom(this.options);