]> git.gag.com Git - debian/openrocket/commitdiff
Remove dependency on awt.Window from CustomExpression since this makes the android...
authorkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Sat, 2 Jun 2012 23:43:36 +0000 (23:43 +0000)
committerkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Sat, 2 Jun 2012 23:43:36 +0000 (23:43 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@739 180e2498-e6e9-4542-8430-84ac67f01cd8

core/src/net/sf/openrocket/gui/customexpression/CustomExpressionPanel.java
core/src/net/sf/openrocket/simulation/CustomExpression.java

index e0bd236088610264fd4b841e87df05f2571f8f5d..7a7fb32a9813523affc8fdc6b860d84303f4eb03 100644 (file)
@@ -137,7 +137,7 @@ public class CustomExpressionPanel extends JPanel {
                                @Override
                                public void actionPerformed(ActionEvent e){
                                        Window parent = SwingUtilities.getWindowAncestor(CustomExpressionPanel.this);
                                @Override
                                public void actionPerformed(ActionEvent e){
                                        Window parent = SwingUtilities.getWindowAncestor(CustomExpressionPanel.this);
-                                       expression.editExpression(parent);
+                                       new ExpressionBuilderDialog(parent, expression.getSimulation(), expression).setVisible(true);
                                        updateExpressions();
                                }
                        });
                                        updateExpressions();
                                }
                        });
index d060c07c26e2fa50bcb67e7921175739cdd88951..1903079a2fb66be9b3437be639931e230532846d 100644 (file)
@@ -1,11 +1,9 @@
 package net.sf.openrocket.simulation;
 
 package net.sf.openrocket.simulation;
 
-import java.awt.Window;
 import java.util.SortedMap;
 import java.util.TreeMap;
 
 import net.sf.openrocket.document.Simulation;
 import java.util.SortedMap;
 import java.util.TreeMap;
 
 import net.sf.openrocket.document.Simulation;
-import net.sf.openrocket.gui.customexpression.ExpressionBuilderDialog;
 import net.sf.openrocket.logging.LogHelper;
 import net.sf.openrocket.startup.Application;
 import net.sf.openrocket.unit.FixedUnitGroup;
 import net.sf.openrocket.logging.LogHelper;
 import net.sf.openrocket.startup.Application;
 import net.sf.openrocket.unit.FixedUnitGroup;
@@ -76,14 +74,6 @@ public class CustomExpression implements Cloneable{
                setSimulation(sim);
        }
        
                setSimulation(sim);
        }
        
-       /*
-        * Opens an ExpressionBuilderDialog for this expression 
-        */
-       public void editExpression(Window parent){
-               log.debug("Opening window to edit an existing custom expression");
-               new ExpressionBuilderDialog(parent, sim, this).setVisible(true);
-       }
-       
        /*
         * Use this to update the simulation this is associated with
         */
        /*
         * Use this to update the simulation this is associated with
         */
@@ -91,6 +81,10 @@ public class CustomExpression implements Cloneable{
                CustomExpression.sim = sim;
        }
        
                CustomExpression.sim = sim;
        }
        
+       public Simulation getSimulation() {
+               return CustomExpression.sim;
+       }
+       
        /*
         * Returns the flight data branch 0 for this simulation, or an empty branch
         * if no simulated data exists
        /*
         * Returns the flight data branch 0 for this simulation, or an empty branch
         * if no simulated data exists