From 278e56e2308abdb0c8a2f2752615239e0588516f Mon Sep 17 00:00:00 2001 From: benfry Date: Sat, 12 Nov 2011 20:14:14 +0000 Subject: [PATCH] cleanups --- android/todo.txt | 7 +++-- app/src/processing/mode/android/Devices.java | 2 +- .../mode/android/EmulatorController.java | 29 ++++++++++++------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/android/todo.txt b/android/todo.txt index 00b2ae931..c1d77bcdd 100644 --- a/android/todo.txt +++ b/android/todo.txt @@ -1,6 +1,9 @@ 0204 android -X fix problem with android emulator launching on Windows +X Android emulator not launching on Windows with 2.0 alpha releases +X http://code.google.com/p/processing/issues/detail?id=899 +X /opt/android using version #s again? fix build script (earlier) +_ don't let the ... ? _ if a sketch asks for android mode but it's not available _ (after a double-click) @@ -13,8 +16,6 @@ _ http://code.google.com/p/processing/issues/detail?id=767 _ don't let the examples get overwritten with other mode stuff _ the whole sketch.properties thing is yech -_ /opt/android using version #s again? fix build script - _ add INTERNET permissions to the android net examples _ go through all basics/topics examples diff --git a/app/src/processing/mode/android/Devices.java b/app/src/processing/mode/android/Devices.java index da0305ab7..621474e8c 100644 --- a/app/src/processing/mode/android/Devices.java +++ b/app/src/processing/mode/android/Devices.java @@ -94,7 +94,7 @@ class Devices { } // System.out.println("no emu found"); - final EmulatorController emuController = EmulatorController.getInstance(); + EmulatorController emuController = EmulatorController.getInstance(); // System.out.println("checking emulator state"); if (emuController.getState() == State.NOT_RUNNING) { try { diff --git a/app/src/processing/mode/android/EmulatorController.java b/app/src/processing/mode/android/EmulatorController.java index 927862960..79cdd5e4c 100644 --- a/app/src/processing/mode/android/EmulatorController.java +++ b/app/src/processing/mode/android/EmulatorController.java @@ -5,30 +5,24 @@ import java.util.concurrent.CountDownLatch; import processing.app.Base; import processing.app.Preferences; -import processing.app.exec.LineProcessor; -import processing.app.exec.ProcessHelper; -import processing.app.exec.ProcessRegistry; -import processing.app.exec.ProcessResult; -import processing.app.exec.StreamPump; +import processing.app.exec.*; + import processing.core.PApplet; + class EmulatorController { public static enum State { NOT_RUNNING, WAITING_FOR_BOOT, RUNNING } - public static EmulatorController getInstance() { - return INSTANCE; - } - - private static final EmulatorController INSTANCE = new EmulatorController(); - private volatile State state = State.NOT_RUNNING; + public State getState() { return state; } + private void setState(final State state) { if (processing.app.Base.DEBUG) { //System.out.println("Emulator state: " + state); @@ -36,6 +30,7 @@ class EmulatorController { } this.state = state; } + /** * Blocks until emulator is running, or some catastrophe happens. @@ -163,4 +158,16 @@ class EmulatorController { System.err.println("Interrupted while waiting for emulator to launch."); } } + + + // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + + + // whoever called them "design patterns" certainly wasn't a f*king designer. + + public static EmulatorController getInstance() { + return INSTANCE; + } + + private static final EmulatorController INSTANCE = new EmulatorController(); }