summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkintel <kintel@cb376a5e-1013-0410-a455-b6b1f9ac8223>2009-06-10 13:53:07 +0000
committerkintel <kintel@cb376a5e-1013-0410-a455-b6b1f9ac8223>2009-06-10 13:53:07 +0000
commit9160571171277009fe3866a1a2f7ee986ad07842 (patch)
tree0ff126184924b31d3dbd58a3572213922d26f9e1
parentc66cddc4ff5080ce9e09fbdb054aa98d0075957d (diff)
downloadreprap-backup-9160571171277009fe3866a1a2f7ee986ad07842.tar.gz
reprap-backup-9160571171277009fe3866a1a2f7ee986ad07842.zip
bugfix from Clifford Wolf: Added window to context to be able to display message boxes from outside the MetaCADEngine class
git-svn-id: https://reprap.svn.sourceforge.net/svnroot/reprap@3139 cb376a5e-1013-0410-a455-b6b1f9ac8223
-rw-r--r--trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/MetaCADContext.java7
-rw-r--r--trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/MetaCADEngine.java2
-rw-r--r--trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/objects/FileObj.java4
3 files changed, 8 insertions, 5 deletions
diff --git a/trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/MetaCADContext.java b/trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/MetaCADContext.java
index 9b891911..d201afc7 100644
--- a/trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/MetaCADContext.java
+++ b/trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/MetaCADContext.java
@@ -13,6 +13,7 @@ import org.reprap.artofillusion.metacad.language.ParsedStatement;
import org.reprap.artofillusion.metacad.parser.MetaCADParser;
import artofillusion.Scene;
+import artofillusion.LayoutWindow;
import bsh.Interpreter;
public class MetaCADContext {
@@ -20,14 +21,16 @@ public class MetaCADContext {
//private JEP jep = new JEP();
bsh.Interpreter interpreter;
public Scene scene;
+ public LayoutWindow window;
public Dictionary<String, MacroPrototype> macros;
// stores the variables
LinkedList<Hashtable<String, Object>> scopes;
Hashtable<String, Object> currentScope;
- public MetaCADContext(Scene scene) {
- this.scene = scene;
+ public MetaCADContext(LayoutWindow window) {
+ this.window = window;
+ this.scene = window.getScene();
clearContext();
}
diff --git a/trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/MetaCADEngine.java b/trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/MetaCADEngine.java
index 0d22e76d..70c11f0f 100644
--- a/trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/MetaCADEngine.java
+++ b/trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/MetaCADEngine.java
@@ -37,7 +37,7 @@ public class MetaCADEngine
public MetaCADEngine(LayoutWindow window) {
this.window = window;
- this.context = new MetaCADContext(window.getScene());
+ this.context = new MetaCADContext(window);
}
public void setParameters(String text) {
diff --git a/trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/objects/FileObj.java b/trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/objects/FileObj.java
index a4b60a71..3748fcf6 100644
--- a/trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/objects/FileObj.java
+++ b/trunk/reprap/miscellaneous/AoI/plugins/MetaCAD/src/org/reprap/artofillusion/metacad/objects/FileObj.java
@@ -49,11 +49,11 @@ public class FileObj extends MetaCADObject
}
catch (NoSuchMethodException nsme) {
nsme.printStackTrace();
- new MessageDialog(null, "Unable to access STL Translator.\nVerify that the STL Translator plugin is installed.");
+ new MessageDialog(ctx.window, "Unable to access STL Translator.\nVerify that the STL Translator plugin is installed.");
}
catch (InvocationTargetException ite) {
ite.printStackTrace();
- new MessageDialog(null, "Unable to access STL Translator.\nVerify that the STL Translator plugin is installed.");
+ new MessageDialog(ctx.window, "Unable to access STL Translator.\nVerify that the STL Translator plugin is installed.");
}
}