mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 13:49:18 +01:00
Small threading fixes for run/present/tweak
This commit is contained in:
@@ -1057,15 +1057,15 @@ public class JavaEditor extends Editor {
|
||||
debugger.continueDebug();
|
||||
|
||||
} else {
|
||||
prepareRun();
|
||||
toolbar.activateRun();
|
||||
new Thread(new Runnable() {
|
||||
public void run() {
|
||||
prepareRun();
|
||||
try {
|
||||
toolbar.activateRun();
|
||||
//runtime = jmode.handleRun(sketch, JavaEditor.this);
|
||||
runtime = jmode.handleLaunch(sketch, JavaEditor.this, false);
|
||||
} catch (Exception e) {
|
||||
statusError(e);
|
||||
EventQueue.invokeLater(() -> statusError(e));
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
@@ -1074,15 +1074,15 @@ public class JavaEditor extends Editor {
|
||||
|
||||
|
||||
public void handlePresent() {
|
||||
prepareRun();
|
||||
toolbar.activateRun();
|
||||
new Thread(new Runnable() {
|
||||
public void run() {
|
||||
prepareRun();
|
||||
try {
|
||||
toolbar.activateRun();
|
||||
//runtime = jmode.handlePresent(sketch, JavaEditor.this);
|
||||
runtime = jmode.handleLaunch(sketch, JavaEditor.this, true);
|
||||
} catch (Exception e) {
|
||||
statusError(e);
|
||||
EventQueue.invokeLater(() -> statusError(e));
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
@@ -1090,15 +1090,23 @@ public class JavaEditor extends Editor {
|
||||
|
||||
|
||||
public void handleTweak() {
|
||||
prepareRun();
|
||||
//toolbar.activate(JavaToolbar.RUN);
|
||||
toolbar.activateRun();
|
||||
|
||||
if (sketch.isModified()) {
|
||||
toolbar.deactivateRun();
|
||||
Messages.showMessage(Language.text("menu.file.save"),
|
||||
Language.text("tweak_mode.save_before_tweak"));
|
||||
return;
|
||||
}
|
||||
|
||||
new Thread(new Runnable() {
|
||||
public void run() {
|
||||
prepareRun();
|
||||
try {
|
||||
// toolbar.activate(JavaToolbar.RUN);
|
||||
toolbar.activateRun();
|
||||
runtime = jmode.handleTweak(sketch, JavaEditor.this);
|
||||
} catch (Exception e) {
|
||||
statusError(e);
|
||||
EventQueue.invokeLater(() -> statusError(e));
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
|
||||
@@ -144,13 +144,6 @@ public class JavaMode extends Mode {
|
||||
// final boolean present) throws SketchException {
|
||||
final JavaEditor editor = (JavaEditor) listener;
|
||||
|
||||
if (isSketchModified(sketch)) {
|
||||
editor.deactivateRun();
|
||||
Messages.showMessage(Language.text("menu.file.save"),
|
||||
Language.text("tweak_mode.save_before_tweak"));
|
||||
return null;
|
||||
}
|
||||
|
||||
// first try to build the unmodified code
|
||||
JavaBuild build = new JavaBuild(sketch);
|
||||
// String appletClassName = build.build(false);
|
||||
|
||||
Reference in New Issue
Block a user