aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2011-02-26 18:03:48 +0100
committerMichael Bien <[email protected]>2011-02-26 18:03:48 +0100
commit77546f8968779fbdcfe58f89c6924803642889c7 (patch)
tree20cb5573576ccd15da822bee0e432a969acbe4f7
parent112e2a26004d974c3bba822fe1467a34784ec57d (diff)
changes due to code cleanup in gluegen.
- StringBuffer -> StringBuilder - ReflectionUtil.getBaseName -> class.getSimpleName() - cleanup imports, generics and @Override for all touched classes
-rw-r--r--src/jogl/classes/com/jogamp/opengl/JoglVersion.java9
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextImpl.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java5
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java6
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java5
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java6
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java6
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java5
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java5
9 files changed, 28 insertions, 23 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
index b1db2974a..ef1ecd7e7 100644
--- a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
+++ b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
@@ -33,7 +33,6 @@ import javax.media.opengl.*;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.VersionUtil;
import com.jogamp.common.util.JogampVersion;
-import com.jogamp.common.util.ReflectionUtil;
import com.jogamp.nativewindow.NativeWindowVersion;
import java.util.jar.Manifest;
import javax.media.nativewindow.AbstractGraphicsDevice;
@@ -59,7 +58,7 @@ public class JoglVersion extends JogampVersion {
return jogampCommonVersionInfo;
}
- public StringBuffer toString(GL gl, StringBuffer sb) {
+ public StringBuilder toString(GL gl, StringBuilder sb) {
sb = super.toString(sb).append(Platform.getNewline());
getGLInfo(gl, sb);
return sb;
@@ -69,16 +68,16 @@ public class JoglVersion extends JogampVersion {
return toString(gl, null).toString();
}
- public static StringBuffer getGLInfo(GL gl, StringBuffer sb) {
+ public static StringBuilder getGLInfo(GL gl, StringBuilder sb) {
AbstractGraphicsDevice device = gl.getContext().getGLDrawable().getNativeSurface()
.getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice();
if(null==sb) {
- sb = new StringBuffer();
+ sb = new StringBuilder();
}
GLContext ctx = gl.getContext();
sb.append(VersionUtil.SEPERATOR).append(Platform.getNewline());
- sb.append(ReflectionUtil.getBaseName(device.getClass())).append("[type ")
+ sb.append(device.getClass().getSimpleName()).append("[type ")
.append(device.getType()).append(", connection ").append(device.getConnection()).append("]: ")
.append(GLProfile.glAvailabilityToString(device));
sb.append(Platform.getNewline());
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 478acba4e..d5059eb74 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -172,8 +172,8 @@ public abstract class GLContextImpl extends GLContext {
public GL setGL(GL gl) {
if(DEBUG) {
- String sgl1 = (null!=this.gl)?ReflectionUtil.getBaseName(this.gl.getClass())+", "+this.gl.toString():"<null>";
- String sgl2 = (null!=gl)?ReflectionUtil.getBaseName(gl.getClass())+", "+gl.toString():"<null>";
+ String sgl1 = (null!=this.gl)?this.gl.getClass().getSimpleName()+", "+this.gl.toString():"<null>";
+ String sgl2 = (null!=gl)?gl.getClass().getSimpleName()+", "+gl.toString():"<null>";
Exception e = new Exception("Info: setGL (OpenGL "+getGLVersion()+"): "+Thread.currentThread().getName()+", "+sgl1+" -> "+sgl2);
e.printStackTrace();
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
index eb8bd522e..4d8f2ac3e 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
@@ -41,7 +41,6 @@ import javax.media.nativewindow.*;
import javax.media.nativewindow.egl.*;
import javax.media.opengl.*;
import com.jogamp.common.nio.PointerBuffer;
-import com.jogamp.common.util.ReflectionUtil;
import jogamp.opengl.*;
public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable {
@@ -76,6 +75,7 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple
return new EGLGraphicsConfiguration(absScreen, caps, capsRequested, new DefaultGLCapabilitiesChooser());
}
+ @Override
public Object clone() {
return super.clone();
}
@@ -299,8 +299,9 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple
return attrs;
}
+ @Override
public String toString() {
- return ReflectionUtil.getBaseName(getClass())+"["+getScreen()+", eglConfigID "+toHexString(getNativeConfigID())+
+ return getClass().getSimpleName()+"["+getScreen()+", eglConfigID "+toHexString(getNativeConfigID())+
",\n\trequested " + getRequestedCapabilities()+
",\n\tchosen " + getChosenCapabilities()+
"]";
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
index c728c1634..ffa8bfae6 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
@@ -32,8 +32,6 @@
package javax.media.nativewindow;
-import com.jogamp.common.util.ReflectionUtil;
-
public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphicsConfiguration {
private AbstractGraphicsScreen screen;
protected CapabilitiesImmutable capabilitiesChosen;
@@ -55,6 +53,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
this.capabilitiesRequested = capsRequested;
}
+ @Override
public Object clone() {
try {
return super.clone();
@@ -105,8 +104,9 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
this.screen = (AbstractGraphicsScreen) screen.clone();
}
+ @Override
public String toString() {
- return ReflectionUtil.getBaseName(getClass())+"[" + screen +
+ return getClass().getSimpleName()+"[" + screen +
",\n\tchosen " + capabilitiesChosen+
",\n\trequested " + capabilitiesRequested+
"]";
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
index bf755d5bc..c2aa6fae9 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
@@ -33,7 +33,6 @@
package javax.media.nativewindow;
-import com.jogamp.common.util.ReflectionUtil;
import jogamp.nativewindow.NativeWindowFactoryImpl;
public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice {
@@ -89,6 +88,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
setToolkitLock( locker );
}
+ @Override
public Object clone() {
try {
return super.clone();
@@ -143,8 +143,9 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
return false;
}
+ @Override
public String toString() {
- return ReflectionUtil.getBaseName(getClass())+"[type "+getType()+", connection "+getConnection()+", unitID "+getUnitID()+", handle 0x"+Long.toHexString(getHandle())+"]";
+ return getClass().getSimpleName()+"[type "+getType()+", connection "+getConnection()+", unitID "+getUnitID()+", handle 0x"+Long.toHexString(getHandle())+"]";
}
/**
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
index 7b7a89bff..f50bd0e14 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
@@ -32,8 +32,6 @@
package javax.media.nativewindow;
-import com.jogamp.common.util.ReflectionUtil;
-
public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen {
AbstractGraphicsDevice device;
private int idx;
@@ -47,6 +45,7 @@ public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen
return new DefaultGraphicsScreen(new DefaultGraphicsDevice(type, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT), 0);
}
+ @Override
public Object clone() {
try {
return super.clone();
@@ -63,7 +62,8 @@ public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen
return idx;
}
+ @Override
public String toString() {
- return ReflectionUtil.getBaseName(getClass())+"["+device+", idx "+idx+"]";
+ return getClass().getSimpleName()+"["+device+", idx "+idx+"]";
}
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java
index 3915158b0..d83a92a5b 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java
@@ -40,7 +40,6 @@
package javax.media.nativewindow.awt;
-import com.jogamp.common.util.ReflectionUtil;
import javax.media.nativewindow.*;
import java.awt.Component;
import java.awt.GraphicsConfiguration;
@@ -104,6 +103,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
return new AWTGraphicsConfiguration(awtScreen, capsChosen, capsRequested, awtGfxConfig);
}
+ @Override
public Object clone() {
return super.clone();
}
@@ -112,6 +112,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
return config;
}
+ @Override
public AbstractGraphicsConfiguration getNativeGraphicsConfiguration() {
return (null!=encapsulated)?encapsulated:this;
}
@@ -155,8 +156,9 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
return capabilities;
}
+ @Override
public String toString() {
- return ReflectionUtil.getBaseName(getClass())+"[" + getScreen() +
+ return getClass().getSimpleName()+"[" + getScreen() +
",\n\tchosen " + capabilitiesChosen+
",\n\trequested " + capabilitiesRequested+
",\n\t" + config +
diff --git a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java
index 2638ae18a..66a63bfcd 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java
@@ -39,7 +39,6 @@
package javax.media.nativewindow.awt;
-import com.jogamp.common.util.ReflectionUtil;
import javax.media.nativewindow.*;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
@@ -66,6 +65,7 @@ public class AWTGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
return new AWTGraphicsDevice(awtDevice, unitID);
}
+ @Override
public Object clone() {
return super.clone();
}
@@ -91,8 +91,9 @@ public class AWTGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
return subType;
}
+ @Override
public String toString() {
- return ReflectionUtil.getBaseName(getClass())+"[type "+getType()+"[subType "+getSubType()+"], connection "+getConnection()+", unitID "+getUnitID()+", awtDevice "+device+", handle 0x"+Long.toHexString(getHandle())+"]";
+ return getClass().getSimpleName()+"[type "+getType()+"[subType "+getSubType()+"], connection "+getConnection()+", unitID "+getUnitID()+", awtDevice "+device+", handle 0x"+Long.toHexString(getHandle())+"]";
}
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java
index dbf06f435..100b6b839 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java
@@ -34,7 +34,6 @@ package javax.media.nativewindow.x11;
import javax.media.nativewindow.*;
-import com.jogamp.common.util.ReflectionUtil;
import jogamp.nativewindow.x11.XVisualInfo;
/** Encapsulates a graphics configuration, or OpenGL pixel format, on
@@ -53,6 +52,7 @@ public class X11GraphicsConfiguration extends DefaultGraphicsConfiguration imple
this.info = info;
}
+ @Override
public Object clone() {
return super.clone();
}
@@ -69,8 +69,9 @@ public class X11GraphicsConfiguration extends DefaultGraphicsConfiguration imple
return (null!=info)?info.getVisualid():0;
}
+ @Override
public String toString() {
- return ReflectionUtil.getBaseName(getClass())+"["+getScreen()+", visualID 0x" + Long.toHexString(getVisualID()) +
+ return getClass().getSimpleName()+"["+getScreen()+", visualID 0x" + Long.toHexString(getVisualID()) +
",\n\tchosen " + capabilitiesChosen+
",\n\trequested " + capabilitiesRequested+
"]";