Merge pull request #540 from oOMoeOo/master

Removed Sysout-Calls in AwtPanel (Issue #539)
define_list_fix
empirephoenix 9 years ago committed by GitHub
commit 671be243b0
  1. 25
      jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanel.java

@ -51,6 +51,8 @@ import java.nio.IntBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import java.util.logging.Logger;
public class AwtPanel extends Canvas implements SceneProcessor {
@ -99,7 +101,6 @@ public class AwtPanel extends Canvas implements SceneProcessor {
newWidth = newWidth2;
newHeight = newHeight2;
reshapeNeeded.set(true);
System.out.println("EDT: componentResized " + newWidth + ", " + newHeight);
}
}
}
@ -112,7 +113,6 @@ public class AwtPanel extends Canvas implements SceneProcessor {
synchronized (lock) {
hasNativePeer.set(true);
System.out.println("EDT: addNotify");
}
requestFocusInWindow();
@ -122,7 +122,6 @@ public class AwtPanel extends Canvas implements SceneProcessor {
public void removeNotify() {
synchronized (lock) {
hasNativePeer.set(false);
System.out.println("EDT: removeNotify");
}
super.removeNotify();
@ -141,19 +140,12 @@ public class AwtPanel extends Canvas implements SceneProcessor {
if (strategy != null) {
// strategy.dispose();
strategy = null;
System.out.println("OGL: Not visible. Destroy strategy.");
}
return false;
}
boolean currentShowing = isShowing();
if (showing.getAndSet(currentShowing) != currentShowing){
if (currentShowing){
System.out.println("OGL: Enter showing state.");
}else{
System.out.println("OGL: Exit showing state.");
}
}
showing.set(currentShowing);
return currentShowing;
}
@ -190,7 +182,6 @@ public class AwtPanel extends Canvas implements SceneProcessor {
ex.printStackTrace();
}
strategy = getBufferStrategy();
System.out.println("OGL: Visible. Create strategy.");
}
// Draw screenshot.
@ -198,7 +189,7 @@ public class AwtPanel extends Canvas implements SceneProcessor {
do {
Graphics2D g2d = (Graphics2D) strategy.getDrawGraphics();
if (g2d == null) {
System.out.println("OGL: DrawGraphics was null.");
Logger.getLogger(AwtPanel.class.getName()).log(Level.WARNING, "OGL: DrawGraphics was null.");
return;
}
@ -231,6 +222,7 @@ public class AwtPanel extends Canvas implements SceneProcessor {
this.attachAsMain = overrideMainFramebuffer;
}
@Override
public void initialize(RenderManager rm, ViewPort vp) {
if (this.rm == null) {
// First time called in OGL thread
@ -264,7 +256,6 @@ public class AwtPanel extends Canvas implements SceneProcessor {
// synchronized (lock){
// img = (BufferedImage) getGraphicsConfiguration().createCompatibleImage(width, height);
// }
AffineTransform tx = AffineTransform.getScaleInstance(1, -1);
tx.translate(0, -img.getHeight());
transformOp = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
@ -283,13 +274,16 @@ public class AwtPanel extends Canvas implements SceneProcessor {
}
}
@Override
public boolean isInitialized() {
return fb != null;
}
@Override
public void preFrame(float tpf) {
}
@Override
public void postQueue(RenderQueue rq) {
}
@ -323,6 +317,7 @@ public class AwtPanel extends Canvas implements SceneProcessor {
}
}
@Override
public void postFrame(FrameBuffer out) {
if (!attachAsMain && out != fb) {
throw new IllegalStateException("Why did you change the output framebuffer?");
@ -331,9 +326,11 @@ public class AwtPanel extends Canvas implements SceneProcessor {
// onFrameEnd();
}
@Override
public void reshape(ViewPort vp, int w, int h) {
}
@Override
public void cleanup() {
}
}

Loading…
Cancel
Save