diff options
34 files changed, 370 insertions, 292 deletions
diff --git a/make/build-common.xml b/make/build-common.xml index 059243101..a00c7f27a 100644 --- a/make/build-common.xml +++ b/make/build-common.xml @@ -175,6 +175,12 @@ <property name="nativewindow.all.jar" value="${build.nativewindow}/nativewindow.all.jar" /> <property name="jogl.all.jar" value="${build.jogl}/jogl.all.jar" /> <property name="newt.all.jar" value="${build.newt}/newt.all.jar" /> + <property name="newt.event.jar" value="${build.newt}/newt.event.jar" /> + + <!-- JavaSE combinations . NO.AWT --> + <property name="nativewindow.all-noawt.jar" value="${build.nativewindow}/nativewindow.all-noawt.jar" /> + <property name="jogl.all-noawt.jar" value="${build.jogl}/jogl.all-noawt.jar" /> + <property name="newt.all-noawt.jar" value="${build.newt}/newt.all-noawt.jar" /> <path id="nativewindow_gluegen.classpath"> <pathelement location="${gluegen-rt.jar}" /> @@ -204,23 +210,40 @@ <pathelement location="${newt.all.jar}" /> </path> - <path id="junit_jogl_newt.run.classpath"> + <path id="junit_jogl_awt.run.classpath"> <pathelement location="${junit.jar}" /> <pathelement location="${ant.jar}" /> <pathelement location="${ant-junit.jar}" /> <pathelement location="${gluegen-rt.jar}" /> <pathelement location="${nativewindow.all.jar}" /> <pathelement location="${jogl.all.jar}" /> - <pathelement location="${newt.all.jar}" /> + <pathelement location="${newt.event.jar}" /> + <pathelement location="${jogl.test.jar}" /> + </path> + + <path id="junit_jogl_newt.run.classpath"> + <pathelement location="${junit.jar}" /> + <pathelement location="${ant.jar}" /> + <pathelement location="${ant-junit.jar}" /> + <pathelement location="${gluegen-rt.jar}" /> + <pathelement location="${nativewindow.all-noawt.jar}" /> + <pathelement location="${jogl.all-noawt.jar}" /> + <pathelement location="${newt.all-noawt.jar}" /> <pathelement location="${jogl.test.jar}" /> </path> <property name="junit_jogl_newt.run.jars" - value="${junit.jar}${path.separator}${ant.jar}${path.separator}${ant-junit.jar}${path.separator}${gluegen-rt.jar}${path.separator}${nativewindow.all.jar}${path.separator}${jogl.all.jar}${path.separator}${newt.all.jar}${path.separator}${jogl.test.jar}"/> + value="${junit.jar}${path.separator}${ant.jar}${path.separator}${ant-junit.jar}${path.separator}${gluegen-rt.jar}${path.separator}${nativewindow.all-noawt.jar}${path.separator}${jogl.all-noawt.jar}${path.separator}${newt.all-noawt.jar}${path.separator}${jogl.test.jar}"/> - <!-- JavaSE combinations . NO.AWT --> - <property name="nativewindow.all-noawt.jar" value="${build.nativewindow}/nativewindow.all-noawt.jar" /> - <property name="jogl.all-noawt.jar" value="${build.jogl}/jogl.all-noawt.jar" /> - <property name="newt.all-noawt.jar" value="${build.newt}/newt.all-noawt.jar" /> + <path id="junit_jogl_newt_awt.run.classpath"> + <pathelement location="${junit.jar}" /> + <pathelement location="${ant.jar}" /> + <pathelement location="${ant-junit.jar}" /> + <pathelement location="${gluegen-rt.jar}" /> + <pathelement location="${nativewindow.all.jar}" /> + <pathelement location="${jogl.all.jar}" /> + <pathelement location="${newt.all.jar}" /> + <pathelement location="${jogl.test.jar}" /> + </path> <path id="jogl_newt_all-noawt.classpath"> <pathelement location="${gluegen-rt.jar}" /> diff --git a/make/build-junit.xml b/make/build-junit.xml index 44a0a7866..e9f292e27 100644 --- a/make/build-junit.xml +++ b/make/build-junit.xml @@ -88,38 +88,18 @@ </jar> </target> - <target name="junit.run" depends="junit.compile"> - <!-- Perform the junit tests--> + <target name="junit.run.setup" depends="junit.compile"> <mkdir dir="${results.junit}" /> <delete quiet="true"> <fileset dir="${results.junit}" includes="**"/> </delete> - <condition property="jvmarg.newt" value="-XstartOnFirstThread -Djava.awt.headless=true"><isset property="isOSX"/></condition> - <condition property="jvmarg.newt" value="-Djava.awt.headless=true"><not><isset property="isOSX"/></not></condition> - - <!-- Test*CORE* --> - <junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}"> - <env key="${system.env.library.path}" path="${obj.all.paths}"/> - <jvmarg value="-Djava.library.path=${obj.all.paths}"/> - <!-- - <jvmarg value="-Dnewt.debug.EDT"/> - --> - - <formatter usefile="false" type="plain"/> - <formatter usefile="true" type="xml"/> - <classpath refid="junit_jogl_newt.run.classpath"/> - - <batchtest todir="${results.junit}"> - <fileset dir="${classes}"> - <include name="${java.dir.test}/**/Test*CORE*"/> - <exclude name="**/*$$*"/> - </fileset> - <formatter usefile="false" type="brief"/> - <formatter usefile="true" type="xml"/> - </batchtest> - </junit> + <condition property="jvmarg.newt.headless" value="-XstartOnFirstThread -Djava.awt.headless=true"><isset property="isOSX"/></condition> + <condition property="jvmarg.newt.headless" value="-Djava.awt.headless=true"><not><isset property="isOSX"/></not></condition> + </target> + <!-- NEWT is currently not supported on OSX --> + <target name="junit.run.newt.headless" depends="junit.run.setup" unless="isOSX"> <!-- Test*NEWT* Emulation of junit task, @@ -144,7 +124,7 @@ <packagemapper from="*.class" to="*"/> <!-- FQCN --> </chainedmapper> </pathconvert> - <var name="test.class.result.file" value="${results.junit}/TEST-${test.class.fqn}.xml"/> + <var name="test.class.result.file" value="${results.junit}/TEST-headless-${test.class.fqn}.xml"/> <echo message="Testing ${test.class.fqn} -> ${test.class.result.file}"/> <apply dir="." executable="${java.home}/bin/java" parallel="false" @@ -155,7 +135,7 @@ <env key="${system.env.library.path}" path="${obj.all.paths}"/> <env key="CLASSPATH" value="${junit_jogl_newt.run.jars}"/> <arg value="-Djava.library.path=${obj.all.paths}"/> - <arg line="${jvmarg.newt}"/> + <arg line="${jvmarg.newt.headless}"/> <!-- <arg line="-Dnewt.debug.EDT"/> --> @@ -178,8 +158,12 @@ </apply> </sequential> </for> + </target> - <!-- Test*AWT* --> + <!-- junit.run.newt is covered by junit.run.newt.headless, disable it for now, but may be checked manually --> + <!-- NEWT is currently not supported on OSX --> + <target name="junit.run.newt" depends="junit.run.setup" unless="isOSX"> + <!-- Test*NEWT* --> <junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}"> <env key="${system.env.library.path}" path="${obj.all.paths}"/> <jvmarg value="-Djava.library.path=${obj.all.paths}"/> @@ -203,16 +187,87 @@ <batchtest todir="${results.junit}"> <fileset dir="${classes}"> + <include name="${java.dir.test}/**/Test*NEWT*"/> + <exclude name="**/*$$*"/> + </fileset> + <formatter usefile="false" type="brief"/> + <formatter usefile="true" type="xml"/> + </batchtest> + </junit> + </target> + + <target name="junit.run.awt" depends="junit.run.setup"> + <!-- Test*AWT* --> + <junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}"> + <env key="${system.env.library.path}" path="${obj.all.paths}"/> + <jvmarg value="-Djava.library.path=${obj.all.paths}"/> + + <!-- + <jvmarg value="-Dnewt.debug.EDT"/> + <jvmarg value="-Djogl.debug=all"/> + <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/> + <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/> + <jvmarg value="-Djogl.debug.GLSLState"/> + <jvmarg value="-Dnativewindow.debug=all"/> + <jvmarg value="-Dnewt.debug=all"/> + <jvmarg value="-verbose:jni"/> + <jvmarg value="-client"/> + <jvmarg value="-d32"/> + --> + + <formatter usefile="false" type="plain"/> + <formatter usefile="true" type="xml"/> + <classpath refid="junit_jogl_awt.run.classpath"/> + + <batchtest todir="${results.junit}"> + <fileset dir="${classes}"> <include name="${java.dir.test}/**/Test*AWT*"/> <exclude name="**/*$$*"/> + <exclude name="**/newt/**"/> </fileset> <formatter usefile="false" type="brief"/> <formatter usefile="true" type="xml"/> </batchtest> </junit> + </target> + + <!-- NEWT is currently not supported on OSX --> + <target name="junit.run.newt.awt" depends="junit.run.setup" unless="isOSX"> + <!-- Test*AWT* --> + <junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}"> + <env key="${system.env.library.path}" path="${obj.all.paths}"/> + <jvmarg value="-Djava.library.path=${obj.all.paths}"/> + + <!-- + <jvmarg value="-Dnewt.debug.EDT"/> + <jvmarg value="-Djogl.debug=all"/> + <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/> + <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/> + <jvmarg value="-Djogl.debug.GLSLState"/> + <jvmarg value="-Dnativewindow.debug=all"/> + <jvmarg value="-Dnewt.debug=all"/> + <jvmarg value="-verbose:jni"/> + <jvmarg value="-client"/> + <jvmarg value="-d32"/> + --> + <formatter usefile="false" type="plain"/> + <formatter usefile="true" type="xml"/> + <classpath refid="junit_jogl_newt_awt.run.classpath"/> + + <batchtest todir="${results.junit}"> + <fileset dir="${classes}"> + <include name="${java.dir.test}/**/newt/**/Test*AWT*"/> + <exclude name="**/*$$*"/> + </fileset> + <formatter usefile="false" type="brief"/> + <formatter usefile="true" type="xml"/> + </batchtest> + </junit> </target> + <target name="junit.run" depends="junit.run.newt.headless,junit.run.awt,junit.run.newt.awt"/> + <!-- ================================================================== --> <!-- - Build everything. diff --git a/make/build-newt.xml b/make/build-newt.xml index 820c50a3a..5c2ba8d7f 100644 --- a/make/build-newt.xml +++ b/make/build-newt.xml @@ -692,6 +692,10 @@ <fileset dir="${classes}" includes="com/jogamp/newt/**" /> </jar> + <jar manifest="tempversion" destfile="${newt.event.jar}" filesonly="true"> + <fileset dir="${classes}" + includes="com/jogamp/newt/Display* com/jogamp/newt/Screen* com/jogamp/newt/Window* com/jogamp/newt/ScreenMode* com/jogamp/newt/event/** com/jogamp/newt/impl/Debug*" /> + </jar> </target> <target name="build-jars-all-noawt" depends="setup-manifestfile"> diff --git a/make/scripts/count-lock.sh b/make/scripts/count-lock.sh new file mode 100644 index 000000000..806235f5c --- /dev/null +++ b/make/scripts/count-lock.sh @@ -0,0 +1,17 @@ + +echo lock +grep -RI "lock()" ../src/ | wc +echo unlock +grep -RI "unlock()" ../src/ | wc +echo +echo + +for i in `grep -RIl "unlock()" ../src/` ; do + echo $i + echo lock + grep -RI "lock()" $i | wc + echo unlock + grep -RI "unlock()" $i | wc + echo + echo +done diff --git a/make/scripts/make-runtime-properties.sh b/make/scripts/make-runtime-properties.sh new file mode 100644 index 000000000..f546a93ee --- /dev/null +++ b/make/scripts/make-runtime-properties.sh @@ -0,0 +1,59 @@ +#! /bin/bash + +dest0=../doc/Implementation +dest=../doc/Implementation/runtime-properties-temp + +rm -rf $dest +mkdir $dest + +function cleanup() { + tfile=$1 + shift + ffile=$1 + shift + domain=$1 + shift + + sed -e 's/^.*(\"//g' -i $tfile + sed -e 's/\".*$//g' -i $tfile + sed -e "s/^/$domain/g" -i $tfile + + sort -u $tfile > $ffile + rm -f $tfile +} + +grep -hRI "Debug\.debug" ../../gluegen/src/java/com/jogamp | sort -u > $dest/gluegen-rt.debug.tmp1.txt +cleanup $dest/gluegen-rt.debug.tmp1.txt $dest/gluegen-rt.debug.txt jogamp.debug. +grep -hRI -e "Debug\.isPropertyDefined" -e "Debug\.get" ../../gluegen/src/java/com/jogamp | sort -u > $dest/gluegen-rt.debug.ipd.tmp1.txt +cleanup $dest/gluegen-rt.debug.ipd.tmp1.txt $dest/gluegen-rt.ipd.debug.txt + +grep -hRI "Debug\.debug" ../src/nativewindow | sort -u > $dest/nativewindow.debug.tmp1.txt +cleanup $dest/nativewindow.debug.tmp1.txt $dest/nativewindow.debug.txt nativewindow.debug. +grep -hRI -e "Debug\.isPropertyDefined" -e "Debug\.get" ../src/nativewindow | sort -u > $dest/nativewindow.debug.ipd.tmp1.txt +cleanup $dest/nativewindow.debug.ipd.tmp1.txt $dest/nativewindow.ipd.debug.txt + +grep -hRI "Debug\.debug" ../src/jogl | sort -u > $dest/jogl.debug.all.tmp1.txt +cleanup $dest/jogl.debug.all.tmp1.txt $dest/jogl.debug.all.txt jogl.debug. +grep -hRI -e "Debug\.isPropertyDefined" -e "Debug\.get" ../src/jogl | sort -u > $dest/jogl.debug.ipd.tmp1.txt +cleanup $dest/jogl.debug.ipd.tmp1.txt $dest/jogl.ipd.debug.txt + +grep -hRI "Debug\.debug" ../src/newt | sort -u > $dest/newt.debug.tmp1.txt +cleanup $dest/newt.debug.tmp1.txt $dest/newt.debug.txt newt.debug. +grep -hRI -e "Debug\.isPropertyDefined" -e "Debug\.get" ../src/newt | sort -u > $dest/newt.debug.ipd.tmp1.txt +cleanup $dest/newt.debug.ipd.tmp1.txt $dest/newt.ipd.debug.txt + +function onefile() { + for i in $dest/* ; do + echo $i + echo ---------------------------------------- + sed 's/^/ /g' $i + echo + echo + echo + done +} + +onefile > $dest0/runtime-properties-new.txt + +rm -rf $dest + diff --git a/make/scripts/tests.bat b/make/scripts/tests.bat index 873f039a8..1f3014660 100644 --- a/make/scripts/tests.bat +++ b/make/scripts/tests.bat @@ -1,7 +1,8 @@ -REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsNEWT -time 30000 +REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT -time 30000 REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.acore.TestGLProfile01CORE -REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestParenting01AWT +REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411 +REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestParenting01AWT REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting01cAWT -time 50000 REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestListenerCom01AWT REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting01NEWT diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index b7033d3e1..83c852584 100755..100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -1,49 +1,93 @@ #! /bin/bash +bdir=../build-x86_64 + rm -f java-run.log spath=`dirname $0` -#com.jogamp.test.junit.newt.TestParenting01AWT - -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.jogl.acore.TestGLProfile01NEWT $* - -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsAWT $* -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsNEWT $* -# $spath/java-run-all.sh ../build-x86_64 -Djava.awt.headless=true com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsNEWT $* - -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.TestDisplayLifecycle01NEWT $* - -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.TestListenerCom01AWT $* - -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.TestGLWindows01NEWT $* -# $spath/java-run-all.sh ../build-x86_64 -Djava.awt.headless=true com.jogamp.test.junit.newt.TestGLWindows01NEWT $* -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.TestGLWindows02NEWTAnimated $* - -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.jogl.offscreen.TestOffscreen01NEWT $* - -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.parenting.TestParenting01NEWT $* -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.parenting.TestParenting02NEWT $* - -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.parenting.TestParenting01aAWT $* -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.parenting.TestParenting01bAWT $* -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.parenting.TestParenting01cAWT $* -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.parenting.TestParenting01cSwingAWT $* -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.parenting.TestParenting02AWT $* -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.parenting.TestParenting03AWT $* - -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.jogl.awt.TestSwingAWTRobotUsageBeforeJOGLInitBug411 $* -# $spath/java-run-all.sh ../build-x86_64 -Dnativewindow.debug.ToolkitLock.TraceLock com.jogamp.test.junit.jogl.awt.TestSwingAWTRobotUsageBeforeJOGLInitBug411 $* - -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.TestFocus01SwingAWTRobot $* -# $spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.TestFocus02SwingAWTRobot $* - -#$spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.TestEventSourceNotAWTBug $* - -#$spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.TestScreenMode01NEWT $* - -$spath/java-run-all.sh ../build-x86_64 com.jogamp.test.junit.newt.TestScreenMode02NEWT $* - - +. $spath/setenv-jogl.sh $bdir JOGL_ALL + +which java 2>&1 | tee -a java-run.log +java -version 2>&1 | tee -a java-run.log +echo LIBXCB_ALLOW_SLOPPY_LOCK: $LIBXCB_ALLOW_SLOPPY_LOCK 2>&1 | tee -a java-run.log +echo LIBGL_DRIVERS_PATH: $LIBGL_DRIVERS_PATH 2>&1 | tee -a java-run.log +echo LIBGL_DEBUG: $LIBGL_DEBUG 2>&1 | tee -a java-run.log +echo java $X_ARGS $D_ARGS $* 2>&1 | tee -a java-run.log + +function jrun() { + awtarg=$1 + shift + # D_ARGS="-Djogamp.debug.TraceLock" + # D_ARGS="-Dnewt.debug.EDT -Dnativewindow.debug.ToolkitLock.TraceLock -Dnativewindow.debug.NativeWindow" + # D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT" + # D_ARGS="-Dnewt.debug.EDT -Dnativewindow.debug.ToolkitLock.TraceLock -Dnativewindow.debug.X11Util.TraceDisplayLifecycle=true" + #D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=600000 -Djogamp.debug.Lock -Djogamp.debug.Lock.TraceLock" + # D_ARGS="-Dnewt.debug.Window -Dnewt.debug.EDT -Dnewt.debug.Display " + #D_ARGS="-Dnewt.debug.EDT -Djogamp.common.utils.locks.Lock.timeout=600000 -Djogl.debug.Animator -Dnewt.debug.Display -Dnewt.debug.Screen" + #D_ARGS="-Dnewt.debug.EDT -Dnewt.debug.Display -Dnativewindow.debug.X11Util -Djogl.debug.GLDrawable -Djogl.debug.GLCanvas" + #D_ARGS="-Dnewt.debug.EDT -Djogl.debug.GLContext" + D_ARGS="-Dnewt.debug.Screen -Dnewt.debug.EDT -Djogamp.debug.Lock" + #D_ARGS="-Dnewt.debug.EDT" + #D_ARGS="-Dnewt.debug.EDT -Djogl.debug=all -Dnativewindow.debug=all" + # D_ARGS="-Djogl.debug=all" + X_ARGS="-Dsun.java2d.noddraw=true -Dsun.java2d.opengl=false" + java $awtarg $X_ARGS $D_ARGS $* 2>&1 | tee -a java-run.log +} + +function testnoawt() { + jrun -Djava.awt.headless=true $* +} + +function testawt() { + jrun -Djava.awt.headless=false $* +} + +# +# newt (testnoawt and testawt) +# +#testnoawt com.jogamp.test.junit.jogl.acore.TestGLProfile01NEWT $* +#testawt com.jogamp.test.junit.jogl.acore.TestGLProfile01NEWT $* +#testawt com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT +#testawt com.jogamp.test.junit.newt.TestDisplayLifecycle01NEWT +#testawt com.jogamp.test.junit.newt.parenting.TestParenting01NEWT +#testawt com.jogamp.test.junit.newt.parenting.TestParenting02NEWT +#testawt com.jogamp.test.junit.newt.TestScreenMode00NEWT +testnoawt com.jogamp.test.junit.newt.TestScreenMode01NEWT +#testnoawt com.jogamp.test.junit.newt.TestScreenMode02NEWT +#testawt com.jogamp.test.junit.newt.TestGLWindows01NEWT +#testawt -Djava.awt.headless=true com.jogamp.test.junit.newt.TestGLWindows01NEWT +#testawt com.jogamp.test.junit.newt.TestGLWindows02NEWTAnimated + + +# +# awt (testawt) +# +#testawt com.jogamp.test.junit.jogl.awt.TestAWT01GLn $* +#testawt com.jogamp.test.junit.jogl.awt.TestAWT02WindowClosing +#testawt com.jogamp.test.junit.jogl.awt.TestSwingAWT01GLn +#testawt com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsAWT +#testawt com.jogamp.test.junit.jogl.texture.TestTexture01AWT + +# +# newt.awt (testawt) +# +#testawt com.jogamp.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411 +#testawt com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNewtAWTWrapper +#testawt com.jogamp.test.junit.newt.TestEventSourceNotAWTBug +#testawt com.jogamp.test.junit.newt.TestFocus01SwingAWTRobot +#testawt com.jogamp.test.junit.newt.TestFocus02SwingAWTRobot +#testawt com.jogamp.test.junit.newt.TestListenerCom01AWT +#testawt com.jogamp.test.junit.newt.parenting.TestParenting01aAWT +#testawt com.jogamp.test.junit.newt.parenting.TestParenting01bAWT +#testawt com.jogamp.test.junit.newt.parenting.TestParenting01cAWT +#testawt com.jogamp.test.junit.newt.parenting.TestParenting01cSwingAWT +#testawt com.jogamp.test.junit.newt.parenting.TestParenting02AWT +#testawt com.jogamp.test.junit.newt.parenting.TestParenting03AWT +#testawt com.jogamp.test.junit.newt.parenting.TestParenting03AWT -time 100000 +#testawt com.jogamp.test.junit.newt.parenting.TestParenting03bAWT -time 100000 + +#testawt $* $spath/count-edt-start.sh java-run.log + diff --git a/make/scripts/tests2.sh b/make/scripts/tests2.sh deleted file mode 100644 index 9f143e60a..000000000 --- a/make/scripts/tests2.sh +++ /dev/null @@ -1,84 +0,0 @@ -#! /bin/bash - -bdir=../build-x86_64 - -rm -f java-run.log - -spath=`dirname $0` - -. $spath/setenv-jogl.sh $bdir JOGL_ALL - -which java 2>&1 | tee -a java-run.log -java -version 2>&1 | tee -a java-run.log -echo LIBXCB_ALLOW_SLOPPY_LOCK: $LIBXCB_ALLOW_SLOPPY_LOCK 2>&1 | tee -a java-run.log -echo LIBGL_DRIVERS_PATH: $LIBGL_DRIVERS_PATH 2>&1 | tee -a java-run.log -echo LIBGL_DEBUG: $LIBGL_DEBUG 2>&1 | tee -a java-run.log -echo java $X_ARGS $D_ARGS $* 2>&1 | tee -a java-run.log - -function jrun() { - awtarg=$1 - shift - # D_ARGS="-Djogamp.debug.TraceLock" - # D_ARGS="-Dnewt.debug.EDT -Dnativewindow.debug.ToolkitLock.TraceLock -Dnativewindow.debug.NativeWindow" - # D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT" - # D_ARGS="-Dnewt.debug.EDT -Dnativewindow.debug.ToolkitLock.TraceLock -Dnativewindow.debug.X11Util.TraceDisplayLifecycle=true" - #D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=600000 -Djogamp.debug.Lock -Djogamp.debug.Lock.TraceLock" - # D_ARGS="-Dnewt.debug.Window -Dnewt.debug.EDT -Dnewt.debug.Display " - #D_ARGS="-Dnewt.debug.EDT -Djogamp.common.utils.locks.Lock.timeout=600000 -Djogl.debug.Animator -Dnewt.debug.Display -Dnewt.debug.Screen" - #D_ARGS="-Dnewt.debug.EDT -Dnewt.debug.Display -Dnativewindow.debug.X11Util -Djogl.debug.GLDrawable -Djogl.debug.GLCanvas" - #D_ARGS="-Dnewt.debug.EDT -Djogl.debug.GLContext" - D_ARGS="-Dnewt.debug.Screen -Dnewt.debug.EDT -Djogamp.debug.Lock" - #D_ARGS="-Dnewt.debug.EDT" - #D_ARGS="-Dnewt.debug.EDT -Djogl.debug=all -Dnativewindow.debug=all" - # D_ARGS="-Djogl.debug=all" - X_ARGS="-Dsun.java2d.noddraw=true -Dsun.java2d.opengl=false" - java $awtarg $X_ARGS $D_ARGS $* 2>&1 | tee -a java-run.log -} - -function testnoawt() { - jrun -Djava.awt.headless=true $* -} - -function testawt() { - jrun -Djava.awt.headless=false $* -} - -#testnoawt com.jogamp.test.junit.jogl.acore.TestGLProfile01NEWT $* -#testawt com.jogamp.test.junit.jogl.acore.TestGLProfile01NEWT $* - -#testawt com.jogamp.test.junit.jogl.awt.TestAWT01GLn $* -#testawt com.jogamp.test.junit.jogl.awt.TestAWT02WindowClosing -#testawt com.jogamp.test.junit.jogl.awt.TestSwingAWT01GLn -#testawt com.jogamp.test.junit.jogl.awt.TestSwingAWTRobotUsageBeforeJOGLInitBug411 -#testawt com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsAWT -#testawt com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsNewtAWTWrapper -#testawt com.jogamp.test.junit.jogl.texture.TestTexture01AWT -#testawt com.jogamp.test.junit.newt.TestEventSourceNotAWTBug -#testawt com.jogamp.test.junit.newt.TestFocus01SwingAWTRobot -#testawt com.jogamp.test.junit.newt.TestFocus02SwingAWTRobot -#testawt com.jogamp.test.junit.newt.TestListenerCom01AWT -#testawt com.jogamp.test.junit.newt.parenting.TestParenting01aAWT -#testawt com.jogamp.test.junit.newt.parenting.TestParenting01bAWT -#testawt com.jogamp.test.junit.newt.parenting.TestParenting01cAWT -#testawt com.jogamp.test.junit.newt.parenting.TestParenting01cSwingAWT -#testawt com.jogamp.test.junit.newt.parenting.TestParenting02AWT -#testawt com.jogamp.test.junit.newt.parenting.TestParenting03AWT -#testawt com.jogamp.test.junit.newt.parenting.TestParenting03AWT -time 100000 -#testawt com.jogamp.test.junit.newt.parenting.TestParenting03bAWT -time 100000 -#testawt com.jogamp.test.junit.core.TestIteratorIndexCORE - -#testawt com.jogamp.test.junit.newt.TestDisplayLifecycle01NEWT -#testawt com.jogamp.test.junit.newt.parenting.TestParenting01NEWT -#testawt com.jogamp.test.junit.newt.parenting.TestParenting02NEWT - -#testawt com.jogamp.test.junit.newt.TestScreenMode00NEWT -testnoawt com.jogamp.test.junit.newt.TestScreenMode01NEWT -#testnoawt com.jogamp.test.junit.newt.TestScreenMode02NEWT - -#testawt com.jogamp.test.junit.newt.TestGLWindows01NEWT -#testawt -Djava.awt.headless=true com.jogamp.test.junit.newt.TestGLWindows01NEWT -#testawt com.jogamp.test.junit.newt.TestGLWindows02NEWTAnimated - -#testawt $* - -$spath/count-edt-start.sh java-run.log diff --git a/src/junit/com/jogamp/test/junit/jogl/acore/TestGLProfile01NEWT.java b/src/junit/com/jogamp/test/junit/jogl/acore/TestGLProfile01NEWT.java index e6988582c..0c64cfdf2 100644 --- a/src/junit/com/jogamp/test/junit/jogl/acore/TestGLProfile01NEWT.java +++ b/src/junit/com/jogamp/test/junit/jogl/acore/TestGLProfile01NEWT.java @@ -29,6 +29,7 @@ package com.jogamp.test.junit.jogl.acore; import com.jogamp.test.junit.util.UITestCase; +import com.jogamp.test.junit.util.DumpVersion; import org.junit.Assert; import org.junit.Before; diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java index d0f915e03..d9194c216 100644 --- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java +++ b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java @@ -2,18 +2,14 @@ package com.jogamp.test.junit.jogl.demos.gl2.gears; import javax.media.opengl.*; -import javax.media.opengl.awt.*; -import com.jogamp.opengl.util.Animator; + import com.jogamp.newt.event.*; import com.jogamp.newt.event.awt.*; - -import java.awt.Component; -import java.awt.Frame; import com.jogamp.newt.Window; /** * Gears.java <BR> - * author: Brian Paul (converted to Java by Ron Cemer and Sven Goethel) <P> + * author: Brian Paul (converted to Java by Ron Cemer and Sven Gothel) <P> * * This version is equal to Brian Paul's version 1.2 1999/10/21 */ @@ -24,8 +20,8 @@ public class Gears implements GLEventListener { private float angle = 0.0f; private int swapInterval; - private int prevMouseX, prevMouseY; private boolean mouseRButtonDown = false; + private int prevMouseX, prevMouseY; public Gears(int swapInterval) { this.swapInterval = swapInterval; @@ -35,42 +31,6 @@ public class Gears implements GLEventListener { this.swapInterval = 1; } - public static void main(String[] args) { - // set argument 'NotFirstUIActionOnProcess' in the JNLP's application-desc tag for example - // <application-desc main-class="demos.j2d.TextCube"/> - // <argument>NotFirstUIActionOnProcess</argument> - // </application-desc> - boolean firstUIActionOnProcess = 0==args.length || !args[0].equals("NotFirstUIActionOnProcess") ; - GLProfile.initSingleton(firstUIActionOnProcess); - - Frame frame = new Frame("Gear Demo"); - GLCanvas canvas = new GLCanvas(); - // GLCapabilities caps = new GLCapabilities(GLProfile.getDefault()); - // GLCanvas canvas = new GLCanvas(caps); - - final Gears gears = new Gears(); - canvas.addGLEventListener(gears); - - frame.add(canvas); - frame.setSize(300, 300); - final Animator animator = new Animator(canvas); - frame.addWindowListener(new java.awt.event.WindowAdapter() { - public void windowClosing(java.awt.event.WindowEvent e) { - // Run this on another thread than the AWT event queue to - // make sure the call to Animator.stop() completes before - // exiting - new Thread(new Runnable() { - public void run() { - animator.stop(); - System.exit(0); - } - }).start(); - } - }); - frame.setVisible(true); - animator.start(); - } - public void init(GLAutoDrawable drawable) { System.err.println("Gears: Init"); // Use debug pipeline @@ -113,12 +73,12 @@ public class Gears implements GLEventListener { // MouseListener gearsMouse = new TraceMouseAdapter(new GearsMouseAdapter()); MouseListener gearsMouse = new GearsMouseAdapter(); - if (drawable instanceof Component) { - Component comp = (Component) drawable; - new AWTMouseAdapter(gearsMouse).addTo(comp); - } else if (drawable instanceof Window) { + if (drawable instanceof Window) { Window window = (Window) drawable; window.addMouseListener(gearsMouse); + } else if (GLProfile.isAWTAvailable() && drawable instanceof java.awt.Component) { + java.awt.Component comp = (java.awt.Component) drawable; + new AWTMouseAdapter(gearsMouse).addTo(comp); } } @@ -154,9 +114,10 @@ public class Gears implements GLEventListener { // Special handling for the case where the GLJPanel is translucent // and wants to be composited with other Java 2D content - if ((drawable instanceof GLJPanel) && - !((GLJPanel) drawable).isOpaque() && - ((GLJPanel) drawable).shouldPreserveColorBufferIfTranslucent()) { + if (GLProfile.isAWTAvailable() && + (drawable instanceof javax.media.opengl.awt.GLJPanel) && + !((javax.media.opengl.awt.GLJPanel) drawable).isOpaque() && + ((javax.media.opengl.awt.GLJPanel) drawable).shouldPreserveColorBufferIfTranslucent()) { gl.glClear(GL2.GL_DEPTH_BUFFER_BIT); } else { gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT); @@ -335,8 +296,8 @@ public class Gears implements GLEventListener { Window window = (Window) source; width=window.getWidth(); height=window.getHeight(); - } else if (source instanceof Component) { - Component comp = (Component) source; + } else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) { + java.awt.Component comp = (java.awt.Component) source; width=comp.getWidth(); height=comp.getHeight(); } else { diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java index 60435cb4a..9639c384b 100644 --- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java +++ b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java @@ -37,6 +37,7 @@ import com.jogamp.newt.event.TraceKeyAdapter; import com.jogamp.newt.event.TraceWindowAdapter; import com.jogamp.test.junit.util.UITestCase; +import com.jogamp.test.junit.util.QuitAdapter; import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears; import java.awt.Frame; diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsNEWT.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/newt/TestGearsNEWT.java index 1589be84c..f88d4d16f 100644 --- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsNEWT.java +++ b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/newt/TestGearsNEWT.java @@ -26,23 +26,25 @@ * or implied, of JogAmp Community. */ -package com.jogamp.test.junit.jogl.demos.gl2.gears; +package com.jogamp.test.junit.jogl.demos.gl2.gears.newt; +import com.jogamp.newt.event.KeyAdapter; +import com.jogamp.newt.event.KeyEvent; +import com.jogamp.newt.opengl.GLWindow; import com.jogamp.test.junit.util.UITestCase; +import com.jogamp.test.junit.util.QuitAdapter; -import javax.media.opengl.*; import com.jogamp.opengl.util.Animator; import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears; -import com.jogamp.newt.*; -import com.jogamp.newt.event.*; -import com.jogamp.newt.opengl.*; +import javax.media.opengl.GLAutoDrawable; +import javax.media.opengl.GLCapabilities; +import javax.media.opengl.GLProfile; +import javax.media.opengl.GLRunnable; import org.junit.Assert; -import org.junit.Before; import org.junit.BeforeClass; import org.junit.AfterClass; -import org.junit.After; import org.junit.Test; public class TestGearsNEWT extends UITestCase { diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsNewtAWTWrapper.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/newt/TestGearsNewtAWTWrapper.java index be1e5a58b..c965d5c21 100644 --- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsNewtAWTWrapper.java +++ b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/newt/TestGearsNewtAWTWrapper.java @@ -26,13 +26,14 @@ * or implied, of JogAmp Community. */ -package com.jogamp.test.junit.jogl.demos.gl2.gears; +package com.jogamp.test.junit.jogl.demos.gl2.gears.newt; import javax.media.nativewindow.*; import javax.media.opengl.*; import com.jogamp.opengl.util.Animator; import com.jogamp.test.junit.util.UITestCase; +import com.jogamp.test.junit.util.QuitAdapter; import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears; import com.jogamp.newt.*; import com.jogamp.newt.event.*; diff --git a/src/junit/com/jogamp/test/junit/jogl/awt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java b/src/junit/com/jogamp/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java index 326a6942a..79d899b6c 100644 --- a/src/junit/com/jogamp/test/junit/jogl/awt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java +++ b/src/junit/com/jogamp/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java @@ -26,7 +26,7 @@ * or implied, of JogAmp Community. */ -package com.jogamp.test.junit.jogl.awt; +package com.jogamp.test.junit.jogl.newt; import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears; import com.jogamp.test.junit.util.*; diff --git a/src/junit/com/jogamp/test/junit/jogl/acore/DumpVersion.java b/src/junit/com/jogamp/test/junit/util/DumpVersion.java index 3fa7f111f..df07c5bcf 100644 --- a/src/junit/com/jogamp/test/junit/jogl/acore/DumpVersion.java +++ b/src/junit/com/jogamp/test/junit/util/DumpVersion.java @@ -26,7 +26,7 @@ * or implied, of JogAmp Community. */ -package com.jogamp.test.junit.jogl.acore; +package com.jogamp.test.junit.util; import org.junit.Assert; import org.junit.Before; diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/QuitAdapter.java b/src/junit/com/jogamp/test/junit/util/QuitAdapter.java index e60543b7c..258132582 100644 --- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/QuitAdapter.java +++ b/src/junit/com/jogamp/test/junit/util/QuitAdapter.java @@ -26,12 +26,12 @@ * or implied, of JogAmp Community. */ -package com.jogamp.test.junit.jogl.demos.gl2.gears; +package com.jogamp.test.junit.util; import com.jogamp.opengl.util.Animator; import com.jogamp.newt.event.*; -class QuitAdapter extends WindowAdapter implements WindowListener, KeyListener { +public class QuitAdapter extends WindowAdapter implements WindowListener, KeyListener { boolean shouldQuit = false; public boolean shouldQuit() { return shouldQuit; } diff --git a/src/newt/classes/com/jogamp/newt/event/InputEvent.java b/src/newt/classes/com/jogamp/newt/event/InputEvent.java index d014de7f3..148787845 100644 --- a/src/newt/classes/com/jogamp/newt/event/InputEvent.java +++ b/src/newt/classes/com/jogamp/newt/event/InputEvent.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -33,8 +34,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; - public abstract class InputEvent extends NEWTEvent { public static final int SHIFT_MASK = 1 << 0; diff --git a/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java index 9fb208649..93c8409b1 100644 --- a/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java +++ b/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java @@ -1,5 +1,6 @@ /** * Copyright 2010 JogAmp Community. All rights reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: @@ -28,8 +29,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; - public abstract class KeyAdapter implements KeyListener { public void keyPressed(KeyEvent e) { diff --git a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java index f5ade47d8..852f77fcb 100644 --- a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java +++ b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -33,8 +34,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; - public class KeyEvent extends InputEvent { public KeyEvent(int eventType, Object source, long when, int modifiers, int keyCode, char keyChar) { diff --git a/src/newt/classes/com/jogamp/newt/event/KeyListener.java b/src/newt/classes/com/jogamp/newt/event/KeyListener.java index 5ce3868f5..dae343d80 100644 --- a/src/newt/classes/com/jogamp/newt/event/KeyListener.java +++ b/src/newt/classes/com/jogamp/newt/event/KeyListener.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -33,8 +34,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; - public interface KeyListener extends NEWTEventListener { public void keyPressed(KeyEvent e); diff --git a/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java index 7e04bc114..3607ae634 100644 --- a/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java +++ b/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java @@ -28,8 +28,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; - public abstract class MouseAdapter implements MouseListener { public void mouseClicked(MouseEvent e) { diff --git a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java index 705f558b9..fbe32d41d 100644 --- a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java +++ b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -33,8 +34,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; - public class MouseEvent extends InputEvent { public static final int BUTTON1 = 1; diff --git a/src/newt/classes/com/jogamp/newt/event/MouseListener.java b/src/newt/classes/com/jogamp/newt/event/MouseListener.java index b328aeac7..5ec086b94 100644 --- a/src/newt/classes/com/jogamp/newt/event/MouseListener.java +++ b/src/newt/classes/com/jogamp/newt/event/MouseListener.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -33,8 +34,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; - public interface MouseListener extends NEWTEventListener { public void mouseClicked(MouseEvent e); diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java index 61858b083..10673be3d 100644 --- a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java +++ b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -33,9 +34,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; -import java.util.*; - /** * NEWT events are provided for notification purposes ONLY;<br> * The NEWT will automatically handle the event semantics internally, regardless of whether a program is receiving these events or not.<br> diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java b/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java index 4aa17bc02..fe224bba6 100644 --- a/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java +++ b/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java @@ -28,7 +28,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; import java.util.LinkedList; public class NEWTEventFiFo diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEventListener.java b/src/newt/classes/com/jogamp/newt/event/NEWTEventListener.java index 90d00383d..677136573 100644 --- a/src/newt/classes/com/jogamp/newt/event/NEWTEventListener.java +++ b/src/newt/classes/com/jogamp/newt/event/NEWTEventListener.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -33,8 +34,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; - public interface NEWTEventListener extends java.util.EventListener { } diff --git a/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java index 17d8df80b..14ee633a0 100644 --- a/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java +++ b/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java @@ -28,8 +28,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; - public class TraceMouseAdapter implements MouseListener { MouseListener downstream; diff --git a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java index 3545a42d4..88b165a8d 100644 --- a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java +++ b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java @@ -28,8 +28,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; - public class TraceWindowAdapter implements WindowListener { WindowListener downstream; diff --git a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java index e57138c54..a1ad43a13 100644 --- a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java +++ b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java @@ -28,8 +28,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; - public abstract class WindowAdapter implements WindowListener { public void windowResized(WindowEvent e) { diff --git a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java index 5221b3664..2742e0d95 100644 --- a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java +++ b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -33,8 +34,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; - /** * NEWT Window events are provided for notification purposes ONLY.<br> * NEWT will automatically handle component moves and resizes internally, regardless of whether a program is receiving these events or not. <br> diff --git a/src/newt/classes/com/jogamp/newt/event/WindowListener.java b/src/newt/classes/com/jogamp/newt/event/WindowListener.java index 174d4a414..0d201a2a4 100644 --- a/src/newt/classes/com/jogamp/newt/event/WindowListener.java +++ b/src/newt/classes/com/jogamp/newt/event/WindowListener.java @@ -34,8 +34,6 @@ package com.jogamp.newt.event; -import com.jogamp.newt.*; - public interface WindowListener extends NEWTEventListener { /** Window is resized, your application shall respect the new window dimension. A repaint is recommended. */ public void windowResized(WindowEvent e); diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java index c7b4f7b84..c136946ac 100644 --- a/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java +++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java @@ -28,13 +28,12 @@ package com.jogamp.newt.event.awt; -import com.jogamp.newt.util.EDTUtil; import com.jogamp.newt.impl.Debug; /** * Convenient adapter forwarding AWT events to NEWT via the event listener model.<br> * <p> - * You may attach an instance of this adapter to an AWT Component. When an event happen, + * You may attach an instance of this adapter to an AWT Component. When an event happens, * it is converted to a NEWT event and the given NEWT listener is being called.<br></p> * <p> * This adapter fullfills three use cases. First as a plain utility to write code AWT agnostic, @@ -47,56 +46,68 @@ import com.jogamp.newt.impl.Debug; * or to an AWT component, e.g. {@link java.awt.Component}.<br></p> * <p> * Common:<br> - * <code> - javax.media.opengl.GLEvenListener demo1 = new javax.media.opengl.GLEvenListener() { ... } ;<br> - com.jogamp.newt.event.MouseListener mouseListener = new com.jogamp.newt.event.MouseAdapter() { ... } ;<br> - * </code> </p> + * <pre> + // your demo/render code + javax.media.opengl.GLEvenListener demo1 = new javax.media.opengl.GLEvenListener() { ... } ; + + // your AWT agnostic NEWT mouse listener code + com.jogamp.newt.event.MouseListener mouseListener = new com.jogamp.newt.event.MouseAdapter() { ... } ; + * </pre> </p> * <p> - * NEWT Usage:<br> - * <code> - GLWindow glWindow = GLWindow.create();<br> - glWindow.addGLEventListener(demo1);<br> - glWindow.addMouseListener(mouseListener);<br> - * </code> </p> + * Default NEWT use case, without using the AWTAdapter:<br> + * <pre> + // the NEWT GLAutoDrawable and Window + GLWindow glWindow = GLWindow.create(); + + // attach the renderer demo1 + glWindow.addGLEventListener(demo1); + + // attach the NEWT mouse event listener to glWindow + glWindow.addMouseListener(mouseListener); + * </pre> </p> * <p> - * AWT Usage:<br> - * <code> - GLCanvas glCanvas = new GLCanvas();<br> - glCanvas.addGLEventListener(demo1);<br> - <br> - new AWTMouseAdapter(mouseListener).addTo(glCanvas);<br> - * </code> </p> + * AWT use case, AWTAdapter used as an AWT event translator and forwarder to your NEWT listener:<br> + * <pre> + // the AWT GLAutoDrawable and Canvas + GLCanvas glCanvas = new GLCanvas(); + + // attach the renderer demo1 + glCanvas.addGLEventListener(demo1); + + // attach the AWTMouseAdapter to glCanvas, which translates and forwards events to the NEWT mouseListener + new AWTMouseAdapter(mouseListener).addTo(glCanvas); + * </pre> </p> * <p> - * AWT Usage (previous form in detail):<br> - * <code> - AWTMouseAdapter mouseAdapter = new AWTMouseAdapter(mouseListener);<br> - glCanvas.addMouseListener(mouseAdapter);<br> - glCanvas.addMouseMotionListener(mouseAdapter);<br> - * </code> </p> + * Previous code in detail:<br> + * <pre> + AWTMouseAdapter mouseAdapter = new AWTMouseAdapter(mouseListener); + glCanvas.addMouseListener(mouseAdapter); + glCanvas.addMouseMotionListener(mouseAdapter); + * </pre> </p> * * <p> - * Second is just a litte variation, where we pass a NEWT Window <br> - * to impersonate as the source of the event.<br></p> + * Second use case is just a litte variation of the previous use case, where we pass a NEWT Window <br> + * to be used as the source of the event.<br></p> * <p> - * <code> + * <pre> com.jogamp.newt.event.MouseListener mouseListener = new com.jogamp.newt.event.MouseAdapter() { ... } ;<br> Component comp = ... ; // the AWT component<br> GLWindow glWindow = GLWindow.create(); // the NEWT component<br> <br> new AWTMouseAdapter(mouseListener, glWindow).addTo(comp);<br> - * </code> </p> + * </pre> </p> * * Last but not least, the AWTAdapter maybe used as a general AWT event forwarder to NEWT.<br> * * <p> - * <code> + * <pre> com.jogamp.newt.event.MouseListener mouseListener = new com.jogamp.newt.event.MouseAdapter() { ... } ;<br> Component comp = ... ; // the AWT component<br> GLWindow glWindow = GLWindow.create(); // the NEWT component<br> glWindow.addMouseListener(mouseListener); // add the custom EventListener to the NEWT component<br> <br> new AWTMouseAdapter(glWindow).addTo(comp); // forward all AWT events to glWindow, as NEWT events<br> - * </code> </p> + * </pre> </p> * * @see #attachTo */ diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTParentWindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTParentWindowAdapter.java index 44ad3586e..68f2b3e0f 100644 --- a/src/newt/classes/com/jogamp/newt/event/awt/AWTParentWindowAdapter.java +++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTParentWindowAdapter.java @@ -28,8 +28,6 @@ package com.jogamp.newt.event.awt; -import java.awt.KeyboardFocusManager; - /** * Specialized parent/client adapter, * where the NEWT child window really gets resized, diff --git a/src/newt/classes/com/jogamp/newt/impl/DefaultEDTUtil.java b/src/newt/classes/com/jogamp/newt/impl/DefaultEDTUtil.java index 0fdfd44fe..c5460ef40 100644 --- a/src/newt/classes/com/jogamp/newt/impl/DefaultEDTUtil.java +++ b/src/newt/classes/com/jogamp/newt/impl/DefaultEDTUtil.java @@ -143,8 +143,13 @@ public class DefaultEDTUtil implements EDTUtil { task.run(); wait = false; // running in same thread (EDT) -> no wait if(stop && edt.tasks.size()>0) { - Throwable t = new Throwable("Warning: EDT about (2) to stop, having remaining tasks: "+edt.tasks.size()+" - "+edt); - t.printStackTrace(); + String msg = "Warning: EDT about (2) to stop, having remaining tasks: "+edt.tasks.size()+" - "+edt; + if(DEBUG) { + Throwable t = new Throwable(msg); + t.printStackTrace(); + } else { + System.err.println(msg); + } } } else { synchronized(edt.tasks) { |