From: kruland2607 Date: Sat, 2 Jun 2012 23:43:36 +0000 (+0000) Subject: Remove dependency on awt.Window from CustomExpression since this makes the android... X-Git-Tag: upstream/12.09^2~213 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=65eedea8e0080d564e5bfd84b35ae70bdfd4f65b;p=debian%2Fopenrocket Remove dependency on awt.Window from CustomExpression since this makes the android app very upset. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@739 180e2498-e6e9-4542-8430-84ac67f01cd8 --- diff --git a/core/src/net/sf/openrocket/gui/customexpression/CustomExpressionPanel.java b/core/src/net/sf/openrocket/gui/customexpression/CustomExpressionPanel.java index e0bd2360..7a7fb32a 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 d060c07c..1903079a 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