From 694eb0c9309b3705a8bdb582f0c287aa77169996 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 21 Mar 2011 07:38:11 +0100 Subject: Fix Bug #460 - GLCanvas NPE --- src/jogl/classes/javax/media/opengl/awt/GLCanvas.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/jogl/classes/javax/media/opengl/awt') diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index 086a17362..4e6c29e01 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -745,12 +745,15 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing @Override public String toString() { + final int dw = (null!=drawable) ? drawable.getWidth() : -1; + final int dh = (null!=drawable) ? drawable.getHeight() : -1; + return "AWT-GLCanvas[Realized "+isRealized()+ ",\n\t"+((null!=drawable)?drawable.getClass().getName():"null-drawable")+ ",\n\tRealized "+isRealized()+ ",\n\tFactory "+getFactory()+ ",\n\thandle 0x"+Long.toHexString(getHandle())+ - ",\n\tDrawable size "+drawable.getWidth()+"x"+drawable.getHeight()+ + ",\n\tDrawable size "+dw+"x"+dh+ ",\n\tAWT pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+ ",\n\tvisible "+isVisible()+ ",\n\t"+awtConfig+"]"; -- cgit v1.2.3