Skip to content

Commit 2b4e784

Browse files
committed
updated to recent changes in editor API
1 parent 15bb70f commit 2b4e784

File tree

2 files changed

+45
-13
lines changed

2 files changed

+45
-13
lines changed

src/processing/mode/android/AndroidEditor.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@ public void showReference(String filename) {
446446
public void statusError(String what) {
447447
super.statusError(what);
448448
// new Exception("deactivating RUN").printStackTrace();
449-
toolbar.deactivate(AndroidToolbar.RUN);
449+
// toolbar.deactivate(AndroidToolbar.RUN);
450+
toolbar.deactivateRun();
450451
}
451452

452453

@@ -462,7 +463,8 @@ public void sketchStopped() {
462463
public void handleRunEmulator() {
463464
new Thread() {
464465
public void run() {
465-
toolbar.activate(AndroidToolbar.RUN);
466+
// toolbar.activate(AndroidToolbar.RUN);
467+
toolbar.activateRun();
466468
startIndeterminate();
467469
prepareRun();
468470
try {
@@ -506,7 +508,8 @@ public void handleRunDevice() {
506508
} else {
507509
new Thread() {
508510
public void run() {
509-
toolbar.activate(AndroidToolbar.RUN);
511+
toolbar.activateRun();
512+
// toolbar.activate(AndroidToolbar.RUN);
510513
startIndeterminate();
511514
prepareRun();
512515
try {
@@ -524,7 +527,8 @@ public void run() {
524527

525528

526529
public void handleStop() {
527-
toolbar.deactivate(AndroidToolbar.RUN);
530+
toolbar.deactivateRun();
531+
// toolbar.deactivate(AndroidToolbar.RUN);
528532
stopIndeterminate();
529533
androidMode.handleStop(this);
530534
}
@@ -538,7 +542,8 @@ public void handleExportProject() {
538542
if (handleExportCheckModified()) {
539543
new Thread() {
540544
public void run() {
541-
toolbar.activate(AndroidToolbar.EXPORT);
545+
// toolbar.activate(AndroidToolbar.EXPORT);
546+
((AndroidToolbar)toolbar).activateExport();
542547
startIndeterminate();
543548
statusNotice("Exporting a debug version of the sketch...");
544549
AndroidBuild build = new AndroidBuild(sketch, androidMode);
@@ -554,7 +559,8 @@ public void run() {
554559
statusError(e);
555560
}
556561
stopIndeterminate();
557-
toolbar.deactivate(AndroidToolbar.EXPORT);
562+
// toolbar.deactivate(AndroidToolbar.EXPORT);
563+
((AndroidToolbar)toolbar).deactivateExport();
558564
}
559565
}.start();
560566
}

src/processing/mode/android/AndroidToolbar.java

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,18 @@ public class AndroidToolbar extends EditorToolbar {
4242

4343

4444
public AndroidToolbar(Editor editor, Base base) {
45-
super(editor, base);
45+
super(editor);
4646
}
4747

4848

49-
public void init() {
50-
Image[][] images = loadImages();
51-
for (int i = 0; i < 6; i++) {
52-
addButton(getTitle(i, false), getTitle(i, true), images[i], i == NEW);
53-
}
54-
}
49+
// TODO:
50+
// Buttons are initialized in createButtons, see code of EditorToolbar.rebuild()
51+
// public void init() {
52+
// Image[][] images = loadImages();
53+
// for (int i = 0; i < 6; i++) {
54+
// addButton(getTitle(i, false), getTitle(i, true), images[i], i == NEW);
55+
// }
56+
// }
5557

5658

5759
static public String getTitle(int index, boolean shift) {
@@ -111,4 +113,28 @@ public void handlePressed(MouseEvent e, int sel) {
111113
break;
112114
}
113115
}
116+
117+
118+
@Override
119+
public void handleRun(int modifiers) {
120+
// TODO Auto-generated method stub
121+
122+
}
123+
124+
125+
@Override
126+
public void handleStop() {
127+
// TODO Auto-generated method stub
128+
129+
}
130+
131+
132+
public void activateExport() {
133+
// TODO added to match the new API in EditorToolbar (activateRun, etc).
134+
}
135+
136+
137+
public void deactivateExport() {
138+
// TODO added to match the new API in EditorToolbar (activateRun, etc).
139+
}
114140
}

0 commit comments

Comments
 (0)