Remove dependency on awt.Window from CustomExpression since this makes the android app very upset.

This commit is contained in:
Kevin Ruland 2012-06-02 23:43:36 +00:00
parent 16eed9a30b
commit 50f3fc39a6
2 changed files with 5 additions and 11 deletions

View File

@ -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();
}
});

View File

@ -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