diff --git a/android/core/src/processing/core/PApplet.java b/android/core/src/processing/core/PApplet.java index 04339a1c2..bc3e0480d 100644 --- a/android/core/src/processing/core/PApplet.java +++ b/android/core/src/processing/core/PApplet.java @@ -67,7 +67,7 @@ public class PApplet extends Activity implements PConstants, Runnable { * not all instances of PApplet will necessarily be started on a screen of * the same size. */ - public int screenW, screenH; + public int screenWidth, screenHeight; // public Dimension screen = // Toolkit.getDefaultToolkit().getScreenSize(); @@ -402,8 +402,8 @@ public class PApplet extends Activity implements PConstants, Runnable { DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); - screenW = dm.widthPixels; - screenH = dm.heightPixels; + screenWidth = dm.widthPixels; + screenHeight = dm.heightPixels; //println("screen size is " + screenWidth + "x" + screenHeight); if (sketchRenderer().equals(A2D)) { @@ -412,8 +412,8 @@ public class PApplet extends Activity implements PConstants, Runnable { surfaceView = new SketchSurfaceView3D(this); } - width = screenW; - height = screenH; + width = screenWidth; + height = screenHeight; window.setContentView(surfaceView); // set full screen @@ -521,7 +521,7 @@ public class PApplet extends Activity implements PConstants, Runnable { // before surfaceChanged() is ever called. PGraphics newGraphics = new PGraphicsAndroid3D(); // Set semi-arbitrary size; will be set properly when surfaceChanged() called - newGraphics.setSize(screenW, screenH); + newGraphics.setSize(screenWidth, screenHeight); newGraphics.setParent(PApplet.this); newGraphics.setPrimary(true); g = newGraphics; @@ -622,7 +622,7 @@ public class PApplet extends Activity implements PConstants, Runnable { // println("creating graphics"); PGraphics newGraphics = new PGraphicsAndroid2D(); // Set semi-arbitrary size; will be set properly when surfaceChanged() called - newGraphics.setSize(screenW, screenH); + newGraphics.setSize(screenWidth, screenHeight); // newGraphics.setSize(getWidth(), getHeight()); newGraphics.setParent(PApplet.this); newGraphics.setPrimary(true); @@ -731,12 +731,12 @@ public class PApplet extends Activity implements PConstants, Runnable { public int sketchWidth() { - return screenW; + return screenWidth; } public int sketchHeight() { - return screenH; + return screenHeight; } diff --git a/android/todo.txt b/android/todo.txt index 412043578..247363d03 100644 --- a/android/todo.txt +++ b/android/todo.txt @@ -1,4 +1,10 @@ 0179 +X screenWidth/Height instead of screenW/H + +previous +X don't require JDK installation and PATH setting +X if using processing with java download, should be able to use its tools.jar +X http://dev.processing.org/bugs/show_bug.cgi?id=1470 _ make size() work to place the component at the center of the screen @@ -79,10 +85,6 @@ P1 _ errors that happen inside events (e.g. keys) not highlighting lines P1 _ useful stack trace information not coming through.. why? P1 _ http://dev.processing.org/bugs/show_bug.cgi?id=1384 -_ don't require JDK installation and PATH setting -_ if using processing with java download, should be able to use its tools.jar -_ http://dev.processing.org/bugs/show_bug.cgi?id=1470 - _ only send error text to System.err (i.e. "Launching emulator" is not an error) _ send these debug log messages to System.out diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 99f4c419e..54a96f124 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -273,13 +273,7 @@ public class PApplet extends Applet * not all instances of PApplet will necessarily be started on a screen of * the same size. */ - static public int screenW; - static public int screenH; - static { - Dimension size = Toolkit.getDefaultToolkit().getScreenSize(); - screenW = size.width; - screenH = size.height; - } + public int screenWidth, screenHeight; /** * Use screenW and screenH instead. @@ -670,6 +664,10 @@ public class PApplet extends Applet public void init() { // println("Calling init()"); + Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); + screenWidth = screen.width; + screenHeight = screen.height; + // send tab keys through to the PApplet setFocusTraversalKeysEnabled(false); diff --git a/core/todo.txt b/core/todo.txt index 7eb553a08..3858f8fd8 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,4 +1,5 @@ 0179 core +X screenWidth/Height instead of screenW/H big ones