| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2739,9 +2739,11 @@ private void removeSpacesFromCode() { | |||
| 2739 | 2739 | * Replace all numbers with variables and add code to initialize | |
| 2740 | 2740 | * these variables and handle update messages. | |
| 2741 | 2741 | */ | |
| 2742 | - protected boolean automateSketch(Sketch sketch, List<List<Handle>> handles) { | ||
| 2742 | + protected boolean automateSketch(Sketch sketch, SketchParser parser) { | ||
| 2743 | 2743 | SketchCode[] code = sketch.getCode(); | |
| 2744 | 2744 | ||
| 2745 | + List<List<Handle>> handles = parser.allHandles; | ||
| 2746 | + | ||
| 2745 | 2747 | if (code.length < 1) { | |
| 2746 | 2748 | return false; | |
| 2747 | 2749 | } | |
@@ -2793,7 +2795,7 @@ protected boolean automateSketch(Sketch sketch, List<List<Handle>> handles) { | |||
| 2793 | 2795 | } | |
| 2794 | 2796 | code[tab].setProgram(c); | |
| 2795 | 2797 | } | |
| 2796 | - | ||
| 2798 | + | ||
| 2797 | 2799 | // add the main header to the code in the first tab | |
| 2798 | 2800 | String c = code[0].getProgram(); | |
| 2799 | 2801 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -167,7 +167,6 @@ public Runner handleTweak(Sketch sketch, | |||
| 167 | 167 | RunnerListener listener, | |
| 168 | 168 | final boolean present) throws SketchException { | |
| 169 | 169 | final JavaEditor editor = (JavaEditor)listener; | |
| 170 | - boolean launchInteractive = false; | ||
| 171 | 170 | ||
| 172 | 171 | if (isSketchModified(sketch)) { | |
| 173 | 172 | editor.deactivateRun(); | |
@@ -193,7 +192,7 @@ public Runner handleTweak(Sketch sketch, | |||
| 193 | 192 | final SketchParser parser = new SketchParser(editor.baseCode, requiresTweak); | |
| 194 | 193 | ||
| 195 | 194 | // add our code to the sketch | |
| 196 | - launchInteractive = editor.automateSketch(sketch, parser.allHandles); | ||
| 195 | + final boolean launchInteractive = editor.automateSketch(sketch, parser); | ||
| 197 | 196 | ||
| 198 | 197 | build = new JavaBuild(sketch); | |
| 199 | 198 | appletClassName = build.build(false); | |
@@ -204,8 +203,10 @@ public Runner handleTweak(Sketch sketch, | |||
| 204 | 203 | public void run() { | |
| 205 | 204 | runtime.launch(present); // this blocks until finished | |
| 206 | 205 | // next lines are executed when the sketch quits | |
| 207 | - editor.initEditorCode(parser.allHandles, false); | ||
| 208 | - editor.stopInteractiveMode(parser.allHandles); | ||
| 206 | + if (launchInteractive) { | ||
| 207 | + editor.initEditorCode(parser.allHandles, false); | ||
| 208 | + editor.stopInteractiveMode(parser.allHandles); | ||
| 209 | + } | ||
| 209 | 210 | } | |
| 210 | 211 | }).start(); | |
| 211 | 212 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments