split out the javafx stuff, clean up misuse of fields

This commit is contained in:
Ben Fry
2015-06-21 22:12:39 -04:00
parent 3d60c3b707
commit 44c05ee2e3
4 changed files with 13 additions and 10 deletions
+2 -3
View File
@@ -9799,7 +9799,7 @@ public class PApplet implements PConstants {
//////////////////////////////////////////////////////////////
void frameMoved(int x, int y) {
public void frameMoved(int x, int y) {
if (!fullScreen) {
System.err.println(EXTERNAL_MOVE + " " + x + " " + y);
System.err.flush(); // doesn't seem to help or hurt
@@ -9807,8 +9807,7 @@ public class PApplet implements PConstants {
}
void frameResized(int w, int h) {
public void frameResized(int w, int h) {
}
+1 -1
View File
@@ -513,7 +513,7 @@ public class PGraphics extends PImage implements PConstants {
// float[][] matrixInvStack = new float[MATRIX_STACK_DEPTH][16];
// int matrixStackDepth;
static final int MATRIX_STACK_DEPTH = 32;
static final protected int MATRIX_STACK_DEPTH = 32;
static final protected String ERROR_PUSHMATRIX_OVERFLOW =
"Too many calls to pushMatrix().";
@@ -20,7 +20,7 @@
Boston, MA 02111-1307 USA
*/
package processing.core;
package processing.javafx;
import java.nio.IntBuffer;
@@ -42,6 +42,8 @@ import javafx.scene.shape.StrokeLineJoin;
import javafx.scene.transform.Affine;
import javafx.scene.transform.Transform;
import processing.core.*;
public class PGraphicsFX2D extends PGraphics {
GraphicsContext context;
@@ -913,7 +915,7 @@ public class PGraphicsFX2D extends PGraphics {
cash = new ImageCache(); //who);
setCache(who, cash);
who.updatePixels(); // mark the whole thing for update
who.modified = true;
who.setModified();
}
// If image previously was tinted, or the color changed
@@ -925,7 +927,7 @@ public class PGraphicsFX2D extends PGraphics {
who.updatePixels();
}
if (who.modified) {
if (who.isModified()) {
if (who.pixels == null) {
// This might be a PGraphics that hasn't been drawn to yet.
// Can't just bail because the cache has been created above.
@@ -933,7 +935,7 @@ public class PGraphicsFX2D extends PGraphics {
who.pixels = new int[who.width * who.height];
}
cash.update(who, tint, tintColor);
who.modified = false;
who.setModified(false);
}
context.drawImage(((ImageCache) getCache(who)).image,
@@ -20,7 +20,7 @@
Boston, MA 02111-1307 USA
*/
package processing.core;
package processing.javafx;
//import java.awt.event.FocusEvent;
//import java.awt.event.FocusListener;
@@ -50,6 +50,8 @@ import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import processing.core.*;
public class PSurfaceFX implements PSurface {
PApplet sketch;
@@ -470,7 +472,7 @@ public class PSurfaceFX implements PSurface {
//System.out.println("handle(" + now + ") calling handleDraw()");
sketch.handleDraw();
if (sketch.exitCalled) {
if (sketch.exitCalled()) {
//sketch.exitActual(); // just calls System.exit()
Platform.exit(); // version for safe JavaFX shutdown
}