28
28
import java .util .regex .Matcher ;
29
29
import java .util .regex .Pattern ;
30
30
31
- import processing .app .Editor ;
31
+ import processing .app .ui . Editor ;
32
32
import processing .app .RunnerListener ;
33
33
import processing .app .SketchException ;
34
34
import processing .mode .java .runner .Runner ;
37
37
public class AndroidRunner implements DeviceListener {
38
38
AndroidBuild build ;
39
39
RunnerListener listener ;
40
-
40
+
41
41
protected PrintStream sketchErr ;
42
42
protected PrintStream sketchOut ;
43
43
44
-
44
+
45
45
public AndroidRunner (AndroidBuild build , RunnerListener listener ) {
46
46
this .build = build ;
47
47
this .listener = listener ;
48
-
48
+
49
49
if (listener instanceof Editor ) {
50
50
Editor editor = (Editor ) listener ;
51
51
sketchErr = editor .getConsole ().getErr ();
@@ -55,8 +55,8 @@ public AndroidRunner(AndroidBuild build, RunnerListener listener) {
55
55
sketchOut = System .out ;
56
56
}
57
57
}
58
-
59
-
58
+
59
+
60
60
public void launch (Future <Device > deviceFuture ) {
61
61
// try {
62
62
// runSketchOnDevice(Devices.getInstance().getEmulator(), "debug", AndroidEditor.this);
@@ -70,7 +70,7 @@ public void launch(Future<Device> deviceFuture) {
70
70
final Device device = waitForDevice (deviceFuture , listener );
71
71
if (device == null || !device .isAlive ()) {
72
72
listener .statusError ("Lost connection with device while launching. Try again." );
73
- // Reset the server, in case that's the problem. Sometimes when
73
+ // Reset the server, in case that's the problem. Sometimes when
74
74
// launching the emulator times out, the device list refuses to update.
75
75
Devices .killAdbServer ();
76
76
return ;
@@ -91,7 +91,7 @@ public void launch(Future<Device> deviceFuture) {
91
91
Devices .killAdbServer (); // see above
92
92
return ;
93
93
}
94
- // if (!build.antInstall()) {
94
+ // if (!build.antInstall()) {
95
95
// }
96
96
97
97
// if (monitor.isCanceled()) {
@@ -115,8 +115,8 @@ public void launch(Future<Device> deviceFuture) {
115
115
//listener.stopIndeterminate();
116
116
//}
117
117
}
118
-
119
-
118
+
119
+
120
120
private volatile Device lastRunDevice = null ;
121
121
122
122
/**
@@ -132,7 +132,7 @@ private void runSketchOnDevice(Sketch sketch,
132
132
// "Building and launching...",
133
133
// "Creating project...");
134
134
135
-
135
+
136
136
AndroidBuild build = new AndroidBuild(sketch, listener);
137
137
try {
138
138
try {
@@ -207,7 +207,7 @@ private void runSketchOnDevice(Sketch sketch,
207
207
}
208
208
*/
209
209
210
-
210
+
211
211
// if user asks for 480x320, 320x480, 854x480 etc, then launch like that
212
212
// though would need to query the emulator to see if it can do that
213
213
@@ -248,8 +248,8 @@ private Device waitForDevice(Future<Device> deviceFuture, RunnerListener listene
248
248
"on waiting for that device to show up." );
249
249
return null ;
250
250
}
251
-
252
-
251
+
252
+
253
253
private static final Pattern LOCATION =
254
254
Pattern .compile ("\\ (([^:]+):(\\ d+)\\ )" );
255
255
private static final Pattern EXCEPTION_PARSER =
@@ -304,7 +304,7 @@ public void close() {
304
304
}
305
305
306
306
307
- // sketch stopped on the device
307
+ // sketch stopped on the device
308
308
public void sketchStopped () {
309
309
listener .stopIndeterminate ();
310
310
listener .statusHalt ();
0 commit comments