diff --git a/core/src/net/sf/openrocket/gui/customexpression/CustomExpressionPanel.java b/core/src/net/sf/openrocket/gui/customexpression/CustomExpressionPanel.java index e0bd23608..7a7fb32a9 100644 --- a/core/src/net/sf/openrocket/gui/customexpression/CustomExpressionPanel.java +++ b/core/src/net/sf/openrocket/gui/customexpression/CustomExpressionPanel.java @@ -137,7 +137,7 @@ public class CustomExpressionPanel extends JPanel { @Override public void actionPerformed(ActionEvent e){ Window parent = SwingUtilities.getWindowAncestor(CustomExpressionPanel.this); - expression.editExpression(parent); + new ExpressionBuilderDialog(parent, expression.getSimulation(), expression).setVisible(true); updateExpressions(); } }); diff --git a/core/src/net/sf/openrocket/simulation/CustomExpression.java b/core/src/net/sf/openrocket/simulation/CustomExpression.java index d060c07c2..1903079a2 100644 --- a/core/src/net/sf/openrocket/simulation/CustomExpression.java +++ b/core/src/net/sf/openrocket/simulation/CustomExpression.java @@ -1,11 +1,9 @@ package net.sf.openrocket.simulation; -import java.awt.Window; 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; @@ -76,14 +74,6 @@ public class CustomExpression implements Cloneable{ 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 */ @@ -91,6 +81,10 @@ public class CustomExpression implements Cloneable{ 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