diff --git a/src/net/apocalypselabs/symat/CodeRunner.java b/src/net/apocalypselabs/symat/CodeRunner.java
index ce4b53d..3592510 100644
--- a/src/net/apocalypselabs/symat/CodeRunner.java
+++ b/src/net/apocalypselabs/symat/CodeRunner.java
@@ -73,7 +73,7 @@ public class CodeRunner {
case "python":
se = new ScriptEngineManager().getEngineByName("python");
try {
- se.eval("from net.apocalypselabs.symat import Functions\n_=Functions()\n");
+ se.eval("from math import *\nfrom net.apocalypselabs.symat import Functions\n_=Functions()\n");
} catch (Exception ex) {
initError(ex);
}
diff --git a/src/net/apocalypselabs/symat/Debug.java b/src/net/apocalypselabs/symat/Debug.java
index 37e97a6..b498392 100644
--- a/src/net/apocalypselabs/symat/Debug.java
+++ b/src/net/apocalypselabs/symat/Debug.java
@@ -35,7 +35,7 @@ package net.apocalypselabs.symat;
public class Debug {
// If output should be on or off
- public static final boolean DEBUG = false;
+ public static final boolean DEBUG = true;
public static void println(Object data) {
if (DEBUG) {
diff --git a/src/net/apocalypselabs/symat/Functions.java b/src/net/apocalypselabs/symat/Functions.java
index 4a08a9b..d916a99 100644
--- a/src/net/apocalypselabs/symat/Functions.java
+++ b/src/net/apocalypselabs/symat/Functions.java
@@ -111,7 +111,7 @@ public class Functions {
Graphing interfaces
*/
public void plot(String function) {
- graphwin.setVisible(true);
+ showGraph();
graphwin.graphFunction(function);
}
@@ -124,13 +124,16 @@ public class Functions {
}
public void plotname(String t) {
- graphwin.setVisible(true);
graphwin.setWindowTitle(t);
}
public String plotname() {
return graphwin.getTitle();
}
+
+ public void plot() {
+ showGraph();
+ }
public void plotclr() {
graphwin.clearDraw();
@@ -145,12 +148,12 @@ public class Functions {
}
public void plotscale(int level) {
- graphwin.setVisible(true);
+ showGraph();
graphwin.setZoom(level);
}
public void drawdot(double x, double y) {
- graphwin.setVisible(true);
+ showGraph();
graphwin.drawDot(x, y);
}
@@ -165,10 +168,17 @@ public class Functions {
return info;
}
+ /**
+ * Make sure the graph window shows.
+ */
+ private void showGraph() {
+ graphwin.setVisible(true);
+ graphwin.toFront();
+ }
/*
Constructor.
*/
public Functions() {
- MainGUI.mainPane.add(graphwin);
+ MainGUI.loadFrame(graphwin, false);
}
}
diff --git a/src/net/apocalypselabs/symat/Graph.form b/src/net/apocalypselabs/symat/Graph.form
index 6be9bbd..d905813 100644
--- a/src/net/apocalypselabs/symat/Graph.form
+++ b/src/net/apocalypselabs/symat/Graph.form
@@ -27,7 +27,7 @@
-