aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java6
-rw-r--r--src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java72
-rw-r--r--src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java24
-rw-r--r--src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java20
-rw-r--r--src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java58
-rw-r--r--src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java188
-rw-r--r--src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java64
-rw-r--r--src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java92
-rw-r--r--src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java106
-rw-r--r--src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java26
-rw-r--r--src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java22
-rw-r--r--src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java54
-rw-r--r--src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java46
-rw-r--r--src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java28
-rw-r--r--src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java8
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java40
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/Region.java28
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java4
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java16
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java41
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java20
-rw-r--r--src/jogl/classes/com/jogamp/graph/font/FontFactory.java8
-rw-r--r--src/jogl/classes/com/jogamp/graph/geom/Outline.java18
-rw-r--r--src/jogl/classes/com/jogamp/graph/geom/SVertex.java22
-rw-r--r--src/jogl/classes/com/jogamp/graph/geom/Triangle.java4
-rw-r--r--src/jogl/classes/com/jogamp/opengl/FBObject.java166
-rw-r--r--src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java6
-rw-r--r--src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java22
-rw-r--r--src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java24
-rw-r--r--src/jogl/classes/com/jogamp/opengl/JoglVersion.java26
-rw-r--r--src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java4
-rw-r--r--src/jogl/classes/com/jogamp/opengl/cg/CgException.java6
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/Binary16.java24
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/Binary32.java2
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/Binary64.java6
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java8
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/Quaternion.java8
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java10
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java36
-rw-r--r--src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java42
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java40
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/Animator.java20
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java34
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java12
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java14
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java76
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java146
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java58
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java145
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java16
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java30
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java12
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java18
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/Gamma.java4
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java255
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java15
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/PNGPixelRect.java2
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java10
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java18
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java20
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java6
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java20
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java4
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java6
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java4
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java27
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java6
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java16
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java14
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java98
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java416
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java133
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java12
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java8
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java2
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java371
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java680
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java618
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java8
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java10
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java4
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java90
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java40
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java129
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java86
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java6
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java48
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java4
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java54
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java52
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java14
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java54
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java8
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java134
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java14
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java129
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java333
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java4
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java14
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java52
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java28
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java143
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java20
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java48
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java30
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java22
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java128
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java76
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java36
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java26
-rw-r--r--src/jogl/classes/javax/media/opengl/DebugGL2.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/DebugGL3.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/DebugGL3bc.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/DebugGL4.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/DebugGLES2.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java16
-rw-r--r--src/jogl/classes/javax/media/opengl/GLCapabilities.java44
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java148
-rw-r--r--src/jogl/classes/javax/media/opengl/GLDebugMessage.java90
-rw-r--r--src/jogl/classes/javax/media/opengl/GLDrawableFactory.java21
-rw-r--r--src/jogl/classes/javax/media/opengl/GLException.java6
-rw-r--r--src/jogl/classes/javax/media/opengl/GLPipelineFactory.java26
-rw-r--r--src/jogl/classes/javax/media/opengl/GLProfile.java170
-rw-r--r--src/jogl/classes/javax/media/opengl/GLUniformData.java28
-rw-r--r--src/jogl/classes/javax/media/opengl/Threading.java4
-rw-r--r--src/jogl/classes/javax/media/opengl/TraceGL2.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/TraceGL3.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/TraceGL3bc.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/TraceGL4.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/TraceGLES2.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLCanvas.java118
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLJPanel.java185
-rw-r--r--src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java4
-rw-r--r--src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java30
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java28
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java31
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java14
-rw-r--r--src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java4
-rw-r--r--src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java6
-rw-r--r--src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java22
-rw-r--r--src/jogl/classes/jogamp/graph/curve/tess/HEdge.java22
-rw-r--r--src/jogl/classes/jogamp/graph/curve/tess/Loop.java42
-rw-r--r--src/jogl/classes/jogamp/graph/font/JavaFontLoader.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java40
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java2
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java16
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java22
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java28
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java26
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java2
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java24
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java18
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java16
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java136
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java180
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java52
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java24
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java32
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java18
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java16
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java16
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java24
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java62
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java18
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java38
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java30
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java30
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java26
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java40
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java30
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java18
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java16
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java16
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java22
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java20
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java70
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java34
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java32
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java2
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java6
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java4
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java12
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java14
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java20
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java10
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java2
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java8
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java48
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java30
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java18
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java372
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java188
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java40
-rw-r--r--src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java70
-rw-r--r--src/jogl/classes/jogamp/graph/geom/plane/Crossing.java206
-rw-r--r--src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java2
-rw-r--r--src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java2
-rw-r--r--src/jogl/classes/jogamp/graph/geom/plane/Path2D.java76
-rw-r--r--src/jogl/classes/jogamp/opengl/Debug.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java21
-rw-r--r--src/jogl/classes/jogamp/opengl/FPSCounterImpl.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java46
-rw-r--r--src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java9
-rw-r--r--src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java21
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextImpl.java148
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextShareSet.java10
-rw-r--r--src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java37
-rw-r--r--src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java84
-rw-r--r--src/jogl/classes/jogamp/opengl/GLDrawableHelper.java90
-rw-r--r--src/jogl/classes/jogamp/opengl/GLDrawableImpl.java16
-rw-r--r--src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java57
-rw-r--r--src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationFactory.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java30
-rw-r--r--src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java18
-rw-r--r--src/jogl/classes/jogamp/opengl/GLPbufferImpl.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/GLRunnableTask.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/GLStateTracker.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/GLVersionNumber.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/GLWorkerThread.java26
-rw-r--r--src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/MemoryObject.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/ProjectFloat.java54
-rw-r--r--src/jogl/classes/jogamp/opengl/SharedResourceRunner.java36
-rw-r--r--src/jogl/classes/jogamp/opengl/SystemUtil.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/ThreadingImpl.java17
-rw-r--r--src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java62
-rw-r--r--src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java36
-rw-r--r--src/jogl/classes/jogamp/opengl/awt/AWTUtil.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/awt/Java2D.java97
-rw-r--r--src/jogl/classes/jogamp/opengl/awt/VersionApplet.java34
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLContext.java40
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java28
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java104
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java11
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java26
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java46
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLPbufferDrawable.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java270
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java110
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/Glue.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/error/Error.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java51
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java63
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java96
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java920
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java10
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java10
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java311
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java325
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java346
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java32
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java188
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java34
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java20
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java24
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java16
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java24
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java18
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java28
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Curvelist.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java74
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java34
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Maplist.java16
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbssurface.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/PwlArc.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java36
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Splinespec.java22
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java198
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/registry/Registry.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java26
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java44
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java46
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java96
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java25
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java34
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java24
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java48
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java158
-rw-r--r--src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java107
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java56
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java26
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java22
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLDrawable.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java24
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java121
-rw-r--r--src/jogl/classes/jogamp/opengl/openal/av/ALDummyUsage.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java10
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/AudioSampleFormat.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java117
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java18
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java10
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java24
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/VideoPixelFormat.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java51
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java22
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java10
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java148
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java135
-rw-r--r--src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java109
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/FilterType.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/FilterWriteStrategy.java16
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/ImageInfo.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java18
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java94
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/ImageLines.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/PngDeinterlacer.java28
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java108
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkInputStream.java22
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkOutputStream.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java114
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java102
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java64
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java10
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java20
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java24
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java36
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java16
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java16
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java20
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java26
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java26
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java16
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java24
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java28
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java26
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java10
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java16
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java20
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java22
-rw-r--r--src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java45
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java10
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java14
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java10
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java30
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java76
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java90
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java116
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java62
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java28
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java30
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java22
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java22
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java84
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java126
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java60
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java78
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java8
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java10
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java26
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookMutableSize.java6
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java10
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/MutableGraphicsConfiguration.java8
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java4
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java12
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java6
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java28
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsDevice.java2
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java18
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java10
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java6
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java4
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java26
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java53
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java2
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java68
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsConfiguration.java8
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java4
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java4
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/Capabilities.java40
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java10
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java16
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java8
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java6
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java40
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java6
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java56
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java8
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java18
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/util/Insets.java28
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/util/PixelFormat.java2
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/util/PixelFormatUtil.java18
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/util/Point.java22
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java20
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java6
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/Debug.java4
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java2
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java8
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java24
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java8
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java2
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java10
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java6
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java12
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java18
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java2
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java73
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java30
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java14
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java9
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java9
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java14
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java8
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java28
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java6
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java6
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java10
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java2
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java4
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java6
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java6
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java28
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java44
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java10
-rw-r--r--src/newt/classes/com/jogamp/newt/Display.java20
-rw-r--r--src/newt/classes/com/jogamp/newt/MonitorDevice.java6
-rw-r--r--src/newt/classes/com/jogamp/newt/MonitorMode.java22
-rw-r--r--src/newt/classes/com/jogamp/newt/NewtFactory.java89
-rw-r--r--src/newt/classes/com/jogamp/newt/NewtVersion.java4
-rw-r--r--src/newt/classes/com/jogamp/newt/Screen.java12
-rw-r--r--src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java60
-rw-r--r--src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java8
-rw-r--r--src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java18
-rw-r--r--src/newt/classes/com/jogamp/newt/event/InputEvent.java2
-rw-r--r--src/newt/classes/com/jogamp/newt/event/KeyAdapter.java4
-rw-r--r--src/newt/classes/com/jogamp/newt/event/KeyEvent.java2
-rw-r--r--src/newt/classes/com/jogamp/newt/event/MouseAdapter.java16
-rw-r--r--src/newt/classes/com/jogamp/newt/event/MouseEvent.java2
-rw-r--r--src/newt/classes/com/jogamp/newt/event/NEWTEvent.java2
-rw-r--r--src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java4
-rw-r--r--src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java6
-rw-r--r--src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java6
-rw-r--r--src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java18
-rw-r--r--src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java16
-rw-r--r--src/newt/classes/com/jogamp/newt/event/WindowAdapter.java14
-rw-r--r--src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java10
-rw-r--r--src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java16
-rw-r--r--src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java42
-rw-r--r--src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java72
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java152
-rw-r--r--src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java28
-rw-r--r--src/newt/classes/com/jogamp/newt/util/MainThread.java41
-rw-r--r--src/newt/classes/com/jogamp/newt/util/MonitorModeUtil.java26
-rw-r--r--src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java16
-rw-r--r--src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java61
-rw-r--r--src/newt/classes/com/jogamp/newt/util/applet/VersionApplet3.java30
-rw-r--r--src/newt/classes/jogamp/newt/Debug.java4
-rw-r--r--src/newt/classes/jogamp/newt/DefaultEDTUtil.java24
-rw-r--r--src/newt/classes/jogamp/newt/DisplayImpl.java46
-rw-r--r--src/newt/classes/jogamp/newt/MonitorDeviceImpl.java6
-rw-r--r--src/newt/classes/jogamp/newt/MonitorModeProps.java40
-rw-r--r--src/newt/classes/jogamp/newt/OffscreenWindow.java18
-rw-r--r--src/newt/classes/jogamp/newt/PointerIconImpl.java8
-rw-r--r--src/newt/classes/jogamp/newt/ScreenImpl.java63
-rw-r--r--src/newt/classes/jogamp/newt/ScreenMonitorState.java32
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java311
-rw-r--r--src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java10
-rw-r--r--src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java8
-rw-r--r--src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java22
-rw-r--r--src/newt/classes/jogamp/newt/driver/PNGIcon.java2
-rw-r--r--src/newt/classes/jogamp/newt/driver/android/DisplayDriver.java2
-rw-r--r--src/newt/classes/jogamp/newt/driver/android/MD.java36
-rw-r--r--src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java18
-rw-r--r--src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java30
-rw-r--r--src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java2
-rw-r--r--src/newt/classes/jogamp/newt/driver/android/ScreenDriver.java20
-rw-r--r--src/newt/classes/jogamp/newt/driver/android/WindowDriver.java63
-rw-r--r--src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java30
-rw-r--r--src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventTranslator.java30
-rw-r--r--src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java36
-rw-r--r--src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java22
-rw-r--r--src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java4
-rw-r--r--src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java14
-rw-r--r--src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java32
-rw-r--r--src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java2
-rw-r--r--src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java6
-rw-r--r--src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java18
-rw-r--r--src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java10
-rw-r--r--src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java8
-rw-r--r--src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java8
-rw-r--r--src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java4
-rw-r--r--src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java10
-rw-r--r--src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java12
-rw-r--r--src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java2
-rw-r--r--src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java8
-rw-r--r--src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java18
-rw-r--r--src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java58
-rw-r--r--src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java26
-rw-r--r--src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java8
-rw-r--r--src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java2
-rw-r--r--src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java38
-rw-r--r--src/newt/classes/jogamp/newt/driver/opengl/JoglUtilPNGIcon.java2
-rw-r--r--src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java12
-rw-r--r--src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java2
-rw-r--r--src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java32
-rw-r--r--src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java16
-rw-r--r--src/newt/classes/jogamp/newt/driver/x11/RandR11.java29
-rw-r--r--src/newt/classes/jogamp/newt/driver/x11/RandR13.java14
-rw-r--r--src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java23
-rw-r--r--src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java58
-rw-r--r--src/newt/classes/jogamp/newt/event/NEWTEventTask.java8
-rw-r--r--src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java22
-rw-r--r--src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java22
-rw-r--r--src/oculusvr/classes/com/jogamp/oculusvr/OVRVersion.java12
-rw-r--r--src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererDualFBO.java8
-rw-r--r--src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererSingleFBO.java4
-rw-r--r--src/oculusvr/classes/jogamp/opengl/oculusvr/OVRDistortion.java10
-rw-r--r--src/test/com/jogamp/opengl/test/android/LauncherUtil.java188
-rw-r--r--src/test/com/jogamp/opengl/test/android/MovieCubeActivity0a.java18
-rw-r--r--src/test/com/jogamp/opengl/test/android/MovieCubeActivity0b.java18
-rw-r--r--src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java16
-rw-r--r--src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java26
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTElektronActivity.java32
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTElektronActivityLauncher.java14
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGearsES1Activity.java32
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGearsES1ActivityLauncher.java14
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java20
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java24
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java26
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java24
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivity.java14
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivityLauncher.java20
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java32
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivityLauncher.java16
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java12
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivityLauncher.java16
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1Activity.java32
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1ActivityLauncher.java16
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2Activity.java42
-rw-r--r--src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2ActivityLauncher.java10
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java33
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Bug735Inv0AppletAWT.java246
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Bug735Inv1AppletAWT.java250
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Bug735Inv2AppletAWT.java128
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Bug735Inv3AppletAWT.java90
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Bug735Inv4AWT.java78
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java18
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Issue326Test1.java48
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java37
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Issue344Base.java47
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Issue344Test1.java4
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Issue344Test2.java2
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Issue344Test3.java2
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Issue344Test4.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java94
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java38
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java56
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java54
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java48
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java13
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java42
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java108
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtCanvasAWTDemo.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo.java8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/MSAATool.java40
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/CrossHair.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/GLEventListenerButton.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/ImageSeqButton.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label0.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/LabelButton.java13
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/MediaPlayerButton.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RoundButton.java8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java36
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/TextureSeqButton.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIListenerBase01.java62
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UINewtDemo01.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java36
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/GLReadBuffer00Base.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/InitConcurrentBaseNEWT.java28
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove01GLCanvasSwingAWT.java17
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove02GLWindowNewtCanvasAWT.java91
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove03GLWindowNEWT.java40
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext01NEWT.java50
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext02NEWT.java38
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug692GL3VAONEWT.java124
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestCPUSourcingAPINEWT.java39
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableDeadlockAWT.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMRTNEWT01.java93
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMix2DemosES2NEWT.java88
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java32
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java32
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateNEWT.java15
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextSurfaceLockNEWT.java96
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java169
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java121
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLExtensionQueryOffscreen.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug651NEWT.java97
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug658NEWT.java42
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLPointsNEWT.java64
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java38
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLCanvasAWT.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLJPanelAWT.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLWindowNEWT.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java42
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java62
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent01NEWT.java6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent02NEWT.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLWindowNEWT.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMapBufferRead01NEWT.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNEWTCloseX11DisplayBug565.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNVSwapGroupNEWT.java54
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer01GLCanvasAWT.java78
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer02NewtCanvasAWT.java72
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestPBufferDeadlockAWT.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java36
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java175
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java22
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java22
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java54
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java24
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java44
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java55
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestX11DefaultDisplay.java42
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/Bug898AnimatorFromEDTAWT.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java13
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java22
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00AWT.java70
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00NEWT.java38
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10.java6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10AWT.java70
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10NEWT.java38
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimAWT.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimNEWT.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimAWT.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimNEWT.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext11VSyncAnimNEWT.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext12FPSAnimNEWT.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestBug722GLContextDrawableSwitchNewt2AWT.java58
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch01NEWT.java156
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch02AWT.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch10NEWT.java96
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch11NewtAWT.java48
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch12AWT.java52
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch21Newt2AWT.java66
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/ManualHiDPIBufferedImage01AWT.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java42
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java28
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java22
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java32
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461PBufferSupersamplingSwingAWT.java64
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug551AWT.java38
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug572AWT.java8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug611AWT.java24
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug642JSplitPaneMixHwLw01AWT.java78
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java25
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug675BeansInDesignTimeAWT.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816GLCanvasFrameHoppingB849B889AWT.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos01AWT.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos02AWT.java8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04aAWT.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04bAWT.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock00AWT.java98
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java130
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java78
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelResize01AWT.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelTextureStateAWT.java24
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestIsRealizedConcurrency01AWT.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java72
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java28
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java58
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java50
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererTraceGL2Mock01.java46
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageAWT.java27
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageNEWT.java25
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1NEWT.java36
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES2NEWT.java36
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java44
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyNEWT.java40
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/PointsDemo.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureDraw01Accessor.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java76
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java21
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/MultisampleDemoES1.java33
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OlympicES1.java64
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OneTriangle.java27
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/PointsDemoES1.java74
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/RedSquareES1.java42
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestGearsES1NEWT.java32
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestOlympicES1NEWT.java40
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestRedSquareES1NEWT.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/ElektronenMultiplizierer.java211
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java9
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java28
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/LandscapeES2.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/MultisampleDemoES2.java56
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/PointsDemoES2.java35
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java47
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareMappedES2.java47
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java38
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java58
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/CrossFadePlayer.java38
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java44
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java104
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas01.java38
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02a.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02b.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03b.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelsAWT.java96
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestElektronenMultipliziererNEWT.java36
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java45
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java35
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java24
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NEWT.java39
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NewtCanvasAWT.java69
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/swt/TestGearsES2SWT.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java127
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Teapot.java38
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/TextureDraw01GL2Listener.java52
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/Bug818GLJPanelApplet.java138
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java47
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java28
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestTeapotNEWT.java24
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/GeomShader01TextureGL3.java24
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/newt/TestGeomShader01TextureGL3NEWT.java50
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java58
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java254
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java164
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java19
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java79
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java69
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug365TextureGenerateMipMaps.java146
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug463ScaleImageMemoryAWT.java70
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug694ScaleImageUnpackBufferSizeAWT.java24
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/math/TestBinary16NOUI.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil01NOUI.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil02MatrixMatrixMultNOUI.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil03InversionNOUI.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectDoubleNOUI.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectFloatNOUI.java82
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix01NEWT.java32
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix02NOUI.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix03NOUI.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/math/TestQuaternion01NOUI.java8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java50
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2File.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java56
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferBase.java24
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/offscreen/Surface2File.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen01GLPBufferNEWT.java78
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen02BitmapNEWT.java58
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/offscreen/WindowUtilNEWT.java28
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java32
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/stereo/ovr/OVRDemo01.java3
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashForm.java25
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashFormComposite.java25
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTBug628ResizeDeadlockAWT.java55
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTGLn.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java60
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTBug643AsyncExec.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTEclipseGLCanvas01GLn.java48
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTJOGLGLCanvas01GLn.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/OffscreenPrintable.java64
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/OnscreenPrintable.java60
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/PrintableBase.java22
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering2GL2NEWT.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering3GL2AWT.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsAWT.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsNewtAWT.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java36
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT2.java46
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingNIOImageSwingAWT.java74
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering1GL2NEWT.java106
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java40
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/TiledPrintingAWTBase.java84
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/tile/TransparentPanel.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1ImmModeSink.java41
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1Plain.java81
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1TextureImmModeSink.java33
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES2ImmModeSink.java60
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/TestES1FixedFunctionPipelineNEWT.java22
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES1NEWT.java46
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES2NEWT.java40
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug362DDSImageCreateFromData.java48
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01AWT.java46
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01NEWT.java44
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02AWT.java48
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02NEWT.java40
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGImage01NEWT.java50
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTBenchmarkNewtAWT.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTCompareNewtAWT.java144
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGTextureFromFileNEWT.java142
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect00NEWT.java6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect01NEWT.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileAWT.java22
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java130
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil00NEWT.java6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil01NEWT.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTGATextureFromFileNEWT.java64
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java58
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture02AWT.java46
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01NEWT.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/DemoCreateAndDisposeOnCloseNEWT.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java25
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java24
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowInvisiblePointer01NEWT.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowWarpPointer01NEWT.java70
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java34
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows01NEWT.java102
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java60
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows03NEWTAnimResize.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java38
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestRemoteGLWindows01NEWT.java46
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestRemoteWindow01NEWT.java42
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java37
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java42
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java42
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom3.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java72
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWTAWT.java42
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodeModifiersAWT.java126
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java28
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventOrderAWT.java92
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyPressReleaseUnmaskRepeatAWT.java82
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java36
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java57
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus03KeyTraversalAWT.java42
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/ManualScreenMode03aNEWT.java34
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java32
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00bNEWT.java50
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java24
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java50
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02aNEWT.java76
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02bNEWT.java78
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/GLRunnableDummy.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/KeyAction.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java50
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java40
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aSWT.java40
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java34
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java97
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01dAWT.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java20
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java46
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java22
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java48
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04SWT.java68
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentChildWindowBug632NEWT.java62
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java44
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/WindowAction.java16
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/AWTFocusAdapter.java28
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/AWTKeyAdapter.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java146
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/AWTWindowFocusAdapter.java26
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/DumpGLInfo.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/EventCountAdapter.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/EventCountAdapterUtil.java18
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/FocusEventCountAdapter.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/GLEventListenerCounter.java8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/KeyEventCountAdapter.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/MiscUtils.java48
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/NEWTFocusAdapter.java38
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/NEWTGLContext.java88
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/NEWTKeyUtil.java24
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/QuitAdapter.java8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/UITestCase.java48
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/ValidateLockListener.java26
-rw-r--r--src/test/jogamp/newt/WindowImplAccess.java12
1068 files changed, 19597 insertions, 19440 deletions
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java
index 83f5e4ebd..fef9d61dd 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java
@@ -36,7 +36,7 @@ import java.io.*;
public class Audio {
private static Audio instance = null;
- private Mixer mixer;
+ private final Mixer mixer;
public synchronized static Audio getInstance() {
if (instance == null) {
@@ -53,9 +53,9 @@ public class Audio {
return mixer;
}
- public Track newTrack(File file) throws IOException
+ public Track newTrack(final File file) throws IOException
{
- Track res = new Track(file);
+ final Track res = new Track(file);
mixer.add(res);
return res;
}
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
index b36fd2637..a84da723f 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
@@ -48,12 +48,12 @@ public class Mixer {
private volatile boolean shutdownDone;
// Windows Event object
- private long event;
+ private final long event;
private volatile ArrayList<Track> tracks = new ArrayList<Track>();
- private Vec3f leftSpeakerPosition = new Vec3f(-1, 0, 0);
- private Vec3f rightSpeakerPosition = new Vec3f( 1, 0, 0);
+ private final Vec3f leftSpeakerPosition = new Vec3f(-1, 0, 0);
+ private final Vec3f rightSpeakerPosition = new Vec3f( 1, 0, 0);
private float falloffFactor = 1.0f;
@@ -64,7 +64,7 @@ public class Mixer {
private Mixer() {
event = CreateEvent();
new FillerThread().start();
- MixerThread m = new MixerThread();
+ final MixerThread m = new MixerThread();
m.setPriority(Thread.MAX_PRIORITY - 1);
m.start();
}
@@ -73,14 +73,14 @@ public class Mixer {
return mixer;
}
- synchronized void add(Track track) {
- ArrayList<Track> newTracks = new ArrayList<Track>(tracks);
+ synchronized void add(final Track track) {
+ final ArrayList<Track> newTracks = new ArrayList<Track>(tracks);
newTracks.add(track);
tracks = newTracks;
}
- synchronized void remove(Track track) {
- ArrayList<Track> newTracks = new ArrayList<Track>(tracks);
+ synchronized void remove(final Track track) {
+ final ArrayList<Track> newTracks = new ArrayList<Track>(tracks);
newTracks.remove(track);
tracks = newTracks;
}
@@ -88,14 +88,14 @@ public class Mixer {
// NOTE: due to a bug on the APX device, we only have mono sounds,
// so we currently only pay attention to the position of the left
// speaker
- public void setLeftSpeakerPosition(float x, float y, float z) {
+ public void setLeftSpeakerPosition(final float x, final float y, final float z) {
leftSpeakerPosition.set(x, y, z);
}
// NOTE: due to a bug on the APX device, we only have mono sounds,
// so we currently only pay attention to the position of the left
// speaker
- public void setRightSpeakerPosition(float x, float y, float z) {
+ public void setRightSpeakerPosition(final float x, final float y, final float z) {
rightSpeakerPosition.set(x, y, z);
}
@@ -109,7 +109,7 @@ public class Mixer {
falloffFactor + r^2
</PRE>
*/
- public void setFalloffFactor(float factor) {
+ public void setFalloffFactor(final float factor) {
falloffFactor = factor;
}
@@ -119,7 +119,7 @@ public class Mixer {
SetEvent(event);
try {
shutdownLock.wait();
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
}
}
}
@@ -132,13 +132,13 @@ public class Mixer {
@Override
public void run() {
while (!shutdown) {
- List<Track> curTracks = tracks;
+ final List<Track> curTracks = tracks;
- for (Iterator<Track> iter = curTracks.iterator(); iter.hasNext(); ) {
- Track track = iter.next();
+ for (final Iterator<Track> iter = curTracks.iterator(); iter.hasNext(); ) {
+ final Track track = iter.next();
try {
track.fill();
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
remove(track);
}
@@ -147,7 +147,7 @@ public class Mixer {
try {
// Run ten times per second
Thread.sleep(100);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -158,7 +158,7 @@ public class Mixer {
// Temporary mixing buffer
// Interleaved left and right channels
float[] mixingBuffer;
- private Vec3f temp = new Vec3f();
+ private final Vec3f temp = new Vec3f();
MixerThread() {
super("Mixer Thread");
@@ -171,7 +171,7 @@ public class Mixer {
public void run() {
while (!shutdown) {
// Get the next buffer
- long mixerBuffer = getNextMixerBuffer();
+ final long mixerBuffer = getNextMixerBuffer();
if (mixerBuffer != 0) {
ByteBuffer buf = getMixerBufferData(mixerBuffer);
@@ -203,27 +203,27 @@ public class Mixer {
// This assertion should be in place if we have stereo
if ((mixingBuffer.length % 2) != 0) {
- String msg = "FATAL ERROR: odd number of samples in the mixing buffer";
+ final String msg = "FATAL ERROR: odd number of samples in the mixing buffer";
System.out.println(msg);
throw new InternalError(msg);
}
// Run down all of the registered tracks mixing them in
- List<Track> curTracks = tracks;
+ final List<Track> curTracks = tracks;
- for (Iterator<Track> iter = curTracks.iterator(); iter.hasNext(); ) {
- Track track = iter.next();
+ for (final Iterator<Track> iter = curTracks.iterator(); iter.hasNext(); ) {
+ final Track track = iter.next();
// Consider only playing tracks
if (track.isPlaying()) {
// First recompute its gain
- Vec3f pos = track.getPosition();
- float leftGain = gain(pos, leftSpeakerPosition);
- float rightGain = gain(pos, rightSpeakerPosition);
+ final Vec3f pos = track.getPosition();
+ final float leftGain = gain(pos, leftSpeakerPosition);
+ final float rightGain = gain(pos, rightSpeakerPosition);
// Now mix it in
int i = 0;
while (i < mixingBuffer.length) {
if (track.hasNextSample()) {
- float sample = track.nextSample();
+ final float sample = track.nextSample();
mixingBuffer[i++] = sample * leftGain;
mixingBuffer[i++] = sample * rightGain;
} else {
@@ -240,7 +240,7 @@ public class Mixer {
// Now that we have our data, send it down to the card
int outPos = 0;
for (int i = 0; i < mixingBuffer.length; i++) {
- short val = (short) mixingBuffer[i];
+ final short val = (short) mixingBuffer[i];
buf.put(outPos++, (byte) val);
buf.put(outPos++, (byte) (val >> 8));
}
@@ -279,9 +279,9 @@ public class Mixer {
// falloffFactor
// -------------------
// falloffFactor + r^2
- private float gain(Vec3f pos, Vec3f speakerPos) {
+ private float gain(final Vec3f pos, final Vec3f speakerPos) {
temp.sub(pos, speakerPos);
- float dotp = temp.dot(temp);
+ final float dotp = temp.dot(temp);
return (falloffFactor / (falloffFactor + dotp));
}
}
@@ -321,8 +321,8 @@ public class Mixer {
private static Constructor directByteBufferConstructor;
private static Map createdBuffers = new HashMap(); // Map Long, ByteBuffer
- private static ByteBuffer newDirectByteBuffer(long address, long capacity) {
- Long key = new Long(address);
+ private static ByteBuffer newDirectByteBuffer(final long address, final long capacity) {
+ final Long key = new Long(address);
ByteBuffer buf = (ByteBuffer) createdBuffers.get(key);
if (buf == null) {
buf = newDirectByteBufferImpl(address, capacity);
@@ -332,17 +332,17 @@ public class Mixer {
}
return buf;
}
- private static ByteBuffer newDirectByteBufferImpl(long address, long capacity) {
+ private static ByteBuffer newDirectByteBufferImpl(final long address, final long capacity) {
if (directByteBufferClass == null) {
try {
directByteBufferClass = Class.forName("java.nio.DirectByteBuffer");
- byte[] tmp = new byte[0];
+ final byte[] tmp = new byte[0];
directByteBufferConstructor =
directByteBufferClass.getDeclaredConstructor(new Class[] { Integer.TYPE,
tmp.getClass(),
Integer.TYPE });
directByteBufferConstructor.setAccessible(true);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -355,7 +355,7 @@ public class Mixer {
null,
new Integer((int) address)
});
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java
index 01346553c..18698f5ea 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java
@@ -35,16 +35,16 @@ package com.jogamp.audio.windows.waveout;
import java.io.*;
class SoundBuffer {
- private byte[] data;
- private boolean needsByteSwap;
+ private final byte[] data;
+ private final boolean needsByteSwap;
private int numBytes;
- private int bytesPerSample;
+ private final int bytesPerSample;
private int numSamples;
private boolean playing;
private boolean empty;
// Note: needsByteSwap argument makes assumptions about the format
- SoundBuffer(int size, int bytesPerSample, boolean needsByteSwap) {
+ SoundBuffer(final int size, final int bytesPerSample, final boolean needsByteSwap) {
this.bytesPerSample = bytesPerSample;
this.needsByteSwap = needsByteSwap;
data = new byte[size * bytesPerSample];
@@ -55,7 +55,7 @@ class SoundBuffer {
return playing;
}
- void playing(boolean playing) {
+ void playing(final boolean playing) {
this.playing = playing;
}
@@ -63,11 +63,11 @@ class SoundBuffer {
return empty;
}
- void empty(boolean empty) {
+ void empty(final boolean empty) {
this.empty = empty;
}
- void fill(InputStream input) throws IOException {
+ void fill(final InputStream input) throws IOException {
synchronized(this) {
if (playing) {
throw new IllegalStateException("Can not fill a buffer that is playing");
@@ -75,7 +75,7 @@ class SoundBuffer {
}
empty(true);
- int num = input.read(data);
+ final int num = input.read(data);
if (num > 0) {
numBytes = num;
numSamples = numBytes / bytesPerSample;
@@ -96,8 +96,8 @@ class SoundBuffer {
// This is called by the mixer and must be extremely fast
// FIXME: may want to reconsider use of floating point at this point
// FIXME: assumes all sounds are of the same format to avoid normalization
- float getSample(int sample) {
- int startByte = sample * bytesPerSample;
+ float getSample(final int sample) {
+ final int startByte = sample * bytesPerSample;
// FIXME: assumes no more than 4 bytes per sample
int res = 0;
if (needsByteSwap) {
@@ -106,7 +106,7 @@ class SoundBuffer {
res |= (data[i] & 0xff);
}
} else {
- int endByte = startByte + bytesPerSample - 1;
+ final int endByte = startByte + bytesPerSample - 1;
for (int i = startByte; i <= endByte; i++) {
res <<= 8;
res |= (data[i] & 0xff);
@@ -119,6 +119,6 @@ class SoundBuffer {
res = (byte) res;
}
- return (float) res;
+ return res;
}
}
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java
index 98a787478..5e55786ac 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java
@@ -56,7 +56,7 @@ public class Track {
// If we're playing the file, this is its input stream
private InputStream input;
// Keep around the file name
- private File file;
+ private final File file;
// Whether we're playing this sound
private boolean playing;
// Whether we're looping this sound
@@ -64,7 +64,7 @@ public class Track {
// The position of this sound; defaults to being at the origin
private volatile Vec3f position = new Vec3f();
- Track(File file) throws IOException {
+ Track(final File file) throws IOException {
if (!file.getName().endsWith(".rawsound")) {
throw new IOException("Unsupported file format (currently supports only raw sounds)");
}
@@ -96,7 +96,7 @@ public class Track {
openInput();
// Fill it immediately
fill();
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
return;
}
@@ -109,7 +109,7 @@ public class Track {
return playing;
}
- public synchronized void setLooping(boolean looping) {
+ public synchronized void setLooping(final boolean looping) {
this.looping = looping;
}
@@ -117,7 +117,7 @@ public class Track {
return looping;
}
- public void setPosition(float x, float y, float z) {
+ public void setPosition(final float x, final float y, final float z) {
position = new Vec3f(x, y, z);
}
@@ -125,7 +125,7 @@ public class Track {
if (input == null) {
return;
}
- SoundBuffer curBuffer = fillingBuffer;
+ final SoundBuffer curBuffer = fillingBuffer;
if (!curBuffer.empty()) {
return;
}
@@ -152,7 +152,7 @@ public class Track {
private float leftGain;
private float rightGain;
- void setLeftGain(float leftGain) {
+ void setLeftGain(final float leftGain) {
this.leftGain = leftGain;
}
@@ -160,7 +160,7 @@ public class Track {
return leftGain;
}
- void setRightGain(float rightGain) {
+ void setRightGain(final float rightGain) {
this.rightGain = rightGain;
}
@@ -180,7 +180,7 @@ public class Track {
// This is called by the mixer and must be extremely fast
float nextSample() {
- float res = activeBuffer.getSample(samplePosition++);
+ final float res = activeBuffer.getSample(samplePosition++);
++samplesRead;
if (!hasNextSample()) {
swapBuffers();
@@ -193,7 +193,7 @@ public class Track {
}
synchronized void swapBuffers() {
- SoundBuffer tmp = activeBuffer;
+ final SoundBuffer tmp = activeBuffer;
activeBuffer = fillingBuffer;
fillingBuffer = tmp;
fillingBuffer.empty(true);
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
index 79fb80169..831b25c91 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
@@ -48,11 +48,11 @@ class Vec3f {
public Vec3f() {}
- public Vec3f(Vec3f arg) {
+ public Vec3f(final Vec3f arg) {
set(arg);
}
- public Vec3f(float x, float y, float z) {
+ public Vec3f(final float x, final float y, final float z) {
set(x, y, z);
}
@@ -60,18 +60,18 @@ class Vec3f {
return new Vec3f(this);
}
- public void set(Vec3f arg) {
+ public void set(final Vec3f arg) {
set(arg.x, arg.y, arg.z);
}
- public void set(float x, float y, float z) {
+ public void set(final float x, final float y, final float z) {
this.x = x;
this.y = y;
this.z = z;
}
/** Sets the ith component, 0 <= i < 3 */
- public void set(int i, float val) {
+ public void set(final int i, final float val) {
switch (i) {
case 0: x = val; break;
case 1: y = val; break;
@@ -81,7 +81,7 @@ class Vec3f {
}
/** Gets the ith component, 0 <= i < 3 */
- public float get(int i) {
+ public float get(final int i) {
switch (i) {
case 0: return x;
case 1: return y;
@@ -94,11 +94,11 @@ class Vec3f {
public float y() { return y; }
public float z() { return z; }
- public void setX(float x) { this.x = x; }
- public void setY(float y) { this.y = y; }
- public void setZ(float z) { this.z = z; }
+ public void setX(final float x) { this.x = x; }
+ public void setY(final float y) { this.y = y; }
+ public void setZ(final float z) { this.z = z; }
- public float dot(Vec3f arg) {
+ public float dot(final Vec3f arg) {
return x * arg.x + y * arg.y + z * arg.z;
}
@@ -111,87 +111,87 @@ class Vec3f {
}
public void normalize() {
- float len = length();
+ final float len = length();
if (len == 0.0f) return;
scale(1.0f / len);
}
/** Returns this * val; creates new vector */
- public Vec3f times(float val) {
- Vec3f tmp = new Vec3f(this);
+ public Vec3f times(final float val) {
+ final Vec3f tmp = new Vec3f(this);
tmp.scale(val);
return tmp;
}
/** this = this * val */
- public void scale(float val) {
+ public void scale(final float val) {
x *= val;
y *= val;
z *= val;
}
/** Returns this + arg; creates new vector */
- public Vec3f plus(Vec3f arg) {
- Vec3f tmp = new Vec3f();
+ public Vec3f plus(final Vec3f arg) {
+ final Vec3f tmp = new Vec3f();
tmp.add(this, arg);
return tmp;
}
/** this = this + b */
- public void add(Vec3f b) {
+ public void add(final Vec3f b) {
add(this, b);
}
/** this = a + b */
- public void add(Vec3f a, Vec3f b) {
+ public void add(final Vec3f a, final Vec3f b) {
x = a.x + b.x;
y = a.y + b.y;
z = a.z + b.z;
}
/** Returns this + s * arg; creates new vector */
- public Vec3f addScaled(float s, Vec3f arg) {
- Vec3f tmp = new Vec3f();
+ public Vec3f addScaled(final float s, final Vec3f arg) {
+ final Vec3f tmp = new Vec3f();
tmp.addScaled(this, s, arg);
return tmp;
}
/** this = a + s * b */
- public void addScaled(Vec3f a, float s, Vec3f b) {
+ public void addScaled(final Vec3f a, final float s, final Vec3f b) {
x = a.x + s * b.x;
y = a.y + s * b.y;
z = a.z + s * b.z;
}
/** Returns this - arg; creates new vector */
- public Vec3f minus(Vec3f arg) {
- Vec3f tmp = new Vec3f();
+ public Vec3f minus(final Vec3f arg) {
+ final Vec3f tmp = new Vec3f();
tmp.sub(this, arg);
return tmp;
}
/** this = this - b */
- public void sub(Vec3f b) {
+ public void sub(final Vec3f b) {
sub(this, b);
}
/** this = a - b */
- public void sub(Vec3f a, Vec3f b) {
+ public void sub(final Vec3f a, final Vec3f b) {
x = a.x - b.x;
y = a.y - b.y;
z = a.z - b.z;
}
/** Returns this cross arg; creates new vector */
- public Vec3f cross(Vec3f arg) {
- Vec3f tmp = new Vec3f();
+ public Vec3f cross(final Vec3f arg) {
+ final Vec3f tmp = new Vec3f();
tmp.cross(this, arg);
return tmp;
}
/** this = a cross b. NOTE: "this" must be a different vector than
both a and b. */
- public void cross(Vec3f a, Vec3f b) {
+ public void cross(final Vec3f a, final Vec3f b) {
x = a.y * b.z - a.z * b.y;
y = a.z * b.x - a.x * b.z;
z = a.x * b.y - a.y * b.x;
@@ -200,7 +200,7 @@ class Vec3f {
/** Sets each component of this vector to the product of the
component with the corresponding component of the argument
vector. */
- public void componentMul(Vec3f arg) {
+ public void componentMul(final Vec3f arg) {
x *= arg.x;
y *= arg.y;
z *= arg.z;
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
index 023913d7b..f082f358f 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
@@ -106,37 +106,37 @@ public class BuildComposablePipeline {
// Desktop OpenGL and GLES1 have GL_STACK_OVERFLOW and GL_STACK_UNDERFLOW errors
private boolean hasGL2ES1StackOverflow;
- public static Class<?> getClass(String name) {
+ public static Class<?> getClass(final String name) {
Class<?> clazz = null;
try {
clazz = Class.forName(name);
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException(
"Could not find class \"" + name + "\"", e);
}
return clazz;
}
- public static Method getMethod(Class<?> clazz, Method m) {
+ public static Method getMethod(final Class<?> clazz, final Method m) {
Method res = null;
try {
res = clazz.getMethod(m.getName(), m.getParameterTypes());
- } catch (Exception e) {
+ } catch (final Exception e) {
}
return res;
}
- public static void main(String[] args) {
- String classToComposeAroundName = args[0];
+ public static void main(final String[] args) {
+ final String classToComposeAroundName = args[0];
Class<?> classPrologOpt, classDownstream;
- Class<?> classToComposeAround = getClass(classToComposeAroundName);
+ final Class<?> classToComposeAround = getClass(classToComposeAroundName);
- String outputDir = args[1];
+ final String outputDir = args[1];
String outputPackage, outputName;
int mode;
if (args.length > 2) {
- String outputClazzName = args[2];
+ final String outputClazzName = args[2];
outputPackage = getPackageName(outputClazzName);
outputName = getBaseClassName(outputClazzName);
classPrologOpt = getClass(args[3]);
@@ -159,19 +159,19 @@ public class BuildComposablePipeline {
mode = GEN_DEBUG | GEN_TRACE ;
}
- BuildComposablePipeline composer =
+ final BuildComposablePipeline composer =
new BuildComposablePipeline(mode, outputDir, outputPackage, outputName, classToComposeAround, classPrologOpt, classDownstream);
try {
composer.emit();
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new RuntimeException(
"Error generating composable pipeline source files", e);
}
}
- protected BuildComposablePipeline(int mode, String outputDir, String outputPackage, String outputName,
- Class<?> classToComposeAround, Class<?> classPrologOpt, Class<?> classDownstream) {
+ protected BuildComposablePipeline(final int mode, final String outputDir, final String outputPackage, final String outputName,
+ final Class<?> classToComposeAround, final Class<?> classPrologOpt, final Class<?> classDownstream) {
this.mode = mode;
this.outputDir = outputDir;
this.outputPackage = outputPackage;
@@ -188,13 +188,13 @@ public class BuildComposablePipeline {
try {
hasImmediateMode =
(classToComposeAround.getMethod("glBegin", new Class<?>[]{Integer.TYPE}) != null);
- } catch (Exception e) {
+ } catch (final Exception e) {
}
try {
hasGL2ES1StackOverflow = hasImmediateMode &&
(classToComposeAround.getField("GL_STACK_OVERFLOW") != null);
- } catch (Exception e) {
+ } catch (final Exception e) {
}
}
@@ -207,7 +207,7 @@ public class BuildComposablePipeline {
final List<Method> publicMethodsRaw = Arrays.asList(classToComposeAround.getMethods());
final Set<PlainMethod> publicMethodsPlain = new HashSet<PlainMethod>();
- for (Iterator<Method> iter = publicMethodsRaw.iterator(); iter.hasNext();) {
+ for (final Iterator<Method> iter = publicMethodsRaw.iterator(); iter.hasNext();) {
final Method method = iter.next();
// Don't hook methods which aren't real GL methods,
// such as the synthetic "isGL2ES2" "getGL2ES2"
@@ -232,8 +232,8 @@ public class BuildComposablePipeline {
}
}
- public static String getPackageName(String clazzName) {
- int lastDot = clazzName.lastIndexOf('.');
+ public static String getPackageName(final String clazzName) {
+ final int lastDot = clazzName.lastIndexOf('.');
if (lastDot == -1) {
// no package, class is at root level
return null;
@@ -241,8 +241,8 @@ public class BuildComposablePipeline {
return clazzName.substring(0, lastDot);
}
- public static String getBaseClassName(String clazzName) {
- int lastDot = clazzName.lastIndexOf('.');
+ public static String getBaseClassName(final String clazzName) {
+ final int lastDot = clazzName.lastIndexOf('.');
if (lastDot == -1) {
// no package, class is at root level
return clazzName;
@@ -256,7 +256,7 @@ public class BuildComposablePipeline {
Method m;
boolean runHooks;
- PlainMethod(Method m, boolean runHooks) {
+ PlainMethod(final Method m, final boolean runHooks) {
this.m = m;
this.runHooks = runHooks;
}
@@ -270,10 +270,10 @@ public class BuildComposablePipeline {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (obj instanceof PlainMethod) {
- PlainMethod b = (PlainMethod) obj;
- boolean res =
+ final PlainMethod b = (PlainMethod) obj;
+ final boolean res =
m.getName().equals(b.m.getName())
&& m.getModifiers() == b.m.getModifiers()
&& m.getReturnType().equals(b.m.getReturnType())
@@ -286,7 +286,7 @@ public class BuildComposablePipeline {
@Override
public int hashCode() {
int hash = m.getName().hashCode() ^ m.getModifiers() ^ m.getReturnType().hashCode();
- Class<?>[] args = m.getParameterTypes();
+ final Class<?>[] args = m.getParameterTypes();
for (int i = 0; i < args.length; i++) {
hash ^= args[i].hashCode();
}
@@ -295,8 +295,8 @@ public class BuildComposablePipeline {
@Override
public String toString() {
- Class<?>[] args = m.getParameterTypes();
- StringBuilder argsString = new StringBuilder();
+ final Class<?>[] args = m.getParameterTypes();
+ final StringBuilder argsString = new StringBuilder();
argsString.append("(");
for (int i = 0; i < args.length; i++) {
if (i > 0) {
@@ -340,7 +340,7 @@ public class BuildComposablePipeline {
* @exception IllegalArgumentException if classToComposeAround is not an
* interface.
*/
- PipelineEmitter(String outputDir, String outputPackage, Class<?> baseInterfaceClass, Class<?> prologClassOpt, Class<?> downstreamClass) {
+ PipelineEmitter(final String outputDir, final String outputPackage, final Class<?> baseInterfaceClass, final Class<?> prologClassOpt, final Class<?> downstreamClass) {
this.outputDir = outputDir;
this.outputPackage = outputPackage;
this.baseInterfaceClass = baseInterfaceClass;
@@ -357,31 +357,31 @@ public class BuildComposablePipeline {
}
}
- public void emit(Iterator<PlainMethod> methodsToWrap) throws IOException {
- String outputClassName = getOutputName();
+ public void emit(final Iterator<PlainMethod> methodsToWrap) throws IOException {
+ final String outputClassName = getOutputName();
this.file = new File(outputDir + File.separatorChar + outputClassName + ".java");
- String parentDir = file.getParent();
+ final String parentDir = file.getParent();
if (parentDir != null) {
- File pDirFile = new File(parentDir);
+ final File pDirFile = new File(parentDir);
pDirFile.mkdirs();
}
- PrintWriter output = new PrintWriter(new BufferedWriter(new FileWriter(file)));
+ final PrintWriter output = new PrintWriter(new BufferedWriter(new FileWriter(file)));
- List<Class<?>> baseInterfaces = Arrays.asList(baseInterfaceClass.getInterfaces());
- HashSet<Class<?>> clazzList = new HashSet<Class<?>>();
+ final List<Class<?>> baseInterfaces = Arrays.asList(baseInterfaceClass.getInterfaces());
+ final HashSet<Class<?>> clazzList = new HashSet<Class<?>>();
clazzList.add(baseInterfaceClass);
clazzList.addAll(baseInterfaces);
- int ifNamesNumber = clazzList.size();
+ final int ifNamesNumber = clazzList.size();
// keep original order ..
clazzList.clear();
- String[] ifNames = new String[ifNamesNumber];
+ final String[] ifNames = new String[ifNamesNumber];
{
int i = 0;
- for (Iterator<Class<?>> iter = baseInterfaces.iterator(); iter.hasNext();) {
- Class<?> ifClass = iter.next();
+ for (final Iterator<Class<?>> iter = baseInterfaces.iterator(); iter.hasNext();) {
+ final Class<?> ifClass = iter.next();
if (!clazzList.contains(ifClass)) {
ifNames[i++] = ifClass.getName();
clazzList.add(ifClass);
@@ -399,12 +399,12 @@ public class BuildComposablePipeline {
clazzList.add(prologClassOpt);
}
- ArrayList<String> imports = new ArrayList<String>();
+ final ArrayList<String> imports = new ArrayList<String>();
imports.add("java.io.*");
imports.add("javax.media.opengl.*");
imports.add("com.jogamp.gluegen.runtime.*");
imports.add(Buffer.class.getPackage().getName()+".*");
- for (Class<?> clasS : clazzList) {
+ for (final Class<?> clasS : clazzList) {
imports.add(clasS.getName());
}
@@ -418,7 +418,7 @@ public class BuildComposablePipeline {
null,
new CodeGenUtils.EmissionCallback() {
@Override
- public void emit(PrintWriter w) {
+ public void emit(final PrintWriter w) {
emitClassDocComment(w);
}
});
@@ -431,8 +431,8 @@ public class BuildComposablePipeline {
emitGLGetMethods(output);
while (methodsToWrap.hasNext()) {
- PlainMethod pm = methodsToWrap.next();
- Method m = pm.getWrappedMethod();
+ final PlainMethod pm = methodsToWrap.next();
+ final Method m = pm.getWrappedMethod();
emitMethodDocComment(output, m);
emitSignature(output, m);
emitBody(output, m, pm.runHooks());
@@ -467,25 +467,25 @@ public class BuildComposablePipeline {
return null;
}
- protected void emitMethodDocComment(PrintWriter output, Method m) {
+ protected void emitMethodDocComment(final PrintWriter output, final Method m) {
}
- protected void emitSignature(PrintWriter output, Method m) {
+ protected void emitSignature(final PrintWriter output, final Method m) {
output.format(" @Override%n public %s %s(%s)%n",
JavaType.createForClass(m.getReturnType()).getName(),
m.getName(),
getArgListAsString(m, true, true));
}
- protected void emitBody(PrintWriter output, Method m, boolean runHooks) {
+ protected void emitBody(final PrintWriter output, final Method m, final boolean runHooks) {
output.println(" {");
- Class<?> retType = m.getReturnType();
+ final Class<?> retType = m.getReturnType();
- boolean callPreDownstreamHook = runHooks && hasPreDownstreamCallHook(m);
- boolean callPostDownstreamHook = runHooks && hasPostDownstreamCallHook(m);
- boolean callDownstream = (null != getMethod(downstreamClass, m))
+ final boolean callPreDownstreamHook = runHooks && hasPreDownstreamCallHook(m);
+ final boolean callPostDownstreamHook = runHooks && hasPostDownstreamCallHook(m);
+ final boolean callDownstream = (null != getMethod(downstreamClass, m))
&& !(0 != (GEN_PROLOG_XOR_DOWNSTREAM & getMode()) && callPreDownstreamHook);
- boolean hasResult = (retType != Void.TYPE);
+ final boolean hasResult = (retType != Void.TYPE);
if (!callDownstream) {
if (!emptyDownstreamAllowed()) {
@@ -546,14 +546,14 @@ public class BuildComposablePipeline {
}
- protected String getArgListAsString(Method m, boolean includeArgTypes, boolean includeArgNames) {
- StringBuilder buf = new StringBuilder(256);
+ protected String getArgListAsString(final Method m, final boolean includeArgTypes, final boolean includeArgNames) {
+ final StringBuilder buf = new StringBuilder(256);
if (!includeArgNames && !includeArgTypes) {
throw new IllegalArgumentException(
"Cannot generate arglist without both arg types and arg names");
}
- Class<?>[] argTypes = m.getParameterTypes();
+ final Class<?>[] argTypes = m.getParameterTypes();
for (int i = 0; i < argTypes.length; ++i) {
if (includeArgTypes) {
buf.append(JavaType.createForClass(argTypes[i]).getName());
@@ -588,7 +588,7 @@ public class BuildComposablePipeline {
* Called after the class headers have been generated, but before any
* method wrappers have been generated.
*/
- protected void preMethodEmissionHook(PrintWriter output) {
+ protected void preMethodEmissionHook(final PrintWriter output) {
output.println(" public static final boolean DEBUG = jogamp.opengl.Debug.debug(\"" + getOutputName() + "\");");
}
@@ -601,7 +601,7 @@ public class BuildComposablePipeline {
* Called after the method wrappers have been generated, but before the
* closing parenthesis of the class is emitted.
*/
- protected void postMethodEmissionHook(PrintWriter output) {
+ protected void postMethodEmissionHook(final PrintWriter output) {
output.println(" @Override");
output.println(" public String toString() {");
output.println(" StringBuilder sb = new StringBuilder();");
@@ -641,7 +641,7 @@ public class BuildComposablePipeline {
/**
* Emits one of the isGL* methods.
*/
- protected void emitGLIsMethod(PrintWriter output, String type) {
+ protected void emitGLIsMethod(final PrintWriter output, final String type) {
output.println(" @Override");
output.println(" public final boolean is" + type + "() {");
if( 0 != (GEN_GL_IDENTITY_BY_ASSIGNABLE_CLASS & getMode() ) ) {
@@ -660,7 +660,7 @@ public class BuildComposablePipeline {
/**
* Emits all of the isGL* methods.
*/
- protected void emitGLIsMethods(PrintWriter output) {
+ protected void emitGLIsMethods(final PrintWriter output) {
output.println(" @Override");
output.println(" public final boolean isGL() {");
output.println(" return true;");
@@ -712,7 +712,7 @@ public class BuildComposablePipeline {
/**
* Emits one of the getGL* methods.
*/
- protected void emitGLGetMethod(PrintWriter output, String type) {
+ protected void emitGLGetMethod(final PrintWriter output, final String type) {
output.println(" @Override");
output.println(" public final javax.media.opengl." + type + " get" + type + "() {");
final Class<?> clazz = BuildComposablePipeline.getClass("javax.media.opengl." + type);
@@ -732,7 +732,7 @@ public class BuildComposablePipeline {
/**
* Emits all of the getGL* methods.
*/
- protected void emitGLGetMethods(PrintWriter output) {
+ protected void emitGLGetMethods(final PrintWriter output) {
output.println(" @Override");
output.println(" public final javax.media.opengl.GL getGL() {");
output.println(" return this;");
@@ -768,7 +768,7 @@ public class BuildComposablePipeline {
String className;
int mode;
- CustomPipeline(int mode, String outputDir, String outputPackage, String outputName, Class<?> baseInterfaceClass, Class<?> prologClassOpt, Class<?> downstreamClass) {
+ CustomPipeline(final int mode, final String outputDir, final String outputPackage, final String outputName, final Class<?> baseInterfaceClass, final Class<?> prologClassOpt, final Class<?> downstreamClass) {
super(outputDir, outputPackage, baseInterfaceClass, prologClassOpt, downstreamClass);
className = outputName;
this.mode = mode;
@@ -795,12 +795,12 @@ public class BuildComposablePipeline {
}
@Override
- protected void preMethodEmissionHook(PrintWriter output) {
+ protected void preMethodEmissionHook(final PrintWriter output) {
super.preMethodEmissionHook(output);
}
@Override
- protected void constructorHook(PrintWriter output) {
+ protected void constructorHook(final PrintWriter output) {
output.print(" public " + getOutputName() + "(");
output.print(downstreamName + " " + getDownstreamObjectName());
if (null != prologNameOpt) {
@@ -823,7 +823,7 @@ public class BuildComposablePipeline {
}
@Override
- protected void postMethodEmissionHook(PrintWriter output) {
+ protected void postMethodEmissionHook(final PrintWriter output) {
super.postMethodEmissionHook(output);
if (null != prologNameOpt) {
output.print(" private " + prologNameOpt + " " + getPrologObjectNameOpt() + ";");
@@ -831,7 +831,7 @@ public class BuildComposablePipeline {
}
@Override
- protected void emitClassDocComment(PrintWriter output) {
+ protected void emitClassDocComment(final PrintWriter output) {
output.println("/**");
output.println(" * Composable pipeline {@link " + outputPackage + "." + outputName + "}, implementing the interface");
output.println(" * {@link " + baseInterfaceClass.getName() + "}");
@@ -866,12 +866,12 @@ public class BuildComposablePipeline {
}
@Override
- protected boolean hasPreDownstreamCallHook(Method m) {
+ protected boolean hasPreDownstreamCallHook(final Method m) {
return null != getMethod(prologClassOpt, m);
}
@Override
- protected void preDownstreamCallHook(PrintWriter output, Method m) {
+ protected void preDownstreamCallHook(final PrintWriter output, final Method m) {
if (null != prologNameOpt) {
output.print(getPrologObjectNameOpt());
output.print('.');
@@ -883,12 +883,12 @@ public class BuildComposablePipeline {
}
@Override
- protected boolean hasPostDownstreamCallHook(Method m) {
+ protected boolean hasPostDownstreamCallHook(final Method m) {
return false;
}
@Override
- protected void postDownstreamCallHook(PrintWriter output, Method m) {
+ protected void postDownstreamCallHook(final PrintWriter output, final Method m) {
}
} // end class CustomPipeline
@@ -896,7 +896,7 @@ public class BuildComposablePipeline {
String className;
- DebugPipeline(String outputDir, String outputPackage, Class<?> baseInterfaceClass, Class<?> downstreamClass) {
+ DebugPipeline(final String outputDir, final String outputPackage, final Class<?> baseInterfaceClass, final Class<?> downstreamClass) {
super(outputDir, outputPackage, baseInterfaceClass, null, downstreamClass);
className = "Debug" + getBaseInterfaceName();
}
@@ -922,12 +922,12 @@ public class BuildComposablePipeline {
}
@Override
- protected void preMethodEmissionHook(PrintWriter output) {
+ protected void preMethodEmissionHook(final PrintWriter output) {
super.preMethodEmissionHook(output);
}
@Override
- protected void constructorHook(PrintWriter output) {
+ protected void constructorHook(final PrintWriter output) {
output.print(" public " + getOutputName() + "(");
output.println(downstreamName + " " + getDownstreamObjectName() + ")");
output.println(" {");
@@ -947,7 +947,7 @@ public class BuildComposablePipeline {
}
@Override
- protected void postMethodEmissionHook(PrintWriter output) {
+ protected void postMethodEmissionHook(final PrintWriter output) {
super.postMethodEmissionHook(output);
output.println(" private int checkGLError() {");
if (hasImmediateMode) {
@@ -1005,7 +1005,7 @@ public class BuildComposablePipeline {
}
@Override
- protected void emitClassDocComment(PrintWriter output) {
+ protected void emitClassDocComment(final PrintWriter output) {
output.println("/**");
output.println(" * <p>");
output.println(" * Composable pipeline which wraps an underlying {@link GL} implementation,");
@@ -1023,22 +1023,22 @@ public class BuildComposablePipeline {
}
@Override
- protected boolean hasPreDownstreamCallHook(Method m) {
+ protected boolean hasPreDownstreamCallHook(final Method m) {
return true;
}
@Override
- protected void preDownstreamCallHook(PrintWriter output, Method m) {
+ protected void preDownstreamCallHook(final PrintWriter output, final Method m) {
output.println(" checkContext();");
}
@Override
- protected boolean hasPostDownstreamCallHook(Method m) {
+ protected boolean hasPostDownstreamCallHook(final Method m) {
return true;
}
@Override
- protected void postDownstreamCallHook(PrintWriter output, Method m) {
+ protected void postDownstreamCallHook(final PrintWriter output, final Method m) {
if (m.getName().equals("glBegin")) {
output.println(" insideBeginEndPair = true;");
output.println(" // NOTE: can't check glGetError(); it's not allowed inside glBegin/glEnd pair");
@@ -1050,12 +1050,12 @@ public class BuildComposablePipeline {
output.println(" final int err = checkGLError();");
output.println(" if (err != GL_NO_ERROR) {");
- StringBuilder fmtsb = new StringBuilder();
- StringBuilder argsb = new StringBuilder();
+ final StringBuilder fmtsb = new StringBuilder();
+ final StringBuilder argsb = new StringBuilder();
fmtsb.append("\"%s(");
argsb.append("\"").append(m.getName()).append("\"");
- Class<?>[] params = m.getParameterTypes();
+ final Class<?>[] params = m.getParameterTypes();
for (int i = 0; i < params.length; i++) {
if (i > 0) {
fmtsb.append(", ");
@@ -1089,7 +1089,7 @@ public class BuildComposablePipeline {
String className;
- TracePipeline(String outputDir, String outputPackage, Class<?> baseInterfaceClass, Class<?> downstreamClass) {
+ TracePipeline(final String outputDir, final String outputPackage, final Class<?> baseInterfaceClass, final Class<?> downstreamClass) {
super(outputDir, outputPackage, baseInterfaceClass, null, downstreamClass);
className = "Trace" + getBaseInterfaceName();
}
@@ -1115,12 +1115,12 @@ public class BuildComposablePipeline {
}
@Override
- protected void preMethodEmissionHook(PrintWriter output) {
+ protected void preMethodEmissionHook(final PrintWriter output) {
super.preMethodEmissionHook(output);
}
@Override
- protected void constructorHook(PrintWriter output) {
+ protected void constructorHook(final PrintWriter output) {
output.print(" public " + getOutputName() + "(");
output.println(downstreamName + " " + getDownstreamObjectName() + ", PrintStream " + getOutputStreamName() + ")");
output.println(" {");
@@ -1136,7 +1136,7 @@ public class BuildComposablePipeline {
}
@Override
- protected void postMethodEmissionHook(PrintWriter output) {
+ protected void postMethodEmissionHook(final PrintWriter output) {
super.postMethodEmissionHook(output);
output.println("private PrintStream " + getOutputStreamName() + ";");
output.println("private int indent = 0;");
@@ -1171,7 +1171,7 @@ public class BuildComposablePipeline {
}
@Override
- protected void emitClassDocComment(PrintWriter output) {
+ protected void emitClassDocComment(final PrintWriter output) {
output.println("/**");
output.println(" * <p>");
output.println(" * Composable pipeline which wraps an underlying {@link GL} implementation,");
@@ -1189,12 +1189,12 @@ public class BuildComposablePipeline {
}
@Override
- protected boolean hasPreDownstreamCallHook(Method m) {
+ protected boolean hasPreDownstreamCallHook(final Method m) {
return true;
}
@Override
- protected void preDownstreamCallHook(PrintWriter output, Method m) {
+ protected void preDownstreamCallHook(final PrintWriter output, final Method m) {
if (m.getName().equals("glEnd") || m.getName().equals("glEndList")) {
output.println(" indent-=2;");
output.println(" printIndent();");
@@ -1208,13 +1208,13 @@ public class BuildComposablePipeline {
}
@Override
- protected boolean hasPostDownstreamCallHook(Method m) {
+ protected boolean hasPostDownstreamCallHook(final Method m) {
return true;
}
@Override
- protected void postDownstreamCallHook(PrintWriter output, Method m) {
- Class<?> ret = m.getReturnType();
+ protected void postDownstreamCallHook(final PrintWriter output, final Method m) {
+ final Class<?> ret = m.getReturnType();
if (ret != Void.TYPE) {
output.println(" println(\" = \"+_res);");
} else {
@@ -1230,8 +1230,8 @@ public class BuildComposablePipeline {
}
} // end class TracePipeline
- public static final void printFunctionCallString(PrintWriter output, Method m) {
- Class<?>[] params = m.getParameterTypes();
+ public static final void printFunctionCallString(final PrintWriter output, final Method m) {
+ final Class<?>[] params = m.getParameterTypes();
output.print(" \"" + m.getName() + "(\"");
for (int i = 0; i < params.length; i++) {
output.print("+\"<" + params[i].getName() + ">");
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java
index a5a26d18f..f9719c232 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java
@@ -138,41 +138,41 @@ public class BuildStaticGLInfo {
* classes reside, and the remaining arguments are paths to the C header
* files that should be parsed
*/
- public static void main(String[] args) throws IOException {
+ public static void main(final String[] args) throws IOException {
if (args.length > 0 && args[0].equals("-test")) {
- BuildStaticGLInfo builder = new BuildStaticGLInfo();
+ final BuildStaticGLInfo builder = new BuildStaticGLInfo();
builder.setDebug(true);
- String[] newArgs = new String[args.length - 1];
+ final String[] newArgs = new String[args.length - 1];
System.arraycopy(args, 1, newArgs, 0, args.length - 1);
builder.parse(newArgs);
builder.dump();
System.exit(0);
}
- String packageName = args[0];
- String packageDir = args[1];
+ final String packageName = args[0];
+ final String packageDir = args[1];
- String[] cHeaderFilePaths = new String[args.length - 2];
+ final String[] cHeaderFilePaths = new String[args.length - 2];
System.arraycopy(args, 2, cHeaderFilePaths, 0, cHeaderFilePaths.length);
- BuildStaticGLInfo builder = new BuildStaticGLInfo();
+ final BuildStaticGLInfo builder = new BuildStaticGLInfo();
try {
builder.parse(cHeaderFilePaths);
- File file = new File(packageDir + File.separatorChar + "StaticGLInfo.java");
- String parentDir = file.getParent();
+ final File file = new File(packageDir + File.separatorChar + "StaticGLInfo.java");
+ final String parentDir = file.getParent();
if (parentDir != null) {
- File pDirFile = new File(parentDir);
+ final File pDirFile = new File(parentDir);
pDirFile.mkdirs();
}
- PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(file)));
+ final PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(file)));
builder.emitJavaCode(writer, packageName);
writer.flush();
writer.close();
- } catch (Exception e) {
- StringBuilder buf = new StringBuilder("{ ");
+ } catch (final Exception e) {
+ final StringBuilder buf = new StringBuilder("{ ");
for (int i = 0; i < cHeaderFilePaths.length; ++i) {
buf.append(cHeaderFilePaths[i]);
buf.append(" ");
@@ -183,13 +183,13 @@ public class BuildStaticGLInfo {
}
}
- public void setDebug(boolean v) {
+ public void setDebug(final boolean v) {
DEBUG = v;
}
/** Parses the supplied C header files and adds the function
associations contained therein to the internal map. */
- public void parse(String[] cHeaderFilePaths) throws IOException {
+ public void parse(final String[] cHeaderFilePaths) throws IOException {
for (int i = 0; i < cHeaderFilePaths.length; i++) {
parse(cHeaderFilePaths[i]);
}
@@ -197,8 +197,8 @@ public class BuildStaticGLInfo {
/** Parses the supplied C header file and adds the function
associations contained therein to the internal map. */
- public void parse(String cHeaderFilePath) throws IOException {
- BufferedReader reader = new BufferedReader(new FileReader(cHeaderFilePath));
+ public void parse(final String cHeaderFilePath) throws IOException {
+ final BufferedReader reader = new BufferedReader(new FileReader(cHeaderFilePath));
String line, activeAssociation = null;
Matcher m = null;
int block = 0;
@@ -264,23 +264,23 @@ public class BuildStaticGLInfo {
}
public void dump() {
- for (String name : extensionToDeclarationMap.keySet()) {
- Set<String> decls = extensionToDeclarationMap.get(name);
+ for (final String name : extensionToDeclarationMap.keySet()) {
+ final Set<String> decls = extensionToDeclarationMap.get(name);
System.out.println("<" + name + "> :");
- List<String> l = new ArrayList<String>();
+ final List<String> l = new ArrayList<String>();
l.addAll(decls);
Collections.sort(l);
- for (String str : l) {
+ for (final String str : l) {
System.out.println(" <" + str + ">");
}
}
}
- public Set<String> getExtension(String identifier) {
+ public Set<String> getExtension(final String identifier) {
return declarationToExtensionMap.get(identifier);
}
- public Set<String> getDeclarations(String extension) {
+ public Set<String> getDeclarations(final String extension) {
return extensionToDeclarationMap.get(extension);
}
@@ -288,7 +288,7 @@ public class BuildStaticGLInfo {
return extensionToDeclarationMap.keySet();
}
- public void emitJavaCode(PrintWriter output, String packageName) {
+ public void emitJavaCode(final PrintWriter output, final String packageName) {
output.println("package " + packageName + ";");
output.println();
output.println("import java.util.*;");
@@ -340,7 +340,7 @@ public class BuildStaticGLInfo {
// Compute max capacity
int maxCapacity = 0;
- for (String name : declarationToExtensionMap.keySet()) {
+ for (final String name : declarationToExtensionMap.keySet()) {
if (!name.startsWith("GL")) {
++maxCapacity;
}
@@ -348,17 +348,17 @@ public class BuildStaticGLInfo {
output.println(" funcToAssocMap = new HashMap(" + maxCapacity + "); // approximate max capacity");
output.println(" String group;");
- ArrayList<String> sets = new ArrayList<String>(extensionToDeclarationMap.keySet());
+ final ArrayList<String> sets = new ArrayList<String>(extensionToDeclarationMap.keySet());
Collections.sort(sets);
- for (String groupName : sets) {
- Set<String> funcs = extensionToDeclarationMap.get(groupName);
- List<String> l = new ArrayList<String>();
+ for (final String groupName : sets) {
+ final Set<String> funcs = extensionToDeclarationMap.get(groupName);
+ final List<String> l = new ArrayList<String>();
l.addAll(funcs);
Collections.sort(l);
- Iterator<String> funcIter = l.iterator();
+ final Iterator<String> funcIter = l.iterator();
boolean printedHeader = false;
while (funcIter.hasNext()) {
- String funcName = funcIter.next();
+ final String funcName = funcIter.next();
if (!funcName.startsWith("GL")) {
if (!printedHeader) {
output.println();
@@ -380,7 +380,7 @@ public class BuildStaticGLInfo {
//----------------------------------------------------------------------
// Internals only below this point
//
- protected void addAssociation(String identifier, String association) {
+ protected void addAssociation(final String identifier, final String association) {
Set<String> extensions = declarationToExtensionMap.get(identifier);
if(null == extensions) {
extensions = new HashSet<String>();
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
index f1a32fa9c..5da45abfe 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
@@ -59,17 +59,17 @@ import java.util.StringTokenizer;
public class GLConfiguration extends ProcAddressConfiguration {
// The following data members support ignoring an entire extension at a time
- private List<String> glHeaders = new ArrayList<String>();
- private Set<String> ignoredExtensions = new HashSet<String>();
- private Set<String> forcedExtensions = new HashSet<String>();
- private Set<String> extensionsRenamedIntoCore = new HashSet<String>();
+ private final List<String> glHeaders = new ArrayList<String>();
+ private final Set<String> ignoredExtensions = new HashSet<String>();
+ private final Set<String> forcedExtensions = new HashSet<String>();
+ private final Set<String> extensionsRenamedIntoCore = new HashSet<String>();
private BuildStaticGLInfo glInfo;
// Maps function names to the kind of buffer object it deals with
- private Map<String, GLEmitter.BufferObjectKind> bufferObjectKinds = new HashMap<String, GLEmitter.BufferObjectKind>();
- private Set<String> bufferObjectOnly = new HashSet<String>();
- private GLEmitter emitter;
- private Set<String> dropUniqVendorExtensions = new HashSet<String>();
+ private final Map<String, GLEmitter.BufferObjectKind> bufferObjectKinds = new HashMap<String, GLEmitter.BufferObjectKind>();
+ private final Set<String> bufferObjectOnly = new HashSet<String>();
+ private final GLEmitter emitter;
+ private final Set<String> dropUniqVendorExtensions = new HashSet<String>();
// This directive is off by default but can help automatically
// indicate which extensions have been folded into the core OpenGL
@@ -77,52 +77,52 @@ public class GLConfiguration extends ProcAddressConfiguration {
private boolean autoUnifyExtensions = false;
private boolean allowNonGLExtensions = false;
- public GLConfiguration(GLEmitter emitter) {
+ public GLConfiguration(final GLEmitter emitter) {
super();
this.emitter = emitter;
try {
setProcAddressNameExpr("PFN $UPPERCASE({0}) PROC");
- } catch (NoSuchElementException e) {
+ } catch (final NoSuchElementException e) {
throw new RuntimeException("Error configuring ProcAddressNameExpr", e);
}
}
@Override
- protected void dispatch(String cmd, StringTokenizer tok, File file, String filename, int lineNo) throws IOException {
+ protected void dispatch(final String cmd, final StringTokenizer tok, final File file, final String filename, final int lineNo) throws IOException {
if (cmd.equalsIgnoreCase("IgnoreExtension")) {
- String sym = readString("IgnoreExtension", tok, filename, lineNo);
+ final String sym = readString("IgnoreExtension", tok, filename, lineNo);
ignoredExtensions.add(sym);
} else if (cmd.equalsIgnoreCase("ForceExtension")) {
- String sym = readString("ForceExtension", tok, filename, lineNo);
+ final String sym = readString("ForceExtension", tok, filename, lineNo);
forcedExtensions.add(sym);
} else if (cmd.equalsIgnoreCase("RenameExtensionIntoCore")) {
- String sym = readString("RenameExtensionIntoCore", tok, filename, lineNo);
+ final String sym = readString("RenameExtensionIntoCore", tok, filename, lineNo);
extensionsRenamedIntoCore.add(sym);
} else if (cmd.equalsIgnoreCase("AllowNonGLExtensions")) {
allowNonGLExtensions = readBoolean("AllowNonGLExtensions", tok, filename, lineNo).booleanValue();
} else if (cmd.equalsIgnoreCase("AutoUnifyExtensions")) {
autoUnifyExtensions = readBoolean("AutoUnifyExtensions", tok, filename, lineNo).booleanValue();
} else if (cmd.equalsIgnoreCase("GLHeader")) {
- String sym = readString("GLHeader", tok, filename, lineNo);
+ final String sym = readString("GLHeader", tok, filename, lineNo);
glHeaders.add(sym);
} else if (cmd.equalsIgnoreCase("BufferObjectKind")) {
readBufferObjectKind(tok, filename, lineNo);
} else if (cmd.equalsIgnoreCase("BufferObjectOnly")) {
- String sym = readString("BufferObjectOnly", tok, filename, lineNo);
+ final String sym = readString("BufferObjectOnly", tok, filename, lineNo);
bufferObjectOnly.add(sym);
} else if (cmd.equalsIgnoreCase("DropUniqVendorExtensions")) {
- String sym = readString("DropUniqVendorExtensions", tok, filename, lineNo);
+ final String sym = readString("DropUniqVendorExtensions", tok, filename, lineNo);
dropUniqVendorExtensions.add(sym);
} else {
super.dispatch(cmd, tok, file, filename, lineNo);
}
}
- protected void readBufferObjectKind(StringTokenizer tok, String filename, int lineNo) {
+ protected void readBufferObjectKind(final StringTokenizer tok, final String filename, final int lineNo) {
try {
- String kindString = tok.nextToken();
+ final String kindString = tok.nextToken();
GLEmitter.BufferObjectKind kind = null;
- String target = tok.nextToken();
+ final String target = tok.nextToken();
if (kindString.equalsIgnoreCase("UnpackPixel")) {
kind = GLEmitter.BufferObjectKind.UNPACK_PIXEL;
} else if (kindString.equalsIgnoreCase("PackPixel")) {
@@ -140,7 +140,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
}
bufferObjectKinds.put(target, kind);
- } catch (NoSuchElementException e) {
+ } catch (final NoSuchElementException e) {
throw new RuntimeException("Error parsing \"BufferObjectKind\" command at line " + lineNo
+ " in file \"" + filename + "\"", e);
}
@@ -150,10 +150,10 @@ public class GLConfiguration extends ProcAddressConfiguration {
automatically generates prologue code for functions associated
with buffer objects. */
@Override
- public List<String> javaPrologueForMethod(MethodBinding binding, boolean forImplementingMethodCall, boolean eraseBufferAndArrayTypes) {
+ public List<String> javaPrologueForMethod(final MethodBinding binding, final boolean forImplementingMethodCall, final boolean eraseBufferAndArrayTypes) {
List<String> res = super.javaPrologueForMethod(binding, forImplementingMethodCall, eraseBufferAndArrayTypes);
- GLEmitter.BufferObjectKind kind = getBufferObjectKind(binding.getName());
+ final GLEmitter.BufferObjectKind kind = getBufferObjectKind(binding.getName());
if (kind != null) {
// Need to generate appropriate prologue based on both buffer
// object kind and whether this variant of the MethodBinding
@@ -161,7 +161,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
//
// NOTE we MUST NOT mutate the array returned from the super
// call!
- ArrayList<String> res2 = new ArrayList<String>();
+ final ArrayList<String> res2 = new ArrayList<String>();
if (res != null) {
res2.addAll(res);
}
@@ -196,8 +196,8 @@ public class GLConfiguration extends ProcAddressConfiguration {
// Must also filter out bogus rangeCheck directives for VBO/PBO
// variants
if (emitter.isBufferObjectMethodBinding(binding)) {
- for (Iterator<String> iter = res.iterator(); iter.hasNext();) {
- String line = iter.next();
+ for (final Iterator<String> iter = res.iterator(); iter.hasNext();) {
+ final String line = iter.next();
if (line.indexOf("Buffers.rangeCheck") >= 0) {
iter.remove();
}
@@ -211,22 +211,22 @@ public class GLConfiguration extends ProcAddressConfiguration {
@Override
public void dumpIgnores() {
System.err.println("GL Ignored extensions: ");
- for (String str : ignoredExtensions) {
+ for (final String str : ignoredExtensions) {
System.err.println("\t" + str);
}
System.err.println("GL Forced extensions: ");
- for (String str : forcedExtensions) {
+ for (final String str : forcedExtensions) {
System.err.println("\t" + str);
}
super.dumpIgnores();
}
- protected boolean shouldIgnoreExtension(String symbol, boolean criteria) {
+ protected boolean shouldIgnoreExtension(final String symbol, final boolean criteria) {
if (criteria && glInfo != null) {
final Set<String> extensionNames = glInfo.getExtension(symbol);
if( null != extensionNames ) {
boolean ignoredExtension = false;
- for(Iterator<String> i=extensionNames.iterator(); !ignoredExtension && i.hasNext(); ) {
+ for(final Iterator<String> i=extensionNames.iterator(); !ignoredExtension && i.hasNext(); ) {
final String extensionName = i.next();
if ( extensionName != null && ignoredExtensions.contains(extensionName) ) {
if (DEBUG_IGNORES) {
@@ -245,7 +245,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
if( ignoredExtension ) {
final Set<String> origSymbols = getRenamedJavaSymbols( symbol );
if(null != origSymbols) {
- for(String origSymbol : origSymbols) {
+ for(final String origSymbol : origSymbols) {
if( shouldForceExtension( origSymbol, true, symbol ) ) {
ignoredExtension = false;
break;
@@ -258,11 +258,11 @@ public class GLConfiguration extends ProcAddressConfiguration {
return true;
}
}
- boolean isGLEnum = GLNameResolver.isGLEnumeration(symbol);
- boolean isGLFunc = GLNameResolver.isGLFunction(symbol);
+ final boolean isGLEnum = GLNameResolver.isGLEnumeration(symbol);
+ final boolean isGLFunc = GLNameResolver.isGLFunction(symbol);
if (isGLFunc || isGLEnum) {
if (GLNameResolver.isExtensionVEN(symbol, isGLFunc)) {
- String extSuffix = GLNameResolver.getExtensionSuffix(symbol, isGLFunc);
+ final String extSuffix = GLNameResolver.getExtensionSuffix(symbol, isGLFunc);
if (getDropUniqVendorExtensions(extSuffix)) {
if (DEBUG_IGNORES) {
System.err.println("Ignore UniqVendorEXT: " + symbol + ", vendor " + extSuffix);
@@ -279,7 +279,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
if (criteria && glInfo != null) {
final Set<String> extensionNames = glInfo.getExtension(symbol);
if( null != extensionNames ) {
- for(Iterator<String> i=extensionNames.iterator(); i.hasNext(); ) {
+ for(final Iterator<String> i=extensionNames.iterator(); i.hasNext(); ) {
final String extensionName = i.next();
if ( extensionName != null && forcedExtensions.contains(extensionName) ) {
if (DEBUG_IGNORES) {
@@ -299,20 +299,20 @@ public class GLConfiguration extends ProcAddressConfiguration {
}
@Override
- public boolean shouldIgnoreInInterface(String symbol) {
+ public boolean shouldIgnoreInInterface(final String symbol) {
return shouldIgnoreInInterface(symbol, true);
}
- public boolean shouldIgnoreInInterface(String symbol, boolean checkEXT) {
+ public boolean shouldIgnoreInInterface(final String symbol, final boolean checkEXT) {
return shouldIgnoreExtension(symbol, checkEXT) || super.shouldIgnoreInInterface(symbol);
}
@Override
- public boolean shouldIgnoreInImpl(String symbol) {
+ public boolean shouldIgnoreInImpl(final String symbol) {
return shouldIgnoreInImpl(symbol, true);
}
- public boolean shouldIgnoreInImpl(String symbol, boolean checkEXT) {
+ public boolean shouldIgnoreInImpl(final String symbol, final boolean checkEXT) {
return shouldIgnoreExtension(symbol, checkEXT) || super.shouldIgnoreInImpl(symbol);
}
@@ -330,32 +330,32 @@ public class GLConfiguration extends ProcAddressConfiguration {
}
/** shall the non unified (uniq) vendor extensions be dropped ? */
- public boolean getDropUniqVendorExtensions(String extName) {
+ public boolean getDropUniqVendorExtensions(final String extName) {
return dropUniqVendorExtensions.contains(extName);
}
/** Returns the kind of buffer object this function deals with, or
null if none. */
- GLEmitter.BufferObjectKind getBufferObjectKind(String name) {
+ GLEmitter.BufferObjectKind getBufferObjectKind(final String name) {
return bufferObjectKinds.get(name);
}
- public boolean isBufferObjectFunction(String name) {
+ public boolean isBufferObjectFunction(final String name) {
return (getBufferObjectKind(name) != null);
}
- public boolean isBufferObjectOnly(String name) {
+ public boolean isBufferObjectOnly(final String name) {
return bufferObjectOnly.contains(name);
}
/** Parses any GL headers specified in the configuration file for
the purpose of being able to ignore an extension at a time. */
- public void parseGLHeaders(GlueEmitterControls controls) throws IOException {
+ public void parseGLHeaders(final GlueEmitterControls controls) throws IOException {
if (!glHeaders.isEmpty()) {
glInfo = new BuildStaticGLInfo();
glInfo.setDebug(GlueGen.debug());
- for (String file : glHeaders) {
- String fullPath = controls.findHeaderFile(file);
+ for (final String file : glHeaders) {
+ final String fullPath = controls.findHeaderFile(file);
if (fullPath == null) {
throw new IOException("Unable to locate header file \"" + file + "\"");
}
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
index 547382ed1..bc230c83a 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
@@ -72,12 +72,12 @@ public class GLEmitter extends ProcAddressEmitter {
// Keeps track of which MethodBindings were created for handling
// Buffer Object variants. Used as a Set rather than a Map.
- private Map<MethodBinding, MethodBinding> bufferObjectMethodBindings = new IdentityHashMap<MethodBinding, MethodBinding>();
+ private final Map<MethodBinding, MethodBinding> bufferObjectMethodBindings = new IdentityHashMap<MethodBinding, MethodBinding>();
enum BufferObjectKind { UNPACK_PIXEL, PACK_PIXEL, ARRAY, ELEMENT, INDIRECT}
@Override
- public void beginEmission(GlueEmitterControls controls) throws IOException {
+ public void beginEmission(final GlueEmitterControls controls) throws IOException {
getGLConfig().parseGLHeaders(controls);
renameExtensionsIntoCore();
if (getGLConfig().getAutoUnifyExtensions()) {
@@ -93,30 +93,30 @@ public class GLEmitter extends ProcAddressEmitter {
// already in the core namespace in desktop OpenGL. It builds upon
// renaming mechanisms that are built elsewhere.
- GLConfiguration config = getGLConfig();
- Set<String> extensionsRenamedIntoCore = config.getExtensionsRenamedIntoCore();
- BuildStaticGLInfo glInfo = config.getGLInfo();
+ final GLConfiguration config = getGLConfig();
+ final Set<String> extensionsRenamedIntoCore = config.getExtensionsRenamedIntoCore();
+ final BuildStaticGLInfo glInfo = config.getGLInfo();
if (null == glInfo) {
if (extensionsRenamedIntoCore.size() > 0) {
throw new RuntimeException("ExtensionRenamedIntoCore (num: " + extensionsRenamedIntoCore.size() + "), but no GLHeader");
}
return;
}
- for (String extension : extensionsRenamedIntoCore) {
+ for (final String extension : extensionsRenamedIntoCore) {
if(JavaConfiguration.DEBUG_RENAMES) {
System.err.println("<RenameExtensionIntoCore: "+extension+" BEGIN");
}
- Set<String> declarations = glInfo.getDeclarations(extension);
+ final Set<String> declarations = glInfo.getDeclarations(extension);
if (declarations != null) {
- for (Iterator<String> iterator = declarations.iterator(); iterator.hasNext();) {
- String decl = iterator.next();
- boolean isGLFunction = GLNameResolver.isGLFunction(decl);
+ for (final Iterator<String> iterator = declarations.iterator(); iterator.hasNext();) {
+ final String decl = iterator.next();
+ final boolean isGLFunction = GLNameResolver.isGLFunction(decl);
boolean isGLEnumeration = false;
if (!isGLFunction) {
isGLEnumeration = GLNameResolver.isGLEnumeration(decl);
}
if (isGLFunction || isGLEnumeration) {
- String renamed = GLNameResolver.normalize(decl, isGLFunction);
+ final String renamed = GLNameResolver.normalize(decl, isGLFunction);
if (!renamed.equals(decl)) {
config.addJavaSymbolRename(decl, renamed);
}
@@ -135,8 +135,8 @@ public class GLEmitter extends ProcAddressEmitter {
private List<FunctionSymbol> functions;
@Override
- public void filterSymbols(List<ConstantDefinition> constants,
- List<FunctionSymbol> functions) {
+ public void filterSymbols(final List<ConstantDefinition> constants,
+ final List<FunctionSymbol> functions) {
this.constants = constants;
this.functions = functions;
doWork();
@@ -153,17 +153,17 @@ public class GLEmitter extends ProcAddressEmitter {
}
private void doWork() {
- BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
+ final BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
if (glInfo == null) {
return;
}
// Try to retain a "good" ordering for these symbols
- Map<String, ConstantDefinition> constantMap = new LinkedHashMap<String, ConstantDefinition>();
- for (ConstantDefinition def : constants) {
+ final Map<String, ConstantDefinition> constantMap = new LinkedHashMap<String, ConstantDefinition>();
+ for (final ConstantDefinition def : constants) {
constantMap.put(def.getName(), def);
}
- Map<String, FunctionSymbol> functionMap = new LinkedHashMap<String, FunctionSymbol>();
- for (FunctionSymbol sym : functions) {
+ final Map<String, FunctionSymbol> functionMap = new LinkedHashMap<String, FunctionSymbol>();
+ for (final FunctionSymbol sym : functions) {
functionMap.put(sym.getName(), sym);
}
@@ -175,15 +175,15 @@ public class GLEmitter extends ProcAddressEmitter {
// that doesn't support the core version of these APIs, the runtime
// will take care of looking up the extension version of these entry
// points.
- Set<String> extensionNames = glInfo.getExtensions();
+ final Set<String> extensionNames = glInfo.getExtensions();
- for (String extension : extensionNames) {
- Set<String> declarations = glInfo.getDeclarations(extension);
+ for (final String extension : extensionNames) {
+ final Set<String> declarations = glInfo.getDeclarations(extension);
boolean isExtension = true;
boolean shouldUnify = true;
String cause = null;
- for (String decl : declarations) {
- boolean isFunc = !decl.startsWith("GL_");
+ for (final String decl : declarations) {
+ final boolean isFunc = !decl.startsWith("GL_");
if (!GLNameResolver.isExtension(decl, isFunc)) {
isExtension = false;
break;
@@ -202,7 +202,7 @@ public class GLEmitter extends ProcAddressEmitter {
}
}
cause = decl;
- String unifiedName = GLNameResolver.normalize(decl, isFunc);
+ final String unifiedName = GLNameResolver.normalize(decl, isFunc);
// NOTE that we look up the unified name in the
// BuildStaticGLInfo's notion of the APIs -- since
// we might not be emitting glue code for the
@@ -225,8 +225,8 @@ public class GLEmitter extends ProcAddressEmitter {
}
if (isExtension) {
if (shouldUnify) {
- for (String decl : declarations) {
- boolean isFunc = !decl.startsWith("GL_");
+ for (final String decl : declarations) {
+ final boolean isFunc = !decl.startsWith("GL_");
if (isFunc) {
functionMap.remove(decl);
} else {
@@ -244,7 +244,7 @@ public class GLEmitter extends ProcAddressEmitter {
}
}
- private void unifyExtensions(GlueEmitterControls controls) {
+ private void unifyExtensions(final GlueEmitterControls controls) {
controls.runSymbolFilter(new ExtensionUnifier());
}
@@ -264,7 +264,7 @@ public class GLEmitter extends ProcAddressEmitter {
inform the CMethodBindingEmitter that it is overloaded in this
case (though we default to true currently). */
@Override
- protected List<MethodBinding> expandMethodBinding(MethodBinding binding) {
+ protected List<MethodBinding> expandMethodBinding(final MethodBinding binding) {
final GLConfiguration glConfig = getGLConfig();
final List<MethodBinding> bindings = super.expandMethodBinding(binding);
@@ -322,7 +322,7 @@ public class GLEmitter extends ProcAddressEmitter {
}
@Override
- protected boolean needsModifiedEmitters(FunctionSymbol sym) {
+ protected boolean needsModifiedEmitters(final FunctionSymbol sym) {
if ((!needsProcAddressWrapper(sym) && !needsBufferObjectVariant(sym))
|| getConfig().isUnimplemented(sym.getName())) {
return false;
@@ -331,22 +331,22 @@ public class GLEmitter extends ProcAddressEmitter {
return true;
}
- public boolean isBufferObjectMethodBinding(MethodBinding binding) {
+ public boolean isBufferObjectMethodBinding(final MethodBinding binding) {
return bufferObjectMethodBindings.containsKey(binding);
}
@Override
- public void emitDefine(ConstantDefinition def, String optionalComment) throws Exception {
- BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
+ public void emitDefine(final ConstantDefinition def, final String optionalComment) throws Exception {
+ final BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
if (null == glInfo) {
throw new Exception("No GLInfo for: " + def);
}
- String symbolRenamed = def.getName();
- StringBuilder newComment = new StringBuilder();
+ final String symbolRenamed = def.getName();
+ final StringBuilder newComment = new StringBuilder();
newComment.append("Part of ");
if (0 == addExtensionsOfSymbols2Buffer(newComment, ", ", "; ", symbolRenamed, def.getAliasedNames())) {
if (def.isEnum()) {
- String enumName = def.getEnumName();
+ final String enumName = def.getEnumName();
if (null != enumName) {
newComment.append(enumName);
} else {
@@ -362,7 +362,7 @@ public class GLEmitter extends ProcAddressEmitter {
// ...
// #endif
if (JavaConfiguration.DEBUG_IGNORES) {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
JavaEmitter.addStrings2Buffer(sb, ", ", symbolRenamed, def.getAliasedNames());
System.err.println("Dropping marker: " + sb.toString());
}
@@ -379,12 +379,12 @@ public class GLEmitter extends ProcAddressEmitter {
super.emitDefine(def, newComment.toString());
}
- private int addExtensionListOfSymbol2Buffer(BuildStaticGLInfo glInfo, StringBuilder buf, String sep1, String name) {
+ private int addExtensionListOfSymbol2Buffer(final BuildStaticGLInfo glInfo, final StringBuilder buf, final String sep1, final String name) {
int num = 0;
- Set<String> extensionNames = glInfo.getExtension(name);
+ final Set<String> extensionNames = glInfo.getExtension(name);
if(null!=extensionNames) {
- for(Iterator<String> i=extensionNames.iterator(); i.hasNext(); ) {
- String extensionName = i.next();
+ for(final Iterator<String> i=extensionNames.iterator(); i.hasNext(); ) {
+ final String extensionName = i.next();
if (null != extensionName) {
buf.append("<code>");
buf.append(extensionName);
@@ -398,19 +398,19 @@ public class GLEmitter extends ProcAddressEmitter {
}
return num;
}
- private int addExtensionListOfAliasedSymbols2Buffer(BuildStaticGLInfo glInfo, StringBuilder buf, String sep1, String sep2, String name, Collection<String> exclude) {
+ private int addExtensionListOfAliasedSymbols2Buffer(final BuildStaticGLInfo glInfo, final StringBuilder buf, final String sep1, final String sep2, final String name, final Collection<String> exclude) {
int num = 0;
if(null != name) {
num += addExtensionListOfSymbol2Buffer(glInfo, buf, sep1, name); // extensions of given name
boolean needsSep2 = 0<num;
- Set<String> origNames = cfg.getRenamedJavaSymbols(name);
+ final Set<String> origNames = cfg.getRenamedJavaSymbols(name);
if(null != origNames) {
- for(String origName : origNames) {
+ for(final String origName : origNames) {
if(!exclude.contains(origName)) {
if (needsSep2) {
buf.append(sep2); // diff-name seperator
}
- int num2 = addExtensionListOfSymbol2Buffer(glInfo, buf, sep1, origName); // extensions of orig-name
+ final int num2 = addExtensionListOfSymbol2Buffer(glInfo, buf, sep1, origName); // extensions of orig-name
needsSep2 = num<num2;
num += num2;
}
@@ -420,8 +420,8 @@ public class GLEmitter extends ProcAddressEmitter {
return num;
}
- public int addExtensionsOfSymbols2Buffer(StringBuilder buf, String sep1, String sep2, String first, Collection<String> col) {
- BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
+ public int addExtensionsOfSymbols2Buffer(StringBuilder buf, final String sep1, final String sep2, final String first, final Collection<String> col) {
+ final BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
if (null == glInfo) {
throw new RuntimeException("No GLInfo for: " + first);
}
@@ -432,11 +432,11 @@ public class GLEmitter extends ProcAddressEmitter {
num += addExtensionListOfAliasedSymbols2Buffer(glInfo, buf, sep1, sep2, first, col);
boolean needsSep2 = 0<num;
- for(Iterator<String> iter = col.iterator(); iter.hasNext(); ) {
+ for(final Iterator<String> iter = col.iterator(); iter.hasNext(); ) {
if(needsSep2) {
buf.append(sep2); // diff-name seperator
}
- int num2 = addExtensionListOfAliasedSymbols2Buffer(glInfo, buf, sep1, sep2, iter.next(), col);
+ final int num2 = addExtensionListOfAliasedSymbols2Buffer(glInfo, buf, sep1, sep2, iter.next(), col);
needsSep2 = num<num2;
num += num2;
}
@@ -447,12 +447,12 @@ public class GLEmitter extends ProcAddressEmitter {
// Internals only below this point
//
@Override
- protected void generateModifiedEmitters(JavaMethodBindingEmitter baseJavaEmitter, List<FunctionEmitter> emitters) {
- List<FunctionEmitter> superEmitters = new ArrayList<FunctionEmitter>();
+ protected void generateModifiedEmitters(final JavaMethodBindingEmitter baseJavaEmitter, final List<FunctionEmitter> emitters) {
+ final List<FunctionEmitter> superEmitters = new ArrayList<FunctionEmitter>();
super.generateModifiedEmitters(baseJavaEmitter, superEmitters);
// See whether this is one of the Buffer Object variants
- boolean bufferObjectVariant = bufferObjectMethodBindings.containsKey(baseJavaEmitter.getBinding());
+ final boolean bufferObjectVariant = bufferObjectMethodBindings.containsKey(baseJavaEmitter.getBinding());
for (FunctionEmitter emitter : superEmitters) {
if (emitter instanceof ProcAddressJavaMethodBindingEmitter) {
@@ -462,7 +462,7 @@ public class GLEmitter extends ProcAddressEmitter {
}
}
- protected boolean needsBufferObjectVariant(FunctionSymbol sym) {
+ protected boolean needsBufferObjectVariant(final FunctionSymbol sym) {
return getGLConfig().isBufferObjectFunction(sym.getName());
}
@@ -475,7 +475,7 @@ public class GLEmitter extends ProcAddressEmitter {
*/
@Override
protected void endProcAddressTable() throws Exception {
- PrintWriter w = tableWriter;
+ final PrintWriter w = tableWriter;
w.println(" @Override");
w.println(" protected boolean isFunctionAvailableImpl(String functionNameUsr) throws IllegalArgumentException {");
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java
index 389d35f99..d491a3712 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java
@@ -58,8 +58,8 @@ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmit
protected GLEmitter glEmitter;
protected CommentEmitter glCommentEmitter = new GLCommentEmitter();
- public GLJavaMethodBindingEmitter(JavaMethodBindingEmitter methodToWrap, boolean callThroughProcAddress,
- String getProcAddressTableExpr, boolean changeNameAndArguments, boolean bufferObjectVariant, GLEmitter emitter) {
+ public GLJavaMethodBindingEmitter(final JavaMethodBindingEmitter methodToWrap, final boolean callThroughProcAddress,
+ final String getProcAddressTableExpr, final boolean changeNameAndArguments, final boolean bufferObjectVariant, final GLEmitter emitter) {
super(methodToWrap, callThroughProcAddress, getProcAddressTableExpr, changeNameAndArguments, emitter);
this.bufferObjectVariant = bufferObjectVariant;
@@ -67,20 +67,20 @@ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmit
setCommentEmitter(glCommentEmitter);
}
- public GLJavaMethodBindingEmitter(ProcAddressJavaMethodBindingEmitter methodToWrap, GLEmitter emitter, boolean bufferObjectVariant) {
+ public GLJavaMethodBindingEmitter(final ProcAddressJavaMethodBindingEmitter methodToWrap, final GLEmitter emitter, final boolean bufferObjectVariant) {
super(methodToWrap);
this.bufferObjectVariant = bufferObjectVariant;
this.glEmitter = emitter;
setCommentEmitter(glCommentEmitter);
}
- public GLJavaMethodBindingEmitter(GLJavaMethodBindingEmitter methodToWrap) {
+ public GLJavaMethodBindingEmitter(final GLJavaMethodBindingEmitter methodToWrap) {
this(methodToWrap, methodToWrap.glEmitter, methodToWrap.bufferObjectVariant);
}
@Override
- protected String getArgumentName(int i) {
- String name = super.getArgumentName(i);
+ protected String getArgumentName(final int i) {
+ final String name = super.getArgumentName(i);
if (!bufferObjectVariant) {
return name;
@@ -89,8 +89,8 @@ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmit
// Emitters for VBO/PBO-related routines change the outgoing
// argument name for the buffer
if (binding.getJavaArgumentType(i).isLong()) {
- Type cType = binding.getCArgumentType(i);
- Type targetType = cType.asPointer().getTargetType();
+ final Type cType = binding.getCArgumentType(i);
+ final Type targetType = cType.asPointer().getTargetType();
if (cType.isPointer() && (targetType.isVoid() || targetType.isPrimitive())) {
return name + "_buffer_offset";
}
@@ -102,10 +102,10 @@ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmit
protected class GLCommentEmitter extends JavaMethodBindingEmitter.DefaultCommentEmitter {
@Override
- protected void emitBindingCSignature(MethodBinding binding, PrintWriter writer) {
+ protected void emitBindingCSignature(final MethodBinding binding, final PrintWriter writer) {
- String symbolRenamed = binding.getName();
- StringBuilder newComment = new StringBuilder();
+ final String symbolRenamed = binding.getName();
+ final StringBuilder newComment = new StringBuilder();
final FunctionSymbol funcSym = binding.getCSymbol();
writer.print("<code> ");
@@ -117,9 +117,9 @@ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmit
if (glEmitter.getGLConfig().getAllowNonGLExtensions()) {
newComment.append("CORE FUNC");
} else {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
JavaEmitter.addStrings2Buffer(sb, ", ", symbolRenamed, binding.getAliasedNames());
- RuntimeException ex = new RuntimeException("Couldn't find extension to: " + binding + " ; " + sb.toString());
+ final RuntimeException ex = new RuntimeException("Couldn't find extension to: " + binding + " ; " + sb.toString());
glEmitter.getGLConfig().getGLInfo().dump();
// glEmitter.getGLConfig().dumpRenames();
throw ex;
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java b/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
index 21946ea89..66819a83e 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
@@ -78,7 +78,7 @@ public class StaticGLGenTask extends Task
* <p>The {@link org.apache.tools.ant.types.CommandlineJava} that is used
* to execute {@link com.jogamp.gluegen.opengl.BuildStaticGLInfo}.</p>
*/
- private CommandlineJava glgenCommandline;
+ private final CommandlineJava glgenCommandline;
// =========================================================================
/**
@@ -94,7 +94,7 @@ public class StaticGLGenTask extends Task
/**
* <p>The {@link org.apache.tools.ant.types.FileSet} of GL headers.</p>
*/
- private FileSet headerSet = new FileSet();
+ private final FileSet headerSet = new FileSet();
// =========================================================================
/**
@@ -117,7 +117,7 @@ public class StaticGLGenTask extends Task
*
* @param packageName the name of the package for the generated files
*/
- public void setPackage(String packageName)
+ public void setPackage(final String packageName)
{
log( ("Setting package name to: " + packageName), Project.MSG_VERBOSE);
this.packageName = packageName;
@@ -128,7 +128,7 @@ public class StaticGLGenTask extends Task
*
* @param directory the output directory
*/
- public void setOutputDir(String directory)
+ public void setOutputDir(final String directory)
{
log( ("Setting output directory to: " + directory),
Project.MSG_VERBOSE);
@@ -163,7 +163,7 @@ public class StaticGLGenTask extends Task
*
* @param headers the string containing the header patterns
*/
- public void setHeaders(String headers)
+ public void setHeaders(final String headers)
{
headerSet.setIncludes(headers);
}
@@ -236,7 +236,7 @@ public class StaticGLGenTask extends Task
* @return <code>true</code> if the string is valid. <code>false</code>
* otherwise.
*/
- private boolean isValid(String string)
+ private boolean isValid(final String string)
{
// check for null
if(string == null)
@@ -265,8 +265,8 @@ public class StaticGLGenTask extends Task
// add the header -files- from the FileSet
headerSet.setDir(getProject().getBaseDir());
- DirectoryScanner directoryScanner = headerSet.getDirectoryScanner(getProject());
- String[] directoryFiles = directoryScanner.getIncludedFiles();
+ final DirectoryScanner directoryScanner = headerSet.getDirectoryScanner(getProject());
+ final String[] directoryFiles = directoryScanner.getIncludedFiles();
for(int i=0; i<directoryFiles.length; i++)
{
glgenCommandline.createArgument().setValue(directoryFiles[i]);
@@ -279,11 +279,11 @@ public class StaticGLGenTask extends Task
*
* @throws BuildException
*/
- private int execute(String[] command)
+ private int execute(final String[] command)
throws BuildException
{
// create the object that will perform the command execution
- Execute execute = new Execute(new LogStreamHandler(this, Project.MSG_INFO,
+ final Execute execute = new Execute(new LogStreamHandler(this, Project.MSG_INFO,
Project.MSG_WARN),
null);
@@ -296,7 +296,7 @@ public class StaticGLGenTask extends Task
try
{
return execute.execute();
- } catch(IOException ioe)
+ } catch(final IOException ioe)
{
throw new BuildException(ioe, location);
}
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java
index 4ac9ae3f3..de9e3ed25 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java
@@ -61,14 +61,14 @@ import java.util.Set;
public class NativeSignatureEmitter extends GLEmitter {
@Override
- protected List<? extends FunctionEmitter> generateMethodBindingEmitters(Set<MethodBinding> methodBindingSet, FunctionSymbol sym) throws Exception {
+ protected List<? extends FunctionEmitter> generateMethodBindingEmitters(final Set<MethodBinding> methodBindingSet, final FunctionSymbol sym) throws Exception {
// Allow superclass to do most of the work for us
- List<? extends FunctionEmitter> res = super.generateMethodBindingEmitters(methodBindingSet, sym);
+ final List<? extends FunctionEmitter> res = super.generateMethodBindingEmitters(methodBindingSet, sym);
// Filter out all non-JavaMethodBindingEmitters
- for (Iterator<? extends FunctionEmitter> iter = res.iterator(); iter.hasNext();) {
- FunctionEmitter emitter = iter.next();
+ for (final Iterator<? extends FunctionEmitter> iter = res.iterator(); iter.hasNext();) {
+ final FunctionEmitter emitter = iter.next();
if (!(emitter instanceof JavaMethodBindingEmitter)) {
iter.remove();
}
@@ -78,13 +78,13 @@ public class NativeSignatureEmitter extends GLEmitter {
return res;
}
- PrintWriter writer = (getConfig().allStatic() ? javaWriter() : javaImplWriter());
+ final PrintWriter writer = (getConfig().allStatic() ? javaWriter() : javaImplWriter());
- List<FunctionEmitter> processed = new ArrayList<FunctionEmitter>();
+ final List<FunctionEmitter> processed = new ArrayList<FunctionEmitter>();
// First, filter out all emitters going to the "other" (public) writer
- for (Iterator<? extends FunctionEmitter> iter = res.iterator(); iter.hasNext();) {
- FunctionEmitter emitter = iter.next();
+ for (final Iterator<? extends FunctionEmitter> iter = res.iterator(); iter.hasNext();) {
+ final FunctionEmitter emitter = iter.next();
if (emitter.getDefaultOutput() != writer) {
processed.add(emitter);
iter.remove();
@@ -93,12 +93,12 @@ public class NativeSignatureEmitter extends GLEmitter {
// Now process all of the remaining emitters sorted by MethodBinding
while (!res.isEmpty()) {
- List<JavaMethodBindingEmitter> emittersForBinding = new ArrayList<JavaMethodBindingEmitter>();
- JavaMethodBindingEmitter emitter = (JavaMethodBindingEmitter) res.remove(0);
+ final List<JavaMethodBindingEmitter> emittersForBinding = new ArrayList<JavaMethodBindingEmitter>();
+ final JavaMethodBindingEmitter emitter = (JavaMethodBindingEmitter) res.remove(0);
emittersForBinding.add(emitter);
- MethodBinding binding = emitter.getBinding();
- for (Iterator<? extends FunctionEmitter> iter = res.iterator(); iter.hasNext();) {
- JavaMethodBindingEmitter emitter2 = (JavaMethodBindingEmitter) iter.next();
+ final MethodBinding binding = emitter.getBinding();
+ for (final Iterator<? extends FunctionEmitter> iter = res.iterator(); iter.hasNext();) {
+ final JavaMethodBindingEmitter emitter2 = (JavaMethodBindingEmitter) iter.next();
if (emitter2.getBinding() == binding) {
emittersForBinding.add(emitter2);
iter.remove();
@@ -111,17 +111,17 @@ public class NativeSignatureEmitter extends GLEmitter {
return processed;
}
- protected void generateNativeSignatureEmitters(MethodBinding binding, List<JavaMethodBindingEmitter> allEmitters) {
+ protected void generateNativeSignatureEmitters(final MethodBinding binding, final List<JavaMethodBindingEmitter> allEmitters) {
if (allEmitters.isEmpty()) {
return;
}
- PrintWriter writer = (getConfig().allStatic() ? javaWriter() : javaImplWriter());
+ final PrintWriter writer = (getConfig().allStatic() ? javaWriter() : javaImplWriter());
// Give ourselves the chance to interpose on the generation of all code to keep things simple
- List<JavaMethodBindingEmitter> newEmitters = new ArrayList<JavaMethodBindingEmitter>();
- for (JavaMethodBindingEmitter javaEmitter : allEmitters) {
+ final List<JavaMethodBindingEmitter> newEmitters = new ArrayList<JavaMethodBindingEmitter>();
+ for (final JavaMethodBindingEmitter javaEmitter : allEmitters) {
NativeSignatureJavaMethodBindingEmitter newEmitter = null;
if (javaEmitter instanceof GLJavaMethodBindingEmitter) {
newEmitter = new NativeSignatureJavaMethodBindingEmitter((GLJavaMethodBindingEmitter) javaEmitter);
@@ -138,11 +138,11 @@ public class NativeSignatureEmitter extends GLEmitter {
// been called with signatureOnly both true and false.
if (signatureContainsStrings(binding) && !haveEmitterWithBody(allEmitters)) {
// This basically handles glGetString but also any similar methods
- NativeSignatureJavaMethodBindingEmitter javaEmitter = findEmitterWithWriter(allEmitters, writer);
+ final NativeSignatureJavaMethodBindingEmitter javaEmitter = findEmitterWithWriter(allEmitters, writer);
// First, we need to clone this emitter to produce the native
// entry point
- NativeSignatureJavaMethodBindingEmitter emitter = new NativeSignatureJavaMethodBindingEmitter(javaEmitter);
+ final NativeSignatureJavaMethodBindingEmitter emitter = new NativeSignatureJavaMethodBindingEmitter(javaEmitter);
emitter.removeModifier(JavaMethodBindingEmitter.PUBLIC);
emitter.addModifier(JavaMethodBindingEmitter.PRIVATE);
emitter.setForImplementingMethodCall(true);
@@ -158,22 +158,22 @@ public class NativeSignatureEmitter extends GLEmitter {
}
}
- protected boolean signatureContainsStrings(MethodBinding binding) {
+ protected boolean signatureContainsStrings(final MethodBinding binding) {
for (int i = 0; i < binding.getNumArguments(); i++) {
- JavaType type = binding.getJavaArgumentType(i);
+ final JavaType type = binding.getJavaArgumentType(i);
if (type.isString() || type.isStringArray()) {
return true;
}
}
- JavaType retType = binding.getJavaReturnType();
+ final JavaType retType = binding.getJavaReturnType();
if (retType.isString() || retType.isStringArray()) {
return true;
}
return false;
}
- protected boolean haveEmitterWithBody(List<JavaMethodBindingEmitter> allEmitters) {
- for (JavaMethodBindingEmitter emitter : allEmitters) {
+ protected boolean haveEmitterWithBody(final List<JavaMethodBindingEmitter> allEmitters) {
+ for (final JavaMethodBindingEmitter emitter : allEmitters) {
if (!emitter.signatureOnly()) {
return true;
}
@@ -181,9 +181,9 @@ public class NativeSignatureEmitter extends GLEmitter {
return false;
}
- protected NativeSignatureJavaMethodBindingEmitter findEmitterWithWriter(List<JavaMethodBindingEmitter> allEmitters, PrintWriter writer) {
- for (JavaMethodBindingEmitter jemitter : allEmitters) {
- NativeSignatureJavaMethodBindingEmitter emitter = (NativeSignatureJavaMethodBindingEmitter)jemitter;
+ protected NativeSignatureJavaMethodBindingEmitter findEmitterWithWriter(final List<JavaMethodBindingEmitter> allEmitters, final PrintWriter writer) {
+ for (final JavaMethodBindingEmitter jemitter : allEmitters) {
+ final NativeSignatureJavaMethodBindingEmitter emitter = (NativeSignatureJavaMethodBindingEmitter)jemitter;
if (emitter.getDefaultOutput() == writer) {
return emitter;
}
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
index 6d9d6f2bb..86080d84f 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
@@ -53,31 +53,31 @@ import java.io.PrintWriter;
/** Review: This Package/Class is not used and subject to be deleted. */
public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBindingEmitter {
- public NativeSignatureJavaMethodBindingEmitter(GLJavaMethodBindingEmitter methodToWrap) {
+ public NativeSignatureJavaMethodBindingEmitter(final GLJavaMethodBindingEmitter methodToWrap) {
super(methodToWrap);
}
- public NativeSignatureJavaMethodBindingEmitter(ProcAddressJavaMethodBindingEmitter methodToWrap, GLEmitter emitter, boolean bufferObjectVariant) {
+ public NativeSignatureJavaMethodBindingEmitter(final ProcAddressJavaMethodBindingEmitter methodToWrap, final GLEmitter emitter, final boolean bufferObjectVariant) {
super(methodToWrap, emitter, bufferObjectVariant);
}
- public NativeSignatureJavaMethodBindingEmitter(JavaMethodBindingEmitter methodToWrap, NativeSignatureEmitter emitter) {
+ public NativeSignatureJavaMethodBindingEmitter(final JavaMethodBindingEmitter methodToWrap, final NativeSignatureEmitter emitter) {
super(methodToWrap, false, null, false, false, emitter);
}
@Override
- protected void emitSignature(PrintWriter writer) {
+ protected void emitSignature(final PrintWriter writer) {
writer.print(getBaseIndentString());
emitNativeSignatureAnnotation(writer);
super.emitSignature(writer);
}
- protected void emitNativeSignatureAnnotation(PrintWriter writer) {
+ protected void emitNativeSignatureAnnotation(final PrintWriter writer) {
if (hasModifier(JavaMethodBindingEmitter.NATIVE)) {
// Emit everything as a leaf for now
// FIXME: make this configurable
writer.print("@NativeSignature(\"l");
- MethodBinding binding = getBinding();
+ final MethodBinding binding = getBinding();
if (callThroughProcAddress) {
writer.print("p");
}
@@ -94,7 +94,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
}
}
- protected void emitNativeSignatureElement(PrintWriter writer, JavaType type, Type cType, int index) {
+ protected void emitNativeSignatureElement(final PrintWriter writer, final JavaType type, final Type cType, final int index) {
if (type.isVoid()) {
if (index > 0) {
throw new InternalError("Error parsing arguments -- void should not be seen aside from argument 0");
@@ -107,7 +107,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
} else if (type.isPrimitiveArray()) {
writer.print("MO");
} else if (type.isPrimitive()) {
- Class<?> clazz = type.getJavaClass();
+ final Class<?> clazz = type.getJavaClass();
if (clazz == Byte.TYPE) { writer.print("B"); }
else if (clazz == Character.TYPE) { writer.print("C"); }
else if (clazz == Double.TYPE) { writer.print("D"); }
@@ -132,9 +132,9 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
}
@Override
- protected String getReturnTypeString(boolean skipArray) {
+ protected String getReturnTypeString(final boolean skipArray) {
if (isForImplementingMethodCall()) {
- JavaType returnType = getBinding().getJavaReturnType();
+ final JavaType returnType = getBinding().getJavaReturnType();
if (returnType.isString() || returnType.isNIOByteBuffer()) {
// Treat these as addresses
return "long";
@@ -144,10 +144,10 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
}
@Override
- protected void emitPreCallSetup(MethodBinding binding, PrintWriter writer) {
+ protected void emitPreCallSetup(final MethodBinding binding, final PrintWriter writer) {
super.emitPreCallSetup(binding, writer);
for (int i = 0; i < binding.getNumArguments(); i++) {
- JavaType type = binding.getJavaArgumentType(i);
+ final JavaType type = binding.getJavaArgumentType(i);
if (type.isNIOBuffer() && !useNIODirectOnly ) {
// Emit declarations for variables holding primitive arrays as type Object
// We don't know 100% sure we're going to use these at this point in the code, though
@@ -160,12 +160,12 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
}
}
- protected String getNIOBufferArrayName(int argNumber) {
+ protected String getNIOBufferArrayName(final int argNumber) {
return "__buffer_array_" + argNumber;
}
@Override
- protected int emitArguments(PrintWriter writer)
+ protected int emitArguments(final PrintWriter writer)
{
boolean needComma = false;
int numEmitted = 0;
@@ -191,7 +191,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
}
for (int i = 0; i < binding.getNumArguments(); i++) {
- JavaType type = binding.getJavaArgumentType(i);
+ final JavaType type = binding.getJavaArgumentType(i);
if (type.isVoid()) {
// Make sure this is the only param to the method; if it isn't,
// there's something wrong with our parsing of the headers.
@@ -246,9 +246,9 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
}
@Override
- protected void emitReturnVariableSetupAndCall(MethodBinding binding, PrintWriter writer) {
+ protected void emitReturnVariableSetupAndCall(final MethodBinding binding, final PrintWriter writer) {
writer.print(" ");
- JavaType returnType = binding.getJavaReturnType();
+ final JavaType returnType = binding.getJavaReturnType();
boolean needsResultAssignment = false;
if (!returnType.isVoid()) {
@@ -344,7 +344,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
}
}
- protected int emitCallArguments(MethodBinding binding, PrintWriter writer, boolean direct) {
+ protected int emitCallArguments(final MethodBinding binding, final PrintWriter writer, final boolean direct) {
// Note that we override this completely because we both need to
// move the potential location of the outgoing proc address as
// well as change the way we pass out Buffers, arrays, Strings, etc.
@@ -368,7 +368,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
++numArgsEmitted;
}
for (int i = 0; i < binding.getNumArguments(); i++) {
- JavaType type = binding.getJavaArgumentType(i);
+ final JavaType type = binding.getJavaArgumentType(i);
if (type.isJNIEnv() || binding.isArgumentThisPointer(i)) {
// Don't need to expose these at the Java level
continue;
@@ -460,9 +460,9 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
}
@Override
- protected void emitCallResultReturn(MethodBinding binding, PrintWriter writer) {
+ protected void emitCallResultReturn(final MethodBinding binding, final PrintWriter writer) {
for (int i = 0; i < binding.getNumArguments(); i++) {
- JavaType type = binding.getJavaArgumentType(i);
+ final JavaType type = binding.getJavaArgumentType(i);
if (type.isString()) {
writer.println(";");
writer.println(" BuffersInternal.freeCString(" + binding.getArgumentName(i) + "_c_str);");
@@ -475,14 +475,14 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
@Override
public String getName() {
- String res = super.getName();
+ final String res = super.getName();
if (forImplementingMethodCall && bufferObjectVariant) {
return res + "BufObj";
}
return res;
}
- protected String getImplMethodName(boolean direct) {
+ protected String getImplMethodName(final boolean direct) {
String name = null;
if (direct) {
name = binding.getName() + "$0";
diff --git a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java
index 9b57a2f2d..34ab3df9e 100644
--- a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java
+++ b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java
@@ -72,19 +72,19 @@ public class GLNameResolver {
};
- public static final boolean isGLFunction(String str) {
+ public static final boolean isGLFunction(final String str) {
return str.startsWith("gl") || /* str.startsWith("glu") || str.startsWith("glX") || */
str.startsWith("egl") || str.startsWith("wgl") || str.startsWith("agl") ||
str.startsWith("cgl") ;
}
- public static final boolean isGLEnumeration(String str) {
+ public static final boolean isGLEnumeration(final String str) {
return str.startsWith("GL_") || str.startsWith("GLU_") || str.startsWith("GLX_") ||
str.startsWith("EGL_") || str.startsWith("WGL_") || str.startsWith("AGL_") ||
str.startsWith("CGL_") ;
}
- public static final int getExtensionIdx(String[] extensions, String str, boolean isGLFunc) {
+ public static final int getExtensionIdx(final String[] extensions, final String str, final boolean isGLFunc) {
if(isGLFunc) {
for(int i = extensions.length - 1 ; i>=0 ; i--) {
if( str.endsWith(extensions[i]) ) {
@@ -101,11 +101,11 @@ public class GLNameResolver {
return -1;
}
- public static final boolean isExtension(String[] extensions, String str, boolean isGLFunc) {
+ public static final boolean isExtension(final String[] extensions, final String str, final boolean isGLFunc) {
return getExtensionIdx(extensions, str, isGLFunc)>=0;
}
- public static final String getExtensionSuffix(String str, boolean isGLFunc) {
+ public static final String getExtensionSuffix(final String str, final boolean isGLFunc) {
int idx = getExtensionIdx(extensionsARB, str, isGLFunc);
if(idx>=0) {
return extensionsARB[idx];
@@ -117,7 +117,7 @@ public class GLNameResolver {
return null;
}
- public static final String normalize(String[] extensions, String str, boolean isGLFunc) {
+ public static final String normalize(final String[] extensions, String str, final boolean isGLFunc) {
boolean touched = false;
for(int i = extensions.length - 1 ; !touched && i>=0 ; i--) {
if(isGLFunc) {
@@ -136,19 +136,19 @@ public class GLNameResolver {
}
return str;
}
- public static final String normalizeARB(String str, boolean isGLFunc) {
+ public static final String normalizeARB(final String str, final boolean isGLFunc) {
return normalize(extensionsARB, str, isGLFunc);
}
- public static final boolean isExtensionARB(String str, boolean isGLFunc) {
+ public static final boolean isExtensionARB(final String str, final boolean isGLFunc) {
return isExtension(extensionsARB, str, isGLFunc);
}
- public static final String normalizeVEN(String str, boolean isGLFunc) {
+ public static final String normalizeVEN(final String str, final boolean isGLFunc) {
return normalize(extensionsVEN, str, isGLFunc);
}
- public static final boolean isExtensionVEN(String str, boolean isGLFunc) {
+ public static final boolean isExtensionVEN(final String str, final boolean isGLFunc) {
return isExtension(extensionsVEN, str, isGLFunc);
}
- public static final String normalize(String str, boolean isGLFunc) {
+ public static final String normalize(final String str, final boolean isGLFunc) {
if (isExtensionARB(str, isGLFunc)) {
return normalizeARB(str, isGLFunc);
}
@@ -157,12 +157,12 @@ public class GLNameResolver {
}
return str;
}
- public static final boolean isExtension(String str, boolean isGLFunc) {
+ public static final boolean isExtension(final String str, final boolean isGLFunc) {
return isExtension(extensionsARB, str, isGLFunc) ||
isExtension(extensionsVEN, str, isGLFunc);
}
- public static final int getFuncNamePermutationNumber(String name) {
+ public static final int getFuncNamePermutationNumber(final String name) {
if(isExtensionARB(name, true) || isExtensionVEN(name, true)) {
// no name permutation, if it's already a known extension
return 1;
@@ -170,7 +170,7 @@ public class GLNameResolver {
return 1 + extensionsARB.length + extensionsVEN.length;
}
- public static final String getFuncNamePermutation(String name, int i) {
+ public static final String getFuncNamePermutation(final String name, int i) {
// identity
if(i==0) {
return name;
diff --git a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
index 3fb315c99..23d4fc3cf 100644
--- a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
+++ b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
@@ -43,16 +43,16 @@ public class GLProcAddressResolver implements FunctionAddressResolver {
public static final boolean DEBUG = false;
@Override
- public long resolve(String name, DynamicLookupHelper lookup) {
+ public long resolve(final String name, final DynamicLookupHelper lookup) {
long newProcAddress = 0;
- int permutations = GLNameResolver.getFuncNamePermutationNumber(name);
+ final int permutations = GLNameResolver.getFuncNamePermutationNumber(name);
for (int i = 0; 0 == newProcAddress && i < permutations; i++) {
- String funcName = GLNameResolver.getFuncNamePermutation(name, i);
+ final String funcName = GLNameResolver.getFuncNamePermutation(name, i);
try {
newProcAddress = lookup.dynamicLookupFunction(funcName);
- } catch (Exception e) {
+ } catch (final Exception e) {
if (DEBUG) {
e.printStackTrace();
}
diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
index d4977669e..939035c69 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
@@ -106,7 +106,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
public final int state;
- VerticesState(int state){
+ VerticesState(final int state){
this.state = state;
}
}
@@ -149,7 +149,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
/** Create a new Outline based Shape
*/
- public OutlineShape(Vertex.Factory<? extends Vertex> factory) {
+ public OutlineShape(final Vertex.Factory<? extends Vertex> factory) {
this.vertexFactory = factory;
this.outlines = new ArrayList<Outline>(3);
this.outlines.add(new Outline());
@@ -235,7 +235,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* @param outline Outline object to be added
* @throws NullPointerException if the {@link Outline} element is null
*/
- public final void addOutline(Outline outline) throws NullPointerException {
+ public final void addOutline(final Outline outline) throws NullPointerException {
addOutline(outlines.size(), outline);
}
@@ -251,7 +251,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* @throws NullPointerException if the {@link Outline} element is null
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getOutlineNumber())
*/
- public final void addOutline(int position, Outline outline) throws NullPointerException, IndexOutOfBoundsException {
+ public final void addOutline(final int position, final Outline outline) throws NullPointerException, IndexOutOfBoundsException {
if (null == outline) {
throw new NullPointerException("outline is null");
}
@@ -285,7 +285,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* @throws NullPointerException if the {@link OutlineShape} is null
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getOutlineNumber())
*/
- public final void addOutlineShape(OutlineShape outlineShape) throws NullPointerException {
+ public final void addOutlineShape(final OutlineShape outlineShape) throws NullPointerException {
if (null == outlineShape) {
throw new NullPointerException("OutlineShape is null");
}
@@ -304,7 +304,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* @throws NullPointerException if the {@link Outline} element is null
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber())
*/
- public final void setOutline(int position, Outline outline) throws NullPointerException, IndexOutOfBoundsException {
+ public final void setOutline(final int position, final Outline outline) throws NullPointerException, IndexOutOfBoundsException {
if (null == outline) {
throw new NullPointerException("outline is null");
}
@@ -319,7 +319,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* @param position of the to be removed Outline
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber())
*/
- public final Outline removeOutline(int position) throws IndexOutOfBoundsException {
+ public final Outline removeOutline(final int position) throws IndexOutOfBoundsException {
dirtyBits |= DIRTY_BOUNDS | DIRTY_TRIANGLES | DIRTY_VERTICES;
return outlines.remove(position);
}
@@ -337,7 +337,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* Returns the {@code Outline} at {@code position}
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber())
*/
- public final Outline getOutline(int position) throws IndexOutOfBoundsException {
+ public final Outline getOutline(final int position) throws IndexOutOfBoundsException {
return outlines.get(position);
}
@@ -345,7 +345,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* Adds a vertex to the last open outline to the shape's tail.
* @param v the vertex to be added to the OutlineShape
*/
- public final void addVertex(Vertex v) {
+ public final void addVertex(final Vertex v) {
final Outline lo = getLastOutline();
lo.addVertex(v);
if( 0 == ( dirtyBits & DIRTY_BOUNDS ) ) {
@@ -360,7 +360,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* @param position indx at which the vertex will be added
* @param v the vertex to be added to the OutlineShape
*/
- public final void addVertex(int position, Vertex v) {
+ public final void addVertex(final int position, final Vertex v) {
final Outline lo = getLastOutline();
lo.addVertex(position, v);
if( 0 == ( dirtyBits & DIRTY_BOUNDS ) ) {
@@ -378,7 +378,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* @param onCurve flag if this vertex is on the final curve or defines a curved region
* of the shape around this vertex.
*/
- public final void addVertex(float x, float y, boolean onCurve) {
+ public final void addVertex(final float x, final float y, final boolean onCurve) {
addVertex(vertexFactory.create(x, y, 0f, onCurve));
}
@@ -391,7 +391,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* @param onCurve flag if this vertex is on the final curve or defines a curved region
* of the shape around this vertex.
*/
- public final void addVertex(float x, float y, float z, boolean onCurve) {
+ public final void addVertex(final float x, final float y, final float z, final boolean onCurve) {
addVertex(vertexFactory.create(x, y, z, onCurve));
}
@@ -407,7 +407,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* @param onCurve flag if this vertex is on the final curve or defines a curved region
* of the shape around this vertex.
*/
- public final void addVertex(float[] coordsBuffer, int offset, int length, boolean onCurve) {
+ public final void addVertex(final float[] coordsBuffer, final int offset, final int length, final boolean onCurve) {
addVertex(vertexFactory.create(coordsBuffer, offset, length, onCurve));
}
@@ -421,7 +421,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* @param closeTail if true, a clone of the first vertex will be appended,
* otherwise a clone of the last vertex will be prepended.
*/
- public final void closeLastOutline(boolean closeTail) {
+ public final void closeLastOutline(final boolean closeTail) {
if( getLastOutline().setClosed(true) ) {
dirtyBits |= DIRTY_TRIANGLES | DIRTY_VERTICES;
}
@@ -443,7 +443,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
// checkPossibleOverlaps = false;
}
- private void subdivideTriangle(final Outline outline, Vertex a, Vertex b, Vertex c, int index){
+ private void subdivideTriangle(final Outline outline, final Vertex a, final Vertex b, final Vertex c, final int index){
VectorUtil.midVec3(tmpV1, a.getCoord(), b.getCoord());
VectorUtil.midVec3(tmpV3, b.getCoord(), c.getCoord());
VectorUtil.midVec3(tmpV2, tmpV1, tmpV3);
@@ -516,7 +516,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
final int count = getOutlineNumber();
for (int cc = 0; cc < count; cc++) {
final Outline outline = getOutline(cc);
- int vertexCount = outline.getVertexCount();
+ final int vertexCount = outline.getVertexCount();
for(int i=0; i < vertexCount; i++) {
final Vertex current = outline.getVertex(i);
if(current.isOnCurve() || current == a || current == b || current == c) {
@@ -549,7 +549,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
final int count = getOutlineNumber();
for (int cc = 0; cc < count; cc++) {
final Outline outline = getOutline(cc);
- int vertexCount = outline.getVertexCount();
+ final int vertexCount = outline.getVertexCount();
for(int i=0; i < vertexCount; i++) {
final Vertex current = outline.getVertex(i);
if(current.isOnCurve() || current == a || current == b || current == c) {
@@ -679,7 +679,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* @return an arraylist of triangles representing the filled region
* which is produced by the combination of the outlines
*/
- public ArrayList<Triangle> getTriangles(VerticesState destinationType) {
+ public ArrayList<Triangle> getTriangles(final VerticesState destinationType) {
final boolean updated;
if(destinationType != VerticesState.QUADRATIC_NURBS) {
throw new IllegalStateException("destinationType "+destinationType.name()+" not supported (currently "+outlineState.name()+")");
@@ -724,7 +724,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
private static Comparator<Outline> reversSizeComparator = new Comparator<Outline>() {
@Override
- public int compare(Outline o1, Outline o2) {
+ public int compare(final Outline o1, final Outline o2) {
return o2.compareTo(o1); // reverse !
} };
@@ -767,7 +767,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
* same outlineState, equal bounds and equal outlines in the same order
*/
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if( obj == this) {
return true;
}
diff --git a/src/jogl/classes/com/jogamp/graph/curve/Region.java b/src/jogl/classes/com/jogamp/graph/curve/Region.java
index e101be33f..350e3ef41 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/Region.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/Region.java
@@ -115,15 +115,15 @@ public abstract class Region {
protected final AABBox box = new AABBox();
protected Frustum frustum = null;
- public static boolean isVBAA(int renderModes) {
+ public static boolean isVBAA(final int renderModes) {
return 0 != (renderModes & Region.VBAA_RENDERING_BIT);
}
- public static boolean isMSAA(int renderModes) {
+ public static boolean isMSAA(final int renderModes) {
return 0 != (renderModes & Region.MSAA_RENDERING_BIT);
}
- public static boolean isTwoPass(int renderModes) {
+ public static boolean isTwoPass(final int renderModes) {
return 0 != ( renderModes & ( Region.VBAA_RENDERING_BIT | Region.MSAA_RENDERING_BIT) );
}
@@ -132,7 +132,7 @@ public abstract class Region {
* i.e. the bit {@link #VARWEIGHT_RENDERING_BIT} is set,
* otherwise false.
*/
- public static boolean hasVariableWeight(int renderModes) {
+ public static boolean hasVariableWeight(final int renderModes) {
return 0 != (renderModes & Region.VARWEIGHT_RENDERING_BIT);
}
@@ -141,7 +141,7 @@ public abstract class Region {
* i.e. the bit {@link #COLORCHANNEL_RENDERING_BIT} is set,
* otherwise false.
*/
- public static boolean hasColorChannel(int renderModes) {
+ public static boolean hasColorChannel(final int renderModes) {
return 0 != (renderModes & Region.COLORCHANNEL_RENDERING_BIT);
}
@@ -150,11 +150,11 @@ public abstract class Region {
* i.e. the bit {@link #COLORTEXTURE_RENDERING_BIT} is set,
* otherwise false.
*/
- public static boolean hasColorTexture(int renderModes) {
+ public static boolean hasColorTexture(final int renderModes) {
return 0 != (renderModes & Region.COLORTEXTURE_RENDERING_BIT);
}
- public static String getRenderModeString(int renderModes) {
+ public static String getRenderModeString(final int renderModes) {
final String curveS = hasVariableWeight(renderModes) ? "-curve" : "";
final String cChanS = hasColorChannel(renderModes) ? "-cols" : "";
final String cTexS = hasColorTexture(renderModes) ? "-ctex" : "";
@@ -167,7 +167,7 @@ public abstract class Region {
}
}
- protected Region(int regionRenderModes) {
+ protected Region(final int regionRenderModes) {
this.renderModes = regionRenderModes;
this.quality = MAX_QUALITY;
}
@@ -187,7 +187,7 @@ public abstract class Region {
public final int getQuality() { return quality; }
/** See {@link #MAX_QUALITY} */
- public final void setQuality(int q) { quality=q; }
+ public final void setQuality(final int q) { quality=q; }
protected void clearImpl() {
dirty = DIRTY_SHAPE | DIRTY_STATE;
@@ -241,13 +241,13 @@ public abstract class Region {
/**
* Set {@link Frustum} culling for {@link #addOutlineShape(OutlineShape, AffineTransform, float[])}.
*/
- public final void setFrustum(Frustum frustum) {
+ public final void setFrustum(final Frustum frustum) {
this.frustum = frustum;
}
final float[] coordsEx = new float[3];
- private void pushNewVertexImpl(final Vertex vertIn, final AffineTransform transform, float[] rgba) {
+ private void pushNewVertexImpl(final Vertex vertIn, final AffineTransform transform, final float[] rgba) {
if( null != transform ) {
final float[] coordsIn = vertIn.getCoord();
transform.transform(coordsIn, coordsEx);
@@ -261,7 +261,7 @@ public abstract class Region {
numVertices++;
}
- private void pushNewVertexIdxImpl(final Vertex vertIn, final AffineTransform transform, float[] rgba) {
+ private void pushNewVertexIdxImpl(final Vertex vertIn, final AffineTransform transform, final float[] rgba) {
pushIndex(numVertices);
pushNewVertexImpl(vertIn, transform, rgba);
}
@@ -308,7 +308,7 @@ public abstract class Region {
final int idxOffset = numVertices;
int vertsVNewIdxCount = 0, vertsTMovIdxCount = 0, vertsTNewIdxCount = 0, tris = 0;
- int vertsDupCountV = 0, vertsDupCountT = 0, vertsKnownMovedT = 0;
+ final int vertsDupCountV = 0, vertsDupCountT = 0, vertsKnownMovedT = 0;
if( vertsIn.size() >= 3 ) {
if(DEBUG_INSTANCE) {
System.err.println("Region.addOutlineShape(): Processing Vertices");
@@ -399,7 +399,7 @@ public abstract class Region {
/**
* See {@link #markShapeDirty()} and {@link #markStateDirty()}.
*/
- protected final void clearDirtyBits(int v) {
+ protected final void clearDirtyBits(final int v) {
dirty &= ~v;
}
protected final int getDirtyBits() { return dirty; }
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
index 568b8ddac..8f3a10d9d 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
@@ -75,7 +75,7 @@ public abstract class GLRegion extends Region {
protected final TextureSequence colorTexSeq;
- protected GLRegion(int renderModes, TextureSequence colorTexSeq) {
+ protected GLRegion(final int renderModes, final TextureSequence colorTexSeq) {
super(renderModes);
this.colorTexSeq = colorTexSeq;
}
@@ -103,7 +103,7 @@ public abstract class GLRegion extends Region {
/**
* Delete and clear the associated OGL objects.
*/
- public final void destroy(GL2ES2 gl) {
+ public final void destroy(final GL2ES2 gl) {
clear(gl);
destroyImpl(gl);
}
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
index 754eb56e8..9a175c030 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
@@ -207,7 +207,7 @@ public class RegionRenderer {
initialized = true;
}
- public final void destroy(GL2ES2 gl) {
+ public final void destroy(final GL2ES2 gl) {
if(!initialized){
if(DEBUG_INSTANCE) {
System.err.println("TextRenderer: Not initialized!");
@@ -234,7 +234,7 @@ public class RegionRenderer {
* </p>
* @see #create(RenderState, GLCallback, GLCallback)
*/
- public final void enable(GL2ES2 gl, boolean enable) {
+ public final void enable(final GL2ES2 gl, final boolean enable) {
if( enable ) {
if( null != enableCallback ) {
enableCallback.run(gl, this);
@@ -253,12 +253,12 @@ public class RegionRenderer {
}
/** No PMVMatrix operation is performed here. PMVMatrix is marked dirty. */
- public final void reshapeNotify(int width, int height) {
+ public final void reshapeNotify(final int width, final int height) {
this.vp_width = width;
this.vp_height = height;
}
- public final void reshapePerspective(float angle, int width, int height, float near, float far) {
+ public final void reshapePerspective(final float angle, final int width, final int height, final float near, final float far) {
this.vp_width = width;
this.vp_height = height;
final float ratio = (float)width/(float)height;
@@ -268,7 +268,7 @@ public class RegionRenderer {
p.gluPerspective(angle, ratio, near, far);
}
- public final void reshapeOrtho(int width, int height, float near, float far) {
+ public final void reshapeOrtho(final int width, final int height, final float near, final float far) {
this.vp_width = width;
this.vp_height = height;
final PMVMatrix p = rs.getMatrix();
@@ -298,7 +298,7 @@ public class RegionRenderer {
// FIXME: Really required to have sampler2D def. precision ? If not, we can drop getFragmentShaderPrecision(..) and use default ShaderCode ..
private static final String es2_precision_fp = "\nprecision mediump float;\nprecision mediump int;\nprecision mediump sampler2D;\n";
- private final String getFragmentShaderPrecision(GL2ES2 gl) {
+ private final String getFragmentShaderPrecision(final GL2ES2 gl) {
if( gl.isGLES() ) {
return es2_precision_fp;
}
@@ -489,7 +489,7 @@ public class RegionRenderer {
try {
posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, "uniforms.glsl");
posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, "varyings.glsl");
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
throw new RuntimeException("Failed to read: includes", ioe);
}
if( 0 > posFp ) {
@@ -514,7 +514,7 @@ public class RegionRenderer {
}
try {
posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, shaderSegment);
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
throw new RuntimeException("Failed to read: "+shaderSegment, ioe);
}
if( 0 > posFp ) {
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
index f991855c0..6ff9bf9cd 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
@@ -34,6 +34,7 @@ import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLException;
import javax.media.opengl.GLUniformData;
+import jogamp.common.os.PlatformPropsImpl;
import jogamp.graph.curve.opengl.shader.UniformNames;
import com.jogamp.common.os.Platform;
@@ -64,7 +65,7 @@ public class RenderState {
* </p>
*/
public static final int BITHINT_BLENDING_ENABLED = 1 << 0 ;
-
+
/**
* Bitfield hint, {@link #isHintMaskSet(int) if set}
* stating globally <i>enabled</i> {@link GL#GL_DEPTH_TEST}, otherwise <i>disabled</i>.
@@ -81,15 +82,15 @@ public class RenderState {
*/
public static final int BITHINT_GLOBAL_DEPTH_TEST_ENABLED = 1 << 1 ;
- public static RenderState createRenderState(Vertex.Factory<? extends Vertex> pointFactory) {
+ public static RenderState createRenderState(final Vertex.Factory<? extends Vertex> pointFactory) {
return new RenderState(pointFactory, null);
}
- public static RenderState createRenderState(Vertex.Factory<? extends Vertex> pointFactory, PMVMatrix pmvMatrix) {
+ public static RenderState createRenderState(final Vertex.Factory<? extends Vertex> pointFactory, final PMVMatrix pmvMatrix) {
return new RenderState(pointFactory, pmvMatrix);
}
- public static final RenderState getRenderState(GL2ES2 gl) {
+ public static final RenderState getRenderState(final GL2ES2 gl) {
return (RenderState) gl.getContext().getAttachedObject(thisKey);
}
@@ -167,13 +168,13 @@ public class RenderState {
return res;
}
- public StringBuilder toString(StringBuilder sb, boolean alsoUnlocated) {
+ public StringBuilder toString(StringBuilder sb, final boolean alsoUnlocated) {
if(null==sb) {
sb = new StringBuilder();
}
- sb.append("ProgramLocal[rsID ").append(rsId).append(Platform.NEWLINE);
+ sb.append("ProgramLocal[rsID ").append(rsId).append(PlatformPropsImpl.NEWLINE);
// pmvMatrix.toString(sb, "%.2f");
- sb.append(gcu_PMVMatrix01).append(", ").append(Platform.NEWLINE);
+ sb.append(gcu_PMVMatrix01).append(", ").append(PlatformPropsImpl.NEWLINE);
sb.append(gcu_ColorStatic).append(", ");
sb.append(gcu_Weight).append("]");
return sb;
@@ -185,7 +186,7 @@ public class RenderState {
}
}
- protected RenderState(Vertex.Factory<? extends Vertex> vertexFactory, PMVMatrix pmvMatrix) {
+ protected RenderState(final Vertex.Factory<? extends Vertex> vertexFactory, final PMVMatrix pmvMatrix) {
this.id = getNextID();
this.sp = null;
this.vertexFactory = vertexFactory;
@@ -226,11 +227,11 @@ public class RenderState {
public final PMVMatrix getMatrix() { return pmvMatrix; }
- public static boolean isWeightValid(float v) {
+ public static boolean isWeightValid(final float v) {
return 0.0f <= v && v <= 1.9f ;
}
public final float getWeight() { return weight[0]; }
- public final void setWeight(float v) {
+ public final void setWeight(final float v) {
if( !isWeightValid(v) ) {
throw new IllegalArgumentException("Weight out of range");
}
@@ -238,11 +239,11 @@ public class RenderState {
}
- public final float[] getColorStatic(float[] rgbaColor) {
+ public final float[] getColorStatic(final float[] rgbaColor) {
System.arraycopy(colorStatic, 0, rgbaColor, 0, 4);
return rgbaColor;
}
- public final void setColorStatic(float r, float g, float b, float a){
+ public final void setColorStatic(final float r, final float g, final float b, final float a){
colorStatic[0] = r;
colorStatic[1] = g;
colorStatic[2] = b;
@@ -301,7 +302,7 @@ public class RenderState {
* @param throwOnError TODO
* @return true if no error occured, i.e. all locations found, otherwise false.
*/
- public final boolean updateAttributeLoc(final GL2ES2 gl, final boolean updateLocation, final GLArrayDataServer data, boolean throwOnError) {
+ public final boolean updateAttributeLoc(final GL2ES2 gl, final boolean updateLocation, final GLArrayDataServer data, final boolean throwOnError) {
if( updateLocation || 0 > data.getLocation() ) {
final boolean ok = 0 <= data.setLocation(gl, sp.program());
if( throwOnError && !ok ) {
@@ -314,29 +315,29 @@ public class RenderState {
}
- public final boolean isHintMaskSet(int mask) {
+ public final boolean isHintMaskSet(final int mask) {
return mask == ( hintBitfield & mask );
}
- public final void setHintMask(int mask) {
+ public final void setHintMask(final int mask) {
hintBitfield |= mask;
}
- public final void clearHintMask(int mask) {
+ public final void clearHintMask(final int mask) {
hintBitfield &= ~mask;
}
- public void destroy(GL2ES2 gl) {
+ public void destroy(final GL2ES2 gl) {
if( null != sp ) {
sp.destroy(gl);
sp = null;
}
}
- public final RenderState attachTo(GL2ES2 gl) {
+ public final RenderState attachTo(final GL2ES2 gl) {
return (RenderState) gl.getContext().attachObject(thisKey, this);
}
- public final boolean detachFrom(GL2ES2 gl) {
- RenderState _rs = (RenderState) gl.getContext().getAttachedObject(thisKey);
+ public final boolean detachFrom(final GL2ES2 gl) {
+ final RenderState _rs = (RenderState) gl.getContext().getAttachedObject(thisKey);
if(_rs == this) {
gl.getContext().detachObject(thisKey);
return true;
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
index aadbecc91..0fa1f49f1 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
@@ -88,7 +88,7 @@ public class TextRegionUtil {
*/
public static void processString(final ShapeVisitor visitor, final AffineTransform transform,
final Font font, final float pixelSize, final CharSequence str,
- final AffineTransform temp1, AffineTransform temp2) {
+ final AffineTransform temp1, final AffineTransform temp2) {
final int charCount = str.length();
// region.setFlipped(true);
@@ -248,7 +248,7 @@ public class TextRegionUtil {
/**
* Clear all cached {@link GLRegions}.
*/
- public void clear(GL2ES2 gl) {
+ public void clear(final GL2ES2 gl) {
// fluchCache(gl) already called
final Iterator<GLRegion> iterator = stringCacheMap.values().iterator();
while(iterator.hasNext()){
@@ -269,7 +269,7 @@ public class TextRegionUtil {
*
* @see #DEFAULT_CACHE_LIMIT
*/
- public final void setCacheLimit(int newLimit ) { stringCacheLimit = newLimit; }
+ public final void setCacheLimit(final int newLimit ) { stringCacheLimit = newLimit; }
/**
* Sets the cache limit, see {@link #setCacheLimit(int)} and validates the cache.
@@ -279,7 +279,7 @@ public class TextRegionUtil {
* @param gl current GL used to remove cached objects if required
* @param newLimit new cache size
*/
- public final void setCacheLimit(GL2ES2 gl, int newLimit ) { stringCacheLimit = newLimit; validateCache(gl, 0); }
+ public final void setCacheLimit(final GL2ES2 gl, final int newLimit ) { stringCacheLimit = newLimit; validateCache(gl, 0); }
/**
* @return the current cache limit
@@ -291,7 +291,7 @@ public class TextRegionUtil {
*/
public final int getCacheSize() { return stringCacheArray.size(); }
- protected final void validateCache(GL2ES2 gl, int space) {
+ protected final void validateCache(final GL2ES2 gl, final int space) {
if ( getCacheLimit() > 0 ) {
while ( getCacheSize() + space > getCacheLimit() ) {
removeCachedRegion(gl, 0);
@@ -299,11 +299,11 @@ public class TextRegionUtil {
}
}
- protected final GLRegion getCachedRegion(Font font, CharSequence str, float pixelSize, int special) {
+ protected final GLRegion getCachedRegion(final Font font, final CharSequence str, final float pixelSize, final int special) {
return stringCacheMap.get(getKey(font, str, pixelSize, special));
}
- protected final void addCachedRegion(GL2ES2 gl, Font font, CharSequence str, float pixelSize, int special, GLRegion glyphString) {
+ protected final void addCachedRegion(final GL2ES2 gl, final Font font, final CharSequence str, final float pixelSize, final int special, final GLRegion glyphString) {
if ( 0 != getCacheLimit() ) {
final String key = getKey(font, str, pixelSize, special);
final GLRegion oldRegion = stringCacheMap.put(key, glyphString);
@@ -315,7 +315,7 @@ public class TextRegionUtil {
}
}
- protected final void removeCachedRegion(GL2ES2 gl, Font font, CharSequence str, int pixelSize, int special) {
+ protected final void removeCachedRegion(final GL2ES2 gl, final Font font, final CharSequence str, final int pixelSize, final int special) {
final String key = getKey(font, str, pixelSize, special);
final GLRegion region = stringCacheMap.remove(key);
if(null != region) {
@@ -324,7 +324,7 @@ public class TextRegionUtil {
stringCacheArray.remove(key);
}
- protected final void removeCachedRegion(GL2ES2 gl, int idx) {
+ protected final void removeCachedRegion(final GL2ES2 gl, final int idx) {
final String key = stringCacheArray.remove(idx);
if( null != key ) {
final GLRegion region = stringCacheMap.remove(key);
@@ -334,7 +334,7 @@ public class TextRegionUtil {
}
}
- protected final String getKey(Font font, CharSequence str, float pixelSize, int special) {
+ protected final String getKey(final Font font, final CharSequence str, final float pixelSize, final int special) {
final StringBuilder sb = new StringBuilder();
return font.getName(sb, Font.NAME_UNIQUNAME)
.append(".").append(str.hashCode()).append(".").append(Float.floatToIntBits(pixelSize)).append(special).toString();
diff --git a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
index 948600a4a..db775e8dc 100644
--- a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
+++ b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
@@ -78,7 +78,7 @@ public class FontFactory {
return get(UBUNTU);
}
- public static final FontSet get(int font) {
+ public static final FontSet get(final int font) {
switch (font) {
case JAVA:
return JavaFontLoader.get();
@@ -87,7 +87,7 @@ public class FontFactory {
}
}
- public static final Font get(File file) throws IOException {
+ public static final Font get(final File file) throws IOException {
return fontConstr.create(file);
}
@@ -101,7 +101,7 @@ public class FontFactory {
try {
final URI uri = TempJarCache.getResource(fname);
conn = null != uri ? uri.toURL().openConnection() : null;
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new IOException(e);
}
} else {
@@ -113,7 +113,7 @@ public class FontFactory {
return null;
}
- public static boolean isPrintableChar( char c ) {
+ public static boolean isPrintableChar( final char c ) {
if( Character.isWhitespace(c) ) {
return true;
}
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Outline.java b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
index 15a45b056..ea2059165 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Outline.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
@@ -87,7 +87,7 @@ public class Outline implements Comparable<Outline> {
* @param vertex Vertex to be added
* @throws NullPointerException if the {@link Vertex} element is null
*/
- public final void addVertex(Vertex vertex) throws NullPointerException {
+ public final void addVertex(final Vertex vertex) throws NullPointerException {
addVertex(vertices.size(), vertex);
}
@@ -98,7 +98,7 @@ public class Outline implements Comparable<Outline> {
* @throws NullPointerException if the {@link Vertex} element is null
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getVertexNumber())
*/
- public final void addVertex(int position, Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
+ public final void addVertex(final int position, final Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
if (null == vertex) {
throw new NullPointerException("vertex is null");
}
@@ -116,7 +116,7 @@ public class Outline implements Comparable<Outline> {
* @throws NullPointerException if the {@link Outline} element is null
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getVertexNumber())
*/
- public final void setVertex(int position, Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
+ public final void setVertex(final int position, final Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
if (null == vertex) {
throw new NullPointerException("vertex is null");
}
@@ -124,11 +124,11 @@ public class Outline implements Comparable<Outline> {
dirtyBBox = true;
}
- public final Vertex getVertex(int index){
+ public final Vertex getVertex(final int index){
return vertices.get(index);
}
- public int getVertexIndex(Vertex vertex){
+ public int getVertexIndex(final Vertex vertex){
return vertices.indexOf(vertex);
}
@@ -138,7 +138,7 @@ public class Outline implements Comparable<Outline> {
* @param position of the to be removed Vertex
* @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getVertexNumber())
*/
- public final Vertex removeVertex(int position) throws IndexOutOfBoundsException {
+ public final Vertex removeVertex(final int position) throws IndexOutOfBoundsException {
dirtyBBox = true;
return vertices.remove(position);
}
@@ -164,7 +164,7 @@ public class Outline implements Comparable<Outline> {
*
* @param vertices the new outline loop/strip
*/
- public final void setVertices(ArrayList<Vertex> vertices) {
+ public final void setVertices(final ArrayList<Vertex> vertices) {
this.vertices = vertices;
validateBoundingBox();
}
@@ -184,7 +184,7 @@ public class Outline implements Comparable<Outline> {
* otherwise a clone of the last vertex will be prepended.
* @return true if closing performed, otherwise false for NOP
*/
- public final boolean setClosed(boolean closeTail) {
+ public final boolean setClosed(final boolean closeTail) {
this.closed = true;
if( !isEmpty() ) {
final Vertex first = vertices.get(0);
@@ -253,7 +253,7 @@ public class Outline implements Comparable<Outline> {
* @return true if {@code obj} is an Outline, not null, equals bounds and equal vertices in the same order
*/
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if( obj == this) {
return true;
}
diff --git a/src/jogl/classes/com/jogamp/graph/geom/SVertex.java b/src/jogl/classes/com/jogamp/graph/geom/SVertex.java
index 579f92455..8df8fbb31 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/SVertex.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/SVertex.java
@@ -65,7 +65,7 @@ public class SVertex implements Vertex {
}
@Override
- public SVertex create(float[] coordsBuffer, int offset, int length, boolean onCurve) {
+ public SVertex create(final float[] coordsBuffer, final int offset, final int length, final boolean onCurve) {
return new SVertex(coordsBuffer, offset, length, onCurve);
}
}
@@ -100,14 +100,14 @@ public class SVertex implements Vertex {
}
@Override
- public final void setCoord(float x, float y, float z) {
+ public final void setCoord(final float x, final float y, final float z) {
coord[0] = x;
coord[1] = y;
coord[2] = z;
}
@Override
- public final void setCoord(float[] coordsBuffer, int offset, int length) {
+ public final void setCoord(final float[] coordsBuffer, final int offset, final int length) {
System.arraycopy(coordsBuffer, offset, coord, 0, length);
}
@@ -122,17 +122,17 @@ public class SVertex implements Vertex {
}
@Override
- public final void setX(float x) {
+ public final void setX(final float x) {
this.coord[0] = x;
}
@Override
- public final void setY(float y) {
+ public final void setY(final float y) {
this.coord[1] = y;
}
@Override
- public final void setZ(float z) {
+ public final void setZ(final float z) {
this.coord[2] = z;
}
@@ -157,7 +157,7 @@ public class SVertex implements Vertex {
}
@Override
- public final void setOnCurve(boolean onCurve) {
+ public final void setOnCurve(final boolean onCurve) {
this.onCurve = onCurve;
}
@@ -167,12 +167,12 @@ public class SVertex implements Vertex {
}
@Override
- public final void setId(int id){
+ public final void setId(final int id){
this.id = id;
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if( obj == this) {
return true;
}
@@ -192,14 +192,14 @@ public class SVertex implements Vertex {
}
@Override
- public final void setTexCoord(float s, float t, float p) {
+ public final void setTexCoord(final float s, final float t, final float p) {
texCoord[0] = s;
texCoord[1] = t;
texCoord[2] = p;
}
@Override
- public final void setTexCoord(float[] texCoordsBuffer, int offset, int length) {
+ public final void setTexCoord(final float[] texCoordsBuffer, final int offset, final int length) {
System.arraycopy(texCoordsBuffer, offset, texCoord, 0, length);
}
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
index 33e53f3ed..fc345f2a7 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
@@ -93,7 +93,7 @@ public class Triangle {
return id;
}
- public void setId(int id) {
+ public void setId(final int id) {
this.id = id;
}
@@ -118,7 +118,7 @@ public class Triangle {
return boundaryVertices;
}
- public void setVerticesBoundary(boolean[] boundaryVertices) {
+ public void setVerticesBoundary(final boolean[] boundaryVertices) {
this.boundaryVertices = boundaryVertices;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/FBObject.java b/src/jogl/classes/com/jogamp/opengl/FBObject.java
index a9b54097f..e765d2d52 100644
--- a/src/jogl/classes/com/jogamp/opengl/FBObject.java
+++ b/src/jogl/classes/com/jogamp/opengl/FBObject.java
@@ -101,7 +101,7 @@ public class FBObject {
* Returns {@link #COLOR}, {@link #DEPTH}, {@link #STENCIL} or {@link #DEPTH_STENCIL}
* @throws IllegalArgumentException if <code>format</code> cannot be handled.
*/
- public static Type determine(int format) throws IllegalArgumentException {
+ public static Type determine(final int format) throws IllegalArgumentException {
switch(format) {
case GL.GL_RGBA4:
case GL.GL_RGB5_A1:
@@ -135,7 +135,7 @@ public class FBObject {
private int name;
- protected Attachment(Type type, int iFormat, int width, int height, int name) {
+ protected Attachment(final Type type, final int iFormat, final int width, final int height, final int name) {
this.type = type;
this.format = iFormat;
this.width = width;
@@ -148,7 +148,7 @@ public class FBObject {
* @param caps the destination for format bits
* @param rgba8Avail whether rgba8 is available
*/
- public final void formatToGLCapabilities(GLCapabilities caps, boolean rgba8Avail) {
+ public final void formatToGLCapabilities(final GLCapabilities caps, final boolean rgba8Avail) {
final int _format;
switch(format) {
case GL.GL_RGBA:
@@ -224,11 +224,11 @@ public class FBObject {
public final int getWidth() { return width; }
/** height of attachment */
public final int getHeight() { return height; }
- /* pp */ final void setSize(int w, int h) { width = w; height = h; }
+ /* pp */ final void setSize(final int w, final int h) { width = w; height = h; }
/** buffer name [1..max], maybe a texture or renderbuffer name, depending on type. */
public final int getName() { return name; }
- /* pp */ final void setName(int n) { name = n; }
+ /* pp */ final void setName(final int n) { name = n; }
/**
* Initializes the attachment and set it's parameter, if uninitialized, i.e. name is <code>zero</code>.
@@ -263,7 +263,7 @@ public class FBObject {
* {@inheritDoc}
*/
@Override
- public boolean equals(Object o) {
+ public boolean equals(final Object o) {
if( this == o ) return true;
if( ! ( o instanceof Attachment ) ) return false;
final Attachment a = (Attachment)o;
@@ -299,7 +299,7 @@ public class FBObject {
"; name "+toHexString(name)+", obj "+toHexString(objectHashCode())+"]";
}
- public static Type getType(int attachmentPoint, int maxColorAttachments) {
+ public static Type getType(final int attachmentPoint, final int maxColorAttachments) {
if( GL.GL_COLOR_ATTACHMENT0 <= attachmentPoint && attachmentPoint < GL.GL_COLOR_ATTACHMENT0+maxColorAttachments ) {
return Type.COLOR;
}
@@ -326,16 +326,16 @@ public class FBObject {
* @param height
* @param name
*/
- public RenderAttachment(Type type, int iFormat, int samples, int width, int height, int name) {
+ public RenderAttachment(final Type type, final int iFormat, final int samples, final int width, final int height, final int name) {
super(validateType(type), iFormat, width, height, name);
this.samples = samples;
}
/** number of samples, or zero for no multisampling */
public final int getSamples() { return samples; }
- /* pp */ final void setSamples(int s) { samples = s; }
+ /* pp */ final void setSamples(final int s) { samples = s; }
- private static Type validateType(Type type) {
+ private static Type validateType(final Type type) {
switch(type) {
case DEPTH_STENCIL:
case DEPTH:
@@ -354,7 +354,7 @@ public class FBObject {
* {@inheritDoc}
*/
@Override
- public boolean equals(Object o) {
+ public boolean equals(final Object o) {
if( this == o ) return true;
if( ! ( o instanceof RenderAttachment ) ) return false;
return super.equals(o) &&
@@ -376,7 +376,7 @@ public class FBObject {
}
@Override
- public boolean initialize(GL gl) throws GLException {
+ public boolean initialize(final GL gl) throws GLException {
final boolean init = 0 == getName();
if( init ) {
checkPreGLError(gl);
@@ -405,7 +405,7 @@ public class FBObject {
}
@Override
- public void free(GL gl) {
+ public void free(final GL gl) {
final int[] name = new int[] { getName() };
if( 0 != name[0] ) {
if(DEBUG) {
@@ -425,7 +425,7 @@ public class FBObject {
/** Color render buffer attachment */
public static class ColorAttachment extends RenderAttachment implements Colorbuffer {
- public ColorAttachment(int iFormat, int samples, int width, int height, int name) {
+ public ColorAttachment(final int iFormat, final int samples, final int width, final int height, final int name) {
super(Type.COLOR, iFormat, samples, width, height, name);
}
}
@@ -448,8 +448,8 @@ public class FBObject {
* @param wrapT
* @param name
*/
- public TextureAttachment(Type type, int iFormat, int width, int height, int dataFormat, int dataType,
- int magFilter, int minFilter, int wrapS, int wrapT, int name) {
+ public TextureAttachment(final Type type, final int iFormat, final int width, final int height, final int dataFormat, final int dataType,
+ final int magFilter, final int minFilter, final int wrapS, final int wrapT, final int name) {
super(validateType(type), iFormat, width, height, name);
this.dataFormat = dataFormat;
this.dataType = dataType;
@@ -459,7 +459,7 @@ public class FBObject {
this.wrapT = wrapT;
}
- private static Type validateType(Type type) {
+ private static Type validateType(final Type type) {
switch(type) {
case COLOR_TEXTURE:
case DEPTH_TEXTURE:
@@ -475,7 +475,7 @@ public class FBObject {
* @throws GLException if texture generation and setup fails. The just created texture name will be deleted in this case.
*/
@Override
- public boolean initialize(GL gl) throws GLException {
+ public boolean initialize(final GL gl) throws GLException {
final boolean init = 0 == getName();
if( init ) {
checkPreGLError(gl);
@@ -520,7 +520,7 @@ public class FBObject {
}
@Override
- public void free(GL gl) {
+ public void free(final GL gl) {
final int[] name = new int[] { getName() };
if( 0 != name[0] ) {
if(DEBUG) {
@@ -540,7 +540,7 @@ public class FBObject {
"; name "+toHexString(getName())+", obj "+toHexString(objectHashCode())+"]";
}
}
- static String toHexString(int v) {
+ static String toHexString(final int v) {
return "0x"+Integer.toHexString(v);
}
@@ -556,7 +556,7 @@ public class FBObject {
* @param height texture height
* @return the created and uninitialized color {@link TextureAttachment}
*/
- public static final TextureAttachment createColorTextureAttachment(GL gl, boolean alpha, int width, int height) {
+ public static final TextureAttachment createColorTextureAttachment(final GL gl, final boolean alpha, final int width, final int height) {
return createColorTextureAttachment(gl, alpha, width, height, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
}
@@ -605,8 +605,8 @@ public class FBObject {
* @param wrapT if > 0 value for {@link GL#GL_TEXTURE_WRAP_T}
* @return the created and uninitialized color {@link TextureAttachment}
*/
- public static final TextureAttachment createColorTextureAttachment(GL gl, boolean alpha, int width, int height,
- int magFilter, int minFilter, int wrapS, int wrapT) {
+ public static final TextureAttachment createColorTextureAttachment(final GL gl, final boolean alpha, final int width, final int height,
+ final int magFilter, final int minFilter, final int wrapS, final int wrapT) {
final int textureInternalFormat, textureDataFormat, textureDataType;
if(gl.isGLES3()) {
textureInternalFormat = alpha ? GL.GL_RGBA8 : GL.GL_RGB8;
@@ -640,13 +640,13 @@ public class FBObject {
* @param wrapT if > 0 value for {@link GL#GL_TEXTURE_WRAP_T}
* @return the created and uninitialized color {@link TextureAttachment}
*/
- public static final TextureAttachment createColorTextureAttachment(int internalFormat, int width, int height, int dataFormat, int dataType,
- int magFilter, int minFilter, int wrapS, int wrapT) {
+ public static final TextureAttachment createColorTextureAttachment(final int internalFormat, final int width, final int height, final int dataFormat, final int dataType,
+ final int magFilter, final int minFilter, final int wrapS, final int wrapT) {
return new TextureAttachment(Type.COLOR_TEXTURE, internalFormat, width, height, dataFormat, dataType,
magFilter, minFilter, wrapS, wrapT, 0 /* name */);
}
- private static boolean hasAlpha(int format) {
+ private static boolean hasAlpha(final int format) {
switch(format) {
case GL.GL_RGBA8:
case GL.GL_RGBA4:
@@ -689,7 +689,7 @@ public class FBObject {
// ColorAttachment helper ..
//
- private final void validateColorAttachmentPointRange(int point) {
+ private final void validateColorAttachmentPointRange(final int point) {
if(!initialized) {
throw new GLException("FBO not initialized");
}
@@ -701,14 +701,14 @@ public class FBObject {
}
}
- private final void validateAddColorAttachment(int point, Colorbuffer ca) {
+ private final void validateAddColorAttachment(final int point, final Colorbuffer ca) {
validateColorAttachmentPointRange(point);
if( null != colorAttachmentPoints[point] ) {
throw new IllegalArgumentException("Cannot attach "+ca+", attachment point already in use by "+colorAttachmentPoints[point]+", "+this);
}
}
- private final void addColorAttachment(int point, Colorbuffer ca) {
+ private final void addColorAttachment(final int point, final Colorbuffer ca) {
validateColorAttachmentPointRange(point);
final Colorbuffer c = colorAttachmentPoints[point];
if( null != c && c != ca ) {
@@ -718,7 +718,7 @@ public class FBObject {
colorAttachmentCount++;
}
- private final void removeColorAttachment(int point, Colorbuffer ca) {
+ private final void removeColorAttachment(final int point, final Colorbuffer ca) {
validateColorAttachmentPointRange(point);
final Colorbuffer c = colorAttachmentPoints[point];
if( null != c && c != ca ) {
@@ -736,7 +736,7 @@ public class FBObject {
* @see #attachTexture2D(GL, int, boolean, int, int, int, int)
* @see #attachTexture2D(GL, int, int, int, int, int, int, int, int)
*/
- public final Colorbuffer getColorbuffer(int attachmentPoint) {
+ public final Colorbuffer getColorbuffer(final int attachmentPoint) {
validateColorAttachmentPointRange(attachmentPoint);
return colorAttachmentPoints[attachmentPoint];
}
@@ -750,7 +750,7 @@ public class FBObject {
* @param ca the {@link Colorbuffer} to look for.
* @return -1 if the {@link Colorbuffer} could not be found, otherwise [0..{@link #getMaxColorAttachments()}-1]
*/
- public final int getColorbufferAttachmentPoint(Colorbuffer ca) {
+ public final int getColorbufferAttachmentPoint(final Colorbuffer ca) {
for(int i=0; i<colorAttachmentPoints.length; i++) {
if( colorAttachmentPoints[i] == ca ) {
return i;
@@ -773,7 +773,7 @@ public class FBObject {
* @see #attachTexture2D(GL, int, boolean, int, int, int, int)
* @see #attachTexture2D(GL, int, int, int, int, int, int, int, int)
*/
- public final Colorbuffer getColorbuffer(Colorbuffer ca) {
+ public final Colorbuffer getColorbuffer(final Colorbuffer ca) {
final int p = getColorbufferAttachmentPoint(ca);
return p>=0 ? getColorbuffer(p) : null;
}
@@ -840,7 +840,7 @@ public class FBObject {
this.samplingSinkDirty = true;
}
- private void init(GL gl, int width, int height, int samples) throws GLException {
+ private void init(final GL gl, int width, int height, final int samples) throws GLException {
if(initialized) {
throw new GLException("FBO already initialized");
}
@@ -863,7 +863,7 @@ public class FBObject {
final boolean NV_fbo_color_attachments = gl.isExtensionAvailable(GLExtensions.NV_fbo_color_attachments);
- int val[] = new int[1];
+ final int val[] = new int[1];
checkPreGLError(gl);
@@ -874,7 +874,7 @@ public class FBObject {
val[0] = 0;
gl.glGetIntegerv(GL2ES2.GL_MAX_COLOR_ATTACHMENTS, val, 0);
realMaxColorAttachments = 1 <= val[0] ? val[0] : 1; // cap minimum to 1
- } catch (GLException gle) { gle.printStackTrace(); }
+ } catch (final GLException gle) { gle.printStackTrace(); }
}
maxColorAttachments = realMaxColorAttachments <= 8 ? realMaxColorAttachments : 8; // cap to limit array size
@@ -967,7 +967,7 @@ public class FBObject {
* @param newHeight
* @throws GLException in case of an error
*/
- public final void reset(GL gl, int newWidth, int newHeight) {
+ public final void reset(final GL gl, final int newWidth, final int newHeight) {
reset(gl, newWidth, newHeight, 0, false);
}
@@ -996,7 +996,7 @@ public class FBObject {
*
* @throws GLException in case of an error, i.e. size too big, etc ..
*/
- public final void reset(GL gl, int newWidth, int newHeight, int newSamples, boolean resetSamplingSink) {
+ public final void reset(final GL gl, int newWidth, int newHeight, int newSamples, final boolean resetSamplingSink) {
if( !initialized ) {
init(gl, newWidth, newHeight, newSamples);
return;
@@ -1048,7 +1048,7 @@ public class FBObject {
* Writes the internal format of the attachments to the given GLCapabilities object.
* @param caps the destination for format bits
*/
- public final void formatToGLCapabilities(GLCapabilities caps) {
+ public final void formatToGLCapabilities(final GLCapabilities caps) {
caps.setSampleBuffers(samples > 0);
caps.setNumSamples(samples);
caps.setDepthBits(0);
@@ -1080,7 +1080,7 @@ public class FBObject {
return getStatusString(vStatus);
}
- public static final String getStatusString(int fbStatus) {
+ public static final String getStatusString(final int fbStatus) {
switch(fbStatus) {
case -1:
return "NOT A FBO";
@@ -1132,7 +1132,7 @@ public class FBObject {
case GL.GL_FRAMEBUFFER_INCOMPLETE_FORMATS:
case GL2GL3.GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
case GL2GL3.GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
- case GL2GL3.GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
+ case GL2ES3.GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
case GL3.GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
if(0 == colorAttachmentCount || null == depth) {
// we are in transition
@@ -1152,8 +1152,8 @@ public class FBObject {
}
}
- private static int checkPreGLError(GL gl) {
- int glerr = gl.glGetError();
+ private static int checkPreGLError(final GL gl) {
+ final int glerr = gl.glGetError();
if(DEBUG && GL.GL_NO_ERROR != glerr) {
System.err.println("Pre-existing GL error: "+toHexString(glerr));
Thread.dumpStack();
@@ -1161,7 +1161,7 @@ public class FBObject {
return glerr;
}
- private final boolean checkNoError(GL gl, int err, String exceptionMessage) throws GLException {
+ private final boolean checkNoError(final GL gl, final int err, final String exceptionMessage) throws GLException {
if(GL.GL_NO_ERROR != err) {
if(null != gl) {
destroy(gl);
@@ -1195,7 +1195,7 @@ public class FBObject {
* @throws GLException in case the texture colorbuffer couldn't be allocated or MSAA has been chosen
* @see #createColorTextureAttachment(GLProfile, boolean, int, int)
*/
- public final TextureAttachment attachTexture2D(GL gl, int attachmentPoint, boolean alpha) throws GLException {
+ public final TextureAttachment attachTexture2D(final GL gl, final int attachmentPoint, final boolean alpha) throws GLException {
return (TextureAttachment)attachColorbuffer(gl, attachmentPoint,
createColorTextureAttachment(gl, alpha, width, height));
}
@@ -1217,7 +1217,7 @@ public class FBObject {
* @throws GLException in case the texture colorbuffer couldn't be allocated or MSAA has been chosen
* @see #createColorTextureAttachment(GLProfile, boolean, int, int, int, int, int, int)
*/
- public final TextureAttachment attachTexture2D(GL gl, int attachmentPoint, boolean alpha, int magFilter, int minFilter, int wrapS, int wrapT) throws GLException {
+ public final TextureAttachment attachTexture2D(final GL gl, final int attachmentPoint, final boolean alpha, final int magFilter, final int minFilter, final int wrapS, final int wrapT) throws GLException {
return (TextureAttachment)attachColorbuffer(gl, attachmentPoint,
createColorTextureAttachment(gl, alpha, width, height, magFilter, minFilter, wrapS, wrapT));
}
@@ -1240,9 +1240,9 @@ public class FBObject {
* @throws GLException in case the texture colorbuffer couldn't be allocated or MSAA has been chosen
* @see #createColorTextureAttachment(int, int, int, int, int, int, int, int, int)
*/
- public final TextureAttachment attachTexture2D(GL gl, int attachmentPoint,
- int internalFormat, int dataFormat, int dataType,
- int magFilter, int minFilter, int wrapS, int wrapT) throws GLException {
+ public final TextureAttachment attachTexture2D(final GL gl, final int attachmentPoint,
+ final int internalFormat, final int dataFormat, final int dataType,
+ final int magFilter, final int minFilter, final int wrapS, final int wrapT) throws GLException {
return (TextureAttachment)attachColorbuffer(gl, attachmentPoint,
createColorTextureAttachment(internalFormat, width, height, dataFormat, dataType, magFilter, minFilter, wrapS, wrapT));
}
@@ -1258,7 +1258,7 @@ public class FBObject {
* @param alpha set to <code>true</code> if you request alpha channel, otherwise <code>false</code>;
* @return uninitialized ColorAttachment instance describing the new attached colorbuffer
*/
- public final ColorAttachment createColorAttachment(boolean alpha) {
+ public final ColorAttachment createColorAttachment(final boolean alpha) {
final int internalFormat;
if( rgba8Avail ) {
@@ -1282,7 +1282,7 @@ public class FBObject {
* @throws GLException in case the colorbuffer couldn't be allocated
* @see #createColorAttachment(boolean)
*/
- public final ColorAttachment attachColorbuffer(GL gl, int attachmentPoint, boolean alpha) throws GLException {
+ public final ColorAttachment attachColorbuffer(final GL gl, final int attachmentPoint, final boolean alpha) throws GLException {
return (ColorAttachment) attachColorbuffer(gl, attachmentPoint, createColorAttachment(alpha));
}
@@ -1298,7 +1298,7 @@ public class FBObject {
* @throws GLException in case the colorbuffer couldn't be allocated
* @throws IllegalArgumentException if <code>internalFormat</code> doesn't reflect a colorbuffer
*/
- public final ColorAttachment attachColorbuffer(GL gl, int attachmentPoint, int internalFormat) throws GLException, IllegalArgumentException {
+ public final ColorAttachment attachColorbuffer(final GL gl, final int attachmentPoint, final int internalFormat) throws GLException, IllegalArgumentException {
final Attachment.Type atype = Attachment.Type.determine(internalFormat);
if( Attachment.Type.COLOR != atype ) {
throw new IllegalArgumentException("colorformat invalid: "+toHexString(internalFormat)+", "+this);
@@ -1326,12 +1326,12 @@ public class FBObject {
* @return newly attached {@link Colorbuffer} instance if bound and configured successfully, otherwise GLException is thrown
* @throws GLException in case the colorbuffer couldn't be allocated or MSAA has been chosen in case of a {@link TextureAttachment}
*/
- public final Colorbuffer attachColorbuffer(GL gl, int attachmentPoint, Colorbuffer colbuf) throws GLException {
+ public final Colorbuffer attachColorbuffer(final GL gl, final int attachmentPoint, final Colorbuffer colbuf) throws GLException {
bind(gl);
return attachColorbufferImpl(gl, attachmentPoint, colbuf);
}
- private final Colorbuffer attachColorbufferImpl(GL gl, int attachmentPoint, Colorbuffer colbuf) throws GLException {
+ private final Colorbuffer attachColorbufferImpl(final GL gl, final int attachmentPoint, final Colorbuffer colbuf) throws GLException {
validateAddColorAttachment(attachmentPoint, colbuf);
final boolean initializedColorbuf = colbuf.initialize(gl);
@@ -1407,7 +1407,7 @@ public class FBObject {
* @see #getDepthAttachment()
* @see #getStencilAttachment()
*/
- public final void attachRenderbuffer(GL gl, Attachment.Type atype, int reqBits) throws GLException, IllegalArgumentException {
+ public final void attachRenderbuffer(final GL gl, final Attachment.Type atype, int reqBits) throws GLException, IllegalArgumentException {
if( 0 > reqBits ) {
reqBits = 24;
}
@@ -1493,7 +1493,7 @@ public class FBObject {
* @see #getDepthAttachment()
* @see #getStencilAttachment()
*/
- public final void attachRenderbuffer(GL gl, int internalFormat) throws GLException, IllegalArgumentException {
+ public final void attachRenderbuffer(final GL gl, final int internalFormat) throws GLException, IllegalArgumentException {
final Attachment.Type atype = Attachment.Type.determine(internalFormat);
if( Attachment.Type.DEPTH != atype && Attachment.Type.STENCIL != atype && Attachment.Type.DEPTH_STENCIL != atype ) {
throw new IllegalArgumentException("renderformat invalid: "+toHexString(internalFormat)+", "+this);
@@ -1501,7 +1501,7 @@ public class FBObject {
attachRenderbufferImpl(gl, atype, internalFormat);
}
- protected final void attachRenderbufferImpl(GL gl, Attachment.Type atype, int internalFormat) throws GLException {
+ protected final void attachRenderbufferImpl(final GL gl, final Attachment.Type atype, final int internalFormat) throws GLException {
if( null != depth && ( Attachment.Type.DEPTH == atype || Attachment.Type.DEPTH_STENCIL == atype ) ) {
throw new GLException("FBO depth buffer already attached (rb "+depth+"), type is "+atype+", "+toHexString(internalFormat)+", "+this);
}
@@ -1513,7 +1513,7 @@ public class FBObject {
attachRenderbufferImpl2(gl, atype, internalFormat);
}
- private final void attachRenderbufferImpl2(GL gl, Attachment.Type atype, int internalFormat) throws GLException {
+ private final void attachRenderbufferImpl2(final GL gl, final Attachment.Type atype, final int internalFormat) throws GLException {
if( Attachment.Type.DEPTH == atype ) {
if(null == depth) {
depth = new RenderAttachment(Type.DEPTH, internalFormat, samples, width, height, 0);
@@ -1578,7 +1578,7 @@ public class FBObject {
* @return the detached Colorbuffer
* @throws IllegalArgumentException
*/
- public final Colorbuffer detachColorbuffer(GL gl, int attachmentPoint, boolean dispose) throws IllegalArgumentException {
+ public final Colorbuffer detachColorbuffer(final GL gl, final int attachmentPoint, final boolean dispose) throws IllegalArgumentException {
bind(gl);
final Colorbuffer res = detachColorbufferImpl(gl, attachmentPoint, dispose ? DetachAction.DISPOSE : DetachAction.NONE);
@@ -1591,7 +1591,7 @@ public class FBObject {
return res;
}
- private final Colorbuffer detachColorbufferImpl(GL gl, int attachmentPoint, DetachAction detachAction) {
+ private final Colorbuffer detachColorbufferImpl(final GL gl, final int attachmentPoint, final DetachAction detachAction) {
Colorbuffer colbuf = colorAttachmentPoints[attachmentPoint]; // shortcut, don't validate here
if(null == colbuf) {
@@ -1661,7 +1661,7 @@ public class FBObject {
return colbuf;
}
- private final void freeAllColorbufferImpl(GL gl) {
+ private final void freeAllColorbufferImpl(final GL gl) {
for(int i=0; i<maxColorAttachments; i++) {
final Colorbuffer colbuf = colorAttachmentPoints[i]; // shortcut, don't validate here
@@ -1696,7 +1696,7 @@ public class FBObject {
* @param dispose true if the Colorbuffer shall be disposed
* @param reqAType {@link Type#DEPTH}, {@link Type#DEPTH} or {@link Type#DEPTH_STENCIL}
*/
- public final void detachRenderbuffer(GL gl, Attachment.Type atype, boolean dispose) throws IllegalArgumentException {
+ public final void detachRenderbuffer(final GL gl, final Attachment.Type atype, final boolean dispose) throws IllegalArgumentException {
bind(gl);
detachRenderbufferImpl(gl, atype, dispose ? DetachAction.DISPOSE : DetachAction.NONE);
if(DEBUG) {
@@ -1718,7 +1718,7 @@ public class FBObject {
return res;
}
- private final void detachRenderbufferImpl(GL gl, Attachment.Type atype, DetachAction detachAction) throws IllegalArgumentException {
+ private final void detachRenderbufferImpl(final GL gl, Attachment.Type atype, final DetachAction detachAction) throws IllegalArgumentException {
switch ( atype ) {
case DEPTH:
case STENCIL:
@@ -1824,7 +1824,7 @@ public class FBObject {
}
}
- private final void freeAllRenderbufferImpl(GL gl) throws IllegalArgumentException {
+ private final void freeAllRenderbufferImpl(final GL gl) throws IllegalArgumentException {
// Note: DEPTH_STENCIL shares buffer w/ depth and stencil
final boolean packed = isDepthStencilPackedFormat();
if( null != depth ) {
@@ -1853,7 +1853,7 @@ public class FBObject {
* </p>
* @param gl the current GL context
*/
- public final void detachAll(GL gl) {
+ public final void detachAll(final GL gl) {
if(null != samplingSink) {
samplingSink.detachAll(gl);
}
@@ -1869,7 +1869,7 @@ public class FBObject {
* </p>
* @param gl the current GL context
*/
- public final void detachAllColorbuffer(GL gl) {
+ public final void detachAllColorbuffer(final GL gl) {
if(null != samplingSink) {
samplingSink.detachAllColorbuffer(gl);
}
@@ -1884,7 +1884,7 @@ public class FBObject {
* </p>
* @param gl the current GL context
*/
- public final void detachAllTexturebuffer(GL gl) {
+ public final void detachAllTexturebuffer(final GL gl) {
if( !isInitialized() ) {
return;
}
@@ -1902,7 +1902,7 @@ public class FBObject {
}
}
- public final void detachAllRenderbuffer(GL gl) {
+ public final void detachAllRenderbuffer(final GL gl) {
if( !isInitialized() ) {
return;
}
@@ -1913,7 +1913,7 @@ public class FBObject {
detachRenderbufferImpl(gl, Attachment.Type.DEPTH_STENCIL, DetachAction.DISPOSE);
}
- private final void detachAllImpl(GL gl, boolean detachNonColorbuffer, boolean recreate) {
+ private final void detachAllImpl(final GL gl, final boolean detachNonColorbuffer, final boolean recreate) {
if( !isInitialized() ) {
return;
}
@@ -1957,7 +1957,7 @@ public class FBObject {
/**
* @param gl the current GL context
*/
- public final void destroy(GL gl) {
+ public final void destroy(final GL gl) {
if(!initialized) {
return;
}
@@ -1976,7 +1976,7 @@ public class FBObject {
final int fb_cache = fbName;
fbName = 0;
- int name[] = new int[1];
+ final int name[] = new int[1];
if(0!=fb_cache) {
name[0] = fb_cache;
gl.glDeleteFramebuffers(1, name, 0);
@@ -2036,7 +2036,7 @@ public class FBObject {
* @param gl the current GL context
* @throws GLException in case of an error, i.e. size too big, etc ..
*/
- public final void resetSamplingSink(GL gl) throws GLException {
+ public final void resetSamplingSink(final GL gl) throws GLException {
if(0 == samples) {
// MSAA off
if(null != samplingSink && samplingSink.initialized) {
@@ -2088,7 +2088,7 @@ public class FBObject {
}
if(null == samplingSinkTexture) {
- boolean hasAlpha = hasAttachmentUsingAlpha();
+ final boolean hasAlpha = hasAttachmentUsingAlpha();
samplingSinkTexture = samplingSink.attachTexture2D(gl, 0, hasAlpha);
} else if( 0 == samplingSinkTexture.getName() ) {
samplingSinkTexture.setSize(width, height);
@@ -2123,7 +2123,7 @@ public class FBObject {
* @return the previous sampling sink or null if none was attached
* @throws GLException if this FBO doesn't use MSAA or the given sink uses MSAA itself
*/
- public FBObject setSamplingSink(FBObject newSamplingSink) throws GLException {
+ public FBObject setSamplingSink(final FBObject newSamplingSink) throws GLException {
final FBObject prev = samplingSink;
if( null == newSamplingSink) {
samplingSink = null;
@@ -2154,7 +2154,7 @@ public class FBObject {
* @param gl the current GL context
* @throws GLException
*/
- public final void bind(GL gl) throws GLException {
+ public final void bind(final GL gl) throws GLException {
if(!bound || fbName != gl.getBoundFramebuffer(GL.GL_FRAMEBUFFER)) {
checkInitialized();
if(samples > 0 && fullFBOSupport) {
@@ -2180,7 +2180,7 @@ public class FBObject {
* @param gl the current GL context
* @throws GLException
*/
- public final void unbind(GL gl) throws GLException {
+ public final void unbind(final GL gl) throws GLException {
if(bound) {
if(fullFBOSupport) {
// default read/draw buffers, may utilize GLContext/GLDrawable override of
@@ -2212,7 +2212,7 @@ public class FBObject {
* </p>
* @param gl the current GL context
*/
- public final boolean isBound(GL gl) {
+ public final boolean isBound(final GL gl) {
bound = bound && fbName != gl.getBoundFramebuffer(GL.GL_FRAMEBUFFER) ;
return bound;
}
@@ -2244,7 +2244,7 @@ public class FBObject {
* @param ta {@link TextureAttachment} to use, prev. attached w/ {@link #attachTexture2D(GL, int, boolean, int, int, int, int) attachTexture2D(..)}
* @throws IllegalArgumentException
*/
- public final void syncSamplingSink(GL gl) {
+ public final void syncSamplingSink(final GL gl) {
markUnbound();
if(samples>0 && samplingSinkDirty) {
samplingSinkDirty = false;
@@ -2279,7 +2279,7 @@ public class FBObject {
* @param ta {@link TextureAttachment} to use, prev. attached w/ {@link #attachTexture2D(GL, int, boolean, int, int, int, int) attachTexture2D(..)}
* @throws IllegalArgumentException
*/
- public final void use(GL gl, TextureAttachment ta) throws IllegalArgumentException {
+ public final void use(final GL gl, final TextureAttachment ta) throws IllegalArgumentException {
if(null == ta) { throw new IllegalArgumentException("Null TextureAttachment, this: "+toString()); }
syncSamplingSink(gl);
gl.glBindTexture(GL.GL_TEXTURE_2D, ta.getName()); // use it ..
@@ -2290,7 +2290,7 @@ public class FBObject {
*
* <p>Leaves the FBO unbound.</p>
*/
- public final void unuse(GL gl) {
+ public final void unuse(final GL gl) {
unbind(gl);
gl.glBindTexture(GL.GL_TEXTURE_2D, 0); // don't use it
}
@@ -2309,7 +2309,7 @@ public class FBObject {
* @param bits 16, 24 or 32 bits
* @throws GLException if {@link #init(GL)} hasn't been called.
*/
- public final boolean supportsDepth(int bits) throws GLException {
+ public final boolean supportsDepth(final int bits) throws GLException {
checkInitialized();
switch(bits) {
case 16: return true;
@@ -2324,7 +2324,7 @@ public class FBObject {
* @param bits 1, 4, 8 or 16 bits
* @throws GLException if {@link #init(GL)} hasn't been called.
*/
- public final boolean supportsStencil(int bits) throws GLException {
+ public final boolean supportsStencil(final int bits) throws GLException {
checkInitialized();
switch(bits) {
case 1: return stencil01Avail;
@@ -2400,7 +2400,7 @@ public class FBObject {
", dirty "+samplingSinkDirty+"], state "+getStatusString()+", obj "+toHexString(objectHashCode())+"]";
}
- private final void updateStatus(GL gl) {
+ private final void updateStatus(final GL gl) {
if( 0 == fbName ) {
vStatus = -1;
} else {
diff --git a/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java b/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java
index e9fe80a91..f9a7ab029 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java
@@ -84,7 +84,7 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
* and no further lifecycle handling is applied.
* @param lock optional custom {@link RecursiveLock}.
*/
- public GLAutoDrawableDelegate(GLDrawable drawable, GLContext context, Object upstreamWidget, boolean ownDevice, RecursiveLock lock) {
+ public GLAutoDrawableDelegate(final GLDrawable drawable, final GLContext context, final Object upstreamWidget, final boolean ownDevice, final RecursiveLock lock) {
super((GLDrawableImpl)drawable, (GLContextImpl)context, ownDevice);
if(null == drawable) {
throw new IllegalArgumentException("null drawable");
@@ -118,7 +118,7 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
* @param newWidth new width in pixel units
* @param newWidth new height in pixel units
*/
- public final void windowResizedOp(int newWidth, int newHeight) {
+ public final void windowResizedOp(final int newWidth, final int newHeight) {
super.defaultWindowResizedOp(newWidth, newHeight);
}
@@ -154,7 +154,7 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
* Set the upstream UI toolkit object.
* @see #getUpstreamWidget()
*/
- public final void setUpstreamWidget(Object newUpstreamWidget) {
+ public final void setUpstreamWidget(final Object newUpstreamWidget) {
upstreamWidget = newUpstreamWidget;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java b/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java
index 299e51532..aa56a8442 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java
@@ -70,9 +70,9 @@ import com.jogamp.nativewindow.MutableGraphicsConfiguration;
public class GLEventListenerState {
private static final boolean DEBUG = Debug.debug("GLDrawable") || Debug.debug("GLEventListenerState");
- private GLEventListenerState(AbstractGraphicsDevice upstreamDevice, boolean proxyOwnsUpstreamDevice, AbstractGraphicsDevice device,
- GLCapabilitiesImmutable caps,
- GLContext context, int count, GLAnimatorControl anim, boolean animStarted) {
+ private GLEventListenerState(final AbstractGraphicsDevice upstreamDevice, final boolean proxyOwnsUpstreamDevice, final AbstractGraphicsDevice device,
+ final GLCapabilitiesImmutable caps,
+ final GLContext context, final int count, final GLAnimatorControl anim, final boolean animStarted) {
this.upstreamDevice = upstreamDevice;
this.proxyOwnsUpstreamDevice = proxyOwnsUpstreamDevice;
this.device = device;
@@ -124,7 +124,7 @@ public class GLEventListenerState {
}
}
- private static AbstractGraphicsDevice cloneDevice(AbstractGraphicsDevice aDevice) {
+ private static AbstractGraphicsDevice cloneDevice(final AbstractGraphicsDevice aDevice) {
return (AbstractGraphicsDevice) aDevice.clone();
}
@@ -148,7 +148,7 @@ public class GLEventListenerState {
*
* @see #moveTo(GLAutoDrawable)
*/
- public static GLEventListenerState moveFrom(GLAutoDrawable a) {
+ public static GLEventListenerState moveFrom(final GLAutoDrawable a) {
final GLAnimatorControl aAnim = a.getAnimator();
final boolean aAnimStarted;
if( null != aAnim ) {
@@ -251,7 +251,7 @@ public class GLEventListenerState {
* @see #moveFrom(GLAutoDrawable)
* @see #isOwner()
*/
- public final void moveTo(GLAutoDrawable a) {
+ public final void moveTo(final GLAutoDrawable a) {
final GLAnimatorControl aAnim = a.getAnimator();
final boolean hasAnimator = null != aAnim;
final boolean aPaused;
@@ -407,7 +407,7 @@ public class GLEventListenerState {
public static GLRunnable setViewport = new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
drawable.getGL().glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
return true;
}
@@ -415,19 +415,19 @@ public class GLEventListenerState {
public static GLRunnable glFinish = new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
drawable.getGL().glFinish();
return true;
}
};
public static class ReshapeGLEventListener implements GLRunnable {
- private GLEventListener listener;
- public ReshapeGLEventListener(GLEventListener listener) {
+ private final GLEventListener listener;
+ public ReshapeGLEventListener(final GLEventListener listener) {
this.listener = listener;
}
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
listener.reshape(drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
return true;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
index 9c9f4e3d6..078b48ec2 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
@@ -336,7 +336,7 @@ public class GLRendererQuirks {
* </p>
* @see #areSameStickyDevice(AbstractGraphicsDevice, AbstractGraphicsDevice)
*/
- public static GLRendererQuirks getStickyDeviceQuirks(AbstractGraphicsDevice device) {
+ public static GLRendererQuirks getStickyDeviceQuirks(final AbstractGraphicsDevice device) {
final String key = device.getUniqueID();
final GLRendererQuirks has = stickyDeviceQuirks.get(key);
final GLRendererQuirks res;
@@ -353,7 +353,7 @@ public class GLRendererQuirks {
* Returns true if both devices have the same {@link AbstractGraphicsDevice#getUniqueID()},
* otherwise false.
*/
- public static boolean areSameStickyDevice(AbstractGraphicsDevice device1, AbstractGraphicsDevice device2) {
+ public static boolean areSameStickyDevice(final AbstractGraphicsDevice device1, final AbstractGraphicsDevice device2) {
return device1.getUniqueID() == device2.getUniqueID();
}
@@ -364,7 +364,7 @@ public class GLRendererQuirks {
* </p>
* @see #getStickyDeviceQuirks(AbstractGraphicsDevice)
*/
- public static void addStickyDeviceQuirks(AbstractGraphicsDevice device, int[] quirks, int offset, int len) throws IllegalArgumentException {
+ public static void addStickyDeviceQuirks(final AbstractGraphicsDevice device, final int[] quirks, final int offset, final int len) throws IllegalArgumentException {
final GLRendererQuirks sq = getStickyDeviceQuirks(device);
sq.addQuirks(quirks, offset, len);
}
@@ -375,7 +375,7 @@ public class GLRendererQuirks {
* </p>
* @see #getStickyDeviceQuirks(AbstractGraphicsDevice)
*/
- public static void addStickyDeviceQuirks(AbstractGraphicsDevice device, GLRendererQuirks quirks) throws IllegalArgumentException {
+ public static void addStickyDeviceQuirks(final AbstractGraphicsDevice device, final GLRendererQuirks quirks) throws IllegalArgumentException {
final GLRendererQuirks sq = getStickyDeviceQuirks(device);
sq.addQuirks(quirks);
}
@@ -386,7 +386,7 @@ public class GLRendererQuirks {
* </p>
* @see #getStickyDeviceQuirks(AbstractGraphicsDevice)
*/
- public static boolean existStickyDeviceQuirk(AbstractGraphicsDevice device, int quirk) {
+ public static boolean existStickyDeviceQuirk(final AbstractGraphicsDevice device, final int quirk) {
return getStickyDeviceQuirks(device).exist(quirk);
}
/**
@@ -397,7 +397,7 @@ public class GLRendererQuirks {
* </p>
* @see #getStickyDeviceQuirks(AbstractGraphicsDevice)
*/
- public static void pushStickyDeviceQuirks(AbstractGraphicsDevice device, GLRendererQuirks dest) {
+ public static void pushStickyDeviceQuirks(final AbstractGraphicsDevice device, final GLRendererQuirks dest) {
dest.addQuirks(getStickyDeviceQuirks(device));
}
@@ -413,7 +413,7 @@ public class GLRendererQuirks {
* @param len number of quirks to read from offset within quirks array
* @throws IllegalArgumentException if one of the quirks is out of range
*/
- public GLRendererQuirks(int[] quirks, int offset, int len) throws IllegalArgumentException {
+ public GLRendererQuirks(final int[] quirks, final int offset, final int len) throws IllegalArgumentException {
this();
addQuirks(quirks, offset, len);
}
@@ -424,7 +424,7 @@ public class GLRendererQuirks {
* @param len number of quirks to read from offset within quirks array
* @throws IllegalArgumentException if one of the quirks is out of range
*/
- public final void addQuirks(int[] quirks, int offset, int len) throws IllegalArgumentException {
+ public final void addQuirks(final int[] quirks, final int offset, final int len) throws IllegalArgumentException {
int bitmask = 0;
if( !( 0 <= offset + len && offset + len <= quirks.length ) ) {
throw new IllegalArgumentException("offset and len out of bounds: offset "+offset+", len "+len+", array-len "+quirks.length);
@@ -440,7 +440,7 @@ public class GLRendererQuirks {
/**
* @param quirks valid GLRendererQuirks to be added
*/
- public final void addQuirks(GLRendererQuirks quirks) {
+ public final void addQuirks(final GLRendererQuirks quirks) {
_bitmask |= quirks._bitmask;
}
@@ -449,7 +449,7 @@ public class GLRendererQuirks {
* @return true if quirk exist, otherwise false
* @throws IllegalArgumentException if quirk is out of range
*/
- public final boolean exist(int quirk) throws IllegalArgumentException {
+ public final boolean exist(final int quirk) throws IllegalArgumentException {
validateQuirk(quirk);
return 0 != ( ( 1 << quirk ) & _bitmask );
}
@@ -481,7 +481,7 @@ public class GLRendererQuirks {
* @param quirk the quirk to be validated, i.e. whether it is out of range
* @throws IllegalArgumentException if quirk is out of range
*/
- public static void validateQuirk(int quirk) throws IllegalArgumentException {
+ public static void validateQuirk(final int quirk) throws IllegalArgumentException {
if( !( 0 <= quirk && quirk < COUNT ) ) {
throw new IllegalArgumentException("Quirks must be in range [0.."+COUNT+"[, but quirk: "+quirk);
}
@@ -492,7 +492,7 @@ public class GLRendererQuirks {
* @return the String equivalent of this quirk
* @throws IllegalArgumentException if quirk is out of range
*/
- public static final String toString(int quirk) throws IllegalArgumentException {
+ public static final String toString(final int quirk) throws IllegalArgumentException {
validateQuirk(quirk);
return _names[quirk];
}
diff --git a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
index 40f0d180f..8d6765036 100644
--- a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
+++ b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
@@ -43,7 +43,7 @@ public class JoglVersion extends JogampVersion {
protected static volatile JoglVersion jogampCommonVersionInfo;
- protected JoglVersion(String packageName, Manifest mf) {
+ protected JoglVersion(final String packageName, final Manifest mf) {
super(packageName, mf);
}
@@ -60,17 +60,17 @@ public class JoglVersion extends JogampVersion {
return jogampCommonVersionInfo;
}
- public StringBuilder toString(GL gl, StringBuilder sb) {
+ public StringBuilder toString(final GL gl, StringBuilder sb) {
sb = super.toString(sb).append(Platform.getNewline());
getGLInfo(gl, sb);
return sb;
}
- public String toString(GL gl) {
+ public String toString(final GL gl) {
return toString(gl, null).toString();
}
- public static StringBuilder getAvailableCapabilitiesInfo(GLDrawableFactory factory, AbstractGraphicsDevice device, StringBuilder sb) {
+ public static StringBuilder getAvailableCapabilitiesInfo(final GLDrawableFactory factory, final AbstractGraphicsDevice device, StringBuilder sb) {
if(null==sb) {
sb = new StringBuilder();
}
@@ -84,7 +84,7 @@ public class JoglVersion extends JogampVersion {
}
done = true;
}
- } catch (GLException gle) { /* n/a */ }
+ } catch (final GLException gle) { /* n/a */ }
}
if(!done) {
sb.append("\tnone").append(Platform.getNewline());
@@ -108,7 +108,7 @@ public class JoglVersion extends JogampVersion {
return sb;
}
- public static StringBuilder getDefaultOpenGLInfo(AbstractGraphicsDevice device, StringBuilder sb, boolean withCapabilitiesInfo) {
+ public static StringBuilder getDefaultOpenGLInfo(AbstractGraphicsDevice device, StringBuilder sb, final boolean withCapabilitiesInfo) {
if(null==sb) {
sb = new StringBuilder();
}
@@ -127,11 +127,11 @@ public class JoglVersion extends JogampVersion {
return sb;
}
- public static StringBuilder getGLInfo(GL gl, StringBuilder sb) {
+ public static StringBuilder getGLInfo(final GL gl, final StringBuilder sb) {
return getGLInfo(gl, sb, false);
}
- public static StringBuilder getGLInfo(GL gl, StringBuilder sb, boolean withCapabilitiesAndExtensionInfo) {
- AbstractGraphicsDevice device = gl.getContext().getGLDrawable().getNativeSurface()
+ public static StringBuilder getGLInfo(final GL gl, StringBuilder sb, final boolean withCapabilitiesAndExtensionInfo) {
+ final AbstractGraphicsDevice device = gl.getContext().getGLDrawable().getNativeSurface()
.getGraphicsConfiguration().getScreen().getDevice();
if(null==sb) {
sb = new StringBuilder();
@@ -151,11 +151,11 @@ public class JoglVersion extends JogampVersion {
return sb;
}
- public static StringBuilder getGLStrings(GL gl, StringBuilder sb) {
+ public static StringBuilder getGLStrings(final GL gl, final StringBuilder sb) {
return getGLStrings(gl, sb, true);
}
- public static StringBuilder getGLStrings(GL gl, StringBuilder sb, boolean withExtensions) {
+ public static StringBuilder getGLStrings(final GL gl, StringBuilder sb, final boolean withExtensions) {
if(null==sb) {
sb = new StringBuilder();
}
@@ -200,7 +200,7 @@ public class JoglVersion extends JogampVersion {
return sb;
}
- public StringBuilder getBriefOSGLBuildInfo(GL gl, StringBuilder sb) {
+ public StringBuilder getBriefOSGLBuildInfo(final GL gl, StringBuilder sb) {
if(null==sb) {
sb = new StringBuilder();
}
@@ -217,7 +217,7 @@ public class JoglVersion extends JogampVersion {
return sb;
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
System.err.println(VersionUtil.getPlatformInfo());
System.err.println(GlueGenVersion.getInstance());
// System.err.println(NativeWindowVersion.getInstance());
diff --git a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
index 4270607f2..d3dae9d63 100644
--- a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
@@ -89,12 +89,12 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
/** Tool has none **/
@Override
- public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+ public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
return 0;
}
@Override
- public final boolean useToolGetProcAdressFirst(String funcName) {
+ public final boolean useToolGetProcAdressFirst(final String funcName) {
return false;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/cg/CgException.java b/src/jogl/classes/com/jogamp/opengl/cg/CgException.java
index 3e42f4d70..0a3535ba6 100644
--- a/src/jogl/classes/com/jogamp/opengl/cg/CgException.java
+++ b/src/jogl/classes/com/jogamp/opengl/cg/CgException.java
@@ -50,18 +50,18 @@ public class CgException extends RuntimeException {
}
/** Constructs a CgException object with the specified detail message. */
- public CgException(String message) {
+ public CgException(final String message) {
super(message);
}
/** Constructs a CgException object with the specified detail message and
root cause. */
- public CgException(String message, Throwable cause) {
+ public CgException(final String message, final Throwable cause) {
super(message, cause);
}
/** Constructs a CgException object with the specified root cause. */
- public CgException(Throwable cause) {
+ public CgException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Binary16.java b/src/jogl/classes/com/jogamp/opengl/math/Binary16.java
index 33add46c2..8e4aa9176 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Binary16.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Binary16.java
@@ -151,7 +151,7 @@ public final class Binary16
* the interval of double precision values is far larger than that of the
* <code>binary16</code> type.
* </p>
- *
+ *
* @see #unpackDouble(char)
*/
@@ -224,7 +224,7 @@ public final class Binary16
* the interval of single precision values is far larger than that of the
* <code>binary16</code> type.
* </p>
- *
+ *
* @see #unpackFloat(char)
*/
@@ -280,7 +280,7 @@ public final class Binary16
* range <code>[-15, 16]</code> - values outside of this range will be
* truncated.
* </p>
- *
+ *
* @see #unpackGetExponentUnbiased(char)
*/
@@ -298,7 +298,7 @@ public final class Binary16
* Encode the significand <code>s</code>. Values should be in the range
* <code>[0, 1023]</code>. Values outside of this range will be truncated.
* </p>
- *
+ *
* @see #unpackGetSignificand(char)
*/
@@ -315,7 +315,7 @@ public final class Binary16
* <code>[0, 1]</code>, with <code>0</code> ironically denoting a positive
* value. Values outside of this range will be truncated.
* </p>
- *
+ *
* @see #unpackGetSign(char)
*/
@@ -369,7 +369,7 @@ public final class Binary16
* <code>k</code>, and the decoded significand <code>s</code> of
* <code>k</code>.</li>
* </ul>
- *
+ *
* @see #packDouble(double)
*/
@@ -405,7 +405,7 @@ public final class Binary16
/**
* 1. Bias the exponent.
- *
+ *
* 2. Shift the result left to the position at which it will appear in the
* resulting value.
*/
@@ -443,7 +443,7 @@ public final class Binary16
* <code>k</code>, and the decoded significand <code>s</code> of
* <code>k</code>.</li>
* </ul>
- *
+ *
* @see #packFloat(float)
*/
@@ -479,7 +479,7 @@ public final class Binary16
/**
* 1. Bias the exponent.
- *
+ *
* 2. Shift the result left to the position at which it will appear in the
* resulting value.
*/
@@ -522,7 +522,7 @@ public final class Binary16
* <code>16</code> iff the input is {@link #POSITIVE_INFINITY},
* {@link #NEGATIVE_INFINITY}, or <code>NaN</code>.</li>
* </ul>
- *
+ *
* @see #packSetExponentUnbiasedUnchecked(int)
*/
@@ -537,7 +537,7 @@ public final class Binary16
/**
* Retrieve the sign bit of the given packed <code>binary16</code> value, as
* an integer in the range <code>[0, 1]</code>.
- *
+ *
* @see Binary16#packSetSignUnchecked(int)
*/
@@ -552,7 +552,7 @@ public final class Binary16
* Return the significand of the given packed <code>binary16</code> value as
* an integer in the range <code>[0, 1023]</code>.
* </p>
- *
+ *
* @see Binary16#packSetSignificandUnchecked(int)
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Binary32.java b/src/jogl/classes/com/jogamp/opengl/math/Binary32.java
index d98815d9f..599b1ff68 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Binary32.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Binary32.java
@@ -75,7 +75,7 @@ public final class Binary32
* {@link #POSITIVE_INFINITY}, {@link #NEGATIVE_INFINITY}, or
* <code>NaN</code>.</li>
* </ul>
- *
+ *
* @see #packSetExponentUnbiasedUnchecked(int)
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Binary64.java b/src/jogl/classes/com/jogamp/opengl/math/Binary64.java
index 5efad433a..d4ec636a5 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Binary64.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Binary64.java
@@ -75,7 +75,7 @@ public final class Binary64
* {@link #POSITIVE_INFINITY}, {@link #NEGATIVE_INFINITY}, or
* <code>NaN</code>.</li>
* </ul>
- *
+ *
* @see #packSetExponentUnbiasedUnchecked(int)
*/
@@ -93,7 +93,7 @@ public final class Binary64
* Return the significand of the given double value.
* </p>
*/
-
+
public static long unpackGetSignificand(
final double d)
{
@@ -106,7 +106,7 @@ public final class Binary64
* Return the sign of the given double value.
* </p>
*/
-
+
public static long unpackGetSign(
final double d)
{
diff --git a/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java b/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java
index b7dbf183f..31408b079 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java
@@ -46,15 +46,15 @@ public class FixedPoint {
return (int)(value * 65536.0f);
}
- public static final float toFloat(int value) {
- return (float)value/65536.0f;
+ public static final float toFloat(final int value) {
+ return value/65536.0f;
}
- public static final int mult(int x1, int x2) {
+ public static final int mult(final int x1, final int x2) {
return (int) ( ((long)x1*(long)x2)/65536 );
}
- public static final int div(int x1, int x2) {
+ public static final int div(final int x1, final int x2) {
return (int) ( (((long)x1)<<16)/x2 );
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
index 243ab2a33..5e0784022 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
@@ -438,7 +438,7 @@ public class Quaternion {
* @see #rotateByAngleX(float)
* @see #setFromEuler(float, float, float)
*/
- public final Quaternion rotateByEuler(final float bankX, final float headingY, float attitudeZ) {
+ public final Quaternion rotateByEuler(final float bankX, final float headingY, final float attitudeZ) {
if ( VectorUtil.isZero(bankX, headingY, attitudeZ, FloatUtil.EPSILON) ) {
return this;
} else {
@@ -859,7 +859,7 @@ public class Quaternion {
* @see <a href="http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm">euclideanspace.com-eulerToQuaternion</a>
* @see #toEuler(float[])
*/
- public final Quaternion setFromEuler(final float bankX, final float headingY, float attitudeZ) {
+ public final Quaternion setFromEuler(final float bankX, final float headingY, final float attitudeZ) {
if ( VectorUtil.isZero(bankX, headingY, attitudeZ, FloatUtil.EPSILON) ) {
return setIdentity();
} else {
@@ -1154,7 +1154,7 @@ public class Quaternion {
* @param m 3x3 column matrix
* @return true if representing a rotational matrix, false otherwise
*/
- public final boolean isRotationMatrix3f(float[] m) {
+ public final boolean isRotationMatrix3f(final float[] m) {
final float epsilon = 0.01f; // margin to allow for rounding errors
if (FloatUtil.abs(m[0] * m[3] + m[3] * m[4] + m[6] * m[7]) > epsilon)
return false;
@@ -1171,7 +1171,7 @@ public class Quaternion {
return (FloatUtil.abs(determinant3f(m) - 1) < epsilon);
}
- private final float determinant3f(float[] m) {
+ private final float determinant3f(final float[] m) {
return m[0] * m[4] * m[8] + m[3] * m[7] * m[2] + m[6] * m[1] * m[5]
- m[0] * m[7] * m[5] - m[3] * m[1] * m[8] - m[6] * m[4] * m[2];
}
diff --git a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
index d87bbb6f9..e454c036a 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
@@ -68,7 +68,7 @@ public class AABBox {
* Create an AABBox copying all values from the given one
* @param src the box value to be used for the new instance
*/
- public AABBox(AABBox src) {
+ public AABBox(final AABBox src) {
copy(src);
}
@@ -147,7 +147,7 @@ public class AABBox {
* @param src source AABBox
* @return this AABBox for chaining
*/
- public final AABBox copy(AABBox src) {
+ public final AABBox copy(final AABBox src) {
System.arraycopy(src.low, 0, low, 0, 3);
System.arraycopy(src.high, 0, high, 0, 3);
System.arraycopy(src.center, 0, center, 0, 3);
@@ -196,8 +196,8 @@ public class AABBox {
* @return this AABBox for chaining
*/
public final AABBox resize(final AABBox newBox) {
- float[] newLow = newBox.getLow();
- float[] newHigh = newBox.getHigh();
+ final float[] newLow = newBox.getLow();
+ final float[] newHigh = newBox.getHigh();
/** test low */
if (newLow[0] < low[0])
@@ -662,7 +662,7 @@ public class AABBox {
}
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if( obj == this ) {
return true;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java b/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
index 87d31becb..f6d3c0dfa 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
@@ -27,6 +27,8 @@
*/
package com.jogamp.opengl.math.geom;
+import jogamp.common.os.PlatformPropsImpl;
+
import com.jogamp.common.os.Platform;
/**
@@ -113,12 +115,12 @@ public class Frustum {
* Negative halfspace is the <i>other side</i> of the plane, i.e. *-1
* </p>
**/
- public final float distanceTo(float x, float y, float z) {
+ public final float distanceTo(final float x, final float y, final float z) {
return n[0] * x + n[1] * y + n[2] * z + d;
}
/** Return distance of plane to given point, see {@link #distanceTo(float, float, float)}. */
- public final float distanceTo(float[] p) {
+ public final float distanceTo(final float[] p) {
return n[0] * p[0] + n[1] * p[1] + n[2] * p[2] + d;
}
@@ -164,7 +166,7 @@ public class Frustum {
* Copy the given <code>src</code> planes into this this instance's planes.
* @param src the 6 source planes
*/
- public final void updateByPlanes(Plane[] src) {
+ public final void updateByPlanes(final Plane[] src) {
for (int i = 0; i < 6; ++i) {
final Plane p0 = planes[i];
final float[] p0_n = p0.n;
@@ -185,7 +187,7 @@ public class Frustum {
* as required by this class.
* </p>
*/
- public void updateByPMV(float[] pmv, int pmv_off) {
+ public void updateByPMV(final float[] pmv, final int pmv_off) {
// Left: a = m41 + m11, b = m42 + m12, c = m43 + m13, d = m44 + m14 - [1..4] column-major
// Left: a = m30 + m00, b = m31 + m01, c = m32 + m02, d = m33 + m03 - [0..3] column-major
{
@@ -265,7 +267,7 @@ public class Frustum {
}
}
- private static final boolean isOutsideImpl(Plane p, AABBox box) {
+ private static final boolean isOutsideImpl(final Plane p, final AABBox box) {
final float[] low = box.getLow();
final float[] high = box.getHigh();
@@ -288,7 +290,7 @@ public class Frustum {
* Note: If method returns false, the box may only be partially inside.
* </p>
*/
- public final boolean isAABBoxOutside(AABBox box) {
+ public final boolean isAABBoxOutside(final AABBox box) {
for (int i = 0; i < 6; ++i) {
if ( isOutsideImpl(planes[i], box) ) {
// fully outside
@@ -308,7 +310,7 @@ public class Frustum {
* @param p the point
* @return {@link Location} of point related to frustum planes
*/
- public final Location classifyPoint(float[] p) {
+ public final Location classifyPoint(final float[] p) {
Location res = Location.INSIDE;
for (int i = 0; i < 6; ++i) {
@@ -328,7 +330,7 @@ public class Frustum {
* @param p the point
* @return true if outside of the frustum, otherwise inside or on a plane
*/
- public final boolean isPointOutside(float[] p) {
+ public final boolean isPointOutside(final float[] p) {
return Location.OUTSIDE == classifyPoint(p);
}
@@ -339,7 +341,7 @@ public class Frustum {
* @param radius radius of the sphere
* @return {@link Location} of point related to frustum planes
*/
- public final Location classifySphere(float[] p, float radius) {
+ public final Location classifySphere(final float[] p, final float radius) {
Location res = Location.INSIDE; // fully inside
for (int i = 0; i < 6; ++i) {
@@ -362,7 +364,7 @@ public class Frustum {
* @param radius radius of the sphere
* @return true if outside of the frustum, otherwise inside or intersecting
*/
- public final boolean isSphereOutside(float[] p, float radius) {
+ public final boolean isSphereOutside(final float[] p, final float radius) {
return Location.OUTSIDE == classifySphere(p, radius);
}
@@ -370,13 +372,13 @@ public class Frustum {
if( null == sb ) {
sb = new StringBuilder();
}
- sb.append("Frustum[ Planes[ ").append(Platform.NEWLINE)
- .append(" L: ").append(planes[0]).append(", ").append(Platform.NEWLINE)
- .append(" R: ").append(planes[1]).append(", ").append(Platform.NEWLINE)
- .append(" B: ").append(planes[2]).append(", ").append(Platform.NEWLINE)
- .append(" T: ").append(planes[3]).append(", ").append(Platform.NEWLINE)
- .append(" N: ").append(planes[4]).append(", ").append(Platform.NEWLINE)
- .append(" F: ").append(planes[5]).append("], ").append(Platform.NEWLINE)
+ sb.append("Frustum[ Planes[ ").append(PlatformPropsImpl.NEWLINE)
+ .append(" L: ").append(planes[0]).append(", ").append(PlatformPropsImpl.NEWLINE)
+ .append(" R: ").append(planes[1]).append(", ").append(PlatformPropsImpl.NEWLINE)
+ .append(" B: ").append(planes[2]).append(", ").append(PlatformPropsImpl.NEWLINE)
+ .append(" T: ").append(planes[3]).append(", ").append(PlatformPropsImpl.NEWLINE)
+ .append(" N: ").append(planes[4]).append(", ").append(PlatformPropsImpl.NEWLINE)
+ .append(" F: ").append(planes[5]).append("], ").append(PlatformPropsImpl.NEWLINE)
.append("]");
return sb;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
index fbe5fedc4..c94d21369 100644
--- a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
+++ b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
@@ -125,8 +125,8 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
private volatile boolean sendReshape; // volatile: maybe written by WindowManager thread w/o locking
private static String getThreadName() { return Thread.currentThread().getName(); }
- private static String toHexString(int v) { return "0x"+Integer.toHexString(v); }
- private static String toHexString(long v) { return "0x"+Long.toHexString(v); }
+ private static String toHexString(final int v) { return "0x"+Integer.toHexString(v); }
+ private static String toHexString(final long v) { return "0x"+Long.toHexString(v); }
/*
* Invokes init(...) on all GLEventListeners. Assumes context is current when run.
@@ -215,7 +215,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
} else {
context.destroy();
}
- } catch (GLException gle) {
+ } catch (final GLException gle) {
gle.printStackTrace();
}
}
@@ -247,7 +247,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
private class DisposeGLEventListenerAction implements Runnable {
private GLEventListener listener;
private final boolean remove;
- private DisposeGLEventListenerAction(GLEventListener listener, boolean remove) {
+ private DisposeGLEventListenerAction(final GLEventListener listener, final boolean remove) {
this.listener = listener;
this.remove = remove;
}
@@ -346,7 +346,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
* Optional GLCapabilitiesChooser to customize the selection of the used GLCapabilities based on the
* requested GLCapabilities, and the available capabilities of the graphics device.
*/
- public GLCanvas(final Composite parent, final int style, GLCapabilitiesImmutable capsReqUser,
+ public GLCanvas(final Composite parent, final int style, final GLCapabilitiesImmutable capsReqUser,
final GLCapabilitiesChooser capsChooser) {
this(parent, style, capsReqUser, capsChooser, null);
}
@@ -418,7 +418,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
final Listener listener = new Listener () {
@Override
- public void handleEvent (Event event) {
+ public void handleEvent (final Event event) {
switch (event.type) {
case SWT.Paint:
displayIfNoAnimatorNoCheck();
@@ -438,29 +438,29 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
}
@Override
- public final void setSharedContext(GLContext sharedContext) throws IllegalStateException {
+ public final void setSharedContext(final GLContext sharedContext) throws IllegalStateException {
helper.setSharedContext(this.context, sharedContext);
}
@Override
- public final void setSharedAutoDrawable(GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
+ public final void setSharedAutoDrawable(final GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
helper.setSharedAutoDrawable(this, sharedAutoDrawable);
}
private final UpstreamSurfaceHook swtCanvasUpStreamHook = new UpstreamSurfaceHook() {
@Override
- public final void create(ProxySurface s) { /* nop */ }
+ public final void create(final ProxySurface s) { /* nop */ }
@Override
- public final void destroy(ProxySurface s) { /* nop */ }
+ public final void destroy(final ProxySurface s) { /* nop */ }
@Override
- public final int getSurfaceWidth(ProxySurface s) {
+ public final int getSurfaceWidth(final ProxySurface s) {
return clientArea.width;
}
@Override
- public final int getSurfaceHeight(ProxySurface s) {
+ public final int getSurfaceHeight(final ProxySurface s) {
return clientArea.height;
}
@@ -619,7 +619,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
final GLDrawableFactory glFactory = GLDrawableFactory.getFactory(capsRequested.getGLProfile());
// Create a NativeWindow proxy for the SWT canvas
- ProxySurface proxySurface = glFactory.createProxySurface(device, screen.getIndex(), nativeWindowHandle,
+ final ProxySurface proxySurface = glFactory.createProxySurface(device, screen.getIndex(), nativeWindowHandle,
capsRequested, capsChooser, swtCanvasUpStreamHook);
// Associate a GL surface with the proxy
final GLDrawableImpl _drawable = (GLDrawableImpl) glFactory.createGLDrawable(proxySurface);
@@ -731,7 +731,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
}
@Override
- public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
+ public GLEventListener getGLEventListener(final int index) throws IndexOutOfBoundsException {
return helper.getGLEventListener(index);
}
@@ -741,17 +741,17 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
}
@Override
- public boolean getGLEventListenerInitState(GLEventListener listener) {
+ public boolean getGLEventListenerInitState(final GLEventListener listener) {
return helper.getGLEventListenerInitState(listener);
}
@Override
- public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
+ public void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized) {
helper.setGLEventListenerInitState(listener, initialized);
}
@Override
- public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
+ public GLEventListener disposeGLEventListener(final GLEventListener listener, final boolean remove) {
final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
runInGLThread(r);
return r.listener;
@@ -781,7 +781,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
}
@Override
- public final Thread setExclusiveContextThread(Thread t) throws GLException {
+ public final Thread setExclusiveContextThread(final Thread t) throws GLException {
return helper.setExclusiveContextThread(t, context);
}
@@ -837,7 +837,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
}
@Override
- public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
+ public GLContext setContext(final GLContext newCtx, final boolean destroyPrevCtx) {
final RecursiveLock _lock = lock;
_lock.lock();
try {
@@ -981,7 +981,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
action.run();
}
- private void runOnEDTIfAvail(boolean wait, final Runnable action) {
+ private void runOnEDTIfAvail(final boolean wait, final Runnable action) {
final Display d = isDisposed() ? null : getDisplay();
if( null == d || d.isDisposed() || d.getThread() == Thread.currentThread() ) {
action.run();
@@ -1025,7 +1025,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
canvas.addGLEventListener(new GLEventListener() {
@Override
public void init(final GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
+ final GL gl = drawable.getGL();
System.err.println(JoglVersion.getGLInfo(gl, null));
}
@Override
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
index d0de3b3a0..496fb88c0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
@@ -54,16 +54,16 @@ import javax.media.opengl.GLAutoDrawable;
class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
// For efficient rendering of Swing components, in particular when
// they overlap one another
- private List<JComponent> lightweights = new ArrayList<JComponent>();
- private Map<RepaintManager,RepaintManager> repaintManagers = new IdentityHashMap<RepaintManager,RepaintManager>();
- private Map<JComponent,Rectangle> dirtyRegions = new IdentityHashMap<JComponent,Rectangle>();
+ private final List<JComponent> lightweights = new ArrayList<JComponent>();
+ private final Map<RepaintManager,RepaintManager> repaintManagers = new IdentityHashMap<RepaintManager,RepaintManager>();
+ private final Map<JComponent,Rectangle> dirtyRegions = new IdentityHashMap<JComponent,Rectangle>();
@Override
- public void display(ArrayList<GLAutoDrawable> drawables,
- boolean ignoreExceptions,
- boolean printExceptions) {
+ public void display(final ArrayList<GLAutoDrawable> drawables,
+ final boolean ignoreExceptions,
+ final boolean printExceptions) {
for (int i=0; i<drawables.size(); i++) {
- GLAutoDrawable drawable = drawables.get(i);
+ final GLAutoDrawable drawable = drawables.get(i);
if (drawable instanceof JComponent) {
// Lightweight components need a more efficient drawing
// scheme than simply forcing repainting of each one in
@@ -73,7 +73,7 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
} else {
try {
drawable.display();
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
if (ignoreExceptions) {
if (printExceptions) {
e.printStackTrace();
@@ -88,7 +88,7 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
if (lightweights.size() > 0) {
try {
SwingUtilities.invokeAndWait(drawWithRepaintManagerRunnable);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
lightweights.clear();
@@ -97,10 +97,10 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
// Uses RepaintManager APIs to implement more efficient redrawing of
// the Swing widgets we're animating
- private Runnable drawWithRepaintManagerRunnable = new Runnable() {
+ private final Runnable drawWithRepaintManagerRunnable = new Runnable() {
@Override
public void run() {
- for (Iterator<JComponent> iter = lightweights.iterator(); iter.hasNext(); ) {
+ for (final Iterator<JComponent> iter = lightweights.iterator(); iter.hasNext(); ) {
JComponent comp = iter.next();
RepaintManager rm = RepaintManager.currentManager(comp);
rm.markCompletelyDirty(comp);
@@ -117,13 +117,13 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
// Walk up the hierarchy trying to find a non-optimizable
// ancestor
- Rectangle visible = comp.getVisibleRect();
+ final Rectangle visible = comp.getVisibleRect();
int x = visible.x;
int y = visible.y;
while (comp != null) {
x += comp.getX();
y += comp.getY();
- Component c = comp.getParent();
+ final Component c = comp.getParent();
if ((c == null) || (!(c instanceof JComponent))) {
comp = null;
} else {
@@ -132,7 +132,7 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
rm = RepaintManager.currentManager(comp);
repaintManagers.put(rm, rm);
// Need to dirty this region
- Rectangle dirty = (Rectangle) dirtyRegions.get(comp);
+ Rectangle dirty = dirtyRegions.get(comp);
if (dirty == null) {
dirty = new Rectangle(x, y, visible.width, visible.height);
dirtyRegions.put(comp, dirty);
@@ -150,15 +150,15 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
}
// Dirty any needed regions on non-optimizable components
- for (Iterator<JComponent> iter = dirtyRegions.keySet().iterator(); iter.hasNext(); ) {
- JComponent comp = iter.next();
- Rectangle rect = dirtyRegions.get(comp);
- RepaintManager rm = RepaintManager.currentManager(comp);
+ for (final Iterator<JComponent> iter = dirtyRegions.keySet().iterator(); iter.hasNext(); ) {
+ final JComponent comp = iter.next();
+ final Rectangle rect = dirtyRegions.get(comp);
+ final RepaintManager rm = RepaintManager.currentManager(comp);
rm.addDirtyRegion(comp, rect.x, rect.y, rect.width, rect.height);
}
// Draw all dirty regions
- for (Iterator<RepaintManager> iter = repaintManagers.keySet().iterator(); iter.hasNext(); ) {
+ for (final Iterator<RepaintManager> iter = repaintManagers.keySet().iterator(); iter.hasNext(); ) {
iter.next().paintDirtyRegions();
}
dirtyRegions.clear();
@@ -167,7 +167,7 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
};
@Override
- public boolean blockUntilDone(Thread thread) {
+ public boolean blockUntilDone(final Thread thread) {
return Thread.currentThread() != thread && !EventQueue.isDispatchThread();
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Animator.java b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
index 31938612a..ae09d81a4 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Animator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
@@ -78,7 +78,7 @@ public class Animator extends AnimatorBase {
/**
* Creates a new Animator w/ an associated ThreadGroup.
*/
- public Animator(ThreadGroup tg) {
+ public Animator(final ThreadGroup tg) {
super();
setThreadGroup(tg);
if(DEBUG) {
@@ -89,7 +89,7 @@ public class Animator extends AnimatorBase {
/**
* Creates a new Animator for a particular drawable.
*/
- public Animator(GLAutoDrawable drawable) {
+ public Animator(final GLAutoDrawable drawable) {
super();
add(drawable);
if(DEBUG) {
@@ -100,7 +100,7 @@ public class Animator extends AnimatorBase {
/**
* Creates a new Animator w/ an associated ThreadGroup for a particular drawable.
*/
- public Animator(ThreadGroup tg, GLAutoDrawable drawable) {
+ public Animator(final ThreadGroup tg, final GLAutoDrawable drawable) {
super();
setThreadGroup(tg);
add(drawable);
@@ -110,7 +110,7 @@ public class Animator extends AnimatorBase {
}
@Override
- protected final String getBaseName(String prefix) {
+ protected final String getBaseName(final String prefix) {
return prefix + "Animator" ;
}
@@ -120,7 +120,7 @@ public class Animator extends AnimatorBase {
* animation loop which prevents the CPU from getting swamped.
* This method may not have an effect on subclasses.
*/
- public final synchronized void setRunAsFastAsPossible(boolean runFast) {
+ public final synchronized void setRunAsFastAsPossible(final boolean runFast) {
runAsFastAsPossible = runFast;
}
@@ -151,7 +151,7 @@ public class Animator extends AnimatorBase {
if( drawablesEmpty ) {
pauseIssued = true;
}
- boolean wasPaused = pauseIssued;
+ final boolean wasPaused = pauseIssued;
if (DEBUG) {
System.err.println("Animator pause on " + animThread.getName() + ": " + toString());
}
@@ -164,7 +164,7 @@ public class Animator extends AnimatorBase {
Animator.this.notifyAll();
try {
Animator.this.wait();
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
}
if (wasPaused) {
// resume from pause -> reset counter
@@ -192,7 +192,7 @@ public class Animator extends AnimatorBase {
Thread.yield();
}
}
- } catch( ThreadDeath td) {
+ } catch( final ThreadDeath td) {
if(DEBUG) {
System.err.println("Animator caught: "+td.getClass().getName()+": "+td.getMessage());
td.printStackTrace();
@@ -232,7 +232,7 @@ public class Animator extends AnimatorBase {
* @param tg the {@link ThreadGroup}
* @throws GLException if the animator has already been started
*/
- public final synchronized void setThreadGroup(ThreadGroup tg) throws GLException {
+ public final synchronized void setThreadGroup(final ThreadGroup tg) throws GLException {
if ( isStarted() ) {
throw new GLException("Animator already started.");
}
@@ -248,7 +248,7 @@ public class Animator extends AnimatorBase {
runnable = new MainLoop();
}
fpsCounter.resetFPSCounter();
- String threadName = getThreadName()+"-"+baseName;
+ final String threadName = getThreadName()+"-"+baseName;
Thread thread;
if(null==threadGroup) {
thread = new Thread(runnable, threadName);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
index 39643744a..68a48381e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
@@ -92,7 +92,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
Class<?> clazz;
try {
clazz = Class.forName("com.jogamp.opengl.util.AWTAnimatorImpl");
- } catch (Exception e) {
+ } catch (final Exception e) {
clazz = null;
}
awtAnimatorImplClazz = clazz;
@@ -112,7 +112,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
drawablesEmpty = true;
}
- private static final boolean useAWTAnimatorImpl(int modeBits) {
+ private static final boolean useAWTAnimatorImpl(final int modeBits) {
return 0 != ( MODE_EXPECT_AWT_RENDERING_THREAD & modeBits ) && null != awtAnimatorImplClazz;
}
@@ -126,13 +126,13 @@ public abstract class AnimatorBase implements GLAnimatorControl {
*
* @throws GLException if Animator is {@link #isStarted()}
*/
- protected final synchronized void initImpl(boolean force) {
+ protected final synchronized void initImpl(final boolean force) {
if( force || null == impl ) {
if( useAWTAnimatorImpl( modeBits ) ) {
try {
impl = (AnimatorImpl) awtAnimatorImplClazz.newInstance();
baseName = getBaseName("AWT");
- } catch (Exception e) { e.printStackTrace(); }
+ } catch (final Exception e) { e.printStackTrace(); }
}
if( null == impl ) {
impl = new DefaultAnimatorImpl();
@@ -154,7 +154,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
* @throws GLException if Animator is {@link #isStarted()} and {@link #MODE_EXPECT_AWT_RENDERING_THREAD} about to change
* @see AnimatorBase#MODE_EXPECT_AWT_RENDERING_THREAD
*/
- public final synchronized void setModeBits(boolean enable, int bitValues) throws GLException {
+ public final synchronized void setModeBits(final boolean enable, final int bitValues) throws GLException {
final int _oldModeBits = modeBits;
if(enable) {
modeBits |= bitValues;
@@ -225,7 +225,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
}
}
- boolean paused = pause();
+ final boolean paused = pause();
drawables.remove(drawable);
drawablesEmpty = drawables.size() == 0;
drawable.setAnimator(null);
@@ -267,7 +267,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
* @see #isExclusiveContextEnabled()
*/
// @Override
- public final synchronized Thread setExclusiveContext(Thread t) {
+ public final synchronized Thread setExclusiveContext(final Thread t) {
final boolean enable = null != t;
final Thread old = userExclusiveContextThread;
if( enable && t != animThread ) { // disable: will be cleared at end after propagation && filter out own animThread usae
@@ -299,7 +299,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
* @see #isExclusiveContextEnabled()
*/
// @Override
- public final boolean setExclusiveContext(boolean enable) {
+ public final boolean setExclusiveContext(final boolean enable) {
final boolean propagateState;
final boolean oldExclusiveContext;
final Thread _exclusiveContextThread;
@@ -324,7 +324,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
while( 0<counter && isAnimating() && !validateDrawablesExclCtxState(dECT) ) {
try {
Thread.sleep(20);
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
counter--;
}
if(resumed) {
@@ -379,7 +379,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
* to allow propagation of releasing the exclusive thread.
* </p>
*/
- protected final synchronized void setDrawablesExclCtxState(boolean enable) {
+ protected final synchronized void setDrawablesExclCtxState(final boolean enable) {
if(DEBUG) {
System.err.println("AnimatorBase.setExclusiveContextImpl exlusive "+exclusiveContext+": Enable "+enable+" for "+this+" - "+Thread.currentThread());
// Thread.dumpStack();
@@ -388,12 +388,12 @@ public abstract class AnimatorBase implements GLAnimatorControl {
for (int i=0; i<drawables.size(); i++) {
try {
drawables.get(i).setExclusiveContextThread( enable ? ect : null );
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
e.printStackTrace();
}
}
}
- protected final boolean validateDrawablesExclCtxState(Thread expected) {
+ protected final boolean validateDrawablesExclCtxState(final Thread expected) {
for (int i=0; i<drawables.size(); i++) {
if( expected != drawables.get(i).getExclusiveContextThread() ) {
return false;
@@ -418,7 +418,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
}
@Override
- public final void setUpdateFPSFrames(int frames, PrintStream out) {
+ public final void setUpdateFPSFrames(final int frames, final PrintStream out) {
fpsCounter.setUpdateFPSFrames(frames, out);
}
@@ -470,7 +470,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
/** Sets a flag causing this Animator to ignore exceptions produced
while redrawing the drawables. By default this flag is set to
false, causing any exception thrown to halt the Animator. */
- public final void setIgnoreExceptions(boolean ignoreExceptions) {
+ public final void setIgnoreExceptions(final boolean ignoreExceptions) {
this.ignoreExceptions = ignoreExceptions;
}
@@ -478,7 +478,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
this Animator (see {@link #setIgnoreExceptions}), to print the
exceptions' stack traces for diagnostic information. Defaults to
false. */
- public final void setPrintExceptions(boolean printExceptions) {
+ public final void setPrintExceptions(final boolean printExceptions) {
this.printExceptions = printExceptions;
}
@@ -495,7 +495,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
* if &gt; <code>0</code>, method will wait for the given <code>pollPeriod</code> in milliseconds.
* @return <code>true</code> if {@link Condition#eval() waitCondition.eval()} returned <code>false</code>, otherwise <code>false</code>.
*/
- protected final synchronized boolean finishLifecycleAction(Condition waitCondition, long pollPeriod) {
+ protected final synchronized boolean finishLifecycleAction(final Condition waitCondition, long pollPeriod) {
/**
* It's hard to tell whether the thread which changes the lifecycle has
* dependencies on the Animator's internal thread. Currently we
@@ -519,7 +519,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
notifyAll();
try {
wait(pollPeriod);
- } catch (InterruptedException ie) { }
+ } catch (final InterruptedException ie) { }
remaining -= System.currentTimeMillis() - t1 ;
nok = waitCondition.eval();
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
index a9c6e6456..7fa4011f8 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
@@ -42,14 +42,14 @@ import javax.media.opengl.GLAutoDrawable;
class DefaultAnimatorImpl implements AnimatorBase.AnimatorImpl {
@Override
- public void display(ArrayList<GLAutoDrawable> drawables,
- boolean ignoreExceptions,
- boolean printExceptions) {
+ public void display(final ArrayList<GLAutoDrawable> drawables,
+ final boolean ignoreExceptions,
+ final boolean printExceptions) {
for (int i=0; i<drawables.size(); i++) {
- GLAutoDrawable drawable = drawables.get(i);
+ final GLAutoDrawable drawable = drawables.get(i);
try {
drawable.display();
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
if (ignoreExceptions) {
if (printExceptions) {
e.printStackTrace();
@@ -62,7 +62,7 @@ class DefaultAnimatorImpl implements AnimatorBase.AnimatorImpl {
}
@Override
- public boolean blockUntilDone(Thread thread) {
+ public boolean blockUntilDone(final Thread thread) {
return Thread.currentThread() != thread;
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
index 5bd803500..de99ae70d 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
@@ -65,13 +65,13 @@ public class FPSAnimator extends AnimatorBase {
private volatile boolean shouldStop; // MainTask trigger
@Override
- protected String getBaseName(String prefix) {
+ protected String getBaseName(final String prefix) {
return "FPS" + prefix + "Animator" ;
}
/** Creates an FPSAnimator with a given target frames-per-second
value. Equivalent to <code>FPSAnimator(null, fps)</code>. */
- public FPSAnimator(int fps) {
+ public FPSAnimator(final int fps) {
this(null, fps);
}
@@ -79,21 +79,21 @@ public class FPSAnimator extends AnimatorBase {
value and a flag indicating whether to use fixed-rate
scheduling. Equivalent to <code>FPSAnimator(null, fps,
scheduleAtFixedRate)</code>. */
- public FPSAnimator(int fps, boolean scheduleAtFixedRate) {
+ public FPSAnimator(final int fps, final boolean scheduleAtFixedRate) {
this(null, fps, scheduleAtFixedRate);
}
/** Creates an FPSAnimator with a given target frames-per-second
value and an initial drawable to animate. Equivalent to
<code>FPSAnimator(null, fps, false)</code>. */
- public FPSAnimator(GLAutoDrawable drawable, int fps) {
+ public FPSAnimator(final GLAutoDrawable drawable, final int fps) {
this(drawable, fps, false);
}
/** Creates an FPSAnimator with a given target frames-per-second
value, an initial drawable to animate, and a flag indicating
whether to use fixed-rate scheduling. */
- public FPSAnimator(GLAutoDrawable drawable, int fps, boolean scheduleAtFixedRate) {
+ public FPSAnimator(final GLAutoDrawable drawable, final int fps, final boolean scheduleAtFixedRate) {
super();
this.fps = fps;
if (drawable != null) {
@@ -106,7 +106,7 @@ public class FPSAnimator extends AnimatorBase {
* @param fps
* @throws GLException if the animator has already been started
*/
- public final synchronized void setFPS(int fps) throws GLException {
+ public final synchronized void setFPS(final int fps) throws GLException {
if ( isStarted() ) {
throw new GLException("Animator already started.");
}
@@ -122,7 +122,7 @@ public class FPSAnimator extends AnimatorBase {
public MainTask() {
}
- public void start(Timer timer) {
+ public void start(final Timer timer) {
fpsCounter.resetFPSCounter();
shouldRun = true;
shouldStop = false;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
index a58eb82cd..1a9ec2782 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
@@ -69,11 +69,11 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
*
* @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
*/
- public static GLArrayDataClient createFixed(int index, int comps, int dataType, boolean normalized, int initialElementCount)
+ public static GLArrayDataClient createFixed(final int index, final int comps, final int dataType, final boolean normalized, final int initialElementCount)
throws GLException
{
- GLArrayDataClient adc = new GLArrayDataClient();
- GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc);
+ final GLArrayDataClient adc = new GLArrayDataClient();
+ final GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc);
adc.init(null, index, comps, dataType, normalized, 0, null, initialElementCount, 0 /* mappedElementCount */, false, glArrayHandler, 0, 0, 0, 0, false);
return adc;
}
@@ -99,12 +99,12 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
*
* @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
*/
- public static GLArrayDataClient createFixed(int index, int comps, int dataType, boolean normalized, int stride,
- Buffer buffer)
+ public static GLArrayDataClient createFixed(final int index, final int comps, final int dataType, final boolean normalized, final int stride,
+ final Buffer buffer)
throws GLException
{
- GLArrayDataClient adc = new GLArrayDataClient();
- GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc);
+ final GLArrayDataClient adc = new GLArrayDataClient();
+ final GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc);
adc.init(null, index, comps, dataType, normalized, stride, buffer, comps*comps, 0 /* mappedElementCount */, false, glArrayHandler, 0, 0, 0, 0, false);
return adc;
}
@@ -118,12 +118,12 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
* @param normalized Whether the data shall be normalized
* @param initialElementCount
*/
- public static GLArrayDataClient createGLSL(String name, int comps,
- int dataType, boolean normalized, int initialElementCount)
+ public static GLArrayDataClient createGLSL(final String name, final int comps,
+ final int dataType, final boolean normalized, final int initialElementCount)
throws GLException
{
- GLArrayDataClient adc = new GLArrayDataClient();
- GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc);
+ final GLArrayDataClient adc = new GLArrayDataClient();
+ final GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc);
adc.init(name, -1, comps, dataType, normalized, 0, null, initialElementCount, 0 /* mappedElementCount */, true, glArrayHandler, 0, 0, 0, 0, true);
return adc;
}
@@ -138,18 +138,18 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
* @param stride
* @param buffer the user define data
*/
- public static GLArrayDataClient createGLSL(String name, int comps,
- int dataType, boolean normalized, int stride, Buffer buffer)
+ public static GLArrayDataClient createGLSL(final String name, final int comps,
+ final int dataType, final boolean normalized, final int stride, final Buffer buffer)
throws GLException
{
- GLArrayDataClient adc = new GLArrayDataClient();
- GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc);
+ final GLArrayDataClient adc = new GLArrayDataClient();
+ final GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc);
adc.init(name, -1, comps, dataType, normalized, stride, buffer, comps*comps, 0 /* mappedElementCount */, true, glArrayHandler, 0, 0, 0, 0, true);
return adc;
}
@Override
- public void associate(Object obj, boolean enable) {
+ public void associate(final Object obj, final boolean enable) {
if(obj instanceof ShaderState) {
if(enable) {
shaderState = (ShaderState)obj;
@@ -177,30 +177,30 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
//
@Override
- public final void setVBOWritten(boolean written) {
+ public final void setVBOWritten(final boolean written) {
bufferWritten = ( 0 == mappedElementCount ) ? written : true;
}
@Override
- public void destroy(GL gl) {
+ public void destroy(final GL gl) {
reset(gl);
super.destroy(gl);
}
@Override
- public void reset(GL gl) {
+ public void reset(final GL gl) {
enableBuffer(gl, false);
reset();
}
@Override
- public void seal(GL gl, boolean seal) {
+ public void seal(final GL gl, final boolean seal) {
seal(seal);
enableBuffer(gl, seal);
}
@Override
- public void enableBuffer(GL gl, boolean enable) {
+ public void enableBuffer(final GL gl, final boolean enable) {
if( enableBufferAlways || bufferEnabled != enable ) {
if(enable) {
checkSeal(true);
@@ -213,7 +213,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
}
@Override
- public boolean bindBuffer(GL gl, boolean bind) {
+ public boolean bindBuffer(final GL gl, final boolean bind) {
if(bind) {
checkSeal(true);
// init/generate VBO name if not done yet
@@ -223,7 +223,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
}
@Override
- public void setEnableAlways(boolean always) {
+ public void setEnableAlways(final boolean always) {
enableBufferAlways = always;
}
@@ -242,7 +242,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
}
@Override
- public void seal(boolean seal)
+ public void seal(final boolean seal)
{
if( sealed == seal ) return;
sealed = seal;
@@ -281,7 +281,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
* The arguments remaining elements must be a multiple of this arrays element stride.
*/
@Override
- public void put(Buffer v) {
+ public void put(final Buffer v) {
if ( sealed ) return;
/** FIXME: isn't true for interleaved arrays !
if(0!=(v.remaining() % strideL)) {
@@ -292,33 +292,33 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
}
@Override
- public void putb(byte v) {
+ public void putb(final byte v) {
if ( sealed ) return;
growBufferIfNecessary(1);
Buffers.putb(buffer, v);
}
@Override
- public void puts(short v) {
+ public void puts(final short v) {
if ( sealed ) return;
growBufferIfNecessary(1);
Buffers.puts(buffer, v);
}
@Override
- public void puti(int v) {
+ public void puti(final int v) {
if ( sealed ) return;
growBufferIfNecessary(1);
Buffers.puti(buffer, v);
}
@Override
- public void putx(int v) {
+ public void putx(final int v) {
puti(v);
}
@Override
- public void putf(float v) {
+ public void putf(final float v) {
if ( sealed ) return;
growBufferIfNecessary(1);
Buffers.putf(buffer, v);
@@ -349,7 +349,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
// non public matters
- protected final boolean growBufferIfNecessary(int spareComponents) {
+ protected final boolean growBufferIfNecessary(final int spareComponents) {
if( buffer==null || buffer.remaining()<spareComponents ) {
if( 0 != mappedElementCount ) {
throw new GLException("Mapped buffer can't grow. Insufficient storage size: Needed "+spareComponents+" components, "+
@@ -411,7 +411,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
}
}
- protected final void checkSeal(boolean test) throws GLException {
+ protected final void checkSeal(final boolean test) throws GLException {
if(!alive) {
throw new GLException("Invalid state: "+this);
}
@@ -424,9 +424,9 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
}
}
- protected void init(String name, int index, int comps, int dataType, boolean normalized, int stride, Buffer data,
- int initialElementCount, int mappedElementCount, boolean isVertexAttribute,
- GLArrayHandler handler, int vboName, long vboOffset, int vboUsage, int vboTarget, boolean usesGLSL)
+ protected void init(final String name, final int index, final int comps, final int dataType, final boolean normalized, final int stride, final Buffer data,
+ final int initialElementCount, final int mappedElementCount, final boolean isVertexAttribute,
+ final GLArrayHandler handler, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget, final boolean usesGLSL)
throws GLException
{
super.init(name, index, comps, dataType, normalized, stride, data, mappedElementCount,
@@ -450,7 +450,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
private boolean isValidated = false;
- protected void init_vbo(GL gl) {
+ protected void init_vbo(final GL gl) {
if(!isValidated ) {
isValidated = true;
validate(gl.getGLProfile(), true);
@@ -468,7 +468,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
* All other values are simply copied.
* </p>
*/
- public GLArrayDataClient(GLArrayDataClient src) {
+ public GLArrayDataClient(final GLArrayDataClient src) {
super(src);
this.isValidated = src.isValidated;
this.sealed = src.sealed;
@@ -481,7 +481,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
try {
final Constructor<? extends GLArrayHandler> ctor = clazz.getConstructor(GLArrayDataEditable.class);
this.glArrayHandler = ctor.newInstance(this);
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException("Could not ctor "+clazz.getName()+"("+this.getClass().getName()+")", e);
}
} else {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
index 833f1ccda..51c55e326 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
@@ -81,12 +81,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
*
* @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
*/
- public static GLArrayDataServer createFixed(int index, int compsPerElement, int dataType, boolean normalized, int stride,
- Buffer buffer, int vboUsage)
+ public static GLArrayDataServer createFixed(final int index, final int compsPerElement, final int dataType, final boolean normalized, final int stride,
+ final Buffer buffer, final int vboUsage)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLFixedArrayHandler(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLFixedArrayHandler(ads);
ads.init(null, index, compsPerElement, dataType, normalized, stride, buffer, buffer.limit(), 0 /* mappedElementCount */, false,
glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, false);
return ads;
@@ -113,12 +113,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
*
* @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
*/
- public static GLArrayDataServer createFixed(int index, int compsPerElement, int dataType, boolean normalized, int initialElementCount,
- int vboUsage)
+ public static GLArrayDataServer createFixed(final int index, final int compsPerElement, final int dataType, final boolean normalized, final int initialElementCount,
+ final int vboUsage)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLFixedArrayHandler(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLFixedArrayHandler(ads);
ads.init(null, index, compsPerElement, dataType, normalized, 0, null, initialElementCount, 0 /* mappedElementCount */, false,
glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, false);
return ads;
@@ -134,12 +134,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param initialElementCount
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
*/
- public static GLArrayDataServer createGLSL(String name, int compsPerElement,
- int dataType, boolean normalized, int initialElementCount, int vboUsage)
+ public static GLArrayDataServer createGLSL(final String name, final int compsPerElement,
+ final int dataType, final boolean normalized, final int initialElementCount, final int vboUsage)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
ads.init(name, -1, compsPerElement, dataType, normalized, 0, null, initialElementCount,
0 /* mappedElementCount */, true, glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
return ads;
@@ -155,12 +155,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param mappedElementCount
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
*/
- public static GLArrayDataServer createGLSLMapped(String name, int compsPerElement,
- int dataType, boolean normalized, int mappedElementCount, int vboUsage)
+ public static GLArrayDataServer createGLSLMapped(final String name, final int compsPerElement,
+ final int dataType, final boolean normalized, final int mappedElementCount, final int vboUsage)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
ads.init(name, -1, compsPerElement, dataType, normalized, 0, null, 0 /* initialElementCount */,
mappedElementCount, true, glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
ads.seal(true);
@@ -178,13 +178,13 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param buffer the user define data
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
*/
- public static GLArrayDataServer createGLSL(String name, int compsPerElement,
- int dataType, boolean normalized, int stride, Buffer buffer,
- int vboUsage)
+ public static GLArrayDataServer createGLSL(final String name, final int compsPerElement,
+ final int dataType, final boolean normalized, final int stride, final Buffer buffer,
+ final int vboUsage)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
ads.init(name, -1, compsPerElement, dataType, normalized, stride, buffer, buffer.limit(), 0 /* mappedElementCount */, true,
glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
return ads;
@@ -203,12 +203,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param vboTarget {@link GL#GL_ELEMENT_ARRAY_BUFFER}, ..
* {@link GL#glGenBuffers(int, int[], int)
*/
- public static GLArrayDataServer createData(int compsPerElement, int dataType, int stride,
- Buffer buffer, int vboUsage, int vboTarget)
+ public static GLArrayDataServer createData(final int compsPerElement, final int dataType, final int stride,
+ final Buffer buffer, final int vboUsage, final int vboTarget)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLDataArrayHandler(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLDataArrayHandler(ads);
ads.init(null, -1, compsPerElement, dataType, false, stride, buffer, buffer.limit(), 0 /* mappedElementCount */, false,
glArrayHandler, 0, 0, vboUsage, vboTarget, false);
return ads;
@@ -225,12 +225,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
* @param vboTarget {@link GL#GL_ELEMENT_ARRAY_BUFFER}, ..
*/
- public static GLArrayDataServer createData(int compsPerElement, int dataType, int initialElementCount,
- int vboUsage, int vboTarget)
+ public static GLArrayDataServer createData(final int compsPerElement, final int dataType, final int initialElementCount,
+ final int vboUsage, final int vboTarget)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLDataArrayHandler(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLDataArrayHandler(ads);
ads.init(null, -1, compsPerElement, dataType, false, 0, null, initialElementCount, 0 /* mappedElementCount */, false,
glArrayHandler, 0, 0, vboUsage, vboTarget, false);
return ads;
@@ -249,12 +249,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
* @param vboTarget {@link GL#GL_ELEMENT_ARRAY_BUFFER}, ..
*/
- public static GLArrayDataServer createDataMapped(int compsPerElement, int dataType, int mappedElementCount,
- int vboUsage, int vboTarget)
+ public static GLArrayDataServer createDataMapped(final int compsPerElement, final int dataType, final int mappedElementCount,
+ final int vboUsage, final int vboTarget)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLDataArrayHandler(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLDataArrayHandler(ads);
ads.init(null, -1, compsPerElement, dataType, false, 0, null, 0 /* initialElementCount */, mappedElementCount, false,
glArrayHandler, 0, 0, vboUsage, vboTarget, false);
return ads;
@@ -271,12 +271,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param initialElementCount The initial number of all interleaved elements
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
*/
- public static GLArrayDataServer createFixedInterleaved(int compsPerElement, int dataType, boolean normalized, int initialElementCount,
- int vboUsage)
+ public static GLArrayDataServer createFixedInterleaved(final int compsPerElement, final int dataType, final boolean normalized, final int initialElementCount,
+ final int vboUsage)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLArrayHandlerInterleaved(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLArrayHandlerInterleaved(ads);
ads.init(GLPointerFuncUtil.mgl_InterleaveArray, -1, compsPerElement, dataType, false, 0, null, initialElementCount, 0 /* mappedElementCount */, false,
glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, false);
return ads;
@@ -293,12 +293,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param mappedElementCount The total number of all interleaved elements
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
*/
- public static GLArrayDataServer createFixedInterleavedMapped(int compsPerElement, int dataType, boolean normalized, int mappedElementCount,
- int vboUsage)
+ public static GLArrayDataServer createFixedInterleavedMapped(final int compsPerElement, final int dataType, final boolean normalized, final int mappedElementCount,
+ final int vboUsage)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLArrayHandlerInterleaved(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLArrayHandlerInterleaved(ads);
ads.init(GLPointerFuncUtil.mgl_InterleaveArray, -1, compsPerElement, dataType, false, 0, null, 0 /* initialElementCount */, mappedElementCount, false,
glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, false);
ads.seal(true);
@@ -317,12 +317,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param buffer The user define data of all interleaved elements
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
*/
- public static GLArrayDataServer createFixedInterleaved(int compsPerElement, int dataType, boolean normalized, int stride, Buffer buffer,
- int vboUsage)
+ public static GLArrayDataServer createFixedInterleaved(final int compsPerElement, final int dataType, final boolean normalized, final int stride, final Buffer buffer,
+ final int vboUsage)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLArrayHandlerInterleaved(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLArrayHandlerInterleaved(ads);
ads.init(GLPointerFuncUtil.mgl_InterleaveArray, -1, compsPerElement, dataType, normalized, stride, buffer, buffer.limit(), 0 /* mappedElementCount */, false,
glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, false);
return ads;
@@ -342,7 +342,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param comps This interleaved array segment's component count per element
* @param vboTarget {@link GL#GL_ARRAY_BUFFER} or {@link GL#GL_ELEMENT_ARRAY_BUFFER}
*/
- public GLArrayData addFixedSubArray(int index, int comps, int vboTarget) {
+ public GLArrayData addFixedSubArray(final int index, final int comps, final int vboTarget) {
if(interleavedOffset >= getComponentCount() * getComponentSizeInBytes()) {
final int iOffC = interleavedOffset / getComponentSizeInBytes();
throw new GLException("Interleaved offset > total components ("+iOffC+" > "+getComponentCount()+")");
@@ -382,12 +382,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param initialElementCount The initial number of all interleaved elements
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
*/
- public static GLArrayDataServer createGLSLInterleaved(int compsPerElement, int dataType, boolean normalized, int initialElementCount,
- int vboUsage)
+ public static GLArrayDataServer createGLSLInterleaved(final int compsPerElement, final int dataType, final boolean normalized, final int initialElementCount,
+ final int vboUsage)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLSLArrayHandlerInterleaved(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLSLArrayHandlerInterleaved(ads);
ads.init(GLPointerFuncUtil.mgl_InterleaveArray, -1, compsPerElement, dataType, normalized, 0, null, initialElementCount, 0 /* mappedElementCount */, false,
glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
return ads;
@@ -404,11 +404,11 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param mappedElementCount The total number of all interleaved elements
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
*/
- public static GLArrayDataServer createGLSLInterleavedMapped(int compsPerElement, int dataType, boolean normalized, int mappedElementCount, int vboUsage)
+ public static GLArrayDataServer createGLSLInterleavedMapped(final int compsPerElement, final int dataType, final boolean normalized, final int mappedElementCount, final int vboUsage)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLSLArrayHandlerInterleaved(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLSLArrayHandlerInterleaved(ads);
ads.init(GLPointerFuncUtil.mgl_InterleaveArray, -1, compsPerElement, dataType, normalized, 0, null, 0 /* initialElementCount */, mappedElementCount, false,
glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
ads.seal(true);
@@ -427,12 +427,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param buffer The user define data of all interleaved elements
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
*/
- public static GLArrayDataServer createGLSLInterleaved(int compsPerElement, int dataType, boolean normalized, int stride, Buffer buffer,
- int vboUsage)
+ public static GLArrayDataServer createGLSLInterleaved(final int compsPerElement, final int dataType, final boolean normalized, final int stride, final Buffer buffer,
+ final int vboUsage)
throws GLException
{
- GLArrayDataServer ads = new GLArrayDataServer();
- GLArrayHandler glArrayHandler = new GLSLArrayHandlerInterleaved(ads);
+ final GLArrayDataServer ads = new GLArrayDataServer();
+ final GLArrayHandler glArrayHandler = new GLSLArrayHandlerInterleaved(ads);
ads.init(GLPointerFuncUtil.mgl_InterleaveArray, -1, compsPerElement, dataType, normalized, stride, buffer, buffer.limit(), 0 /* mappedElementCount */, false,
glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
return ads;
@@ -451,7 +451,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* @param comps This interleaved array segment's component count per element
* @param vboTarget {@link GL#GL_ARRAY_BUFFER} or {@link GL#GL_ELEMENT_ARRAY_BUFFER}
*/
- public GLArrayData addGLSLSubArray(String name, int comps, int vboTarget) {
+ public GLArrayData addGLSLSubArray(final String name, final int comps, final int vboTarget) {
if(interleavedOffset >= getComponentCount() * getComponentSizeInBytes()) {
final int iOffC = interleavedOffset / getComponentSizeInBytes();
throw new GLException("Interleaved offset > total components ("+iOffC+" > "+getComponentCount()+")");
@@ -480,7 +480,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
return ad;
}
- public final void setInterleavedOffset(int interleavedOffset) {
+ public final void setInterleavedOffset(final int interleavedOffset) {
this.interleavedOffset = interleavedOffset;
}
@@ -497,11 +497,11 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
//
@Override
- public void destroy(GL gl) {
+ public void destroy(final GL gl) {
// super.destroy(gl):
// - GLArrayDataClient.destroy(gl): disables & clears client-side buffer
// - GLArrayDataWrapper.destroy(gl) (clears all values 'vboName' ..)
- int _vboName = vboName;
+ final int _vboName = vboName;
super.destroy(gl);
if(_vboName!=0) {
final int[] tmp = new int[] { _vboName } ;
@@ -520,12 +520,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* Only possible if buffer is defined.
*/
@Override
- public void setVBOEnabled(boolean vboUsage) {
+ public void setVBOEnabled(final boolean vboUsage) {
checkSeal(false);
super.setVBOEnabled(vboUsage);
}
- public GLBufferStorage mapStorage(GL gl, int access) {
+ public GLBufferStorage mapStorage(final GL gl, final int access) {
if( null != this.getBuffer() ) {
throw new IllegalStateException("user buffer not null");
}
@@ -542,7 +542,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
rewind();
return storage;
}
- public GLBufferStorage mapStorage(GL gl, long offset, long length, int access) {
+ public GLBufferStorage mapStorage(final GL gl, final long offset, final long length, final int access) {
if( null != this.getBuffer() ) {
throw new IllegalStateException("user buffer not null");
}
@@ -559,7 +559,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
rewind();
return storage;
}
- private final void setMappedBuffer(GLBufferStorage storage) {
+ private final void setMappedBuffer(final GLBufferStorage storage) {
mappedStorage = storage;
final ByteBuffer bb = storage.getMappedBuffer();
if(componentClazz==ByteBuffer.class) {
@@ -575,7 +575,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
}
}
- public void unmapStorage(GL gl) {
+ public void unmapStorage(final GL gl) {
if( null == mappedStorage ) {
throw new IllegalStateException("not mapped");
}
@@ -621,10 +621,10 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
//
@Override
- protected void init(String name, int index, int comps, int dataType, boolean normalized,
- int stride, Buffer data, int initialElementCount, int mappedElementCount,
- boolean isVertexAttribute,
- GLArrayHandler glArrayHandler, int vboName, long vboOffset, int vboUsage, int vboTarget, boolean usesGLSL)
+ protected void init(final String name, final int index, final int comps, final int dataType, final boolean normalized,
+ final int stride, final Buffer data, final int initialElementCount, final int mappedElementCount,
+ final boolean isVertexAttribute,
+ final GLArrayHandler glArrayHandler, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget, final boolean usesGLSL)
throws GLException
{
super.init(name, index, comps, dataType, normalized, stride, data, initialElementCount, mappedElementCount, isVertexAttribute,
@@ -634,10 +634,10 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
}
@Override
- protected void init_vbo(GL gl) {
+ protected void init_vbo(final GL gl) {
super.init_vbo(gl);
if(vboEnabled && vboName==0) {
- int[] tmp = new int[1];
+ final int[] tmp = new int[1];
gl.glGenBuffers(1, tmp, 0);
vboName = tmp[0];
if(0 < interleavedOffset) {
@@ -657,7 +657,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
* All other values are simply copied.
* </p>
*/
- public GLArrayDataServer(GLArrayDataServer src) {
+ public GLArrayDataServer(final GLArrayDataServer src) {
super(src);
this.interleavedOffset = src.interleavedOffset;
this.mappedStorage = src.mappedStorage;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
index f617fed73..867bc00ac 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
@@ -66,11 +66,11 @@ public class GLArrayDataWrapper implements GLArrayData {
*
* @throws GLException
*/
- public static GLArrayDataWrapper createFixed(int index, int comps, int dataType, boolean normalized, int stride,
- Buffer buffer, int vboName, long vboOffset, int vboUsage, int vboTarget)
+ public static GLArrayDataWrapper createFixed(final int index, final int comps, final int dataType, final boolean normalized, final int stride,
+ final Buffer buffer, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget)
throws GLException
{
- GLArrayDataWrapper adc = new GLArrayDataWrapper();
+ final GLArrayDataWrapper adc = new GLArrayDataWrapper();
adc.init(null, index, comps, dataType, normalized, stride, buffer, 0 /* mappedElementCount */,
false, vboName, vboOffset, vboUsage, vboTarget);
return adc;
@@ -93,11 +93,11 @@ public class GLArrayDataWrapper implements GLArrayData {
*
* @throws GLException
*/
- public static GLArrayDataWrapper createFixed(int index, int comps, int dataType, boolean normalized, int stride,
- int mappedElementCount, int vboName, long vboOffset, int vboUsage, int vboTarget)
+ public static GLArrayDataWrapper createFixed(final int index, final int comps, final int dataType, final boolean normalized, final int stride,
+ final int mappedElementCount, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget)
throws GLException
{
- GLArrayDataWrapper adc = new GLArrayDataWrapper();
+ final GLArrayDataWrapper adc = new GLArrayDataWrapper();
adc.init(null, index, comps, dataType, normalized, stride, null, mappedElementCount,
false, vboName, vboOffset, vboUsage, vboTarget);
return adc;
@@ -119,11 +119,11 @@ public class GLArrayDataWrapper implements GLArrayData {
* @return the new create instance
* @throws GLException
*/
- public static GLArrayDataWrapper createGLSL(String name, int comps, int dataType, boolean normalized, int stride,
- Buffer buffer, int vboName, long vboOffset, int vboUsage, int vboTarget)
+ public static GLArrayDataWrapper createGLSL(final String name, final int comps, final int dataType, final boolean normalized, final int stride,
+ final Buffer buffer, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget)
throws GLException
{
- GLArrayDataWrapper adc = new GLArrayDataWrapper();
+ final GLArrayDataWrapper adc = new GLArrayDataWrapper();
adc.init(name, -1, comps, dataType, normalized, stride, buffer, 0 /* mappedElementCount */,
true, vboName, vboOffset, vboUsage, vboTarget);
return adc;
@@ -145,11 +145,11 @@ public class GLArrayDataWrapper implements GLArrayData {
* @return the new create instance
* @throws GLException
*/
- public static GLArrayDataWrapper createGLSL(String name, int comps, int dataType, boolean normalized, int stride,
- int mappedElementCount, int vboName, long vboOffset, int vboUsage, int vboTarget)
+ public static GLArrayDataWrapper createGLSL(final String name, final int comps, final int dataType, final boolean normalized, final int stride,
+ final int mappedElementCount, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget)
throws GLException
{
- GLArrayDataWrapper adc = new GLArrayDataWrapper();
+ final GLArrayDataWrapper adc = new GLArrayDataWrapper();
adc.init(name, -1, comps, dataType, normalized, stride, null, mappedElementCount,
true, vboName, vboOffset, vboUsage, vboTarget);
return adc;
@@ -163,7 +163,7 @@ public class GLArrayDataWrapper implements GLArrayData {
* @param throwException whether to throw an exception if this instance has invalid parameter or not
* @return true if this instance has invalid parameter, otherwise false
*/
- public final boolean validate(GLProfile glp, boolean throwException) {
+ public final boolean validate(final GLProfile glp, final boolean throwException) {
if(!alive) {
if(throwException) {
throw new GLException("Instance !alive "+this);
@@ -180,7 +180,7 @@ public class GLArrayDataWrapper implements GLArrayData {
}
@Override
- public void associate(Object obj, boolean enable) {
+ public void associate(final Object obj, final boolean enable) {
// nop
}
@@ -198,16 +198,16 @@ public class GLArrayDataWrapper implements GLArrayData {
public final int getLocation() { return location; }
@Override
- public final int setLocation(int v) { location = v; return location; }
+ public final int setLocation(final int v) { location = v; return location; }
@Override
- public final int setLocation(GL2ES2 gl, int program) {
+ public final int setLocation(final GL2ES2 gl, final int program) {
location = gl.glGetAttribLocation(program, name);
return location;
}
@Override
- public final int setLocation(GL2ES2 gl, int program, int location) {
+ public final int setLocation(final GL2ES2 gl, final int program, final int location) {
this.location = location;
gl.glBindAttribLocation(program, location, name);
return location;
@@ -275,7 +275,7 @@ public class GLArrayDataWrapper implements GLArrayData {
public final Class<?> getBufferClass() { return componentClazz; }
@Override
- public void destroy(GL gl) {
+ public void destroy(final GL gl) {
buffer = null;
vboName=0;
vboEnabled=false;
@@ -305,7 +305,7 @@ public class GLArrayDataWrapper implements GLArrayData {
"]";
}
- public static final Class<?> getBufferClass(int dataType) {
+ public static final Class<?> getBufferClass(final int dataType) {
switch(dataType) {
case GL.GL_BYTE:
case GL.GL_UNSIGNED_BYTE:
@@ -314,7 +314,7 @@ public class GLArrayDataWrapper implements GLArrayData {
case GL.GL_UNSIGNED_SHORT:
return ShortBuffer.class;
case GL.GL_UNSIGNED_INT:
- case GL2ES1.GL_FIXED:
+ case GL.GL_FIXED:
case GL2ES2.GL_INT:
return IntBuffer.class;
case GL.GL_FLOAT:
@@ -325,7 +325,7 @@ public class GLArrayDataWrapper implements GLArrayData {
}
@Override
- public void setName(String newName) {
+ public void setName(final String newName) {
location = -1;
name = newName;
}
@@ -335,7 +335,7 @@ public class GLArrayDataWrapper implements GLArrayData {
* Only possible if a VBO buffer name is defined.
* @see #setVBOName(int)
*/
- public void setVBOEnabled(boolean vboEnabled) {
+ public void setVBOEnabled(final boolean vboEnabled) {
this.vboEnabled=vboEnabled;
}
@@ -345,7 +345,7 @@ public class GLArrayDataWrapper implements GLArrayData {
*
* @see #setVBOEnabled(boolean)
*/
- public void setVBOName(int vboName) {
+ public void setVBOName(final int vboName) {
this.vboName=vboName;
setVBOEnabled(0!=vboName);
}
@@ -353,20 +353,20 @@ public class GLArrayDataWrapper implements GLArrayData {
/**
* @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
*/
- public void setVBOUsage(int vboUsage) {
+ public void setVBOUsage(final int vboUsage) {
this.vboUsage = vboUsage;
}
/**
* @param vboTarget either {@link GL#GL_ARRAY_BUFFER} or {@link GL#GL_ELEMENT_ARRAY_BUFFER}
*/
- public void setVBOTarget(int vboTarget) {
+ public void setVBOTarget(final int vboTarget) {
this.vboTarget = vboTarget;
}
- protected void init(String name, int index, int componentsPerElement, int componentType,
- boolean normalized, int stride, Buffer data, int mappedElementCount,
- boolean isVertexAttribute, int vboName, long vboOffset, int vboUsage, int vboTarget)
+ protected void init(final String name, final int index, final int componentsPerElement, final int componentType,
+ final boolean normalized, final int stride, final Buffer data, final int mappedElementCount,
+ final boolean isVertexAttribute, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget)
throws GLException
{
if( 0<mappedElementCount && null != data ) {
@@ -452,7 +452,7 @@ public class GLArrayDataWrapper implements GLArrayData {
* All other values are simply copied.
* </p>
*/
- public GLArrayDataWrapper(GLArrayDataWrapper src) {
+ public GLArrayDataWrapper(final GLArrayDataWrapper src) {
this.alive = src.alive;
this.index = src.index;
this.location = src.location;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
index b9903ac6d..67dc08450 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
@@ -44,6 +44,7 @@ import java.nio.ByteBuffer;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL2ES3;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLES2;
import javax.media.opengl.GLException;
@@ -65,7 +66,7 @@ public class GLBuffers extends Buffers {
* GL_UNSIGNED_INT, <br/>
* GL_HILO16_NV <br/>
*/
- public static final boolean isSignedGLType(int glType) {
+ public static final boolean isSignedGLType(final int glType) {
switch (glType) { // 29
case GL.GL_UNSIGNED_BYTE:
case GL.GL_UNSIGNED_SHORT:
@@ -85,7 +86,7 @@ public class GLBuffers extends Buffers {
* GL_HALF_FLOAT_OES, <br/>
* GL_DOUBLE <br/>
*/
- public static final boolean isGLTypeFixedPoint(int glType) {
+ public static final boolean isGLTypeFixedPoint(final int glType) {
switch(glType) {
case GL.GL_FLOAT:
case GL.GL_HALF_FLOAT:
@@ -123,7 +124,7 @@ public class GLBuffers extends Buffers {
*
* @return -1 if glType is unhandled, otherwise the actual value > 0
*/
- public static final int sizeOfGLType(int glType) {
+ public static final int sizeOfGLType(final int glType) {
switch (glType) { // 29
// case GL2.GL_BITMAP:
case GL.GL_BYTE:
@@ -136,9 +137,9 @@ public class GLBuffers extends Buffers {
case GL.GL_UNSIGNED_SHORT:
case GL.GL_UNSIGNED_SHORT_5_6_5:
case GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL.GL_UNSIGNED_SHORT_4_4_4_4:
case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL.GL_UNSIGNED_SHORT_5_5_5_1:
case GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV:
case GL2.GL_UNSIGNED_SHORT_8_8_APPLE:
case GL2.GL_UNSIGNED_SHORT_8_8_REV_APPLE:
@@ -151,16 +152,16 @@ public class GLBuffers extends Buffers {
case GL.GL_UNSIGNED_INT:
case GL2GL3.GL_UNSIGNED_INT_8_8_8_8:
case GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL2GL3.GL_UNSIGNED_INT_10_10_10_2:
- case GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV:
- case GL2GL3.GL_UNSIGNED_INT_24_8:
- case GL2GL3.GL_UNSIGNED_INT_10F_11F_11F_REV:
- case GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV:
+ case GL2ES2.GL_UNSIGNED_INT_10_10_10_2:
+ case GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV:
+ case GL.GL_UNSIGNED_INT_24_8:
+ case GL.GL_UNSIGNED_INT_10F_11F_11F_REV:
+ case GL2ES3.GL_UNSIGNED_INT_5_9_9_9_REV:
case GL2.GL_HILO16_NV:
case GL2.GL_SIGNED_HILO16_NV:
return SIZEOF_INT;
- case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+ case GL2ES3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
return SIZEOF_LONG;
case GL.GL_FLOAT:
@@ -197,7 +198,7 @@ public class GLBuffers extends Buffers {
*
* @return null if glType is unhandled, otherwise the new Buffer object
*/
- public static final Buffer newDirectGLBuffer(int glType, int numElements) {
+ public static final Buffer newDirectGLBuffer(final int glType, final int numElements) {
switch (glType) { // 29
case GL.GL_BYTE:
case GL.GL_UNSIGNED_BYTE:
@@ -209,9 +210,9 @@ public class GLBuffers extends Buffers {
case GL.GL_UNSIGNED_SHORT:
case GL.GL_UNSIGNED_SHORT_5_6_5:
case GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL.GL_UNSIGNED_SHORT_4_4_4_4:
case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL.GL_UNSIGNED_SHORT_5_5_5_1:
case GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV:
case GL2.GL_UNSIGNED_SHORT_8_8_APPLE:
case GL2.GL_UNSIGNED_SHORT_8_8_REV_APPLE:
@@ -224,22 +225,22 @@ public class GLBuffers extends Buffers {
case GL.GL_UNSIGNED_INT:
case GL2GL3.GL_UNSIGNED_INT_8_8_8_8:
case GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL2GL3.GL_UNSIGNED_INT_10_10_10_2:
- case GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV:
- case GL2GL3.GL_UNSIGNED_INT_24_8:
- case GL2GL3.GL_UNSIGNED_INT_10F_11F_11F_REV:
- case GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV:
+ case GL2ES2.GL_UNSIGNED_INT_10_10_10_2:
+ case GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV:
+ case GL.GL_UNSIGNED_INT_24_8:
+ case GL.GL_UNSIGNED_INT_10F_11F_11F_REV:
+ case GL2ES3.GL_UNSIGNED_INT_5_9_9_9_REV:
case GL2.GL_HILO16_NV:
case GL2.GL_SIGNED_HILO16_NV:
return newDirectIntBuffer(numElements);
- case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+ case GL2ES3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
return newDirectLongBuffer(numElements);
case GL.GL_FLOAT:
return newDirectFloatBuffer(numElements);
- case GL2.GL_DOUBLE:
+ case GL2GL3.GL_DOUBLE:
return newDirectDoubleBuffer(numElements);
}
return null;
@@ -269,7 +270,7 @@ public class GLBuffers extends Buffers {
* GL_FLOAT, GL_DOUBLE <br/>
* @return null if glType is unhandled or parent is null or bufLen is 0, otherwise the new Buffer object
*/
- public static final Buffer sliceGLBuffer(ByteBuffer parent, int bytePos, int byteLen, int glType) {
+ public static final Buffer sliceGLBuffer(final ByteBuffer parent, final int bytePos, final int byteLen, final int glType) {
if (parent == null || byteLen == 0) {
return null;
}
@@ -292,9 +293,9 @@ public class GLBuffers extends Buffers {
case GL.GL_UNSIGNED_SHORT:
case GL.GL_UNSIGNED_SHORT_5_6_5:
case GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL.GL_UNSIGNED_SHORT_4_4_4_4:
case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL.GL_UNSIGNED_SHORT_5_5_5_1:
case GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV:
case GL2.GL_UNSIGNED_SHORT_8_8_APPLE:
case GL2.GL_UNSIGNED_SHORT_8_8_REV_APPLE:
@@ -304,21 +305,21 @@ public class GLBuffers extends Buffers {
break;
case GL.GL_FIXED:
- case GL2GL3.GL_INT:
- case GL2ES2.GL_UNSIGNED_INT:
+ case GL2ES2.GL_INT:
+ case GL.GL_UNSIGNED_INT:
case GL2GL3.GL_UNSIGNED_INT_8_8_8_8:
case GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL2GL3.GL_UNSIGNED_INT_10_10_10_2:
- case GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV:
- case GL2GL3.GL_UNSIGNED_INT_24_8:
- case GL2GL3.GL_UNSIGNED_INT_10F_11F_11F_REV:
- case GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV:
+ case GL2ES2.GL_UNSIGNED_INT_10_10_10_2:
+ case GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV:
+ case GL.GL_UNSIGNED_INT_24_8:
+ case GL.GL_UNSIGNED_INT_10F_11F_11F_REV:
+ case GL2ES3.GL_UNSIGNED_INT_5_9_9_9_REV:
case GL2.GL_HILO16_NV:
case GL2.GL_SIGNED_HILO16_NV:
res = parent.slice().order(parent.order()).asIntBuffer(); // slice and duplicate may change byte order
break;
- case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+ case GL2ES3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
res = parent.slice().order(parent.order()).asLongBuffer(); // slice and duplicate may change byte order
break;
@@ -326,7 +327,7 @@ public class GLBuffers extends Buffers {
res = parent.slice().order(parent.order()).asFloatBuffer(); // slice and duplicate may change byte order
break;
- case GL2.GL_DOUBLE:
+ case GL2GL3.GL_DOUBLE:
res = parent.slice().order(parent.order()).asDoubleBuffer(); // slice and duplicate may change byte order
break;
}
@@ -334,7 +335,7 @@ public class GLBuffers extends Buffers {
return res;
}
- private static final int glGetInteger(GL gl, int pname, int[] tmp) {
+ private static final int glGetInteger(final GL gl, final int pname, final int[] tmp) {
gl.glGetIntegerv(pname, tmp, 0);
return tmp[0];
}
@@ -359,9 +360,9 @@ public class GLBuffers extends Buffers {
* @return required minimum size of the buffer in bytes
* @throws GLException if alignment is invalid. Please contact the maintainer if this is our bug.
*/
- public static final int sizeof(GL gl, int tmp[],
- int bytesPerPixel, int width, int height, int depth,
- boolean pack) {
+ public static final int sizeof(final GL gl, final int tmp[],
+ final int bytesPerPixel, int width, int height, int depth,
+ final boolean pack) {
int rowLength = 0;
int skipRows = 0;
int skipPixels = 0;
@@ -372,9 +373,9 @@ public class GLBuffers extends Buffers {
if (pack) {
alignment = glGetInteger(gl, GL.GL_PACK_ALIGNMENT, tmp);
if(gl.isGL2GL3()) {
- rowLength = glGetInteger(gl, GL2GL3.GL_PACK_ROW_LENGTH, tmp);
- skipRows = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_ROWS, tmp);
- skipPixels = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_PIXELS, tmp);
+ rowLength = glGetInteger(gl, GL2ES3.GL_PACK_ROW_LENGTH, tmp);
+ skipRows = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_ROWS, tmp);
+ skipPixels = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_PIXELS, tmp);
if (depth > 1) {
imageHeight = glGetInteger(gl, GL2GL3.GL_PACK_IMAGE_HEIGHT, tmp);
skipImages = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_IMAGES, tmp);
@@ -383,12 +384,12 @@ public class GLBuffers extends Buffers {
} else {
alignment = glGetInteger(gl, GL.GL_UNPACK_ALIGNMENT, tmp);
if(gl.isGL2GL3 ()) {
- rowLength = glGetInteger(gl, GL2GL3.GL_UNPACK_ROW_LENGTH, tmp);
- skipRows = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_ROWS, tmp);
- skipPixels = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_PIXELS, tmp);
+ rowLength = glGetInteger(gl, GL2ES2.GL_UNPACK_ROW_LENGTH, tmp);
+ skipRows = glGetInteger(gl, GL2ES2.GL_UNPACK_SKIP_ROWS, tmp);
+ skipPixels = glGetInteger(gl, GL2ES2.GL_UNPACK_SKIP_PIXELS, tmp);
if (depth > 1) {
- imageHeight = glGetInteger(gl, GL2GL3.GL_UNPACK_IMAGE_HEIGHT, tmp);
- skipImages = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_IMAGES, tmp);
+ imageHeight = glGetInteger(gl, GL2ES3.GL_UNPACK_IMAGE_HEIGHT, tmp);
+ skipImages = glGetInteger(gl, GL2ES3.GL_UNPACK_SKIP_IMAGES, tmp);
}
}
}
@@ -511,9 +512,9 @@ public class GLBuffers extends Buffers {
* @return required minimum size of the buffer in bytes
* @throws GLException if format, type or alignment is not handled. Please contact the maintainer if this is our bug.
*/
- public static final int sizeof(GL gl, int tmp[],
- int format, int type, int width, int height, int depth,
- boolean pack) throws GLException {
+ public static final int sizeof(final GL gl, final int tmp[],
+ final int format, final int type, final int width, final int height, final int depth,
+ final boolean pack) throws GLException {
if (width < 0) return 0;
if (height < 0) return 0;
if (depth < 0) return 0;
@@ -578,14 +579,14 @@ public class GLBuffers extends Buffers {
* @return required size of one pixel in bytes
* @throws GLException if format or type alignment is not handled. Please contact the maintainer if this is our bug.
*/
- public static final int bytesPerPixel(int format, int type) throws GLException {
+ public static final int bytesPerPixel(final int format, final int type) throws GLException {
int compSize = 0;
int compCount = componentCount(format);
switch (type) /* 30 */ {
case GL2.GL_BITMAP:
- if (GL2.GL_COLOR_INDEX == format || GL2GL3.GL_STENCIL_INDEX == format) {
+ if (GL2.GL_COLOR_INDEX == format || GL2ES2.GL_STENCIL_INDEX == format) {
compSize = 1;
}
case GL.GL_BYTE:
@@ -615,9 +616,9 @@ public class GLBuffers extends Buffers {
break;
case GL.GL_UNSIGNED_SHORT_5_6_5:
case GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL.GL_UNSIGNED_SHORT_4_4_4_4:
case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL.GL_UNSIGNED_SHORT_5_5_5_1:
case GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV:
case GL2.GL_UNSIGNED_SHORT_8_8_APPLE:
case GL2.GL_UNSIGNED_SHORT_8_8_REV_APPLE:
@@ -631,15 +632,15 @@ public class GLBuffers extends Buffers {
break;
case GL2GL3.GL_UNSIGNED_INT_8_8_8_8:
case GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL2GL3.GL_UNSIGNED_INT_10_10_10_2:
- case GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV:
- case GL2GL3.GL_UNSIGNED_INT_24_8:
- case GL2GL3.GL_UNSIGNED_INT_10F_11F_11F_REV:
- case GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV:
+ case GL2ES2.GL_UNSIGNED_INT_10_10_10_2:
+ case GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV:
+ case GL.GL_UNSIGNED_INT_24_8:
+ case GL.GL_UNSIGNED_INT_10F_11F_11F_REV:
+ case GL2ES3.GL_UNSIGNED_INT_5_9_9_9_REV:
compSize = 4;
compCount = 1;
break;
- case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+ case GL2ES3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
compSize = 8;
compCount = 1;
break;
@@ -681,33 +682,33 @@ public class GLBuffers extends Buffers {
* @return number of components required for the given OpenGL format
* @throws GLException if format is not handled. Please contact the maintainer if this is our bug.
*/
- public static final int componentCount(int format) throws GLException {
+ public static final int componentCount(final int format) throws GLException {
final int compCount;
switch (format) /* 26 */ {
case GL2.GL_COLOR_INDEX:
- case GL2GL3.GL_STENCIL_INDEX:
- case GL2GL3.GL_DEPTH_COMPONENT:
- case GL2GL3.GL_DEPTH_STENCIL:
- case GL2GL3.GL_RED:
- case GL2GL3.GL_RED_INTEGER:
- case GL2GL3.GL_GREEN:
+ case GL2ES2.GL_STENCIL_INDEX:
+ case GL2ES2.GL_DEPTH_COMPONENT:
+ case GL.GL_DEPTH_STENCIL:
+ case GL2ES2.GL_RED:
+ case GL2ES3.GL_RED_INTEGER:
+ case GL2ES3.GL_GREEN:
case GL2GL3.GL_GREEN_INTEGER:
- case GL2GL3.GL_BLUE:
+ case GL2ES3.GL_BLUE:
case GL2GL3.GL_BLUE_INTEGER:
case GL.GL_ALPHA:
case GL.GL_LUMINANCE:
compCount = 1;
break;
case GL.GL_LUMINANCE_ALPHA:
- case GL2GL3.GL_RG:
- case GL2GL3.GL_RG_INTEGER:
+ case GL2ES2.GL_RG:
+ case GL2ES3.GL_RG_INTEGER:
case GL2.GL_HILO_NV:
case GL2.GL_SIGNED_HILO_NV:
compCount = 2;
break;
case GL.GL_RGB:
- case GL2GL3.GL_RGB_INTEGER:
+ case GL2ES3.GL_RGB_INTEGER:
case GL2GL3.GL_BGR:
case GL2GL3.GL_BGR_INTEGER:
compCount = 3;
@@ -716,7 +717,7 @@ public class GLBuffers extends Buffers {
compCount = 3;
break;
case GL.GL_RGBA:
- case GL2GL3.GL_RGBA_INTEGER:
+ case GL2ES3.GL_RGBA_INTEGER:
case GL.GL_BGRA:
case GL2GL3.GL_BGRA_INTEGER:
case GL2.GL_ABGR_EXT:
@@ -748,9 +749,9 @@ public class GLBuffers extends Buffers {
//----------------------------------------------------------------------
// Conversion routines
//
- public final static float[] getFloatArray(double[] source) {
+ public final static float[] getFloatArray(final double[] source) {
int i = source.length;
- float[] dest = new float[i--];
+ final float[] dest = new float[i--];
while (i >= 0) {
dest[i] = (float) source[i];
i--;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java b/src/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java
index cf88e7bf6..c74284299 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java
@@ -47,19 +47,19 @@ import jogamp.opengl.Debug;
public class GLDrawableUtil {
protected static final boolean DEBUG = Debug.debug("GLDrawable");
- public static final boolean isAnimatorStartedOnOtherThread(GLAnimatorControl animatorCtrl) {
+ public static final boolean isAnimatorStartedOnOtherThread(final GLAnimatorControl animatorCtrl) {
return ( null != animatorCtrl ) ? animatorCtrl.isStarted() && animatorCtrl.getThread() != Thread.currentThread() : false ;
}
- public static final boolean isAnimatorStarted(GLAnimatorControl animatorCtrl) {
+ public static final boolean isAnimatorStarted(final GLAnimatorControl animatorCtrl) {
return ( null != animatorCtrl ) ? animatorCtrl.isStarted() : false ;
}
- public static final boolean isAnimatorAnimatingOnOtherThread(GLAnimatorControl animatorCtrl) {
+ public static final boolean isAnimatorAnimatingOnOtherThread(final GLAnimatorControl animatorCtrl) {
return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() && animatorCtrl.getThread() != Thread.currentThread() : false ;
}
- public static final boolean isAnimatorAnimating(GLAnimatorControl animatorCtrl) {
+ public static final boolean isAnimatorAnimating(final GLAnimatorControl animatorCtrl) {
return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() : false ;
}
@@ -79,7 +79,7 @@ public class GLDrawableUtil {
* @param listener
* @param preserveInitState
*/
- public static final void moveGLEventListener(GLAutoDrawable src, GLAutoDrawable dest, GLEventListener listener, boolean preserveInitState) {
+ public static final void moveGLEventListener(final GLAutoDrawable src, final GLAutoDrawable dest, final GLEventListener listener, final boolean preserveInitState) {
final boolean initialized = src.getGLEventListenerInitState(listener);
src.removeGLEventListener(listener);
dest.addGLEventListener(listener);
@@ -105,7 +105,7 @@ public class GLDrawableUtil {
* @param listener
* @param preserveInitState
*/
- public static final void moveAllGLEventListener(GLAutoDrawable src, GLAutoDrawable dest, boolean preserveInitState) {
+ public static final void moveAllGLEventListener(final GLAutoDrawable src, final GLAutoDrawable dest, final boolean preserveInitState) {
for(int count = src.getGLEventListenerCount(); 0<count; count--) {
final GLEventListener listener = src.getGLEventListener(0);
moveGLEventListener(src, dest, listener, preserveInitState);
@@ -127,7 +127,7 @@ public class GLDrawableUtil {
* @param b
* @throws GLException if the {@link AbstractGraphicsDevice} are incompatible w/ each other.
*/
- public static final void swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b) {
+ public static final void swapGLContextAndAllGLEventListener(final GLAutoDrawable a, final GLAutoDrawable b) {
final GLEventListenerState gllsA = GLEventListenerState.moveFrom(a);
final GLEventListenerState gllsB = GLEventListenerState.moveFrom(b);
@@ -149,7 +149,7 @@ public class GLDrawableUtil {
* @param src
* @param dest
*/
- public static final void swapGLContext(GLAutoDrawable src, GLAutoDrawable dest) {
+ public static final void swapGLContext(final GLAutoDrawable src, final GLAutoDrawable dest) {
final GLAnimatorControl aAnim = src.getAnimator();
final GLAnimatorControl bAnim = dest.getAnimator();
final boolean aIsPaused = isAnimatorAnimatingOnOtherThread(aAnim) && aAnim.pause();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
index 223c23ebb..ec2991448 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
@@ -103,7 +103,7 @@ public class GLPixelBuffer {
* @param allowRowStride If <code>true</code>, allow row-stride, otherwise not.
* See {@link #getAllowRowStride()} and {@link GLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
*/
- public DefaultGLPixelBufferProvider(boolean allowRowStride) {
+ public DefaultGLPixelBufferProvider(final boolean allowRowStride) {
this.allowRowStride = allowRowStride;
}
@@ -111,7 +111,7 @@ public class GLPixelBuffer {
public boolean getAllowRowStride() { return allowRowStride; }
@Override
- public GLPixelAttributes getAttributes(GL gl, int componentCount) {
+ public GLPixelAttributes getAttributes(final GL gl, final int componentCount) {
final GLContext ctx = gl.getContext();
final int dFormat, dType;
@@ -121,14 +121,14 @@ public class GLPixelBuffer {
dFormat = GL2ES2.GL_RED;
} else {
// ALPHA is supported on ES2 and GL2, i.e. <= GL3 [core] or compatibility
- dFormat = GL2ES2.GL_ALPHA;
+ dFormat = GL.GL_ALPHA;
}
dType = GL.GL_UNSIGNED_BYTE;
} else if( 3 == componentCount ) {
dFormat = GL.GL_RGB;
dType = GL.GL_UNSIGNED_BYTE;
} else if( 4 == componentCount ) {
- int _dFormat = ctx.getDefaultPixelDataFormat();
+ final int _dFormat = ctx.getDefaultPixelDataFormat();
final int dComps = GLBuffers.componentCount(_dFormat);
if( dComps == componentCount ) {
dFormat = _dFormat;
@@ -150,11 +150,11 @@ public class GLPixelBuffer {
* </p>
*/
@Override
- public GLPixelBuffer allocate(GL gl, GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
+ public GLPixelBuffer allocate(final GL gl, final GLPixelAttributes pixelAttributes, final int width, final int height, final int depth, final boolean pack, final int minByteSize) {
if( minByteSize > 0 ) {
return new GLPixelBuffer(pixelAttributes, width, height, depth, pack, Buffers.newDirectByteBuffer(minByteSize), getAllowRowStride());
} else {
- int[] tmp = { 0 };
+ final int[] tmp = { 0 };
final int byteSize = GLBuffers.sizeof(gl, tmp, pixelAttributes.bytesPerPixel, width, height, depth, pack);
return new GLPixelBuffer(pixelAttributes, width, height, depth, pack, Buffers.newDirectByteBuffer(byteSize), getAllowRowStride());
}
@@ -194,7 +194,7 @@ public class GLPixelBuffer {
* @param dataFormat GL data format
* @param dataType GL data type
*/
- public GLPixelAttributes(int dataFormat, int dataType) {
+ public GLPixelAttributes(final int dataFormat, final int dataType) {
this(0 < dataFormat ? GLBuffers.componentCount(dataFormat) : 0, dataFormat, dataType);
}
/**
@@ -203,7 +203,7 @@ public class GLPixelBuffer {
* @param dataFormat GL data format
* @param dataType GL data type
*/
- public GLPixelAttributes(int componentCount, int dataFormat, int dataType) {
+ public GLPixelAttributes(final int componentCount, final int dataFormat, final int dataType) {
this(componentCount, dataFormat, dataType, true);
}
@@ -211,7 +211,7 @@ public class GLPixelBuffer {
* Returns the matching {@link GLPixelAttributes} for the given {@link PixelFormat} and {@link GLProfile} if exists,
* otherwise returns <code>null</code>.
*/
- public static final GLPixelAttributes convert(PixelFormat pixFmt, GLProfile glp) {
+ public static final GLPixelAttributes convert(final PixelFormat pixFmt, final GLProfile glp) {
int df = 0; // format
int dt = GL.GL_UNSIGNED_BYTE; // data type
switch(pixFmt) {
@@ -221,7 +221,7 @@ public class GLPixelBuffer {
df = GL2ES2.GL_RED;
} else {
// ALPHA/LUMINANCE is supported on ES2 and GL2, i.e. <= GL3 [core] or compatibility
- df = GL2ES2.GL_LUMINANCE;
+ df = GL.GL_LUMINANCE;
}
break;
case BGR888:
@@ -256,7 +256,7 @@ public class GLPixelBuffer {
}
return null;
}
- private GLPixelAttributes(int componentCount, int dataFormat, int dataType, boolean checkArgs) {
+ private GLPixelAttributes(final int componentCount, final int dataFormat, final int dataType, final boolean checkArgs) {
this.componentCount = componentCount;
this.format = dataFormat;
this.type = dataType;
@@ -290,7 +290,7 @@ public class GLPixelBuffer {
case GL.GL_RGBA:
pixFmt = PixelFormat.RGBA8888;
break;
- case GL2.GL_BGR:
+ case GL2GL3.GL_BGR:
pixFmt = PixelFormat.BGR888;
break;
case GL.GL_BGRA:
@@ -383,7 +383,7 @@ public class GLPixelBuffer {
* @param buffer the backing array
* @param allowRowStride If <code>true</code>, allow row-stride, otherwise not. See {@link #requiresNewBuffer(GL, int, int, int)}.
*/
- public GLPixelBuffer(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, Buffer buffer, boolean allowRowStride) {
+ public GLPixelBuffer(final GLPixelAttributes pixelAttributes, final int width, final int height, final int depth, final boolean pack, final Buffer buffer, final boolean allowRowStride) {
this.pixelAttributes = pixelAttributes;
this.width = width;
this.height = height;
@@ -414,7 +414,7 @@ public class GLPixelBuffer {
}
/** Sets the byte position of the {@link #buffer}. */
- public Buffer position(int bytePos) {
+ public Buffer position(final int bytePos) {
return buffer.position( bytePos / bufferElemSize );
}
@@ -465,7 +465,7 @@ public class GLPixelBuffer {
* @param newByteSize if &gt; 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.
* @see GLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int)
*/
- public boolean requiresNewBuffer(GL gl, int newWidth, int newHeight, int newByteSize) {
+ public boolean requiresNewBuffer(final GL gl, final int newWidth, final int newHeight, int newByteSize) {
if( !isValid() ) {
return true;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java b/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
index 34b493586..52612d224 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
@@ -171,7 +171,7 @@ public class GLPixelStorageModes {
*/
public final void resetPack(final GL gl) {
// Compared w/ ES2, ES3 and GL3-core spec
- gl.glPixelStorei(GL2ES2.GL_PACK_ALIGNMENT, 4); // es2, es3, gl3
+ gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, 4); // es2, es3, gl3
if( gl.isGL2ES3() ) {
gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, 0); // es3, gl3
gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_ROWS, 0); // es3, gl3
@@ -202,7 +202,7 @@ public class GLPixelStorageModes {
gl.getGL2().glPushClientAttrib(GL2.GL_CLIENT_PIXEL_STORE_BIT);
} else {
// ES1 or ES2 deals with pack/unpack alignment only
- gl.glGetIntegerv(GL2ES2.GL_PACK_ALIGNMENT, cachePack, 0);
+ gl.glGetIntegerv(GL.GL_PACK_ALIGNMENT, cachePack, 0);
if( gl.isGL2ES3() ) {
gl.glGetIntegerv(GL2ES3.GL_PACK_ROW_LENGTH, cachePack, 1);
gl.glGetIntegerv(GL2ES3.GL_PACK_SKIP_ROWS, cachePack, 2);
@@ -222,7 +222,7 @@ public class GLPixelStorageModes {
if( gl.isGL2() ) {
gl.getGL2().glPopClientAttrib();
} else {
- gl.glPixelStorei(GL2ES2.GL_PACK_ALIGNMENT, cachePack[0]);
+ gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, cachePack[0]);
if( gl.isGL2ES3() ) {
gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, cachePack[1]);
gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_ROWS, cachePack[2]);
@@ -242,7 +242,7 @@ public class GLPixelStorageModes {
*/
public final void resetUnpack(final GL gl) {
// Compared w/ ES2, ES3 and GL3-core spec
- gl.glPixelStorei(GL2ES2.GL_UNPACK_ALIGNMENT, 4); // es2, es3, gl3
+ gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 4); // es2, es3, gl3
if( gl.isGL2ES3() ) {
gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, 0); // es3, gl3
gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS, 0); // es3, gl3
@@ -273,7 +273,7 @@ public class GLPixelStorageModes {
gl.getGL2().glPushClientAttrib(GL2.GL_CLIENT_PIXEL_STORE_BIT);
} else {
// ES1 or ES2 deals with pack/unpack alignment only
- gl.glGetIntegerv(GL2ES2.GL_UNPACK_ALIGNMENT, cacheUnpack, 0);
+ gl.glGetIntegerv(GL.GL_UNPACK_ALIGNMENT, cacheUnpack, 0);
if( gl.isGL2ES3() ) {
gl.glGetIntegerv(GL2ES2.GL_UNPACK_ROW_LENGTH, cacheUnpack, 1);
gl.glGetIntegerv(GL2ES2.GL_UNPACK_SKIP_ROWS, cacheUnpack, 2);
@@ -293,7 +293,7 @@ public class GLPixelStorageModes {
if( gl.isGL2() ) {
gl.getGL2().glPopClientAttrib();
} else {
- gl.glPixelStorei(GL2ES2.GL_UNPACK_ALIGNMENT, cacheUnpack[0]);
+ gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, cacheUnpack[0]);
if( gl.isGL2ES3() ) {
gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, cacheUnpack[1]);
gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS, cacheUnpack[2]);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java
index 680984cdb..abdb7c5f9 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java
@@ -62,11 +62,11 @@ public class GLReadBufferUtil {
* @param alpha true for RGBA readPixels, otherwise RGB readPixels. Disclaimer: Alpha maybe forced on ES platforms!
* @param write2Texture true if readPixel's TextureData shall be written to a 2d Texture
*/
- public GLReadBufferUtil(boolean alpha, boolean write2Texture) {
+ public GLReadBufferUtil(final boolean alpha, final boolean write2Texture) {
this(GLPixelBuffer.defaultProviderNoRowStride, alpha, write2Texture);
}
- public GLReadBufferUtil(GLPixelBufferProvider pixelBufferProvider, boolean alpha, boolean write2Texture) {
+ public GLReadBufferUtil(final GLPixelBufferProvider pixelBufferProvider, final boolean alpha, final boolean write2Texture) {
this.pixelBufferProvider = pixelBufferProvider;
this.componentCount = alpha ? 4 : 3 ;
this.alignment = alpha ? 4 : 1 ;
@@ -110,11 +110,11 @@ public class GLReadBufferUtil {
/**
* Write the TextureData filled by {@link #readPixels(GLAutoDrawable, boolean)} to file
*/
- public void write(File dest) {
+ public void write(final File dest) {
try {
TextureIO.write(readTextureData, dest);
rewindPixelBuffer();
- } catch (IOException ex) {
+ } catch (final IOException ex) {
throw new RuntimeException("can not write to file: " + dest.getAbsolutePath(), ex);
}
}
@@ -131,7 +131,7 @@ public class GLReadBufferUtil {
*
* @see #GLReadBufferUtil(boolean, boolean)
*/
- public boolean readPixels(GL gl, boolean mustFlipVertically) {
+ public boolean readPixels(final GL gl, final boolean mustFlipVertically) {
return readPixels(gl, 0, 0, 0, 0, mustFlipVertically);
}
@@ -150,7 +150,7 @@ public class GLReadBufferUtil {
* and handled in a efficient manner there (TextureCoordinates and TextureIO writer).
* @see #GLReadBufferUtil(boolean, boolean)
*/
- public boolean readPixels(GL gl, int inX, int inY, int inWidth, int inHeight, boolean mustFlipVertically) {
+ public boolean readPixels(final GL gl, final int inX, final int inY, final int inWidth, final int inHeight, final boolean mustFlipVertically) {
final GLDrawable drawable = gl.getContext().getGLReadDrawable();
final int width, height;
if( 0 >= inWidth || drawable.getSurfaceWidth() < inWidth ) {
@@ -207,7 +207,7 @@ public class GLReadBufferUtil {
readPixelBuffer.buffer,
null /* Flusher */);
newData = true;
- } catch (Exception e) {
+ } catch (final Exception e) {
readTextureData = null;
readPixelBuffer = null;
throw new RuntimeException("can not fetch offscreen texture", e);
@@ -229,7 +229,7 @@ public class GLReadBufferUtil {
readPixelBuffer.clear();
try {
gl.glReadPixels(inX, inY, width, height, pixelAttribs.format, pixelAttribs.type, readPixelBuffer.buffer);
- } catch(GLException gle) { res = false; gle.printStackTrace(); }
+ } catch(final GLException gle) { res = false; gle.printStackTrace(); }
readPixelBuffer.position( readPixelSize );
readPixelBuffer.flip();
final int glerr1 = gl.glGetError();
@@ -256,7 +256,7 @@ public class GLReadBufferUtil {
return res;
}
- public void dispose(GL gl) {
+ public void dispose(final GL gl) {
if(null != readTexture) {
readTexture.destroy(gl);
readTextureData = null;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Gamma.java b/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
index 966781906..4e44c997a 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
@@ -87,7 +87,7 @@ public class Gamma {
* @throws IllegalArgumentException if any of the parameters were
* out-of-bounds
*/
- public static boolean setDisplayGamma(GL gl, float gamma, float brightness, float contrast) throws IllegalArgumentException {
+ public static boolean setDisplayGamma(final GL gl, final float gamma, final float brightness, final float contrast) throws IllegalArgumentException {
return GLDrawableFactoryImpl.getFactoryImpl(gl.getContext().getGLDrawable().getGLProfile()).setDisplayGamma(gamma, brightness, contrast);
}
@@ -101,7 +101,7 @@ public class Gamma {
* exiting, calling it is recommended because of the inevitable
* unspecified behavior during JVM teardown.
*/
- public static void resetDisplayGamma(GL gl) {
+ public static void resetDisplayGamma(final GL gl) {
GLDrawableFactoryImpl.getFactoryImpl(gl.getContext().getGLDrawable().getGLProfile()).resetDisplayGamma();
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
index 986f6d8d3..150e92c2e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
@@ -18,6 +18,7 @@ import jogamp.opengl.Debug;
import com.jogamp.common.nio.Buffers;
import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.opengl.util.glsl.ShaderState;
/**
@@ -54,9 +55,9 @@ public class ImmModeSink {
static {
Debug.initSingleton();
- DEBUG_BEGIN_END = Debug.isPropertyDefined("jogl.debug.ImmModeSink.BeginEnd", true);
- DEBUG_DRAW = Debug.isPropertyDefined("jogl.debug.ImmModeSink.Draw", true);
- DEBUG_BUFFER = Debug.isPropertyDefined("jogl.debug.ImmModeSink.Buffer", true);
+ DEBUG_BEGIN_END = PropertyAccess.isPropertyDefined("jogl.debug.ImmModeSink.BeginEnd", true);
+ DEBUG_DRAW = PropertyAccess.isPropertyDefined("jogl.debug.ImmModeSink.Draw", true);
+ DEBUG_BUFFER = PropertyAccess.isPropertyDefined("jogl.debug.ImmModeSink.Buffer", true);
}
public static final int GL_QUADS = 0x0007; // Needs data manipulation on ES1/ES2
@@ -81,12 +82,12 @@ public class ImmModeSink {
* @param glBufferUsage VBO <code>usage</code> parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW},
* set to <code>0</code> for no VBO usage
*/
- public static ImmModeSink createFixed(int initialElementCount,
- int vComps, int vDataType,
- int cComps, int cDataType,
- int nComps, int nDataType,
- int tComps, int tDataType,
- int glBufferUsage) {
+ public static ImmModeSink createFixed(final int initialElementCount,
+ final int vComps, final int vDataType,
+ final int cComps, final int cDataType,
+ final int nComps, final int nDataType,
+ final int tComps, final int tDataType,
+ final int glBufferUsage) {
return new ImmModeSink(initialElementCount,
vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
false, glBufferUsage, null, 0);
@@ -114,12 +115,12 @@ public class ImmModeSink {
* @see com.jogamp.opengl.util.glsl.ShaderState#useProgram(GL2ES2, boolean)
* @see com.jogamp.opengl.util.glsl.ShaderState#getCurrentShaderState()
*/
- public static ImmModeSink createGLSL(int initialElementCount,
- int vComps, int vDataType,
- int cComps, int cDataType,
- int nComps, int nDataType,
- int tComps, int tDataType,
- int glBufferUsage, ShaderState st) {
+ public static ImmModeSink createGLSL(final int initialElementCount,
+ final int vComps, final int vDataType,
+ final int cComps, final int cDataType,
+ final int nComps, final int nDataType,
+ final int tComps, final int tDataType,
+ final int glBufferUsage, final ShaderState st) {
return new ImmModeSink(initialElementCount,
vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
true, glBufferUsage, st, 0);
@@ -147,18 +148,18 @@ public class ImmModeSink {
* @see com.jogamp.opengl.util.glsl.ShaderState#useProgram(GL2ES2, boolean)
* @see com.jogamp.opengl.util.glsl.ShaderState#getCurrentShaderState()
*/
- public static ImmModeSink createGLSL(int initialElementCount,
- int vComps, int vDataType,
- int cComps, int cDataType,
- int nComps, int nDataType,
- int tComps, int tDataType,
- int glBufferUsage, int shaderProgram) {
+ public static ImmModeSink createGLSL(final int initialElementCount,
+ final int vComps, final int vDataType,
+ final int cComps, final int cDataType,
+ final int nComps, final int nDataType,
+ final int tComps, final int tDataType,
+ final int glBufferUsage, final int shaderProgram) {
return new ImmModeSink(initialElementCount,
vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
true, glBufferUsage, null, shaderProgram);
}
- public void destroy(GL gl) {
+ public void destroy(final GL gl) {
destroyList(gl);
vboSet.destroy(gl);
@@ -168,16 +169,16 @@ public class ImmModeSink {
reset(null);
}
- public void reset(GL gl) {
+ public void reset(final GL gl) {
destroyList(gl);
vboSet.reset(gl);
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("ImmModeSink[");
+ final StringBuilder sb = new StringBuilder("ImmModeSink[");
sb.append(",\n\tVBO list: "+vboSetList.size()+" [");
- for(Iterator<VBOSet> i=vboSetList.iterator(); i.hasNext() ; ) {
+ for(final Iterator<VBOSet> i=vboSetList.iterator(); i.hasNext() ; ) {
sb.append("\n\t");
sb.append( i.next() );
}
@@ -191,7 +192,7 @@ public class ImmModeSink {
return sb.toString();
}
- public void draw(GL gl, boolean disableBufferAfterDraw) {
+ public void draw(final GL gl, final boolean disableBufferAfterDraw) {
if(DEBUG_DRAW) {
System.err.println("ImmModeSink.draw(disableBufferAfterDraw: "+disableBufferAfterDraw+"):\n\t"+this);
}
@@ -201,7 +202,7 @@ public class ImmModeSink {
}
}
- public void draw(GL gl, Buffer indices, boolean disableBufferAfterDraw) {
+ public void draw(final GL gl, final Buffer indices, final boolean disableBufferAfterDraw) {
if(DEBUG_DRAW) {
System.err.println("ImmModeSink.draw(disableBufferAfterDraw: "+disableBufferAfterDraw+"):\n\t"+this);
}
@@ -228,19 +229,19 @@ public class ImmModeSink {
vboSet.checkSeal(false);
}
- public final void glEnd(GL gl) {
+ public final void glEnd(final GL gl) {
glEnd(gl, null, true);
}
- public void glEnd(GL gl, boolean immediateDraw) {
+ public void glEnd(final GL gl, final boolean immediateDraw) {
glEnd(gl, null, immediateDraw);
}
- public final void glEnd(GL gl, Buffer indices) {
+ public final void glEnd(final GL gl, final Buffer indices) {
glEnd(gl, indices, true);
}
- private void glEnd(GL gl, Buffer indices, boolean immediateDraw) {
+ private void glEnd(final GL gl, final Buffer indices, final boolean immediateDraw) {
if(DEBUG_BEGIN_END) {
System.err.println("ImmModeSink START glEnd(immediate: "+immediateDraw+")");
}
@@ -259,117 +260,117 @@ public class ImmModeSink {
}
}
- public void glVertexv(Buffer v) {
+ public void glVertexv(final Buffer v) {
vboSet.glVertexv(v);
}
- public void glNormalv(Buffer v) {
+ public void glNormalv(final Buffer v) {
vboSet.glNormalv(v);
}
- public void glColorv(Buffer v) {
+ public void glColorv(final Buffer v) {
vboSet.glColorv(v);
}
- public void glTexCoordv(Buffer v) {
+ public void glTexCoordv(final Buffer v) {
vboSet.glTexCoordv(v);
}
- public final void glVertex2f(float x, float y) {
+ public final void glVertex2f(final float x, final float y) {
vboSet.glVertex2f(x,y);
}
- public final void glVertex3f(float x, float y, float z) {
+ public final void glVertex3f(final float x, final float y, final float z) {
vboSet.glVertex3f(x,y,z);
}
- public final void glNormal3f(float x, float y, float z) {
+ public final void glNormal3f(final float x, final float y, final float z) {
vboSet.glNormal3f(x,y,z);
}
- public final void glColor3f(float x, float y, float z) {
+ public final void glColor3f(final float x, final float y, final float z) {
vboSet.glColor3f(x,y,z);
}
- public final void glColor4f(float x, float y, float z, float a) {
+ public final void glColor4f(final float x, final float y, final float z, final float a) {
vboSet.glColor4f(x,y,z, a);
}
- public final void glTexCoord2f(float x, float y) {
+ public final void glTexCoord2f(final float x, final float y) {
vboSet.glTexCoord2f(x,y);
}
- public final void glTexCoord3f(float x, float y, float z) {
+ public final void glTexCoord3f(final float x, final float y, final float z) {
vboSet.glTexCoord3f(x,y,z);
}
- public final void glVertex2s(short x, short y) {
+ public final void glVertex2s(final short x, final short y) {
vboSet.glVertex2s(x,y);
}
- public final void glVertex3s(short x, short y, short z) {
+ public final void glVertex3s(final short x, final short y, final short z) {
vboSet.glVertex3s(x,y,z);
}
- public final void glNormal3s(short x, short y, short z) {
+ public final void glNormal3s(final short x, final short y, final short z) {
vboSet.glNormal3s(x,y,z);
}
- public final void glColor3s(short x, short y, short z) {
+ public final void glColor3s(final short x, final short y, final short z) {
vboSet.glColor3s(x,y,z);
}
- public final void glColor4s(short x, short y, short z, short a) {
+ public final void glColor4s(final short x, final short y, final short z, final short a) {
vboSet.glColor4s(x,y,z,a);
}
- public final void glTexCoord2s(short x, short y) {
+ public final void glTexCoord2s(final short x, final short y) {
vboSet.glTexCoord2s(x,y);
}
- public final void glTexCoord3s(short x, short y, short z) {
+ public final void glTexCoord3s(final short x, final short y, final short z) {
vboSet.glTexCoord3s(x,y,z);
}
- public final void glVertex2b(byte x, byte y) {
+ public final void glVertex2b(final byte x, final byte y) {
vboSet.glVertex2b(x,y);
}
- public final void glVertex3b(byte x, byte y, byte z) {
+ public final void glVertex3b(final byte x, final byte y, final byte z) {
vboSet.glVertex3b(x,y,z);
}
- public final void glNormal3b(byte x, byte y, byte z) {
+ public final void glNormal3b(final byte x, final byte y, final byte z) {
vboSet.glNormal3b(x,y,z);
}
- public final void glColor3b(byte x, byte y, byte z) {
+ public final void glColor3b(final byte x, final byte y, final byte z) {
vboSet.glColor3b(x,y,z);
}
- public final void glColor3ub(byte x, byte y, byte z) {
+ public final void glColor3ub(final byte x, final byte y, final byte z) {
vboSet.glColor3ub(x,y,z);
}
- public final void glColor4b(byte x, byte y, byte z, byte a) {
+ public final void glColor4b(final byte x, final byte y, final byte z, final byte a) {
vboSet.glColor4b(x,y,z,a);
}
- public final void glColor4ub(byte x, byte y, byte z, byte a) {
+ public final void glColor4ub(final byte x, final byte y, final byte z, final byte a) {
vboSet.glColor4ub(x,y,z,a);
}
- public final void glTexCoord2b(byte x, byte y) {
+ public final void glTexCoord2b(final byte x, final byte y) {
vboSet.glTexCoord2b(x,y);
}
- public final void glTexCoord3b(byte x, byte y, byte z) {
+ public final void glTexCoord3b(final byte x, final byte y, final byte z) {
vboSet.glTexCoord3b(x,y,z);
}
- protected ImmModeSink(int initialElementCount,
- int vComps, int vDataType,
- int cComps, int cDataType,
- int nComps, int nDataType,
- int tComps, int tDataType,
- boolean useGLSL, int glBufferUsage, ShaderState st, int shaderProgram) {
+ protected ImmModeSink(final int initialElementCount,
+ final int vComps, final int vDataType,
+ final int cComps, final int cDataType,
+ final int nComps, final int nDataType,
+ final int tComps, final int tDataType,
+ final boolean useGLSL, final int glBufferUsage, final ShaderState st, final int shaderProgram) {
vboSet = new VBOSet(initialElementCount,
vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
useGLSL, glBufferUsage, st, shaderProgram);
@@ -390,9 +391,9 @@ public class ImmModeSink {
* @see #createFixed(int, int, int, int, int, int, int, int, int, int)
* @see #createGLSL(int, int, int, int, int, int, int, int, int, int, ShaderState)
*/
- public void setResizeElementCount(int v) { vboSet.setResizeElementCount(v); }
+ public void setResizeElementCount(final int v) { vboSet.setResizeElementCount(v); }
- private void destroyList(GL gl) {
+ private void destroyList(final GL gl) {
for(int i=0; i<vboSetList.size(); i++) {
vboSetList.get(i).destroy(gl);
}
@@ -403,12 +404,12 @@ public class ImmModeSink {
private final ArrayList<VBOSet> vboSetList;
protected static class VBOSet {
- protected VBOSet (int initialElementCount,
- int vComps, int vDataType,
- int cComps, int cDataType,
- int nComps, int nDataType,
- int tComps, int tDataType,
- boolean useGLSL, int glBufferUsage, ShaderState st, int shaderProgram) {
+ protected VBOSet (final int initialElementCount,
+ final int vComps, final int vDataType,
+ final int cComps, final int cDataType,
+ final int nComps, final int nDataType,
+ final int tComps, final int tDataType,
+ final boolean useGLSL, final int glBufferUsage, final ShaderState st, final int shaderProgram) {
// final ..
this.glBufferUsage=glBufferUsage;
this.initialElementCount=initialElementCount;
@@ -465,17 +466,17 @@ public class ImmModeSink {
}
protected int getResizeElementCount() { return resizeElementCount; }
- protected void setResizeElementCount(int v) { resizeElementCount=v; }
+ protected void setResizeElementCount(final int v) { resizeElementCount=v; }
protected boolean getUseVBO() { return useVBO; }
- protected final VBOSet regenerate(GL gl) {
+ protected final VBOSet regenerate(final GL gl) {
return new VBOSet(initialElementCount, vComps,
vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
useGLSL, glBufferUsage, shaderState, shaderProgram);
}
- protected void checkSeal(boolean test) throws GLException {
+ protected void checkSeal(final boolean test) throws GLException {
if(0==mode) {
throw new GLException("No mode set yet, call glBegin(mode) first:\n\t"+this);
}
@@ -490,7 +491,7 @@ public class ImmModeSink {
private boolean usingShaderProgram = false;
- protected void useShaderProgram(GL2ES2 gl, boolean force) {
+ protected void useShaderProgram(final GL2ES2 gl, final boolean force) {
if( force || !usingShaderProgram ) {
if(null != shaderState) {
shaderState.useProgram(gl, true);
@@ -501,7 +502,7 @@ public class ImmModeSink {
}
}
- protected void draw(GL gl, Buffer indices, boolean disableBufferAfterDraw, int i)
+ protected void draw(final GL gl, final Buffer indices, final boolean disableBufferAfterDraw, final int i)
{
enableBuffer(gl, true);
@@ -544,17 +545,17 @@ public class ImmModeSink {
if( GL.GL_UNSIGNED_BYTE == type ) {
final ByteBuffer b = (ByteBuffer) indices;
for (int j = 0; j < idxLen; j++) {
- gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x000000ff & b.get(idx0+j)), 4);
+ gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0x000000ff & b.get(idx0+j), 4);
}
} else if( GL.GL_UNSIGNED_SHORT == type ){
final ShortBuffer b = (ShortBuffer) indices;
for (int j = 0; j < idxLen; j++) {
- gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x0000ffff & b.get(idx0+j)), 4);
+ gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0x0000ffff & b.get(idx0+j), 4);
}
} else {
final IntBuffer b = (IntBuffer) indices;
for (int j = 0; j < idxLen; j++) {
- gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0xffffffff & b.get(idx0+j)), 4);
+ gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0xffffffff & b.get(idx0+j), 4);
}
}
} else {
@@ -573,24 +574,24 @@ public class ImmModeSink {
}
}
- public void glVertexv(Buffer v) {
+ public void glVertexv(final Buffer v) {
checkSeal(false);
Buffers.put(vertexArray, v);
}
- public void glNormalv(Buffer v) {
+ public void glNormalv(final Buffer v) {
checkSeal(false);
Buffers.put(normalArray, v);
}
- public void glColorv(Buffer v) {
+ public void glColorv(final Buffer v) {
checkSeal(false);
Buffers.put(colorArray, v);
}
- public void glTexCoordv(Buffer v) {
+ public void glTexCoordv(final Buffer v) {
checkSeal(false);
Buffers.put(textCoordArray, v);
}
- public void glVertex2b(byte x, byte y) {
+ public void glVertex2b(final byte x, final byte y) {
checkSeal(false);
growBuffer(VERTEX);
if(vComps>0)
@@ -599,7 +600,7 @@ public class ImmModeSink {
Buffers.putNb(vertexArray, vDataTypeSigned, y, true);
countAndPadding(VERTEX, vComps-2);
}
- public void glVertex3b(byte x, byte y, byte z) {
+ public void glVertex3b(final byte x, final byte y, final byte z) {
checkSeal(false);
growBuffer(VERTEX);
if(vComps>0)
@@ -610,7 +611,7 @@ public class ImmModeSink {
Buffers.putNb(vertexArray, vDataTypeSigned, z, true);
countAndPadding(VERTEX, vComps-3);
}
- public void glVertex2s(short x, short y) {
+ public void glVertex2s(final short x, final short y) {
checkSeal(false);
growBuffer(VERTEX);
if(vComps>0)
@@ -619,7 +620,7 @@ public class ImmModeSink {
Buffers.putNs(vertexArray, vDataTypeSigned, y, true);
countAndPadding(VERTEX, vComps-2);
}
- public void glVertex3s(short x, short y, short z) {
+ public void glVertex3s(final short x, final short y, final short z) {
checkSeal(false);
growBuffer(VERTEX);
if(vComps>0)
@@ -630,7 +631,7 @@ public class ImmModeSink {
Buffers.putNs(vertexArray, vDataTypeSigned, z, true);
countAndPadding(VERTEX, vComps-3);
}
- public void glVertex2f(float x, float y) {
+ public void glVertex2f(final float x, final float y) {
checkSeal(false);
growBuffer(VERTEX);
if(vComps>0)
@@ -639,7 +640,7 @@ public class ImmModeSink {
Buffers.putNf(vertexArray, vDataTypeSigned, y);
countAndPadding(VERTEX, vComps-2);
}
- public void glVertex3f(float x, float y, float z) {
+ public void glVertex3f(final float x, final float y, final float z) {
checkSeal(false);
growBuffer(VERTEX);
if(vComps>0)
@@ -651,7 +652,7 @@ public class ImmModeSink {
countAndPadding(VERTEX, vComps-3);
}
- public void glNormal3b(byte x, byte y, byte z) {
+ public void glNormal3b(final byte x, final byte y, final byte z) {
checkSeal(false);
growBuffer(NORMAL);
if(nComps>0)
@@ -662,7 +663,7 @@ public class ImmModeSink {
Buffers.putNb(normalArray, nDataTypeSigned, z, true);
countAndPadding(NORMAL, nComps-3);
}
- public void glNormal3s(short x, short y, short z) {
+ public void glNormal3s(final short x, final short y, final short z) {
checkSeal(false);
growBuffer(NORMAL);
if(nComps>0)
@@ -673,7 +674,7 @@ public class ImmModeSink {
Buffers.putNs(normalArray, nDataTypeSigned, z, true);
countAndPadding(NORMAL, nComps-3);
}
- public void glNormal3f(float x, float y, float z) {
+ public void glNormal3f(final float x, final float y, final float z) {
checkSeal(false);
growBuffer(NORMAL);
if(nComps>0)
@@ -685,7 +686,7 @@ public class ImmModeSink {
countAndPadding(NORMAL, nComps-3);
}
- public void glColor3b(byte r, byte g, byte b) {
+ public void glColor3b(final byte r, final byte g, final byte b) {
checkSeal(false);
growBuffer(COLOR);
if(cComps>0)
@@ -696,7 +697,7 @@ public class ImmModeSink {
Buffers.putNb(colorArray, cDataTypeSigned, b, true);
countAndPadding(COLOR, cComps-3);
}
- public void glColor3ub(byte r, byte g, byte b) {
+ public void glColor3ub(final byte r, final byte g, final byte b) {
checkSeal(false);
growBuffer(COLOR);
if(cComps>0)
@@ -707,7 +708,7 @@ public class ImmModeSink {
Buffers.putNb(colorArray, cDataTypeSigned, b, false);
countAndPadding(COLOR, cComps-3);
}
- public void glColor4b(byte r, byte g, byte b, byte a) {
+ public void glColor4b(final byte r, final byte g, final byte b, final byte a) {
checkSeal(false);
growBuffer(COLOR);
if(cComps>0)
@@ -720,7 +721,7 @@ public class ImmModeSink {
Buffers.putNb(colorArray, cDataTypeSigned, a, true);
countAndPadding(COLOR, cComps-4);
}
- public void glColor4ub(byte r, byte g, byte b, byte a) {
+ public void glColor4ub(final byte r, final byte g, final byte b, final byte a) {
checkSeal(false);
growBuffer(COLOR);
if(cComps>0)
@@ -733,7 +734,7 @@ public class ImmModeSink {
Buffers.putNb(colorArray, cDataTypeSigned, a, false);
countAndPadding(COLOR, cComps-4);
}
- public void glColor3s(short r, short g, short b) {
+ public void glColor3s(final short r, final short g, final short b) {
checkSeal(false);
growBuffer(COLOR);
if(cComps>0)
@@ -744,7 +745,7 @@ public class ImmModeSink {
Buffers.putNs(colorArray, cDataTypeSigned, b, true);
countAndPadding(COLOR, cComps-3);
}
- public void glColor4s(short r, short g, short b, short a) {
+ public void glColor4s(final short r, final short g, final short b, final short a) {
checkSeal(false);
growBuffer(COLOR);
if(cComps>0)
@@ -757,7 +758,7 @@ public class ImmModeSink {
Buffers.putNs(colorArray, cDataTypeSigned, a, true);
countAndPadding(COLOR, cComps-4);
}
- public void glColor3f(float r, float g, float b) {
+ public void glColor3f(final float r, final float g, final float b) {
checkSeal(false);
growBuffer(COLOR);
if(cComps>0)
@@ -768,7 +769,7 @@ public class ImmModeSink {
Buffers.putNf(colorArray, cDataTypeSigned, b);
countAndPadding(COLOR, cComps-3);
}
- public void glColor4f(float r, float g, float b, float a) {
+ public void glColor4f(final float r, final float g, final float b, final float a) {
checkSeal(false);
growBuffer(COLOR);
if(cComps>0)
@@ -782,7 +783,7 @@ public class ImmModeSink {
countAndPadding(COLOR, cComps-4);
}
- public void glTexCoord2b(byte x, byte y) {
+ public void glTexCoord2b(final byte x, final byte y) {
checkSeal(false);
growBuffer(TEXTCOORD);
if(tComps>0)
@@ -791,7 +792,7 @@ public class ImmModeSink {
Buffers.putNb(textCoordArray, tDataTypeSigned, y, true);
countAndPadding(TEXTCOORD, tComps-2);
}
- public void glTexCoord3b(byte x, byte y, byte z) {
+ public void glTexCoord3b(final byte x, final byte y, final byte z) {
checkSeal(false);
growBuffer(TEXTCOORD);
if(tComps>0)
@@ -802,7 +803,7 @@ public class ImmModeSink {
Buffers.putNb(textCoordArray, tDataTypeSigned, z, true);
countAndPadding(TEXTCOORD, tComps-3);
}
- public void glTexCoord2s(short x, short y) {
+ public void glTexCoord2s(final short x, final short y) {
checkSeal(false);
growBuffer(TEXTCOORD);
if(tComps>0)
@@ -811,7 +812,7 @@ public class ImmModeSink {
Buffers.putNs(textCoordArray, tDataTypeSigned, y, true);
countAndPadding(TEXTCOORD, tComps-2);
}
- public void glTexCoord3s(short x, short y, short z) {
+ public void glTexCoord3s(final short x, final short y, final short z) {
checkSeal(false);
growBuffer(TEXTCOORD);
if(tComps>0)
@@ -822,7 +823,7 @@ public class ImmModeSink {
Buffers.putNs(textCoordArray, tDataTypeSigned, z, true);
countAndPadding(TEXTCOORD, tComps-3);
}
- public void glTexCoord2f(float x, float y) {
+ public void glTexCoord2f(final float x, final float y) {
checkSeal(false);
growBuffer(TEXTCOORD);
if(tComps>0)
@@ -831,7 +832,7 @@ public class ImmModeSink {
Buffers.putNf(textCoordArray, tDataTypeSigned, y);
countAndPadding(TEXTCOORD, tComps-2);
}
- public void glTexCoord3f(float x, float y, float z) {
+ public void glTexCoord3f(final float x, final float y, final float z) {
checkSeal(false);
growBuffer(TEXTCOORD);
if(tComps>0)
@@ -858,7 +859,7 @@ public class ImmModeSink {
}
}
- public void setShaderProgram(int program) {
+ public void setShaderProgram(final int program) {
if(null == shaderState && 0 == program) {
throw new IllegalArgumentException("Not allowed to zero shader program if no ShaderState is set");
}
@@ -871,7 +872,7 @@ public class ImmModeSink {
* @return true if all locations for all used arrays are found (min 1 array), otherwise false.
* Also sets 'glslLocationSet' to the return value!
*/
- private boolean resetGLSLArrayLocation(GL2ES2 gl) {
+ private boolean resetGLSLArrayLocation(final GL2ES2 gl) {
int iA = 0;
int iL = 0;
@@ -903,7 +904,7 @@ public class ImmModeSink {
return glslLocationSet;
}
- public void destroy(GL gl) {
+ public void destroy(final GL gl) {
reset(gl);
vCount=0; cCount=0; nCount=0; tCount=0;
@@ -912,7 +913,7 @@ public class ImmModeSink {
buffer=null;
}
- public void reset(GL gl) {
+ public void reset(final GL gl) {
enableBuffer(gl, false);
reset();
}
@@ -935,16 +936,16 @@ public class ImmModeSink {
this.tElems=0;
}
- public void seal(GL glObj, boolean seal)
+ public void seal(final GL glObj, final boolean seal)
{
seal(seal);
if(sealedGL==seal) return;
sealedGL = seal;
- GL gl = glObj.getGL();
+ final GL gl = glObj.getGL();
if(seal) {
if(useVBO) {
if(0 == vboName) {
- int[] tmp = new int[1];
+ final int[] tmp = new int[1];
gl.glGenBuffers(1, tmp, 0);
vboName = tmp[0];
}
@@ -967,7 +968,7 @@ public class ImmModeSink {
}
}
- public void seal(boolean seal)
+ public void seal(final boolean seal)
{
if(sealed==seal) return;
sealed = seal;
@@ -977,7 +978,7 @@ public class ImmModeSink {
}
}
- public void enableBuffer(GL gl, boolean enable) {
+ public void enableBuffer(final GL gl, final boolean enable) {
if( bufferEnabled != enable && vElems>0 ) {
if(enable) {
checkSeal(true);
@@ -996,7 +997,7 @@ public class ImmModeSink {
}
}
- private final void writeBuffer(GL gl) {
+ private final void writeBuffer(final GL gl) {
final int vBytes = vElems * vCompsBytes;
final int cBytes = cElems * cCompsBytes;
final int nBytes = nElems * nCompsBytes;
@@ -1021,8 +1022,8 @@ public class ImmModeSink {
}
}
- private void enableBufferFixed(GL gl, boolean enable) {
- GL2ES1 glf = gl.getGL2ES1();
+ private void enableBufferFixed(final GL gl, final boolean enable) {
+ final GL2ES1 glf = gl.getGL2ES1();
final boolean useV = vComps>0 && vElems>0 ;
final boolean useC = cComps>0 && cElems>0 ;
@@ -1089,8 +1090,8 @@ public class ImmModeSink {
}
}
- private void enableBufferGLSLShaderState(GL gl, boolean enable) {
- GL2ES2 glsl = gl.getGL2ES2();
+ private void enableBufferGLSLShaderState(final GL gl, final boolean enable) {
+ final GL2ES2 glsl = gl.getGL2ES2();
final boolean useV = vComps>0 && vElems>0 ;
final boolean useC = cComps>0 && cElems>0 ;
@@ -1157,8 +1158,8 @@ public class ImmModeSink {
}
}
- private void enableBufferGLSLSimple(GL gl, boolean enable) {
- GL2ES2 glsl = gl.getGL2ES2();
+ private void enableBufferGLSLSimple(final GL gl, final boolean enable) {
+ final GL2ES2 glsl = gl.getGL2ES2();
final boolean useV = vComps>0 && vElems>0 ;
final boolean useC = cComps>0 && cElems>0 ;
@@ -1267,7 +1268,7 @@ public class ImmModeSink {
return "[v "+vElems+"/"+vCount+", c "+cElems+"/"+cCount+", n "+nElems+"/"+nCount+", t "+tElems+"/"+tCount+"]";
}
- protected boolean fitElementInBuffer(int type) {
+ protected boolean fitElementInBuffer(final int type) {
final int addElems = 1;
switch (type) {
case VERTEX:
@@ -1283,7 +1284,7 @@ public class ImmModeSink {
}
}
- protected boolean reallocateBuffer(int addElems) {
+ protected boolean reallocateBuffer(final int addElems) {
final int vAdd = addElems - ( vCount - vElems );
final int cAdd = addElems - ( cCount - cElems );
final int nAdd = addElems - ( nCount - nElems );
@@ -1381,7 +1382,7 @@ public class ImmModeSink {
}
/** grow buffer by initialElementCount if there is no space for one more element in the designated buffer */
- protected final boolean growBuffer(int type) {
+ protected final boolean growBuffer(final int type) {
if( null !=buffer && !sealed ) {
if( !fitElementInBuffer(type) ) {
// save olde values ..
@@ -1422,7 +1423,7 @@ public class ImmModeSink {
* @param type
* @param fill
*/
- private void countAndPadding(int type, int fill) {
+ private void countAndPadding(final int type, int fill) {
if ( sealed ) return;
final Buffer dest;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
index 71d880a44..39608b116 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
@@ -41,8 +41,9 @@ import javax.media.opengl.GL;
import javax.media.opengl.GLException;
import javax.media.opengl.fixedfunc.GLMatrixFunc;
+import jogamp.common.os.PlatformPropsImpl;
+
import com.jogamp.common.nio.Buffers;
-import com.jogamp.common.os.Platform;
import com.jogamp.common.util.FloatStack;
import com.jogamp.opengl.math.FloatUtil;
import com.jogamp.opengl.math.Quaternion;
@@ -852,19 +853,19 @@ public final class PMVMatrix implements GLMatrixFunc {
final boolean modT = 0 != ( MODIFIED_TEXTURE & modifiedBits );
sb.append("PMVMatrix[modified[P ").append(modP).append(", Mv ").append(modMv).append(", T ").append(modT);
- sb.append("], dirty/req[Mvi ").append(mviDirty).append("/").append(mviReq).append(", Mvit ").append(mvitDirty).append("/").append(mvitReq).append(", Frustum ").append(frustumDirty).append("/").append(frustumReq).append("]").append(Platform.NEWLINE);
- sb.append(", Projection").append(Platform.NEWLINE);
+ sb.append("], dirty/req[Mvi ").append(mviDirty).append("/").append(mviReq).append(", Mvit ").append(mvitDirty).append("/").append(mvitReq).append(", Frustum ").append(frustumDirty).append("/").append(frustumReq).append("]").append(PlatformPropsImpl.NEWLINE);
+ sb.append(", Projection").append(PlatformPropsImpl.NEWLINE);
matrixToString(sb, f, matrixP);
- sb.append(", Modelview").append(Platform.NEWLINE);
+ sb.append(", Modelview").append(PlatformPropsImpl.NEWLINE);
matrixToString(sb, f, matrixMv);
- sb.append(", Texture").append(Platform.NEWLINE);
+ sb.append(", Texture").append(PlatformPropsImpl.NEWLINE);
matrixToString(sb, f, matrixTex);
if( 0 != ( requestMask & DIRTY_INVERSE_MODELVIEW ) ) {
- sb.append(", Inverse Modelview").append(Platform.NEWLINE);
+ sb.append(", Inverse Modelview").append(PlatformPropsImpl.NEWLINE);
matrixToString(sb, f, matrixMvi);
}
if( 0 != ( requestMask & DIRTY_INVERSE_TRANSPOSED_MODELVIEW ) ) {
- sb.append(", Inverse Transposed Modelview").append(Platform.NEWLINE);
+ sb.append(", Inverse Transposed Modelview").append(PlatformPropsImpl.NEWLINE);
matrixToString(sb, f, matrixMvit);
}
sb.append("]");
diff --git a/src/jogl/classes/com/jogamp/opengl/util/PNGPixelRect.java b/src/jogl/classes/com/jogamp/opengl/util/PNGPixelRect.java
index fd8f54152..64da547c2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/PNGPixelRect.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/PNGPixelRect.java
@@ -192,7 +192,7 @@ public class PNGPixelRect extends PixelRectangle.GenericPixelRect {
return new PNGPixelRect(destFmt, new Dimension(width, height), destStrideInBytes, destIsGLOriented, destPixels, dpiX, dpiY);
}
- private static final int getPixelLUMToAny(PixelFormat dest_fmt, ByteBuffer d, int dOff, byte lum, byte alpha) {
+ private static final int getPixelLUMToAny(final PixelFormat dest_fmt, final ByteBuffer d, int dOff, final byte lum, final byte alpha) {
switch(dest_fmt) {
case LUMINANCE:
d.put(dOff++, lum);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java
index 0a3a9d513..3b65b0824 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java
@@ -51,7 +51,7 @@ public class RandomTileRenderer extends TileRendererBase {
}
@Override
- public final int getParam(int pname) {
+ public final int getParam(final int pname) {
switch (pname) {
case TR_IMAGE_WIDTH:
return imageSize.getWidth();
@@ -75,7 +75,7 @@ public class RandomTileRenderer extends TileRendererBase {
*
* @throws IllegalArgumentException is tile x/y are < 0 or tile size is <= 0x0
*/
- public void setTileRect(int tX, int tY, int tWidth, int tHeight) throws IllegalStateException, IllegalArgumentException {
+ public void setTileRect(final int tX, final int tY, final int tWidth, final int tHeight) throws IllegalStateException, IllegalArgumentException {
if( 0 > tX || 0 > tY ) {
throw new IllegalArgumentException("Tile pos must be >= 0/0");
}
@@ -120,7 +120,7 @@ public class RandomTileRenderer extends TileRendererBase {
* {@link #setTileRect(int, int, int, int) tile-rect} has not been set.
*/
@Override
- public final void beginTile(GL gl) throws IllegalStateException, GLException {
+ public final void beginTile(final GL gl) throws IllegalStateException, GLException {
if( 0 >= imageSize.getWidth() || 0 >= imageSize.getHeight() ) {
throw new IllegalStateException("Image size has not been set");
}
@@ -143,7 +143,7 @@ public class RandomTileRenderer extends TileRendererBase {
}
@Override
- public void endTile( GL gl ) throws IllegalStateException, GLException {
+ public void endTile( final GL gl ) throws IllegalStateException, GLException {
if( !beginCalled ) {
throw new IllegalStateException("beginTile(..) has not been called");
}
@@ -229,7 +229,7 @@ public class RandomTileRenderer extends TileRendererBase {
* @throws IllegalStateException if no {@link GLAutoDrawable} is {@link #attachAutoDrawable(GLAutoDrawable) attached}
* or imageSize is not set
*/
- public void display(int tX, int tY, int tWidth, int tHeight) throws IllegalStateException {
+ public void display(final int tX, final int tY, final int tWidth, final int tHeight) throws IllegalStateException {
setTileRect(tX, tY, tWidth, tHeight);
display();
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java b/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java
index 47d56bcb1..6e31c78a0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java
@@ -70,18 +70,18 @@ public class TGAWriter {
* @throws IOException if an I/O error occurred while writing the
* file
*/
- public void open(File file,
- int width,
- int height,
- boolean alpha) throws IOException {
- RandomAccessFile out = new RandomAccessFile(file, "rw");
+ public void open(final File file,
+ final int width,
+ final int height,
+ final boolean alpha) throws IOException {
+ final RandomAccessFile out = new RandomAccessFile(file, "rw");
ch = out.getChannel();
- int pixelSize = (alpha ? 32 : 24);
- int numChannels = (alpha ? 4 : 3);
+ final int pixelSize = (alpha ? 32 : 24);
+ final int numChannels = (alpha ? 4 : 3);
- int fileLength = TARGA_HEADER_SIZE + width * height * numChannels;
+ final int fileLength = TARGA_HEADER_SIZE + width * height * numChannels;
out.setLength(fileLength);
- MappedByteBuffer image = ch.map(FileChannel.MapMode.READ_WRITE, 0, fileLength);
+ final MappedByteBuffer image = ch.map(FileChannel.MapMode.READ_WRITE, 0, fileLength);
// write the TARGA header
image.put(0, (byte) 0).put(1, (byte) 0);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java
index 887312a64..d8410a102 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java
@@ -145,7 +145,7 @@ public class TileRenderer extends TileRendererBase {
private int offsetY;
@Override
- protected StringBuilder tileDetails(StringBuilder sb) {
+ protected StringBuilder tileDetails(final StringBuilder sb) {
sb.append("# "+currentTile+": ["+currentColumn+"]["+currentRow+"] / "+columns+"x"+rows+", ")
.append("rowOrder "+rowOrder+", offset/size "+offsetX+"/"+offsetY+" "+tileSize.getWidth()+"x"+tileSize.getHeight()+" brd "+tileBorder+", ");
return super.tileDetails(sb);
@@ -165,7 +165,7 @@ public class TileRenderer extends TileRendererBase {
* </p>
*/
@Override
- public final void setImageSize(int width, int height) {
+ public final void setImageSize(final int width, final int height) {
super.setImageSize(width, height);
reset();
}
@@ -184,7 +184,7 @@ public class TileRenderer extends TileRendererBase {
* @param height The image-clipping.height
* @see #getClippedImageSize()
*/
- public final void clipImageSize(int width, int height) {
+ public final void clipImageSize(final int width, final int height) {
if( null == imageClippingDim ) {
imageClippingDim = new Dimension(width, height);
} else {
@@ -236,7 +236,7 @@ public class TileRenderer extends TileRendererBase {
* to avoid artifacts when rendering lines or points with
* thickness > 1.
*/
- public final void setTileSize(int width, int height, int border) {
+ public final void setTileSize(final int width, final int height, final int border) {
if( 0 > border ) {
throw new IllegalArgumentException("Tile border must be >= 0");
}
@@ -255,7 +255,7 @@ public class TileRenderer extends TileRendererBase {
* @see #TR_TILE_X_OFFSET
* @see #TR_TILE_Y_OFFSET
**/
- public void setTileOffset(int xoff, int yoff) {
+ public void setTileOffset(final int xoff, final int yoff) {
offsetX = xoff;
offsetY = yoff;
}
@@ -299,7 +299,7 @@ public class TileRenderer extends TileRendererBase {
/* pp */ final int getCurrentTile() { return currentTile; }
@Override
- public final int getParam(int pname) {
+ public final int getParam(final int pname) {
switch (pname) {
case TR_IMAGE_WIDTH:
return imageSize.getWidth();
@@ -349,7 +349,7 @@ public class TileRenderer extends TileRendererBase {
*
* @param order The row traversal order, must be either {@link #TR_TOP_TO_BOTTOM} or {@link #TR_BOTTOM_TO_TOP}.
*/
- public final void setRowOrder(int order) {
+ public final void setRowOrder(final int order) {
if (order == TR_TOP_TO_BOTTOM || order == TR_BOTTOM_TO_TOP) {
rowOrder = order;
} else {
@@ -388,7 +388,7 @@ public class TileRenderer extends TileRendererBase {
* {@link #eot() end-of-tiling} has been reached.
*/
@Override
- public final void beginTile( GL gl ) throws IllegalStateException, GLException {
+ public final void beginTile( final GL gl ) throws IllegalStateException, GLException {
if( !isSetup() ) {
throw new IllegalStateException("Image size has not been set: "+this);
}
@@ -408,7 +408,7 @@ public class TileRenderer extends TileRendererBase {
assert ( currentRow < rows );
assert ( currentColumn < columns );
- int border = tileBorder;
+ final int border = tileBorder;
final DimensionImmutable clippedImageSize = getClippedImageSize();
int tH, tW;
@@ -446,7 +446,7 @@ public class TileRenderer extends TileRendererBase {
}
@Override
- public void endTile( GL gl ) throws IllegalStateException, GLException {
+ public void endTile( final GL gl ) throws IllegalStateException, GLException {
if( !beginCalled ) {
throw new IllegalStateException("beginTile(..) has not been called");
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java b/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
index b29846d91..99def6f5c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
@@ -60,7 +60,7 @@ public class TimeFrameI {
pts = INVALID_PTS;
duration = 0;
}
- public TimeFrameI(int pts, int duration) {
+ public TimeFrameI(final int pts, final int duration) {
this.pts = pts;
this.duration = duration;
}
@@ -68,11 +68,11 @@ public class TimeFrameI {
/** Get this frame's presentation timestamp (PTS) in milliseconds. */
public final int getPTS() { return pts; }
/** Set this frame's presentation timestamp (PTS) in milliseconds. */
- public final void setPTS(int pts) { this.pts = pts; }
+ public final void setPTS(final int pts) { this.pts = pts; }
/** Get this frame's duration in milliseconds. */
public final int getDuration() { return duration; }
/** Set this frame's duration in milliseconds. */
- public final void setDuration(int duration) { this.duration = duration; }
+ public final void setDuration(final int duration) { this.duration = duration; }
@Override
public String toString() {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
index 1d835dd33..6d875fcf5 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
@@ -61,7 +61,7 @@ public interface AudioSink {
* @param planar true for planar data package (each channel in own data buffer), false for packed data channels interleaved in one buffer.
* @param littleEndian true for little-endian, false for big endian
*/
- public AudioFormat(int sampleRate, int sampleSize, int channelCount, boolean signed, boolean fixedP, boolean planar, boolean littleEndian) {
+ public AudioFormat(final int sampleRate, final int sampleSize, final int channelCount, final boolean signed, final boolean fixedP, final boolean planar, final boolean littleEndian) {
this.sampleRate = sampleRate;
this.sampleSize = sampleSize;
this.channelCount = channelCount;
@@ -104,7 +104,7 @@ public interface AudioSink {
* Time -> Byte Count
* </p>
*/
- public final int getDurationsByteSize(int millisecs) {
+ public final int getDurationsByteSize(final int millisecs) {
final int bytesPerSample = sampleSize >>> 3; // /8
return millisecs * ( channelCount * bytesPerSample * ( sampleRate / 1000 ) );
}
@@ -116,7 +116,7 @@ public interface AudioSink {
* Byte Count -> Time
* </p>
*/
- public final int getBytesDuration(int byteCount) {
+ public final int getBytesDuration(final int byteCount) {
final int bytesPerSample = sampleSize >>> 3; // /8
return byteCount / ( channelCount * bytesPerSample * ( sampleRate / 1000 ) );
}
@@ -132,7 +132,7 @@ public interface AudioSink {
* </p>
* @param sampleCount sample count per frame and channel
*/
- public final float getSamplesDuration(int sampleCount) {
+ public final float getSamplesDuration(final int sampleCount) {
return ( 1000f * sampleCount ) / sampleRate;
}
@@ -151,7 +151,7 @@ public interface AudioSink {
* @param millisecs time in milliseconds
* @param frameDuration duration per frame in milliseconds.
*/
- public final int getFrameCount(int millisecs, float frameDuration) {
+ public final int getFrameCount(final int millisecs, final float frameDuration) {
return Math.max(1, (int) ( millisecs / frameDuration + 0.5f ));
}
@@ -170,7 +170,7 @@ public interface AudioSink {
* </p>
* @param sampleCount sample count
*/
- public final int getSamplesByteCount(int sampleCount) {
+ public final int getSamplesByteCount(final int sampleCount) {
return sampleCount * ( sampleSize >>> 3 );
}
@@ -189,7 +189,7 @@ public interface AudioSink {
* </p>
* @param byteCount number of bytes
*/
- public final int getBytesSampleCount(int byteCount) {
+ public final int getBytesSampleCount(final int byteCount) {
return ( byteCount << 3 ) / sampleSize;
}
@@ -208,7 +208,7 @@ public interface AudioSink {
public AudioFrame() {
this.byteSize = 0;
}
- public AudioFrame(int pts, int duration, int byteCount) {
+ public AudioFrame(final int pts, final int duration, final int byteCount) {
super(pts, duration);
this.byteSize=byteCount;
}
@@ -216,7 +216,7 @@ public interface AudioSink {
/** Get this frame's size in bytes. */
public final int getByteSize() { return byteSize; }
/** Set this frame's size in bytes. */
- public final void setByteSize(int size) { this.byteSize=size; }
+ public final void setByteSize(final int size) { this.byteSize=size; }
@Override
public String toString() {
@@ -226,7 +226,7 @@ public interface AudioSink {
public static class AudioDataFrame extends AudioFrame {
protected final ByteBuffer data;
- public AudioDataFrame(int pts, int duration, ByteBuffer bytes, int byteCount) {
+ public AudioDataFrame(final int pts, final int duration, final ByteBuffer bytes, final int byteCount) {
super(pts, duration, byteCount);
if( byteCount > bytes.remaining() ) {
throw new IllegalArgumentException("Give size "+byteCount+" exceeds remaining bytes in ls "+bytes+". "+this);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
index 386b1e085..a2b29b4eb 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
@@ -50,7 +50,7 @@ public class AudioSinkFactory {
return new NullAudioSink();
}
- public static AudioSink create(final ClassLoader cl, String implName) {
+ public static AudioSink create(final ClassLoader cl, final String implName) {
final AudioSink audioSink;
if(ReflectionUtil.isClassAvailable(implName, cl)){
try {
@@ -58,7 +58,7 @@ public class AudioSinkFactory {
if( audioSink.isInitialized() ) {
return audioSink;
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if(AudioSink.DEBUG) { System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); }
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 215275951..4fffd9fab 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -246,10 +246,10 @@ public interface GLMediaPlayer extends TextureSequence {
*/
@SuppressWarnings("serial")
public static class StreamException extends Exception {
- public StreamException(Throwable cause) {
+ public StreamException(final Throwable cause) {
super(cause);
}
- public StreamException(String message, Throwable cause) {
+ public StreamException(final String message, final Throwable cause) {
super(message, cause);
}
}
@@ -318,7 +318,7 @@ public interface GLMediaPlayer extends TextureSequence {
public final int id;
- State(int id){
+ State(final int id){
this.id = id;
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
index 558d59630..9378cec91 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
@@ -55,12 +55,12 @@ public class GLMediaPlayerFactory {
return new NullGLMediaPlayer();
}
- public static GLMediaPlayer create(final ClassLoader cl, String implName) {
+ public static GLMediaPlayer create(final ClassLoader cl, final String implName) {
try {
if(((Boolean)ReflectionUtil.callStaticMethod(implName, isAvailableMethodName, null, null, cl)).booleanValue()) {
return (GLMediaPlayer) ReflectionUtil.createInstance(implName, cl);
}
- } catch (Throwable t) { if(GLMediaPlayer.DEBUG) { System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); } }
+ } catch (final Throwable t) { if(GLMediaPlayer.DEBUG) { System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); } }
return null;
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
index a33356067..04bc0a15d 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
@@ -31,6 +31,7 @@ import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.DataBuffer;
import java.awt.image.DataBufferInt;
+import java.awt.image.Raster;
import java.awt.image.SinglePixelPackedSampleModel;
import java.awt.image.WritableRaster;
import java.nio.Buffer;
@@ -78,8 +79,8 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
* @param allowRowStride If <code>true</code>, allow row-stride, otherwise not. See {@link #requiresNewBuffer(GL, int, int, int)}.
* If <code>true</code>, user shall decide whether to use a {@link #getAlignedImage(int, int) width-aligned image}.
*/
- public AWTGLPixelBuffer(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, BufferedImage image,
- Buffer buffer, boolean allowRowStride) {
+ public AWTGLPixelBuffer(final GLPixelAttributes pixelAttributes, final int width, final int height, final int depth, final boolean pack, final BufferedImage image,
+ final Buffer buffer, final boolean allowRowStride) {
super(pixelAttributes, width, height, depth, pack, buffer, allowRowStride);
this.image = image;
}
@@ -97,7 +98,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
* @return
* @throws IllegalArgumentException if requested size exceeds image size
*/
- public BufferedImage getAlignedImage(int width, int height) throws IllegalArgumentException {
+ public BufferedImage getAlignedImage(final int width, final int height) throws IllegalArgumentException {
if( width * height > image.getWidth() * image.getHeight() ) {
throw new IllegalArgumentException("Requested size exceeds image size: "+width+"x"+height+" > "+image.getWidth()+"x"+image.getHeight());
}
@@ -110,12 +111,12 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
final SinglePixelPackedSampleModel sppsm0 = (SinglePixelPackedSampleModel) raster0.getSampleModel();
final SinglePixelPackedSampleModel sppsm1 = new SinglePixelPackedSampleModel(dataBuffer.getDataType(),
width, height, width /* scanLineStride */, sppsm0.getBitMasks());
- final WritableRaster raster1 = WritableRaster.createWritableRaster(sppsm1, dataBuffer, null);
+ final WritableRaster raster1 = Raster.createWritableRaster(sppsm1, dataBuffer, null);
return new BufferedImage (cm, raster1, cm.isAlphaPremultiplied(), null);
}
}
- public final boolean isDataBufferSource(BufferedImage imageU) {
+ public final boolean isDataBufferSource(final BufferedImage imageU) {
final DataBuffer dataBuffer0 = image.getRaster().getDataBuffer();
final DataBuffer dataBufferU = imageU.getRaster().getDataBuffer();
return dataBufferU == dataBuffer0;
@@ -143,14 +144,14 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
* See {@link #getAllowRowStride()} and {@link AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
* If <code>true</code>, user shall decide whether to use a {@link AWTGLPixelBuffer#getAlignedImage(int, int) width-aligned image}.
*/
- public AWTGLPixelBufferProvider(boolean allowRowStride) {
+ public AWTGLPixelBufferProvider(final boolean allowRowStride) {
this.allowRowStride = allowRowStride;
}
@Override
public boolean getAllowRowStride() { return allowRowStride; }
@Override
- public GLPixelAttributes getAttributes(GL gl, int componentCount) {
+ public GLPixelAttributes getAttributes(final GL gl, final int componentCount) {
return 4 == componentCount ? awtPixelAttributesIntRGBA4 : awtPixelAttributesIntRGB3;
}
@@ -161,7 +162,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
* </p>
*/
@Override
- public AWTGLPixelBuffer allocate(GL gl, GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
+ public AWTGLPixelBuffer allocate(final GL gl, final GLPixelAttributes pixelAttributes, final int width, final int height, final int depth, final boolean pack, final int minByteSize) {
final BufferedImage image = new BufferedImage(width, height, 4 == pixelAttributes.componentCount ? BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB);
final int[] readBackIntBuffer = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();
final Buffer ibuffer = IntBuffer.wrap( readBackIntBuffer );
@@ -186,7 +187,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
/**
* @param allowRowStride If <code>true</code>, allow row-stride, otherwise not. See {@link AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
*/
- public SingleAWTGLPixelBufferProvider(boolean allowRowStride) {
+ public SingleAWTGLPixelBufferProvider(final boolean allowRowStride) {
super(allowRowStride);
}
@@ -197,7 +198,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
* </p>
*/
@Override
- public AWTGLPixelBuffer allocate(GL gl, GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
+ public AWTGLPixelBuffer allocate(final GL gl, final GLPixelAttributes pixelAttributes, final int width, final int height, final int depth, final boolean pack, final int minByteSize) {
if( 4 == pixelAttributes.componentCount ) {
if( null == singleRGBA4 || singleRGBA4.requiresNewBuffer(gl, width, height, minByteSize) ) {
singleRGBA4 = allocateImpl(pixelAttributes, width, height, depth, pack, minByteSize);
@@ -211,7 +212,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
}
}
- private AWTGLPixelBuffer allocateImpl(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
+ private AWTGLPixelBuffer allocateImpl(final GLPixelAttributes pixelAttributes, final int width, final int height, final int depth, final boolean pack, final int minByteSize) {
final BufferedImage image = new BufferedImage(width, height, 4 == pixelAttributes.componentCount ? BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB);
final int[] readBackIntBuffer = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();
final Buffer ibuffer = IntBuffer.wrap( readBackIntBuffer );
@@ -220,7 +221,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
/** Return the last {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated} {@link AWTGLPixelBuffer} w/ {@link GLPixelAttributes#componentCount}. */
@Override
- public AWTGLPixelBuffer getSingleBuffer(GLPixelAttributes pixelAttributes) {
+ public AWTGLPixelBuffer getSingleBuffer(final GLPixelAttributes pixelAttributes) {
return 4 == pixelAttributes.componentCount ? singleRGBA4 : singleRGB3;
}
@@ -229,7 +230,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
* @return the newly initialized single {@link AWTGLPixelBuffer}, or null if already allocated.
*/
@Override
- public AWTGLPixelBuffer initSingleton(int componentCount, int width, int height, int depth, boolean pack) {
+ public AWTGLPixelBuffer initSingleton(final int componentCount, final int width, final int height, final int depth, final boolean pack) {
if( 4 == componentCount ) {
if( null != singleRGBA4 ) {
return null;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
index 3c5d6be2d..06e3ccda5 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
@@ -46,7 +46,7 @@ public class AWTGLReadBufferUtil extends GLReadBufferUtil {
*
* @param alpha
*/
- public AWTGLReadBufferUtil(GLProfile glp, boolean alpha) {
+ public AWTGLReadBufferUtil(final GLProfile glp, final boolean alpha) {
super(new AWTGLPixelBuffer.AWTGLPixelBufferProvider( glp.isGL2ES3() /* allowRowStride */ ), alpha, false);
}
@@ -64,7 +64,7 @@ public class AWTGLReadBufferUtil extends GLReadBufferUtil {
* and handled in a efficient manner there (TextureCoordinates and TextureIO writer).
* @see #AWTGLReadBufferUtil(GLProfile, boolean)
*/
- public BufferedImage readPixelsToBufferedImage(GL gl, boolean awtOrientation) {
+ public BufferedImage readPixelsToBufferedImage(final GL gl, final boolean awtOrientation) {
return readPixelsToBufferedImage(gl, 0, 0, 0, 0, awtOrientation);
}
@@ -84,7 +84,7 @@ public class AWTGLReadBufferUtil extends GLReadBufferUtil {
* and handled in a efficient manner there (TextureCoordinates and TextureIO writer).
* @see #AWTGLReadBufferUtil(GLProfile, boolean)
*/
- public BufferedImage readPixelsToBufferedImage(GL gl, int inX, int inY, int inWidth, int inHeight, boolean awtOrientation) {
+ public BufferedImage readPixelsToBufferedImage(final GL gl, final int inX, final int inY, final int inWidth, final int inHeight, final boolean awtOrientation) {
final GLDrawable drawable = gl.getContext().getGLReadDrawable();
final int width, height;
if( 0 >= inWidth || drawable.getSurfaceWidth() < inWidth ) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java b/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
index df3cc4a39..4023a06f0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
@@ -50,8 +50,8 @@ public class ImageUtil {
/** Flips the supplied BufferedImage vertically. This is often a
necessary conversion step to display a Java2D image correctly
with OpenGL and vice versa. */
- public static void flipImageVertically(BufferedImage image) {
- WritableRaster raster = image.getRaster();
+ public static void flipImageVertically(final BufferedImage image) {
+ final WritableRaster raster = image.getRaster();
Object scanline1 = null;
Object scanline2 = null;
@@ -73,8 +73,8 @@ public class ImageUtil {
*
* @return A instance of <code>BufferedImage</code> with a type compatible with the graphics card.
*/
- public static BufferedImage createCompatibleImage(int width, int height) {
- GraphicsConfiguration configuration =
+ public static BufferedImage createCompatibleImage(final int width, final int height) {
+ final GraphicsConfiguration configuration =
GraphicsEnvironment.getLocalGraphicsEnvironment().
getDefaultScreenDevice().getDefaultConfiguration();
return configuration.createCompatibleImage(width, height);
@@ -92,7 +92,7 @@ public class ImageUtil {
*
* @return A thumbnail with the requested width or the original picture if thumbWidth = image.getWidth()
*/
- public static BufferedImage createThumbnail(BufferedImage image, int thumbWidth) {
+ public static BufferedImage createThumbnail(final BufferedImage image, final int thumbWidth) {
// Thanks to Romain Guy for this utility
if (thumbWidth > image.getWidth()) {
throw new IllegalArgumentException("Thumbnail width must be greater than image width");
@@ -102,7 +102,7 @@ public class ImageUtil {
return image;
}
- float ratio = (float) image.getWidth() / (float) image.getHeight();
+ final float ratio = (float) image.getWidth() / (float) image.getHeight();
int width = image.getWidth();
BufferedImage thumb = image;
@@ -112,8 +112,8 @@ public class ImageUtil {
width = thumbWidth;
}
- BufferedImage temp = createCompatibleImage(width, (int) (width / ratio));
- Graphics2D g2 = temp.createGraphics();
+ final BufferedImage temp = createCompatibleImage(width, (int) (width / ratio));
+ final Graphics2D g2 = temp.createGraphics();
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g2.drawImage(thumb, 0, 0, temp.getWidth(), temp.getHeight(), null);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java b/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java
index 1ad7b9987..a78bc9bb3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java
@@ -49,13 +49,13 @@ import javax.media.opengl.*;
efficiency. */
public class Overlay {
- private GLDrawable drawable;
+ private final GLDrawable drawable;
private TextureRenderer renderer;
private boolean contentsLost;
/** Creates a new Java 2D overlay on top of the specified
GLDrawable. */
- public Overlay(GLDrawable drawable) {
+ public Overlay(final GLDrawable drawable) {
this.drawable = drawable;
}
@@ -103,7 +103,7 @@ public class Overlay {
@param height the height of the region to update
@throws GLException If an OpenGL context is not current when this method is called */
- public void markDirty(int x, int y, int width, int height) {
+ public void markDirty(final int x, final int y, final int width, final int height) {
renderer.markDirty(x, y, width, height);
}
@@ -159,7 +159,7 @@ public class Overlay {
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void draw(int x, int y, int width, int height) throws GLException {
+ public void draw(final int x, final int y, final int width, final int height) throws GLException {
draw(x, y, x, y, width, height);
}
@@ -184,9 +184,9 @@ public class Overlay {
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void draw(int screenx, int screeny,
- int overlayx, int overlayy,
- int width, int height) throws GLException {
+ public void draw(final int screenx, final int screeny,
+ final int overlayx, final int overlayy,
+ final int width, final int height) throws GLException {
renderer.drawOrthoRect(screenx, screeny,
overlayx, overlayy,
width, height);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java b/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java
index f686b672a..ac208044b 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java
@@ -88,9 +88,9 @@ public class Screenshot {
* @throws IOException if an I/O error occurred while writing the
* file
*/
- public static void writeToTargaFile(File file,
- int width,
- int height) throws GLException, IOException {
+ public static void writeToTargaFile(final File file,
+ final int width,
+ final int height) throws GLException, IOException {
writeToTargaFile(file, width, height, false);
}
@@ -115,10 +115,10 @@ public class Screenshot {
* @throws IOException if an I/O error occurred while writing the
* file
*/
- public static void writeToTargaFile(File file,
- int width,
- int height,
- boolean alpha) throws GLException, IOException {
+ public static void writeToTargaFile(final File file,
+ final int width,
+ final int height,
+ final boolean alpha) throws GLException, IOException {
writeToTargaFile(file, 0, 0, width, height, alpha);
}
@@ -145,27 +145,27 @@ public class Screenshot {
* @throws IOException if an I/O error occurred while writing the
* file
*/
- public static void writeToTargaFile(File file,
- int x,
- int y,
- int width,
- int height,
- boolean alpha) throws GLException, IOException {
+ public static void writeToTargaFile(final File file,
+ final int x,
+ final int y,
+ final int width,
+ final int height,
+ final boolean alpha) throws GLException, IOException {
if (alpha) {
checkExtABGR();
}
- TGAWriter writer = new TGAWriter();
+ final TGAWriter writer = new TGAWriter();
writer.open(file, width, height, alpha);
- ByteBuffer bgr = writer.getImageData();
+ final ByteBuffer bgr = writer.getImageData();
- GL gl = GLContext.getCurrentGL();
+ final GL gl = GLContext.getCurrentGL();
// Set up pixel storage modes
- GLPixelStorageModes psm = new GLPixelStorageModes();
+ final GLPixelStorageModes psm = new GLPixelStorageModes();
psm.setPackAlignment(gl, 1);
- int readbackType = (alpha ? GL2.GL_ABGR_EXT : GL2GL3.GL_BGR);
+ final int readbackType = (alpha ? GL2.GL_ABGR_EXT : GL2GL3.GL_BGR);
// read the BGR values into the image buffer
gl.glReadPixels(x, y, width, height, readbackType,
@@ -198,8 +198,8 @@ public class Screenshot {
* @throws GLException if an OpenGL context was not current or
* another OpenGL-related error occurred
*/
- public static BufferedImage readToBufferedImage(int width,
- int height) throws GLException {
+ public static BufferedImage readToBufferedImage(final int width,
+ final int height) throws GLException {
return readToBufferedImage(width, height, false);
}
@@ -223,9 +223,9 @@ public class Screenshot {
* @throws GLException if an OpenGL context was not current or
* another OpenGL-related error occurred
*/
- public static BufferedImage readToBufferedImage(int width,
- int height,
- boolean alpha) throws GLException {
+ public static BufferedImage readToBufferedImage(final int width,
+ final int height,
+ final boolean alpha) throws GLException {
return readToBufferedImage(0, 0, width, height, alpha);
}
@@ -251,26 +251,26 @@ public class Screenshot {
* @throws GLException if an OpenGL context was not current or
* another OpenGL-related error occurred
*/
- public static BufferedImage readToBufferedImage(int x,
- int y,
- int width,
- int height,
- boolean alpha) throws GLException {
- int bufImgType = (alpha ? BufferedImage.TYPE_4BYTE_ABGR : BufferedImage.TYPE_3BYTE_BGR);
- int readbackType = (alpha ? GL2.GL_ABGR_EXT : GL2GL3.GL_BGR);
+ public static BufferedImage readToBufferedImage(final int x,
+ final int y,
+ final int width,
+ final int height,
+ final boolean alpha) throws GLException {
+ final int bufImgType = (alpha ? BufferedImage.TYPE_4BYTE_ABGR : BufferedImage.TYPE_3BYTE_BGR);
+ final int readbackType = (alpha ? GL2.GL_ABGR_EXT : GL2GL3.GL_BGR);
if (alpha) {
checkExtABGR();
}
// Allocate necessary storage
- BufferedImage image = new BufferedImage(width, height, bufImgType);
+ final BufferedImage image = new BufferedImage(width, height, bufImgType);
- GLContext glc = GLContext.getCurrent();
- GL gl = glc.getGL();
+ final GLContext glc = GLContext.getCurrent();
+ final GL gl = glc.getGL();
// Set up pixel storage modes
- GLPixelStorageModes psm = new GLPixelStorageModes();
+ final GLPixelStorageModes psm = new GLPixelStorageModes();
psm.setPackAlignment(gl, 1);
// read the BGR values into the image
@@ -313,9 +313,9 @@ public class Screenshot {
* not be written to disk due to the requested file format being
* unsupported by ImageIO
*/
- public static void writeToFile(File file,
- int width,
- int height) throws IOException, GLException {
+ public static void writeToFile(final File file,
+ final int width,
+ final int height) throws IOException, GLException {
writeToFile(file, width, height, false);
}
@@ -348,10 +348,10 @@ public class Screenshot {
* not be written to disk due to the requested file format being
* unsupported by ImageIO
*/
- public static void writeToFile(File file,
- int width,
- int height,
- boolean alpha) throws IOException, GLException {
+ public static void writeToFile(final File file,
+ final int width,
+ final int height,
+ final boolean alpha) throws IOException, GLException {
writeToFile(file, 0, 0, width, height, alpha);
}
@@ -386,26 +386,26 @@ public class Screenshot {
* not be written to disk due to the requested file format being
* unsupported by ImageIO
*/
- public static void writeToFile(File file,
- int x,
- int y,
- int width,
- int height,
+ public static void writeToFile(final File file,
+ final int x,
+ final int y,
+ final int width,
+ final int height,
boolean alpha) throws IOException, GLException {
- String fileSuffix = IOUtil.getFileSuffix(file);
+ final String fileSuffix = IOUtil.getFileSuffix(file);
if (alpha && (fileSuffix.equals("jpg") || fileSuffix.equals("jpeg"))) {
// JPEGs can't deal properly with alpha channels
alpha = false;
}
- BufferedImage image = readToBufferedImage(x, y, width, height, alpha);
+ final BufferedImage image = readToBufferedImage(x, y, width, height, alpha);
if (!ImageIO.write(image, fileSuffix, file)) {
throw new IOException("Unsupported file format " + fileSuffix);
}
}
private static void checkExtABGR() {
- GL gl = GLContext.getCurrentGL();
+ final GL gl = GLContext.getCurrentGL();
if (!gl.isExtensionAvailable(GLExtensions.EXT_abgr)) {
throw new IllegalArgumentException("Saving alpha channel requires GL_EXT_abgr");
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
index a5c8f66af..660d3bc6a 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
@@ -40,7 +40,7 @@
package com.jogamp.opengl.util.awt;
import com.jogamp.common.nio.Buffers;
-
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.opengl.GLExtensions;
import com.jogamp.opengl.util.*;
import com.jogamp.opengl.util.packrect.*;
@@ -60,14 +60,12 @@ import java.awt.RenderingHints;
import java.awt.event.*;
import java.awt.font.*;
import java.awt.geom.*;
-
import java.nio.*;
-
import java.text.*;
-
import java.util.*;
import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.GLPointerFunc;
import javax.media.opengl.glu.*;
import javax.media.opengl.awt.*;
@@ -132,7 +130,7 @@ public class TextRenderer {
static {
Debug.initSingleton();
- DEBUG = Debug.isPropertyDefined("jogl.debug.TextRenderer", true);
+ DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.TextRenderer", true);
}
// These are occasionally useful for more in-depth debugging
@@ -218,7 +216,7 @@ public class TextRenderer {
@param font the font to render with
*/
- public TextRenderer(Font font) {
+ public TextRenderer(final Font font) {
this(font, false, false, null, false);
}
@@ -232,7 +230,7 @@ public class TextRenderer {
@param font the font to render with
@param mipmap whether to attempt use of automatic mipmap generation
*/
- public TextRenderer(Font font, boolean mipmap) {
+ public TextRenderer(final Font font, final boolean mipmap) {
this(font, false, false, null, mipmap);
}
@@ -249,8 +247,8 @@ public class TextRenderer {
@param useFractionalMetrics whether to use fractional font
metrics at the Java 2D level
*/
- public TextRenderer(Font font, boolean antialiased,
- boolean useFractionalMetrics) {
+ public TextRenderer(final Font font, final boolean antialiased,
+ final boolean useFractionalMetrics) {
this(font, antialiased, useFractionalMetrics, null, false);
}
@@ -268,8 +266,8 @@ public class TextRenderer {
@param renderDelegate the render delegate to use to draw the
text's bitmap, or null to use the default one
*/
- public TextRenderer(Font font, boolean antialiased,
- boolean useFractionalMetrics, RenderDelegate renderDelegate) {
+ public TextRenderer(final Font font, final boolean antialiased,
+ final boolean useFractionalMetrics, final RenderDelegate renderDelegate) {
this(font, antialiased, useFractionalMetrics, renderDelegate, false);
}
@@ -290,9 +288,9 @@ public class TextRenderer {
text's bitmap, or null to use the default one
@param mipmap whether to attempt use of automatic mipmap generation
*/
- public TextRenderer(Font font, boolean antialiased,
- boolean useFractionalMetrics, RenderDelegate renderDelegate,
- boolean mipmap) {
+ public TextRenderer(final Font font, final boolean antialiased,
+ final boolean useFractionalMetrics, RenderDelegate renderDelegate,
+ final boolean mipmap) {
this.font = font;
this.antialiased = antialiased;
this.useFractionalMetrics = useFractionalMetrics;
@@ -314,7 +312,7 @@ public class TextRenderer {
/** Returns the bounding rectangle of the given String, assuming it
was rendered at the origin. See {@link #getBounds(CharSequence)
getBounds(CharSequence)}. */
- public Rectangle2D getBounds(String str) {
+ public Rectangle2D getBounds(final String str) {
return getBounds((CharSequence) str);
}
@@ -333,12 +331,12 @@ public class TextRenderer {
{@link java.awt.font.GlyphVector#getPixelBounds getPixelBounds},
etc.) the returned bounds correspond to, although every effort
is made to ensure an accurate bound. */
- public Rectangle2D getBounds(CharSequence str) {
+ public Rectangle2D getBounds(final CharSequence str) {
// FIXME: this should be more optimized and use the glyph cache
- Rect r = stringLocations.get(str);
+ final Rect r = stringLocations.get(str);
if (r != null) {
- TextData data = (TextData) r.getUserData();
+ final TextData data = (TextData) r.getUserData();
// Reconstitute the Java 2D results based on the cached values
return new Rectangle2D.Double(-data.origin().x, -data.origin().y,
@@ -385,7 +383,7 @@ public class TextRenderer {
@param height the height of the current on-screen OpenGL drawable
@throws javax.media.opengl.GLException If an OpenGL context is not current when this method is called
*/
- public void beginRendering(int width, int height) throws GLException {
+ public void beginRendering(final int width, final int height) throws GLException {
beginRendering(width, height, true);
}
@@ -405,7 +403,7 @@ public class TextRenderer {
@param disableDepthTest whether to disable the depth test
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void beginRendering(int width, int height, boolean disableDepthTest)
+ public void beginRendering(final int width, final int height, final boolean disableDepthTest)
throws GLException {
beginRendering(true, width, height, disableDepthTest);
}
@@ -432,8 +430,8 @@ public class TextRenderer {
@param color the new color to use for rendering text
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void setColor(Color color) throws GLException {
- boolean noNeedForFlush = (haveCachedColor && (cachedColor != null) &&
+ public void setColor(final Color color) throws GLException {
+ final boolean noNeedForFlush = (haveCachedColor && (cachedColor != null) &&
color.equals(cachedColor));
if (!noNeedForFlush) {
@@ -460,9 +458,9 @@ public class TextRenderer {
transparent, 1.0f = completely opaque
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void setColor(float r, float g, float b, float a)
+ public void setColor(final float r, final float g, final float b, final float a)
throws GLException {
- boolean noNeedForFlush = (haveCachedColor && (cachedColor == null) &&
+ final boolean noNeedForFlush = (haveCachedColor && (cachedColor == null) &&
(r == cachedR) && (g == cachedG) && (b == cachedB) &&
(a == cachedA));
@@ -490,14 +488,14 @@ public class TextRenderer {
@param y the y coordinate at which to draw
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void draw(CharSequence str, int x, int y) throws GLException {
+ public void draw(final CharSequence str, final int x, final int y) throws GLException {
draw3D(str, x, y, 0, 1);
}
/** Draws the supplied String at the desired location using the
renderer's current color. See {@link #draw(CharSequence, int,
int) draw(CharSequence, int, int)}. */
- public void draw(String str, int x, int y) throws GLException {
+ public void draw(final String str, final int x, final int y) throws GLException {
draw3D(str, x, y, 0, 1);
}
@@ -513,8 +511,8 @@ public class TextRenderer {
@param scaleFactor a uniform scale factor applied to the width and height of the drawn rectangle
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void draw3D(CharSequence str, float x, float y, float z,
- float scaleFactor) {
+ public void draw3D(final CharSequence str, final float x, final float y, final float z,
+ final float scaleFactor) {
internal_draw3D(str, x, y, z, scaleFactor);
}
@@ -522,12 +520,12 @@ public class TextRenderer {
renderer's current color. See {@link #draw3D(CharSequence,
float, float, float, float) draw3D(CharSequence, float, float,
float, float)}. */
- public void draw3D(String str, float x, float y, float z, float scaleFactor) {
+ public void draw3D(final String str, final float x, final float y, final float z, final float scaleFactor) {
internal_draw3D(str, x, y, z, scaleFactor);
}
/** Returns the pixel width of the given character. */
- public float getCharWidth(char inChar) {
+ public float getCharWidth(final char inChar) {
return mGlyphProducer.getGlyphPixelWidth(inChar);
}
@@ -582,20 +580,20 @@ public class TextRenderer {
// Internals only below this point
//
- private static Rectangle2D preNormalize(Rectangle2D src) {
+ private static Rectangle2D preNormalize(final Rectangle2D src) {
// Need to round to integer coordinates
// Also give ourselves a little slop around the reported
// bounds of glyphs because it looks like neither the visual
// nor the pixel bounds works perfectly well
- int minX = (int) Math.floor(src.getMinX()) - 1;
- int minY = (int) Math.floor(src.getMinY()) - 1;
- int maxX = (int) Math.ceil(src.getMaxX()) + 1;
- int maxY = (int) Math.ceil(src.getMaxY()) + 1;
+ final int minX = (int) Math.floor(src.getMinX()) - 1;
+ final int minY = (int) Math.floor(src.getMinY()) - 1;
+ final int maxX = (int) Math.ceil(src.getMaxX()) + 1;
+ final int maxY = (int) Math.ceil(src.getMaxY()) + 1;
return new Rectangle2D.Double(minX, minY, maxX - minX, maxY - minY);
}
- private Rectangle2D normalize(Rectangle2D src) {
+ private Rectangle2D normalize(final Rectangle2D src) {
// Give ourselves a boundary around each entity on the backing
// store in order to prevent bleeding of nearby Strings due to
// the fact that we use linear filtering
@@ -603,7 +601,7 @@ public class TextRenderer {
// NOTE that this boundary is quite heuristic and is related
// to how far away in 3D we may view the text --
// heuristically, 1.5% of the font's height
- int boundary = (int) Math.max(1, 0.015 * font.getSize());
+ final int boundary = (int) Math.max(1, 0.015 * font.getSize());
return new Rectangle2D.Double((int) Math.floor(src.getMinX() - boundary),
(int) Math.floor(src.getMinY() - boundary),
@@ -612,7 +610,7 @@ public class TextRenderer {
}
private TextureRenderer getBackingStore() {
- TextureRenderer renderer = (TextureRenderer) packer.getBackingStore();
+ final TextureRenderer renderer = (TextureRenderer) packer.getBackingStore();
if (renderer != cachedBackingStore) {
// Backing store changed since last time; discard any cached Graphics2D
@@ -629,7 +627,7 @@ public class TextRenderer {
}
private Graphics2D getGraphics2D() {
- TextureRenderer renderer = getBackingStore();
+ final TextureRenderer renderer = getBackingStore();
if (cachedGraphics == null) {
cachedGraphics = renderer.createGraphics();
@@ -650,9 +648,9 @@ public class TextRenderer {
return cachedGraphics;
}
- private void beginRendering(boolean ortho, int width, int height,
- boolean disableDepthTestForOrtho) {
- GL2 gl = GLContext.getCurrentGL().getGL2();
+ private void beginRendering(final boolean ortho, final int width, final int height,
+ final boolean disableDepthTestForOrtho) {
+ final GL2 gl = GLContext.getCurrentGL().getGL2();
if (DEBUG && !debugged) {
debug(gl);
@@ -677,8 +675,8 @@ public class TextRenderer {
if (!haveMaxSize) {
// Query OpenGL for the maximum texture size and set it in the
// RectanglePacker to keep it from expanding too large
- int[] sz = new int[1];
- gl.glGetIntegerv(GL2.GL_MAX_TEXTURE_SIZE, sz, 0);
+ final int[] sz = new int[1];
+ gl.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, sz, 0);
packer.setMaxSize(sz[0], sz[0]);
haveMaxSize = true;
}
@@ -711,12 +709,12 @@ public class TextRenderer {
* @param ortho
* @throws GLException
*/
- private void endRendering(boolean ortho) throws GLException {
+ private void endRendering(final boolean ortho) throws GLException {
flushGlyphPipeline();
inBeginEndPair = false;
- GL2 gl = GLContext.getCurrentGL().getGL2();
+ final GL2 gl = GLContext.getCurrentGL().getGL2();
// Pop client attrib bits used by the pipelined quad renderer
gl.glPopClientAttrib();
@@ -726,8 +724,8 @@ public class TextRenderer {
// binding
if (getUseVertexArrays() && is15Available(gl)) {
try {
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
- } catch (Exception e) {
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+ } catch (final Exception e) {
isExtensionAvailable_GL_VERSION_1_5 = false;
}
}
@@ -756,8 +754,8 @@ public class TextRenderer {
// text strings that haven't been used recently
packer.visit(new RectVisitor() {
@Override
- public void visit(Rect rect) {
- TextData data = (TextData) rect.getUserData();
+ public void visit(final Rect rect) {
+ final TextData data = (TextData) rect.getUserData();
if (data.used()) {
data.clearUsed();
@@ -767,11 +765,11 @@ public class TextRenderer {
}
});
- for (Rect r : deadRects) {
+ for (final Rect r : deadRects) {
packer.remove(r);
stringLocations.remove(((TextData) r.getUserData()).string());
- int unicodeToClearFromCache = ((TextData) r.getUserData()).unicodeID;
+ final int unicodeToClearFromCache = ((TextData) r.getUserData()).unicodeID;
if (unicodeToClearFromCache > 0) {
mGlyphProducer.clearCacheEntry(unicodeToClearFromCache);
@@ -786,7 +784,7 @@ public class TextRenderer {
}
// If we removed dead rectangles this cycle, try to do a compaction
- float frag = packer.verticalFragmentationRatio();
+ final float frag = packer.verticalFragmentationRatio();
if (!deadRects.isEmpty() && (frag > MAX_VERTICAL_FRAGMENTATION)) {
if (DEBUG) {
@@ -804,10 +802,10 @@ public class TextRenderer {
}
}
- private void internal_draw3D(CharSequence str, float x, float y, float z,
- float scaleFactor) {
- for (Glyph glyph : mGlyphProducer.getGlyphs(str)) {
- float advance = glyph.draw3D(x, y, z, scaleFactor);
+ private void internal_draw3D(final CharSequence str, float x, final float y, final float z,
+ final float scaleFactor) {
+ for (final Glyph glyph : mGlyphProducer.getGlyphs(str)) {
+ final float advance = glyph.draw3D(x, y, z, scaleFactor);
x += advance * scaleFactor;
}
}
@@ -818,8 +816,8 @@ public class TextRenderer {
}
}
- private void draw3D_ROBUST(CharSequence str, float x, float y, float z,
- float scaleFactor) {
+ private void draw3D_ROBUST(final CharSequence str, final float x, final float y, final float z,
+ final float scaleFactor) {
String curStr;
if (str instanceof String) {
curStr = (String) str;
@@ -833,9 +831,9 @@ public class TextRenderer {
if (rect == null) {
// Rasterize this string and place it on the backing store
Graphics2D g = getGraphics2D();
- Rectangle2D origBBox = preNormalize(renderDelegate.getBounds(curStr, font, getFontRenderContext()));
- Rectangle2D bbox = normalize(origBBox);
- Point origin = new Point((int) -bbox.getMinX(),
+ final Rectangle2D origBBox = preNormalize(renderDelegate.getBounds(curStr, font, getFontRenderContext()));
+ final Rectangle2D bbox = normalize(origBBox);
+ final Point origin = new Point((int) -bbox.getMinX(),
(int) -bbox.getMinY());
rect = new Rect(0, 0, (int) bbox.getWidth(),
(int) bbox.getHeight(),
@@ -850,8 +848,8 @@ public class TextRenderer {
// OK, should now have an (x, y) for this rectangle; rasterize
// the String
- int strx = rect.x() + origin.x;
- int stry = rect.y() + origin.y;
+ final int strx = rect.x() + origin.x;
+ final int stry = rect.y() + origin.y;
// Clear out the area we're going to draw into
g.setComposite(AlphaComposite.Clear);
@@ -862,7 +860,7 @@ public class TextRenderer {
renderDelegate.draw(g, curStr, strx, stry);
if (DRAW_BBOXES) {
- TextData data = (TextData) rect.getUserData();
+ final TextData data = (TextData) rect.getUserData();
// Draw a bounding box on the backing store
g.drawRect(strx - data.origOriginX(),
stry - data.origOriginY(),
@@ -880,15 +878,15 @@ public class TextRenderer {
}
// OK, now draw the portion of the backing store to the screen
- TextureRenderer renderer = getBackingStore();
+ final TextureRenderer renderer = getBackingStore();
// NOTE that the rectangles managed by the packer have their
// origin at the upper-left but the TextureRenderer's origin is
// at its lower left!!!
- TextData data = (TextData) rect.getUserData();
+ final TextData data = (TextData) rect.getUserData();
data.markUsed();
- Rectangle2D origRect = data.origRect();
+ final Rectangle2D origRect = data.origRect();
// Align the leftmost point of the baseline to the (x, y, z) coordinate requested
renderer.draw3DRect(x - (scaleFactor * data.origOriginX()),
@@ -902,10 +900,10 @@ public class TextRenderer {
//----------------------------------------------------------------------
// Debugging functionality
//
- private void debug(GL gl) {
+ private void debug(final GL gl) {
dbgFrame = new Frame("TextRenderer Debug Output");
- GLCanvas dbgCanvas = new GLCanvas(new GLCapabilities(gl.getGLProfile()));
+ final GLCanvas dbgCanvas = new GLCanvas(new GLCapabilities(gl.getGLProfile()));
dbgCanvas.setSharedContext(GLContext.getCurrent());
dbgCanvas.addGLEventListener(new DebugListener(gl, dbgFrame));
dbgFrame.add(dbgCanvas);
@@ -913,7 +911,7 @@ public class TextRenderer {
final FPSAnimator anim = new FPSAnimator(dbgCanvas, 10);
dbgFrame.addWindowListener(new WindowAdapter() {
@Override
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
// Run this on another thread than the AWT event queue to
// make sure the call to Animator.stop() completes before
// exiting
@@ -999,11 +997,11 @@ public class TextRenderer {
CharSequenceIterator() {
}
- CharSequenceIterator(CharSequence sequence) {
+ CharSequenceIterator(final CharSequence sequence) {
initFromCharSequence(sequence);
}
- public void initFromCharSequence(CharSequence sequence) {
+ public void initFromCharSequence(final CharSequence sequence) {
mSequence = sequence;
mLength = mSequence.length();
mCurrentIndex = 0;
@@ -1040,7 +1038,7 @@ public class TextRenderer {
}
@Override
- public char setIndex(int position) {
+ public char setIndex(final int position) {
mCurrentIndex = position;
return current();
@@ -1063,7 +1061,7 @@ public class TextRenderer {
@Override
public Object clone() {
- CharSequenceIterator iter = new CharSequenceIterator(mSequence);
+ final CharSequenceIterator iter = new CharSequenceIterator(mSequence);
iter.mCurrentIndex = mCurrentIndex;
return iter;
@@ -1108,7 +1106,7 @@ public class TextRenderer {
private boolean used; // Whether this text was used recently
- TextData(String str, Point origin, Rectangle2D origRect, int unicodeID) {
+ TextData(final String str, final Point origin, final Rectangle2D origRect, final int unicodeID) {
this.str = str;
this.origin = origin;
this.origRect = origRect;
@@ -1154,7 +1152,7 @@ public class TextRenderer {
private Graphics2D g;
@Override
- public Object allocateBackingStore(int w, int h) {
+ public Object allocateBackingStore(final int w, final int h) {
// FIXME: should consider checking Font's attributes to see
// whether we're likely to need to support a full RGBA backing
// store (i.e., non-default Paint, foreground color, etc.), but
@@ -1177,12 +1175,12 @@ public class TextRenderer {
}
@Override
- public void deleteBackingStore(Object backingStore) {
+ public void deleteBackingStore(final Object backingStore) {
((TextureRenderer) backingStore).dispose();
}
@Override
- public boolean preExpand(Rect cause, int attemptNumber) {
+ public boolean preExpand(final Rect cause, final int attemptNumber) {
// Only try this one time; clear out potentially obsolete entries
// NOTE: this heuristic and the fact that it clears the used bit
// of all entries seems to cause cycling of entries in some
@@ -1218,7 +1216,7 @@ public class TextRenderer {
}
@Override
- public boolean additionFailed(Rect cause, int attemptNumber) {
+ public boolean additionFailed(final Rect cause, final int attemptNumber) {
// Heavy hammer -- might consider doing something different
packer.clear();
stringLocations.clear();
@@ -1242,13 +1240,13 @@ public class TextRenderer {
}
@Override
- public void beginMovement(Object oldBackingStore, Object newBackingStore) {
+ public void beginMovement(final Object oldBackingStore, final Object newBackingStore) {
// Exit the begin / end pair if necessary
if (inBeginEndPair) {
// Draw any outstanding glyphs
flush();
- GL2 gl = GLContext.getCurrentGL().getGL2();
+ final GL2 gl = GLContext.getCurrentGL().getGL2();
// Pop client attrib bits used by the pipelined quad renderer
gl.glPopClientAttrib();
@@ -1258,8 +1256,8 @@ public class TextRenderer {
// binding
if (getUseVertexArrays() && is15Available(gl)) {
try {
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
- } catch (Exception e) {
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+ } catch (final Exception e) {
isExtensionAvailable_GL_VERSION_1_5 = false;
}
}
@@ -1271,15 +1269,15 @@ public class TextRenderer {
}
}
- TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
+ final TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
g = newRenderer.createGraphics();
}
@Override
- public void move(Object oldBackingStore, Rect oldLocation,
- Object newBackingStore, Rect newLocation) {
- TextureRenderer oldRenderer = (TextureRenderer) oldBackingStore;
- TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
+ public void move(final Object oldBackingStore, final Rect oldLocation,
+ final Object newBackingStore, final Rect newLocation) {
+ final TextureRenderer oldRenderer = (TextureRenderer) oldBackingStore;
+ final TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
if (oldRenderer == newRenderer) {
// Movement on the same backing store -- easy case
@@ -1288,7 +1286,7 @@ public class TextRenderer {
newLocation.y() - oldLocation.y());
} else {
// Need to draw from the old renderer's image into the new one
- Image img = oldRenderer.getImage();
+ final Image img = oldRenderer.getImage();
g.drawImage(img, newLocation.x(), newLocation.y(),
newLocation.x() + newLocation.w(),
newLocation.y() + newLocation.h(), oldLocation.x(),
@@ -1298,11 +1296,11 @@ public class TextRenderer {
}
@Override
- public void endMovement(Object oldBackingStore, Object newBackingStore) {
+ public void endMovement(final Object oldBackingStore, final Object newBackingStore) {
g.dispose();
// Sync the whole surface
- TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
+ final TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
newRenderer.markDirty(0, 0, newRenderer.getWidth(),
newRenderer.getHeight());
@@ -1316,7 +1314,7 @@ public class TextRenderer {
}
// Push client attrib bits used by the pipelined quad renderer
- GL2 gl = GLContext.getCurrentGL().getGL2();
+ final GL2 gl = GLContext.getCurrentGL().getGL2();
gl.glPushClientAttrib((int) GL2.GL_ALL_CLIENT_ATTRIB_BITS);
if (haveCachedColor) {
@@ -1340,32 +1338,32 @@ public class TextRenderer {
}
@Override
- public Rectangle2D getBounds(CharSequence str, Font font,
- FontRenderContext frc) {
+ public Rectangle2D getBounds(final CharSequence str, final Font font,
+ final FontRenderContext frc) {
return getBounds(font.createGlyphVector(frc,
new CharSequenceIterator(str)),
frc);
}
@Override
- public Rectangle2D getBounds(String str, Font font,
- FontRenderContext frc) {
+ public Rectangle2D getBounds(final String str, final Font font,
+ final FontRenderContext frc) {
return getBounds(font.createGlyphVector(frc, str), frc);
}
@Override
- public Rectangle2D getBounds(GlyphVector gv, FontRenderContext frc) {
+ public Rectangle2D getBounds(final GlyphVector gv, final FontRenderContext frc) {
return gv.getVisualBounds();
}
@Override
- public void drawGlyphVector(Graphics2D graphics, GlyphVector str,
- int x, int y) {
+ public void drawGlyphVector(final Graphics2D graphics, final GlyphVector str,
+ final int x, final int y) {
graphics.drawGlyphVector(str, x, y);
}
@Override
- public void draw(Graphics2D graphics, String str, int x, int y) {
+ public void draw(final Graphics2D graphics, final String str, final int x, final int y) {
graphics.drawString(str, x, y);
}
}
@@ -1415,11 +1413,11 @@ public class TextRenderer {
private boolean needAdvance;
// Creates a Glyph representing an individual Unicode character
- public Glyph(int unicodeID,
- int glyphCode,
- float advance,
- GlyphVector singleUnicodeGlyphVector,
- GlyphProducer producer) {
+ public Glyph(final int unicodeID,
+ final int glyphCode,
+ final float advance,
+ final GlyphVector singleUnicodeGlyphVector,
+ final GlyphProducer producer) {
this.unicodeID = unicodeID;
this.glyphCode = glyphCode;
this.advance = advance;
@@ -1430,7 +1428,7 @@ public class TextRenderer {
// Creates a Glyph representing a sequence of characters, with
// an indication of whether additional single glyphs are being
// rendered after it
- public Glyph(String str, boolean needAdvance) {
+ public Glyph(final String str, final boolean needAdvance) {
this.str = str;
this.needAdvance = needAdvance;
}
@@ -1451,14 +1449,14 @@ public class TextRenderer {
}
/** Draws this glyph and returns the (x) advance for this glyph */
- public float draw3D(float inX, float inY, float z, float scaleFactor) {
+ public float draw3D(final float inX, final float inY, final float z, final float scaleFactor) {
if (str != null) {
draw3D_ROBUST(str, inX, inY, z, scaleFactor);
if (!needAdvance) {
return 0;
}
// Compute and return the advance for this string
- GlyphVector gv = font.createGlyphVector(getFontRenderContext(), str);
+ final GlyphVector gv = font.createGlyphVector(getFontRenderContext(), str);
float totalAdvance = 0;
for (int i = 0; i < gv.getNumGlyphs(); i++) {
totalAdvance += gv.getGlyphMetrics(i).getAdvance();
@@ -1476,32 +1474,32 @@ public class TextRenderer {
mPipelinedQuadRenderer = new Pipelined_QuadRenderer();
}
- TextureRenderer renderer = getBackingStore();
+ final TextureRenderer renderer = getBackingStore();
// Handles case where NPOT texture is used for backing store
- TextureCoords wholeImageTexCoords = renderer.getTexture().getImageTexCoords();
- float xScale = wholeImageTexCoords.right();
- float yScale = wholeImageTexCoords.bottom();
+ final TextureCoords wholeImageTexCoords = renderer.getTexture().getImageTexCoords();
+ final float xScale = wholeImageTexCoords.right();
+ final float yScale = wholeImageTexCoords.bottom();
- Rect rect = glyphRectForTextureMapping;
- TextData data = (TextData) rect.getUserData();
+ final Rect rect = glyphRectForTextureMapping;
+ final TextData data = (TextData) rect.getUserData();
data.markUsed();
- Rectangle2D origRect = data.origRect();
+ final Rectangle2D origRect = data.origRect();
- float x = inX - (scaleFactor * data.origOriginX());
- float y = inY - (scaleFactor * ((float) origRect.getHeight() - data.origOriginY()));
+ final float x = inX - (scaleFactor * data.origOriginX());
+ final float y = inY - (scaleFactor * ((float) origRect.getHeight() - data.origOriginY()));
- int texturex = rect.x() + (data.origin().x - data.origOriginX());
- int texturey = renderer.getHeight() - rect.y() - (int) origRect.getHeight() -
+ final int texturex = rect.x() + (data.origin().x - data.origOriginX());
+ final int texturey = renderer.getHeight() - rect.y() - (int) origRect.getHeight() -
(data.origin().y - data.origOriginY());
- int width = (int) origRect.getWidth();
- int height = (int) origRect.getHeight();
+ final int width = (int) origRect.getWidth();
+ final int height = (int) origRect.getHeight();
- float tx1 = xScale * texturex / renderer.getWidth();
- float ty1 = yScale * (1.0f -
+ final float tx1 = xScale * texturex / renderer.getWidth();
+ final float ty1 = yScale * (1.0f -
((float) texturey / (float) renderer.getHeight()));
- float tx2 = xScale * (texturex + width) / renderer.getWidth();
- float ty2 = yScale * (1.0f -
+ final float tx2 = xScale * (texturex + width) / renderer.getWidth();
+ final float ty2 = yScale * (1.0f -
((float) (texturey + height) / (float) renderer.getHeight()));
mPipelinedQuadRenderer.glTexCoord2f(tx1, ty1);
@@ -1515,7 +1513,7 @@ public class TextRenderer {
mPipelinedQuadRenderer.glTexCoord2f(tx1, ty2);
mPipelinedQuadRenderer.glVertex3f(x,
y + (height * scaleFactor), z);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
return advance;
@@ -1527,21 +1525,21 @@ public class TextRenderer {
}
private void upload() {
- GlyphVector gv = getGlyphVector();
- Rectangle2D origBBox = preNormalize(renderDelegate.getBounds(gv, getFontRenderContext()));
- Rectangle2D bbox = normalize(origBBox);
- Point origin = new Point((int) -bbox.getMinX(),
+ final GlyphVector gv = getGlyphVector();
+ final Rectangle2D origBBox = preNormalize(renderDelegate.getBounds(gv, getFontRenderContext()));
+ final Rectangle2D bbox = normalize(origBBox);
+ final Point origin = new Point((int) -bbox.getMinX(),
(int) -bbox.getMinY());
- Rect rect = new Rect(0, 0, (int) bbox.getWidth(),
+ final Rect rect = new Rect(0, 0, (int) bbox.getWidth(),
(int) bbox.getHeight(),
new TextData(null, origin, origBBox, unicodeID));
packer.add(rect);
glyphRectForTextureMapping = rect;
- Graphics2D g = getGraphics2D();
+ final Graphics2D g = getGraphics2D();
// OK, should now have an (x, y) for this rectangle; rasterize
// the glyph
- int strx = rect.x() + origin.x;
- int stry = rect.y() + origin.y;
+ final int strx = rect.x() + origin.x;
+ final int stry = rect.y() + origin.y;
// Clear out the area we're going to draw into
g.setComposite(AlphaComposite.Clear);
@@ -1552,7 +1550,7 @@ public class TextRenderer {
renderDelegate.drawGlyphVector(g, gv, strx, stry);
if (DRAW_BBOXES) {
- TextData data = (TextData) rect.getUserData();
+ final TextData data = (TextData) rect.getUserData();
// Draw a bounding box on the backing store
g.drawRect(strx - data.origOriginX(),
stry - data.origOriginY(),
@@ -1572,7 +1570,7 @@ public class TextRenderer {
}
private GlyphVector getGlyphVector() {
- GlyphVector gv = singleUnicodeGlyphVector;
+ final GlyphVector gv = singleUnicodeGlyphVector;
if (gv != null) {
singleUnicodeGlyphVector = null; // Don't need this anymore
return gv;
@@ -1595,13 +1593,13 @@ public class TextRenderer {
// We re-use this for each incoming string
CharSequenceIterator iter = new CharSequenceIterator();
- GlyphProducer(int fontLengthInGlyphs) {
+ GlyphProducer(final int fontLengthInGlyphs) {
unicodes2Glyphs = new int[512];
glyphCache = new Glyph[fontLengthInGlyphs];
clearAllCacheEntries();
}
- public List<Glyph> getGlyphs(CharSequence inString) {
+ public List<Glyph> getGlyphs(final CharSequence inString) {
glyphsOutput.clear();
GlyphVector fullRunGlyphVector;
fullRunGlyphVector = fullGlyphVectorCache.get(inString.toString());
@@ -1610,30 +1608,30 @@ public class TextRenderer {
fullRunGlyphVector = font.createGlyphVector(getFontRenderContext(), iter);
fullGlyphVectorCache.put(inString.toString(), fullRunGlyphVector);
}
- boolean complex = (fullRunGlyphVector.getLayoutFlags() != 0);
+ final boolean complex = (fullRunGlyphVector.getLayoutFlags() != 0);
if (complex || DISABLE_GLYPH_CACHE) {
// Punt to the robust version of the renderer
glyphsOutput.add(new Glyph(inString.toString(), false));
return glyphsOutput;
}
- int lengthInGlyphs = fullRunGlyphVector.getNumGlyphs();
+ final int lengthInGlyphs = fullRunGlyphVector.getNumGlyphs();
int i = 0;
while (i < lengthInGlyphs) {
- Character letter = CharacterCache.valueOf(inString.charAt(i));
+ final Character letter = CharacterCache.valueOf(inString.charAt(i));
GlyphMetrics metrics = glyphMetricsCache.get(letter);
if (metrics == null) {
metrics = fullRunGlyphVector.getGlyphMetrics(i);
glyphMetricsCache.put(letter, metrics);
}
- Glyph glyph = getGlyph(inString, metrics, i);
+ final Glyph glyph = getGlyph(inString, metrics, i);
if (glyph != null) {
glyphsOutput.add(glyph);
i++;
} else {
// Assemble a run of characters that don't fit in
// the cache
- StringBuilder buf = new StringBuilder();
+ final StringBuilder buf = new StringBuilder();
while (i < lengthInGlyphs &&
getGlyph(inString, fullRunGlyphVector.getGlyphMetrics(i), i) == null) {
buf.append(inString.charAt(i++));
@@ -1646,10 +1644,10 @@ public class TextRenderer {
return glyphsOutput;
}
- public void clearCacheEntry(int unicodeID) {
- int glyphID = unicodes2Glyphs[unicodeID];
+ public void clearCacheEntry(final int unicodeID) {
+ final int glyphID = unicodes2Glyphs[unicodeID];
if (glyphID != undefined) {
- Glyph glyph = glyphCache[glyphID];
+ final Glyph glyph = glyphCache[glyphID];
if (glyph != null) {
glyph.clear();
}
@@ -1664,20 +1662,20 @@ public class TextRenderer {
}
}
- public void register(Glyph glyph) {
+ public void register(final Glyph glyph) {
unicodes2Glyphs[glyph.getUnicodeID()] = glyph.getGlyphCode();
glyphCache[glyph.getGlyphCode()] = glyph;
}
- public float getGlyphPixelWidth(char unicodeID) {
- Glyph glyph = getGlyph(unicodeID);
+ public float getGlyphPixelWidth(final char unicodeID) {
+ final Glyph glyph = getGlyph(unicodeID);
if (glyph != null) {
return glyph.getAdvance();
}
// Have to do this the hard / uncached way
singleUnicode[0] = unicodeID;
- GlyphVector gv = font.createGlyphVector(fontRenderContext,
+ final GlyphVector gv = font.createGlyphVector(fontRenderContext,
singleUnicode);
return gv.getGlyphMetrics(0).getAdvance();
}
@@ -1685,52 +1683,52 @@ public class TextRenderer {
// Returns a glyph object for this single glyph. Returns null
// if the unicode or glyph ID would be out of bounds of the
// glyph cache.
- private Glyph getGlyph(CharSequence inString,
- GlyphMetrics glyphMetrics,
- int index) {
- char unicodeID = inString.charAt(index);
+ private Glyph getGlyph(final CharSequence inString,
+ final GlyphMetrics glyphMetrics,
+ final int index) {
+ final char unicodeID = inString.charAt(index);
if (unicodeID >= unicodes2Glyphs.length) {
return null;
}
- int glyphID = unicodes2Glyphs[unicodeID];
+ final int glyphID = unicodes2Glyphs[unicodeID];
if (glyphID != undefined) {
return glyphCache[glyphID];
}
// Must fabricate the glyph
singleUnicode[0] = unicodeID;
- GlyphVector gv = font.createGlyphVector(getFontRenderContext(), singleUnicode);
+ final GlyphVector gv = font.createGlyphVector(getFontRenderContext(), singleUnicode);
return getGlyph(unicodeID, gv, glyphMetrics);
}
// It's unclear whether this variant might produce less
// optimal results than if we can see the entire GlyphVector
// for the incoming string
- private Glyph getGlyph(int unicodeID) {
+ private Glyph getGlyph(final int unicodeID) {
if (unicodeID >= unicodes2Glyphs.length) {
return null;
}
- int glyphID = unicodes2Glyphs[unicodeID];
+ final int glyphID = unicodes2Glyphs[unicodeID];
if (glyphID != undefined) {
return glyphCache[glyphID];
}
singleUnicode[0] = (char) unicodeID;
- GlyphVector gv = font.createGlyphVector(getFontRenderContext(), singleUnicode);
+ final GlyphVector gv = font.createGlyphVector(getFontRenderContext(), singleUnicode);
return getGlyph(unicodeID, gv, gv.getGlyphMetrics(0));
}
- private Glyph getGlyph(int unicodeID,
- GlyphVector singleUnicodeGlyphVector,
- GlyphMetrics metrics) {
- int glyphCode = singleUnicodeGlyphVector.getGlyphCode(0);
+ private Glyph getGlyph(final int unicodeID,
+ final GlyphVector singleUnicodeGlyphVector,
+ final GlyphMetrics metrics) {
+ final int glyphCode = singleUnicodeGlyphVector.getGlyphCode(0);
// Have seen huge glyph codes (65536) coming out of some fonts in some Unicode situations
if (glyphCode >= glyphCache.length) {
return null;
}
- Glyph glyph = new Glyph(unicodeID,
+ final Glyph glyph = new Glyph(unicodeID,
glyphCode,
metrics.getAdvance(),
singleUnicodeGlyphVector,
@@ -1752,7 +1750,7 @@ public class TextRenderer {
}
}
- public static Character valueOf(char c) {
+ public static Character valueOf(final char c) {
if (c <= 127) { // must cache
return CharacterCache.cache[c];
}
@@ -1769,7 +1767,7 @@ public class TextRenderer {
int mVBO_For_ResuableTileTexCoords;
Pipelined_QuadRenderer() {
- GL2 gl = GLContext.getCurrentGL().getGL2();
+ final GL2 gl = GLContext.getCurrentGL().getGL2();
mVertCoords = Buffers.newDirectFloatBuffer(kTotalBufferSizeCoordsVerts);
mTexCoords = Buffers.newDirectFloatBuffer(kTotalBufferSizeCoordsTex);
@@ -1777,34 +1775,34 @@ public class TextRenderer {
if (usingVBOs) {
try {
- int[] vbos = new int[2];
+ final int[] vbos = new int[2];
gl.glGenBuffers(2, IntBuffer.wrap(vbos));
mVBO_For_ResuableTileVertices = vbos[0];
mVBO_For_ResuableTileTexCoords = vbos[1];
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER,
mVBO_For_ResuableTileVertices);
- gl.glBufferData(GL2.GL_ARRAY_BUFFER, kTotalBufferSizeBytesVerts,
- null, GL2.GL_STREAM_DRAW); // stream draw because this is a single quad use pipeline
+ gl.glBufferData(GL.GL_ARRAY_BUFFER, kTotalBufferSizeBytesVerts,
+ null, GL2ES2.GL_STREAM_DRAW); // stream draw because this is a single quad use pipeline
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER,
mVBO_For_ResuableTileTexCoords);
- gl.glBufferData(GL2.GL_ARRAY_BUFFER, kTotalBufferSizeBytesTex,
- null, GL2.GL_STREAM_DRAW); // stream draw because this is a single quad use pipeline
- } catch (Exception e) {
+ gl.glBufferData(GL.GL_ARRAY_BUFFER, kTotalBufferSizeBytesTex,
+ null, GL2ES2.GL_STREAM_DRAW); // stream draw because this is a single quad use pipeline
+ } catch (final Exception e) {
isExtensionAvailable_GL_VERSION_1_5 = false;
usingVBOs = false;
}
}
}
- public void glTexCoord2f(float v, float v1) {
+ public void glTexCoord2f(final float v, final float v1) {
mTexCoords.put(v);
mTexCoords.put(v1);
}
- public void glVertex3f(float inX, float inY, float inZ) {
+ public void glVertex3f(final float inX, final float inY, final float inZ) {
mVertCoords.put(inX);
mVertCoords.put(inY);
mVertCoords.put(inZ);
@@ -1826,41 +1824,41 @@ public class TextRenderer {
private void drawVertexArrays() {
if (mOutstandingGlyphsVerticesPipeline > 0) {
- GL2 gl = GLContext.getCurrentGL().getGL2();
+ final GL2 gl = GLContext.getCurrentGL().getGL2();
- TextureRenderer renderer = getBackingStore();
+ final TextureRenderer renderer = getBackingStore();
renderer.getTexture(); // triggers texture uploads. Maybe this should be more obvious?
mVertCoords.rewind();
mTexCoords.rewind();
- gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
+ gl.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
if (usingVBOs) {
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER,
mVBO_For_ResuableTileVertices);
- gl.glBufferSubData(GL2.GL_ARRAY_BUFFER, 0,
+ gl.glBufferSubData(GL.GL_ARRAY_BUFFER, 0,
mOutstandingGlyphsVerticesPipeline * kSizeInBytes_OneVertices_VertexData,
mVertCoords); // upload only the new stuff
- gl.glVertexPointer(3, GL2.GL_FLOAT, 0, 0);
+ gl.glVertexPointer(3, GL.GL_FLOAT, 0, 0);
} else {
- gl.glVertexPointer(3, GL2.GL_FLOAT, 0, mVertCoords);
+ gl.glVertexPointer(3, GL.GL_FLOAT, 0, mVertCoords);
}
- gl.glEnableClientState(GL2.GL_TEXTURE_COORD_ARRAY);
+ gl.glEnableClientState(GLPointerFunc.GL_TEXTURE_COORD_ARRAY);
if (usingVBOs) {
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER,
mVBO_For_ResuableTileTexCoords);
- gl.glBufferSubData(GL2.GL_ARRAY_BUFFER, 0,
+ gl.glBufferSubData(GL.GL_ARRAY_BUFFER, 0,
mOutstandingGlyphsVerticesPipeline * kSizeInBytes_OneVertices_TexData,
mTexCoords); // upload only the new stuff
- gl.glTexCoordPointer(2, GL2.GL_FLOAT, 0, 0);
+ gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, 0);
} else {
- gl.glTexCoordPointer(2, GL2.GL_FLOAT, 0, mTexCoords);
+ gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, mTexCoords);
}
- gl.glDrawArrays(GL2.GL_QUADS, 0,
+ gl.glDrawArrays(GL2GL3.GL_QUADS, 0,
mOutstandingGlyphsVerticesPipeline);
mVertCoords.rewind();
@@ -1871,14 +1869,14 @@ public class TextRenderer {
private void drawIMMEDIATE() {
if (mOutstandingGlyphsVerticesPipeline > 0) {
- TextureRenderer renderer = getBackingStore();
+ final TextureRenderer renderer = getBackingStore();
renderer.getTexture(); // triggers texture uploads. Maybe this should be more obvious?
- GL2 gl = GLContext.getCurrentGL().getGL2();
- gl.glBegin(GL2.GL_QUADS);
+ final GL2 gl = GLContext.getCurrentGL().getGL2();
+ gl.glBegin(GL2GL3.GL_QUADS);
try {
- int numberOfQuads = mOutstandingGlyphsVerticesPipeline / 4;
+ final int numberOfQuads = mOutstandingGlyphsVerticesPipeline / 4;
mVertCoords.rewind();
mTexCoords.rewind();
@@ -1899,7 +1897,7 @@ public class TextRenderer {
gl.glVertex3f(mVertCoords.get(), mVertCoords.get(),
mVertCoords.get());
}
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
} finally {
gl.glEnd();
@@ -1915,21 +1913,21 @@ public class TextRenderer {
private GLU glu;
private Frame frame;
- DebugListener(GL gl, Frame frame) {
+ DebugListener(final GL gl, final Frame frame) {
this.glu = GLU.createGLU(gl);
this.frame = frame;
}
@Override
- public void display(GLAutoDrawable drawable) {
- GL2 gl = GLContext.getCurrentGL().getGL2();
- gl.glClear(GL2.GL_DEPTH_BUFFER_BIT | GL2.GL_COLOR_BUFFER_BIT);
+ public void display(final GLAutoDrawable drawable) {
+ final GL2 gl = GLContext.getCurrentGL().getGL2();
+ gl.glClear(GL.GL_DEPTH_BUFFER_BIT | GL.GL_COLOR_BUFFER_BIT);
if (packer == null) {
return;
}
- TextureRenderer rend = getBackingStore();
+ final TextureRenderer rend = getBackingStore();
final int w = rend.getWidth();
final int h = rend.getHeight();
rend.beginOrthoRendering(w, h);
@@ -1947,23 +1945,23 @@ public class TextRenderer {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
glu=null;
frame=null;
}
// Unused methods
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width,
- int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width,
+ final int height) {
}
- public void displayChanged(GLAutoDrawable drawable,
- boolean modeChanged, boolean deviceChanged) {
+ public void displayChanged(final GLAutoDrawable drawable,
+ final boolean modeChanged, final boolean deviceChanged) {
}
}
@@ -1974,7 +1972,7 @@ public class TextRenderer {
* certain graphics cards which have poor vertex array
* performance. Defaults to true.
*/
- public void setUseVertexArrays(boolean useVertexArrays) {
+ public void setUseVertexArrays(final boolean useVertexArrays) {
this.useVertexArrays = useVertexArrays;
}
@@ -1993,7 +1991,7 @@ public class TextRenderer {
* graphics cards do not behave well when this is enabled,
* resulting in fuzzy text. Defaults to true.
*/
- public void setSmoothing(boolean smoothing) {
+ public void setSmoothing(final boolean smoothing) {
this.smoothing = smoothing;
getBackingStore().setSmoothing(smoothing);
}
@@ -2008,7 +2006,7 @@ public class TextRenderer {
return smoothing;
}
- private final boolean is15Available(GL gl) {
+ private final boolean is15Available(final GL gl) {
if (!checkFor_isExtensionAvailable_GL_VERSION_1_5) {
isExtensionAvailable_GL_VERSION_1_5 = gl.isExtensionAvailable(GLExtensions.VERSION_1_5);
checkFor_isExtensionAvailable_GL_VERSION_1_5 = true;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
index 26e1eb041..ef59f9fa0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
@@ -48,7 +48,10 @@ import java.awt.Rectangle;
import java.awt.image.*;
import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import javax.media.opengl.glu.gl2.*;
+
import com.jogamp.opengl.util.texture.*;
import com.jogamp.opengl.util.texture.awt.*;
@@ -70,10 +73,10 @@ public class TextureRenderer {
// appropriate threads, which would be somewhat unfortunate.
// Whether we have an alpha channel in the (RGB/A) backing store
- private boolean alpha;
+ private final boolean alpha;
// Whether we're using only a GL_INTENSITY backing store
- private boolean intensity;
+ private final boolean intensity;
// Whether we're attempting to use automatic mipmap generation support
private boolean mipmap;
@@ -91,7 +94,7 @@ public class TextureRenderer {
private boolean mustReallocateTexture;
private Rectangle dirtyRegion;
- private GLUgl2 glu = new GLUgl2();
+ private final GLUgl2 glu = new GLUgl2();
// Current color
private float r = 1.0f;
@@ -108,7 +111,7 @@ public class TextureRenderer {
@param height the height of the texture to render into
@param alpha whether to allocate an alpha channel for the texture
*/
- public TextureRenderer(int width, int height, boolean alpha) {
+ public TextureRenderer(final int width, final int height, final boolean alpha) {
this(width, height, alpha, false);
}
@@ -123,13 +126,13 @@ public class TextureRenderer {
@param alpha whether to allocate an alpha channel for the texture
@param mipmap whether to attempt use of automatic mipmap generation
*/
- public TextureRenderer(int width, int height, boolean alpha, boolean mipmap) {
+ public TextureRenderer(final int width, final int height, final boolean alpha, final boolean mipmap) {
this(width, height, alpha, false, mipmap);
}
// Internal constructor to avoid confusion since alpha only makes
// sense when intensity is not set
- private TextureRenderer(int width, int height, boolean alpha, boolean intensity, boolean mipmap) {
+ private TextureRenderer(final int width, final int height, final boolean alpha, final boolean intensity, final boolean mipmap) {
this.alpha = alpha;
this.intensity = intensity;
this.mipmap = mipmap;
@@ -140,7 +143,7 @@ public class TextureRenderer {
which acts only as an alpha channel. No mipmap support is
requested. Internally, this associates a GL_INTENSITY OpenGL
texture with the backing store. */
- public static TextureRenderer createAlphaOnlyRenderer(int width, int height) {
+ public static TextureRenderer createAlphaOnlyRenderer(final int width, final int height) {
return createAlphaOnlyRenderer(width, height, false);
}
@@ -150,7 +153,7 @@ public class TextureRenderer {
better smoothing when rendering the TextureRenderer's contents
at a distance. Internally, this associates a GL_INTENSITY OpenGL
texture with the backing store. */
- public static TextureRenderer createAlphaOnlyRenderer(int width, int height, boolean mipmap) {
+ public static TextureRenderer createAlphaOnlyRenderer(final int width, final int height, final boolean mipmap) {
return new TextureRenderer(width, height, false, true, mipmap);
}
@@ -205,7 +208,7 @@ public class TextureRenderer {
@param height the new height of the backing store of this renderer
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void setSize(int width, int height) throws GLException {
+ public void setSize(final int width, final int height) throws GLException {
init(width, height);
}
@@ -216,7 +219,7 @@ public class TextureRenderer {
@param d the new size of the backing store of this renderer
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void setSize(Dimension d) throws GLException {
+ public void setSize(final Dimension d) throws GLException {
setSize(d.width, d.height);
}
@@ -228,7 +231,7 @@ public class TextureRenderer {
@param smoothing whether smoothing is enabled for the OpenGL texture
*/
- public void setSmoothing(boolean smoothing) {
+ public void setSmoothing(final boolean smoothing) {
this.smoothing = smoothing;
smoothingChanged = true;
}
@@ -275,8 +278,8 @@ public class TextureRenderer {
@param width the width of the region to update
@param height the height of the region to update
*/
- public void markDirty(int x, int y, int width, int height) {
- Rectangle curRegion = new Rectangle(x, y, width, height);
+ public void markDirty(final int x, final int y, final int width, final int height) {
+ final Rectangle curRegion = new Rectangle(x, y, width, height);
if (dirtyRegion == null) {
dirtyRegion = curRegion;
} else {
@@ -333,7 +336,7 @@ public class TextureRenderer {
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void beginOrthoRendering(int width, int height) throws GLException {
+ public void beginOrthoRendering(final int width, final int height) throws GLException {
beginOrthoRendering(width, height, true);
}
@@ -355,7 +358,7 @@ public class TextureRenderer {
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void beginOrthoRendering(int width, int height, boolean disableDepthTest) throws GLException {
+ public void beginOrthoRendering(final int width, final int height, final boolean disableDepthTest) throws GLException {
beginRendering(true, width, height, disableDepthTest);
}
@@ -399,8 +402,8 @@ public class TextureRenderer {
transparent, 1.0f = completely opaque
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void setColor(float r, float g, float b, float a) throws GLException {
- GL2 gl = GLContext.getCurrentGL().getGL2();
+ public void setColor(final float r, final float g, final float b, final float a) throws GLException {
+ final GL2 gl = GLContext.getCurrentGL().getGL2();
this.r = r * a;
this.g = g * a;
this.b = b * a;
@@ -417,7 +420,7 @@ public class TextureRenderer {
@param color the new color to use for rendering
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void setColor(Color color) throws GLException {
+ public void setColor(final Color color) throws GLException {
// Get color's RGBA components as floats in the range [0,1].
if (compArray == null) {
compArray = new float[4];
@@ -440,7 +443,7 @@ public class TextureRenderer {
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void drawOrthoRect(int screenx, int screeny) throws GLException {
+ public void drawOrthoRect(final int screenx, final int screeny) throws GLException {
drawOrthoRect(screenx, screeny, 0, 0, getWidth(), getHeight());
}
@@ -462,9 +465,9 @@ public class TextureRenderer {
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void drawOrthoRect(int screenx, int screeny,
- int texturex, int texturey,
- int width, int height) throws GLException {
+ public void drawOrthoRect(final int screenx, final int screeny,
+ final int texturex, final int texturey,
+ final int width, final int height) throws GLException {
draw3DRect(screenx, screeny, 0, texturex, texturey, width, height, 1);
}
@@ -493,16 +496,16 @@ public class TextureRenderer {
@throws GLException If an OpenGL context is not current when this method is called
*/
- public void draw3DRect(float x, float y, float z,
- int texturex, int texturey,
- int width, int height,
- float scaleFactor) throws GLException {
- GL2 gl = GLContext.getCurrentGL().getGL2();
- Texture texture = getTexture();
- TextureCoords coords = texture.getSubImageTexCoords(texturex, texturey,
+ public void draw3DRect(final float x, final float y, final float z,
+ final int texturex, final int texturey,
+ final int width, final int height,
+ final float scaleFactor) throws GLException {
+ final GL2 gl = GLContext.getCurrentGL().getGL2();
+ final Texture texture = getTexture();
+ final TextureCoords coords = texture.getSubImageTexCoords(texturex, texturey,
texturex + width,
texturey + height);
- gl.glBegin(GL2.GL_QUADS);
+ gl.glBegin(GL2GL3.GL_QUADS);
gl.glTexCoord2f(coords.left(), coords.bottom());
gl.glVertex3f(x, y, z);
gl.glTexCoord2f(coords.right(), coords.bottom());
@@ -550,70 +553,70 @@ public class TextureRenderer {
// Internals only below this point
//
- private void beginRendering(boolean ortho, int width, int height, boolean disableDepthTestForOrtho) {
- GL2 gl = GLContext.getCurrentGL().getGL2();
- int attribBits =
- GL2.GL_ENABLE_BIT | GL2.GL_TEXTURE_BIT | GL2.GL_COLOR_BUFFER_BIT |
- (ortho ? (GL2.GL_DEPTH_BUFFER_BIT | GL2.GL_TRANSFORM_BIT) : 0);
+ private void beginRendering(final boolean ortho, final int width, final int height, final boolean disableDepthTestForOrtho) {
+ final GL2 gl = GLContext.getCurrentGL().getGL2();
+ final int attribBits =
+ GL2.GL_ENABLE_BIT | GL2.GL_TEXTURE_BIT | GL.GL_COLOR_BUFFER_BIT |
+ (ortho ? (GL.GL_DEPTH_BUFFER_BIT | GL2.GL_TRANSFORM_BIT) : 0);
gl.glPushAttrib(attribBits);
- gl.glDisable(GL2.GL_LIGHTING);
+ gl.glDisable(GLLightingFunc.GL_LIGHTING);
if (ortho) {
if (disableDepthTestForOrtho) {
- gl.glDisable(GL2.GL_DEPTH_TEST);
+ gl.glDisable(GL.GL_DEPTH_TEST);
}
- gl.glDisable(GL2.GL_CULL_FACE);
- gl.glMatrixMode(GL2.GL_PROJECTION);
+ gl.glDisable(GL.GL_CULL_FACE);
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glPushMatrix();
gl.glLoadIdentity();
glu.gluOrtho2D(0, width, 0, height);
- gl.glMatrixMode(GL2.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glPushMatrix();
gl.glLoadIdentity();
- gl.glMatrixMode(GL2.GL_TEXTURE);
+ gl.glMatrixMode(GL.GL_TEXTURE);
gl.glPushMatrix();
gl.glLoadIdentity();
}
- gl.glEnable(GL2.GL_BLEND);
- gl.glBlendFunc(GL2.GL_ONE, GL2.GL_ONE_MINUS_SRC_ALPHA);
- Texture texture = getTexture();
+ gl.glEnable(GL.GL_BLEND);
+ gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
+ final Texture texture = getTexture();
texture.enable(gl);
texture.bind(gl);
- gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_MODULATE);
+ gl.glTexEnvi(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_MODE, GL2ES1.GL_MODULATE);
// Change polygon color to last saved
gl.glColor4f(r, g, b, a);
if (smoothingChanged) {
smoothingChanged = false;
if (smoothing) {
- texture.setTexParameteri(gl, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR);
+ texture.setTexParameteri(gl, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
if (mipmap) {
- texture.setTexParameteri(gl, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR_MIPMAP_LINEAR);
+ texture.setTexParameteri(gl, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_LINEAR);
} else {
- texture.setTexParameteri(gl, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR);
+ texture.setTexParameteri(gl, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
}
} else {
- texture.setTexParameteri(gl, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_NEAREST);
- texture.setTexParameteri(gl, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_NEAREST);
+ texture.setTexParameteri(gl, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
+ texture.setTexParameteri(gl, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
}
}
}
- private void endRendering(boolean ortho) {
- GL2 gl = GLContext.getCurrentGL().getGL2();
- Texture texture = getTexture();
+ private void endRendering(final boolean ortho) {
+ final GL2 gl = GLContext.getCurrentGL().getGL2();
+ final Texture texture = getTexture();
texture.disable(gl);
if (ortho) {
- gl.glMatrixMode(GL2.GL_PROJECTION);
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glPopMatrix();
- gl.glMatrixMode(GL2.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glPopMatrix();
- gl.glMatrixMode(GL2.GL_TEXTURE);
+ gl.glMatrixMode(GL.GL_TEXTURE);
gl.glPopMatrix();
}
gl.glPopAttrib();
}
- private void init(int width, int height) {
- GL2 gl = GLContext.getCurrentGL().getGL2();
+ private void init(final int width, final int height) {
+ final GL2 gl = GLContext.getCurrentGL().getGL2();
// Discard previous BufferedImage if any
if (image != null) {
image.flush();
@@ -621,8 +624,8 @@ public class TextureRenderer {
}
// Infer the internal format if not an intensity texture
- int internalFormat = (intensity ? GL2.GL_INTENSITY : 0);
- int imageType =
+ final int internalFormat = (intensity ? GL2.GL_INTENSITY : 0);
+ final int imageType =
(intensity ? BufferedImage.TYPE_BYTE_GRAY :
(alpha ? BufferedImage.TYPE_INT_ARGB_PRE : BufferedImage.TYPE_INT_RGB));
image = new BufferedImage(width, height, imageType);
@@ -650,9 +653,9 @@ public class TextureRenderer {
@throws GLException If an OpenGL context is not current when this method is called
*/
- private void sync(int x, int y, int width, int height) throws GLException {
+ private void sync(final int x, final int y, final int width, final int height) throws GLException {
// Force allocation if necessary
- boolean canSkipUpdate = ensureTexture();
+ final boolean canSkipUpdate = ensureTexture();
if (!canSkipUpdate) {
// Update specified region.
@@ -667,7 +670,7 @@ public class TextureRenderer {
// Returns true if the texture was newly allocated, false if not
private boolean ensureTexture() {
- GL gl = GLContext.getCurrentGL();
+ final GL gl = GLContext.getCurrentGL();
if (mustReallocateTexture) {
if (texture != null) {
texture.destroy(gl);
@@ -688,8 +691,8 @@ public class TextureRenderer {
if (!smoothing) {
// The TextureIO classes default to GL_LINEAR filtering
- texture.setTexParameteri(gl, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_NEAREST);
- texture.setTexParameteri(gl, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_NEAREST);
+ texture.setTexParameteri(gl, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
+ texture.setTexParameteri(gl, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
}
return true;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java
index e8df6aaec..1f055211d 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java
@@ -53,12 +53,12 @@ class BitmapCharRec {
public float advance;
public byte[] bitmap;
- public BitmapCharRec(int width,
- int height,
- float xorig,
- float yorig,
- float advance,
- byte[] bitmap) {
+ public BitmapCharRec(final int width,
+ final int height,
+ final float xorig,
+ final float yorig,
+ final float advance,
+ final byte[] bitmap) {
this.width = width;
this.height = height;
this.xorig = xorig;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java
index d4ee12b32..7b8418704 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java
@@ -51,10 +51,10 @@ class BitmapFontRec {
public int first;
public BitmapCharRec[] ch;
- public BitmapFontRec(String name,
- int num_chars,
- int first,
- BitmapCharRec[] ch) {
+ public BitmapFontRec(final String name,
+ final int num_chars,
+ final int first,
+ final BitmapCharRec[] ch) {
this.name = name;
this.num_chars = num_chars;
this.first = first;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java
index 5e26e0d14..d79f16638 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java
@@ -49,7 +49,7 @@ class CoordRec {
public float x;
public float y;
- public CoordRec(float x, float y) {
+ public CoordRec(final float x, final float y) {
this.x = x;
this.y = y;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java
index 42529f3f1..92cbd66da 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java
@@ -40,6 +40,7 @@
package com.jogamp.opengl.util.gl2;
import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
import javax.media.opengl.glu.*;
import javax.media.opengl.glu.gl2.*;
@@ -103,13 +104,13 @@ public class GLUT {
public static final int BITMAP_HELVETICA_12 = 7;
public static final int BITMAP_HELVETICA_18 = 8;
- private GLUgl2 glu = new GLUgl2();
+ private final GLUgl2 glu = new GLUgl2();
//----------------------------------------------------------------------
// Shapes
//
- public void glutWireSphere(double radius, int slices, int stacks) {
+ public void glutWireSphere(final double radius, final int slices, final int stacks) {
quadObjInit(glu);
glu.gluQuadricDrawStyle(quadObj, GLU.GLU_LINE);
glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
@@ -119,7 +120,7 @@ public class GLUT {
glu.gluSphere(quadObj, radius, slices, stacks);
}
- public void glutSolidSphere(double radius, int slices, int stacks) {
+ public void glutSolidSphere(final double radius, final int slices, final int stacks) {
quadObjInit(glu);
glu.gluQuadricDrawStyle(quadObj, GLU.GLU_FILL);
glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
@@ -129,8 +130,8 @@ public class GLUT {
glu.gluSphere(quadObj, radius, slices, stacks);
}
- public void glutWireCone(double base, double height,
- int slices, int stacks) {
+ public void glutWireCone(final double base, final double height,
+ final int slices, final int stacks) {
quadObjInit(glu);
glu.gluQuadricDrawStyle(quadObj, GLU.GLU_LINE);
glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
@@ -140,8 +141,8 @@ public class GLUT {
glu.gluCylinder(quadObj, base, 0.0, height, slices, stacks);
}
- public void glutSolidCone(double base, double height,
- int slices, int stacks) {
+ public void glutSolidCone(final double base, final double height,
+ final int slices, final int stacks) {
quadObjInit(glu);
glu.gluQuadricDrawStyle(quadObj, GLU.GLU_FILL);
glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
@@ -151,7 +152,7 @@ public class GLUT {
glu.gluCylinder(quadObj, base, 0.0, height, slices, stacks);
}
- public void glutWireCylinder(double radius, double height, int slices, int stacks) {
+ public void glutWireCylinder(final double radius, final double height, final int slices, final int stacks) {
quadObjInit(glu);
glu.gluQuadricDrawStyle(quadObj, GLU.GLU_LINE);
glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
@@ -161,13 +162,13 @@ public class GLUT {
glu.gluCylinder(quadObj, radius, radius, height, slices, stacks);
}
- public void glutSolidCylinder(double radius, double height, int slices, int stacks) {
- GL2 gl = GLUgl2.getCurrentGL2();
+ public void glutSolidCylinder(final double radius, final double height, final int slices, final int stacks) {
+ final GL2 gl = GLUgl2.getCurrentGL2();
// Prepare table of points for drawing end caps
- double [] x = new double[slices];
- double [] y = new double[slices];
- double angleDelta = Math.PI * 2 / slices;
+ final double [] x = new double[slices];
+ final double [] y = new double[slices];
+ final double angleDelta = Math.PI * 2 / slices;
double angle = 0;
for (int i = 0 ; i < slices ; i ++) {
angle = i * angleDelta;
@@ -176,7 +177,7 @@ public class GLUT {
}
// Draw bottom cap
- gl.glBegin(GL2.GL_TRIANGLE_FAN);
+ gl.glBegin(GL.GL_TRIANGLE_FAN);
gl.glNormal3d(0,0,-1);
gl.glVertex3d(0,0,0);
for (int i = 0 ; i < slices ; i ++) {
@@ -186,7 +187,7 @@ public class GLUT {
gl.glEnd();
// Draw top cap
- gl.glBegin(GL2.GL_TRIANGLE_FAN);
+ gl.glBegin(GL.GL_TRIANGLE_FAN);
gl.glNormal3d(0,0,1);
gl.glVertex3d(0,0,height);
for (int i = 0 ; i < slices ; i ++) {
@@ -205,58 +206,58 @@ public class GLUT {
glu.gluCylinder(quadObj, radius, radius, height, slices, stacks);
}
- public void glutWireCube(float size) {
- drawBox(GLUgl2.getCurrentGL2(), size, GL2.GL_LINE_LOOP);
+ public void glutWireCube(final float size) {
+ drawBox(GLUgl2.getCurrentGL2(), size, GL.GL_LINE_LOOP);
}
- public void glutSolidCube(float size) {
- drawBox(GLUgl2.getCurrentGL2(), size, GL2.GL_QUADS);
+ public void glutSolidCube(final float size) {
+ drawBox(GLUgl2.getCurrentGL2(), size, GL2GL3.GL_QUADS);
}
- public void glutWireTorus(double innerRadius, double outerRadius,
- int nsides, int rings) {
- GL2 gl = GLUgl2.getCurrentGL2();
+ public void glutWireTorus(final double innerRadius, final double outerRadius,
+ final int nsides, final int rings) {
+ final GL2 gl = GLUgl2.getCurrentGL2();
gl.glPushAttrib(GL2.GL_POLYGON_BIT);
- gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
+ gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_LINE);
doughnut(gl, innerRadius, outerRadius, nsides, rings);
gl.glPopAttrib();
}
- public void glutSolidTorus(double innerRadius, double outerRadius,
- int nsides, int rings) {
+ public void glutSolidTorus(final double innerRadius, final double outerRadius,
+ final int nsides, final int rings) {
doughnut(GLUgl2.getCurrentGL2(), innerRadius, outerRadius, nsides, rings);
}
public void glutWireDodecahedron() {
- dodecahedron(GLUgl2.getCurrentGL2(), GL2.GL_LINE_LOOP);
+ dodecahedron(GLUgl2.getCurrentGL2(), GL.GL_LINE_LOOP);
}
public void glutSolidDodecahedron() {
- dodecahedron(GLUgl2.getCurrentGL2(), GL2.GL_TRIANGLE_FAN);
+ dodecahedron(GLUgl2.getCurrentGL2(), GL.GL_TRIANGLE_FAN);
}
public void glutWireOctahedron() {
- octahedron(GLUgl2.getCurrentGL2(), GL2.GL_LINE_LOOP);
+ octahedron(GLUgl2.getCurrentGL2(), GL.GL_LINE_LOOP);
}
public void glutSolidOctahedron() {
- octahedron(GLUgl2.getCurrentGL2(), GL2.GL_TRIANGLES);
+ octahedron(GLUgl2.getCurrentGL2(), GL.GL_TRIANGLES);
}
public void glutWireIcosahedron() {
- icosahedron(GLUgl2.getCurrentGL2(), GL2.GL_LINE_LOOP);
+ icosahedron(GLUgl2.getCurrentGL2(), GL.GL_LINE_LOOP);
}
public void glutSolidIcosahedron() {
- icosahedron(GLUgl2.getCurrentGL2(), GL2.GL_TRIANGLES);
+ icosahedron(GLUgl2.getCurrentGL2(), GL.GL_TRIANGLES);
}
public void glutWireTetrahedron() {
- tetrahedron(GLUgl2.getCurrentGL2(), GL2.GL_LINE_LOOP);
+ tetrahedron(GLUgl2.getCurrentGL2(), GL.GL_LINE_LOOP);
}
public void glutSolidTetrahedron() {
- tetrahedron(GLUgl2.getCurrentGL2(), GL2.GL_TRIANGLES);
+ tetrahedron(GLUgl2.getCurrentGL2(), GL.GL_TRIANGLES);
}
/**
@@ -266,7 +267,7 @@ public class GLUT {
* @param scale
* the factor by which to scale the teapot
*/
- public void glutSolidTeapot(double scale) {
+ public void glutSolidTeapot(final double scale) {
glutSolidTeapot(scale, true);
}
@@ -285,8 +286,8 @@ public class GLUT {
* whether to create the teapot in exactly the same way as in the C
* implementation of GLUT
*/
- public void glutSolidTeapot(double scale, boolean cStyle) {
- teapot(GLUgl2.getCurrentGL2(), 14, scale, GL2.GL_FILL, cStyle);
+ public void glutSolidTeapot(final double scale, final boolean cStyle) {
+ teapot(GLUgl2.getCurrentGL2(), 14, scale, GL2GL3.GL_FILL, cStyle);
}
/**
@@ -296,7 +297,7 @@ public class GLUT {
* @param scale
* the factor by which to scale the teapot
*/
- public void glutWireTeapot(double scale) {
+ public void glutWireTeapot(final double scale) {
glutWireTeapot(scale, true);
}
@@ -315,22 +316,22 @@ public class GLUT {
* whether to create the teapot in exactly the same way as in the C
* implementation of GLUT
*/
- public void glutWireTeapot(double scale, boolean cStyle) {
- teapot(GLUgl2.getCurrentGL2(), 10, scale, GL2.GL_LINE, cStyle);
+ public void glutWireTeapot(final double scale, final boolean cStyle) {
+ teapot(GLUgl2.getCurrentGL2(), 10, scale, GL2GL3.GL_LINE, cStyle);
}
//----------------------------------------------------------------------
// Fonts
//
- public void glutBitmapCharacter(int font, char character) {
- GL2 gl = GLUgl2.getCurrentGL2();
- int[] swapbytes = new int[1];
- int[] lsbfirst = new int[1];
- int[] rowlength = new int[1];
- int[] skiprows = new int[1];
- int[] skippixels = new int[1];
- int[] alignment = new int[1];
+ public void glutBitmapCharacter(final int font, final char character) {
+ final GL2 gl = GLUgl2.getCurrentGL2();
+ final int[] swapbytes = new int[1];
+ final int[] lsbfirst = new int[1];
+ final int[] rowlength = new int[1];
+ final int[] skiprows = new int[1];
+ final int[] skippixels = new int[1];
+ final int[] alignment = new int[1];
beginBitmap(gl,
swapbytes,
lsbfirst,
@@ -348,14 +349,14 @@ public class GLUT {
alignment);
}
- public void glutBitmapString (int font, String string) {
- GL2 gl = GLUgl2.getCurrentGL2();
- int[] swapbytes = new int[1];
- int[] lsbfirst = new int[1];
- int[] rowlength = new int[1];
- int[] skiprows = new int[1];
- int[] skippixels = new int[1];
- int[] alignment = new int[1];
+ public void glutBitmapString (final int font, final String string) {
+ final GL2 gl = GLUgl2.getCurrentGL2();
+ final int[] swapbytes = new int[1];
+ final int[] lsbfirst = new int[1];
+ final int[] rowlength = new int[1];
+ final int[] skiprows = new int[1];
+ final int[] skippixels = new int[1];
+ final int[] alignment = new int[1];
beginBitmap(gl,
swapbytes,
lsbfirst,
@@ -363,7 +364,7 @@ public class GLUT {
skiprows,
skippixels,
alignment);
- int len = string.length();
+ final int len = string.length();
for (int i = 0; i < len; i++) {
bitmapCharacterImpl(gl, font, string.charAt(i));
}
@@ -376,31 +377,31 @@ public class GLUT {
alignment);
}
- public int glutBitmapWidth (int font, char character) {
- BitmapFontRec fontinfo = getBitmapFont(font);
- int c = character & 0xFFFF;
+ public int glutBitmapWidth (final int font, final char character) {
+ final BitmapFontRec fontinfo = getBitmapFont(font);
+ final int c = character & 0xFFFF;
if (c < fontinfo.first || c >= fontinfo.first + fontinfo.num_chars)
return 0;
- BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
+ final BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
if (ch != null)
return (int) ch.advance;
else
return 0;
}
- public void glutStrokeCharacter(int font, char character) {
- GL2 gl = GLUgl2.getCurrentGL2();
- StrokeFontRec fontinfo = getStrokeFont(font);
- int c = character & 0xFFFF;
+ public void glutStrokeCharacter(final int font, final char character) {
+ final GL2 gl = GLUgl2.getCurrentGL2();
+ final StrokeFontRec fontinfo = getStrokeFont(font);
+ final int c = character & 0xFFFF;
if (c < 0 || c >= fontinfo.num_chars)
return;
- StrokeCharRec ch = fontinfo.ch[c];
+ final StrokeCharRec ch = fontinfo.ch[c];
if (ch != null) {
for (int i = 0; i < ch.num_strokes; i++) {
- StrokeRec stroke = ch.stroke[i];
- gl.glBegin(GL2.GL_LINE_STRIP);
+ final StrokeRec stroke = ch.stroke[i];
+ gl.glBegin(GL.GL_LINE_STRIP);
for (int j = 0; j < stroke.num_coords; j++) {
- CoordRec coord = stroke.coord[j];
+ final CoordRec coord = stroke.coord[j];
gl.glVertex2f(coord.x, coord.y);
}
gl.glEnd();
@@ -409,21 +410,21 @@ public class GLUT {
}
}
- public void glutStrokeString(int font, String string) {
- GL2 gl = GLUgl2.getCurrentGL2();
- StrokeFontRec fontinfo = getStrokeFont(font);
- int len = string.length();
+ public void glutStrokeString(final int font, final String string) {
+ final GL2 gl = GLUgl2.getCurrentGL2();
+ final StrokeFontRec fontinfo = getStrokeFont(font);
+ final int len = string.length();
for (int pos = 0; pos < len; pos++) {
- int c = string.charAt(pos) & 0xFFFF;
+ final int c = string.charAt(pos) & 0xFFFF;
if (c < 0 || c >= fontinfo.num_chars)
continue;
- StrokeCharRec ch = fontinfo.ch[c];
+ final StrokeCharRec ch = fontinfo.ch[c];
if (ch != null) {
for (int i = 0; i < ch.num_strokes; i++) {
- StrokeRec stroke = ch.stroke[i];
- gl.glBegin(GL2.GL_LINE_STRIP);
+ final StrokeRec stroke = ch.stroke[i];
+ gl.glBegin(GL.GL_LINE_STRIP);
for (int j = 0; j < stroke.num_coords; j++) {
- CoordRec coord = stroke.coord[j];
+ final CoordRec coord = stroke.coord[j];
gl.glVertex2f(coord.x, coord.y);
}
gl.glEnd();
@@ -433,30 +434,30 @@ public class GLUT {
}
}
- public int glutStrokeWidth (int font, char character) {
+ public int glutStrokeWidth (final int font, final char character) {
return (int) glutStrokeWidthf(font, character);
}
- public float glutStrokeWidthf (int font, char character) {
- StrokeFontRec fontinfo = getStrokeFont(font);
- int c = character & 0xFFFF;
+ public float glutStrokeWidthf (final int font, final char character) {
+ final StrokeFontRec fontinfo = getStrokeFont(font);
+ final int c = character & 0xFFFF;
if (c < 0 || c >= fontinfo.num_chars)
return 0;
- StrokeCharRec ch = fontinfo.ch[c];
+ final StrokeCharRec ch = fontinfo.ch[c];
if (ch != null)
return ch.right;
else
return 0;
}
- public int glutBitmapLength (int font, String string) {
- BitmapFontRec fontinfo = getBitmapFont(font);
+ public int glutBitmapLength (final int font, final String string) {
+ final BitmapFontRec fontinfo = getBitmapFont(font);
int length = 0;
- int len = string.length();
+ final int len = string.length();
for (int pos = 0; pos < len; pos++) {
- int c = string.charAt(pos) & 0xFFFF;
+ final int c = string.charAt(pos) & 0xFFFF;
if (c >= fontinfo.first && c < fontinfo.first + fontinfo.num_chars) {
- BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
+ final BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
if (ch != null)
length += ch.advance;
}
@@ -464,18 +465,18 @@ public class GLUT {
return length;
}
- public int glutStrokeLength (int font, String string) {
+ public int glutStrokeLength (final int font, final String string) {
return (int) glutStrokeLengthf(font, string);
}
- public float glutStrokeLengthf (int font, String string) {
- StrokeFontRec fontinfo = getStrokeFont(font);
+ public float glutStrokeLengthf (final int font, final String string) {
+ final StrokeFontRec fontinfo = getStrokeFont(font);
float length = 0;
- int len = string.length();
+ final int len = string.length();
for (int i = 0; i < len; i++) {
- char c = string.charAt(i);
+ final char c = string.charAt(i);
if (c >= 0 && c < fontinfo.num_chars) {
- StrokeCharRec ch = fontinfo.ch[c];
+ final StrokeCharRec ch = fontinfo.ch[c];
if (ch != null)
length += ch.right;
}
@@ -491,9 +492,9 @@ public class GLUT {
The polyhedron is centered at the origin.
*/
public void glutWireRhombicDodecahedron() {
- GL2 gl = GLUgl2.getCurrentGL2();
+ final GL2 gl = GLUgl2.getCurrentGL2();
for( int i = 0; i < 12; i++ ) {
- gl.glBegin( GL2.GL_LINE_LOOP );
+ gl.glBegin( GL.GL_LINE_LOOP );
gl.glNormal3dv( rdod_n[ i ],0 );
gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 0 ] ],0 );
gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 1 ] ],0 );
@@ -511,8 +512,8 @@ public class GLUT {
The polyhedron is centered at the origin.
*/
public void glutSolidRhombicDodecahedron() {
- GL2 gl = GLUgl2.getCurrentGL2();
- gl.glBegin( GL2.GL_QUADS );
+ final GL2 gl = GLUgl2.getCurrentGL2();
+ gl.glBegin( GL2GL3.GL_QUADS );
for( int i = 0; i < 12; i++ ) {
gl.glNormal3dv( rdod_n[ i ],0 );
gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 0 ] ],0 );
@@ -532,7 +533,7 @@ public class GLUT {
//
private GLUquadric quadObj;
- private void quadObjInit(GLUgl2 glu) {
+ private void quadObjInit(final GLUgl2 glu) {
if (quadObj == null) {
quadObj = glu.gluNewQuadric();
}
@@ -541,7 +542,7 @@ public class GLUT {
}
}
- private static void doughnut(GL2 gl, double r, double R, int nsides, int rings) {
+ private static void doughnut(final GL2 gl, final double r, final double R, final int nsides, final int rings) {
int i, j;
float theta, phi, theta1;
float cosTheta, sinTheta;
@@ -597,9 +598,9 @@ public class GLUT {
{5, 6, 2, 1},
{7, 4, 0, 3}
};
- private void drawBox(GL2 gl, float size, int type) {
+ private void drawBox(final GL2 gl, final float size, final int type) {
if (boxVertices == null) {
- float[][] v = new float[8][];
+ final float[][] v = new float[8][];
for (int i = 0; i < 8; i++) {
v[i] = new float[3];
}
@@ -611,9 +612,9 @@ public class GLUT {
v[1][2] = v[2][2] = v[5][2] = v[6][2] = 0.5f;
boxVertices = v;
}
- float[][] v = boxVertices;
- float[][] n = boxNormals;
- int[][] faces = boxFaces;
+ final float[][] v = boxVertices;
+ final float[][] n = boxNormals;
+ final int[][] faces = boxFaces;
for (int i = 5; i >= 0; i--) {
gl.glBegin(type);
gl.glNormal3fv(n[i], 0);
@@ -664,14 +665,14 @@ public class GLUT {
dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha;
}
- private static void diff3(float[] a, float[] b, float[] c) {
+ private static void diff3(final float[] a, final float[] b, final float[] c) {
c[0] = a[0] - b[0];
c[1] = a[1] - b[1];
c[2] = a[2] - b[2];
}
- private static void crossprod(float[] v1, float[] v2, float[] prod) {
- float[] p = new float[3]; /* in case prod == v1 or v2 */
+ private static void crossprod(final float[] v1, final float[] v2, final float[] prod) {
+ final float[] p = new float[3]; /* in case prod == v1 or v2 */
p[0] = v1[1] * v2[2] - v2[1] * v1[2];
p[1] = v1[2] * v2[0] - v2[2] * v1[0];
@@ -681,7 +682,7 @@ public class GLUT {
prod[2] = p[2];
}
- private static void normalize(float[] v) {
+ private static void normalize(final float[] v) {
float d;
d = (float) Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
@@ -694,10 +695,10 @@ public class GLUT {
v[2] *= d;
}
- private void pentagon(GL2 gl, int a, int b, int c, int d, int e, int shadeType) {
- float[] n0 = new float[3];
- float[] d1 = new float[3];
- float[] d2 = new float[3];
+ private void pentagon(final GL2 gl, final int a, final int b, final int c, final int d, final int e, final int shadeType) {
+ final float[] n0 = new float[3];
+ final float[] d1 = new float[3];
+ final float[] d2 = new float[3];
diff3(dodec[a], dodec[b], d1);
diff3(dodec[b], dodec[c], d2);
@@ -714,7 +715,7 @@ public class GLUT {
gl.glEnd();
}
- private void dodecahedron(GL2 gl, int type) {
+ private void dodecahedron(final GL2 gl, final int type) {
if (dodec == null) {
initDodecahedron();
}
@@ -732,9 +733,9 @@ public class GLUT {
pentagon(gl, 4, 12, 5, 16, 17, type);
}
- private static void recorditem(GL2 gl, float[] n1, float[] n2, float[] n3, int shadeType) {
- float[] q0 = new float[3];
- float[] q1 = new float[3];
+ private static void recorditem(final GL2 gl, final float[] n1, final float[] n2, final float[] n3, final int shadeType) {
+ final float[] q0 = new float[3];
+ final float[] q1 = new float[3];
diff3(n1, n2, q0);
diff3(n2, n3, q1);
@@ -749,11 +750,11 @@ public class GLUT {
gl.glEnd();
}
- private static void subdivide(GL2 gl, float[] v0, float[] v1, float[] v2, int shadeType) {
+ private static void subdivide(final GL2 gl, final float[] v0, final float[] v1, final float[] v2, final int shadeType) {
int depth;
- float[] w0 = new float[3];
- float[] w1 = new float[3];
- float[] w2 = new float[3];
+ final float[] w0 = new float[3];
+ final float[] w1 = new float[3];
+ final float[] w2 = new float[3];
float l;
int i, j, k, n;
@@ -785,10 +786,10 @@ public class GLUT {
}
}
- private static void drawtriangle(GL2 gl, int i, float[][] data, int[][] ndx, int shadeType) {
- float[] x0 = data[ndx[i][0]];
- float[] x1 = data[ndx[i][1]];
- float[] x2 = data[ndx[i][2]];
+ private static void drawtriangle(final GL2 gl, final int i, final float[][] data, final int[][] ndx, final int shadeType) {
+ final float[] x0 = data[ndx[i][0]];
+ final float[] x1 = data[ndx[i][1]];
+ final float[] x2 = data[ndx[i][2]];
subdivide(gl, x0, x1, x2, shadeType);
}
@@ -816,7 +817,7 @@ public class GLUT {
{1, 3, 5}
};
- private static void octahedron(GL2 gl, int shadeType) {
+ private static void octahedron(final GL2 gl, final int shadeType) {
int i;
for (i = 7; i >= 0; i--) {
@@ -870,7 +871,7 @@ public class GLUT {
{7, 2, 11},
};
- private static void icosahedron(GL2 gl, int shadeType) {
+ private static void icosahedron(final GL2 gl, final int shadeType) {
int i;
for (i = 19; i >= 0; i--) {
@@ -950,7 +951,7 @@ public class GLUT {
{1, 2, 3}
};
- private static final void tetrahedron(GL2 gl, int shadeType) {
+ private static final void tetrahedron(final GL2 gl, final int shadeType) {
for (int i = 3; i >= 0; i--)
drawtriangle(gl, i, tdata, tndex, shadeType);
}
@@ -1112,28 +1113,28 @@ public class GLUT {
0, 0, 1, 0, 0, 1, 1, 1
};
- private static void teapot(GL2 gl,
- int grid,
- double scale,
- int type,
- boolean backCompatible)
+ private static void teapot(final GL2 gl,
+ final int grid,
+ final double scale,
+ final int type,
+ final boolean backCompatible)
{
// As mentioned above, GL2.glMap2f expects a packed array of floats
- float[] p = new float[4*4*3];
- float[] q = new float[4*4*3];
- float[] r = new float[4*4*3];
- float[] s = new float[4*4*3];
+ final float[] p = new float[4*4*3];
+ final float[] q = new float[4*4*3];
+ final float[] r = new float[4*4*3];
+ final float[] s = new float[4*4*3];
int i, j, k, l;
gl.glPushAttrib(GL2.GL_ENABLE_BIT | GL2.GL_EVAL_BIT | GL2.GL_POLYGON_BIT);
gl.glEnable(GL2.GL_AUTO_NORMAL);
- gl.glEnable(GL2.GL_NORMALIZE);
+ gl.glEnable(GLLightingFunc.GL_NORMALIZE);
gl.glEnable(GL2.GL_MAP2_VERTEX_3);
gl.glEnable(GL2.GL_MAP2_TEXTURE_COORD_2);
gl.glPushMatrix();
if (!backCompatible) {
// The time has come to have the teapot no longer be inside out
- gl.glFrontFace(GL2.GL_CW);
+ gl.glFrontFace(GL.GL_CW);
gl.glScaled(0.5*scale, 0.5*scale, 0.5*scale);
} else {
// We want the teapot in it's backward compatible position and
@@ -1184,29 +1185,29 @@ public class GLUT {
gl.glPopAttrib();
}
- private static void evaluateTeapotMesh(GL2 gl,
- int grid,
- int type,
- int partNum,
- boolean repairSingularities)
+ private static void evaluateTeapotMesh(final GL2 gl,
+ final int grid,
+ final int type,
+ final int partNum,
+ final boolean repairSingularities)
{
if (repairSingularities && (partNum == 5 || partNum == 3)) {
// Instead of using evaluators that give bad results at singularities,
// evaluate by hand
- gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, type);
+ gl.glPolygonMode(GL.GL_FRONT_AND_BACK, type);
for (int nv = 0; nv < grid; nv++) {
if (nv == 0) {
// Draw a small triangle-fan to fill the hole
gl.glDisable(GL2.GL_AUTO_NORMAL);
gl.glNormal3f(0, 0, partNum == 3 ? 1 : -1);
- gl.glBegin(GL2.GL_TRIANGLE_FAN);
+ gl.glBegin(GL.GL_TRIANGLE_FAN);
{
gl.glEvalCoord2f(0, 0);
// Note that we draw in clock-wise order to match the evaluator
// method
for (int nu = 0; nu <= grid; nu++)
{
- gl.glEvalCoord2f(nu / (float)grid, (1f / grid) / (float)grid);
+ gl.glEvalCoord2f(nu / (float)grid, (1f / grid) / grid);
}
}
gl.glEnd();
@@ -1219,7 +1220,7 @@ public class GLUT {
for (int nu = grid; nu >= 0; nu--) {
gl.glEvalCoord2f(nu / (float)grid, (nv + 1) / (float)grid);
gl.glEvalCoord2f(nu / (float)grid, Math.max(nv, 1f / grid)
- / (float)grid);
+ / grid);
}
}
gl.glEnd();
@@ -1233,13 +1234,13 @@ public class GLUT {
// Font implementation
//
- private static void bitmapCharacterImpl(GL2 gl, int font, char cin) {
- BitmapFontRec fontinfo = getBitmapFont(font);
- int c = cin & 0xFFFF;
+ private static void bitmapCharacterImpl(final GL2 gl, final int font, final char cin) {
+ final BitmapFontRec fontinfo = getBitmapFont(font);
+ final int c = cin & 0xFFFF;
if (c < fontinfo.first ||
c >= fontinfo.first + fontinfo.num_chars)
return;
- BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
+ final BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
if (ch != null) {
gl.glBitmap(ch.width, ch.height, ch.xorig, ch.yorig,
ch.advance, 0, ch.bitmap, 0);
@@ -1249,7 +1250,7 @@ public class GLUT {
private static final BitmapFontRec[] bitmapFonts = new BitmapFontRec[9];
private static final StrokeFontRec[] strokeFonts = new StrokeFontRec[9];
- private static BitmapFontRec getBitmapFont(int font) {
+ private static BitmapFontRec getBitmapFont(final int font) {
BitmapFontRec rec = bitmapFonts[font];
if (rec == null) {
switch (font) {
@@ -1282,7 +1283,7 @@ public class GLUT {
return rec;
}
- private static StrokeFontRec getStrokeFont(int font) {
+ private static StrokeFontRec getStrokeFont(final int font) {
StrokeFontRec rec = strokeFonts[font];
if (rec == null) {
switch (font) {
@@ -1299,44 +1300,44 @@ public class GLUT {
return rec;
}
- private static void beginBitmap(GL2 gl,
- int[] swapbytes,
- int[] lsbfirst,
- int[] rowlength,
- int[] skiprows,
- int[] skippixels,
- int[] alignment) {
- gl.glGetIntegerv(GL2.GL_UNPACK_SWAP_BYTES, swapbytes, 0);
- gl.glGetIntegerv(GL2.GL_UNPACK_LSB_FIRST, lsbfirst, 0);
- gl.glGetIntegerv(GL2.GL_UNPACK_ROW_LENGTH, rowlength, 0);
- gl.glGetIntegerv(GL2.GL_UNPACK_SKIP_ROWS, skiprows, 0);
- gl.glGetIntegerv(GL2.GL_UNPACK_SKIP_PIXELS, skippixels, 0);
- gl.glGetIntegerv(GL2.GL_UNPACK_ALIGNMENT, alignment, 0);
+ private static void beginBitmap(final GL2 gl,
+ final int[] swapbytes,
+ final int[] lsbfirst,
+ final int[] rowlength,
+ final int[] skiprows,
+ final int[] skippixels,
+ final int[] alignment) {
+ gl.glGetIntegerv(GL2GL3.GL_UNPACK_SWAP_BYTES, swapbytes, 0);
+ gl.glGetIntegerv(GL2GL3.GL_UNPACK_LSB_FIRST, lsbfirst, 0);
+ gl.glGetIntegerv(GL2ES2.GL_UNPACK_ROW_LENGTH, rowlength, 0);
+ gl.glGetIntegerv(GL2ES2.GL_UNPACK_SKIP_ROWS, skiprows, 0);
+ gl.glGetIntegerv(GL2ES2.GL_UNPACK_SKIP_PIXELS, skippixels, 0);
+ gl.glGetIntegerv(GL.GL_UNPACK_ALIGNMENT, alignment, 0);
/* Little endian machines (DEC Alpha for example) could
benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE
instead of GL_FALSE, but this would require changing the
generated bitmaps too. */
- gl.glPixelStorei(GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE);
- gl.glPixelStorei(GL2.GL_UNPACK_LSB_FIRST, GL2.GL_FALSE);
- gl.glPixelStorei(GL2.GL_UNPACK_ROW_LENGTH, 0);
- gl.glPixelStorei(GL2.GL_UNPACK_SKIP_ROWS, 0);
- gl.glPixelStorei(GL2.GL_UNPACK_SKIP_PIXELS, 0);
- gl.glPixelStorei(GL2.GL_UNPACK_ALIGNMENT, 1);
+ gl.glPixelStorei(GL2GL3.GL_UNPACK_SWAP_BYTES, GL.GL_FALSE);
+ gl.glPixelStorei(GL2GL3.GL_UNPACK_LSB_FIRST, GL.GL_FALSE);
+ gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, 0);
+ gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS, 0);
+ gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_PIXELS, 0);
+ gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);
}
- private static void endBitmap(GL2 gl,
- int[] swapbytes,
- int[] lsbfirst,
- int[] rowlength,
- int[] skiprows,
- int[] skippixels,
- int[] alignment) {
+ private static void endBitmap(final GL2 gl,
+ final int[] swapbytes,
+ final int[] lsbfirst,
+ final int[] rowlength,
+ final int[] skiprows,
+ final int[] skippixels,
+ final int[] alignment) {
/* Restore saved modes. */
- gl.glPixelStorei(GL2.GL_UNPACK_SWAP_BYTES, swapbytes[0]);
- gl.glPixelStorei(GL2.GL_UNPACK_LSB_FIRST, lsbfirst[0]);
- gl.glPixelStorei(GL2.GL_UNPACK_ROW_LENGTH, rowlength[0]);
- gl.glPixelStorei(GL2.GL_UNPACK_SKIP_ROWS, skiprows[0]);
- gl.glPixelStorei(GL2.GL_UNPACK_SKIP_PIXELS, skippixels[0]);
- gl.glPixelStorei(GL2.GL_UNPACK_ALIGNMENT, alignment[0]);
+ gl.glPixelStorei(GL2GL3.GL_UNPACK_SWAP_BYTES, swapbytes[0]);
+ gl.glPixelStorei(GL2GL3.GL_UNPACK_LSB_FIRST, lsbfirst[0]);
+ gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, rowlength[0]);
+ gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS, skiprows[0]);
+ gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_PIXELS, skippixels[0]);
+ gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, alignment[0]);
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java
index 3587ca992..a191efdb4 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java
@@ -46,14 +46,14 @@ class GLUTStrokeMonoRoman {
/* char: 33 '!' */
static final CoordRec char33_stroke0[] = {
- new CoordRec((float) 52.381, (float) 100 ),
+ new CoordRec((float) 52.381, 100 ),
new CoordRec((float) 52.381, (float) 33.3333 ),
};
static final CoordRec char33_stroke1[] = {
new CoordRec((float) 52.381, (float) 9.5238 ),
new CoordRec((float) 47.6191, (float) 4.7619 ),
- new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 52.381, 0 ),
new CoordRec((float) 57.1429, (float) 4.7619 ),
new CoordRec((float) 52.381, (float) 9.5238 ),
};
@@ -66,12 +66,12 @@ static final StrokeRec char33[] = {
/* char: 34 '"' */
static final CoordRec char34_stroke0[] = {
- new CoordRec((float) 33.3334, (float) 100 ),
+ new CoordRec((float) 33.3334, 100 ),
new CoordRec((float) 33.3334, (float) 66.6667 ),
};
static final CoordRec char34_stroke1[] = {
- new CoordRec((float) 71.4286, (float) 100 ),
+ new CoordRec((float) 71.4286, 100 ),
new CoordRec((float) 71.4286, (float) 66.6667 ),
};
@@ -89,7 +89,7 @@ static final CoordRec char35_stroke0[] = {
static final CoordRec char35_stroke1[] = {
new CoordRec((float) 83.3334, (float) 119.048 ),
- new CoordRec((float) 50, (float) -33.3333 ),
+ new CoordRec(50, (float) -33.3333 ),
};
static final CoordRec char35_stroke2[] = {
@@ -124,8 +124,8 @@ static final CoordRec char36_stroke1[] = {
static final CoordRec char36_stroke2[] = {
new CoordRec((float) 85.7143, (float) 85.7143 ),
new CoordRec((float) 76.1905, (float) 95.2381 ),
- new CoordRec((float) 61.9047, (float) 100 ),
- new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 61.9047, 100 ),
+ new CoordRec((float) 42.8571, 100 ),
new CoordRec((float) 28.5714, (float) 95.2381 ),
new CoordRec((float) 19.0476, (float) 85.7143 ),
new CoordRec((float) 19.0476, (float) 76.1905 ),
@@ -138,8 +138,8 @@ static final CoordRec char36_stroke2[] = {
new CoordRec((float) 85.7143, (float) 28.5714 ),
new CoordRec((float) 85.7143, (float) 14.2857 ),
new CoordRec((float) 76.1905, (float) 4.7619 ),
- new CoordRec((float) 61.9047, (float) 0 ),
- new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 61.9047, 0 ),
+ new CoordRec((float) 42.8571, 0 ),
new CoordRec((float) 28.5714, (float) 4.7619 ),
new CoordRec((float) 19.0476, (float) 14.2857 ),
};
@@ -153,12 +153,12 @@ static final StrokeRec char36[] = {
/* char: 37 '%' */
static final CoordRec char37_stroke0[] = {
- new CoordRec((float) 95.2381, (float) 100 ),
- new CoordRec((float) 9.5238, (float) 0 ),
+ new CoordRec((float) 95.2381, 100 ),
+ new CoordRec((float) 9.5238, 0 ),
};
static final CoordRec char37_stroke1[] = {
- new CoordRec((float) 33.3333, (float) 100 ),
+ new CoordRec((float) 33.3333, 100 ),
new CoordRec((float) 42.8571, (float) 90.4762 ),
new CoordRec((float) 42.8571, (float) 80.9524 ),
new CoordRec((float) 38.0952, (float) 71.4286 ),
@@ -167,13 +167,13 @@ static final CoordRec char37_stroke1[] = {
new CoordRec((float) 9.5238, (float) 76.1905 ),
new CoordRec((float) 9.5238, (float) 85.7143 ),
new CoordRec((float) 14.2857, (float) 95.2381 ),
- new CoordRec((float) 23.8095, (float) 100 ),
- new CoordRec((float) 33.3333, (float) 100 ),
+ new CoordRec((float) 23.8095, 100 ),
+ new CoordRec((float) 33.3333, 100 ),
new CoordRec((float) 42.8571, (float) 95.2381 ),
new CoordRec((float) 57.1428, (float) 90.4762 ),
new CoordRec((float) 71.4286, (float) 90.4762 ),
new CoordRec((float) 85.7143, (float) 95.2381 ),
- new CoordRec((float) 95.2381, (float) 100 ),
+ new CoordRec((float) 95.2381, 100 ),
};
static final CoordRec char37_stroke2[] = {
@@ -181,8 +181,8 @@ static final CoordRec char37_stroke2[] = {
new CoordRec((float) 66.6667, (float) 28.5714 ),
new CoordRec((float) 61.9048, (float) 19.0476 ),
new CoordRec((float) 61.9048, (float) 9.5238 ),
- new CoordRec((float) 71.4286, (float) 0 ),
- new CoordRec((float) 80.9524, (float) 0 ),
+ new CoordRec((float) 71.4286, 0 ),
+ new CoordRec((float) 80.9524, 0 ),
new CoordRec((float) 90.4762, (float) 4.7619 ),
new CoordRec((float) 95.2381, (float) 14.2857 ),
new CoordRec((float) 95.2381, (float) 23.8095 ),
@@ -199,8 +199,8 @@ static final StrokeRec char37[] = {
/* char: 38 '&' */
static final CoordRec char38_stroke0[] = {
- new CoordRec((float) 100, (float) 57.1429 ),
- new CoordRec((float) 100, (float) 61.9048 ),
+ new CoordRec(100, (float) 57.1429 ),
+ new CoordRec(100, (float) 61.9048 ),
new CoordRec((float) 95.2381, (float) 66.6667 ),
new CoordRec((float) 90.4762, (float) 66.6667 ),
new CoordRec((float) 85.7143, (float) 61.9048 ),
@@ -208,8 +208,8 @@ static final CoordRec char38_stroke0[] = {
new CoordRec((float) 71.4286, (float) 28.5714 ),
new CoordRec((float) 61.9048, (float) 14.2857 ),
new CoordRec((float) 52.3809, (float) 4.7619 ),
- new CoordRec((float) 42.8571, (float) 0 ),
- new CoordRec((float) 23.8095, (float) 0 ),
+ new CoordRec((float) 42.8571, 0 ),
+ new CoordRec((float) 23.8095, 0 ),
new CoordRec((float) 14.2857, (float) 4.7619 ),
new CoordRec((float) 9.5238, (float) 9.5238 ),
new CoordRec((float) 4.7619, (float) 19.0476 ),
@@ -221,7 +221,7 @@ static final CoordRec char38_stroke0[] = {
new CoordRec((float) 57.1429, (float) 76.1905 ),
new CoordRec((float) 57.1429, (float) 85.7143 ),
new CoordRec((float) 52.3809, (float) 95.2381 ),
- new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 42.8571, 100 ),
new CoordRec((float) 33.3333, (float) 95.2381 ),
new CoordRec((float) 28.5714, (float) 85.7143 ),
new CoordRec((float) 28.5714, (float) 76.1905 ),
@@ -229,10 +229,10 @@ static final CoordRec char38_stroke0[] = {
new CoordRec((float) 42.8571, (float) 47.619 ),
new CoordRec((float) 66.6667, (float) 14.2857 ),
new CoordRec((float) 76.1905, (float) 4.7619 ),
- new CoordRec((float) 85.7143, (float) 0 ),
- new CoordRec((float) 95.2381, (float) 0 ),
- new CoordRec((float) 100, (float) 4.7619 ),
- new CoordRec((float) 100, (float) 9.5238 ),
+ new CoordRec((float) 85.7143, 0 ),
+ new CoordRec((float) 95.2381, 0 ),
+ new CoordRec(100, (float) 4.7619 ),
+ new CoordRec(100, (float) 9.5238 ),
};
static final StrokeRec char38[] = {
@@ -242,7 +242,7 @@ static final StrokeRec char38[] = {
/* char: 39 ''' */
static final CoordRec char39_stroke0[] = {
- new CoordRec((float) 52.381, (float) 100 ),
+ new CoordRec((float) 52.381, 100 ),
new CoordRec((float) 52.381, (float) 66.6667 ),
};
@@ -255,12 +255,12 @@ static final StrokeRec char39[] = {
static final CoordRec char40_stroke0[] = {
new CoordRec((float) 69.0476, (float) 119.048 ),
new CoordRec((float) 59.5238, (float) 109.524 ),
- new CoordRec((float) 50, (float) 95.2381 ),
+ new CoordRec(50, (float) 95.2381 ),
new CoordRec((float) 40.4762, (float) 76.1905 ),
new CoordRec((float) 35.7143, (float) 52.381 ),
new CoordRec((float) 35.7143, (float) 33.3333 ),
new CoordRec((float) 40.4762, (float) 9.5238 ),
- new CoordRec((float) 50, (float) -9.5238 ),
+ new CoordRec(50, (float) -9.5238 ),
new CoordRec((float) 59.5238, (float) -23.8095 ),
new CoordRec((float) 69.0476, (float) -33.3333 ),
};
@@ -315,7 +315,7 @@ static final StrokeRec char42[] = {
static final CoordRec char43_stroke0[] = {
new CoordRec((float) 52.3809, (float) 85.7143 ),
- new CoordRec((float) 52.3809, (float) 0 ),
+ new CoordRec((float) 52.3809, 0 ),
};
static final CoordRec char43_stroke1[] = {
@@ -332,7 +332,7 @@ static final StrokeRec char43[] = {
static final CoordRec char44_stroke0[] = {
new CoordRec((float) 57.1429, (float) 4.7619 ),
- new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 52.381, 0 ),
new CoordRec((float) 47.6191, (float) 4.7619 ),
new CoordRec((float) 52.381, (float) 9.5238 ),
new CoordRec((float) 57.1429, (float) 4.7619 ),
@@ -361,7 +361,7 @@ static final StrokeRec char45[] = {
static final CoordRec char46_stroke0[] = {
new CoordRec((float) 52.381, (float) 9.5238 ),
new CoordRec((float) 47.6191, (float) 4.7619 ),
- new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 52.381, 0 ),
new CoordRec((float) 57.1429, (float) 4.7619 ),
new CoordRec((float) 52.381, (float) 9.5238 ),
};
@@ -374,7 +374,7 @@ static final StrokeRec char46[] = {
static final CoordRec char47_stroke0[] = {
new CoordRec((float) 19.0476, (float) -14.2857 ),
- new CoordRec((float) 85.7143, (float) 100 ),
+ new CoordRec((float) 85.7143, 100 ),
};
static final StrokeRec char47[] = {
@@ -384,23 +384,23 @@ static final StrokeRec char47[] = {
/* char: 48 '0' */
static final CoordRec char48_stroke0[] = {
- new CoordRec((float) 47.619, (float) 100 ),
+ new CoordRec((float) 47.619, 100 ),
new CoordRec((float) 33.3333, (float) 95.2381 ),
new CoordRec((float) 23.8095, (float) 80.9524 ),
new CoordRec((float) 19.0476, (float) 57.1429 ),
new CoordRec((float) 19.0476, (float) 42.8571 ),
new CoordRec((float) 23.8095, (float) 19.0476 ),
new CoordRec((float) 33.3333, (float) 4.7619 ),
- new CoordRec((float) 47.619, (float) 0 ),
- new CoordRec((float) 57.1428, (float) 0 ),
+ new CoordRec((float) 47.619, 0 ),
+ new CoordRec((float) 57.1428, 0 ),
new CoordRec((float) 71.4286, (float) 4.7619 ),
new CoordRec((float) 80.9524, (float) 19.0476 ),
new CoordRec((float) 85.7143, (float) 42.8571 ),
new CoordRec((float) 85.7143, (float) 57.1429 ),
new CoordRec((float) 80.9524, (float) 80.9524 ),
new CoordRec((float) 71.4286, (float) 95.2381 ),
- new CoordRec((float) 57.1428, (float) 100 ),
- new CoordRec((float) 47.619, (float) 100 ),
+ new CoordRec((float) 57.1428, 100 ),
+ new CoordRec((float) 47.619, 100 ),
};
static final StrokeRec char48[] = {
@@ -411,9 +411,9 @@ static final StrokeRec char48[] = {
static final CoordRec char49_stroke0[] = {
new CoordRec((float) 40.4762, (float) 80.9524 ),
- new CoordRec((float) 50, (float) 85.7143 ),
- new CoordRec((float) 64.2857, (float) 100 ),
- new CoordRec((float) 64.2857, (float) 0 ),
+ new CoordRec(50, (float) 85.7143 ),
+ new CoordRec((float) 64.2857, 100 ),
+ new CoordRec((float) 64.2857, 0 ),
};
static final StrokeRec char49[] = {
@@ -427,16 +427,16 @@ static final CoordRec char50_stroke0[] = {
new CoordRec((float) 23.8095, (float) 80.9524 ),
new CoordRec((float) 28.5714, (float) 90.4762 ),
new CoordRec((float) 33.3333, (float) 95.2381 ),
- new CoordRec((float) 42.8571, (float) 100 ),
- new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 42.8571, 100 ),
+ new CoordRec((float) 61.9047, 100 ),
new CoordRec((float) 71.4286, (float) 95.2381 ),
new CoordRec((float) 76.1905, (float) 90.4762 ),
new CoordRec((float) 80.9524, (float) 80.9524 ),
new CoordRec((float) 80.9524, (float) 71.4286 ),
new CoordRec((float) 76.1905, (float) 61.9048 ),
new CoordRec((float) 66.6666, (float) 47.619 ),
- new CoordRec((float) 19.0476, (float) 0 ),
- new CoordRec((float) 85.7143, (float) 0 ),
+ new CoordRec((float) 19.0476, 0 ),
+ new CoordRec((float) 85.7143, 0 ),
};
static final StrokeRec char50[] = {
@@ -446,8 +446,8 @@ static final StrokeRec char50[] = {
/* char: 51 '3' */
static final CoordRec char51_stroke0[] = {
- new CoordRec((float) 28.5714, (float) 100 ),
- new CoordRec((float) 80.9524, (float) 100 ),
+ new CoordRec((float) 28.5714, 100 ),
+ new CoordRec((float) 80.9524, 100 ),
new CoordRec((float) 52.3809, (float) 61.9048 ),
new CoordRec((float) 66.6666, (float) 61.9048 ),
new CoordRec((float) 76.1905, (float) 57.1429 ),
@@ -456,8 +456,8 @@ static final CoordRec char51_stroke0[] = {
new CoordRec((float) 85.7143, (float) 28.5714 ),
new CoordRec((float) 80.9524, (float) 14.2857 ),
new CoordRec((float) 71.4286, (float) 4.7619 ),
- new CoordRec((float) 57.1428, (float) 0 ),
- new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 57.1428, 0 ),
+ new CoordRec((float) 42.8571, 0 ),
new CoordRec((float) 28.5714, (float) 4.7619 ),
new CoordRec((float) 23.8095, (float) 9.5238 ),
new CoordRec((float) 19.0476, (float) 19.0476 ),
@@ -470,14 +470,14 @@ static final StrokeRec char51[] = {
/* char: 52 '4' */
static final CoordRec char52_stroke0[] = {
- new CoordRec((float) 64.2857, (float) 100 ),
+ new CoordRec((float) 64.2857, 100 ),
new CoordRec((float) 16.6667, (float) 33.3333 ),
new CoordRec((float) 88.0952, (float) 33.3333 ),
};
static final CoordRec char52_stroke1[] = {
- new CoordRec((float) 64.2857, (float) 100 ),
- new CoordRec((float) 64.2857, (float) 0 ),
+ new CoordRec((float) 64.2857, 100 ),
+ new CoordRec((float) 64.2857, 0 ),
};
static final StrokeRec char52[] = {
@@ -488,8 +488,8 @@ static final StrokeRec char52[] = {
/* char: 53 '5' */
static final CoordRec char53_stroke0[] = {
- new CoordRec((float) 76.1905, (float) 100 ),
- new CoordRec((float) 28.5714, (float) 100 ),
+ new CoordRec((float) 76.1905, 100 ),
+ new CoordRec((float) 28.5714, 100 ),
new CoordRec((float) 23.8095, (float) 57.1429 ),
new CoordRec((float) 28.5714, (float) 61.9048 ),
new CoordRec((float) 42.8571, (float) 66.6667 ),
@@ -500,8 +500,8 @@ static final CoordRec char53_stroke0[] = {
new CoordRec((float) 85.7143, (float) 28.5714 ),
new CoordRec((float) 80.9524, (float) 14.2857 ),
new CoordRec((float) 71.4286, (float) 4.7619 ),
- new CoordRec((float) 57.1428, (float) 0 ),
- new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 57.1428, 0 ),
+ new CoordRec((float) 42.8571, 0 ),
new CoordRec((float) 28.5714, (float) 4.7619 ),
new CoordRec((float) 23.8095, (float) 9.5238 ),
new CoordRec((float) 19.0476, (float) 19.0476 ),
@@ -516,16 +516,16 @@ static final StrokeRec char53[] = {
static final CoordRec char54_stroke0[] = {
new CoordRec((float) 78.5714, (float) 85.7143 ),
new CoordRec((float) 73.8096, (float) 95.2381 ),
- new CoordRec((float) 59.5238, (float) 100 ),
- new CoordRec((float) 50, (float) 100 ),
+ new CoordRec((float) 59.5238, 100 ),
+ new CoordRec(50, 100 ),
new CoordRec((float) 35.7143, (float) 95.2381 ),
new CoordRec((float) 26.1905, (float) 80.9524 ),
new CoordRec((float) 21.4286, (float) 57.1429 ),
new CoordRec((float) 21.4286, (float) 33.3333 ),
new CoordRec((float) 26.1905, (float) 14.2857 ),
new CoordRec((float) 35.7143, (float) 4.7619 ),
- new CoordRec((float) 50, (float) 0 ),
- new CoordRec((float) 54.7619, (float) 0 ),
+ new CoordRec(50, 0 ),
+ new CoordRec((float) 54.7619, 0 ),
new CoordRec((float) 69.0476, (float) 4.7619 ),
new CoordRec((float) 78.5714, (float) 14.2857 ),
new CoordRec((float) 83.3334, (float) 28.5714 ),
@@ -533,7 +533,7 @@ static final CoordRec char54_stroke0[] = {
new CoordRec((float) 78.5714, (float) 47.619 ),
new CoordRec((float) 69.0476, (float) 57.1429 ),
new CoordRec((float) 54.7619, (float) 61.9048 ),
- new CoordRec((float) 50, (float) 61.9048 ),
+ new CoordRec(50, (float) 61.9048 ),
new CoordRec((float) 35.7143, (float) 57.1429 ),
new CoordRec((float) 26.1905, (float) 47.619 ),
new CoordRec((float) 21.4286, (float) 33.3333 ),
@@ -546,13 +546,13 @@ static final StrokeRec char54[] = {
/* char: 55 '7' */
static final CoordRec char55_stroke0[] = {
- new CoordRec((float) 85.7143, (float) 100 ),
- new CoordRec((float) 38.0952, (float) 0 ),
+ new CoordRec((float) 85.7143, 100 ),
+ new CoordRec((float) 38.0952, 0 ),
};
static final CoordRec char55_stroke1[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 85.7143, (float) 100 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 85.7143, 100 ),
};
static final StrokeRec char55[] = {
@@ -563,7 +563,7 @@ static final StrokeRec char55[] = {
/* char: 56 '8' */
static final CoordRec char56_stroke0[] = {
- new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 42.8571, 100 ),
new CoordRec((float) 28.5714, (float) 95.2381 ),
new CoordRec((float) 23.8095, (float) 85.7143 ),
new CoordRec((float) 23.8095, (float) 76.1905 ),
@@ -576,8 +576,8 @@ static final CoordRec char56_stroke0[] = {
new CoordRec((float) 85.7143, (float) 19.0476 ),
new CoordRec((float) 80.9524, (float) 9.5238 ),
new CoordRec((float) 76.1905, (float) 4.7619 ),
- new CoordRec((float) 61.9047, (float) 0 ),
- new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 61.9047, 0 ),
+ new CoordRec((float) 42.8571, 0 ),
new CoordRec((float) 28.5714, (float) 4.7619 ),
new CoordRec((float) 23.8095, (float) 9.5238 ),
new CoordRec((float) 19.0476, (float) 19.0476 ),
@@ -590,8 +590,8 @@ static final CoordRec char56_stroke0[] = {
new CoordRec((float) 80.9524, (float) 76.1905 ),
new CoordRec((float) 80.9524, (float) 85.7143 ),
new CoordRec((float) 76.1905, (float) 95.2381 ),
- new CoordRec((float) 61.9047, (float) 100 ),
- new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 61.9047, 100 ),
+ new CoordRec((float) 42.8571, 100 ),
};
static final StrokeRec char56[] = {
@@ -605,23 +605,23 @@ static final CoordRec char57_stroke0[] = {
new CoordRec((float) 78.5714, (float) 52.381 ),
new CoordRec((float) 69.0476, (float) 42.8571 ),
new CoordRec((float) 54.7619, (float) 38.0952 ),
- new CoordRec((float) 50, (float) 38.0952 ),
+ new CoordRec(50, (float) 38.0952 ),
new CoordRec((float) 35.7143, (float) 42.8571 ),
new CoordRec((float) 26.1905, (float) 52.381 ),
new CoordRec((float) 21.4286, (float) 66.6667 ),
new CoordRec((float) 21.4286, (float) 71.4286 ),
new CoordRec((float) 26.1905, (float) 85.7143 ),
new CoordRec((float) 35.7143, (float) 95.2381 ),
- new CoordRec((float) 50, (float) 100 ),
- new CoordRec((float) 54.7619, (float) 100 ),
+ new CoordRec(50, 100 ),
+ new CoordRec((float) 54.7619, 100 ),
new CoordRec((float) 69.0476, (float) 95.2381 ),
new CoordRec((float) 78.5714, (float) 85.7143 ),
new CoordRec((float) 83.3334, (float) 66.6667 ),
new CoordRec((float) 83.3334, (float) 42.8571 ),
new CoordRec((float) 78.5714, (float) 19.0476 ),
new CoordRec((float) 69.0476, (float) 4.7619 ),
- new CoordRec((float) 54.7619, (float) 0 ),
- new CoordRec((float) 45.2381, (float) 0 ),
+ new CoordRec((float) 54.7619, 0 ),
+ new CoordRec((float) 45.2381, 0 ),
new CoordRec((float) 30.9524, (float) 4.7619 ),
new CoordRec((float) 26.1905, (float) 14.2857 ),
};
@@ -643,7 +643,7 @@ static final CoordRec char58_stroke0[] = {
static final CoordRec char58_stroke1[] = {
new CoordRec((float) 52.381, (float) 9.5238 ),
new CoordRec((float) 47.6191, (float) 4.7619 ),
- new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 52.381, 0 ),
new CoordRec((float) 57.1429, (float) 4.7619 ),
new CoordRec((float) 52.381, (float) 9.5238 ),
};
@@ -665,7 +665,7 @@ static final CoordRec char59_stroke0[] = {
static final CoordRec char59_stroke1[] = {
new CoordRec((float) 57.1429, (float) 4.7619 ),
- new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 52.381, 0 ),
new CoordRec((float) 47.6191, (float) 4.7619 ),
new CoordRec((float) 52.381, (float) 9.5238 ),
new CoordRec((float) 57.1429, (float) 4.7619 ),
@@ -684,7 +684,7 @@ static final StrokeRec char59[] = {
static final CoordRec char60_stroke0[] = {
new CoordRec((float) 90.4762, (float) 85.7143 ),
new CoordRec((float) 14.2857, (float) 42.8571 ),
- new CoordRec((float) 90.4762, (float) 0 ),
+ new CoordRec((float) 90.4762, 0 ),
};
static final StrokeRec char60[] = {
@@ -713,7 +713,7 @@ static final StrokeRec char61[] = {
static final CoordRec char62_stroke0[] = {
new CoordRec((float) 14.2857, (float) 85.7143 ),
new CoordRec((float) 90.4762, (float) 42.8571 ),
- new CoordRec((float) 14.2857, (float) 0 ),
+ new CoordRec((float) 14.2857, 0 ),
};
static final StrokeRec char62[] = {
@@ -727,8 +727,8 @@ static final CoordRec char63_stroke0[] = {
new CoordRec((float) 23.8095, (float) 80.9524 ),
new CoordRec((float) 28.5714, (float) 90.4762 ),
new CoordRec((float) 33.3333, (float) 95.2381 ),
- new CoordRec((float) 42.8571, (float) 100 ),
- new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 42.8571, 100 ),
+ new CoordRec((float) 61.9047, 100 ),
new CoordRec((float) 71.4285, (float) 95.2381 ),
new CoordRec((float) 76.1905, (float) 90.4762 ),
new CoordRec((float) 80.9524, (float) 80.9524 ),
@@ -742,7 +742,7 @@ static final CoordRec char63_stroke0[] = {
static final CoordRec char63_stroke1[] = {
new CoordRec((float) 52.3809, (float) 9.5238 ),
new CoordRec((float) 47.619, (float) 4.7619 ),
- new CoordRec((float) 52.3809, (float) 0 ),
+ new CoordRec((float) 52.3809, 0 ),
new CoordRec((float) 57.1428, (float) 4.7619 ),
new CoordRec((float) 52.3809, (float) 9.5238 ),
};
@@ -775,14 +775,14 @@ static final CoordRec char64_stroke1[] = {
new CoordRec((float) 78.5714, (float) 61.9048 ),
new CoordRec((float) 69.0476, (float) 71.4286 ),
new CoordRec((float) 54.7619, (float) 76.1905 ),
- new CoordRec((float) 50, (float) 76.1905 ),
+ new CoordRec(50, (float) 76.1905 ),
new CoordRec((float) 35.7143, (float) 71.4286 ),
new CoordRec((float) 26.1905, (float) 61.9048 ),
new CoordRec((float) 21.4286, (float) 47.619 ),
new CoordRec((float) 21.4286, (float) 42.8571 ),
new CoordRec((float) 26.1905, (float) 28.5714 ),
new CoordRec((float) 35.7143, (float) 19.0476 ),
- new CoordRec((float) 50, (float) 14.2857 ),
+ new CoordRec(50, (float) 14.2857 ),
new CoordRec((float) 54.7619, (float) 14.2857 ),
new CoordRec((float) 69.0476, (float) 19.0476 ),
};
@@ -795,13 +795,13 @@ static final StrokeRec char64[] = {
/* char: 65 'A' */
static final CoordRec char65_stroke0[] = {
- new CoordRec((float) 52.3809, (float) 100 ),
- new CoordRec((float) 14.2857, (float) 0 ),
+ new CoordRec((float) 52.3809, 100 ),
+ new CoordRec((float) 14.2857, 0 ),
};
static final CoordRec char65_stroke1[] = {
- new CoordRec((float) 52.3809, (float) 100 ),
- new CoordRec((float) 90.4762, (float) 0 ),
+ new CoordRec((float) 52.3809, 100 ),
+ new CoordRec((float) 90.4762, 0 ),
};
static final CoordRec char65_stroke2[] = {
@@ -818,13 +818,13 @@ static final StrokeRec char65[] = {
/* char: 66 'B' */
static final CoordRec char66_stroke0[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 19.0476, (float) 0 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 19.0476, 0 ),
};
static final CoordRec char66_stroke1[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 61.9047, 100 ),
new CoordRec((float) 76.1905, (float) 95.2381 ),
new CoordRec((float) 80.9524, (float) 90.4762 ),
new CoordRec((float) 85.7143, (float) 80.9524 ),
@@ -843,8 +843,8 @@ static final CoordRec char66_stroke2[] = {
new CoordRec((float) 85.7143, (float) 19.0476 ),
new CoordRec((float) 80.9524, (float) 9.5238 ),
new CoordRec((float) 76.1905, (float) 4.7619 ),
- new CoordRec((float) 61.9047, (float) 0 ),
- new CoordRec((float) 19.0476, (float) 0 ),
+ new CoordRec((float) 61.9047, 0 ),
+ new CoordRec((float) 19.0476, 0 ),
};
static final StrokeRec char66[] = {
@@ -859,8 +859,8 @@ static final CoordRec char67_stroke0[] = {
new CoordRec((float) 88.0952, (float) 76.1905 ),
new CoordRec((float) 83.3334, (float) 85.7143 ),
new CoordRec((float) 73.8096, (float) 95.2381 ),
- new CoordRec((float) 64.2857, (float) 100 ),
- new CoordRec((float) 45.2381, (float) 100 ),
+ new CoordRec((float) 64.2857, 100 ),
+ new CoordRec((float) 45.2381, 100 ),
new CoordRec((float) 35.7143, (float) 95.2381 ),
new CoordRec((float) 26.1905, (float) 85.7143 ),
new CoordRec((float) 21.4286, (float) 76.1905 ),
@@ -869,8 +869,8 @@ static final CoordRec char67_stroke0[] = {
new CoordRec((float) 21.4286, (float) 23.8095 ),
new CoordRec((float) 26.1905, (float) 14.2857 ),
new CoordRec((float) 35.7143, (float) 4.7619 ),
- new CoordRec((float) 45.2381, (float) 0 ),
- new CoordRec((float) 64.2857, (float) 0 ),
+ new CoordRec((float) 45.2381, 0 ),
+ new CoordRec((float) 64.2857, 0 ),
new CoordRec((float) 73.8096, (float) 4.7619 ),
new CoordRec((float) 83.3334, (float) 14.2857 ),
new CoordRec((float) 88.0952, (float) 23.8095 ),
@@ -883,13 +883,13 @@ static final StrokeRec char67[] = {
/* char: 68 'D' */
static final CoordRec char68_stroke0[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 19.0476, (float) 0 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 19.0476, 0 ),
};
static final CoordRec char68_stroke1[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 52.3809, (float) 100 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 52.3809, 100 ),
new CoordRec((float) 66.6666, (float) 95.2381 ),
new CoordRec((float) 76.1905, (float) 85.7143 ),
new CoordRec((float) 80.9524, (float) 76.1905 ),
@@ -898,8 +898,8 @@ static final CoordRec char68_stroke1[] = {
new CoordRec((float) 80.9524, (float) 23.8095 ),
new CoordRec((float) 76.1905, (float) 14.2857 ),
new CoordRec((float) 66.6666, (float) 4.7619 ),
- new CoordRec((float) 52.3809, (float) 0 ),
- new CoordRec((float) 19.0476, (float) 0 ),
+ new CoordRec((float) 52.3809, 0 ),
+ new CoordRec((float) 19.0476, 0 ),
};
static final StrokeRec char68[] = {
@@ -910,13 +910,13 @@ static final StrokeRec char68[] = {
/* char: 69 'E' */
static final CoordRec char69_stroke0[] = {
- new CoordRec((float) 21.4286, (float) 100 ),
- new CoordRec((float) 21.4286, (float) 0 ),
+ new CoordRec((float) 21.4286, 100 ),
+ new CoordRec((float) 21.4286, 0 ),
};
static final CoordRec char69_stroke1[] = {
- new CoordRec((float) 21.4286, (float) 100 ),
- new CoordRec((float) 83.3334, (float) 100 ),
+ new CoordRec((float) 21.4286, 100 ),
+ new CoordRec((float) 83.3334, 100 ),
};
static final CoordRec char69_stroke2[] = {
@@ -925,8 +925,8 @@ static final CoordRec char69_stroke2[] = {
};
static final CoordRec char69_stroke3[] = {
- new CoordRec((float) 21.4286, (float) 0 ),
- new CoordRec((float) 83.3334, (float) 0 ),
+ new CoordRec((float) 21.4286, 0 ),
+ new CoordRec((float) 83.3334, 0 ),
};
static final StrokeRec char69[] = {
@@ -939,13 +939,13 @@ static final StrokeRec char69[] = {
/* char: 70 'F' */
static final CoordRec char70_stroke0[] = {
- new CoordRec((float) 21.4286, (float) 100 ),
- new CoordRec((float) 21.4286, (float) 0 ),
+ new CoordRec((float) 21.4286, 100 ),
+ new CoordRec((float) 21.4286, 0 ),
};
static final CoordRec char70_stroke1[] = {
- new CoordRec((float) 21.4286, (float) 100 ),
- new CoordRec((float) 83.3334, (float) 100 ),
+ new CoordRec((float) 21.4286, 100 ),
+ new CoordRec((float) 83.3334, 100 ),
};
static final CoordRec char70_stroke2[] = {
@@ -965,8 +965,8 @@ static final CoordRec char71_stroke0[] = {
new CoordRec((float) 88.0952, (float) 76.1905 ),
new CoordRec((float) 83.3334, (float) 85.7143 ),
new CoordRec((float) 73.8096, (float) 95.2381 ),
- new CoordRec((float) 64.2857, (float) 100 ),
- new CoordRec((float) 45.2381, (float) 100 ),
+ new CoordRec((float) 64.2857, 100 ),
+ new CoordRec((float) 45.2381, 100 ),
new CoordRec((float) 35.7143, (float) 95.2381 ),
new CoordRec((float) 26.1905, (float) 85.7143 ),
new CoordRec((float) 21.4286, (float) 76.1905 ),
@@ -975,8 +975,8 @@ static final CoordRec char71_stroke0[] = {
new CoordRec((float) 21.4286, (float) 23.8095 ),
new CoordRec((float) 26.1905, (float) 14.2857 ),
new CoordRec((float) 35.7143, (float) 4.7619 ),
- new CoordRec((float) 45.2381, (float) 0 ),
- new CoordRec((float) 64.2857, (float) 0 ),
+ new CoordRec((float) 45.2381, 0 ),
+ new CoordRec((float) 64.2857, 0 ),
new CoordRec((float) 73.8096, (float) 4.7619 ),
new CoordRec((float) 83.3334, (float) 14.2857 ),
new CoordRec((float) 88.0952, (float) 23.8095 ),
@@ -996,13 +996,13 @@ static final StrokeRec char71[] = {
/* char: 72 'H' */
static final CoordRec char72_stroke0[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 19.0476, (float) 0 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 19.0476, 0 ),
};
static final CoordRec char72_stroke1[] = {
- new CoordRec((float) 85.7143, (float) 100 ),
- new CoordRec((float) 85.7143, (float) 0 ),
+ new CoordRec((float) 85.7143, 100 ),
+ new CoordRec((float) 85.7143, 0 ),
};
static final CoordRec char72_stroke2[] = {
@@ -1019,8 +1019,8 @@ static final StrokeRec char72[] = {
/* char: 73 'I' */
static final CoordRec char73_stroke0[] = {
- new CoordRec((float) 52.381, (float) 100 ),
- new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 52.381, 100 ),
+ new CoordRec((float) 52.381, 0 ),
};
static final StrokeRec char73[] = {
@@ -1030,12 +1030,12 @@ static final StrokeRec char73[] = {
/* char: 74 'J' */
static final CoordRec char74_stroke0[] = {
- new CoordRec((float) 76.1905, (float) 100 ),
+ new CoordRec((float) 76.1905, 100 ),
new CoordRec((float) 76.1905, (float) 23.8095 ),
new CoordRec((float) 71.4286, (float) 9.5238 ),
new CoordRec((float) 66.6667, (float) 4.7619 ),
- new CoordRec((float) 57.1429, (float) 0 ),
- new CoordRec((float) 47.6191, (float) 0 ),
+ new CoordRec((float) 57.1429, 0 ),
+ new CoordRec((float) 47.6191, 0 ),
new CoordRec((float) 38.0953, (float) 4.7619 ),
new CoordRec((float) 33.3334, (float) 9.5238 ),
new CoordRec((float) 28.5715, (float) 23.8095 ),
@@ -1049,18 +1049,18 @@ static final StrokeRec char74[] = {
/* char: 75 'K' */
static final CoordRec char75_stroke0[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 19.0476, (float) 0 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 19.0476, 0 ),
};
static final CoordRec char75_stroke1[] = {
- new CoordRec((float) 85.7143, (float) 100 ),
+ new CoordRec((float) 85.7143, 100 ),
new CoordRec((float) 19.0476, (float) 33.3333 ),
};
static final CoordRec char75_stroke2[] = {
new CoordRec((float) 42.8571, (float) 57.1429 ),
- new CoordRec((float) 85.7143, (float) 0 ),
+ new CoordRec((float) 85.7143, 0 ),
};
static final StrokeRec char75[] = {
@@ -1072,13 +1072,13 @@ static final StrokeRec char75[] = {
/* char: 76 'L' */
static final CoordRec char76_stroke0[] = {
- new CoordRec((float) 23.8095, (float) 100 ),
- new CoordRec((float) 23.8095, (float) 0 ),
+ new CoordRec((float) 23.8095, 100 ),
+ new CoordRec((float) 23.8095, 0 ),
};
static final CoordRec char76_stroke1[] = {
- new CoordRec((float) 23.8095, (float) 0 ),
- new CoordRec((float) 80.9524, (float) 0 ),
+ new CoordRec((float) 23.8095, 0 ),
+ new CoordRec((float) 80.9524, 0 ),
};
static final StrokeRec char76[] = {
@@ -1089,23 +1089,23 @@ static final StrokeRec char76[] = {
/* char: 77 'M' */
static final CoordRec char77_stroke0[] = {
- new CoordRec((float) 14.2857, (float) 100 ),
- new CoordRec((float) 14.2857, (float) 0 ),
+ new CoordRec((float) 14.2857, 100 ),
+ new CoordRec((float) 14.2857, 0 ),
};
static final CoordRec char77_stroke1[] = {
- new CoordRec((float) 14.2857, (float) 100 ),
- new CoordRec((float) 52.3809, (float) 0 ),
+ new CoordRec((float) 14.2857, 100 ),
+ new CoordRec((float) 52.3809, 0 ),
};
static final CoordRec char77_stroke2[] = {
- new CoordRec((float) 90.4762, (float) 100 ),
- new CoordRec((float) 52.3809, (float) 0 ),
+ new CoordRec((float) 90.4762, 100 ),
+ new CoordRec((float) 52.3809, 0 ),
};
static final CoordRec char77_stroke3[] = {
- new CoordRec((float) 90.4762, (float) 100 ),
- new CoordRec((float) 90.4762, (float) 0 ),
+ new CoordRec((float) 90.4762, 100 ),
+ new CoordRec((float) 90.4762, 0 ),
};
static final StrokeRec char77[] = {
@@ -1118,18 +1118,18 @@ static final StrokeRec char77[] = {
/* char: 78 'N' */
static final CoordRec char78_stroke0[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 19.0476, (float) 0 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 19.0476, 0 ),
};
static final CoordRec char78_stroke1[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 85.7143, (float) 0 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 85.7143, 0 ),
};
static final CoordRec char78_stroke2[] = {
- new CoordRec((float) 85.7143, (float) 100 ),
- new CoordRec((float) 85.7143, (float) 0 ),
+ new CoordRec((float) 85.7143, 100 ),
+ new CoordRec((float) 85.7143, 0 ),
};
static final StrokeRec char78[] = {
@@ -1141,7 +1141,7 @@ static final StrokeRec char78[] = {
/* char: 79 'O' */
static final CoordRec char79_stroke0[] = {
- new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 42.8571, 100 ),
new CoordRec((float) 33.3333, (float) 95.2381 ),
new CoordRec((float) 23.8095, (float) 85.7143 ),
new CoordRec((float) 19.0476, (float) 76.1905 ),
@@ -1150,8 +1150,8 @@ static final CoordRec char79_stroke0[] = {
new CoordRec((float) 19.0476, (float) 23.8095 ),
new CoordRec((float) 23.8095, (float) 14.2857 ),
new CoordRec((float) 33.3333, (float) 4.7619 ),
- new CoordRec((float) 42.8571, (float) 0 ),
- new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 42.8571, 0 ),
+ new CoordRec((float) 61.9047, 0 ),
new CoordRec((float) 71.4286, (float) 4.7619 ),
new CoordRec((float) 80.9524, (float) 14.2857 ),
new CoordRec((float) 85.7143, (float) 23.8095 ),
@@ -1160,8 +1160,8 @@ static final CoordRec char79_stroke0[] = {
new CoordRec((float) 85.7143, (float) 76.1905 ),
new CoordRec((float) 80.9524, (float) 85.7143 ),
new CoordRec((float) 71.4286, (float) 95.2381 ),
- new CoordRec((float) 61.9047, (float) 100 ),
- new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 61.9047, 100 ),
+ new CoordRec((float) 42.8571, 100 ),
};
static final StrokeRec char79[] = {
@@ -1171,13 +1171,13 @@ static final StrokeRec char79[] = {
/* char: 80 'P' */
static final CoordRec char80_stroke0[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 19.0476, (float) 0 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 19.0476, 0 ),
};
static final CoordRec char80_stroke1[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 61.9047, 100 ),
new CoordRec((float) 76.1905, (float) 95.2381 ),
new CoordRec((float) 80.9524, (float) 90.4762 ),
new CoordRec((float) 85.7143, (float) 80.9524 ),
@@ -1196,7 +1196,7 @@ static final StrokeRec char80[] = {
/* char: 81 'Q' */
static final CoordRec char81_stroke0[] = {
- new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 42.8571, 100 ),
new CoordRec((float) 33.3333, (float) 95.2381 ),
new CoordRec((float) 23.8095, (float) 85.7143 ),
new CoordRec((float) 19.0476, (float) 76.1905 ),
@@ -1205,8 +1205,8 @@ static final CoordRec char81_stroke0[] = {
new CoordRec((float) 19.0476, (float) 23.8095 ),
new CoordRec((float) 23.8095, (float) 14.2857 ),
new CoordRec((float) 33.3333, (float) 4.7619 ),
- new CoordRec((float) 42.8571, (float) 0 ),
- new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 42.8571, 0 ),
+ new CoordRec((float) 61.9047, 0 ),
new CoordRec((float) 71.4286, (float) 4.7619 ),
new CoordRec((float) 80.9524, (float) 14.2857 ),
new CoordRec((float) 85.7143, (float) 23.8095 ),
@@ -1215,8 +1215,8 @@ static final CoordRec char81_stroke0[] = {
new CoordRec((float) 85.7143, (float) 76.1905 ),
new CoordRec((float) 80.9524, (float) 85.7143 ),
new CoordRec((float) 71.4286, (float) 95.2381 ),
- new CoordRec((float) 61.9047, (float) 100 ),
- new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 61.9047, 100 ),
+ new CoordRec((float) 42.8571, 100 ),
};
static final CoordRec char81_stroke1[] = {
@@ -1232,13 +1232,13 @@ static final StrokeRec char81[] = {
/* char: 82 'R' */
static final CoordRec char82_stroke0[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 19.0476, (float) 0 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 19.0476, 0 ),
};
static final CoordRec char82_stroke1[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 61.9047, 100 ),
new CoordRec((float) 76.1905, (float) 95.2381 ),
new CoordRec((float) 80.9524, (float) 90.4762 ),
new CoordRec((float) 85.7143, (float) 80.9524 ),
@@ -1251,7 +1251,7 @@ static final CoordRec char82_stroke1[] = {
static final CoordRec char82_stroke2[] = {
new CoordRec((float) 52.3809, (float) 52.381 ),
- new CoordRec((float) 85.7143, (float) 0 ),
+ new CoordRec((float) 85.7143, 0 ),
};
static final StrokeRec char82[] = {
@@ -1265,8 +1265,8 @@ static final StrokeRec char82[] = {
static final CoordRec char83_stroke0[] = {
new CoordRec((float) 85.7143, (float) 85.7143 ),
new CoordRec((float) 76.1905, (float) 95.2381 ),
- new CoordRec((float) 61.9047, (float) 100 ),
- new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 61.9047, 100 ),
+ new CoordRec((float) 42.8571, 100 ),
new CoordRec((float) 28.5714, (float) 95.2381 ),
new CoordRec((float) 19.0476, (float) 85.7143 ),
new CoordRec((float) 19.0476, (float) 76.1905 ),
@@ -1279,8 +1279,8 @@ static final CoordRec char83_stroke0[] = {
new CoordRec((float) 85.7143, (float) 28.5714 ),
new CoordRec((float) 85.7143, (float) 14.2857 ),
new CoordRec((float) 76.1905, (float) 4.7619 ),
- new CoordRec((float) 61.9047, (float) 0 ),
- new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 61.9047, 0 ),
+ new CoordRec((float) 42.8571, 0 ),
new CoordRec((float) 28.5714, (float) 4.7619 ),
new CoordRec((float) 19.0476, (float) 14.2857 ),
};
@@ -1292,13 +1292,13 @@ static final StrokeRec char83[] = {
/* char: 84 'T' */
static final CoordRec char84_stroke0[] = {
- new CoordRec((float) 52.3809, (float) 100 ),
- new CoordRec((float) 52.3809, (float) 0 ),
+ new CoordRec((float) 52.3809, 100 ),
+ new CoordRec((float) 52.3809, 0 ),
};
static final CoordRec char84_stroke1[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 85.7143, (float) 100 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 85.7143, 100 ),
};
static final StrokeRec char84[] = {
@@ -1309,16 +1309,16 @@ static final StrokeRec char84[] = {
/* char: 85 'U' */
static final CoordRec char85_stroke0[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 19.0476, 100 ),
new CoordRec((float) 19.0476, (float) 28.5714 ),
new CoordRec((float) 23.8095, (float) 14.2857 ),
new CoordRec((float) 33.3333, (float) 4.7619 ),
- new CoordRec((float) 47.619, (float) 0 ),
- new CoordRec((float) 57.1428, (float) 0 ),
+ new CoordRec((float) 47.619, 0 ),
+ new CoordRec((float) 57.1428, 0 ),
new CoordRec((float) 71.4286, (float) 4.7619 ),
new CoordRec((float) 80.9524, (float) 14.2857 ),
new CoordRec((float) 85.7143, (float) 28.5714 ),
- new CoordRec((float) 85.7143, (float) 100 ),
+ new CoordRec((float) 85.7143, 100 ),
};
static final StrokeRec char85[] = {
@@ -1328,13 +1328,13 @@ static final StrokeRec char85[] = {
/* char: 86 'V' */
static final CoordRec char86_stroke0[] = {
- new CoordRec((float) 14.2857, (float) 100 ),
- new CoordRec((float) 52.3809, (float) 0 ),
+ new CoordRec((float) 14.2857, 100 ),
+ new CoordRec((float) 52.3809, 0 ),
};
static final CoordRec char86_stroke1[] = {
- new CoordRec((float) 90.4762, (float) 100 ),
- new CoordRec((float) 52.3809, (float) 0 ),
+ new CoordRec((float) 90.4762, 100 ),
+ new CoordRec((float) 52.3809, 0 ),
};
static final StrokeRec char86[] = {
@@ -1345,23 +1345,23 @@ static final StrokeRec char86[] = {
/* char: 87 'W' */
static final CoordRec char87_stroke0[] = {
- new CoordRec((float) 4.7619, (float) 100 ),
- new CoordRec((float) 28.5714, (float) 0 ),
+ new CoordRec((float) 4.7619, 100 ),
+ new CoordRec((float) 28.5714, 0 ),
};
static final CoordRec char87_stroke1[] = {
- new CoordRec((float) 52.3809, (float) 100 ),
- new CoordRec((float) 28.5714, (float) 0 ),
+ new CoordRec((float) 52.3809, 100 ),
+ new CoordRec((float) 28.5714, 0 ),
};
static final CoordRec char87_stroke2[] = {
- new CoordRec((float) 52.3809, (float) 100 ),
- new CoordRec((float) 76.1905, (float) 0 ),
+ new CoordRec((float) 52.3809, 100 ),
+ new CoordRec((float) 76.1905, 0 ),
};
static final CoordRec char87_stroke3[] = {
- new CoordRec((float) 100, (float) 100 ),
- new CoordRec((float) 76.1905, (float) 0 ),
+ new CoordRec(100, 100 ),
+ new CoordRec((float) 76.1905, 0 ),
};
static final StrokeRec char87[] = {
@@ -1374,13 +1374,13 @@ static final StrokeRec char87[] = {
/* char: 88 'X' */
static final CoordRec char88_stroke0[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 85.7143, (float) 0 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 85.7143, 0 ),
};
static final CoordRec char88_stroke1[] = {
- new CoordRec((float) 85.7143, (float) 100 ),
- new CoordRec((float) 19.0476, (float) 0 ),
+ new CoordRec((float) 85.7143, 100 ),
+ new CoordRec((float) 19.0476, 0 ),
};
static final StrokeRec char88[] = {
@@ -1391,13 +1391,13 @@ static final StrokeRec char88[] = {
/* char: 89 'Y' */
static final CoordRec char89_stroke0[] = {
- new CoordRec((float) 14.2857, (float) 100 ),
+ new CoordRec((float) 14.2857, 100 ),
new CoordRec((float) 52.3809, (float) 52.381 ),
- new CoordRec((float) 52.3809, (float) 0 ),
+ new CoordRec((float) 52.3809, 0 ),
};
static final CoordRec char89_stroke1[] = {
- new CoordRec((float) 90.4762, (float) 100 ),
+ new CoordRec((float) 90.4762, 100 ),
new CoordRec((float) 52.3809, (float) 52.381 ),
};
@@ -1409,18 +1409,18 @@ static final StrokeRec char89[] = {
/* char: 90 'Z' */
static final CoordRec char90_stroke0[] = {
- new CoordRec((float) 85.7143, (float) 100 ),
- new CoordRec((float) 19.0476, (float) 0 ),
+ new CoordRec((float) 85.7143, 100 ),
+ new CoordRec((float) 19.0476, 0 ),
};
static final CoordRec char90_stroke1[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
- new CoordRec((float) 85.7143, (float) 100 ),
+ new CoordRec((float) 19.0476, 100 ),
+ new CoordRec((float) 85.7143, 100 ),
};
static final CoordRec char90_stroke2[] = {
- new CoordRec((float) 19.0476, (float) 0 ),
- new CoordRec((float) 85.7143, (float) 0 ),
+ new CoordRec((float) 19.0476, 0 ),
+ new CoordRec((float) 85.7143, 0 ),
};
static final StrokeRec char90[] = {
@@ -1461,7 +1461,7 @@ static final StrokeRec char91[] = {
/* char: 92 '\' */
static final CoordRec char92_stroke0[] = {
- new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 19.0476, 100 ),
new CoordRec((float) 85.7143, (float) -14.2857 ),
};
@@ -1518,11 +1518,11 @@ static final StrokeRec char94[] = {
/* char: 95 '_' */
static final CoordRec char95_stroke0[] = {
- new CoordRec((float) 0, (float) -33.3333 ),
+ new CoordRec(0, (float) -33.3333 ),
new CoordRec((float) 104.762, (float) -33.3333 ),
new CoordRec((float) 104.762, (float) -28.5714 ),
- new CoordRec((float) 0, (float) -28.5714 ),
- new CoordRec((float) 0, (float) -33.3333 ),
+ new CoordRec(0, (float) -28.5714 ),
+ new CoordRec(0, (float) -33.3333 ),
};
static final StrokeRec char95[] = {
@@ -1532,12 +1532,12 @@ static final StrokeRec char95[] = {
/* char: 96 '`' */
static final CoordRec char96_stroke0[] = {
- new CoordRec((float) 42.8572, (float) 100 ),
+ new CoordRec((float) 42.8572, 100 ),
new CoordRec((float) 66.6667, (float) 71.4286 ),
};
static final CoordRec char96_stroke1[] = {
- new CoordRec((float) 42.8572, (float) 100 ),
+ new CoordRec((float) 42.8572, 100 ),
new CoordRec((float) 38.0953, (float) 95.2381 ),
new CoordRec((float) 66.6667, (float) 71.4286 ),
};
@@ -1551,7 +1551,7 @@ static final StrokeRec char96[] = {
static final CoordRec char97_stroke0[] = {
new CoordRec((float) 80.9524, (float) 66.6667 ),
- new CoordRec((float) 80.9524, (float) 0 ),
+ new CoordRec((float) 80.9524, 0 ),
};
static final CoordRec char97_stroke1[] = {
@@ -1565,8 +1565,8 @@ static final CoordRec char97_stroke1[] = {
new CoordRec((float) 23.8095, (float) 28.5714 ),
new CoordRec((float) 28.5714, (float) 14.2857 ),
new CoordRec((float) 38.0952, (float) 4.7619 ),
- new CoordRec((float) 47.619, (float) 0 ),
- new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 47.619, 0 ),
+ new CoordRec((float) 61.9047, 0 ),
new CoordRec((float) 71.4285, (float) 4.7619 ),
new CoordRec((float) 80.9524, (float) 14.2857 ),
};
@@ -1579,8 +1579,8 @@ static final StrokeRec char97[] = {
/* char: 98 'b' */
static final CoordRec char98_stroke0[] = {
- new CoordRec((float) 23.8095, (float) 100 ),
- new CoordRec((float) 23.8095, (float) 0 ),
+ new CoordRec((float) 23.8095, 100 ),
+ new CoordRec((float) 23.8095, 0 ),
};
static final CoordRec char98_stroke1[] = {
@@ -1594,8 +1594,8 @@ static final CoordRec char98_stroke1[] = {
new CoordRec((float) 80.9524, (float) 28.5714 ),
new CoordRec((float) 76.1905, (float) 14.2857 ),
new CoordRec((float) 66.6666, (float) 4.7619 ),
- new CoordRec((float) 57.1428, (float) 0 ),
- new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 57.1428, 0 ),
+ new CoordRec((float) 42.8571, 0 ),
new CoordRec((float) 33.3333, (float) 4.7619 ),
new CoordRec((float) 23.8095, (float) 14.2857 ),
};
@@ -1618,8 +1618,8 @@ static final CoordRec char99_stroke0[] = {
new CoordRec((float) 23.8095, (float) 28.5714 ),
new CoordRec((float) 28.5714, (float) 14.2857 ),
new CoordRec((float) 38.0952, (float) 4.7619 ),
- new CoordRec((float) 47.619, (float) 0 ),
- new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 47.619, 0 ),
+ new CoordRec((float) 61.9047, 0 ),
new CoordRec((float) 71.4285, (float) 4.7619 ),
new CoordRec((float) 80.9524, (float) 14.2857 ),
};
@@ -1631,8 +1631,8 @@ static final StrokeRec char99[] = {
/* char: 100 'd' */
static final CoordRec char100_stroke0[] = {
- new CoordRec((float) 80.9524, (float) 100 ),
- new CoordRec((float) 80.9524, (float) 0 ),
+ new CoordRec((float) 80.9524, 100 ),
+ new CoordRec((float) 80.9524, 0 ),
};
static final CoordRec char100_stroke1[] = {
@@ -1646,8 +1646,8 @@ static final CoordRec char100_stroke1[] = {
new CoordRec((float) 23.8095, (float) 28.5714 ),
new CoordRec((float) 28.5714, (float) 14.2857 ),
new CoordRec((float) 38.0952, (float) 4.7619 ),
- new CoordRec((float) 47.619, (float) 0 ),
- new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 47.619, 0 ),
+ new CoordRec((float) 61.9047, 0 ),
new CoordRec((float) 71.4285, (float) 4.7619 ),
new CoordRec((float) 80.9524, (float) 14.2857 ),
};
@@ -1673,8 +1673,8 @@ static final CoordRec char101_stroke0[] = {
new CoordRec((float) 23.8095, (float) 28.5714 ),
new CoordRec((float) 28.5714, (float) 14.2857 ),
new CoordRec((float) 38.0952, (float) 4.7619 ),
- new CoordRec((float) 47.619, (float) 0 ),
- new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 47.619, 0 ),
+ new CoordRec((float) 61.9047, 0 ),
new CoordRec((float) 71.4285, (float) 4.7619 ),
new CoordRec((float) 80.9524, (float) 14.2857 ),
};
@@ -1686,11 +1686,11 @@ static final StrokeRec char101[] = {
/* char: 102 'f' */
static final CoordRec char102_stroke0[] = {
- new CoordRec((float) 71.4286, (float) 100 ),
- new CoordRec((float) 61.9048, (float) 100 ),
+ new CoordRec((float) 71.4286, 100 ),
+ new CoordRec((float) 61.9048, 100 ),
new CoordRec((float) 52.381, (float) 95.2381 ),
new CoordRec((float) 47.6191, (float) 80.9524 ),
- new CoordRec((float) 47.6191, (float) 0 ),
+ new CoordRec((float) 47.6191, 0 ),
};
static final CoordRec char102_stroke1[] = {
@@ -1726,8 +1726,8 @@ static final CoordRec char103_stroke1[] = {
new CoordRec((float) 23.8095, (float) 28.5714 ),
new CoordRec((float) 28.5714, (float) 14.2857 ),
new CoordRec((float) 38.0952, (float) 4.7619 ),
- new CoordRec((float) 47.619, (float) 0 ),
- new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 47.619, 0 ),
+ new CoordRec((float) 61.9047, 0 ),
new CoordRec((float) 71.4285, (float) 4.7619 ),
new CoordRec((float) 80.9524, (float) 14.2857 ),
};
@@ -1740,18 +1740,18 @@ static final StrokeRec char103[] = {
/* char: 104 'h' */
static final CoordRec char104_stroke0[] = {
- new CoordRec((float) 26.1905, (float) 100 ),
- new CoordRec((float) 26.1905, (float) 0 ),
+ new CoordRec((float) 26.1905, 100 ),
+ new CoordRec((float) 26.1905, 0 ),
};
static final CoordRec char104_stroke1[] = {
new CoordRec((float) 26.1905, (float) 47.619 ),
new CoordRec((float) 40.4762, (float) 61.9048 ),
- new CoordRec((float) 50, (float) 66.6667 ),
+ new CoordRec(50, (float) 66.6667 ),
new CoordRec((float) 64.2857, (float) 66.6667 ),
new CoordRec((float) 73.8095, (float) 61.9048 ),
new CoordRec((float) 78.5715, (float) 47.619 ),
- new CoordRec((float) 78.5715, (float) 0 ),
+ new CoordRec((float) 78.5715, 0 ),
};
static final StrokeRec char104[] = {
@@ -1762,16 +1762,16 @@ static final StrokeRec char104[] = {
/* char: 105 'i' */
static final CoordRec char105_stroke0[] = {
- new CoordRec((float) 47.6191, (float) 100 ),
+ new CoordRec((float) 47.6191, 100 ),
new CoordRec((float) 52.381, (float) 95.2381 ),
- new CoordRec((float) 57.1429, (float) 100 ),
+ new CoordRec((float) 57.1429, 100 ),
new CoordRec((float) 52.381, (float) 104.762 ),
- new CoordRec((float) 47.6191, (float) 100 ),
+ new CoordRec((float) 47.6191, 100 ),
};
static final CoordRec char105_stroke1[] = {
new CoordRec((float) 52.381, (float) 66.6667 ),
- new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 52.381, 0 ),
};
static final StrokeRec char105[] = {
@@ -1782,11 +1782,11 @@ static final StrokeRec char105[] = {
/* char: 106 'j' */
static final CoordRec char106_stroke0[] = {
- new CoordRec((float) 57.1429, (float) 100 ),
+ new CoordRec((float) 57.1429, 100 ),
new CoordRec((float) 61.9048, (float) 95.2381 ),
- new CoordRec((float) 66.6667, (float) 100 ),
+ new CoordRec((float) 66.6667, 100 ),
new CoordRec((float) 61.9048, (float) 104.762 ),
- new CoordRec((float) 57.1429, (float) 100 ),
+ new CoordRec((float) 57.1429, 100 ),
};
static final CoordRec char106_stroke1[] = {
@@ -1805,8 +1805,8 @@ static final StrokeRec char106[] = {
/* char: 107 'k' */
static final CoordRec char107_stroke0[] = {
- new CoordRec((float) 26.1905, (float) 100 ),
- new CoordRec((float) 26.1905, (float) 0 ),
+ new CoordRec((float) 26.1905, 100 ),
+ new CoordRec((float) 26.1905, 0 ),
};
static final CoordRec char107_stroke1[] = {
@@ -1816,7 +1816,7 @@ static final CoordRec char107_stroke1[] = {
static final CoordRec char107_stroke2[] = {
new CoordRec((float) 45.2381, (float) 38.0952 ),
- new CoordRec((float) 78.5715, (float) 0 ),
+ new CoordRec((float) 78.5715, 0 ),
};
static final StrokeRec char107[] = {
@@ -1828,8 +1828,8 @@ static final StrokeRec char107[] = {
/* char: 108 'l' */
static final CoordRec char108_stroke0[] = {
- new CoordRec((float) 52.381, (float) 100 ),
- new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 52.381, 100 ),
+ new CoordRec((float) 52.381, 0 ),
};
static final StrokeRec char108[] = {
@@ -1839,18 +1839,18 @@ static final StrokeRec char108[] = {
/* char: 109 'm' */
static final CoordRec char109_stroke0[] = {
- new CoordRec((float) 0, (float) 66.6667 ),
- new CoordRec((float) 0, (float) 0 ),
+ new CoordRec(0, (float) 66.6667 ),
+ new CoordRec(0, 0 ),
};
static final CoordRec char109_stroke1[] = {
- new CoordRec((float) 0, (float) 47.619 ),
+ new CoordRec(0, (float) 47.619 ),
new CoordRec((float) 14.2857, (float) 61.9048 ),
new CoordRec((float) 23.8095, (float) 66.6667 ),
new CoordRec((float) 38.0952, (float) 66.6667 ),
new CoordRec((float) 47.619, (float) 61.9048 ),
new CoordRec((float) 52.381, (float) 47.619 ),
- new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 52.381, 0 ),
};
static final CoordRec char109_stroke2[] = {
@@ -1858,9 +1858,9 @@ static final CoordRec char109_stroke2[] = {
new CoordRec((float) 66.6667, (float) 61.9048 ),
new CoordRec((float) 76.1905, (float) 66.6667 ),
new CoordRec((float) 90.4762, (float) 66.6667 ),
- new CoordRec((float) 100, (float) 61.9048 ),
+ new CoordRec(100, (float) 61.9048 ),
new CoordRec((float) 104.762, (float) 47.619 ),
- new CoordRec((float) 104.762, (float) 0 ),
+ new CoordRec((float) 104.762, 0 ),
};
static final StrokeRec char109[] = {
@@ -1873,17 +1873,17 @@ static final StrokeRec char109[] = {
static final CoordRec char110_stroke0[] = {
new CoordRec((float) 26.1905, (float) 66.6667 ),
- new CoordRec((float) 26.1905, (float) 0 ),
+ new CoordRec((float) 26.1905, 0 ),
};
static final CoordRec char110_stroke1[] = {
new CoordRec((float) 26.1905, (float) 47.619 ),
new CoordRec((float) 40.4762, (float) 61.9048 ),
- new CoordRec((float) 50, (float) 66.6667 ),
+ new CoordRec(50, (float) 66.6667 ),
new CoordRec((float) 64.2857, (float) 66.6667 ),
new CoordRec((float) 73.8095, (float) 61.9048 ),
new CoordRec((float) 78.5715, (float) 47.619 ),
- new CoordRec((float) 78.5715, (float) 0 ),
+ new CoordRec((float) 78.5715, 0 ),
};
static final StrokeRec char110[] = {
@@ -1901,8 +1901,8 @@ static final CoordRec char111_stroke0[] = {
new CoordRec((float) 21.4286, (float) 28.5714 ),
new CoordRec((float) 26.1905, (float) 14.2857 ),
new CoordRec((float) 35.7143, (float) 4.7619 ),
- new CoordRec((float) 45.2381, (float) 0 ),
- new CoordRec((float) 59.5238, (float) 0 ),
+ new CoordRec((float) 45.2381, 0 ),
+ new CoordRec((float) 59.5238, 0 ),
new CoordRec((float) 69.0476, (float) 4.7619 ),
new CoordRec((float) 78.5714, (float) 14.2857 ),
new CoordRec((float) 83.3334, (float) 28.5714 ),
@@ -1935,8 +1935,8 @@ static final CoordRec char112_stroke1[] = {
new CoordRec((float) 80.9524, (float) 28.5714 ),
new CoordRec((float) 76.1905, (float) 14.2857 ),
new CoordRec((float) 66.6666, (float) 4.7619 ),
- new CoordRec((float) 57.1428, (float) 0 ),
- new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 57.1428, 0 ),
+ new CoordRec((float) 42.8571, 0 ),
new CoordRec((float) 33.3333, (float) 4.7619 ),
new CoordRec((float) 23.8095, (float) 14.2857 ),
};
@@ -1964,8 +1964,8 @@ static final CoordRec char113_stroke1[] = {
new CoordRec((float) 23.8095, (float) 28.5714 ),
new CoordRec((float) 28.5714, (float) 14.2857 ),
new CoordRec((float) 38.0952, (float) 4.7619 ),
- new CoordRec((float) 47.619, (float) 0 ),
- new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 47.619, 0 ),
+ new CoordRec((float) 61.9047, 0 ),
new CoordRec((float) 71.4285, (float) 4.7619 ),
new CoordRec((float) 80.9524, (float) 14.2857 ),
};
@@ -1979,7 +1979,7 @@ static final StrokeRec char113[] = {
static final CoordRec char114_stroke0[] = {
new CoordRec((float) 33.3334, (float) 66.6667 ),
- new CoordRec((float) 33.3334, (float) 0 ),
+ new CoordRec((float) 33.3334, 0 ),
};
static final CoordRec char114_stroke1[] = {
@@ -2011,8 +2011,8 @@ static final CoordRec char115_stroke0[] = {
new CoordRec((float) 78.5715, (float) 19.0476 ),
new CoordRec((float) 78.5715, (float) 14.2857 ),
new CoordRec((float) 73.8095, (float) 4.7619 ),
- new CoordRec((float) 59.5238, (float) 0 ),
- new CoordRec((float) 45.2381, (float) 0 ),
+ new CoordRec((float) 59.5238, 0 ),
+ new CoordRec((float) 45.2381, 0 ),
new CoordRec((float) 30.9524, (float) 4.7619 ),
new CoordRec((float) 26.1905, (float) 14.2857 ),
};
@@ -2024,11 +2024,11 @@ static final StrokeRec char115[] = {
/* char: 116 't' */
static final CoordRec char116_stroke0[] = {
- new CoordRec((float) 47.6191, (float) 100 ),
+ new CoordRec((float) 47.6191, 100 ),
new CoordRec((float) 47.6191, (float) 19.0476 ),
new CoordRec((float) 52.381, (float) 4.7619 ),
- new CoordRec((float) 61.9048, (float) 0 ),
- new CoordRec((float) 71.4286, (float) 0 ),
+ new CoordRec((float) 61.9048, 0 ),
+ new CoordRec((float) 71.4286, 0 ),
};
static final CoordRec char116_stroke1[] = {
@@ -2047,15 +2047,15 @@ static final CoordRec char117_stroke0[] = {
new CoordRec((float) 26.1905, (float) 66.6667 ),
new CoordRec((float) 26.1905, (float) 19.0476 ),
new CoordRec((float) 30.9524, (float) 4.7619 ),
- new CoordRec((float) 40.4762, (float) 0 ),
- new CoordRec((float) 54.7619, (float) 0 ),
+ new CoordRec((float) 40.4762, 0 ),
+ new CoordRec((float) 54.7619, 0 ),
new CoordRec((float) 64.2857, (float) 4.7619 ),
new CoordRec((float) 78.5715, (float) 19.0476 ),
};
static final CoordRec char117_stroke1[] = {
new CoordRec((float) 78.5715, (float) 66.6667 ),
- new CoordRec((float) 78.5715, (float) 0 ),
+ new CoordRec((float) 78.5715, 0 ),
};
static final StrokeRec char117[] = {
@@ -2067,12 +2067,12 @@ static final StrokeRec char117[] = {
static final CoordRec char118_stroke0[] = {
new CoordRec((float) 23.8095, (float) 66.6667 ),
- new CoordRec((float) 52.3809, (float) 0 ),
+ new CoordRec((float) 52.3809, 0 ),
};
static final CoordRec char118_stroke1[] = {
new CoordRec((float) 80.9524, (float) 66.6667 ),
- new CoordRec((float) 52.3809, (float) 0 ),
+ new CoordRec((float) 52.3809, 0 ),
};
static final StrokeRec char118[] = {
@@ -2084,22 +2084,22 @@ static final StrokeRec char118[] = {
static final CoordRec char119_stroke0[] = {
new CoordRec((float) 14.2857, (float) 66.6667 ),
- new CoordRec((float) 33.3333, (float) 0 ),
+ new CoordRec((float) 33.3333, 0 ),
};
static final CoordRec char119_stroke1[] = {
new CoordRec((float) 52.3809, (float) 66.6667 ),
- new CoordRec((float) 33.3333, (float) 0 ),
+ new CoordRec((float) 33.3333, 0 ),
};
static final CoordRec char119_stroke2[] = {
new CoordRec((float) 52.3809, (float) 66.6667 ),
- new CoordRec((float) 71.4286, (float) 0 ),
+ new CoordRec((float) 71.4286, 0 ),
};
static final CoordRec char119_stroke3[] = {
new CoordRec((float) 90.4762, (float) 66.6667 ),
- new CoordRec((float) 71.4286, (float) 0 ),
+ new CoordRec((float) 71.4286, 0 ),
};
static final StrokeRec char119[] = {
@@ -2113,12 +2113,12 @@ static final StrokeRec char119[] = {
static final CoordRec char120_stroke0[] = {
new CoordRec((float) 26.1905, (float) 66.6667 ),
- new CoordRec((float) 78.5715, (float) 0 ),
+ new CoordRec((float) 78.5715, 0 ),
};
static final CoordRec char120_stroke1[] = {
new CoordRec((float) 78.5715, (float) 66.6667 ),
- new CoordRec((float) 26.1905, (float) 0 ),
+ new CoordRec((float) 26.1905, 0 ),
};
static final StrokeRec char120[] = {
@@ -2130,12 +2130,12 @@ static final StrokeRec char120[] = {
static final CoordRec char121_stroke0[] = {
new CoordRec((float) 26.1905, (float) 66.6667 ),
- new CoordRec((float) 54.7619, (float) 0 ),
+ new CoordRec((float) 54.7619, 0 ),
};
static final CoordRec char121_stroke1[] = {
new CoordRec((float) 83.3334, (float) 66.6667 ),
- new CoordRec((float) 54.7619, (float) 0 ),
+ new CoordRec((float) 54.7619, 0 ),
new CoordRec((float) 45.2381, (float) -19.0476 ),
new CoordRec((float) 35.7143, (float) -28.5714 ),
new CoordRec((float) 26.1905, (float) -33.3333 ),
@@ -2151,7 +2151,7 @@ static final StrokeRec char121[] = {
static final CoordRec char122_stroke0[] = {
new CoordRec((float) 78.5715, (float) 66.6667 ),
- new CoordRec((float) 26.1905, (float) 0 ),
+ new CoordRec((float) 26.1905, 0 ),
};
static final CoordRec char122_stroke1[] = {
@@ -2160,8 +2160,8 @@ static final CoordRec char122_stroke1[] = {
};
static final CoordRec char122_stroke2[] = {
- new CoordRec((float) 26.1905, (float) 0 ),
- new CoordRec((float) 78.5715, (float) 0 ),
+ new CoordRec((float) 26.1905, 0 ),
+ new CoordRec((float) 78.5715, 0 ),
};
static final StrokeRec char122[] = {
@@ -2175,20 +2175,20 @@ static final StrokeRec char122[] = {
static final CoordRec char123_stroke0[] = {
new CoordRec((float) 64.2857, (float) 119.048 ),
new CoordRec((float) 54.7619, (float) 114.286 ),
- new CoordRec((float) 50, (float) 109.524 ),
- new CoordRec((float) 45.2381, (float) 100 ),
+ new CoordRec(50, (float) 109.524 ),
+ new CoordRec((float) 45.2381, 100 ),
new CoordRec((float) 45.2381, (float) 90.4762 ),
- new CoordRec((float) 50, (float) 80.9524 ),
+ new CoordRec(50, (float) 80.9524 ),
new CoordRec((float) 54.7619, (float) 76.1905 ),
new CoordRec((float) 59.5238, (float) 66.6667 ),
new CoordRec((float) 59.5238, (float) 57.1429 ),
- new CoordRec((float) 50, (float) 47.619 ),
+ new CoordRec(50, (float) 47.619 ),
};
static final CoordRec char123_stroke1[] = {
new CoordRec((float) 54.7619, (float) 114.286 ),
- new CoordRec((float) 50, (float) 104.762 ),
- new CoordRec((float) 50, (float) 95.2381 ),
+ new CoordRec(50, (float) 104.762 ),
+ new CoordRec(50, (float) 95.2381 ),
new CoordRec((float) 54.7619, (float) 85.7143 ),
new CoordRec((float) 59.5238, (float) 80.9524 ),
new CoordRec((float) 64.2857, (float) 71.4286 ),
@@ -2199,21 +2199,21 @@ static final CoordRec char123_stroke1[] = {
new CoordRec((float) 64.2857, (float) 23.8095 ),
new CoordRec((float) 64.2857, (float) 14.2857 ),
new CoordRec((float) 59.5238, (float) 4.7619 ),
- new CoordRec((float) 54.7619, (float) 0 ),
- new CoordRec((float) 50, (float) -9.5238 ),
- new CoordRec((float) 50, (float) -19.0476 ),
+ new CoordRec((float) 54.7619, 0 ),
+ new CoordRec(50, (float) -9.5238 ),
+ new CoordRec(50, (float) -19.0476 ),
new CoordRec((float) 54.7619, (float) -28.5714 ),
};
static final CoordRec char123_stroke2[] = {
- new CoordRec((float) 50, (float) 38.0952 ),
+ new CoordRec(50, (float) 38.0952 ),
new CoordRec((float) 59.5238, (float) 28.5714 ),
new CoordRec((float) 59.5238, (float) 19.0476 ),
new CoordRec((float) 54.7619, (float) 9.5238 ),
- new CoordRec((float) 50, (float) 4.7619 ),
+ new CoordRec(50, (float) 4.7619 ),
new CoordRec((float) 45.2381, (float) -4.7619 ),
new CoordRec((float) 45.2381, (float) -14.2857 ),
- new CoordRec((float) 50, (float) -23.8095 ),
+ new CoordRec(50, (float) -23.8095 ),
new CoordRec((float) 54.7619, (float) -28.5714 ),
new CoordRec((float) 64.2857, (float) -33.3333 ),
};
@@ -2239,22 +2239,22 @@ static final StrokeRec char124[] = {
static final CoordRec char125_stroke0[] = {
new CoordRec((float) 40.4762, (float) 119.048 ),
- new CoordRec((float) 50, (float) 114.286 ),
+ new CoordRec(50, (float) 114.286 ),
new CoordRec((float) 54.7619, (float) 109.524 ),
- new CoordRec((float) 59.5238, (float) 100 ),
+ new CoordRec((float) 59.5238, 100 ),
new CoordRec((float) 59.5238, (float) 90.4762 ),
new CoordRec((float) 54.7619, (float) 80.9524 ),
- new CoordRec((float) 50, (float) 76.1905 ),
+ new CoordRec(50, (float) 76.1905 ),
new CoordRec((float) 45.2381, (float) 66.6667 ),
new CoordRec((float) 45.2381, (float) 57.1429 ),
new CoordRec((float) 54.7619, (float) 47.619 ),
};
static final CoordRec char125_stroke1[] = {
- new CoordRec((float) 50, (float) 114.286 ),
+ new CoordRec(50, (float) 114.286 ),
new CoordRec((float) 54.7619, (float) 104.762 ),
new CoordRec((float) 54.7619, (float) 95.2381 ),
- new CoordRec((float) 50, (float) 85.7143 ),
+ new CoordRec(50, (float) 85.7143 ),
new CoordRec((float) 45.2381, (float) 80.9524 ),
new CoordRec((float) 40.4762, (float) 71.4286 ),
new CoordRec((float) 40.4762, (float) 61.9048 ),
@@ -2264,22 +2264,22 @@ static final CoordRec char125_stroke1[] = {
new CoordRec((float) 40.4762, (float) 23.8095 ),
new CoordRec((float) 40.4762, (float) 14.2857 ),
new CoordRec((float) 45.2381, (float) 4.7619 ),
- new CoordRec((float) 50, (float) 0 ),
+ new CoordRec(50, 0 ),
new CoordRec((float) 54.7619, (float) -9.5238 ),
new CoordRec((float) 54.7619, (float) -19.0476 ),
- new CoordRec((float) 50, (float) -28.5714 ),
+ new CoordRec(50, (float) -28.5714 ),
};
static final CoordRec char125_stroke2[] = {
new CoordRec((float) 54.7619, (float) 38.0952 ),
new CoordRec((float) 45.2381, (float) 28.5714 ),
new CoordRec((float) 45.2381, (float) 19.0476 ),
- new CoordRec((float) 50, (float) 9.5238 ),
+ new CoordRec(50, (float) 9.5238 ),
new CoordRec((float) 54.7619, (float) 4.7619 ),
new CoordRec((float) 59.5238, (float) -4.7619 ),
new CoordRec((float) 59.5238, (float) -14.2857 ),
new CoordRec((float) 54.7619, (float) -23.8095 ),
- new CoordRec((float) 50, (float) -28.5714 ),
+ new CoordRec(50, (float) -28.5714 ),
new CoordRec((float) 40.4762, (float) -33.3333 ),
};
@@ -2327,7 +2327,7 @@ static final StrokeRec char126[] = {
/* char: 127 */
static final CoordRec char127_stroke0[] = {
- new CoordRec((float) 71.4286, (float) 100 ),
+ new CoordRec((float) 71.4286, 100 ),
new CoordRec((float) 33.3333, (float) -33.3333 ),
};
@@ -2339,8 +2339,8 @@ static final CoordRec char127_stroke1[] = {
new CoordRec((float) 19.0476, (float) 23.8095 ),
new CoordRec((float) 23.8095, (float) 14.2857 ),
new CoordRec((float) 33.3333, (float) 4.7619 ),
- new CoordRec((float) 47.619, (float) 0 ),
- new CoordRec((float) 57.1428, (float) 0 ),
+ new CoordRec((float) 47.619, 0 ),
+ new CoordRec((float) 57.1428, 0 ),
new CoordRec((float) 71.4286, (float) 4.7619 ),
new CoordRec((float) 80.9524, (float) 14.2857 ),
new CoordRec((float) 85.7143, (float) 28.5714 ),
@@ -2357,38 +2357,38 @@ static final StrokeRec char127[] = {
};
static final StrokeCharRec chars[] = {
- new StrokeCharRec(0, /* char0 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char1 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char2 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char3 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char4 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char5 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char6 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char7 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char8 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char9 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char10 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char11 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char12 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char13 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char14 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char15 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char16 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char17 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char18 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char19 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char20 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char21 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char22 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char23 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char24 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char25 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char26 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char27 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char28 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char29 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char30 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec(0, /* char31 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char0 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char1 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char2 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char3 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char4 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char5 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char6 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char7 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char8 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char9 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char10 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char11 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char12 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char13 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char14 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char15 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char16 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char17 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char18 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char19 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char20 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char21 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char22 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char23 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char24 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char25 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char26 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char27 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char28 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char29 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char30 */ null, 0, 0 ),
+ new StrokeCharRec(0, /* char31 */ null, 0, 0 ),
new StrokeCharRec(0, /* char32 */ null, (float) 52.381, (float) 104.762 ),
new StrokeCharRec(2, char33, (float) 52.381, (float) 104.762 ),
new StrokeCharRec(2, char34, (float) 52.381, (float) 104.762 ),
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java
index cf51ddd3c..5b614c64e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java
@@ -46,14 +46,14 @@ class GLUTStrokeRoman {
/* char: 33 '!' */
static final CoordRec char33_stroke0[] = {
- new CoordRec((float) 13.3819, (float) 100),
+ new CoordRec((float) 13.3819, 100),
new CoordRec((float) 13.3819, (float) 33.3333),
};
static final CoordRec char33_stroke1[] = {
new CoordRec((float) 13.3819, (float) 9.5238),
new CoordRec((float) 8.62, (float) 4.7619),
- new CoordRec((float) 13.3819, (float) 0),
+ new CoordRec((float) 13.3819, 0),
new CoordRec((float) 18.1438, (float) 4.7619),
new CoordRec((float) 13.3819, (float) 9.5238),
};
@@ -66,12 +66,12 @@ static final StrokeRec char33[] = {
/* char: 34 '"' */
static final CoordRec char34_stroke0[] = {
- new CoordRec((float) 4.02, (float) 100),
+ new CoordRec((float) 4.02, 100),
new CoordRec((float) 4.02, (float) 66.6667),
};
static final CoordRec char34_stroke1[] = {
- new CoordRec((float) 42.1152, (float) 100),
+ new CoordRec((float) 42.1152, 100),
new CoordRec((float) 42.1152, (float) 66.6667),
};
@@ -124,8 +124,8 @@ static final CoordRec char36_stroke1[] = {
static final CoordRec char36_stroke2[] = {
new CoordRec((float) 71.4867, (float) 85.7143),
new CoordRec((float) 61.9629, (float) 95.2381),
- new CoordRec((float) 47.6771, (float) 100),
- new CoordRec((float) 28.6295, (float) 100),
+ new CoordRec((float) 47.6771, 100),
+ new CoordRec((float) 28.6295, 100),
new CoordRec((float) 14.3438, (float) 95.2381),
new CoordRec((float) 4.82, (float) 85.7143),
new CoordRec((float) 4.82, (float) 76.1905),
@@ -138,8 +138,8 @@ static final CoordRec char36_stroke2[] = {
new CoordRec((float) 71.4867, (float) 28.5714),
new CoordRec((float) 71.4867, (float) 14.2857),
new CoordRec((float) 61.9629, (float) 4.7619),
- new CoordRec((float) 47.6771, (float) 0),
- new CoordRec((float) 28.6295, (float) 0),
+ new CoordRec((float) 47.6771, 0),
+ new CoordRec((float) 28.6295, 0),
new CoordRec((float) 14.3438, (float) 4.7619),
new CoordRec((float) 4.82, (float) 14.2857),
};
@@ -153,12 +153,12 @@ static final StrokeRec char36[] = {
/* char: 37 '%' */
static final CoordRec char37_stroke0[] = {
- new CoordRec((float) 92.0743, (float) 100),
- new CoordRec((float) 6.36, (float) 0),
+ new CoordRec((float) 92.0743, 100),
+ new CoordRec((float) 6.36, 0),
};
static final CoordRec char37_stroke1[] = {
- new CoordRec((float) 30.1695, (float) 100),
+ new CoordRec((float) 30.1695, 100),
new CoordRec((float) 39.6933, (float) 90.4762),
new CoordRec((float) 39.6933, (float) 80.9524),
new CoordRec((float) 34.9314, (float) 71.4286),
@@ -167,13 +167,13 @@ static final CoordRec char37_stroke1[] = {
new CoordRec((float) 6.36, (float) 76.1905),
new CoordRec((float) 6.36, (float) 85.7143),
new CoordRec((float) 11.1219, (float) 95.2381),
- new CoordRec((float) 20.6457, (float) 100),
- new CoordRec((float) 30.1695, (float) 100),
+ new CoordRec((float) 20.6457, 100),
+ new CoordRec((float) 30.1695, 100),
new CoordRec((float) 39.6933, (float) 95.2381),
new CoordRec((float) 53.979, (float) 90.4762),
new CoordRec((float) 68.2648, (float) 90.4762),
new CoordRec((float) 82.5505, (float) 95.2381),
- new CoordRec((float) 92.0743, (float) 100),
+ new CoordRec((float) 92.0743, 100),
};
static final CoordRec char37_stroke2[] = {
@@ -181,8 +181,8 @@ static final CoordRec char37_stroke2[] = {
new CoordRec((float) 63.5029, (float) 28.5714),
new CoordRec((float) 58.741, (float) 19.0476),
new CoordRec((float) 58.741, (float) 9.5238),
- new CoordRec((float) 68.2648, (float) 0),
- new CoordRec((float) 77.7886, (float) 0),
+ new CoordRec((float) 68.2648, 0),
+ new CoordRec((float) 77.7886, 0),
new CoordRec((float) 87.3124, (float) 4.7619),
new CoordRec((float) 92.0743, (float) 14.2857),
new CoordRec((float) 92.0743, (float) 23.8095),
@@ -208,8 +208,8 @@ static final CoordRec char38_stroke0[] = {
new CoordRec((float) 72.6467, (float) 28.5714),
new CoordRec((float) 63.1229, (float) 14.2857),
new CoordRec((float) 53.599, (float) 4.7619),
- new CoordRec((float) 44.0752, (float) 0),
- new CoordRec((float) 25.0276, (float) 0),
+ new CoordRec((float) 44.0752, 0),
+ new CoordRec((float) 25.0276, 0),
new CoordRec((float) 15.5038, (float) 4.7619),
new CoordRec((float) 10.7419, (float) 9.5238),
new CoordRec((float) 5.98, (float) 19.0476),
@@ -221,7 +221,7 @@ static final CoordRec char38_stroke0[] = {
new CoordRec((float) 58.361, (float) 76.1905),
new CoordRec((float) 58.361, (float) 85.7143),
new CoordRec((float) 53.599, (float) 95.2381),
- new CoordRec((float) 44.0752, (float) 100),
+ new CoordRec((float) 44.0752, 100),
new CoordRec((float) 34.5514, (float) 95.2381),
new CoordRec((float) 29.7895, (float) 85.7143),
new CoordRec((float) 29.7895, (float) 76.1905),
@@ -229,8 +229,8 @@ static final CoordRec char38_stroke0[] = {
new CoordRec((float) 44.0752, (float) 47.619),
new CoordRec((float) 67.8848, (float) 14.2857),
new CoordRec((float) 77.4086, (float) 4.7619),
- new CoordRec((float) 86.9324, (float) 0),
- new CoordRec((float) 96.4562, (float) 0),
+ new CoordRec((float) 86.9324, 0),
+ new CoordRec((float) 96.4562, 0),
new CoordRec((float) 101.218, (float) 4.7619),
new CoordRec((float) 101.218, (float) 9.5238),
};
@@ -242,7 +242,7 @@ static final StrokeRec char38[] = {
/* char: 39 ''' */
static final CoordRec char39_stroke0[] = {
- new CoordRec((float) 4.44, (float) 100),
+ new CoordRec((float) 4.44, 100),
new CoordRec((float) 4.44, (float) 66.6667),
};
@@ -315,7 +315,7 @@ static final StrokeRec char42[] = {
static final CoordRec char43_stroke0[] = {
new CoordRec((float) 48.8371, (float) 85.7143),
- new CoordRec((float) 48.8371, (float) 0),
+ new CoordRec((float) 48.8371, 0),
};
static final CoordRec char43_stroke1[] = {
@@ -332,7 +332,7 @@ static final StrokeRec char43[] = {
static final CoordRec char44_stroke0[] = {
new CoordRec((float) 18.2838, (float) 4.7619),
- new CoordRec((float) 13.5219, (float) 0),
+ new CoordRec((float) 13.5219, 0),
new CoordRec((float) 8.76, (float) 4.7619),
new CoordRec((float) 13.5219, (float) 9.5238),
new CoordRec((float) 18.2838, (float) 4.7619),
@@ -361,7 +361,7 @@ static final StrokeRec char45[] = {
static final CoordRec char46_stroke0[] = {
new CoordRec((float) 13.1019, (float) 9.5238),
new CoordRec((float) 8.34, (float) 4.7619),
- new CoordRec((float) 13.1019, (float) 0),
+ new CoordRec((float) 13.1019, 0),
new CoordRec((float) 17.8638, (float) 4.7619),
new CoordRec((float) 13.1019, (float) 9.5238),
};
@@ -374,7 +374,7 @@ static final StrokeRec char46[] = {
static final CoordRec char47_stroke0[] = {
new CoordRec((float) 7.24, (float) -14.2857),
- new CoordRec((float) 73.9067, (float) 100),
+ new CoordRec((float) 73.9067, 100),
};
static final StrokeRec char47[] = {
@@ -384,23 +384,23 @@ static final StrokeRec char47[] = {
/* char: 48 '0' */
static final CoordRec char48_stroke0[] = {
- new CoordRec((float) 33.5514, (float) 100),
+ new CoordRec((float) 33.5514, 100),
new CoordRec((float) 19.2657, (float) 95.2381),
new CoordRec((float) 9.7419, (float) 80.9524),
new CoordRec((float) 4.98, (float) 57.1429),
new CoordRec((float) 4.98, (float) 42.8571),
new CoordRec((float) 9.7419, (float) 19.0476),
new CoordRec((float) 19.2657, (float) 4.7619),
- new CoordRec((float) 33.5514, (float) 0),
- new CoordRec((float) 43.0752, (float) 0),
+ new CoordRec((float) 33.5514, 0),
+ new CoordRec((float) 43.0752, 0),
new CoordRec((float) 57.361, (float) 4.7619),
new CoordRec((float) 66.8848, (float) 19.0476),
new CoordRec((float) 71.6467, (float) 42.8571),
new CoordRec((float) 71.6467, (float) 57.1429),
new CoordRec((float) 66.8848, (float) 80.9524),
new CoordRec((float) 57.361, (float) 95.2381),
- new CoordRec((float) 43.0752, (float) 100),
- new CoordRec((float) 33.5514, (float) 100),
+ new CoordRec((float) 43.0752, 100),
+ new CoordRec((float) 33.5514, 100),
};
static final StrokeRec char48[] = {
@@ -412,8 +412,8 @@ static final StrokeRec char48[] = {
static final CoordRec char49_stroke0[] = {
new CoordRec((float) 11.82, (float) 80.9524),
new CoordRec((float) 21.3438, (float) 85.7143),
- new CoordRec((float) 35.6295, (float) 100),
- new CoordRec((float) 35.6295, (float) 0),
+ new CoordRec((float) 35.6295, 100),
+ new CoordRec((float) 35.6295, 0),
};
static final StrokeRec char49[] = {
@@ -427,16 +427,16 @@ static final CoordRec char50_stroke0[] = {
new CoordRec((float) 10.1819, (float) 80.9524),
new CoordRec((float) 14.9438, (float) 90.4762),
new CoordRec((float) 19.7057, (float) 95.2381),
- new CoordRec((float) 29.2295, (float) 100),
- new CoordRec((float) 48.2771, (float) 100),
+ new CoordRec((float) 29.2295, 100),
+ new CoordRec((float) 48.2771, 100),
new CoordRec((float) 57.801, (float) 95.2381),
new CoordRec((float) 62.5629, (float) 90.4762),
new CoordRec((float) 67.3248, (float) 80.9524),
new CoordRec((float) 67.3248, (float) 71.4286),
new CoordRec((float) 62.5629, (float) 61.9048),
new CoordRec((float) 53.039, (float) 47.619),
- new CoordRec((float) 5.42, (float) 0),
- new CoordRec((float) 72.0867, (float) 0),
+ new CoordRec((float) 5.42, 0),
+ new CoordRec((float) 72.0867, 0),
};
static final StrokeRec char50[] = {
@@ -446,8 +446,8 @@ static final StrokeRec char50[] = {
/* char: 51 '3' */
static final CoordRec char51_stroke0[] = {
- new CoordRec((float) 14.5238, (float) 100),
- new CoordRec((float) 66.9048, (float) 100),
+ new CoordRec((float) 14.5238, 100),
+ new CoordRec((float) 66.9048, 100),
new CoordRec((float) 38.3333, (float) 61.9048),
new CoordRec((float) 52.619, (float) 61.9048),
new CoordRec((float) 62.1429, (float) 57.1429),
@@ -456,11 +456,11 @@ static final CoordRec char51_stroke0[] = {
new CoordRec((float) 71.6667, (float) 28.5714),
new CoordRec((float) 66.9048, (float) 14.2857),
new CoordRec((float) 57.381, (float) 4.7619),
- new CoordRec((float) 43.0952, (float) 0),
- new CoordRec((float) 28.8095, (float) 0),
+ new CoordRec((float) 43.0952, 0),
+ new CoordRec((float) 28.8095, 0),
new CoordRec((float) 14.5238, (float) 4.7619),
new CoordRec((float) 9.7619, (float) 9.5238),
- new CoordRec((float) 5, (float) 19.0476),
+ new CoordRec(5, (float) 19.0476),
};
static final StrokeRec char51[] = {
@@ -470,14 +470,14 @@ static final StrokeRec char51[] = {
/* char: 52 '4' */
static final CoordRec char52_stroke0[] = {
- new CoordRec((float) 51.499, (float) 100),
+ new CoordRec((float) 51.499, 100),
new CoordRec((float) 3.88, (float) 33.3333),
new CoordRec((float) 75.3086, (float) 33.3333),
};
static final CoordRec char52_stroke1[] = {
- new CoordRec((float) 51.499, (float) 100),
- new CoordRec((float) 51.499, (float) 0),
+ new CoordRec((float) 51.499, 100),
+ new CoordRec((float) 51.499, 0),
};
static final StrokeRec char52[] = {
@@ -488,8 +488,8 @@ static final StrokeRec char52[] = {
/* char: 53 '5' */
static final CoordRec char53_stroke0[] = {
- new CoordRec((float) 62.0029, (float) 100),
- new CoordRec((float) 14.3838, (float) 100),
+ new CoordRec((float) 62.0029, 100),
+ new CoordRec((float) 14.3838, 100),
new CoordRec((float) 9.6219, (float) 57.1429),
new CoordRec((float) 14.3838, (float) 61.9048),
new CoordRec((float) 28.6695, (float) 66.6667),
@@ -500,8 +500,8 @@ static final CoordRec char53_stroke0[] = {
new CoordRec((float) 71.5267, (float) 28.5714),
new CoordRec((float) 66.7648, (float) 14.2857),
new CoordRec((float) 57.241, (float) 4.7619),
- new CoordRec((float) 42.9552, (float) 0),
- new CoordRec((float) 28.6695, (float) 0),
+ new CoordRec((float) 42.9552, 0),
+ new CoordRec((float) 28.6695, 0),
new CoordRec((float) 14.3838, (float) 4.7619),
new CoordRec((float) 9.6219, (float) 9.5238),
new CoordRec((float) 4.86, (float) 19.0476),
@@ -516,16 +516,16 @@ static final StrokeRec char53[] = {
static final CoordRec char54_stroke0[] = {
new CoordRec((float) 62.7229, (float) 85.7143),
new CoordRec((float) 57.961, (float) 95.2381),
- new CoordRec((float) 43.6752, (float) 100),
- new CoordRec((float) 34.1514, (float) 100),
+ new CoordRec((float) 43.6752, 100),
+ new CoordRec((float) 34.1514, 100),
new CoordRec((float) 19.8657, (float) 95.2381),
new CoordRec((float) 10.3419, (float) 80.9524),
new CoordRec((float) 5.58, (float) 57.1429),
new CoordRec((float) 5.58, (float) 33.3333),
new CoordRec((float) 10.3419, (float) 14.2857),
new CoordRec((float) 19.8657, (float) 4.7619),
- new CoordRec((float) 34.1514, (float) 0),
- new CoordRec((float) 38.9133, (float) 0),
+ new CoordRec((float) 34.1514, 0),
+ new CoordRec((float) 38.9133, 0),
new CoordRec((float) 53.199, (float) 4.7619),
new CoordRec((float) 62.7229, (float) 14.2857),
new CoordRec((float) 67.4848, (float) 28.5714),
@@ -546,13 +546,13 @@ static final StrokeRec char54[] = {
/* char: 55 '7' */
static final CoordRec char55_stroke0[] = {
- new CoordRec((float) 72.2267, (float) 100),
- new CoordRec((float) 24.6076, (float) 0),
+ new CoordRec((float) 72.2267, 100),
+ new CoordRec((float) 24.6076, 0),
};
static final CoordRec char55_stroke1[] = {
- new CoordRec((float) 5.56, (float) 100),
- new CoordRec((float) 72.2267, (float) 100),
+ new CoordRec((float) 5.56, 100),
+ new CoordRec((float) 72.2267, 100),
};
static final StrokeRec char55[] = {
@@ -563,7 +563,7 @@ static final StrokeRec char55[] = {
/* char: 56 '8' */
static final CoordRec char56_stroke0[] = {
- new CoordRec((float) 29.4095, (float) 100),
+ new CoordRec((float) 29.4095, 100),
new CoordRec((float) 15.1238, (float) 95.2381),
new CoordRec((float) 10.3619, (float) 85.7143),
new CoordRec((float) 10.3619, (float) 76.1905),
@@ -576,8 +576,8 @@ static final CoordRec char56_stroke0[] = {
new CoordRec((float) 72.2667, (float) 19.0476),
new CoordRec((float) 67.5048, (float) 9.5238),
new CoordRec((float) 62.7429, (float) 4.7619),
- new CoordRec((float) 48.4571, (float) 0),
- new CoordRec((float) 29.4095, (float) 0),
+ new CoordRec((float) 48.4571, 0),
+ new CoordRec((float) 29.4095, 0),
new CoordRec((float) 15.1238, (float) 4.7619),
new CoordRec((float) 10.3619, (float) 9.5238),
new CoordRec((float) 5.6, (float) 19.0476),
@@ -590,8 +590,8 @@ static final CoordRec char56_stroke0[] = {
new CoordRec((float) 67.5048, (float) 76.1905),
new CoordRec((float) 67.5048, (float) 85.7143),
new CoordRec((float) 62.7429, (float) 95.2381),
- new CoordRec((float) 48.4571, (float) 100),
- new CoordRec((float) 29.4095, (float) 100),
+ new CoordRec((float) 48.4571, 100),
+ new CoordRec((float) 29.4095, 100),
};
static final StrokeRec char56[] = {
@@ -612,16 +612,16 @@ static final CoordRec char57_stroke0[] = {
new CoordRec((float) 6.6, (float) 71.4286),
new CoordRec((float) 11.3619, (float) 85.7143),
new CoordRec((float) 20.8857, (float) 95.2381),
- new CoordRec((float) 35.1714, (float) 100),
- new CoordRec((float) 39.9333, (float) 100),
+ new CoordRec((float) 35.1714, 100),
+ new CoordRec((float) 39.9333, 100),
new CoordRec((float) 54.219, (float) 95.2381),
new CoordRec((float) 63.7429, (float) 85.7143),
new CoordRec((float) 68.5048, (float) 66.6667),
new CoordRec((float) 68.5048, (float) 42.8571),
new CoordRec((float) 63.7429, (float) 19.0476),
new CoordRec((float) 54.219, (float) 4.7619),
- new CoordRec((float) 39.9333, (float) 0),
- new CoordRec((float) 30.4095, (float) 0),
+ new CoordRec((float) 39.9333, 0),
+ new CoordRec((float) 30.4095, 0),
new CoordRec((float) 16.1238, (float) 4.7619),
new CoordRec((float) 11.3619, (float) 14.2857),
};
@@ -643,7 +643,7 @@ static final CoordRec char58_stroke0[] = {
static final CoordRec char58_stroke1[] = {
new CoordRec((float) 14.0819, (float) 9.5238),
new CoordRec((float) 9.32, (float) 4.7619),
- new CoordRec((float) 14.0819, (float) 0),
+ new CoordRec((float) 14.0819, 0),
new CoordRec((float) 18.8438, (float) 4.7619),
new CoordRec((float) 14.0819, (float) 9.5238),
};
@@ -665,7 +665,7 @@ static final CoordRec char59_stroke0[] = {
static final CoordRec char59_stroke1[] = {
new CoordRec((float) 17.7238, (float) 4.7619),
- new CoordRec((float) 12.9619, (float) 0),
+ new CoordRec((float) 12.9619, 0),
new CoordRec((float) 8.2, (float) 4.7619),
new CoordRec((float) 12.9619, (float) 9.5238),
new CoordRec((float) 17.7238, (float) 4.7619),
@@ -684,7 +684,7 @@ static final StrokeRec char59[] = {
static final CoordRec char60_stroke0[] = {
new CoordRec((float) 79.2505, (float) 85.7143),
new CoordRec((float) 3.06, (float) 42.8571),
- new CoordRec((float) 79.2505, (float) 0),
+ new CoordRec((float) 79.2505, 0),
};
static final StrokeRec char60[] = {
@@ -713,7 +713,7 @@ static final StrokeRec char61[] = {
static final CoordRec char62_stroke0[] = {
new CoordRec((float) 2.78, (float) 85.7143),
new CoordRec((float) 78.9705, (float) 42.8571),
- new CoordRec((float) 2.78, (float) 0),
+ new CoordRec((float) 2.78, 0),
};
static final StrokeRec char62[] = {
@@ -727,8 +727,8 @@ static final CoordRec char63_stroke0[] = {
new CoordRec((float) 8.42, (float) 80.9524),
new CoordRec((float) 13.1819, (float) 90.4762),
new CoordRec((float) 17.9438, (float) 95.2381),
- new CoordRec((float) 27.4676, (float) 100),
- new CoordRec((float) 46.5152, (float) 100),
+ new CoordRec((float) 27.4676, 100),
+ new CoordRec((float) 46.5152, 100),
new CoordRec((float) 56.039, (float) 95.2381),
new CoordRec((float) 60.801, (float) 90.4762),
new CoordRec((float) 65.5629, (float) 80.9524),
@@ -742,7 +742,7 @@ static final CoordRec char63_stroke0[] = {
static final CoordRec char63_stroke1[] = {
new CoordRec((float) 36.9914, (float) 9.5238),
new CoordRec((float) 32.2295, (float) 4.7619),
- new CoordRec((float) 36.9914, (float) 0),
+ new CoordRec((float) 36.9914, 0),
new CoordRec((float) 41.7533, (float) 4.7619),
new CoordRec((float) 36.9914, (float) 9.5238),
};
@@ -795,13 +795,13 @@ static final StrokeRec char64[] = {
/* char: 65 'A' */
static final CoordRec char65_stroke0[] = {
- new CoordRec((float) 40.5952, (float) 100),
- new CoordRec((float) 2.5, (float) 0),
+ new CoordRec((float) 40.5952, 100),
+ new CoordRec((float) 2.5, 0),
};
static final CoordRec char65_stroke1[] = {
- new CoordRec((float) 40.5952, (float) 100),
- new CoordRec((float) 78.6905, (float) 0),
+ new CoordRec((float) 40.5952, 100),
+ new CoordRec((float) 78.6905, 0),
};
static final CoordRec char65_stroke2[] = {
@@ -818,13 +818,13 @@ static final StrokeRec char65[] = {
/* char: 66 'B' */
static final CoordRec char66_stroke0[] = {
- new CoordRec((float) 11.42, (float) 100),
- new CoordRec((float) 11.42, (float) 0),
+ new CoordRec((float) 11.42, 100),
+ new CoordRec((float) 11.42, 0),
};
static final CoordRec char66_stroke1[] = {
- new CoordRec((float) 11.42, (float) 100),
- new CoordRec((float) 54.2771, (float) 100),
+ new CoordRec((float) 11.42, 100),
+ new CoordRec((float) 54.2771, 100),
new CoordRec((float) 68.5629, (float) 95.2381),
new CoordRec((float) 73.3248, (float) 90.4762),
new CoordRec((float) 78.0867, (float) 80.9524),
@@ -843,8 +843,8 @@ static final CoordRec char66_stroke2[] = {
new CoordRec((float) 78.0867, (float) 19.0476),
new CoordRec((float) 73.3248, (float) 9.5238),
new CoordRec((float) 68.5629, (float) 4.7619),
- new CoordRec((float) 54.2771, (float) 0),
- new CoordRec((float) 11.42, (float) 0),
+ new CoordRec((float) 54.2771, 0),
+ new CoordRec((float) 11.42, 0),
};
static final StrokeRec char66[] = {
@@ -859,8 +859,8 @@ static final CoordRec char67_stroke0[] = {
new CoordRec((float) 78.0886, (float) 76.1905),
new CoordRec((float) 73.3267, (float) 85.7143),
new CoordRec((float) 63.8029, (float) 95.2381),
- new CoordRec((float) 54.279, (float) 100),
- new CoordRec((float) 35.2314, (float) 100),
+ new CoordRec((float) 54.279, 100),
+ new CoordRec((float) 35.2314, 100),
new CoordRec((float) 25.7076, (float) 95.2381),
new CoordRec((float) 16.1838, (float) 85.7143),
new CoordRec((float) 11.4219, (float) 76.1905),
@@ -869,8 +869,8 @@ static final CoordRec char67_stroke0[] = {
new CoordRec((float) 11.4219, (float) 23.8095),
new CoordRec((float) 16.1838, (float) 14.2857),
new CoordRec((float) 25.7076, (float) 4.7619),
- new CoordRec((float) 35.2314, (float) 0),
- new CoordRec((float) 54.279, (float) 0),
+ new CoordRec((float) 35.2314, 0),
+ new CoordRec((float) 54.279, 0),
new CoordRec((float) 63.8029, (float) 4.7619),
new CoordRec((float) 73.3267, (float) 14.2857),
new CoordRec((float) 78.0886, (float) 23.8095),
@@ -883,13 +883,13 @@ static final StrokeRec char67[] = {
/* char: 68 'D' */
static final CoordRec char68_stroke0[] = {
- new CoordRec((float) 11.96, (float) 100),
- new CoordRec((float) 11.96, (float) 0),
+ new CoordRec((float) 11.96, 100),
+ new CoordRec((float) 11.96, 0),
};
static final CoordRec char68_stroke1[] = {
- new CoordRec((float) 11.96, (float) 100),
- new CoordRec((float) 45.2933, (float) 100),
+ new CoordRec((float) 11.96, 100),
+ new CoordRec((float) 45.2933, 100),
new CoordRec((float) 59.579, (float) 95.2381),
new CoordRec((float) 69.1029, (float) 85.7143),
new CoordRec((float) 73.8648, (float) 76.1905),
@@ -898,8 +898,8 @@ static final CoordRec char68_stroke1[] = {
new CoordRec((float) 73.8648, (float) 23.8095),
new CoordRec((float) 69.1029, (float) 14.2857),
new CoordRec((float) 59.579, (float) 4.7619),
- new CoordRec((float) 45.2933, (float) 0),
- new CoordRec((float) 11.96, (float) 0),
+ new CoordRec((float) 45.2933, 0),
+ new CoordRec((float) 11.96, 0),
};
static final StrokeRec char68[] = {
@@ -910,13 +910,13 @@ static final StrokeRec char68[] = {
/* char: 69 'E' */
static final CoordRec char69_stroke0[] = {
- new CoordRec((float) 11.42, (float) 100),
- new CoordRec((float) 11.42, (float) 0),
+ new CoordRec((float) 11.42, 100),
+ new CoordRec((float) 11.42, 0),
};
static final CoordRec char69_stroke1[] = {
- new CoordRec((float) 11.42, (float) 100),
- new CoordRec((float) 73.3248, (float) 100),
+ new CoordRec((float) 11.42, 100),
+ new CoordRec((float) 73.3248, 100),
};
static final CoordRec char69_stroke2[] = {
@@ -925,8 +925,8 @@ static final CoordRec char69_stroke2[] = {
};
static final CoordRec char69_stroke3[] = {
- new CoordRec((float) 11.42, (float) 0),
- new CoordRec((float) 73.3248, (float) 0),
+ new CoordRec((float) 11.42, 0),
+ new CoordRec((float) 73.3248, 0),
};
static final StrokeRec char69[] = {
@@ -939,13 +939,13 @@ static final StrokeRec char69[] = {
/* char: 70 'F' */
static final CoordRec char70_stroke0[] = {
- new CoordRec((float) 11.42, (float) 100),
- new CoordRec((float) 11.42, (float) 0),
+ new CoordRec((float) 11.42, 100),
+ new CoordRec((float) 11.42, 0),
};
static final CoordRec char70_stroke1[] = {
- new CoordRec((float) 11.42, (float) 100),
- new CoordRec((float) 73.3248, (float) 100),
+ new CoordRec((float) 11.42, 100),
+ new CoordRec((float) 73.3248, 100),
};
static final CoordRec char70_stroke2[] = {
@@ -965,8 +965,8 @@ static final CoordRec char71_stroke0[] = {
new CoordRec((float) 78.4886, (float) 76.1905),
new CoordRec((float) 73.7267, (float) 85.7143),
new CoordRec((float) 64.2029, (float) 95.2381),
- new CoordRec((float) 54.679, (float) 100),
- new CoordRec((float) 35.6314, (float) 100),
+ new CoordRec((float) 54.679, 100),
+ new CoordRec((float) 35.6314, 100),
new CoordRec((float) 26.1076, (float) 95.2381),
new CoordRec((float) 16.5838, (float) 85.7143),
new CoordRec((float) 11.8219, (float) 76.1905),
@@ -975,8 +975,8 @@ static final CoordRec char71_stroke0[] = {
new CoordRec((float) 11.8219, (float) 23.8095),
new CoordRec((float) 16.5838, (float) 14.2857),
new CoordRec((float) 26.1076, (float) 4.7619),
- new CoordRec((float) 35.6314, (float) 0),
- new CoordRec((float) 54.679, (float) 0),
+ new CoordRec((float) 35.6314, 0),
+ new CoordRec((float) 54.679, 0),
new CoordRec((float) 64.2029, (float) 4.7619),
new CoordRec((float) 73.7267, (float) 14.2857),
new CoordRec((float) 78.4886, (float) 23.8095),
@@ -996,13 +996,13 @@ static final StrokeRec char71[] = {
/* char: 72 'H' */
static final CoordRec char72_stroke0[] = {
- new CoordRec((float) 11.42, (float) 100),
- new CoordRec((float) 11.42, (float) 0),
+ new CoordRec((float) 11.42, 100),
+ new CoordRec((float) 11.42, 0),
};
static final CoordRec char72_stroke1[] = {
- new CoordRec((float) 78.0867, (float) 100),
- new CoordRec((float) 78.0867, (float) 0),
+ new CoordRec((float) 78.0867, 100),
+ new CoordRec((float) 78.0867, 0),
};
static final CoordRec char72_stroke2[] = {
@@ -1019,8 +1019,8 @@ static final StrokeRec char72[] = {
/* char: 73 'I' */
static final CoordRec char73_stroke0[] = {
- new CoordRec((float) 10.86, (float) 100),
- new CoordRec((float) 10.86, (float) 0),
+ new CoordRec((float) 10.86, 100),
+ new CoordRec((float) 10.86, 0),
};
static final StrokeRec char73[] = {
@@ -1030,12 +1030,12 @@ static final StrokeRec char73[] = {
/* char: 74 'J' */
static final CoordRec char74_stroke0[] = {
- new CoordRec((float) 50.119, (float) 100),
+ new CoordRec((float) 50.119, 100),
new CoordRec((float) 50.119, (float) 23.8095),
new CoordRec((float) 45.3571, (float) 9.5238),
new CoordRec((float) 40.5952, (float) 4.7619),
- new CoordRec((float) 31.0714, (float) 0),
- new CoordRec((float) 21.5476, (float) 0),
+ new CoordRec((float) 31.0714, 0),
+ new CoordRec((float) 21.5476, 0),
new CoordRec((float) 12.0238, (float) 4.7619),
new CoordRec((float) 7.2619, (float) 9.5238),
new CoordRec((float) 2.5, (float) 23.8095),
@@ -1049,18 +1049,18 @@ static final StrokeRec char74[] = {
/* char: 75 'K' */
static final CoordRec char75_stroke0[] = {
- new CoordRec((float) 11.28, (float) 100),
- new CoordRec((float) 11.28, (float) 0),
+ new CoordRec((float) 11.28, 100),
+ new CoordRec((float) 11.28, 0),
};
static final CoordRec char75_stroke1[] = {
- new CoordRec((float) 77.9467, (float) 100),
+ new CoordRec((float) 77.9467, 100),
new CoordRec((float) 11.28, (float) 33.3333),
};
static final CoordRec char75_stroke2[] = {
new CoordRec((float) 35.0895, (float) 57.1429),
- new CoordRec((float) 77.9467, (float) 0),
+ new CoordRec((float) 77.9467, 0),
};
static final StrokeRec char75[] = {
@@ -1072,13 +1072,13 @@ static final StrokeRec char75[] = {
/* char: 76 'L' */
static final CoordRec char76_stroke0[] = {
- new CoordRec((float) 11.68, (float) 100),
- new CoordRec((float) 11.68, (float) 0),
+ new CoordRec((float) 11.68, 100),
+ new CoordRec((float) 11.68, 0),
};
static final CoordRec char76_stroke1[] = {
- new CoordRec((float) 11.68, (float) 0),
- new CoordRec((float) 68.8229, (float) 0),
+ new CoordRec((float) 11.68, 0),
+ new CoordRec((float) 68.8229, 0),
};
static final StrokeRec char76[] = {
@@ -1089,23 +1089,23 @@ static final StrokeRec char76[] = {
/* char: 77 'M' */
static final CoordRec char77_stroke0[] = {
- new CoordRec((float) 10.86, (float) 100),
- new CoordRec((float) 10.86, (float) 0),
+ new CoordRec((float) 10.86, 100),
+ new CoordRec((float) 10.86, 0),
};
static final CoordRec char77_stroke1[] = {
- new CoordRec((float) 10.86, (float) 100),
- new CoordRec((float) 48.9552, (float) 0),
+ new CoordRec((float) 10.86, 100),
+ new CoordRec((float) 48.9552, 0),
};
static final CoordRec char77_stroke2[] = {
- new CoordRec((float) 87.0505, (float) 100),
- new CoordRec((float) 48.9552, (float) 0),
+ new CoordRec((float) 87.0505, 100),
+ new CoordRec((float) 48.9552, 0),
};
static final CoordRec char77_stroke3[] = {
- new CoordRec((float) 87.0505, (float) 100),
- new CoordRec((float) 87.0505, (float) 0),
+ new CoordRec((float) 87.0505, 100),
+ new CoordRec((float) 87.0505, 0),
};
static final StrokeRec char77[] = {
@@ -1118,18 +1118,18 @@ static final StrokeRec char77[] = {
/* char: 78 'N' */
static final CoordRec char78_stroke0[] = {
- new CoordRec((float) 11.14, (float) 100),
- new CoordRec((float) 11.14, (float) 0),
+ new CoordRec((float) 11.14, 100),
+ new CoordRec((float) 11.14, 0),
};
static final CoordRec char78_stroke1[] = {
- new CoordRec((float) 11.14, (float) 100),
- new CoordRec((float) 77.8067, (float) 0),
+ new CoordRec((float) 11.14, 100),
+ new CoordRec((float) 77.8067, 0),
};
static final CoordRec char78_stroke2[] = {
- new CoordRec((float) 77.8067, (float) 100),
- new CoordRec((float) 77.8067, (float) 0),
+ new CoordRec((float) 77.8067, 100),
+ new CoordRec((float) 77.8067, 0),
};
static final StrokeRec char78[] = {
@@ -1141,7 +1141,7 @@ static final StrokeRec char78[] = {
/* char: 79 'O' */
static final CoordRec char79_stroke0[] = {
- new CoordRec((float) 34.8114, (float) 100),
+ new CoordRec((float) 34.8114, 100),
new CoordRec((float) 25.2876, (float) 95.2381),
new CoordRec((float) 15.7638, (float) 85.7143),
new CoordRec((float) 11.0019, (float) 76.1905),
@@ -1150,8 +1150,8 @@ static final CoordRec char79_stroke0[] = {
new CoordRec((float) 11.0019, (float) 23.8095),
new CoordRec((float) 15.7638, (float) 14.2857),
new CoordRec((float) 25.2876, (float) 4.7619),
- new CoordRec((float) 34.8114, (float) 0),
- new CoordRec((float) 53.859, (float) 0),
+ new CoordRec((float) 34.8114, 0),
+ new CoordRec((float) 53.859, 0),
new CoordRec((float) 63.3829, (float) 4.7619),
new CoordRec((float) 72.9067, (float) 14.2857),
new CoordRec((float) 77.6686, (float) 23.8095),
@@ -1160,8 +1160,8 @@ static final CoordRec char79_stroke0[] = {
new CoordRec((float) 77.6686, (float) 76.1905),
new CoordRec((float) 72.9067, (float) 85.7143),
new CoordRec((float) 63.3829, (float) 95.2381),
- new CoordRec((float) 53.859, (float) 100),
- new CoordRec((float) 34.8114, (float) 100),
+ new CoordRec((float) 53.859, 100),
+ new CoordRec((float) 34.8114, 100),
};
static final StrokeRec char79[] = {
@@ -1171,13 +1171,13 @@ static final StrokeRec char79[] = {
/* char: 80 'P' */
static final CoordRec char80_stroke0[] = {
- new CoordRec((float) 12.1, (float) 100),
- new CoordRec((float) 12.1, (float) 0),
+ new CoordRec((float) 12.1, 100),
+ new CoordRec((float) 12.1, 0),
};
static final CoordRec char80_stroke1[] = {
- new CoordRec((float) 12.1, (float) 100),
- new CoordRec((float) 54.9571, (float) 100),
+ new CoordRec((float) 12.1, 100),
+ new CoordRec((float) 54.9571, 100),
new CoordRec((float) 69.2429, (float) 95.2381),
new CoordRec((float) 74.0048, (float) 90.4762),
new CoordRec((float) 78.7667, (float) 80.9524),
@@ -1196,7 +1196,7 @@ static final StrokeRec char80[] = {
/* char: 81 'Q' */
static final CoordRec char81_stroke0[] = {
- new CoordRec((float) 33.8714, (float) 100),
+ new CoordRec((float) 33.8714, 100),
new CoordRec((float) 24.3476, (float) 95.2381),
new CoordRec((float) 14.8238, (float) 85.7143),
new CoordRec((float) 10.0619, (float) 76.1905),
@@ -1205,8 +1205,8 @@ static final CoordRec char81_stroke0[] = {
new CoordRec((float) 10.0619, (float) 23.8095),
new CoordRec((float) 14.8238, (float) 14.2857),
new CoordRec((float) 24.3476, (float) 4.7619),
- new CoordRec((float) 33.8714, (float) 0),
- new CoordRec((float) 52.919, (float) 0),
+ new CoordRec((float) 33.8714, 0),
+ new CoordRec((float) 52.919, 0),
new CoordRec((float) 62.4429, (float) 4.7619),
new CoordRec((float) 71.9667, (float) 14.2857),
new CoordRec((float) 76.7286, (float) 23.8095),
@@ -1215,8 +1215,8 @@ static final CoordRec char81_stroke0[] = {
new CoordRec((float) 76.7286, (float) 76.1905),
new CoordRec((float) 71.9667, (float) 85.7143),
new CoordRec((float) 62.4429, (float) 95.2381),
- new CoordRec((float) 52.919, (float) 100),
- new CoordRec((float) 33.8714, (float) 100),
+ new CoordRec((float) 52.919, 100),
+ new CoordRec((float) 33.8714, 100),
};
static final CoordRec char81_stroke1[] = {
@@ -1232,13 +1232,13 @@ static final StrokeRec char81[] = {
/* char: 82 'R' */
static final CoordRec char82_stroke0[] = {
- new CoordRec((float) 11.68, (float) 100),
- new CoordRec((float) 11.68, (float) 0),
+ new CoordRec((float) 11.68, 100),
+ new CoordRec((float) 11.68, 0),
};
static final CoordRec char82_stroke1[] = {
- new CoordRec((float) 11.68, (float) 100),
- new CoordRec((float) 54.5371, (float) 100),
+ new CoordRec((float) 11.68, 100),
+ new CoordRec((float) 54.5371, 100),
new CoordRec((float) 68.8229, (float) 95.2381),
new CoordRec((float) 73.5848, (float) 90.4762),
new CoordRec((float) 78.3467, (float) 80.9524),
@@ -1251,7 +1251,7 @@ static final CoordRec char82_stroke1[] = {
static final CoordRec char82_stroke2[] = {
new CoordRec((float) 45.0133, (float) 52.381),
- new CoordRec((float) 78.3467, (float) 0),
+ new CoordRec((float) 78.3467, 0),
};
static final StrokeRec char82[] = {
@@ -1265,11 +1265,11 @@ static final StrokeRec char82[] = {
static final CoordRec char83_stroke0[] = {
new CoordRec((float) 74.6667, (float) 85.7143),
new CoordRec((float) 65.1429, (float) 95.2381),
- new CoordRec((float) 50.8571, (float) 100),
- new CoordRec((float) 31.8095, (float) 100),
+ new CoordRec((float) 50.8571, 100),
+ new CoordRec((float) 31.8095, 100),
new CoordRec((float) 17.5238, (float) 95.2381),
- new CoordRec((float) 8, (float) 85.7143),
- new CoordRec((float) 8, (float) 76.1905),
+ new CoordRec(8, (float) 85.7143),
+ new CoordRec(8, (float) 76.1905),
new CoordRec((float) 12.7619, (float) 66.6667),
new CoordRec((float) 17.5238, (float) 61.9048),
new CoordRec((float) 27.0476, (float) 57.1429),
@@ -1279,10 +1279,10 @@ static final CoordRec char83_stroke0[] = {
new CoordRec((float) 74.6667, (float) 28.5714),
new CoordRec((float) 74.6667, (float) 14.2857),
new CoordRec((float) 65.1429, (float) 4.7619),
- new CoordRec((float) 50.8571, (float) 0),
- new CoordRec((float) 31.8095, (float) 0),
+ new CoordRec((float) 50.8571, 0),
+ new CoordRec((float) 31.8095, 0),
new CoordRec((float) 17.5238, (float) 4.7619),
- new CoordRec((float) 8, (float) 14.2857),
+ new CoordRec(8, (float) 14.2857),
};
static final StrokeRec char83[] = {
@@ -1292,13 +1292,13 @@ static final StrokeRec char83[] = {
/* char: 84 'T' */
static final CoordRec char84_stroke0[] = {
- new CoordRec((float) 35.6933, (float) 100),
- new CoordRec((float) 35.6933, (float) 0),
+ new CoordRec((float) 35.6933, 100),
+ new CoordRec((float) 35.6933, 0),
};
static final CoordRec char84_stroke1[] = {
- new CoordRec((float) 2.36, (float) 100),
- new CoordRec((float) 69.0267, (float) 100),
+ new CoordRec((float) 2.36, 100),
+ new CoordRec((float) 69.0267, 100),
};
static final StrokeRec char84[] = {
@@ -1309,16 +1309,16 @@ static final StrokeRec char84[] = {
/* char: 85 'U' */
static final CoordRec char85_stroke0[] = {
- new CoordRec((float) 11.54, (float) 100),
+ new CoordRec((float) 11.54, 100),
new CoordRec((float) 11.54, (float) 28.5714),
new CoordRec((float) 16.3019, (float) 14.2857),
new CoordRec((float) 25.8257, (float) 4.7619),
- new CoordRec((float) 40.1114, (float) 0),
- new CoordRec((float) 49.6352, (float) 0),
+ new CoordRec((float) 40.1114, 0),
+ new CoordRec((float) 49.6352, 0),
new CoordRec((float) 63.921, (float) 4.7619),
new CoordRec((float) 73.4448, (float) 14.2857),
new CoordRec((float) 78.2067, (float) 28.5714),
- new CoordRec((float) 78.2067, (float) 100),
+ new CoordRec((float) 78.2067, 100),
};
static final StrokeRec char85[] = {
@@ -1328,13 +1328,13 @@ static final StrokeRec char85[] = {
/* char: 86 'V' */
static final CoordRec char86_stroke0[] = {
- new CoordRec((float) 2.36, (float) 100),
- new CoordRec((float) 40.4552, (float) 0),
+ new CoordRec((float) 2.36, 100),
+ new CoordRec((float) 40.4552, 0),
};
static final CoordRec char86_stroke1[] = {
- new CoordRec((float) 78.5505, (float) 100),
- new CoordRec((float) 40.4552, (float) 0),
+ new CoordRec((float) 78.5505, 100),
+ new CoordRec((float) 40.4552, 0),
};
static final StrokeRec char86[] = {
@@ -1345,23 +1345,23 @@ static final StrokeRec char86[] = {
/* char: 87 'W' */
static final CoordRec char87_stroke0[] = {
- new CoordRec((float) 2.22, (float) 100),
- new CoordRec((float) 26.0295, (float) 0),
+ new CoordRec((float) 2.22, 100),
+ new CoordRec((float) 26.0295, 0),
};
static final CoordRec char87_stroke1[] = {
- new CoordRec((float) 49.839, (float) 100),
- new CoordRec((float) 26.0295, (float) 0),
+ new CoordRec((float) 49.839, 100),
+ new CoordRec((float) 26.0295, 0),
};
static final CoordRec char87_stroke2[] = {
- new CoordRec((float) 49.839, (float) 100),
- new CoordRec((float) 73.6486, (float) 0),
+ new CoordRec((float) 49.839, 100),
+ new CoordRec((float) 73.6486, 0),
};
static final CoordRec char87_stroke3[] = {
- new CoordRec((float) 97.4581, (float) 100),
- new CoordRec((float) 73.6486, (float) 0),
+ new CoordRec((float) 97.4581, 100),
+ new CoordRec((float) 73.6486, 0),
};
static final StrokeRec char87[] = {
@@ -1374,13 +1374,13 @@ static final StrokeRec char87[] = {
/* char: 88 'X' */
static final CoordRec char88_stroke0[] = {
- new CoordRec((float) 2.5, (float) 100),
- new CoordRec((float) 69.1667, (float) 0),
+ new CoordRec((float) 2.5, 100),
+ new CoordRec((float) 69.1667, 0),
};
static final CoordRec char88_stroke1[] = {
- new CoordRec((float) 69.1667, (float) 100),
- new CoordRec((float) 2.5, (float) 0),
+ new CoordRec((float) 69.1667, 100),
+ new CoordRec((float) 2.5, 0),
};
static final StrokeRec char88[] = {
@@ -1391,13 +1391,13 @@ static final StrokeRec char88[] = {
/* char: 89 'Y' */
static final CoordRec char89_stroke0[] = {
- new CoordRec((float) 1.52, (float) 100),
+ new CoordRec((float) 1.52, 100),
new CoordRec((float) 39.6152, (float) 52.381),
- new CoordRec((float) 39.6152, (float) 0),
+ new CoordRec((float) 39.6152, 0),
};
static final CoordRec char89_stroke1[] = {
- new CoordRec((float) 77.7105, (float) 100),
+ new CoordRec((float) 77.7105, 100),
new CoordRec((float) 39.6152, (float) 52.381),
};
@@ -1409,18 +1409,18 @@ static final StrokeRec char89[] = {
/* char: 90 'Z' */
static final CoordRec char90_stroke0[] = {
- new CoordRec((float) 69.1667, (float) 100),
- new CoordRec((float) 2.5, (float) 0),
+ new CoordRec((float) 69.1667, 100),
+ new CoordRec((float) 2.5, 0),
};
static final CoordRec char90_stroke1[] = {
- new CoordRec((float) 2.5, (float) 100),
- new CoordRec((float) 69.1667, (float) 100),
+ new CoordRec((float) 2.5, 100),
+ new CoordRec((float) 69.1667, 100),
};
static final CoordRec char90_stroke2[] = {
- new CoordRec((float) 2.5, (float) 0),
- new CoordRec((float) 69.1667, (float) 0),
+ new CoordRec((float) 2.5, 0),
+ new CoordRec((float) 69.1667, 0),
};
static final StrokeRec char90[] = {
@@ -1461,7 +1461,7 @@ static final StrokeRec char91[] = {
/* char: 92 '\' */
static final CoordRec char92_stroke0[] = {
- new CoordRec((float) 5.84, (float) 100),
+ new CoordRec((float) 5.84, 100),
new CoordRec((float) 72.5067, (float) -14.2857),
};
@@ -1532,12 +1532,12 @@ static final StrokeRec char95[] = {
/* char: 96 '`' */
static final CoordRec char96_stroke0[] = {
- new CoordRec((float) 33.0219, (float) 100),
+ new CoordRec((float) 33.0219, 100),
new CoordRec((float) 56.8314, (float) 71.4286),
};
static final CoordRec char96_stroke1[] = {
- new CoordRec((float) 33.0219, (float) 100),
+ new CoordRec((float) 33.0219, 100),
new CoordRec((float) 28.26, (float) 95.2381),
new CoordRec((float) 56.8314, (float) 71.4286),
};
@@ -1551,7 +1551,7 @@ static final StrokeRec char96[] = {
static final CoordRec char97_stroke0[] = {
new CoordRec((float) 63.8229, (float) 66.6667),
- new CoordRec((float) 63.8229, (float) 0),
+ new CoordRec((float) 63.8229, 0),
};
static final CoordRec char97_stroke1[] = {
@@ -1565,8 +1565,8 @@ static final CoordRec char97_stroke1[] = {
new CoordRec((float) 6.68, (float) 28.5714),
new CoordRec((float) 11.4419, (float) 14.2857),
new CoordRec((float) 20.9657, (float) 4.7619),
- new CoordRec((float) 30.4895, (float) 0),
- new CoordRec((float) 44.7752, (float) 0),
+ new CoordRec((float) 30.4895, 0),
+ new CoordRec((float) 44.7752, 0),
new CoordRec((float) 54.299, (float) 4.7619),
new CoordRec((float) 63.8229, (float) 14.2857),
};
@@ -1579,8 +1579,8 @@ static final StrokeRec char97[] = {
/* char: 98 'b' */
static final CoordRec char98_stroke0[] = {
- new CoordRec((float) 8.76, (float) 100),
- new CoordRec((float) 8.76, (float) 0),
+ new CoordRec((float) 8.76, 100),
+ new CoordRec((float) 8.76, 0),
};
static final CoordRec char98_stroke1[] = {
@@ -1594,8 +1594,8 @@ static final CoordRec char98_stroke1[] = {
new CoordRec((float) 65.9029, (float) 28.5714),
new CoordRec((float) 61.141, (float) 14.2857),
new CoordRec((float) 51.6171, (float) 4.7619),
- new CoordRec((float) 42.0933, (float) 0),
- new CoordRec((float) 27.8076, (float) 0),
+ new CoordRec((float) 42.0933, 0),
+ new CoordRec((float) 27.8076, 0),
new CoordRec((float) 18.2838, (float) 4.7619),
new CoordRec((float) 8.76, (float) 14.2857),
};
@@ -1618,8 +1618,8 @@ static final CoordRec char99_stroke0[] = {
new CoordRec((float) 5.52, (float) 28.5714),
new CoordRec((float) 10.2819, (float) 14.2857),
new CoordRec((float) 19.8057, (float) 4.7619),
- new CoordRec((float) 29.3295, (float) 0),
- new CoordRec((float) 43.6152, (float) 0),
+ new CoordRec((float) 29.3295, 0),
+ new CoordRec((float) 43.6152, 0),
new CoordRec((float) 53.139, (float) 4.7619),
new CoordRec((float) 62.6629, (float) 14.2857),
};
@@ -1631,8 +1631,8 @@ static final StrokeRec char99[] = {
/* char: 100 'd' */
static final CoordRec char100_stroke0[] = {
- new CoordRec((float) 61.7829, (float) 100),
- new CoordRec((float) 61.7829, (float) 0),
+ new CoordRec((float) 61.7829, 100),
+ new CoordRec((float) 61.7829, 0),
};
static final CoordRec char100_stroke1[] = {
@@ -1646,8 +1646,8 @@ static final CoordRec char100_stroke1[] = {
new CoordRec((float) 4.64, (float) 28.5714),
new CoordRec((float) 9.4019, (float) 14.2857),
new CoordRec((float) 18.9257, (float) 4.7619),
- new CoordRec((float) 28.4495, (float) 0),
- new CoordRec((float) 42.7352, (float) 0),
+ new CoordRec((float) 28.4495, 0),
+ new CoordRec((float) 42.7352, 0),
new CoordRec((float) 52.259, (float) 4.7619),
new CoordRec((float) 61.7829, (float) 14.2857),
};
@@ -1673,8 +1673,8 @@ static final CoordRec char101_stroke0[] = {
new CoordRec((float) 5.72, (float) 28.5714),
new CoordRec((float) 10.4819, (float) 14.2857),
new CoordRec((float) 20.0057, (float) 4.7619),
- new CoordRec((float) 29.5295, (float) 0),
- new CoordRec((float) 43.8152, (float) 0),
+ new CoordRec((float) 29.5295, 0),
+ new CoordRec((float) 43.8152, 0),
new CoordRec((float) 53.339, (float) 4.7619),
new CoordRec((float) 62.8629, (float) 14.2857),
};
@@ -1686,11 +1686,11 @@ static final StrokeRec char101[] = {
/* char: 102 'f' */
static final CoordRec char102_stroke0[] = {
- new CoordRec((float) 38.7752, (float) 100),
- new CoordRec((float) 29.2514, (float) 100),
+ new CoordRec((float) 38.7752, 100),
+ new CoordRec((float) 29.2514, 100),
new CoordRec((float) 19.7276, (float) 95.2381),
new CoordRec((float) 14.9657, (float) 80.9524),
- new CoordRec((float) 14.9657, (float) 0),
+ new CoordRec((float) 14.9657, 0),
};
static final CoordRec char102_stroke1[] = {
@@ -1726,8 +1726,8 @@ static final CoordRec char103_stroke1[] = {
new CoordRec((float) 5.36, (float) 28.5714),
new CoordRec((float) 10.1219, (float) 14.2857),
new CoordRec((float) 19.6457, (float) 4.7619),
- new CoordRec((float) 29.1695, (float) 0),
- new CoordRec((float) 43.4552, (float) 0),
+ new CoordRec((float) 29.1695, 0),
+ new CoordRec((float) 43.4552, 0),
new CoordRec((float) 52.979, (float) 4.7619),
new CoordRec((float) 62.5029, (float) 14.2857),
};
@@ -1740,8 +1740,8 @@ static final StrokeRec char103[] = {
/* char: 104 'h' */
static final CoordRec char104_stroke0[] = {
- new CoordRec((float) 9.6, (float) 100),
- new CoordRec((float) 9.6, (float) 0),
+ new CoordRec((float) 9.6, 100),
+ new CoordRec((float) 9.6, 0),
};
static final CoordRec char104_stroke1[] = {
@@ -1751,7 +1751,7 @@ static final CoordRec char104_stroke1[] = {
new CoordRec((float) 47.6952, (float) 66.6667),
new CoordRec((float) 57.219, (float) 61.9048),
new CoordRec((float) 61.981, (float) 47.619),
- new CoordRec((float) 61.981, (float) 0),
+ new CoordRec((float) 61.981, 0),
};
static final StrokeRec char104[] = {
@@ -1762,16 +1762,16 @@ static final StrokeRec char104[] = {
/* char: 105 'i' */
static final CoordRec char105_stroke0[] = {
- new CoordRec((float) 10.02, (float) 100),
+ new CoordRec((float) 10.02, 100),
new CoordRec((float) 14.7819, (float) 95.2381),
- new CoordRec((float) 19.5438, (float) 100),
+ new CoordRec((float) 19.5438, 100),
new CoordRec((float) 14.7819, (float) 104.762),
- new CoordRec((float) 10.02, (float) 100),
+ new CoordRec((float) 10.02, 100),
};
static final CoordRec char105_stroke1[] = {
new CoordRec((float) 14.7819, (float) 66.6667),
- new CoordRec((float) 14.7819, (float) 0),
+ new CoordRec((float) 14.7819, 0),
};
static final StrokeRec char105[] = {
@@ -1782,11 +1782,11 @@ static final StrokeRec char105[] = {
/* char: 106 'j' */
static final CoordRec char106_stroke0[] = {
- new CoordRec((float) 17.3876, (float) 100),
+ new CoordRec((float) 17.3876, 100),
new CoordRec((float) 22.1495, (float) 95.2381),
- new CoordRec((float) 26.9114, (float) 100),
+ new CoordRec((float) 26.9114, 100),
new CoordRec((float) 22.1495, (float) 104.762),
- new CoordRec((float) 17.3876, (float) 100),
+ new CoordRec((float) 17.3876, 100),
};
static final CoordRec char106_stroke1[] = {
@@ -1805,8 +1805,8 @@ static final StrokeRec char106[] = {
/* char: 107 'k' */
static final CoordRec char107_stroke0[] = {
- new CoordRec((float) 9.6, (float) 100),
- new CoordRec((float) 9.6, (float) 0),
+ new CoordRec((float) 9.6, 100),
+ new CoordRec((float) 9.6, 0),
};
static final CoordRec char107_stroke1[] = {
@@ -1816,7 +1816,7 @@ static final CoordRec char107_stroke1[] = {
static final CoordRec char107_stroke2[] = {
new CoordRec((float) 28.6476, (float) 38.0952),
- new CoordRec((float) 61.981, (float) 0),
+ new CoordRec((float) 61.981, 0),
};
static final StrokeRec char107[] = {
@@ -1828,8 +1828,8 @@ static final StrokeRec char107[] = {
/* char: 108 'l' */
static final CoordRec char108_stroke0[] = {
- new CoordRec((float) 10.02, (float) 100),
- new CoordRec((float) 10.02, (float) 0),
+ new CoordRec((float) 10.02, 100),
+ new CoordRec((float) 10.02, 0),
};
static final StrokeRec char108[] = {
@@ -1840,7 +1840,7 @@ static final StrokeRec char108[] = {
static final CoordRec char109_stroke0[] = {
new CoordRec((float) 9.6, (float) 66.6667),
- new CoordRec((float) 9.6, (float) 0),
+ new CoordRec((float) 9.6, 0),
};
static final CoordRec char109_stroke1[] = {
@@ -1850,7 +1850,7 @@ static final CoordRec char109_stroke1[] = {
new CoordRec((float) 47.6952, (float) 66.6667),
new CoordRec((float) 57.219, (float) 61.9048),
new CoordRec((float) 61.981, (float) 47.619),
- new CoordRec((float) 61.981, (float) 0),
+ new CoordRec((float) 61.981, 0),
};
static final CoordRec char109_stroke2[] = {
@@ -1860,7 +1860,7 @@ static final CoordRec char109_stroke2[] = {
new CoordRec((float) 100.076, (float) 66.6667),
new CoordRec((float) 109.6, (float) 61.9048),
new CoordRec((float) 114.362, (float) 47.619),
- new CoordRec((float) 114.362, (float) 0),
+ new CoordRec((float) 114.362, 0),
};
static final StrokeRec char109[] = {
@@ -1873,7 +1873,7 @@ static final StrokeRec char109[] = {
static final CoordRec char110_stroke0[] = {
new CoordRec((float) 9.18, (float) 66.6667),
- new CoordRec((float) 9.18, (float) 0),
+ new CoordRec((float) 9.18, 0),
};
static final CoordRec char110_stroke1[] = {
@@ -1883,7 +1883,7 @@ static final CoordRec char110_stroke1[] = {
new CoordRec((float) 47.2752, (float) 66.6667),
new CoordRec((float) 56.799, (float) 61.9048),
new CoordRec((float) 61.561, (float) 47.619),
- new CoordRec((float) 61.561, (float) 0),
+ new CoordRec((float) 61.561, 0),
};
static final StrokeRec char110[] = {
@@ -1901,8 +1901,8 @@ static final CoordRec char111_stroke0[] = {
new CoordRec((float) 4.98, (float) 28.5714),
new CoordRec((float) 9.7419, (float) 14.2857),
new CoordRec((float) 19.2657, (float) 4.7619),
- new CoordRec((float) 28.7895, (float) 0),
- new CoordRec((float) 43.0752, (float) 0),
+ new CoordRec((float) 28.7895, 0),
+ new CoordRec((float) 43.0752, 0),
new CoordRec((float) 52.599, (float) 4.7619),
new CoordRec((float) 62.1229, (float) 14.2857),
new CoordRec((float) 66.8848, (float) 28.5714),
@@ -1935,8 +1935,8 @@ static final CoordRec char112_stroke1[] = {
new CoordRec((float) 66.6029, (float) 28.5714),
new CoordRec((float) 61.841, (float) 14.2857),
new CoordRec((float) 52.3171, (float) 4.7619),
- new CoordRec((float) 42.7933, (float) 0),
- new CoordRec((float) 28.5076, (float) 0),
+ new CoordRec((float) 42.7933, 0),
+ new CoordRec((float) 28.5076, 0),
new CoordRec((float) 18.9838, (float) 4.7619),
new CoordRec((float) 9.46, (float) 14.2857),
};
@@ -1964,8 +1964,8 @@ static final CoordRec char113_stroke1[] = {
new CoordRec((float) 4.84, (float) 28.5714),
new CoordRec((float) 9.6019, (float) 14.2857),
new CoordRec((float) 19.1257, (float) 4.7619),
- new CoordRec((float) 28.6495, (float) 0),
- new CoordRec((float) 42.9352, (float) 0),
+ new CoordRec((float) 28.6495, 0),
+ new CoordRec((float) 42.9352, 0),
new CoordRec((float) 52.459, (float) 4.7619),
new CoordRec((float) 61.9829, (float) 14.2857),
};
@@ -1979,7 +1979,7 @@ static final StrokeRec char113[] = {
static final CoordRec char114_stroke0[] = {
new CoordRec((float) 9.46, (float) 66.6667),
- new CoordRec((float) 9.46, (float) 0),
+ new CoordRec((float) 9.46, 0),
};
static final CoordRec char114_stroke1[] = {
@@ -2011,8 +2011,8 @@ static final CoordRec char115_stroke0[] = {
new CoordRec((float) 57.081, (float) 19.0476),
new CoordRec((float) 57.081, (float) 14.2857),
new CoordRec((float) 52.319, (float) 4.7619),
- new CoordRec((float) 38.0333, (float) 0),
- new CoordRec((float) 23.7476, (float) 0),
+ new CoordRec((float) 38.0333, 0),
+ new CoordRec((float) 23.7476, 0),
new CoordRec((float) 9.4619, (float) 4.7619),
new CoordRec((float) 4.7, (float) 14.2857),
};
@@ -2024,11 +2024,11 @@ static final StrokeRec char115[] = {
/* char: 116 't' */
static final CoordRec char116_stroke0[] = {
- new CoordRec((float) 14.8257, (float) 100),
+ new CoordRec((float) 14.8257, 100),
new CoordRec((float) 14.8257, (float) 19.0476),
new CoordRec((float) 19.5876, (float) 4.7619),
- new CoordRec((float) 29.1114, (float) 0),
- new CoordRec((float) 38.6352, (float) 0),
+ new CoordRec((float) 29.1114, 0),
+ new CoordRec((float) 38.6352, 0),
};
static final CoordRec char116_stroke1[] = {
@@ -2047,15 +2047,15 @@ static final CoordRec char117_stroke0[] = {
new CoordRec((float) 9.46, (float) 66.6667),
new CoordRec((float) 9.46, (float) 19.0476),
new CoordRec((float) 14.2219, (float) 4.7619),
- new CoordRec((float) 23.7457, (float) 0),
- new CoordRec((float) 38.0314, (float) 0),
+ new CoordRec((float) 23.7457, 0),
+ new CoordRec((float) 38.0314, 0),
new CoordRec((float) 47.5552, (float) 4.7619),
new CoordRec((float) 61.841, (float) 19.0476),
};
static final CoordRec char117_stroke1[] = {
new CoordRec((float) 61.841, (float) 66.6667),
- new CoordRec((float) 61.841, (float) 0),
+ new CoordRec((float) 61.841, 0),
};
static final StrokeRec char117[] = {
@@ -2067,12 +2067,12 @@ static final StrokeRec char117[] = {
static final CoordRec char118_stroke0[] = {
new CoordRec((float) 1.8, (float) 66.6667),
- new CoordRec((float) 30.3714, (float) 0),
+ new CoordRec((float) 30.3714, 0),
};
static final CoordRec char118_stroke1[] = {
new CoordRec((float) 58.9429, (float) 66.6667),
- new CoordRec((float) 30.3714, (float) 0),
+ new CoordRec((float) 30.3714, 0),
};
static final StrokeRec char118[] = {
@@ -2084,22 +2084,22 @@ static final StrokeRec char118[] = {
static final CoordRec char119_stroke0[] = {
new CoordRec((float) 2.5, (float) 66.6667),
- new CoordRec((float) 21.5476, (float) 0),
+ new CoordRec((float) 21.5476, 0),
};
static final CoordRec char119_stroke1[] = {
new CoordRec((float) 40.5952, (float) 66.6667),
- new CoordRec((float) 21.5476, (float) 0),
+ new CoordRec((float) 21.5476, 0),
};
static final CoordRec char119_stroke2[] = {
new CoordRec((float) 40.5952, (float) 66.6667),
- new CoordRec((float) 59.6429, (float) 0),
+ new CoordRec((float) 59.6429, 0),
};
static final CoordRec char119_stroke3[] = {
new CoordRec((float) 78.6905, (float) 66.6667),
- new CoordRec((float) 59.6429, (float) 0),
+ new CoordRec((float) 59.6429, 0),
};
static final StrokeRec char119[] = {
@@ -2113,12 +2113,12 @@ static final StrokeRec char119[] = {
static final CoordRec char120_stroke0[] = {
new CoordRec((float) 1.66, (float) 66.6667),
- new CoordRec((float) 54.041, (float) 0),
+ new CoordRec((float) 54.041, 0),
};
static final CoordRec char120_stroke1[] = {
new CoordRec((float) 54.041, (float) 66.6667),
- new CoordRec((float) 1.66, (float) 0),
+ new CoordRec((float) 1.66, 0),
};
static final StrokeRec char120[] = {
@@ -2130,12 +2130,12 @@ static final StrokeRec char120[] = {
static final CoordRec char121_stroke0[] = {
new CoordRec((float) 6.5619, (float) 66.6667),
- new CoordRec((float) 35.1333, (float) 0),
+ new CoordRec((float) 35.1333, 0),
};
static final CoordRec char121_stroke1[] = {
new CoordRec((float) 63.7048, (float) 66.6667),
- new CoordRec((float) 35.1333, (float) 0),
+ new CoordRec((float) 35.1333, 0),
new CoordRec((float) 25.6095, (float) -19.0476),
new CoordRec((float) 16.0857, (float) -28.5714),
new CoordRec((float) 6.5619, (float) -33.3333),
@@ -2151,7 +2151,7 @@ static final StrokeRec char121[] = {
static final CoordRec char122_stroke0[] = {
new CoordRec((float) 56.821, (float) 66.6667),
- new CoordRec((float) 4.44, (float) 0),
+ new CoordRec((float) 4.44, 0),
};
static final CoordRec char122_stroke1[] = {
@@ -2160,8 +2160,8 @@ static final CoordRec char122_stroke1[] = {
};
static final CoordRec char122_stroke2[] = {
- new CoordRec((float) 4.44, (float) 0),
- new CoordRec((float) 56.821, (float) 0),
+ new CoordRec((float) 4.44, 0),
+ new CoordRec((float) 56.821, 0),
};
static final StrokeRec char122[] = {
@@ -2176,7 +2176,7 @@ static final CoordRec char123_stroke0[] = {
new CoordRec((float) 31.1895, (float) 119.048),
new CoordRec((float) 21.6657, (float) 114.286),
new CoordRec((float) 16.9038, (float) 109.524),
- new CoordRec((float) 12.1419, (float) 100),
+ new CoordRec((float) 12.1419, 100),
new CoordRec((float) 12.1419, (float) 90.4762),
new CoordRec((float) 16.9038, (float) 80.9524),
new CoordRec((float) 21.6657, (float) 76.1905),
@@ -2199,7 +2199,7 @@ static final CoordRec char123_stroke1[] = {
new CoordRec((float) 31.1895, (float) 23.8095),
new CoordRec((float) 31.1895, (float) 14.2857),
new CoordRec((float) 26.4276, (float) 4.7619),
- new CoordRec((float) 21.6657, (float) 0),
+ new CoordRec((float) 21.6657, 0),
new CoordRec((float) 16.9038, (float) -9.5238),
new CoordRec((float) 16.9038, (float) -19.0476),
new CoordRec((float) 21.6657, (float) -28.5714),
@@ -2241,7 +2241,7 @@ static final CoordRec char125_stroke0[] = {
new CoordRec((float) 9.18, (float) 119.048),
new CoordRec((float) 18.7038, (float) 114.286),
new CoordRec((float) 23.4657, (float) 109.524),
- new CoordRec((float) 28.2276, (float) 100),
+ new CoordRec((float) 28.2276, 100),
new CoordRec((float) 28.2276, (float) 90.4762),
new CoordRec((float) 23.4657, (float) 80.9524),
new CoordRec((float) 18.7038, (float) 76.1905),
@@ -2264,7 +2264,7 @@ static final CoordRec char125_stroke1[] = {
new CoordRec((float) 9.18, (float) 23.8095),
new CoordRec((float) 9.18, (float) 14.2857),
new CoordRec((float) 13.9419, (float) 4.7619),
- new CoordRec((float) 18.7038, (float) 0),
+ new CoordRec((float) 18.7038, 0),
new CoordRec((float) 23.4657, (float) -9.5238),
new CoordRec((float) 23.4657, (float) -19.0476),
new CoordRec((float) 18.7038, (float) -28.5714),
@@ -2327,7 +2327,7 @@ static final StrokeRec char126[] = {
/* char: 127 */
static final CoordRec char127_stroke0[] = {
- new CoordRec((float) 52.381, (float) 100),
+ new CoordRec((float) 52.381, 100),
new CoordRec((float) 14.2857, (float) -33.3333),
};
@@ -2335,12 +2335,12 @@ static final CoordRec char127_stroke1[] = {
new CoordRec((float) 28.5714, (float) 66.6667),
new CoordRec((float) 14.2857, (float) 61.9048),
new CoordRec((float) 4.7619, (float) 52.381),
- new CoordRec((float) 0, (float) 38.0952),
- new CoordRec((float) 0, (float) 23.8095),
+ new CoordRec(0, (float) 38.0952),
+ new CoordRec(0, (float) 23.8095),
new CoordRec((float) 4.7619, (float) 14.2857),
new CoordRec((float) 14.2857, (float) 4.7619),
- new CoordRec((float) 28.5714, (float) 0),
- new CoordRec((float) 38.0952, (float) 0),
+ new CoordRec((float) 28.5714, 0),
+ new CoordRec((float) 38.0952, 0),
new CoordRec((float) 52.381, (float) 4.7619),
new CoordRec((float) 61.9048, (float) 14.2857),
new CoordRec((float) 66.6667, (float) 28.5714),
@@ -2357,38 +2357,38 @@ static final StrokeRec char127[] = {
};
static final StrokeCharRec chars[] = {
- new StrokeCharRec( 0, /* char0 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char1 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char2 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char3 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char4 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char5 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char6 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char7 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char8 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char9 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char10 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char11 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char12 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char13 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char14 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char15 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char16 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char17 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char18 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char19 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char20 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char21 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char22 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char23 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char24 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char25 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char26 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char27 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char28 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char29 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char30 */ null, (float) 0, (float) 0 ),
- new StrokeCharRec( 0, /* char31 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char0 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char1 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char2 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char3 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char4 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char5 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char6 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char7 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char8 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char9 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char10 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char11 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char12 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char13 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char14 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char15 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char16 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char17 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char18 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char19 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char20 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char21 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char22 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char23 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char24 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char25 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char26 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char27 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char28 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char29 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char30 */ null, 0, 0 ),
+ new StrokeCharRec( 0, /* char31 */ null, 0, 0 ),
new StrokeCharRec( 0, /* char32 */ null, (float) 52.381, (float) 104.762 ),
new StrokeCharRec( 2, char33, (float) 13.3819, (float) 26.6238 ),
new StrokeCharRec( 2, char34, (float) 23.0676, (float) 51.4352 ),
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java
index 515212f0e..59935e358 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java
@@ -51,10 +51,10 @@ class StrokeCharRec {
public float center;
public float right;
- public StrokeCharRec(int num_strokes,
- StrokeRec[] stroke,
- float center,
- float right) {
+ public StrokeCharRec(final int num_strokes,
+ final StrokeRec[] stroke,
+ final float center,
+ final float right) {
this.num_strokes = num_strokes;
this.stroke = stroke;
this.center = center;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java
index 5335c8523..5810ac38a 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java
@@ -52,11 +52,11 @@ class StrokeFontRec {
public float top;
public float bottom;
- public StrokeFontRec(String name,
- int num_chars,
- StrokeCharRec[] ch,
- float top,
- float bottom) {
+ public StrokeFontRec(final String name,
+ final int num_chars,
+ final StrokeCharRec[] ch,
+ final float top,
+ final float bottom) {
this.name = name;
this.num_chars = num_chars;
this.ch = ch;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java
index b0c91c696..fcb7c912a 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java
@@ -49,8 +49,8 @@ class StrokeRec {
public int num_coords;
public CoordRec[] coord;
- public StrokeRec(int num_coords,
- CoordRec[] coord) {
+ public StrokeRec(final int num_coords,
+ final CoordRec[] coord) {
this.num_coords = num_coords;
this.coord = coord;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
index 7c6a40468..4a3e5b2e1 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
@@ -96,7 +96,7 @@ public class ShaderCode {
*
* @throws IllegalArgumentException if <code>count</count> and <code>source.length</code> do not match
*/
- public ShaderCode(int type, int count, CharSequence[][] source) {
+ public ShaderCode(final int type, final int count, final CharSequence[][] source) {
if(source.length != count) {
throw new IllegalArgumentException("shader number ("+count+") and sourceFiles array ("+source.length+") of different lenght.");
}
@@ -126,7 +126,7 @@ public class ShaderCode {
* @param count number of shaders
* @param binary binary buffer containing the shader binaries,
*/
- public ShaderCode(int type, int count, int binFormat, Buffer binary) {
+ public ShaderCode(final int type, final int count, final int binFormat, final Buffer binary) {
switch (type) {
case GL2ES2.GL_VERTEX_SHADER:
case GL2ES2.GL_FRAGMENT_SHADER:
@@ -162,7 +162,7 @@ public class ShaderCode {
* @throws IllegalArgumentException if <code>count</count> and <code>sourceFiles.length</code> do not match
* @see #readShaderSource(Class, String)
*/
- public static ShaderCode create(GL2ES2 gl, int type, int count, Class<?> context, String[] sourceFiles, boolean mutableStringBuilder) {
+ public static ShaderCode create(final GL2ES2 gl, final int type, final int count, final Class<?> context, final String[] sourceFiles, final boolean mutableStringBuilder) {
if(null != gl && !ShaderUtil.isShaderCompilerAvailable(gl)) {
return null;
}
@@ -174,7 +174,7 @@ public class ShaderCode {
for(int i=0; i<sourceFiles.length; i++) {
try {
shaderSources[i][0] = readShaderSource(context, sourceFiles[i], mutableStringBuilder);
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
throw new RuntimeException("readShaderSource("+sourceFiles[i]+") error: ", ioe);
}
if(null == shaderSources[i][0]) {
@@ -201,12 +201,12 @@ public class ShaderCode {
* @see #readShaderBinary(Class, String)
* @see ShaderUtil#getShaderBinaryFormats(GL)
*/
- public static ShaderCode create(int type, int count, Class<?> context, int binFormat, String binaryFile) {
+ public static ShaderCode create(final int type, final int count, final Class<?> context, int binFormat, final String binaryFile) {
ByteBuffer shaderBinary = null;
if(null!=binaryFile && 0<=binFormat) {
try {
shaderBinary = readShaderBinary(context, binaryFile);
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
throw new RuntimeException("readShaderBinary("+binaryFile+") error: ", ioe);
}
if(null == shaderBinary) {
@@ -238,7 +238,7 @@ public class ShaderCode {
*
* @see #create(GL2ES2, int, Class, String, String, String, boolean)
*/
- public static String getFileSuffix(boolean binary, int type) {
+ public static String getFileSuffix(final boolean binary, final int type) {
switch (type) {
case GL2ES2.GL_VERTEX_SHADER:
return binary?SUFFIX_VERTEX_BINARY:SUFFIX_VERTEX_SOURCE;
@@ -261,7 +261,7 @@ public class ShaderCode {
*
* @see #create(GL2ES2, int, Class, String, String, String, boolean)
*/
- public static String getBinarySubPath(int binFormat) {
+ public static String getBinarySubPath(final int binFormat) {
switch (binFormat) {
case GLES2.GL_NVIDIA_PLATFORM_BINARY_NV:
return SUB_PATH_NVIDIA;
@@ -347,9 +347,9 @@ public class ShaderCode {
* @see ShaderUtil#getShaderBinaryFormats(GL)
* @see #getBinarySubPath(int)
*/
- public static ShaderCode create(GL2ES2 gl, int type, int count, Class<?> context,
- String srcRoot, String[] srcBasenames, String binRoot, String binBasename,
- boolean mutableStringBuilder) {
+ public static ShaderCode create(final GL2ES2 gl, final int type, final int count, final Class<?> context,
+ final String srcRoot, final String[] srcBasenames, final String binRoot, final String binBasename,
+ final boolean mutableStringBuilder) {
ShaderCode res = null;
final String srcPath[];
String srcPathString = null;
@@ -376,10 +376,10 @@ public class ShaderCode {
srcPath = null;
}
if( null!=binBasename ) {
- Set<Integer> binFmts = ShaderUtil.getShaderBinaryFormats(gl);
+ final Set<Integer> binFmts = ShaderUtil.getShaderBinaryFormats(gl);
final String binSuffix = getFileSuffix(true, type);
- for(Iterator<Integer> iter=binFmts.iterator(); iter.hasNext(); ) {
- int bFmt = iter.next().intValue();
+ for(final Iterator<Integer> iter=binFmts.iterator(); iter.hasNext(); ) {
+ final int bFmt = iter.next().intValue();
final String bFmtPath = getBinarySubPath(bFmt);
if(null==bFmtPath) continue;
binFileName = binRoot + '/' + bFmtPath + '/' + binBasename + "." + binSuffix;
@@ -447,8 +447,8 @@ public class ShaderCode {
*
* @see #create(GL2ES2, int, int, Class, String, String[], String, String)
*/
- public static ShaderCode create(GL2ES2 gl, int type, Class<?> context,
- String srcRoot, String binRoot, String basename, boolean mutableStringBuilder) {
+ public static ShaderCode create(final GL2ES2 gl, final int type, final Class<?> context,
+ final String srcRoot, final String binRoot, final String basename, final boolean mutableStringBuilder) {
return create(gl, type, 1, context, srcRoot, new String[] { basename }, binRoot, basename, mutableStringBuilder );
}
@@ -460,7 +460,7 @@ public class ShaderCode {
public int shaderType() { return shaderType; }
public String shaderTypeStr() { return shaderTypeStr(shaderType); }
- public static String shaderTypeStr(int type) {
+ public static String shaderTypeStr(final int type) {
switch (type) {
case GL2ES2.GL_VERTEX_SHADER:
return "VERTEX_SHADER";
@@ -480,10 +480,10 @@ public class ShaderCode {
public IntBuffer shader() { return shader; }
- public boolean compile(GL2ES2 gl) {
+ public boolean compile(final GL2ES2 gl) {
return compile(gl, null);
}
- public boolean compile(GL2ES2 gl, PrintStream verboseOut) {
+ public boolean compile(final GL2ES2 gl, final PrintStream verboseOut) {
if(isValid()) return true;
// Create & Compile the vertex/fragment shader objects
@@ -503,7 +503,7 @@ public class ShaderCode {
return valid;
}
- public void destroy(GL2ES2 gl) {
+ public void destroy(final GL2ES2 gl) {
if(isValid()) {
if(null!=gl) {
ShaderUtil.deleteShader(gl, shader());
@@ -521,7 +521,7 @@ public class ShaderCode {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if(this==obj) { return true; }
if(obj instanceof ShaderCode) {
return id()==((ShaderCode)obj).id();
@@ -534,7 +534,7 @@ public class ShaderCode {
}
@Override
public String toString() {
- StringBuilder buf = new StringBuilder("ShaderCode[id="+id+", type="+shaderTypeStr()+", valid="+valid+", shader: ");
+ final StringBuilder buf = new StringBuilder("ShaderCode[id="+id+", type="+shaderTypeStr()+", valid="+valid+", shader: ");
for(int i=0; i<shader.remaining(); i++) {
buf.append(" "+shader.get(i));
}
@@ -546,7 +546,7 @@ public class ShaderCode {
return buf.toString();
}
- public void dumpShaderSource(PrintStream out) {
+ public void dumpShaderSource(final PrintStream out) {
if(null==shaderSource) {
out.println("<no shader source>");
return;
@@ -560,7 +560,7 @@ public class ShaderCode {
if(i>=sourceCount) {
out.println("<no shader source>");
} else {
- CharSequence[] src = shaderSource[i];
+ final CharSequence[] src = shaderSource[i];
int lineno=0;
for(int j=0; j<src.length; j++) {
@@ -572,7 +572,7 @@ public class ShaderCode {
lineno++;
out.printf("%4d: %s\n", lineno, line);
}
- } catch (IOException e) { /* impossible .. StringReader */ }
+ } catch (final IOException e) { /* impossible .. StringReader */ }
}
}
out.println("--------------------------------------------------------------");
@@ -593,7 +593,7 @@ public class ShaderCode {
*
* @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type <code>StringBuilder</code>
*/
- public int insertShaderSource(int shaderIdx, String tag, int fromIndex, CharSequence data) {
+ public int insertShaderSource(final int shaderIdx, final String tag, final int fromIndex, final CharSequence data) {
if(null==shaderSource) {
throw new IllegalStateException("no shader source");
}
@@ -650,7 +650,7 @@ public class ShaderCode {
*
* @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type <code>StringBuilder</code>
*/
- public int replaceInShaderSource(String oldName, String newName) {
+ public int replaceInShaderSource(final String oldName, final String newName) {
if(null==shaderSource) {
throw new IllegalStateException("no shader source");
}
@@ -670,9 +670,9 @@ public class ShaderCode {
final StringBuilder sb = (StringBuilder)src[j];
int curPos = 0;
while(curPos<sb.length()-oldNameLen+1) {
- int startIdx = sb.indexOf(oldName, curPos);
+ final int startIdx = sb.indexOf(oldName, curPos);
if(0<=startIdx) {
- int endIdx = startIdx + oldNameLen;
+ final int endIdx = startIdx + oldNameLen;
sb.replace(startIdx, endIdx, newName);
curPos = startIdx + newNameLen;
num++;
@@ -698,7 +698,7 @@ public class ShaderCode {
*
* @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type <code>StringBuilder</code>
*/
- public int insertShaderSource(int shaderIdx, int position, CharSequence data) {
+ public int insertShaderSource(final int shaderIdx, int position, final CharSequence data) {
if(null==shaderSource) {
throw new IllegalStateException("no shader source");
}
@@ -750,7 +750,7 @@ public class ShaderCode {
* @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type <code>StringBuilder</code>
* @see IOUtil#getResource(Class, String)
*/
- public int insertShaderSource(int shaderIdx, int position, Class<?> context, String path) throws IOException {
+ public int insertShaderSource(final int shaderIdx, final int position, final Class<?> context, final String path) throws IOException {
final CharSequence data = readShaderSource(context, path, true);
if( null != data ) {
return insertShaderSource(shaderIdx, position, data);
@@ -760,7 +760,7 @@ public class ShaderCode {
}
@SuppressWarnings("resource")
- private static int readShaderSource(Class<?> context, URLConnection conn, StringBuilder result, int lineno) throws IOException {
+ private static int readShaderSource(final Class<?> context, final URLConnection conn, final StringBuilder result, int lineno) throws IOException {
if(DEBUG_CODE) {
if(0 == lineno) {
result.append("// "+conn.getURL().toExternalForm()+"\n");
@@ -774,7 +774,7 @@ public class ShaderCode {
while ((line = reader.readLine()) != null) {
lineno++;
if (line.startsWith("#include ")) {
- String includeFile = line.substring(9).trim();
+ final String includeFile = line.substring(9).trim();
URLConnection nextConn = null;
// Try relative of current shader location
@@ -805,7 +805,7 @@ public class ShaderCode {
* @param result
* @throws IOException
*/
- public static void readShaderSource(Class<?> context, URLConnection conn, StringBuilder result) throws IOException {
+ public static void readShaderSource(final Class<?> context, final URLConnection conn, final StringBuilder result) throws IOException {
readShaderSource(context, conn, result, 0);
}
@@ -829,12 +829,12 @@ public class ShaderCode {
*
* @see IOUtil#getResource(Class, String)
*/
- public static CharSequence readShaderSource(Class<?> context, String path, boolean mutableStringBuilder) throws IOException {
- URLConnection conn = IOUtil.getResource(context, path);
+ public static CharSequence readShaderSource(final Class<?> context, final String path, final boolean mutableStringBuilder) throws IOException {
+ final URLConnection conn = IOUtil.getResource(context, path);
if (conn == null) {
return null;
}
- StringBuilder result = new StringBuilder();
+ final StringBuilder result = new StringBuilder();
readShaderSource(context, conn, result);
return mutableStringBuilder ? result : result.toString();
}
@@ -853,7 +853,7 @@ public class ShaderCode {
*
* @see IOUtil#getResource(Class, String)
*/
- public static ByteBuffer readShaderBinary(Class<?> context, String path) throws IOException {
+ public static ByteBuffer readShaderBinary(final Class<?> context, final String path) throws IOException {
final URLConnection conn = IOUtil.getResource(context, path);
if (conn == null) {
return null;
@@ -901,7 +901,7 @@ public class ShaderCode {
* @param behavior shall be either {@link #REQUIRE}, {@link #ENABLE}, {@link #DISABLE} or {@link #WARN}
* @return the complete extension directive
*/
- public static String createExtensionDirective(String extensionName, String behavior) {
+ public static String createExtensionDirective(final String extensionName, final String behavior) {
return "#extension " + extensionName + " : " + behavior + "\n";
}
@@ -913,7 +913,7 @@ public class ShaderCode {
* @param gl a GL context, which must have been made current once
* @return the index after the inserted data, maybe 0 if nothing has be inserted.
*/
- public final int addGLSLVersion(GL2ES2 gl) {
+ public final int addGLSLVersion(final GL2ES2 gl) {
return insertShaderSource(0, 0, gl.getContext().getGLSLVersionString());
}
@@ -929,7 +929,7 @@ public class ShaderCode {
* @param pos position within this mutable shader source.
* @return the index after the inserted data, maybe 0 if nothing has be inserted.
*/
- public final int addDefaultShaderPrecision(GL2ES2 gl, int pos) {
+ public final int addDefaultShaderPrecision(final GL2ES2 gl, int pos) {
final String defaultPrecision;
if( gl.isGLES3() ) {
switch ( shaderType ) {
@@ -973,7 +973,7 @@ public class ShaderCode {
}
/** Returns true, if GLSL version requires default precision, i.e. ES2 or GLSL [1.30 .. 1.50[. */
- public static final boolean requiresDefaultPrecision(GL2ES2 gl) {
+ public static final boolean requiresDefaultPrecision(final GL2ES2 gl) {
if( gl.isGLES() ) {
return true;
}
@@ -981,7 +981,7 @@ public class ShaderCode {
}
/** Returns true, if GL3 GLSL version requires default precision, i.e. GLSL [1.30 .. 1.50[. */
- public static final boolean requiresGL3DefaultPrecision(GL2ES2 gl) {
+ public static final boolean requiresGL3DefaultPrecision(final GL2ES2 gl) {
if( gl.isGL3() ) {
final VersionNumber glslVersion = gl.getContext().getGLSLVersionNumber();
return glslVersion.compareTo(GLContext.Version130) >= 0 && glslVersion.compareTo(GLContext.Version150) < 0 ;
@@ -1005,7 +1005,7 @@ public class ShaderCode {
* @see #addGLSLVersion(GL2ES2)
* @see #addDefaultShaderPrecision(GL2ES2, int)
*/
- public final int defaultShaderCustomization(GL2ES2 gl, boolean preludeVersion, boolean addDefaultPrecision) {
+ public final int defaultShaderCustomization(final GL2ES2 gl, final boolean preludeVersion, final boolean addDefaultPrecision) {
int pos;
if( preludeVersion ) {
pos = addGLSLVersion(gl);
@@ -1031,7 +1031,7 @@ public class ShaderCode {
* @see #addGLSLVersion(GL2ES2)
* @see #addDefaultShaderPrecision(GL2ES2, int)
*/
- public final int defaultShaderCustomization(GL2ES2 gl, boolean preludeVersion, String esDefaultPrecision) {
+ public final int defaultShaderCustomization(final GL2ES2 gl, final boolean preludeVersion, final String esDefaultPrecision) {
int pos;
if( preludeVersion ) {
pos = addGLSLVersion(gl);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
index 3ac17b0c5..a9b0bddc6 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
@@ -65,7 +65,7 @@ public class ShaderProgram {
*
* @see #release(GL2ES2, boolean)
*/
- public synchronized void destroy(GL2ES2 gl) {
+ public synchronized void destroy(final GL2ES2 gl) {
release(gl, true);
}
@@ -76,7 +76,7 @@ public class ShaderProgram {
*
* @see #release(GL2ES2, boolean)
*/
- public synchronized void release(GL2ES2 gl) {
+ public synchronized void release(final GL2ES2 gl) {
release(gl, false);
}
@@ -84,12 +84,12 @@ public class ShaderProgram {
* Detaches all shader codes and deletes the program.
* If <code>destroyShaderCode</code> is true it destroys the shader codes as well.
*/
- public synchronized void release(GL2ES2 gl, boolean destroyShaderCode) {
+ public synchronized void release(final GL2ES2 gl, final boolean destroyShaderCode) {
if( programLinked ) {
useProgram(gl, false);
}
- for(Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
- ShaderCode shaderCode = iter.next();
+ for(final Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
+ final ShaderCode shaderCode = iter.next();
if(attachedShaderCode.remove(shaderCode)) {
ShaderUtil.detachShader(gl, shaderProgram, shaderCode.shader());
}
@@ -115,11 +115,11 @@ public class ShaderProgram {
* <p>This command does not compile and attach the shader,
* use {@link #add(GL2ES2, ShaderCode)} for this purpose.</p>
*/
- public synchronized void add(ShaderCode shaderCode) throws GLException {
+ public synchronized void add(final ShaderCode shaderCode) throws GLException {
allShaderCode.add(shaderCode);
}
- public synchronized boolean contains(ShaderCode shaderCode) {
+ public synchronized boolean contains(final ShaderCode shaderCode) {
return allShaderCode.contains(shaderCode);
}
@@ -128,9 +128,9 @@ public class ShaderProgram {
* @param id
* @return
*/
- public synchronized ShaderCode getShader(int id) {
- for(Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
- ShaderCode shaderCode = iter.next();
+ public synchronized ShaderCode getShader(final int id) {
+ for(final Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
+ final ShaderCode shaderCode = iter.next();
if(shaderCode.id() == id) {
return shaderCode;
}
@@ -149,7 +149,7 @@ public class ShaderProgram {
* @param gl
* @return true if shader program is valid, i.e. not zero
*/
- public synchronized final boolean init(GL2ES2 gl) {
+ public synchronized final boolean init(final GL2ES2 gl) {
if( 0 == shaderProgram ) {
shaderProgram = gl.glCreateProgram();
}
@@ -163,7 +163,7 @@ public class ShaderProgram {
*
* @return true if the shader was successfully added, false if compilation failed.
*/
- public synchronized boolean add(GL2ES2 gl, ShaderCode shaderCode, PrintStream verboseOut) {
+ public synchronized boolean add(final GL2ES2 gl, final ShaderCode shaderCode, final PrintStream verboseOut) {
if( !init(gl) ) { return false; }
if( allShaderCode.add(shaderCode) ) {
if( !shaderCode.compile(gl, verboseOut) ) {
@@ -195,12 +195,12 @@ public class ShaderProgram {
* @see ShaderState#glResetAllVertexAttributes
* @see ShaderState#glResetAllVertexAttributes
*/
- public synchronized boolean replaceShader(GL2ES2 gl, ShaderCode oldShader, ShaderCode newShader, PrintStream verboseOut) {
+ public synchronized boolean replaceShader(final GL2ES2 gl, final ShaderCode oldShader, final ShaderCode newShader, final PrintStream verboseOut) {
if(!init(gl) || !newShader.compile(gl, verboseOut)) {
return false;
}
- boolean shaderWasInUse = inUse();
+ final boolean shaderWasInUse = inUse();
if(shaderWasInUse) {
useProgram(gl, false);
}
@@ -238,13 +238,13 @@ public class ShaderProgram {
*
* @see #init(GL2ES2)
*/
- public synchronized boolean link(GL2ES2 gl, PrintStream verboseOut) {
+ public synchronized boolean link(final GL2ES2 gl, final PrintStream verboseOut) {
if( !init(gl) ) {
programLinked = false; // mark unlinked due to user attempt to [re]link
return false;
}
- for(Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
+ for(final Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
final ShaderCode shaderCode = iter.next();
if(!shaderCode.compile(gl, verboseOut)) {
programLinked = false; // mark unlinked due to user attempt to [re]link
@@ -264,7 +264,7 @@ public class ShaderProgram {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if(this == obj) { return true; }
if(obj instanceof ShaderProgram) {
return id()==((ShaderProgram)obj).id();
@@ -283,7 +283,7 @@ public class ShaderProgram {
}
sb.append("ShaderProgram[id=").append(id);
sb.append(", linked="+programLinked+", inUse="+programInUse+", program: "+shaderProgram+",");
- for(Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
+ for(final Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
sb.append(Platform.getNewline()).append(" ").append(iter.next());
}
sb.append("]");
@@ -299,11 +299,11 @@ public class ShaderProgram {
* Performs {@link GL2ES2#glValidateProgram(int)} via {@link ShaderUtil#isProgramExecStatusValid(GL, int, PrintStream)}.
* @see ShaderUtil#isProgramExecStatusValid(GL, int, PrintStream)
**/
- public synchronized boolean validateProgram(GL2ES2 gl, PrintStream verboseOut) {
+ public synchronized boolean validateProgram(final GL2ES2 gl, final PrintStream verboseOut) {
return ShaderUtil.isProgramExecStatusValid(gl, shaderProgram, verboseOut);
}
- public synchronized void useProgram(GL2ES2 gl, boolean on) {
+ public synchronized void useProgram(final GL2ES2 gl, boolean on) {
if(!programLinked) { throw new GLException("Program is not linked"); }
if(programInUse==on) { return; }
if( 0 == shaderProgram ) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
index 64dd589b8..c841f2f09 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
@@ -41,6 +41,7 @@ import javax.media.opengl.GLUniformData;
import jogamp.opengl.Debug;
import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.opengl.util.GLArrayDataEditable;
/**
@@ -60,7 +61,7 @@ public class ShaderState {
static {
Debug.initSingleton();
- DEBUG = Debug.isPropertyDefined("jogl.debug.GLSLState", true);
+ DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.GLSLState", true);
}
public ShaderState() {
@@ -68,12 +69,12 @@ public class ShaderState {
public boolean verbose() { return verbose; }
- public void setVerbose(boolean v) { verbose = DEBUG || v; }
+ public void setVerbose(final boolean v) { verbose = DEBUG || v; }
/**
* Returns the attached user object for the given name to this ShaderState.
*/
- public final Object getAttachedObject(String name) {
+ public final Object getAttachedObject(final String name) {
return attachedObjectsByString.get(name);
}
@@ -83,7 +84,7 @@ public class ShaderState {
*
* @return the previous mapped object or null if none
*/
- public final Object attachObject(String name, Object obj) {
+ public final Object attachObject(final String name, final Object obj) {
return attachedObjectsByString.put(name, obj);
}
@@ -92,7 +93,7 @@ public class ShaderState {
*
* @return the previous mapped object or null if none
*/
- public final Object detachObject(String name) {
+ public final Object detachObject(final String name) {
return attachedObjectsByString.remove(name);
}
@@ -103,7 +104,7 @@ public class ShaderState {
*
* @see com.jogamp.opengl.util.glsl.ShaderState#useProgram(GL2ES2, boolean)
*/
- public synchronized void useProgram(GL2ES2 gl, boolean on) throws GLException {
+ public synchronized void useProgram(final GL2ES2 gl, final boolean on) throws GLException {
if(null==shaderProgram) { throw new GLException("No program is attached"); }
if(on) {
if(shaderProgram.linked()) {
@@ -154,10 +155,10 @@ public class ShaderState {
*
* @throws GLException if program was not linked and linking fails
*/
- public synchronized boolean attachShaderProgram(GL2ES2 gl, ShaderProgram prog, boolean enable) throws GLException {
+ public synchronized boolean attachShaderProgram(final GL2ES2 gl, final ShaderProgram prog, final boolean enable) throws GLException {
if(verbose) {
- int curId = (null!=shaderProgram)?shaderProgram.id():-1;
- int newId = (null!=prog)?prog.id():-1;
+ final int curId = (null!=shaderProgram)?shaderProgram.id():-1;
+ final int newId = (null!=prog)?prog.id():-1;
System.err.println("ShaderState: attachShaderProgram: "+curId+" -> "+newId+" (enable: "+enable+")\n\t"+shaderProgram+"\n\t"+prog);
if(DEBUG) {
Thread.dumpStack();
@@ -213,7 +214,7 @@ public class ShaderState {
* @see #glReleaseAllUniforms
* @see #release(GL2ES2, boolean, boolean, boolean)
*/
- public synchronized void destroy(GL2ES2 gl) {
+ public synchronized void destroy(final GL2ES2 gl) {
release(gl, true, true, true);
attachedObjectsByString.clear();
}
@@ -225,7 +226,7 @@ public class ShaderState {
* @see #glReleaseAllUniforms
* @see #release(GL2ES2, boolean, boolean, boolean)
*/
- public synchronized void releaseAllData(GL2ES2 gl) {
+ public synchronized void releaseAllData(final GL2ES2 gl) {
release(gl, false, false, false);
}
@@ -234,12 +235,12 @@ public class ShaderState {
* @see #glReleaseAllUniforms
* @see ShaderProgram#release(GL2ES2, boolean)
*/
- public synchronized void release(GL2ES2 gl, boolean destroyBoundAttributes, boolean destroyShaderProgram, boolean destroyShaderCode) {
+ public synchronized void release(final GL2ES2 gl, final boolean destroyBoundAttributes, final boolean destroyShaderProgram, final boolean destroyShaderCode) {
if(null!=shaderProgram && shaderProgram.linked() ) {
shaderProgram.useProgram(gl, false);
}
if(destroyBoundAttributes) {
- for(Iterator<GLArrayData> iter = managedAttributes.iterator(); iter.hasNext(); ) {
+ for(final Iterator<GLArrayData> iter = managedAttributes.iterator(); iter.hasNext(); ) {
iter.next().destroy(gl);
}
}
@@ -265,8 +266,8 @@ public class ShaderState {
* @see #getAttribLocation(GL2ES2, String)
* @see GL2ES2#glGetAttribLocation(int, String)
*/
- public int getCachedAttribLocation(String name) {
- Integer idx = activeAttribLocationMap.get(name);
+ public int getCachedAttribLocation(final String name) {
+ final Integer idx = activeAttribLocationMap.get(name);
return (null!=idx)?idx.intValue():-1;
}
@@ -285,11 +286,11 @@ public class ShaderState {
* @see #glResetAllVertexAttributes
* @see ShaderProgram#glReplaceShader
*/
- public GLArrayData getAttribute(String name) {
+ public GLArrayData getAttribute(final String name) {
return activeAttribDataMap.get(name);
}
- public boolean isActiveAttribute(GLArrayData attribute) {
+ public boolean isActiveAttribute(final GLArrayData attribute) {
return attribute == activeAttribDataMap.get(attribute.getName());
}
@@ -313,7 +314,7 @@ public class ShaderState {
* @see #getAttribute(String)
* @see GLArrayData#associate(Object, boolean)
*/
- public void ownAttribute(GLArrayData attribute, boolean own) {
+ public void ownAttribute(final GLArrayData attribute, final boolean own) {
if(own) {
final int location = getCachedAttribLocation(attribute.getName());
if(0<=location) {
@@ -326,7 +327,7 @@ public class ShaderState {
attribute.associate(this, own);
}
- public boolean ownsAttribute(GLArrayData attribute) {
+ public boolean ownsAttribute(final GLArrayData attribute) {
return managedAttributes.contains(attribute);
}
@@ -343,7 +344,7 @@ public class ShaderState {
* @see #getAttribLocation(GL2ES2, String)
* @see #getCachedAttribLocation(String)
*/
- public void bindAttribLocation(GL2ES2 gl, int location, String name) {
+ public void bindAttribLocation(final GL2ES2 gl, final int location, final String name) {
if(null==shaderProgram) throw new GLException("No program is attached");
if(shaderProgram.linked()) throw new GLException("Program is already linked");
final Integer loc = new Integer(location);
@@ -366,7 +367,7 @@ public class ShaderState {
* @see #getCachedAttribLocation(String)
* @see #getAttribute(String)
*/
- public void bindAttribLocation(GL2ES2 gl, int location, GLArrayData data) {
+ public void bindAttribLocation(final GL2ES2 gl, final int location, final GLArrayData data) {
if(null==shaderProgram) throw new GLException("No program is attached");
if(shaderProgram.linked()) throw new GLException("Program is already linked");
final String name = data.getName();
@@ -391,7 +392,7 @@ public class ShaderState {
* @see #bindAttribLocation(GL2ES2, int, String)
* @see GL2ES2#glGetAttribLocation(int, String)
*/
- public int getAttribLocation(GL2ES2 gl, String name) {
+ public int getAttribLocation(final GL2ES2 gl, final String name) {
if(null==shaderProgram) throw new GLException("No program is attached");
int location = getCachedAttribLocation(name);
if(0>location) {
@@ -431,7 +432,7 @@ public class ShaderState {
* @see GL2ES2#glGetAttribLocation(int, String)
* @see #getAttribute(String)
*/
- public int getAttribLocation(GL2ES2 gl, GLArrayData data) {
+ public int getAttribLocation(final GL2ES2 gl, final GLArrayData data) {
if(null==shaderProgram) throw new GLException("No program is attached");
final String name = data.getName();
int location = getCachedAttribLocation(name);
@@ -441,7 +442,7 @@ public class ShaderState {
if(!shaderProgram.linked()) throw new GLException("Program is not linked");
location = data.setLocation(gl, shaderProgram.program());
if(0<=location) {
- Integer idx = new Integer(location);
+ final Integer idx = new Integer(location);
activeAttribLocationMap.put(name, idx);
if(DEBUG) {
System.err.println("ShaderState: glGetAttribLocation: "+name+", loc: "+location);
@@ -464,7 +465,7 @@ public class ShaderState {
/**
* @return true if the named attribute is enable
*/
- public final boolean isVertexAttribArrayEnabled(String name) {
+ public final boolean isVertexAttribArrayEnabled(final String name) {
final Boolean v = activedAttribEnabledMap.get(name);
return null != v && v.booleanValue();
}
@@ -472,11 +473,11 @@ public class ShaderState {
/**
* @return true if the {@link GLArrayData} attribute is enable
*/
- public final boolean isVertexAttribArrayEnabled(GLArrayData data) {
+ public final boolean isVertexAttribArrayEnabled(final GLArrayData data) {
return isVertexAttribArrayEnabled(data.getName());
}
- private boolean enableVertexAttribArray(GL2ES2 gl, String name, int location) {
+ private boolean enableVertexAttribArray(final GL2ES2 gl, final String name, int location) {
activedAttribEnabledMap.put(name, Boolean.TRUE);
if(0>location) {
location = getAttribLocation(gl, name);
@@ -515,7 +516,7 @@ public class ShaderState {
* @see #glVertexAttribPointer
* @see #getVertexAttribPointer
*/
- public boolean enableVertexAttribArray(GL2ES2 gl, String name) {
+ public boolean enableVertexAttribArray(final GL2ES2 gl, final String name) {
return enableVertexAttribArray(gl, name, -1);
}
@@ -541,7 +542,7 @@ public class ShaderState {
* @see #getVertexAttribPointer
* @see GLArrayDataEditable#enableBuffer(GL, boolean)
*/
- public boolean enableVertexAttribArray(GL2ES2 gl, GLArrayData data) {
+ public boolean enableVertexAttribArray(final GL2ES2 gl, final GLArrayData data) {
if(0 > data.getLocation()) {
getAttribLocation(gl, data);
} else {
@@ -551,7 +552,7 @@ public class ShaderState {
return enableVertexAttribArray(gl, data.getName(), data.getLocation());
}
- private boolean disableVertexAttribArray(GL2ES2 gl, String name, int location) {
+ private boolean disableVertexAttribArray(final GL2ES2 gl, final String name, int location) {
activedAttribEnabledMap.put(name, Boolean.FALSE);
if(0>location) {
location = getAttribLocation(gl, name);
@@ -591,7 +592,7 @@ public class ShaderState {
* @see #glVertexAttribPointer
* @see #getVertexAttribPointer
*/
- public boolean disableVertexAttribArray(GL2ES2 gl, String name) {
+ public boolean disableVertexAttribArray(final GL2ES2 gl, final String name) {
return disableVertexAttribArray(gl, name, -1);
}
@@ -616,7 +617,7 @@ public class ShaderState {
* @see #glVertexAttribPointer
* @see #getVertexAttribPointer
*/
- public boolean disableVertexAttribArray(GL2ES2 gl, GLArrayData data) {
+ public boolean disableVertexAttribArray(final GL2ES2 gl, final GLArrayData data) {
if(0 > data.getLocation()) {
getAttribLocation(gl, data);
}
@@ -641,7 +642,7 @@ public class ShaderState {
* @see #glVertexAttribPointer
* @see #getVertexAttribPointer
*/
- public boolean vertexAttribPointer(GL2ES2 gl, GLArrayData data) {
+ public boolean vertexAttribPointer(final GL2ES2 gl, final GLArrayData data) {
int location = data.getLocation();
if(0 > location) {
location = getAttribLocation(gl, data);
@@ -670,12 +671,12 @@ public class ShaderState {
* @see #glResetAllVertexAttributes
* @see ShaderProgram#glReplaceShader
*/
- public void releaseAllAttributes(GL2ES2 gl) {
+ public void releaseAllAttributes(final GL2ES2 gl) {
if(null!=shaderProgram) {
- for(Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
+ for(final Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
disableVertexAttribArray(gl, iter.next());
}
- for(Iterator<String> iter = activedAttribEnabledMap.keySet().iterator(); iter.hasNext(); ) {
+ for(final Iterator<String> iter = activedAttribEnabledMap.keySet().iterator(); iter.hasNext(); ) {
disableVertexAttribArray(gl, iter.next());
}
}
@@ -702,8 +703,8 @@ public class ShaderState {
* @see #glResetAllVertexAttributes
* @see ShaderProgram#glReplaceShader
*/
- public void disableAllVertexAttributeArrays(GL2ES2 gl, boolean removeFromState) {
- for(Iterator<String> iter = activedAttribEnabledMap.keySet().iterator(); iter.hasNext(); ) {
+ public void disableAllVertexAttributeArrays(final GL2ES2 gl, final boolean removeFromState) {
+ for(final Iterator<String> iter = activedAttribEnabledMap.keySet().iterator(); iter.hasNext(); ) {
final String name = iter.next();
if(removeFromState) {
activedAttribEnabledMap.remove(name);
@@ -715,7 +716,7 @@ public class ShaderState {
}
}
- private final void relocateAttribute(GL2ES2 gl, GLArrayData attribute) {
+ private final void relocateAttribute(final GL2ES2 gl, final GLArrayData attribute) {
// get new location .. note: 'activeAttribLocationMap' is cleared before
final String name = attribute.getName();
final int loc = attribute.setLocation(gl, shaderProgram.program());
@@ -760,19 +761,19 @@ public class ShaderState {
*
* @see #attachShaderProgram(GL2ES2, ShaderProgram)
*/
- private final void resetAllAttributes(GL2ES2 gl) {
+ private final void resetAllAttributes(final GL2ES2 gl) {
if(!shaderProgram.linked()) throw new GLException("Program is not linked");
activeAttribLocationMap.clear();
for(int i=0; i<managedAttributes.size(); i++) {
managedAttributes.get(i).setLocation(-1);
}
- for(Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
+ for(final Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
relocateAttribute(gl, iter.next());
}
}
- private final void setAttribute(GL2ES2 gl, GLArrayData attribute) {
+ private final void setAttribute(final GL2ES2 gl, final GLArrayData attribute) {
// get new location ..
final String name = attribute.getName();
final int loc = attribute.getLocation();
@@ -798,8 +799,8 @@ public class ShaderState {
/**
* preserves the attribute location .. (program not linked)
*/
- private final void setAllAttributes(GL2ES2 gl) {
- for(Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
+ private final void setAllAttributes(final GL2ES2 gl) {
+ for(final Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
setAttribute(gl, iter.next());
}
}
@@ -814,8 +815,8 @@ public class ShaderState {
* @return -1 if there is no such uniform available,
* otherwise >= 0
*/
- public final int getCachedUniformLocation(String name) {
- Integer idx = activeUniformLocationMap.get(name);
+ public final int getCachedUniformLocation(final String name) {
+ final Integer idx = activeUniformLocationMap.get(name);
return (null!=idx)?idx.intValue():-1;
}
@@ -833,7 +834,7 @@ public class ShaderState {
*
* @see #getUniform(String)
*/
- public void ownUniform(GLUniformData uniform) {
+ public void ownUniform(final GLUniformData uniform) {
final int location = getCachedUniformLocation(uniform.getName());
if(0<=location) {
uniform.setLocation(location);
@@ -842,7 +843,7 @@ public class ShaderState {
managedUniforms.add(uniform);
}
- public boolean ownsUniform(GLUniformData uniform) {
+ public boolean ownsUniform(final GLUniformData uniform) {
return managedUniforms.contains(uniform);
}
@@ -865,14 +866,14 @@ public class ShaderState {
* @see #getUniformLocation
* @see ShaderProgram#glReplaceShader
*/
- public final int getUniformLocation(GL2ES2 gl, String name) {
+ public final int getUniformLocation(final GL2ES2 gl, final String name) {
if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
int location = getCachedUniformLocation(name);
if(0>location) {
if(!shaderProgram.linked()) throw new GLException("Program is not linked");
location = gl.glGetUniformLocation(shaderProgram.program(), name);
if(0<=location) {
- Integer idx = new Integer(location);
+ final Integer idx = new Integer(location);
activeUniformLocationMap.put(name, idx);
} else if(verbose) {
System.err.println("ShaderState: glUniform failed, no location for: "+name+", index: "+location);
@@ -904,7 +905,7 @@ public class ShaderState {
* @see #getUniformLocation
* @see ShaderProgram#glReplaceShader
*/
- public int getUniformLocation(GL2ES2 gl, GLUniformData data) {
+ public int getUniformLocation(final GL2ES2 gl, final GLUniformData data) {
if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
final String name = data.getName();
int location = getCachedUniformLocation(name);
@@ -942,7 +943,7 @@ public class ShaderState {
* @see #getUniformLocation
* @see ShaderProgram#glReplaceShader
*/
- public boolean uniform(GL2ES2 gl, GLUniformData data) {
+ public boolean uniform(final GL2ES2 gl, final GLUniformData data) {
if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
int location = data.getLocation();
if(0>location) {
@@ -964,7 +965,7 @@ public class ShaderState {
*
* @return the GLUniformData object, null if not previously set.
*/
- public GLUniformData getUniform(String name) {
+ public GLUniformData getUniform(final String name) {
return activeUniformDataMap.get(name);
}
@@ -972,7 +973,7 @@ public class ShaderState {
* Releases all mapped uniform data
* and loses all indices
*/
- public void releaseAllUniforms(GL2ES2 gl) {
+ public void releaseAllUniforms(final GL2ES2 gl) {
activeUniformDataMap.clear();
activeUniformLocationMap.clear();
managedUniforms.clear();
@@ -993,13 +994,13 @@ public class ShaderState {
*
* @see #attachShaderProgram(GL2ES2, ShaderProgram)
*/
- private final void resetAllUniforms(GL2ES2 gl) {
+ private final void resetAllUniforms(final GL2ES2 gl) {
if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
activeUniformLocationMap.clear();
- for(Iterator<GLUniformData> iter = managedUniforms.iterator(); iter.hasNext(); ) {
+ for(final Iterator<GLUniformData> iter = managedUniforms.iterator(); iter.hasNext(); ) {
iter.next().setLocation(-1);
}
- for(Iterator<GLUniformData> iter = activeUniformDataMap.values().iterator(); iter.hasNext(); ) {
+ for(final Iterator<GLUniformData> iter = activeUniformDataMap.values().iterator(); iter.hasNext(); ) {
final GLUniformData data = iter.next();
final int loc = data.setLocation(gl, shaderProgram.program());
if( 0 <= loc ) {
@@ -1013,7 +1014,7 @@ public class ShaderState {
}
}
- public StringBuilder toString(StringBuilder sb, boolean alsoUnlocated) {
+ public StringBuilder toString(StringBuilder sb, final boolean alsoUnlocated) {
if(null==sb) {
sb = new StringBuilder();
}
@@ -1028,35 +1029,35 @@ public class ShaderState {
}
sb.append(Platform.getNewline()).append(" enabledAttributes [");
{
- Iterator<String> names = activedAttribEnabledMap.keySet().iterator();
- Iterator<Boolean> values = activedAttribEnabledMap.values().iterator();
+ final Iterator<String> names = activedAttribEnabledMap.keySet().iterator();
+ final Iterator<Boolean> values = activedAttribEnabledMap.values().iterator();
while( names.hasNext() ) {
sb.append(Platform.getNewline()).append(" ").append(names.next()).append(": ").append(values.next());
}
}
sb.append(Platform.getNewline()).append(" ],").append(" activeAttributes [");
- for(Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
+ for(final Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
final GLArrayData ad = iter.next();
if( alsoUnlocated || 0 <= ad.getLocation() ) {
sb.append(Platform.getNewline()).append(" ").append(ad);
}
}
sb.append(Platform.getNewline()).append(" ],").append(" managedAttributes [");
- for(Iterator<GLArrayData> iter = managedAttributes.iterator(); iter.hasNext(); ) {
+ for(final Iterator<GLArrayData> iter = managedAttributes.iterator(); iter.hasNext(); ) {
final GLArrayData ad = iter.next();
if( alsoUnlocated || 0 <= ad.getLocation() ) {
sb.append(Platform.getNewline()).append(" ").append(ad);
}
}
sb.append(Platform.getNewline()).append(" ],").append(" activeUniforms [");
- for(Iterator<GLUniformData> iter=activeUniformDataMap.values().iterator(); iter.hasNext(); ) {
+ for(final Iterator<GLUniformData> iter=activeUniformDataMap.values().iterator(); iter.hasNext(); ) {
final GLUniformData ud = iter.next();
if( alsoUnlocated || 0 <= ud.getLocation() ) {
sb.append(Platform.getNewline()).append(" ").append(ud);
}
}
sb.append(Platform.getNewline()).append(" ],").append(" managedUniforms [");
- for(Iterator<GLUniformData> iter = managedUniforms.iterator(); iter.hasNext(); ) {
+ for(final Iterator<GLUniformData> iter = managedUniforms.iterator(); iter.hasNext(); ) {
final GLUniformData ud = iter.next();
if( alsoUnlocated || 0 <= ud.getLocation() ) {
sb.append(Platform.getNewline()).append(" ").append(ud);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
index ad5331a28..b927e8ceb 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
@@ -43,49 +43,49 @@ import com.jogamp.common.nio.Buffers;
import com.jogamp.opengl.GLExtensions;
public class ShaderUtil {
- public static String getShaderInfoLog(GL _gl, int shaderObj) {
+ public static String getShaderInfoLog(final GL _gl, final int shaderObj) {
final GL2ES2 gl = _gl.getGL2ES2();
- int[] infoLogLength=new int[1];
+ final int[] infoLogLength=new int[1];
gl.glGetShaderiv(shaderObj, GL2ES2.GL_INFO_LOG_LENGTH, infoLogLength, 0);
if(infoLogLength[0]==0) {
return "(no info log)";
}
- int[] charsWritten=new int[1];
- byte[] infoLogBytes = new byte[infoLogLength[0]];
+ final int[] charsWritten=new int[1];
+ final byte[] infoLogBytes = new byte[infoLogLength[0]];
gl.glGetShaderInfoLog(shaderObj, infoLogLength[0], charsWritten, 0, infoLogBytes, 0);
return new String(infoLogBytes, 0, charsWritten[0]);
}
- public static String getProgramInfoLog(GL _gl, int programObj) {
+ public static String getProgramInfoLog(final GL _gl, final int programObj) {
final GL2ES2 gl = _gl.getGL2ES2();
- int[] infoLogLength=new int[1];
+ final int[] infoLogLength=new int[1];
gl.glGetProgramiv(programObj, GL2ES2.GL_INFO_LOG_LENGTH, infoLogLength, 0);
if(infoLogLength[0]==0) {
return "(no info log)";
}
- int[] charsWritten=new int[1];
- byte[] infoLogBytes = new byte[infoLogLength[0]];
+ final int[] charsWritten=new int[1];
+ final byte[] infoLogBytes = new byte[infoLogLength[0]];
gl.glGetProgramInfoLog(programObj, infoLogLength[0], charsWritten, 0, infoLogBytes, 0);
return new String(infoLogBytes, 0, charsWritten[0]);
}
- public static boolean isShaderStatusValid(GL _gl, int shaderObj, int name, PrintStream verboseOut) {
+ public static boolean isShaderStatusValid(final GL _gl, final int shaderObj, final int name, final PrintStream verboseOut) {
final GL2ES2 gl = _gl.getGL2ES2();
- int[] ires = new int[1];
+ final int[] ires = new int[1];
gl.glGetShaderiv(shaderObj, name, ires, 0);
- boolean res = ires[0]==1;
+ final boolean res = ires[0]==1;
if(!res && null!=verboseOut) {
verboseOut.println("Shader status invalid: "+ getShaderInfoLog(gl, shaderObj));
}
return res;
}
- public static boolean isShaderStatusValid(GL _gl, IntBuffer shaders, int name, PrintStream verboseOut) {
+ public static boolean isShaderStatusValid(final GL _gl, final IntBuffer shaders, final int name, final PrintStream verboseOut) {
boolean res = true;
for (int i = shaders.position(); i < shaders.limit(); i++) {
res = isShaderStatusValid(_gl, shaders.get(i), name, verboseOut) && res;
@@ -93,15 +93,15 @@ public class ShaderUtil {
return res;
}
- public static boolean isProgramStatusValid(GL _gl, int programObj, int name) {
+ public static boolean isProgramStatusValid(final GL _gl, final int programObj, final int name) {
final GL2ES2 gl = _gl.getGL2ES2();
- int[] ires = new int[1];
+ final int[] ires = new int[1];
gl.glGetProgramiv(programObj, name, ires, 0);
return ires[0]==1;
}
- public static boolean isProgramLinkStatusValid(GL _gl, int programObj, PrintStream verboseOut) {
+ public static boolean isProgramLinkStatusValid(final GL _gl, final int programObj, final PrintStream verboseOut) {
final GL2ES2 gl = _gl.getGL2ES2();
if(!gl.glIsProgram(programObj)) {
if(null!=verboseOut) {
@@ -130,7 +130,7 @@ public class ShaderUtil {
* </p>
* @see GL2ES2#glValidateProgram(int)
**/
- public static boolean isProgramExecStatusValid(GL _gl, int programObj, PrintStream verboseOut) {
+ public static boolean isProgramExecStatusValid(final GL _gl, final int programObj, final PrintStream verboseOut) {
final GL2ES2 gl = _gl.getGL2ES2();
gl.glValidateProgram(programObj);
if(!isProgramStatusValid(gl, programObj, GL2ES2.GL_VALIDATE_STATUS)) {
@@ -142,7 +142,7 @@ public class ShaderUtil {
return true;
}
- public static void createShader(GL _gl, int type, IntBuffer shaders) {
+ public static void createShader(final GL _gl, final int type, final IntBuffer shaders) {
final GL2ES2 gl = _gl.getGL2ES2();
for (int i = shaders.position(); i < shaders.limit(); i++) {
shaders.put(i, gl.glCreateShader(type));
@@ -154,7 +154,7 @@ public class ShaderUtil {
* {@link GL2ES2#GL_NUM_SHADER_BINARY_FORMATS} and {@link GL2ES2#GL_SHADER_BINARY_FORMATS}
* via {@link GL2ES2#glGetIntegerv(int, int[], int)}.
*/
- public static Set<Integer> getShaderBinaryFormats(GL _gl) {
+ public static Set<Integer> getShaderBinaryFormats(final GL _gl) {
final GL2ES2 gl = _gl.getGL2ES2();
final ProfileInformation info = getProfileInformation(gl);
if(null == info.shaderBinaryFormats) {
@@ -166,13 +166,13 @@ public class ShaderUtil {
final int err = gl.glGetError();
final int numFormats = GL.GL_NO_ERROR == err ? param[0] : 0;
if(numFormats>0) {
- int[] formats = new int[numFormats];
+ final int[] formats = new int[numFormats];
gl.glGetIntegerv(GL2ES2.GL_SHADER_BINARY_FORMATS, formats, 0);
for(int i=0; i<numFormats; i++) {
info.shaderBinaryFormats.add(new Integer(formats[i]));
}
}
- } catch (GLException gle) {
+ } catch (final GLException gle) {
System.err.println("Caught exception on thread "+Thread.currentThread().getName());
gle.printStackTrace();
}
@@ -182,7 +182,7 @@ public class ShaderUtil {
}
/** Returns true if a hader compiler is available, otherwise false. */
- public static boolean isShaderCompilerAvailable(GL _gl) {
+ public static boolean isShaderCompilerAvailable(final GL _gl) {
final GL2ES2 gl = _gl.getGL2ES2();
final ProfileInformation info = getProfileInformation(gl);
if(null==info.shaderCompilerAvailable) {
@@ -202,7 +202,7 @@ public class ShaderUtil {
}
info.shaderCompilerAvailable = new Boolean(v);
queryOK = true;
- } catch (GLException gle) {
+ } catch (final GLException gle) {
System.err.println("Caught exception on thread "+Thread.currentThread().getName());
gle.printStackTrace();
}
@@ -219,25 +219,25 @@ public class ShaderUtil {
}
/** Returns true if GeometryShader is supported, i.e. whether GLContext is &ge; 3.2 or ARB_geometry_shader4 extension is available. */
- public static boolean isGeometryShaderSupported(GL _gl) {
+ public static boolean isGeometryShaderSupported(final GL _gl) {
final GLContext ctx = _gl.getContext();
return ctx.getGLVersionNumber().compareTo(GLContext.Version320) >= 0 ||
ctx.isExtensionAvailable(GLExtensions.ARB_geometry_shader4);
}
- public static void shaderSource(GL _gl, int shader, CharSequence[] source)
+ public static void shaderSource(final GL _gl, final int shader, final CharSequence[] source)
{
final GL2ES2 gl = _gl.getGL2ES2();
if(!isShaderCompilerAvailable(_gl)) {
throw new GLException("No compiler is available");
}
- int count = (null!=source)?source.length:0;
+ final int count = (null!=source)?source.length:0;
if(count==0) {
throw new GLException("No sources specified");
}
- IntBuffer lengths = Buffers.newDirectIntBuffer(count);
+ final IntBuffer lengths = Buffers.newDirectIntBuffer(count);
for(int i=0; i<count; i++) {
lengths.put(i, source[i].length());
}
@@ -260,10 +260,10 @@ public class ShaderUtil {
}
}
- public static void shaderSource(GL _gl, IntBuffer shaders, CharSequence[][] sources)
+ public static void shaderSource(final GL _gl, final IntBuffer shaders, final CharSequence[][] sources)
{
- int sourceNum = (null!=sources)?sources.length:0;
- int shaderNum = (null!=shaders)?shaders.remaining():0;
+ final int sourceNum = (null!=sources)?sources.length:0;
+ final int shaderNum = (null!=shaders)?shaders.remaining():0;
if(shaderNum<=0 || sourceNum<=0 || shaderNum!=sourceNum) {
throw new GLException("Invalid number of shaders and/or sources: shaders="+
shaderNum+", sources="+sourceNum);
@@ -273,28 +273,28 @@ public class ShaderUtil {
}
}
- public static void shaderBinary(GL _gl, IntBuffer shaders, int binFormat, java.nio.Buffer bin)
+ public static void shaderBinary(final GL _gl, final IntBuffer shaders, final int binFormat, final java.nio.Buffer bin)
{
final GL2ES2 gl = _gl.getGL2ES2();
if(getShaderBinaryFormats(gl).size()<=0) {
throw new GLException("No binary formats are supported");
}
- int shaderNum = shaders.remaining();
+ final int shaderNum = shaders.remaining();
if(shaderNum<=0) {
throw new GLException("No shaders specified");
}
if(null==bin) {
throw new GLException("Null shader binary");
}
- int binLength = bin.remaining();
+ final int binLength = bin.remaining();
if(0>=binLength) {
throw new GLException("Empty shader binary (remaining == 0)");
}
gl.glShaderBinary(shaderNum, shaders, binFormat, bin, binLength);
}
- public static void compileShader(GL _gl, IntBuffer shaders)
+ public static void compileShader(final GL _gl, final IntBuffer shaders)
{
final GL2ES2 gl = _gl.getGL2ES2();
for (int i = shaders.position(); i < shaders.limit(); i++) {
@@ -302,7 +302,7 @@ public class ShaderUtil {
}
}
- public static void attachShader(GL _gl, int program, IntBuffer shaders)
+ public static void attachShader(final GL _gl, final int program, final IntBuffer shaders)
{
final GL2ES2 gl = _gl.getGL2ES2();
for (int i = shaders.position(); i < shaders.limit(); i++) {
@@ -310,7 +310,7 @@ public class ShaderUtil {
}
}
- public static void detachShader(GL _gl, int program, IntBuffer shaders)
+ public static void detachShader(final GL _gl, final int program, final IntBuffer shaders)
{
final GL2ES2 gl = _gl.getGL2ES2();
for (int i = shaders.position(); i < shaders.limit(); i++) {
@@ -318,7 +318,7 @@ public class ShaderUtil {
}
}
- public static void deleteShader(GL _gl, IntBuffer shaders)
+ public static void deleteShader(final GL _gl, final IntBuffer shaders)
{
final GL2ES2 gl = _gl.getGL2ES2();
for (int i = shaders.position(); i < shaders.limit(); i++) {
@@ -327,9 +327,9 @@ public class ShaderUtil {
}
}
- public static boolean createAndLoadShader(GL _gl, IntBuffer shader, int shaderType,
- int binFormat, java.nio.Buffer bin,
- PrintStream verboseOut)
+ public static boolean createAndLoadShader(final GL _gl, final IntBuffer shader, final int shaderType,
+ final int binFormat, final java.nio.Buffer bin,
+ final PrintStream verboseOut)
{
final GL2ES2 gl = _gl.getGL2ES2();
int err = gl.glGetError(); // flush previous errors ..
@@ -352,9 +352,9 @@ public class ShaderUtil {
return err == GL.GL_NO_ERROR;
}
- public static boolean createAndCompileShader(GL _gl, IntBuffer shader, int shaderType,
- CharSequence[][] sources,
- PrintStream verboseOut)
+ public static boolean createAndCompileShader(final GL _gl, final IntBuffer shader, final int shaderType,
+ final CharSequence[][] sources,
+ final PrintStream verboseOut)
{
final GL2ES2 gl = _gl.getGL2ES2();
int err = gl.glGetError(); // flush previous errors ..
@@ -390,7 +390,7 @@ public class ShaderUtil {
Set<Integer> shaderBinaryFormats = null;
}
- private static ProfileInformation getProfileInformation(GL gl) {
+ private static ProfileInformation getProfileInformation(final GL gl) {
final GLContext context = gl.getContext();
context.validateCurrent();
ProfileInformation data = (ProfileInformation) context.getAttachedObject(implObjectKey);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
index 2f8884a3a..1ed875f27 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
@@ -37,7 +37,7 @@ public class FixedFuncUtil {
* @see ShaderSelectionMode#COLOR_TEXTURE
* @see ShaderSelectionMode#COLOR_TEXTURE_LIGHT_PER_VERTEX
*/
- public static final GL2ES1 wrapFixedFuncEmul(GL gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix, boolean force, boolean verbose) {
+ public static final GL2ES1 wrapFixedFuncEmul(final GL gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix, final boolean force, final boolean verbose) {
if(gl.isGL2ES2() && ( !gl.isGL2ES1() || force ) ) {
final GL2ES2 es2 = gl.getGL2ES2();
final FixedFuncHook hook = new FixedFuncHook(es2, mode, pmvMatrix);
@@ -66,7 +66,7 @@ public class FixedFuncUtil {
* @see ShaderSelectionMode#COLOR_TEXTURE
* @see ShaderSelectionMode#COLOR_TEXTURE_LIGHT_PER_VERTEX
*/
- public static final GL2ES1 wrapFixedFuncEmul(GL gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) {
+ public static final GL2ES1 wrapFixedFuncEmul(final GL gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) {
return wrapFixedFuncEmul(gl, mode, null, false, false);
}
@@ -90,7 +90,7 @@ public class FixedFuncUtil {
* @see javax.media.opengl.fixedfunc.GLPointerFunc#glNormalPointer
* @see javax.media.opengl.fixedfunc.GLPointerFunc#glTexCoordPointer
*/
- public static String getPredefinedArrayIndexName(int glArrayIndex) {
+ public static String getPredefinedArrayIndexName(final int glArrayIndex) {
return GLPointerFuncUtil.getPredefinedArrayIndexName(glArrayIndex);
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
index 44fbf1c6d..f113be2b2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
@@ -30,7 +30,7 @@ public abstract class CompileShader {
public abstract String getFragmentShaderCompiler();
- public void processOneShader(String resourceName)
+ public void processOneShader(final String resourceName)
throws IOException, UnsupportedEncodingException, InterruptedException
{
int type = -1;
@@ -49,11 +49,11 @@ public abstract class CompileShader {
suffixLen = 4;
type = GL2ES2.GL_VERTEX_SHADER;
}
- String justName = basename(resourceName);
+ final String justName = basename(resourceName);
outName = justName.substring(0, justName.length() - suffixLen) +
ShaderCode.getFileSuffix(true, type);
- URL resourceURL = IOUtil.getResource(null, resourceName).getURL();
- String dirName = dirname(resourceURL.getPath());
+ final URL resourceURL = IOUtil.getResource(null, resourceName).getURL();
+ final String dirName = dirname(resourceURL.getPath());
outName = dirName + File.separator + "bin" + File.separator +
ShaderCode.getBinarySubPath(getBinaryFormat()) + File.separator +
@@ -61,19 +61,19 @@ public abstract class CompileShader {
processOneShader(resourceName, outName, type);
}
- public void processOneShader(String resourceName, String outName, int type)
+ public void processOneShader(final String resourceName, final String outName, final int type)
throws IOException, UnsupportedEncodingException, InterruptedException
{
- URL resourceURL = IOUtil.getResource(null, resourceName).getURL();
- String dirName = dirname(resourceURL.getPath());
+ final URL resourceURL = IOUtil.getResource(null, resourceName).getURL();
+ final String dirName = dirname(resourceURL.getPath());
- CharSequence shader = ShaderCode.readShaderSource(null, resourceName, false);
+ final CharSequence shader = ShaderCode.readShaderSource(null, resourceName, false);
if(null==shader) {
System.err.println("Can't find shader source " + resourceName + " - ignored");
return;
}
System.err.println("Preprocessing: "+ resourceName+", in dir: "+dirName);
- String justName = basename(resourceName);
+ final String justName = basename(resourceName);
String processor;
switch (type) {
case GL2ES2.GL_VERTEX_SHADER:
@@ -85,26 +85,26 @@ public abstract class CompileShader {
default:
throw new GLException("Unknown shader type: "+type);
}
- File outputFile = new File(outName);
+ final File outputFile = new File(outName);
// Write shader to a file in java.io.tmpdir
- File tmpDir = new File(dirName+File.separator+"tmp");
+ final File tmpDir = new File(dirName+File.separator+"tmp");
tmpDir.mkdirs();
- File tmpFile = new File(tmpDir, justName);
- Writer writer = new BufferedWriter(new FileWriter(tmpFile));
+ final File tmpFile = new File(tmpDir, justName);
+ final Writer writer = new BufferedWriter(new FileWriter(tmpFile));
writer.write(shader.toString(), 0, shader.length());
writer.flush();
writer.close();
System.err.println("Preprocessed: "+ tmpFile.getAbsolutePath());
- File processorDir = getSDKCompilerDir();
+ final File processorDir = getSDKCompilerDir();
System.err.println("SDK: "+ processorDir.getAbsolutePath() + ", compiler: "+processor);
System.err.println("Output: "+ outputFile.getAbsolutePath());
// Run the tool
- Process process = Runtime.getRuntime().exec(new String[] {
+ final Process process = Runtime.getRuntime().exec(new String[] {
processorDir.getAbsolutePath() + File.separator + processor,
tmpFile.getAbsolutePath(),
outputFile.getAbsolutePath()
@@ -116,7 +116,7 @@ public abstract class CompileShader {
// tmpFile.delete();
}
- protected static String basename(String path) {
+ protected static String basename(final String path) {
int lastSlash = path.lastIndexOf("/");
if (lastSlash < 0) {
lastSlash = path.lastIndexOf("\\");
@@ -130,7 +130,7 @@ public abstract class CompileShader {
return basename;
}
- protected static String dirname(String path) {
+ protected static String dirname(final String path) {
int lastSlash = path.lastIndexOf("/");
if (lastSlash < 0) {
lastSlash = path.lastIndexOf("\\");
@@ -144,19 +144,19 @@ public abstract class CompileShader {
return dirname;
}
- public void run(String[] args) {
+ public void run(final String[] args) {
try {
for (int i = 0; i < args.length; i++) {
processOneShader(args[i]);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
private static class StreamMonitor implements Runnable {
- private InputStream istream;
- public StreamMonitor(InputStream stream) {
+ private final InputStream istream;
+ public StreamMonitor(final InputStream stream) {
istream = stream;
new Thread(this, "Output Reader Thread").start();
}
@@ -164,7 +164,7 @@ public abstract class CompileShader {
@Override
public void run()
{
- byte[] buffer = new byte[4096];
+ final byte[] buffer = new byte[4096];
try {
int numRead = 0;
do {
@@ -175,10 +175,10 @@ public abstract class CompileShader {
}
} while (numRead >= 0);
}
- catch (IOException e) {
+ catch (final IOException e) {
try {
istream.close();
- } catch (IOException e2) {
+ } catch (final IOException e2) {
}
// Should allow clean exit when process shuts down
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java
index 215cf592b..9ff37c7ee 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java
@@ -13,7 +13,7 @@ public class CompileShaderNVidia extends CompileShader {
private static final String NVAPSDK;
static {
- String nvapSDKProp = System.getProperty("NVAPSDK");
+ final String nvapSDKProp = System.getProperty("NVAPSDK");
if (nvapSDKProp != null) {
NVAPSDK = nvapSDKProp;
} else {
@@ -51,7 +51,7 @@ public class CompileShaderNVidia extends CompileShader {
return "glslf.bat";
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
new CompileShaderNVidia().run(args);
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
index 9aadfba93..e694f1b33 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
@@ -42,29 +42,29 @@ package com.jogamp.opengl.util.packrect;
import java.util.*;
public class Level {
- private int width;
+ private final int width;
private int height;
- private int yPos;
- private LevelSet holder;
+ private final int yPos;
+ private final LevelSet holder;
- private List<Rect> rects = new ArrayList<Rect>();
+ private final List<Rect> rects = new ArrayList<Rect>();
private List<Rect> freeList;
private int nextAddX;
static class RectXComparator implements Comparator<Rect> {
@Override
- public int compare(Rect r1, Rect r2) {
+ public int compare(final Rect r1, final Rect r2) {
return r1.x() - r2.x();
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
return this == obj;
}
}
private static final Comparator<Rect> rectXComparator = new RectXComparator();
- public Level(int width, int height, int yPos, LevelSet holder) {
+ public Level(final int width, final int height, final int yPos, final LevelSet holder) {
this.width = width;
this.height = height;
this.yPos = yPos;
@@ -80,7 +80,7 @@ public class Level {
in the RectanglePacker and allocation from the free list. More
disruptive changes like compaction of the level must be
requested explicitly. */
- public boolean add(Rect rect) {
+ public boolean add(final Rect rect) {
if (rect.h() > height) {
// See whether it's worth trying to expand vertically
if (nextAddX + rect.w() > width) {
@@ -108,8 +108,8 @@ public class Level {
// See whether we can add from the free list
if (freeList != null) {
Rect candidate = null;
- for (Iterator<Rect> iter = freeList.iterator(); iter.hasNext(); ) {
- Rect cur = iter.next();
+ for (final Iterator<Rect> iter = freeList.iterator(); iter.hasNext(); ) {
+ final Rect cur = iter.next();
if (cur.canContain(rect)) {
candidate = cur;
break;
@@ -139,7 +139,7 @@ public class Level {
}
/** Removes the given Rect from this Level. */
- public boolean remove(Rect rect) {
+ public boolean remove(final Rect rect) {
if (!rects.remove(rect))
return false;
@@ -165,14 +165,14 @@ public class Level {
/** Indicates whether this Level could satisfy an allocation request
if it were compacted. */
- public boolean couldAllocateIfCompacted(Rect rect) {
+ public boolean couldAllocateIfCompacted(final Rect rect) {
if (rect.h() > height)
return false;
if (freeList == null)
return false;
int freeListWidth = 0;
- for (Iterator<Rect> iter = freeList.iterator(); iter.hasNext(); ) {
- Rect cur = iter.next();
+ for (final Iterator<Rect> iter = freeList.iterator(); iter.hasNext(); ) {
+ final Rect cur = iter.next();
freeListWidth += cur.w();
}
// Add on the remaining space at the end
@@ -180,12 +180,12 @@ public class Level {
return (freeListWidth >= rect.w());
}
- public void compact(Object backingStore, BackingStoreManager manager) {
+ public void compact(final Object backingStore, final BackingStoreManager manager) {
Collections.sort(rects, rectXComparator);
int nextCompactionDest = 0;
manager.beginMovement(backingStore, backingStore);
- for (Iterator<Rect> iter = rects.iterator(); iter.hasNext(); ) {
- Rect cur = iter.next();
+ for (final Iterator<Rect> iter = rects.iterator(); iter.hasNext(); ) {
+ final Rect cur = iter.next();
if (cur.x() != nextCompactionDest) {
manager.move(backingStore, cur,
backingStore, new Rect(nextCompactionDest, cur.y(), cur.w(), cur.h(), null));
@@ -203,9 +203,9 @@ public class Level {
}
/** Visits all Rects contained in this Level. */
- public void visit(RectVisitor visitor) {
- for (Iterator<Rect> iter = rects.iterator(); iter.hasNext(); ) {
- Rect rect = iter.next();
+ public void visit(final RectVisitor visitor) {
+ for (final Iterator<Rect> iter = rects.iterator(); iter.hasNext(); ) {
+ final Rect rect = iter.next();
visitor.visit(rect);
}
}
@@ -216,8 +216,8 @@ public class Level {
original Rects. */
public void updateRectangleReferences() {
for (int i = 0; i < rects.size(); i++) {
- Rect cur = rects.get(i);
- Rect next = cur.getNextLocation();
+ final Rect cur = rects.get(i);
+ final Rect next = cur.getNextLocation();
next.setPosition(cur.x(), cur.y());
if (cur.w() != next.w() || cur.h() != next.h())
throw new RuntimeException("Unexpected disparity in rectangle sizes during updateRectangleReferences");
@@ -235,8 +235,8 @@ public class Level {
Collections.sort(freeList, rectXComparator);
int i = 0;
while (i < freeList.size() - 1) {
- Rect r1 = freeList.get(i);
- Rect r2 = freeList.get(i+1);
+ final Rect r1 = freeList.get(i);
+ final Rect r2 = freeList.get(i+1);
if (r1.maxX() + 1 == r2.x()) {
// Coalesce r1 and r2 into one block
freeList.remove(i+1);
@@ -246,7 +246,7 @@ public class Level {
}
}
// See whether the last block bumps up against the addition point
- Rect last = freeList.get(freeList.size() - 1);
+ final Rect last = freeList.get(freeList.size() - 1);
if (last.maxX() + 1 == nextAddX) {
nextAddX -= last.w();
freeList.remove(freeList.size() - 1);
@@ -262,8 +262,8 @@ public class Level {
public void dumpFreeSpace() {
int freeListWidth = 0;
- for (Iterator<Rect> iter = freeList.iterator(); iter.hasNext(); ) {
- Rect cur = iter.next();
+ for (final Iterator<Rect> iter = freeList.iterator(); iter.hasNext(); ) {
+ final Rect cur = iter.next();
System.err.println(" Free rectangle at " + cur);
freeListWidth += cur.w();
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java
index 433421f1a..803ca28cf 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java
@@ -47,14 +47,14 @@ import java.util.*;
public class LevelSet {
// Maintained in sorted order by increasing Y coordinate
- private List<Level> levels = new ArrayList<Level>();
+ private final List<Level> levels = new ArrayList<Level>();
private int nextAddY;
- private int w;
+ private final int w;
private int h;
/** A LevelSet manages all of the backing store for a region of a
specified width and height. */
- public LevelSet(int w, int h) {
+ public LevelSet(final int w, final int h) {
this.w = w;
this.h = h;
}
@@ -66,14 +66,14 @@ public class LevelSet {
the LevelSet given its current dimensions, false if not. Caller
is responsible for performing compaction, expansion, etc. as a
consequence. */
- public boolean add(Rect rect) {
+ public boolean add(final Rect rect) {
if (rect.w() > w)
return false;
// Go in reverse order through the levels seeing whether we can
// trivially satisfy the allocation request
for (int i = levels.size() - 1; i >= 0; --i) {
- Level level = levels.get(i);
+ final Level level = levels.get(i);
if (level.add(rect))
return true;
}
@@ -82,7 +82,7 @@ public class LevelSet {
// increases the computational complexity of the addition process,
// but prevents us from expanding unnecessarily.
for (int i = levels.size() - 1; i >= 0; --i) {
- Level level = levels.get(i);
+ final Level level = levels.get(i);
if (level.couldAllocateIfCompacted(rect))
return false;
}
@@ -92,19 +92,19 @@ public class LevelSet {
if (nextAddY + rect.h() > h)
return false;
- Level newLevel = new Level(w, rect.h(), nextAddY, this);
+ final Level newLevel = new Level(w, rect.h(), nextAddY, this);
levels.add(newLevel);
nextAddY += rect.h();
- boolean res = newLevel.add(rect);
+ final boolean res = newLevel.add(rect);
if (!res)
throw new RuntimeException("Unexpected failure in addition to new Level");
return true;
}
/** Removes the given Rect from this LevelSet. */
- public boolean remove(Rect rect) {
+ public boolean remove(final Rect rect) {
for (int i = levels.size() - 1; i >= 0; --i) {
- Level level = levels.get(i);
+ final Level level = levels.get(i);
if (level.remove(rect))
return true;
}
@@ -116,14 +116,14 @@ public class LevelSet {
if necessary. This is the correct fallback path to {@link
#add(Rect)} above. Returns true if allocated successfully, false
otherwise (indicating the need to expand the backing store). */
- public boolean compactAndAdd(Rect rect,
- Object backingStore,
- BackingStoreManager manager) {
+ public boolean compactAndAdd(final Rect rect,
+ final Object backingStore,
+ final BackingStoreManager manager) {
for (int i = levels.size() - 1; i >= 0; --i) {
- Level level = levels.get(i);
+ final Level level = levels.get(i);
if (level.couldAllocateIfCompacted(rect)) {
level.compact(backingStore, manager);
- boolean res = level.add(rect);
+ final boolean res = level.add(rect);
if (!res)
throw new RuntimeException("Unexpected failure to add after compaction");
return true;
@@ -136,7 +136,7 @@ public class LevelSet {
/** Indicates whether it's legal to trivially increase the height of
the given Level. This is only possible if it's the last Level
added and there's enough room in the backing store. */
- public boolean canExpand(Level level, int height) {
+ public boolean canExpand(final Level level, final int height) {
if (levels.isEmpty())
return false; // Should not happen
if (levels.get(levels.size() - 1) == level &&
@@ -145,7 +145,7 @@ public class LevelSet {
return false;
}
- public void expand(Level level, int oldHeight, int newHeight) {
+ public void expand(final Level level, final int oldHeight, final int newHeight) {
nextAddY += (newHeight - oldHeight);
}
@@ -156,7 +156,7 @@ public class LevelSet {
/** Sets the height of this LevelSet. It is only legal to reduce the
height to greater than or equal to the currently used height. */
- public void setHeight(int height) throws IllegalArgumentException {
+ public void setHeight(final int height) throws IllegalArgumentException {
if (height < getUsedHeight()) {
throw new IllegalArgumentException("May not reduce height below currently used height");
}
@@ -170,11 +170,11 @@ public class LevelSet {
it may be profitable to perform a compaction. */
public float verticalFragmentationRatio() {
int freeHeight = 0;
- int usedHeight = getUsedHeight();
+ final int usedHeight = getUsedHeight();
if (usedHeight == 0)
return 0.0f;
- for (Iterator<Level> iter = iterator(); iter.hasNext(); ) {
- Level level = iter.next();
+ for (final Iterator<Level> iter = iterator(); iter.hasNext(); ) {
+ final Level level = iter.next();
if (level.isEmpty()) {
freeHeight += level.h();
}
@@ -187,9 +187,9 @@ public class LevelSet {
}
/** Visits all Rects contained in this LevelSet. */
- public void visit(RectVisitor visitor) {
- for (Iterator<Level> iter = levels.iterator(); iter.hasNext(); ) {
- Level level = iter.next();
+ public void visit(final RectVisitor visitor) {
+ for (final Iterator<Level> iter = levels.iterator(); iter.hasNext(); ) {
+ final Level level = iter.next();
level.visit(visitor);
}
}
@@ -199,8 +199,8 @@ public class LevelSet {
update the new Rects in a newly laid-out LevelSet with the
original Rects. */
public void updateRectangleReferences() {
- for (Iterator<Level> iter = levels.iterator(); iter.hasNext(); ) {
- Level level = iter.next();
+ for (final Iterator<Level> iter = levels.iterator(); iter.hasNext(); ) {
+ final Level level = iter.next();
level.updateRectangleReferences();
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
index 89f594230..cbf6b933c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
@@ -77,11 +77,11 @@ public class Rect {
this(null);
}
- public Rect(Object userData) {
+ public Rect(final Object userData) {
this(0, 0, 0, 0, userData);
}
- public Rect(int x, int y, int w, int h, Object userData) {
+ public Rect(final int x, final int y, final int w, final int h, final Object userData) {
setPosition(x, y);
setSize(w, h);
setUserData(userData);
@@ -94,7 +94,7 @@ public class Rect {
public Object getUserData() { return userData; }
public Rect getNextLocation() { return nextLocation; }
- public void setPosition(int x, int y) {
+ public void setPosition(final int x, final int y) {
if (x < 0)
throw new IllegalArgumentException("Negative x");
if (y < 0)
@@ -103,7 +103,7 @@ public class Rect {
this.y = y;
}
- public void setSize(int w, int h) throws IllegalArgumentException {
+ public void setSize(final int w, final int h) throws IllegalArgumentException {
if (w < 0)
throw new IllegalArgumentException("Negative width");
if (h < 0)
@@ -112,8 +112,8 @@ public class Rect {
this.h = h;
}
- public void setUserData(Object obj) { userData = obj; }
- public void setNextLocation(Rect nextLocation) { this.nextLocation = nextLocation; }
+ public void setUserData(final Object obj) { userData = obj; }
+ public void setNextLocation(final Rect nextLocation) { this.nextLocation = nextLocation; }
// Helpers for computations.
@@ -139,7 +139,7 @@ public class Rect {
return y() + h() - 1;
}
- public boolean canContain(Rect other) {
+ public boolean canContain(final Rect other) {
return (w() >= other.w() &&
h() >= other.h());
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
index 44faa44b0..65f59ba53 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
@@ -48,34 +48,34 @@ import java.util.*;
backing store, when necessary. */
public class RectanglePacker {
- private BackingStoreManager manager;
+ private final BackingStoreManager manager;
private Object backingStore;
private LevelSet levels;
- private float EXPANSION_FACTOR = 0.5f;
- private float SHRINK_FACTOR = 0.3f;
+ private final float EXPANSION_FACTOR = 0.5f;
+ private final float SHRINK_FACTOR = 0.3f;
- private int initialWidth;
- private int initialHeight;
+ private final int initialWidth;
+ private final int initialHeight;
private int maxWidth = -1;
private int maxHeight = -1;
static class RectHComparator implements Comparator<Rect> {
@Override
- public int compare(Rect r1, Rect r2) {
+ public int compare(final Rect r1, final Rect r2) {
return r2.h() - r1.h();
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
return this == obj;
}
}
private static final Comparator<Rect> rectHComparator = new RectHComparator();
- public RectanglePacker(BackingStoreManager manager,
- int initialWidth,
- int initialHeight) {
+ public RectanglePacker(final BackingStoreManager manager,
+ final int initialWidth,
+ final int initialHeight) {
this.manager = manager;
levels = new LevelSet(initialWidth, initialHeight);
this.initialWidth = initialWidth;
@@ -95,7 +95,7 @@ public class RectanglePacker {
necessary. Setting up a maximum width and height introduces the
possibility that additions will fail; these are handled with the
BackingStoreManager's allocationFailed notification. */
- public void setMaxSize(int maxWidth, int maxHeight) {
+ public void setMaxSize(final int maxWidth, final int maxHeight) {
this.maxWidth = maxWidth;
this.maxHeight = maxHeight;
}
@@ -107,7 +107,7 @@ public class RectanglePacker {
BackingStoreManager#preExpand BackingStoreManager.preExpand}
does not clear enough space for the incoming rectangle, then
this method will throw a RuntimeException. */
- public void add(Rect rect) throws RuntimeException {
+ public void add(final Rect rect) throws RuntimeException {
// Allocate backing store if we don't have any yet
if (backingStore == null)
backingStore = manager.allocateBackingStore(levels.w(), levels.h());
@@ -143,12 +143,12 @@ public class RectanglePacker {
}
/** Removes the given rectangle from this RectanglePacker. */
- public void remove(Rect rect) {
+ public void remove(final Rect rect) {
levels.remove(rect);
}
/** Visits all Rects contained in this RectanglePacker. */
- public void visit(RectVisitor visitor) {
+ public void visit(final RectVisitor visitor) {
levels.visit(visitor);
}
@@ -168,7 +168,7 @@ public class RectanglePacker {
}
// The "cause" rect may be null
- private void compactImpl(Rect cause) {
+ private void compactImpl(final Rect cause) {
// Have to either expand, compact or both. Need to figure out what
// direction to go. Prefer to expand vertically. Expand
// horizontally only if rectangle being added is too wide. FIXME:
@@ -205,12 +205,12 @@ public class RectanglePacker {
nextLevelSet = new LevelSet(newWidth, newHeight);
// Make copies of all existing rectangles
- List<Rect> newRects = new ArrayList<Rect>();
- for (Iterator<Level> i1 = levels.iterator(); i1.hasNext(); ) {
- Level level = i1.next();
- for (Iterator<Rect> i2 = level.iterator(); i2.hasNext(); ) {
- Rect cur = i2.next();
- Rect newRect = new Rect(0, 0, cur.w(), cur.h(), null);
+ final List<Rect> newRects = new ArrayList<Rect>();
+ for (final Iterator<Level> i1 = levels.iterator(); i1.hasNext(); ) {
+ final Level level = i1.next();
+ for (final Iterator<Rect> i2 = level.iterator(); i2.hasNext(); ) {
+ final Rect cur = i2.next();
+ final Rect newRect = new Rect(0, 0, cur.w(), cur.h(), null);
cur.setNextLocation(newRect);
// Hook up the reverse mapping too for easier replacement
newRect.setNextLocation(cur);
@@ -222,7 +222,7 @@ public class RectanglePacker {
Collections.sort(newRects, rectHComparator);
// Try putting all of these rectangles into the new level set
done = true;
- for (Iterator<Rect> iter = newRects.iterator(); iter.hasNext(); ) {
+ for (final Iterator<Rect> iter = newRects.iterator(); iter.hasNext(); ) {
if (!nextLevelSet.add(iter.next())) {
done = false;
break;
@@ -268,13 +268,13 @@ public class RectanglePacker {
// new locations of rectangles on the backing store. Allocate a
// new backing store, move the contents over and deallocate the
// old one.
- Object newBackingStore = manager.allocateBackingStore(nextLevelSet.w(),
+ final Object newBackingStore = manager.allocateBackingStore(nextLevelSet.w(),
nextLevelSet.h());
manager.beginMovement(backingStore, newBackingStore);
- for (Iterator<Level> i1 = levels.iterator(); i1.hasNext(); ) {
- Level level = i1.next();
- for (Iterator<Rect> i2 = level.iterator(); i2.hasNext(); ) {
- Rect cur = i2.next();
+ for (final Iterator<Level> i1 = levels.iterator(); i1.hasNext(); ) {
+ final Level level = i1.next();
+ for (final Iterator<Rect> i2 = level.iterator(); i2.hasNext(); ) {
+ final Rect cur = i2.next();
manager.move(backingStore, cur,
newBackingStore, cur.getNextLocation());
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java
index a2d202d11..f5ef5672f 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java
@@ -77,7 +77,7 @@ public class ImageSequence implements TextureSequence {
}
public final void addFrame(final GL gl, final Class<?> context, final String imageResourcePath, final String imageSuffix) throws IOException {
- URLConnection urlConn = IOUtil.getResource(context, imageResourcePath);
+ final URLConnection urlConn = IOUtil.getResource(context, imageResourcePath);
if(null != urlConn) {
final TextureData texData = TextureIO.newTextureData(GLProfile.getGL2ES2(), urlConn.getInputStream(), false, imageSuffix);
final Texture tex = new Texture(getTextureTarget());
@@ -97,7 +97,7 @@ public class ImageSequence implements TextureSequence {
public final boolean getManualStepping() { return manualStepping; }
public final TextureSequence.TextureFrame getFrame(final int idx) { return frames.get(idx); }
- public void destroy(GL gl) throws GLException {
+ public void destroy(final GL gl) throws GLException {
for(int i=frames.size()-1; i>=0; i--) {
frames.get(i).getTexture().destroy(gl);
}
@@ -133,7 +133,7 @@ public class ImageSequence implements TextureSequence {
}
@Override
- public TextureSequence.TextureFrame getNextTexture(GL gl) throws IllegalStateException {
+ public TextureSequence.TextureFrame getNextTexture(final GL gl) throws IllegalStateException {
if( !manualStepping ) {
frameIdx = ( frameIdx + 1 ) % frames.size();
}
@@ -153,7 +153,7 @@ public class ImageSequence implements TextureSequence {
private String textureLookupFunctionName = "myTexture2D";
@Override
- public String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException {
+ public String getTextureLookupFunctionName(final String desiredFuncName) throws IllegalStateException {
if(useBuildInTexLookup) {
return "texture2D";
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
index 47be0714e..e7693f4a6 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
@@ -205,7 +205,7 @@ public class Texture {
private static final boolean disableNPOT = Debug.isPropertyDefined("jogl.texture.nonpot", true);
private static final boolean disableTexRect = Debug.isPropertyDefined("jogl.texture.notexrect", true);
- public Texture(GL gl, TextureData data) throws GLException {
+ public Texture(final GL gl, final TextureData data) throws GLException {
texID = 0;
updateImage(gl, data);
}
@@ -216,7 +216,7 @@ public class Texture {
* @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D,
* GL2.GL_TEXTURE_RECTANGLE
*/
- public Texture(int target) {
+ public Texture(final int target) {
texID = 0;
this.target = target;
}
@@ -278,7 +278,7 @@ public class Texture {
* @throws GLException if no OpenGL context was current or if any
* OpenGL-related errors occurred
*/
- public void enable(GL gl) throws GLException {
+ public void enable(final GL gl) throws GLException {
if( !gl.isGLcore() && GLES2.GL_TEXTURE_EXTERNAL_OES != target) {
gl.glEnable(target);
}
@@ -305,7 +305,7 @@ public class Texture {
* @throws GLException if no OpenGL context was current or if any
* OpenGL-related errors occurred
*/
- public void disable(GL gl) throws GLException {
+ public void disable(final GL gl) throws GLException {
if( !gl.isGLcore() && GLES2.GL_TEXTURE_EXTERNAL_OES != target ) {
gl.glDisable(target);
}
@@ -325,7 +325,7 @@ public class Texture {
* @throws GLException if no OpenGL context was current or if any
* OpenGL-related errors occurred
*/
- public void bind(GL gl) throws GLException {
+ public void bind(final GL gl) throws GLException {
validateTexID(gl, true);
gl.glBindTexture(target, texID);
}
@@ -335,7 +335,7 @@ public class Texture {
*
* @throws GLException if any OpenGL-related errors occurred
*/
- public void destroy(GL gl) throws GLException {
+ public void destroy(final GL gl) throws GLException {
if(0!=texID) {
gl.glDeleteTextures(1, new int[] {texID}, 0);
texID = 0;
@@ -437,7 +437,7 @@ public class Texture {
*
* @return the texture coordinates corresponding to the specified sub-image
*/
- public TextureCoords getSubImageTexCoords(int x1, int y1, int x2, int y2) {
+ public TextureCoords getSubImageTexCoords(final int x1, final int y1, final int x2, final int y2) {
if (target == GL2.GL_TEXTURE_RECTANGLE_ARB) {
if (mustFlipVertically) {
return new TextureCoords(x1, texHeight - y1, x2, texHeight - y2);
@@ -445,12 +445,12 @@ public class Texture {
return new TextureCoords(x1, y1, x2, y2);
}
} else {
- float tx1 = (float)x1 / (float)texWidth;
- float ty1 = (float)y1 / (float)texHeight;
- float tx2 = (float)x2 / (float)texWidth;
- float ty2 = (float)y2 / (float)texHeight;
+ final float tx1 = (float)x1 / (float)texWidth;
+ final float ty1 = (float)y1 / (float)texHeight;
+ final float tx2 = (float)x2 / (float)texWidth;
+ final float ty2 = (float)y2 / (float)texHeight;
if (mustFlipVertically) {
- float yMax = (float) imgHeight / (float) texHeight;
+ final float yMax = (float) imgHeight / (float) texHeight;
return new TextureCoords(tx1, yMax - ty1, tx2, yMax - ty2);
} else {
return new TextureCoords(tx1, ty1, tx2, ty2);
@@ -464,7 +464,7 @@ public class Texture {
*
* @throws GLException if any OpenGL-related errors occurred
*/
- public void updateImage(GL gl, TextureData data) throws GLException {
+ public void updateImage(final GL gl, final TextureData data) throws GLException {
updateImage(gl, data, 0);
}
@@ -487,7 +487,7 @@ public class Texture {
* No-op if no change, otherwise generates new {@link TextureCoords}.
* </p>
*/
- public void setMustFlipVertically(boolean v) {
+ public void setMustFlipVertically(final boolean v) {
if( v != mustFlipVertically ) {
mustFlipVertically = v;
updateTexCoords();
@@ -501,7 +501,7 @@ public class Texture {
*
* @throws GLException if any OpenGL-related errors occurred
*/
- public void updateImage(GL gl, TextureData data, int targetOverride) throws GLException {
+ public void updateImage(final GL gl, final TextureData data, final int targetOverride) throws GLException {
validateTexID(gl, true);
imgWidth = data.getWidth();
@@ -522,7 +522,7 @@ public class Texture {
data.setHaveGL12(gl.isExtensionAvailable(GLExtensions.VERSION_1_2));
// Indicates whether both width and height are power of two
- boolean isPOT = isPowerOfTwo(imgWidth) && isPowerOfTwo(imgHeight);
+ final boolean isPOT = isPowerOfTwo(imgWidth) && isPowerOfTwo(imgHeight);
// Note that automatic mipmap generation doesn't work for
// GL_ARB_texture_rectangle
@@ -634,7 +634,7 @@ public class Texture {
}
if (data.getMipmap() && !haveAutoMipmapGeneration) {
- int[] align = new int[1];
+ final int[] align = new int[1];
gl.glGetIntegerv(GL.GL_UNPACK_ALIGNMENT, align, 0); // save alignment
gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, data.getAlignment());
@@ -644,7 +644,7 @@ public class Texture {
try {
// FIXME: may need check for GLUnsupportedException
- GLU glu = GLU.createGLU(gl);
+ final GLU glu = GLU.createGLU(gl);
glu.gluBuild2DMipmaps(texTarget, data.getInternalFormat(),
data.getWidth(), data.getHeight(),
data.getPixelFormat(), data.getPixelType(), data.getBuffer());
@@ -653,7 +653,7 @@ public class Texture {
}
} else {
checkCompressedTextureExtensions(gl, data);
- Buffer[] mipmapData = data.getMipmapData();
+ final Buffer[] mipmapData = data.getMipmapData();
if (mipmapData != null) {
int width = texWidth;
int height = texHeight;
@@ -684,7 +684,7 @@ public class Texture {
texWidth, texHeight, data.getBorder(),
data.getBuffer().capacity(), data.getBuffer());
} else {
- ByteBuffer buf = DDSImage.allocateBlankBuffer(texWidth,
+ final ByteBuffer buf = DDSImage.allocateBlankBuffer(texWidth,
texHeight,
data.getInternalFormat());
gl.glCompressedTexImage2D(texTarget, 0, data.getInternalFormat(),
@@ -710,9 +710,9 @@ public class Texture {
}
}
- int minFilter = (data.getMipmap() ? GL.GL_LINEAR_MIPMAP_LINEAR : GL.GL_LINEAR);
- int magFilter = GL.GL_LINEAR;
- int wrapMode = (gl.isExtensionAvailable(GLExtensions.VERSION_1_2) || !gl.isGL2()) ? GL.GL_CLAMP_TO_EDGE : GL2.GL_CLAMP;
+ final int minFilter = (data.getMipmap() ? GL.GL_LINEAR_MIPMAP_LINEAR : GL.GL_LINEAR);
+ final int magFilter = GL.GL_LINEAR;
+ final int wrapMode = (gl.isExtensionAvailable(GLExtensions.VERSION_1_2) || !gl.isGL2()) ? GL.GL_CLAMP_TO_EDGE : GL2.GL_CLAMP;
// REMIND: figure out what to do for GL_TEXTURE_RECTANGLE_ARB
if (texTarget != GL2.GL_TEXTURE_RECTANGLE_ARB) {
@@ -720,8 +720,8 @@ public class Texture {
gl.glTexParameteri(texParamTarget, GL.GL_TEXTURE_MAG_FILTER, magFilter);
gl.glTexParameteri(texParamTarget, GL.GL_TEXTURE_WRAP_S, wrapMode);
gl.glTexParameteri(texParamTarget, GL.GL_TEXTURE_WRAP_T, wrapMode);
- if (this.target == GL2.GL_TEXTURE_CUBE_MAP) {
- gl.glTexParameteri(texParamTarget, GL2.GL_TEXTURE_WRAP_R, wrapMode);
+ if (this.target == GL.GL_TEXTURE_CUBE_MAP) {
+ gl.glTexParameteri(texParamTarget, GL2ES2.GL_TEXTURE_WRAP_R, wrapMode);
}
}
@@ -758,7 +758,7 @@ public class Texture {
*
* @throws GLException if any OpenGL-related errors occurred
*/
- public void updateSubImage(GL gl, TextureData data, int mipmapLevel, int x, int y) throws GLException {
+ public void updateSubImage(final GL gl, final TextureData data, final int mipmapLevel, final int x, final int y) throws GLException {
if (usingAutoMipmapGeneration && mipmapLevel != 0) {
// When we're using mipmap generation via GL_GENERATE_MIPMAP, we
// don't need to update other mipmap levels
@@ -798,10 +798,10 @@ public class Texture {
* @throws GLException if no OpenGL context was current or if any
* OpenGL-related errors occurred
*/
- public void updateSubImage(GL gl, TextureData data, int mipmapLevel,
- int dstx, int dsty,
- int srcx, int srcy,
- int width, int height) throws GLException {
+ public void updateSubImage(final GL gl, final TextureData data, final int mipmapLevel,
+ final int dstx, final int dsty,
+ final int srcx, final int srcy,
+ final int width, final int height) throws GLException {
if (data.isDataCompressed()) {
throw new GLException("updateSubImage specifying a sub-rectangle is not supported for compressed TextureData");
}
@@ -823,8 +823,8 @@ public class Texture {
* @throws GLException if no OpenGL context was current or if any
* OpenGL-related errors occurred
*/
- public void setTexParameterf(GL gl, int parameterName,
- float value) {
+ public void setTexParameterf(final GL gl, final int parameterName,
+ final float value) {
bind(gl);
gl.glTexParameterf(target, parameterName, value);
}
@@ -836,8 +836,8 @@ public class Texture {
*
* @throws GLException if any OpenGL-related errors occurred
*/
- public void setTexParameterfv(GL gl, int parameterName,
- FloatBuffer params) {
+ public void setTexParameterfv(final GL gl, final int parameterName,
+ final FloatBuffer params) {
bind(gl);
gl.glTexParameterfv(target, parameterName, params);
}
@@ -849,8 +849,8 @@ public class Texture {
*
* @throws GLException if any OpenGL-related errors occurred
*/
- public void setTexParameterfv(GL gl, int parameterName,
- float[] params, int params_offset) {
+ public void setTexParameterfv(final GL gl, final int parameterName,
+ final float[] params, final int params_offset) {
bind(gl);
gl.glTexParameterfv(target, parameterName, params, params_offset);
}
@@ -865,8 +865,8 @@ public class Texture {
*
* @throws GLException if any OpenGL-related errors occurred
*/
- public void setTexParameteri(GL gl, int parameterName,
- int value) {
+ public void setTexParameteri(final GL gl, final int parameterName,
+ final int value) {
bind(gl);
gl.glTexParameteri(target, parameterName, value);
}
@@ -878,8 +878,8 @@ public class Texture {
*
* @throws GLException if any OpenGL-related errors occurred
*/
- public void setTexParameteriv(GL gl, int parameterName,
- IntBuffer params) {
+ public void setTexParameteriv(final GL gl, final int parameterName,
+ final IntBuffer params) {
bind(gl);
gl.glTexParameteriv(target, parameterName, params);
}
@@ -891,8 +891,8 @@ public class Texture {
*
* @throws GLException if any OpenGL-related errors occurred
*/
- public void setTexParameteriv(GL gl, int parameterName,
- int[] params, int params_offset) {
+ public void setTexParameteriv(final GL gl, final int parameterName,
+ final int[] params, final int params_offset) {
bind(gl);
gl.glTexParameteriv(target, parameterName, params, params_offset);
}
@@ -908,7 +908,7 @@ public class Texture {
* otherwise it may be <code>null</code>.
* @see #getTextureObject()
*/
- public int getTextureObject(GL gl) {
+ public int getTextureObject(final GL gl) {
validateTexID(gl, false);
return texID;
}
@@ -957,7 +957,7 @@ public class Texture {
*
* @return true if the given value is a power of two, false otherwise
*/
- private static boolean isPowerOfTwo(int val) {
+ private static boolean isPowerOfTwo(final int val) {
return ((val & (val - 1)) == 0);
}
@@ -969,7 +969,7 @@ public class Texture {
* @param val the value
* @return the next power of two
*/
- private static int nextPowerOfTwo(int val) {
+ private static int nextPowerOfTwo(final int val) {
int ret = 1;
while (ret < val) {
ret <<= 1;
@@ -981,7 +981,7 @@ public class Texture {
* Updates the actual image dimensions; usually only called from
* <code>updateImage</code>.
*/
- private void setImageSize(int width, int height, int target) {
+ private void setImageSize(final int width, final int height, final int target) {
imgWidth = width;
imgHeight = height;
updateTexCoords();
@@ -1010,7 +1010,7 @@ public class Texture {
}
}
- private void updateSubImageImpl(GL gl, TextureData data, int newTarget, int mipmapLevel,
+ private void updateSubImageImpl(final GL gl, final TextureData data, final int newTarget, final int mipmapLevel,
int dstx, int dsty,
int srcx, int srcy, int width, int height) throws GLException {
data.setHaveEXTABGR(gl.isExtensionAvailable(GLExtensions.EXT_abgr));
@@ -1081,15 +1081,15 @@ public class Texture {
data.getInternalFormat(),
buffer.remaining(), buffer);
} else {
- int[] align = { 0 };
- int[] rowLength = { 0 };
- int[] skipRows = { 0 };
- int[] skipPixels = { 0 };
+ final int[] align = { 0 };
+ final int[] rowLength = { 0 };
+ final int[] skipRows = { 0 };
+ final int[] skipPixels = { 0 };
gl.glGetIntegerv(GL.GL_UNPACK_ALIGNMENT, align, 0); // save alignment
if(gl.isGL2GL3()) {
- gl.glGetIntegerv(GL2GL3.GL_UNPACK_ROW_LENGTH, rowLength, 0); // save row length
- gl.glGetIntegerv(GL2GL3.GL_UNPACK_SKIP_ROWS, skipRows, 0); // save skipped rows
- gl.glGetIntegerv(GL2GL3.GL_UNPACK_SKIP_PIXELS, skipPixels, 0); // save skipped pixels
+ gl.glGetIntegerv(GL2ES2.GL_UNPACK_ROW_LENGTH, rowLength, 0); // save row length
+ gl.glGetIntegerv(GL2ES2.GL_UNPACK_SKIP_ROWS, skipRows, 0); // save skipped rows
+ gl.glGetIntegerv(GL2ES2.GL_UNPACK_SKIP_PIXELS, skipPixels, 0); // save skipped pixels
}
gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, data.getAlignment());
if (DEBUG && VERBOSE) {
@@ -1102,9 +1102,9 @@ public class Texture {
System.out.println("height = " + height);
}
if(gl.isGL2GL3()) {
- gl.glPixelStorei(GL2GL3.GL_UNPACK_ROW_LENGTH, rowlen);
- gl.glPixelStorei(GL2GL3.GL_UNPACK_SKIP_ROWS, srcy);
- gl.glPixelStorei(GL2GL3.GL_UNPACK_SKIP_PIXELS, srcx);
+ gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, rowlen);
+ gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS, srcy);
+ gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_PIXELS, srcx);
} else {
if ( rowlen!=0 && rowlen!=width &&
srcy!=0 && srcx!=0 ) {
@@ -1118,14 +1118,14 @@ public class Texture {
buffer);
gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, align[0]); // restore alignment
if(gl.isGL2GL3()) {
- gl.glPixelStorei(GL2GL3.GL_UNPACK_ROW_LENGTH, rowLength[0]); // restore row length
- gl.glPixelStorei(GL2GL3.GL_UNPACK_SKIP_ROWS, skipRows[0]); // restore skipped rows
- gl.glPixelStorei(GL2GL3.GL_UNPACK_SKIP_PIXELS, skipPixels[0]); // restore skipped pixels
+ gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, rowLength[0]); // restore row length
+ gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS, skipRows[0]); // restore skipped rows
+ gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_PIXELS, skipPixels[0]); // restore skipped pixels
}
}
}
- private void checkCompressedTextureExtensions(GL gl, TextureData data) {
+ private void checkCompressedTextureExtensions(final GL gl, final TextureData data) {
if (data.isDataCompressed()) {
switch (data.getInternalFormat()) {
case GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
@@ -1145,10 +1145,10 @@ public class Texture {
}
}
- private boolean validateTexID(GL gl, boolean throwException) {
+ private boolean validateTexID(final GL gl, final boolean throwException) {
if( 0 == texID ) {
if( null != gl ) {
- int[] tmp = new int[1];
+ final int[] tmp = new int[1];
gl.glGenTextures(1, tmp, 0);
texID = tmp[0];
if ( 0 == texID && throwException ) {
@@ -1162,22 +1162,22 @@ public class Texture {
}
// Helper routines for disabling certain codepaths
- private static boolean haveNPOT(GL gl) {
+ private static boolean haveNPOT(final GL gl) {
return !disableNPOT && gl.isNPOTTextureAvailable();
}
- private static boolean haveTexRect(GL gl) {
+ private static boolean haveTexRect(final GL gl) {
return (!disableTexRect &&
TextureIO.isTexRectEnabled() &&
gl.isExtensionAvailable(GLExtensions.ARB_texture_rectangle));
}
- private static boolean preferTexRect(GL gl) {
+ private static boolean preferTexRect(final GL gl) {
// Prefer GL_ARB_texture_rectangle on ATI hardware on Mac OS X
// due to software fallbacks
if (NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {
- String vendor = gl.glGetString(GL.GL_VENDOR);
+ final String vendor = gl.glGetString(GL.GL_VENDOR);
if (vendor != null && vendor.startsWith("ATI")) {
return true;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
index ba59f89c5..17fcc7016 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
@@ -48,14 +48,14 @@ package com.jogamp.opengl.util.texture;
public class TextureCoords {
// These represent the lower-left point
- private float left;
- private float bottom;
+ private final float left;
+ private final float bottom;
// These represent the upper-right point
- private float right;
- private float top;
+ private final float right;
+ private final float top;
- public TextureCoords(float left, float bottom,
- float right, float top) {
+ public TextureCoords(final float left, final float bottom,
+ final float right, final float top) {
this.left = left;
this.bottom = bottom;
this.right = right;
@@ -70,7 +70,7 @@ public class TextureCoords {
* right top
* </pre>
*/
- public float[] getST_LB_RB_LT_RT(float[] d, int d_off, float ss, float ts) {
+ public float[] getST_LB_RB_LT_RT(final float[] d, final int d_off, final float ss, final float ts) {
d[0+d_off] = left *ss; d[1+d_off] = bottom*ts;
d[2+d_off] = right *ss; d[3+d_off] = bottom*ts;
d[4+d_off] = left *ss; d[5+d_off] = top *ts;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
index 5d88a76c0..5b2e4fc00 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
@@ -41,6 +41,7 @@ import java.nio.Buffer;
import javax.media.opengl.GLProfile;
+import com.jogamp.common.nio.Buffers;
import com.jogamp.opengl.util.GLBuffers;
import com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes;
@@ -123,18 +124,18 @@ public class TextureData {
* data were invalid, such as requesting mipmap generation for a
* compressed texture
*/
- public TextureData(GLProfile glp,
- int internalFormat,
- int width,
- int height,
- int border,
- int pixelFormat,
- int pixelType,
- boolean mipmap,
- boolean dataIsCompressed,
- boolean mustFlipVertically,
- Buffer buffer,
- Flusher flusher) throws IllegalArgumentException {
+ public TextureData(final GLProfile glp,
+ final int internalFormat,
+ final int width,
+ final int height,
+ final int border,
+ final int pixelFormat,
+ final int pixelType,
+ final boolean mipmap,
+ final boolean dataIsCompressed,
+ final boolean mustFlipVertically,
+ final Buffer buffer,
+ final Flusher flusher) throws IllegalArgumentException {
this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
mipmap, dataIsCompressed, mustFlipVertically, buffer, flusher);
}
@@ -178,17 +179,17 @@ public class TextureData {
* data were invalid, such as requesting mipmap generation for a
* compressed texture
*/
- public TextureData(GLProfile glp,
- int internalFormat,
- int width,
- int height,
- int border,
- GLPixelAttributes pixelAttributes,
- boolean mipmap,
- boolean dataIsCompressed,
- boolean mustFlipVertically,
- Buffer buffer,
- Flusher flusher) throws IllegalArgumentException {
+ public TextureData(final GLProfile glp,
+ final int internalFormat,
+ final int width,
+ final int height,
+ final int border,
+ final GLPixelAttributes pixelAttributes,
+ final boolean mipmap,
+ final boolean dataIsCompressed,
+ final boolean mustFlipVertically,
+ final Buffer buffer,
+ final Flusher flusher) throws IllegalArgumentException {
if (mipmap && dataIsCompressed) {
throw new IllegalArgumentException("Can not generate mipmaps for compressed textures");
}
@@ -247,17 +248,17 @@ public class TextureData {
* data were invalid, such as requesting mipmap generation for a
* compressed texture
*/
- public TextureData(GLProfile glp,
- int internalFormat,
- int width,
- int height,
- int border,
- int pixelFormat,
- int pixelType,
- boolean dataIsCompressed,
- boolean mustFlipVertically,
- Buffer[] mipmapData,
- Flusher flusher) throws IllegalArgumentException {
+ public TextureData(final GLProfile glp,
+ final int internalFormat,
+ final int width,
+ final int height,
+ final int border,
+ final int pixelFormat,
+ final int pixelType,
+ final boolean dataIsCompressed,
+ final boolean mustFlipVertically,
+ final Buffer[] mipmapData,
+ final Flusher flusher) throws IllegalArgumentException {
this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
dataIsCompressed, mustFlipVertically, mipmapData, flusher);
}
@@ -300,16 +301,16 @@ public class TextureData {
* data were invalid, such as requesting mipmap generation for a
* compressed texture
*/
- public TextureData(GLProfile glp,
- int internalFormat,
- int width,
- int height,
- int border,
- GLPixelAttributes pixelAttributes,
- boolean dataIsCompressed,
- boolean mustFlipVertically,
- Buffer[] mipmapData,
- Flusher flusher) throws IllegalArgumentException {
+ public TextureData(final GLProfile glp,
+ final int internalFormat,
+ final int width,
+ final int height,
+ final int border,
+ final GLPixelAttributes pixelAttributes,
+ final boolean dataIsCompressed,
+ final boolean mustFlipVertically,
+ final Buffer[] mipmapData,
+ final Flusher flusher) throws IllegalArgumentException {
this.glProfile = glp;
this.width = width;
this.height = height;
@@ -318,7 +319,7 @@ public class TextureData {
this.internalFormat = internalFormat;
this.dataIsCompressed = dataIsCompressed;
this.mustFlipVertically = mustFlipVertically;
- this.mipmapData = (Buffer[]) mipmapData.clone();
+ this.mipmapData = mipmapData.clone();
this.flusher = flusher;
alignment = 1; // FIXME: is this correct enough in all situations?
for (int i = 0; i < mipmapData.length; i++) {
@@ -336,10 +337,10 @@ public class TextureData {
* Set the color space of the pixel data, which defaults to {@link ColorSpace#RGB}.
* @see #getColorSpace()
*/
- public void setColorSpace(ColorSpace cs) { pixelCS = cs; }
+ public void setColorSpace(final ColorSpace cs) { pixelCS = cs; }
/** Used only by subclasses */
- protected TextureData(GLProfile glp) { this.glProfile = glp; this.pixelAttributes = GLPixelAttributes.UNDEF; }
+ protected TextureData(final GLProfile glp) { this.glProfile = glp; this.pixelAttributes = GLPixelAttributes.UNDEF; }
/** Returns the width in pixels of the texture data. */
public int getWidth() { return width; }
@@ -399,20 +400,20 @@ public class TextureData {
}
/** Sets the width in pixels of the texture data. */
- public void setWidth(int width) { this.width = width; }
+ public void setWidth(final int width) { this.width = width; }
/** Sets the height in pixels of the texture data. */
- public void setHeight(int height) { this.height = height; }
+ public void setHeight(final int height) { this.height = height; }
/** Sets the border in pixels of the texture data. */
- public void setBorder(int border) { this.border = border; }
+ public void setBorder(final int border) { this.border = border; }
/** Sets the intended OpenGL pixel format of the texture data. */
- public void setPixelAttributes(GLPixelAttributes pixelAttributes) { this.pixelAttributes = pixelAttributes; }
+ public void setPixelAttributes(final GLPixelAttributes pixelAttributes) { this.pixelAttributes = pixelAttributes; }
/**
* Sets the intended OpenGL pixel format component of {@link GLPixelAttributes} of the texture data.
* <p>
* Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
* </p>
*/
- public void setPixelFormat(int pixelFormat) {
+ public void setPixelFormat(final int pixelFormat) {
if( pixelAttributes.format != pixelFormat ) {
pixelAttributes = new GLPixelAttributes(pixelFormat, pixelAttributes.type);
}
@@ -423,42 +424,42 @@ public class TextureData {
* Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
* </p>
*/
- public void setPixelType(int pixelType) {
+ public void setPixelType(final int pixelType) {
if( pixelAttributes.type != pixelType) {
pixelAttributes = new GLPixelAttributes(pixelAttributes.format, pixelType);
}
}
/** Sets the intended OpenGL internal format of the texture data. */
- public void setInternalFormat(int internalFormat) { this.internalFormat = internalFormat; }
+ public void setInternalFormat(final int internalFormat) { this.internalFormat = internalFormat; }
/** Sets whether mipmaps should be generated for the texture data. */
- public void setMipmap(boolean mipmap) { this.mipmap = mipmap; }
+ public void setMipmap(final boolean mipmap) { this.mipmap = mipmap; }
/** Sets whether the texture data is in compressed form. */
- public void setIsDataCompressed(boolean compressed) { this.dataIsCompressed = compressed; }
+ public void setIsDataCompressed(final boolean compressed) { this.dataIsCompressed = compressed; }
/** Sets whether the texture coordinates must be flipped vertically
for proper display. */
- public void setMustFlipVertically(boolean mustFlipVertically) { this.mustFlipVertically = mustFlipVertically; }
+ public void setMustFlipVertically(final boolean mustFlipVertically) { this.mustFlipVertically = mustFlipVertically; }
/** Sets the texture data. */
- public void setBuffer(Buffer buffer) {
+ public void setBuffer(final Buffer buffer) {
this.buffer = buffer;
estimatedMemorySize = estimatedMemorySize(buffer);
}
/** Sets the required byte alignment for the texture data. */
- public void setAlignment(int alignment) { this.alignment = alignment; }
+ public void setAlignment(final int alignment) { this.alignment = alignment; }
/** Sets the row length needed for correct GL_UNPACK_ROW_LENGTH
specification. This is currently only supported for
non-mipmapped, non-compressed textures. */
- public void setRowLength(int rowLength) { this.rowLength = rowLength; }
+ public void setRowLength(final int rowLength) { this.rowLength = rowLength; }
/** Indicates to this TextureData whether the GL_EXT_abgr extension
is available. Used for optimization along some code paths to
avoid data copies. */
- public void setHaveEXTABGR(boolean haveEXTABGR) {
+ public void setHaveEXTABGR(final boolean haveEXTABGR) {
this.haveEXTABGR = haveEXTABGR;
}
/** Indicates to this TextureData whether OpenGL version 1.2 is
available. If not, falls back to relatively inefficient code
paths for several input data types (several kinds of packed
pixel formats, in particular). */
- public void setHaveGL12(boolean haveGL12) {
+ public void setHaveGL12(final boolean haveGL12) {
this.haveGL12 = haveGL12;
}
@@ -509,10 +510,10 @@ public class TextureData {
// Internals only below this point
//
- protected static int estimatedMemorySize(Buffer buffer) {
+ protected static int estimatedMemorySize(final Buffer buffer) {
if (buffer == null) {
return 0;
}
- return buffer.capacity() * GLBuffers.sizeOfBufferElem(buffer);
+ return buffer.capacity() * Buffers.sizeOfBufferElem(buffer);
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
index b2bcd0de3..19f2fc05b 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
@@ -60,6 +60,7 @@ import javax.media.nativewindow.util.DimensionImmutable;
import javax.media.nativewindow.util.PixelFormat;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
+import javax.media.opengl.GL2ES3;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLContext;
import javax.media.opengl.GLException;
@@ -209,8 +210,8 @@ public class TextureIO {
* registered texture providers could read the file
* @throws IOException if an error occurred while reading the file
*/
- public static TextureData newTextureData(GLProfile glp, File file,
- boolean mipmap,
+ public static TextureData newTextureData(final GLProfile glp, final File file,
+ final boolean mipmap,
String fileSuffix) throws IOException {
if (fileSuffix == null) {
fileSuffix = IOUtil.getFileSuffix(file);
@@ -239,9 +240,9 @@ public class TextureIO {
* registered texture providers could read the stream
* @throws IOException if an error occurred while reading the stream
*/
- public static TextureData newTextureData(GLProfile glp, InputStream stream,
- boolean mipmap,
- String fileSuffix) throws IOException {
+ public static TextureData newTextureData(final GLProfile glp, final InputStream stream,
+ final boolean mipmap,
+ final String fileSuffix) throws IOException {
return newTextureDataImpl(glp, stream, 0, 0, mipmap, fileSuffix);
}
@@ -266,8 +267,8 @@ public class TextureIO {
* registered texture providers could read the URL
* @throws IOException if an error occurred while reading the URL
*/
- public static TextureData newTextureData(GLProfile glp, URL url,
- boolean mipmap,
+ public static TextureData newTextureData(final GLProfile glp, final URL url,
+ final boolean mipmap,
String fileSuffix) throws IOException {
if (fileSuffix == null) {
fileSuffix = IOUtil.getFileSuffix(url.getPath());
@@ -314,10 +315,10 @@ public class TextureIO {
* pixelFormat was 0
* @throws IOException if an error occurred while reading the file
*/
- public static TextureData newTextureData(GLProfile glp, File file,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
+ public static TextureData newTextureData(final GLProfile glp, final File file,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
String fileSuffix) throws IOException, IllegalArgumentException {
if ((internalFormat == 0) || (pixelFormat == 0)) {
throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
@@ -362,11 +363,11 @@ public class TextureIO {
* pixelFormat was 0
* @throws IOException if an error occurred while reading the stream
*/
- public static TextureData newTextureData(GLProfile glp, InputStream stream,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
- String fileSuffix) throws IOException, IllegalArgumentException {
+ public static TextureData newTextureData(final GLProfile glp, final InputStream stream,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
+ final String fileSuffix) throws IOException, IllegalArgumentException {
if ((internalFormat == 0) || (pixelFormat == 0)) {
throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
}
@@ -406,10 +407,10 @@ public class TextureIO {
* pixelFormat was 0
* @throws IOException if an error occurred while reading the URL
*/
- public static TextureData newTextureData(GLProfile glp, URL url,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
+ public static TextureData newTextureData(final GLProfile glp, final URL url,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
String fileSuffix) throws IOException, IllegalArgumentException {
if ((internalFormat == 0) || (pixelFormat == 0)) {
throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
@@ -435,7 +436,7 @@ public class TextureIO {
* OpenGL error occurred
* @throws IllegalArgumentException if the passed TextureData was null
*/
- public static Texture newTexture(TextureData data) throws GLException, IllegalArgumentException {
+ public static Texture newTexture(final TextureData data) throws GLException, IllegalArgumentException {
return newTexture(GLContext.getCurrentGL(), data);
}
@@ -448,7 +449,7 @@ public class TextureIO {
* OpenGL error occurred
* @throws IllegalArgumentException if the passed TextureData was null
*/
- public static Texture newTexture(GL gl, TextureData data) throws GLException, IllegalArgumentException {
+ public static Texture newTexture(final GL gl, final TextureData data) throws GLException, IllegalArgumentException {
if (data == null) {
throw new IllegalArgumentException("Null TextureData");
}
@@ -470,11 +471,11 @@ public class TextureIO {
* @throws GLException if no OpenGL context is current or if an
* OpenGL error occurred
*/
- public static Texture newTexture(File file, boolean mipmap) throws IOException, GLException {
- GL gl = GLContext.getCurrentGL();
- GLProfile glp = gl.getGLProfile();
- TextureData data = newTextureData(glp, file, mipmap, IOUtil.getFileSuffix(file));
- Texture texture = newTexture(gl, data);
+ public static Texture newTexture(final File file, final boolean mipmap) throws IOException, GLException {
+ final GL gl = GLContext.getCurrentGL();
+ final GLProfile glp = gl.getGLProfile();
+ final TextureData data = newTextureData(glp, file, mipmap, IOUtil.getFileSuffix(file));
+ final Texture texture = newTexture(gl, data);
data.flush();
return texture;
}
@@ -499,11 +500,11 @@ public class TextureIO {
* @throws GLException if no OpenGL context is current or if an
* OpenGL error occurred
*/
- public static Texture newTexture(InputStream stream, boolean mipmap, String fileSuffix) throws IOException, GLException {
- GL gl = GLContext.getCurrentGL();
- GLProfile glp = gl.getGLProfile();
- TextureData data = newTextureData(glp, stream, mipmap, fileSuffix);
- Texture texture = newTexture(gl, data);
+ public static Texture newTexture(final InputStream stream, final boolean mipmap, final String fileSuffix) throws IOException, GLException {
+ final GL gl = GLContext.getCurrentGL();
+ final GLProfile glp = gl.getGLProfile();
+ final TextureData data = newTextureData(glp, stream, mipmap, fileSuffix);
+ final Texture texture = newTexture(gl, data);
data.flush();
return texture;
}
@@ -528,14 +529,14 @@ public class TextureIO {
* @throws GLException if no OpenGL context is current or if an
* OpenGL error occurred
*/
- public static Texture newTexture(URL url, boolean mipmap, String fileSuffix) throws IOException, GLException {
+ public static Texture newTexture(final URL url, final boolean mipmap, String fileSuffix) throws IOException, GLException {
if (fileSuffix == null) {
fileSuffix = IOUtil.getFileSuffix(url.getPath());
}
- GL gl = GLContext.getCurrentGL();
- GLProfile glp = gl.getGLProfile();
- TextureData data = newTextureData(glp, url, mipmap, fileSuffix);
- Texture texture = newTexture(gl, data);
+ final GL gl = GLContext.getCurrentGL();
+ final GLProfile glp = gl.getGLProfile();
+ final TextureData data = newTextureData(glp, url, mipmap, fileSuffix);
+ final Texture texture = newTexture(gl, data);
data.flush();
return texture;
}
@@ -549,7 +550,7 @@ public class TextureIO {
* @param target the OpenGL target type, eg GL.GL_TEXTURE_2D,
* GL.GL_TEXTURE_RECTANGLE_ARB
*/
- public static Texture newTexture(int target) {
+ public static Texture newTexture(final int target) {
return new Texture(target);
}
@@ -579,31 +580,31 @@ public class TextureIO {
* @throws GLException if no OpenGL context was current or an
* OpenGL-related error occurred
*/
- public static void write(Texture texture, File file) throws IOException, GLException {
+ public static void write(final Texture texture, final File file) throws IOException, GLException {
if (texture.getTarget() != GL.GL_TEXTURE_2D) {
throw new GLException("Only GL_TEXTURE_2D textures are supported");
}
// First fetch the texture data
- GL _gl = GLContext.getCurrentGL();
+ final GL _gl = GLContext.getCurrentGL();
if (!_gl.isGL2GL3()) {
throw new GLException("Implementation only supports GL2GL3 (Use GLReadBufferUtil and the TextureData variant), have: " + _gl);
}
- GL2GL3 gl = _gl.getGL2();
+ final GL2GL3 gl = _gl.getGL2();
texture.bind(gl);
- int internalFormat = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_INTERNAL_FORMAT);
- int width = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_WIDTH);
- int height = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_HEIGHT);
- int border = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_BORDER);
+ final int internalFormat = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2GL3.GL_TEXTURE_INTERNAL_FORMAT);
+ final int width = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2GL3.GL_TEXTURE_WIDTH);
+ final int height = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2GL3.GL_TEXTURE_HEIGHT);
+ final int border = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_BORDER);
TextureData data = null;
if (internalFormat == GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT ||
internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT ||
internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) {
// Fetch using glGetCompressedTexImage
- int size = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_COMPRESSED_IMAGE_SIZE);
- ByteBuffer res = ByteBuffer.allocate(size);
+ final int size = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2GL3.GL_TEXTURE_COMPRESSED_IMAGE_SIZE);
+ final ByteBuffer res = ByteBuffer.allocate(size);
gl.glGetCompressedTexImage(GL.GL_TEXTURE_2D, 0, res);
data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, internalFormat, GL.GL_UNSIGNED_BYTE,
false, true, true, res, null);
@@ -612,7 +613,7 @@ public class TextureIO {
int fetchedFormat = 0;
switch (internalFormat) {
case GL.GL_RGB:
- case GL2.GL_BGR:
+ case GL2GL3.GL_BGR:
case GL.GL_RGB8:
bytesPerPixel = 3;
fetchedFormat = GL.GL_RGB;
@@ -629,19 +630,19 @@ public class TextureIO {
}
// Fetch using glGetTexImage
- int packAlignment = glGetInteger(gl, GL.GL_PACK_ALIGNMENT);
- int packRowLength = glGetInteger(gl, GL2.GL_PACK_ROW_LENGTH);
- int packSkipRows = glGetInteger(gl, GL2.GL_PACK_SKIP_ROWS);
- int packSkipPixels = glGetInteger(gl, GL2.GL_PACK_SKIP_PIXELS);
- int packSwapBytes = glGetInteger(gl, GL2.GL_PACK_SWAP_BYTES);
+ final int packAlignment = glGetInteger(gl, GL.GL_PACK_ALIGNMENT);
+ final int packRowLength = glGetInteger(gl, GL2ES3.GL_PACK_ROW_LENGTH);
+ final int packSkipRows = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_ROWS);
+ final int packSkipPixels = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_PIXELS);
+ final int packSwapBytes = glGetInteger(gl, GL2GL3.GL_PACK_SWAP_BYTES);
gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, 1);
- gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, 0);
- gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, 0);
- gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, 0);
- gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, 0);
+ gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, 0);
+ gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_ROWS, 0);
+ gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_PIXELS, 0);
+ gl.glPixelStorei(GL2GL3.GL_PACK_SWAP_BYTES, 0);
- ByteBuffer res = ByteBuffer.allocate((width + (2 * border)) *
+ final ByteBuffer res = ByteBuffer.allocate((width + (2 * border)) *
(height + (2 * border)) *
bytesPerPixel);
if (DEBUG) {
@@ -651,10 +652,10 @@ public class TextureIO {
gl.glGetTexImage(GL.GL_TEXTURE_2D, 0, fetchedFormat, GL.GL_UNSIGNED_BYTE, res);
gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, packAlignment);
- gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, packRowLength);
- gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, packSkipRows);
- gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, packSkipPixels);
- gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, packSwapBytes);
+ gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, packRowLength);
+ gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_ROWS, packSkipRows);
+ gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_PIXELS, packSkipPixels);
+ gl.glPixelStorei(GL2GL3.GL_PACK_SWAP_BYTES, packSwapBytes);
data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE,
false, false, false, res, null);
@@ -668,9 +669,9 @@ public class TextureIO {
write(data, file);
}
- public static void write(TextureData data, File file) throws IOException, GLException {
- for (Iterator<TextureWriter> iter = textureWriters.iterator(); iter.hasNext(); ) {
- TextureWriter writer = iter.next();
+ public static void write(final TextureData data, final File file) throws IOException, GLException {
+ for (final Iterator<TextureWriter> iter = textureWriters.iterator(); iter.hasNext(); ) {
+ final TextureWriter writer = iter.next();
if (writer.write(file, data)) {
return;
}
@@ -689,7 +690,7 @@ public class TextureIO {
* The last provider added, will be the first provider to be tested.
* </p>
*/
- public static void addTextureProvider(TextureProvider provider) {
+ public static void addTextureProvider(final TextureProvider provider) {
// Must always add at the front so the ImageIO provider is last,
// so we don't accidentally use it instead of a user's possibly
// more optimal provider
@@ -702,7 +703,7 @@ public class TextureIO {
* The last provider added, will be the first provider to be tested.
* </p>
*/
- public static void addTextureWriter(TextureWriter writer) {
+ public static void addTextureWriter(final TextureWriter writer) {
// Must always add at the front so the ImageIO writer is last,
// so we don't accidentally use it instead of a user's possibly
// more optimal writer
@@ -727,7 +728,7 @@ public class TextureIO {
the GL_ARB_texture_rectangle extension to be turned off globally
for this purpose. The default is that the use of the extension
is enabled. */
- public static void setTexRectEnabled(boolean enabled) {
+ public static void setTexRectEnabled(final boolean enabled) {
texRectEnabled = enabled;
}
@@ -750,10 +751,10 @@ public class TextureIO {
if(GLProfile.isAWTAvailable()) {
try {
// Use reflection to avoid compile-time dependencies on AWT-related classes
- TextureProvider provider = (TextureProvider)
+ final TextureProvider provider = (TextureProvider)
Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureProvider").newInstance();
addTextureProvider(provider);
- } catch (Exception e) {
+ } catch (final Exception e) {
if (DEBUG) {
e.printStackTrace();
}
@@ -771,14 +772,14 @@ public class TextureIO {
if(GLProfile.isAWTAvailable()) {
try {
// Use reflection to avoid compile-time dependencies on AWT-related classes
- TextureWriter writer = (TextureWriter)
+ final TextureWriter writer = (TextureWriter)
Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureWriter").newInstance();
addTextureWriter(writer);
- } catch (Exception e) {
+ } catch (final Exception e) {
if (DEBUG) {
e.printStackTrace();
}
- } catch (Error e) {
+ } catch (final Error e) {
if (DEBUG) {
e.printStackTrace();
}
@@ -794,10 +795,10 @@ public class TextureIO {
}
// Implementation methods
- private static TextureData newTextureDataImpl(GLProfile glp, File file,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
+ private static TextureData newTextureDataImpl(final GLProfile glp, final File file,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
String fileSuffix) throws IOException {
if (file == null) {
throw new IOException("File was null");
@@ -805,9 +806,9 @@ public class TextureIO {
fileSuffix = toLowerCase(fileSuffix);
- for (Iterator<TextureProvider> iter = textureProviders.iterator(); iter.hasNext(); ) {
- TextureProvider provider = iter.next();
- TextureData data = provider.newTextureData(glp, file,
+ for (final Iterator<TextureProvider> iter = textureProviders.iterator(); iter.hasNext(); ) {
+ final TextureProvider provider = iter.next();
+ final TextureData data = provider.newTextureData(glp, file,
internalFormat,
pixelFormat,
mipmap,
@@ -820,10 +821,10 @@ public class TextureIO {
throw new IOException("No suitable reader for given file "+file.getAbsolutePath());
}
- private static TextureData newTextureDataImpl(GLProfile glp, InputStream stream,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
+ private static TextureData newTextureDataImpl(final GLProfile glp, InputStream stream,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
String fileSuffix) throws IOException {
if (stream == null) {
throw new IOException("Stream was null");
@@ -836,9 +837,9 @@ public class TextureIO {
stream = new BufferedInputStream(stream);
}
- for (Iterator<TextureProvider> iter = textureProviders.iterator(); iter.hasNext(); ) {
- TextureProvider provider = iter.next();
- TextureData data = provider.newTextureData(glp, stream,
+ for (final Iterator<TextureProvider> iter = textureProviders.iterator(); iter.hasNext(); ) {
+ final TextureProvider provider = iter.next();
+ final TextureData data = provider.newTextureData(glp, stream,
internalFormat,
pixelFormat,
mipmap,
@@ -851,10 +852,10 @@ public class TextureIO {
throw new IOException("No suitable reader for given stream");
}
- private static TextureData newTextureDataImpl(GLProfile glp, URL url,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
+ private static TextureData newTextureDataImpl(final GLProfile glp, final URL url,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
String fileSuffix) throws IOException {
if (url == null) {
throw new IOException("URL was null");
@@ -862,9 +863,9 @@ public class TextureIO {
fileSuffix = toLowerCase(fileSuffix);
- for (Iterator<TextureProvider> iter = textureProviders.iterator(); iter.hasNext(); ) {
- TextureProvider provider = iter.next();
- TextureData data = provider.newTextureData(glp, url,
+ for (final Iterator<TextureProvider> iter = textureProviders.iterator(); iter.hasNext(); ) {
+ final TextureProvider provider = iter.next();
+ final TextureData data = provider.newTextureData(glp, url,
internalFormat,
pixelFormat,
mipmap,
@@ -881,14 +882,14 @@ public class TextureIO {
// DDS provider -- supports files only for now
static class DDSTextureProvider implements TextureProvider {
@Override
- public TextureData newTextureData(GLProfile glp, File file,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
- String fileSuffix) throws IOException {
+ public TextureData newTextureData(final GLProfile glp, final File file,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
+ final String fileSuffix) throws IOException {
if (DDS.equals(fileSuffix) ||
DDS.equals(IOUtil.getFileSuffix(file))) {
- DDSImage image = DDSImage.read(file);
+ final DDSImage image = DDSImage.read(file);
return newTextureData(glp, image, internalFormat, pixelFormat, mipmap);
}
@@ -896,16 +897,16 @@ public class TextureIO {
}
@Override
- public TextureData newTextureData(GLProfile glp, InputStream stream,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
- String fileSuffix) throws IOException {
+ public TextureData newTextureData(final GLProfile glp, final InputStream stream,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
+ final String fileSuffix) throws IOException {
if (DDS.equals(fileSuffix) ||
DDSImage.isDDSImage(stream)) {
- byte[] data = IOUtil.copyStream2ByteArray(stream);
- ByteBuffer buf = ByteBuffer.wrap(data);
- DDSImage image = DDSImage.read(buf);
+ final byte[] data = IOUtil.copyStream2ByteArray(stream);
+ final ByteBuffer buf = ByteBuffer.wrap(data);
+ final DDSImage image = DDSImage.read(buf);
return newTextureData(glp, image, internalFormat, pixelFormat, mipmap);
}
@@ -913,12 +914,12 @@ public class TextureIO {
}
@Override
- public TextureData newTextureData(GLProfile glp, URL url,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
- String fileSuffix) throws IOException {
- InputStream stream = new BufferedInputStream(url.openStream());
+ public TextureData newTextureData(final GLProfile glp, final URL url,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
+ final String fileSuffix) throws IOException {
+ final InputStream stream = new BufferedInputStream(url.openStream());
try {
return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
} finally {
@@ -926,11 +927,11 @@ public class TextureIO {
}
}
- private TextureData newTextureData(GLProfile glp, final DDSImage image,
+ private TextureData newTextureData(final GLProfile glp, final DDSImage image,
int internalFormat,
int pixelFormat,
boolean mipmap) {
- DDSImage.ImageInfo info = image.getMipMap(0);
+ final DDSImage.ImageInfo info = image.getMipMap(0);
if (pixelFormat == 0) {
switch (image.getPixelFormat()) {
case DDSImage.D3DFMT_R8G8B8:
@@ -967,7 +968,7 @@ public class TextureIO {
break;
}
}
- TextureData.Flusher flusher = new TextureData.Flusher() {
+ final TextureData.Flusher flusher = new TextureData.Flusher() {
@Override
public void flush() {
image.close();
@@ -975,7 +976,7 @@ public class TextureIO {
};
TextureData data;
if (mipmap && image.getNumMipMaps() > 0) {
- Buffer[] mipmapData = new Buffer[image.getNumMipMaps()];
+ final Buffer[] mipmapData = new Buffer[image.getNumMipMaps()];
for (int i = 0; i < image.getNumMipMaps(); i++) {
mipmapData[i] = image.getMipMap(i).getData();
}
@@ -1013,12 +1014,12 @@ public class TextureIO {
// Base class for SGI RGB and TGA image providers
static abstract class StreamBasedTextureProvider implements TextureProvider {
@Override
- public TextureData newTextureData(GLProfile glp, File file,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
- String fileSuffix) throws IOException {
- InputStream inStream = new BufferedInputStream(new FileInputStream(file));
+ public TextureData newTextureData(final GLProfile glp, final File file,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
+ final String fileSuffix) throws IOException {
+ final InputStream inStream = new BufferedInputStream(new FileInputStream(file));
try {
// The SGIImage and TGAImage implementations use InputStreams
// anyway so there isn't much point in having a separate code
@@ -1034,12 +1035,12 @@ public class TextureIO {
}
@Override
- public TextureData newTextureData(GLProfile glp, URL url,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
- String fileSuffix) throws IOException {
- InputStream stream = new BufferedInputStream(url.openStream());
+ public TextureData newTextureData(final GLProfile glp, final URL url,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
+ final String fileSuffix) throws IOException {
+ final InputStream stream = new BufferedInputStream(url.openStream());
try {
return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
} finally {
@@ -1052,15 +1053,15 @@ public class TextureIO {
// SGI RGB image provider
static class SGITextureProvider extends StreamBasedTextureProvider {
@Override
- public TextureData newTextureData(GLProfile glp, InputStream stream,
+ public TextureData newTextureData(final GLProfile glp, final InputStream stream,
int internalFormat,
int pixelFormat,
- boolean mipmap,
- String fileSuffix) throws IOException {
+ final boolean mipmap,
+ final String fileSuffix) throws IOException {
if (SGI.equals(fileSuffix) ||
SGI_RGB.equals(fileSuffix) ||
SGIImage.isSGIImage(stream)) {
- SGIImage image = SGIImage.read(stream);
+ final SGIImage image = SGIImage.read(stream);
if (pixelFormat == 0) {
pixelFormat = image.getFormat();
}
@@ -1088,13 +1089,13 @@ public class TextureIO {
// TGA (Targa) image provider
static class TGATextureProvider extends StreamBasedTextureProvider {
@Override
- public TextureData newTextureData(GLProfile glp, InputStream stream,
+ public TextureData newTextureData(final GLProfile glp, final InputStream stream,
int internalFormat,
int pixelFormat,
- boolean mipmap,
- String fileSuffix) throws IOException {
+ final boolean mipmap,
+ final String fileSuffix) throws IOException {
if (TGA.equals(fileSuffix)) {
- TGAImage image = TGAImage.read(glp, stream);
+ final TGAImage image = TGAImage.read(glp, stream);
if (pixelFormat == 0) {
pixelFormat = image.getGLFormat();
}
@@ -1126,11 +1127,11 @@ public class TextureIO {
// PNG image provider
static class PNGTextureProvider extends StreamBasedTextureProvider {
@Override
- public TextureData newTextureData(GLProfile glp, InputStream stream,
+ public TextureData newTextureData(final GLProfile glp, final InputStream stream,
int internalFormat,
int pixelFormat,
- boolean mipmap,
- String fileSuffix) throws IOException {
+ final boolean mipmap,
+ final String fileSuffix) throws IOException {
if (PNG.equals(fileSuffix)) {
final PNGPixelRect image = PNGPixelRect.read(stream, null, true /* directBuffer */, 0 /* destMinStrideInBytes */, true /* destIsGLOriented */);
final GLPixelAttributes glpa = GLPixelAttributes.convert(image.getPixelformat(), glp);
@@ -1166,13 +1167,13 @@ public class TextureIO {
// JPEG image provider
static class JPGTextureProvider extends StreamBasedTextureProvider {
@Override
- public TextureData newTextureData(GLProfile glp, InputStream stream,
+ public TextureData newTextureData(final GLProfile glp, final InputStream stream,
int internalFormat,
int pixelFormat,
- boolean mipmap,
- String fileSuffix) throws IOException {
+ final boolean mipmap,
+ final String fileSuffix) throws IOException {
if (JPG.equals(fileSuffix)) {
- JPEGImage image = JPEGImage.read(/*glp, */ stream);
+ final JPEGImage image = JPEGImage.read(/*glp, */ stream);
if (pixelFormat == 0) {
pixelFormat = image.getGLFormat();
}
@@ -1205,8 +1206,8 @@ public class TextureIO {
//
static class DDSTextureWriter implements TextureWriter {
@Override
- public boolean write(File file,
- TextureData data) throws IOException {
+ public boolean write(final File file,
+ final TextureData data) throws IOException {
if (DDS.equals(IOUtil.getFileSuffix(file))) {
// See whether the DDS writer can handle this TextureData
final GLPixelAttributes pixelAttribs = data.getPixelAttributes();
@@ -1239,7 +1240,7 @@ public class TextureIO {
mipmaps = new ByteBuffer[] { (ByteBuffer) data.getBuffer() };
}
- DDSImage image = DDSImage.createFromData(d3dFormat,
+ final DDSImage image = DDSImage.createFromData(d3dFormat,
data.getWidth(),
data.getHeight(),
mipmaps);
@@ -1256,9 +1257,9 @@ public class TextureIO {
//
static class SGITextureWriter implements TextureWriter {
@Override
- public boolean write(File file,
- TextureData data) throws IOException {
- String fileSuffix = IOUtil.getFileSuffix(file);
+ public boolean write(final File file,
+ final TextureData data) throws IOException {
+ final String fileSuffix = IOUtil.getFileSuffix(file);
if (SGI.equals(fileSuffix) ||
SGI_RGB.equals(fileSuffix)) {
// See whether the SGI writer can handle this TextureData
@@ -1269,7 +1270,7 @@ public class TextureIO {
pixelFormat == GL.GL_RGBA) &&
(pixelType == GL.GL_BYTE ||
pixelType == GL.GL_UNSIGNED_BYTE)) {
- ByteBuffer buf = ((data.getBuffer() != null) ?
+ final ByteBuffer buf = ((data.getBuffer() != null) ?
(ByteBuffer) data.getBuffer() :
(ByteBuffer) data.getMipmapData()[0]);
byte[] bytes;
@@ -1282,7 +1283,7 @@ public class TextureIO {
buf.rewind();
}
- SGIImage image = SGIImage.createFromData(data.getWidth(),
+ final SGIImage image = SGIImage.createFromData(data.getWidth(),
data.getHeight(),
(pixelFormat == GL.GL_RGBA),
bytes);
@@ -1302,8 +1303,8 @@ public class TextureIO {
static class TGATextureWriter implements TextureWriter {
@Override
- public boolean write(File file,
- TextureData data) throws IOException {
+ public boolean write(final File file,
+ final TextureData data) throws IOException {
if (TGA.equals(IOUtil.getFileSuffix(file))) {
// See whether the TGA writer can handle this TextureData
final GLPixelAttributes pixelAttribs = data.getPixelAttributes();
@@ -1311,7 +1312,7 @@ public class TextureIO {
final int pixelType = pixelAttribs.type;
if ((pixelFormat == GL.GL_RGB ||
pixelFormat == GL.GL_RGBA ||
- pixelFormat == GL2.GL_BGR ||
+ pixelFormat == GL2GL3.GL_BGR ||
pixelFormat == GL.GL_BGRA ) &&
(pixelType == GL.GL_BYTE ||
pixelType == GL.GL_UNSIGNED_BYTE)) {
@@ -1324,16 +1325,16 @@ public class TextureIO {
if( pixelFormat == GL.GL_RGB || pixelFormat == GL.GL_RGBA ) {
// Must reverse order of red and blue channels to get correct results
- int skip = ((pixelFormat == GL.GL_RGB) ? 3 : 4);
+ final int skip = ((pixelFormat == GL.GL_RGB) ? 3 : 4);
for (int i = 0; i < buf.remaining(); i += skip) {
- byte red = buf.get(i + 0);
- byte blue = buf.get(i + 2);
+ final byte red = buf.get(i + 0);
+ final byte blue = buf.get(i + 2);
buf.put(i + 0, blue);
buf.put(i + 2, red);
}
}
- TGAImage image = TGAImage.createFromData(data.getWidth(),
+ final TGAImage image = TGAImage.createFromData(data.getWidth(),
data.getHeight(),
(pixelFormat == GL.GL_RGBA || pixelFormat == GL.GL_BGRA),
false, buf);
@@ -1353,7 +1354,7 @@ public class TextureIO {
static class PNGTextureWriter implements TextureWriter {
@Override
- public boolean write(File file, TextureData data) throws IOException {
+ public boolean write(final File file, final TextureData data) throws IOException {
if (PNG.equals(IOUtil.getFileSuffix(file))) {
// See whether the PNG writer can handle this TextureData
final GLPixelAttributes pixelAttribs = data.getPixelAttributes();
@@ -1403,19 +1404,19 @@ public class TextureIO {
// Helper routines
//
- private static int glGetInteger(GL gl, int pname) {
- int[] tmp = new int[1];
+ private static int glGetInteger(final GL gl, final int pname) {
+ final int[] tmp = new int[1];
gl.glGetIntegerv(pname, tmp, 0);
return tmp[0];
}
- private static int glGetTexLevelParameteri(GL2GL3 gl, int target, int level, int pname) {
- int[] tmp = new int[1];
+ private static int glGetTexLevelParameteri(final GL2GL3 gl, final int target, final int level, final int pname) {
+ final int[] tmp = new int[1];
gl.glGetTexLevelParameteriv(target, 0, pname, tmp, 0);
return tmp[0];
}
- private static String toLowerCase(String arg) {
+ private static String toLowerCase(final String arg) {
if (arg == null) {
return null;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
index ee3b600a5..5add4f695 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
@@ -114,11 +114,11 @@ public interface TextureSequence {
* to associated related data.
*/
public static class TextureFrame extends TimeFrameI {
- public TextureFrame(Texture t, int pts, int duration) {
+ public TextureFrame(final Texture t, final int pts, final int duration) {
super(pts, duration);
texture = t;
}
- public TextureFrame(Texture t) {
+ public TextureFrame(final Texture t) {
texture = t;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
index d8320c690..467ab41c5 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
@@ -53,7 +53,7 @@ public class TextureState {
* Returns <code>0</code> is <code>textureTarget</code> is not supported.
* </p>
*/
- public static final int getTextureTargetQueryName(int textureTarget) {
+ public static final int getTextureTargetQueryName(final int textureTarget) {
final int texBindQName;
switch(textureTarget) {
case GL.GL_TEXTURE_2D: texBindQName = GL.GL_TEXTURE_BINDING_2D; break;
@@ -61,7 +61,7 @@ public class TextureState {
case GL2ES2.GL_TEXTURE_3D: texBindQName = GL2ES2.GL_TEXTURE_BINDING_3D; break;
case GL2GL3.GL_TEXTURE_1D: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D; break;
case GL2GL3.GL_TEXTURE_1D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D_ARRAY; break;
- case GL2GL3.GL_TEXTURE_2D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_2D_ARRAY; break;
+ case GL.GL_TEXTURE_2D_ARRAY: texBindQName = GL.GL_TEXTURE_BINDING_2D_ARRAY; break;
case GL2GL3.GL_TEXTURE_RECTANGLE: texBindQName = GL2GL3.GL_TEXTURE_BINDING_RECTANGLE; break;
case GL2GL3.GL_TEXTURE_BUFFER: texBindQName = GL2GL3.GL_TEXTURE_BINDING_BUFFER; break;
case GL3.GL_TEXTURE_2D_MULTISAMPLE: texBindQName = GL3.GL_TEXTURE_BINDING_2D_MULTISAMPLE; break;
@@ -84,9 +84,9 @@ public class TextureState {
*/
private final int[] state = new int[] { 0, 0, 0, 0, 0, 0 };
- private static final String toHexString(int i) { return "0x"+Integer.toHexString(i); }
+ private static final String toHexString(final int i) { return "0x"+Integer.toHexString(i); }
- private static final int activeTexture(GL gl) {
+ private static final int activeTexture(final GL gl) {
final int[] vi = { 0 };
gl.glGetIntegerv(GL.GL_ACTIVE_TEXTURE, vi, 0);
return vi[0];
@@ -99,7 +99,7 @@ public class TextureState {
* @param textureTarget
* @throws GLException if textureTarget is not supported
*/
- public TextureState(GL gl, int textureTarget) throws GLException {
+ public TextureState(final GL gl, final int textureTarget) throws GLException {
this(gl, activeTexture(gl), textureTarget);
}
@@ -111,7 +111,7 @@ public class TextureState {
* @param textureTarget
* @throws GLException if textureTarget is not supported
*/
- public TextureState(GL gl, int textureUnit, int textureTarget) throws GLException {
+ public TextureState(final GL gl, final int textureUnit, final int textureTarget) throws GLException {
target = textureTarget;
state[0] = textureUnit;
final int texBindQName = getTextureTargetQueryName(textureTarget);
@@ -132,7 +132,7 @@ public class TextureState {
* </p>
* @param gl current GL context's GL object
*/
- public final void restore(GL gl) {
+ public final void restore(final GL gl) {
gl.glActiveTexture(state[0]);
gl.glBindTexture(target, state[1]);
gl.glTexParameteri(target, GL.GL_TEXTURE_MAG_FILTER, state[2]);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
index 202c08e4e..ccb3ecc3c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
@@ -113,11 +113,11 @@ public class AWTTextureData extends TextureData {
* texture
* @param image the image containing the texture data
*/
- public AWTTextureData(GLProfile glp,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
- BufferedImage image) {
+ public AWTTextureData(final GLProfile glp,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
+ final BufferedImage image) {
super(glp);
if (internalFormat == 0) {
this.internalFormat = image.getColorModel().hasAlpha() ? GL.GL_RGBA : GL.GL_RGB;
@@ -176,7 +176,7 @@ public class AWTTextureData extends TextureData {
return buffer;
}
- private void createFromImage(GLProfile glp, BufferedImage image) {
+ private void createFromImage(final GLProfile glp, final BufferedImage image) {
pixelAttributes = GLPixelAttributes.UNDEF; // Determine from image
mustFlipVertically = true;
@@ -185,7 +185,7 @@ public class AWTTextureData extends TextureData {
int scanlineStride;
- SampleModel sm = image.getRaster().getSampleModel();
+ final SampleModel sm = image.getRaster().getSampleModel();
if (sm instanceof SinglePixelPackedSampleModel) {
scanlineStride =
((SinglePixelPackedSampleModel)sm).getScanlineStride();
@@ -300,7 +300,7 @@ public class AWTTextureData extends TextureData {
case BufferedImage.TYPE_BYTE_INDEXED:
case BufferedImage.TYPE_CUSTOM:
default:
- java.awt.image.ColorModel cm = image.getColorModel();
+ final java.awt.image.ColorModel cm = image.getColorModel();
if (cm.equals(rgbColorModel)) {
pixelAttributes = new GLPixelAttributes(GL.GL_RGB, GL.GL_UNSIGNED_BYTE);
rowLength = scanlineStride / 3;
@@ -362,7 +362,7 @@ public class AWTTextureData extends TextureData {
case BufferedImage.TYPE_BYTE_INDEXED:
case BufferedImage.TYPE_CUSTOM:
default:
- java.awt.image.ColorModel cm = image.getColorModel();
+ final java.awt.image.ColorModel cm = image.getColorModel();
if (cm.equals(rgbColorModel)) {
pixelAttributes = new GLPixelAttributes(GL.GL_RGB, GL.GL_UNSIGNED_BYTE);
rowLength = scanlineStride / 3;
@@ -382,9 +382,9 @@ public class AWTTextureData extends TextureData {
createNIOBufferFromImage(image);
}
- private void setupLazyCustomConversion(BufferedImage image) {
+ private void setupLazyCustomConversion(final BufferedImage image) {
imageForLazyCustomConversion = image;
- boolean hasAlpha = image.getColorModel().hasAlpha();
+ final boolean hasAlpha = image.getColorModel().hasAlpha();
int pixelFormat = pixelAttributes.format;
int pixelType = pixelAttributes.type;
if (pixelFormat == 0) {
@@ -395,7 +395,7 @@ public class AWTTextureData extends TextureData {
// Allow previously-selected pixelType (if any) to override that
// we can infer from the DataBuffer
- DataBuffer data = image.getRaster().getDataBuffer();
+ final DataBuffer data = image.getRaster().getDataBuffer();
if (data instanceof DataBufferByte || isPackedInt(image)) {
// Don't use GL_UNSIGNED_INT for BufferedImage packed int images
if (pixelType == 0) pixelType = GL.GL_UNSIGNED_BYTE;
@@ -405,7 +405,7 @@ public class AWTTextureData extends TextureData {
if (pixelType == 0) pixelType = GL.GL_FLOAT;
} else if (data instanceof DataBufferInt) {
// FIXME: should we support signed ints?
- if (pixelType == 0) pixelType = GL2GL3.GL_UNSIGNED_INT;
+ if (pixelType == 0) pixelType = GL.GL_UNSIGNED_INT;
} else if (data instanceof DataBufferShort) {
if (pixelType == 0) pixelType = GL.GL_SHORT;
} else if (data instanceof DataBufferUShort) {
@@ -416,12 +416,12 @@ public class AWTTextureData extends TextureData {
pixelAttributes = new GLPixelAttributes(pixelFormat, pixelType);
}
- private void createFromCustom(BufferedImage image) {
- int width = image.getWidth();
- int height = image.getHeight();
+ private void createFromCustom(final BufferedImage image) {
+ final int width = image.getWidth();
+ final int height = image.getHeight();
// create a temporary image that is compatible with OpenGL
- boolean hasAlpha = image.getColorModel().hasAlpha();
+ final boolean hasAlpha = image.getColorModel().hasAlpha();
java.awt.image.ColorModel cm = null;
int dataBufferType = image.getRaster().getDataBuffer().getDataType();
// Don't use integer components for packed int images
@@ -444,13 +444,13 @@ public class AWTTextureData extends TextureData {
}
}
- boolean premult = cm.isAlphaPremultiplied();
- WritableRaster raster =
+ final boolean premult = cm.isAlphaPremultiplied();
+ final WritableRaster raster =
cm.createCompatibleWritableRaster(width, height);
- BufferedImage texImage = new BufferedImage(cm, raster, premult, null);
+ final BufferedImage texImage = new BufferedImage(cm, raster, premult, null);
// copy the source image into the temporary image
- Graphics2D g = texImage.createGraphics();
+ final Graphics2D g = texImage.createGraphics();
g.setComposite(AlphaComposite.Src);
g.drawImage(image, 0, 0, null);
g.dispose();
@@ -459,8 +459,8 @@ public class AWTTextureData extends TextureData {
createNIOBufferFromImage(texImage);
}
- private boolean isPackedInt(BufferedImage image) {
- int imgType = image.getType();
+ private boolean isPackedInt(final BufferedImage image) {
+ final int imgType = image.getType();
return (imgType == BufferedImage.TYPE_INT_RGB ||
imgType == BufferedImage.TYPE_INT_BGR ||
imgType == BufferedImage.TYPE_INT_ARGB ||
@@ -476,11 +476,11 @@ public class AWTTextureData extends TextureData {
setupLazyCustomConversion(imageForLazyCustomConversion);
}
- private void createNIOBufferFromImage(BufferedImage image) {
+ private void createNIOBufferFromImage(final BufferedImage image) {
buffer = wrapImageDataBuffer(image);
}
- private Buffer wrapImageDataBuffer(BufferedImage image) {
+ private Buffer wrapImageDataBuffer(final BufferedImage image) {
//
// Note: Grabbing the DataBuffer will defeat Java2D's image
// management mechanism (as of JDK 5/6, at least). This shouldn't
@@ -490,7 +490,7 @@ public class AWTTextureData extends TextureData {
// it could be.
//
- DataBuffer data = image.getRaster().getDataBuffer();
+ final DataBuffer data = image.getRaster().getDataBuffer();
if (data instanceof DataBufferByte) {
return ByteBuffer.wrap(((DataBufferByte) data).getData());
} else if (data instanceof DataBufferDouble) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
index c70f5d0f3..c3b3adc75 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
@@ -59,8 +59,8 @@ public class AWTTextureIO extends TextureIO {
*
* @see #newTextureData(GLProfile, BufferedImage, boolean)
*/
- public static TextureData newTextureData(GLProfile glp, BufferedImage image,
- boolean mipmap) {
+ public static TextureData newTextureData(final GLProfile glp, final BufferedImage image,
+ final boolean mipmap) {
return newTextureDataImpl(glp, image, 0, 0, mipmap);
}
@@ -89,10 +89,10 @@ public class AWTTextureIO extends TextureIO {
* @throws IllegalArgumentException if either internalFormat or
* pixelFormat was 0
*/
- public static TextureData newTextureData(GLProfile glp, BufferedImage image,
- int internalFormat,
- int pixelFormat,
- boolean mipmap) throws IllegalArgumentException {
+ public static TextureData newTextureData(final GLProfile glp, final BufferedImage image,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap) throws IllegalArgumentException {
if ((internalFormat == 0) || (pixelFormat == 0)) {
throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
}
@@ -112,18 +112,18 @@ public class AWTTextureIO extends TextureIO {
* @throws GLException if no OpenGL context is current or if an
* OpenGL error occurred
*/
- public static Texture newTexture(GLProfile glp, BufferedImage image, boolean mipmap) throws GLException {
- TextureData data = newTextureData(glp, image, mipmap);
- Texture texture = newTexture(data);
+ public static Texture newTexture(final GLProfile glp, final BufferedImage image, final boolean mipmap) throws GLException {
+ final TextureData data = newTextureData(glp, image, mipmap);
+ final Texture texture = newTexture(data);
data.flush();
return texture;
}
- private static TextureData newTextureDataImpl(GLProfile glp,
- BufferedImage image,
- int internalFormat,
- int pixelFormat,
- boolean mipmap) {
+ private static TextureData newTextureDataImpl(final GLProfile glp,
+ final BufferedImage image,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap) {
return new AWTTextureData(glp, internalFormat, pixelFormat, mipmap, image);
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
index 7311f20b3..20fc92819 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
@@ -52,6 +52,7 @@ import java.nio.channels.FileChannel;
import javax.media.opengl.GL;
+import com.jogamp.common.nio.Buffers;
import com.jogamp.common.util.IOUtil;
import com.jogamp.opengl.util.GLBuffers;
@@ -67,13 +68,13 @@ public class DDSImage {
that information in another way. */
public static class ImageInfo {
- private ByteBuffer data;
- private int width;
- private int height;
- private boolean isCompressed;
- private int compressionFormat;
+ private final ByteBuffer data;
+ private final int width;
+ private final int height;
+ private final boolean isCompressed;
+ private final int compressionFormat;
- public ImageInfo(ByteBuffer data, int width, int height, boolean compressed, int compressionFormat) {
+ public ImageInfo(final ByteBuffer data, final int width, final int height, final boolean compressed, final int compressionFormat) {
this.data = data; this.width = width; this.height = height;
this.isCompressed = compressed; this.compressionFormat = compressionFormat;
}
@@ -163,7 +164,7 @@ public class DDSImage {
@return DDS image object
@throws java.io.IOException if an I/O exception occurred
*/
- public static DDSImage read(String filename) throws IOException {
+ public static DDSImage read(final String filename) throws IOException {
return read(new File(filename));
}
@@ -174,8 +175,8 @@ public class DDSImage {
@return DDS image object
@throws java.io.IOException if an I/O exception occurred
*/
- public static DDSImage read(File file) throws IOException {
- DDSImage image = new DDSImage();
+ public static DDSImage read(final File file) throws IOException {
+ final DDSImage image = new DDSImage();
image.readFromFile(file);
return image;
}
@@ -187,8 +188,8 @@ public class DDSImage {
@return DDS image object
@throws java.io.IOException if an I/O exception occurred
*/
- public static DDSImage read(ByteBuffer buf) throws IOException {
- DDSImage image = new DDSImage();
+ public static DDSImage read(final ByteBuffer buf) throws IOException {
+ final DDSImage image = new DDSImage();
image.readFromBuffer(buf);
return image;
}
@@ -207,7 +208,7 @@ public class DDSImage {
fis = null;
}
buf = null;
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
}
@@ -228,11 +229,11 @@ public class DDSImage {
* specified arguments
* @return DDS image object
*/
- public static DDSImage createFromData(int d3dFormat,
- int width,
- int height,
- ByteBuffer[] mipmapData) throws IllegalArgumentException {
- DDSImage image = new DDSImage();
+ public static DDSImage createFromData(final int d3dFormat,
+ final int width,
+ final int height,
+ final ByteBuffer[] mipmapData) throws IllegalArgumentException {
+ final DDSImage image = new DDSImage();
image.initFromData(d3dFormat, width, height, mipmapData);
return image;
}
@@ -256,7 +257,7 @@ public class DDSImage {
in.mark(4);
int magic = 0;
for (int i = 0; i < 4; i++) {
- int tmp = in.read();
+ final int tmp = in.read();
if (tmp < 0) {
in.reset();
return false;
@@ -272,7 +273,7 @@ public class DDSImage {
* @param filename File name to write to
* @throws java.io.IOException if an I/O exception occurred
*/
- public void write(String filename) throws IOException {
+ public void write(final String filename) throws IOException {
write(new File(filename));
}
@@ -281,12 +282,12 @@ public class DDSImage {
* @param file File object to write to
* @throws java.io.IOException if an I/O exception occurred
*/
- public void write(File file) throws IOException {
- FileOutputStream stream = IOUtil.getFileOutputStream(file, true);
- FileChannel chan = stream.getChannel();
+ public void write(final File file) throws IOException {
+ final FileOutputStream stream = IOUtil.getFileOutputStream(file, true);
+ final FileChannel chan = stream.getChannel();
// Create ByteBuffer for header in case the start of our
// ByteBuffer isn't actually memory-mapped
- ByteBuffer hdr = ByteBuffer.allocate(Header.writtenSize());
+ final ByteBuffer hdr = ByteBuffer.allocate(Header.writtenSize());
hdr.order(ByteOrder.LITTLE_ENDIAN);
header.write(hdr);
hdr.rewind();
@@ -302,12 +303,12 @@ public class DDSImage {
* @param flag DDSD_* flags set to test
* @return true if flag present or false otherwise
*/
- public boolean isSurfaceDescFlagSet(int flag) {
+ public boolean isSurfaceDescFlagSet(final int flag) {
return ((header.flags & flag) != 0);
}
/** Test for presence/absence of pixel format flags (DDPF_*) */
- public boolean isPixelFormatFlagSet(int flag) {
+ public boolean isPixelFormatFlagSet(final int flag) {
return ((header.pfFlags & flag) != 0);
}
@@ -357,7 +358,7 @@ public class DDSImage {
* @param side Side to test
* @return true if side present or false otherwise
*/
- public boolean isCubemapSidePresent(int side) {
+ public boolean isCubemapSidePresent(final int side) {
return isCubemap() && (header.ddsCaps2 & side) != 0;
}
@@ -402,7 +403,7 @@ public class DDSImage {
* @param map Mipmap index
* @return Image object
*/
- public ImageInfo getMipMap(int map) {
+ public ImageInfo getMipMap(final int map) {
return getMipMap( 0, map );
}
@@ -412,7 +413,7 @@ public class DDSImage {
* @param map Mipmap index
* @return Image object
*/
- public ImageInfo getMipMap(int side, int map) {
+ public ImageInfo getMipMap(final int side, final int map) {
if (!isCubemap() && (side != 0)) {
throw new RuntimeException( "Illegal side for 2D texture: " + side );
}
@@ -434,7 +435,7 @@ public class DDSImage {
}
buf.limit(seek + mipMapSizeInBytes(map));
buf.position(seek);
- ByteBuffer next = buf.slice();
+ final ByteBuffer next = buf.slice();
buf.position(0);
buf.limit(buf.capacity());
return new ImageInfo(next, mipMapWidth(map), mipMapHeight(map), isCompressed(), getCompressionFormat());
@@ -454,12 +455,12 @@ public class DDSImage {
* @param side Cubemap side or 0 for 2D texture
* @return Mipmap image objects set
*/
- public ImageInfo[] getAllMipMaps( int side ) {
+ public ImageInfo[] getAllMipMaps( final int side ) {
int numLevels = getNumMipMaps();
if (numLevels == 0) {
numLevels = 1;
}
- ImageInfo[] result = new ImageInfo[numLevels];
+ final ImageInfo[] result = new ImageInfo[numLevels];
for (int i = 0; i < numLevels; i++) {
result[i] = getMipMap(side, i);
}
@@ -472,9 +473,9 @@ public class DDSImage {
@return String format code
*/
public static String getCompressionFormatName(int compressionFormat) {
- StringBuilder buf = new StringBuilder();
+ final StringBuilder buf = new StringBuilder();
for (int i = 0; i < 4; i++) {
- char c = (char) (compressionFormat & 0xFF);
+ final char c = (char) (compressionFormat & 0xFF);
buf.append(c);
compressionFormat = compressionFormat >> 8;
}
@@ -491,9 +492,9 @@ public class DDSImage {
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, or
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT.
*/
- public static ByteBuffer allocateBlankBuffer(int width,
- int height,
- int openGLInternalFormat) {
+ public static ByteBuffer allocateBlankBuffer(final int width,
+ final int height,
+ final int openGLInternalFormat) {
int size = width * height;
switch (openGLInternalFormat) {
case GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
@@ -511,15 +512,15 @@ public class DDSImage {
}
if (size == 0)
size = 1;
- return GLBuffers.newDirectByteBuffer(size);
+ return Buffers.newDirectByteBuffer(size);
}
public void debugPrint() {
- PrintStream tty = System.err;
+ final PrintStream tty = System.err;
tty.println("Compressed texture: " + isCompressed());
if (isCompressed()) {
- int fmt = getCompressionFormat();
- String name = getCompressionFormatName(fmt);
+ final int fmt = getCompressionFormat();
+ final String name = getCompressionFormatName(fmt);
tty.println("Compression format: 0x" + Integer.toHexString(fmt) + " (" + name + ")");
}
tty.println("Width: " + header.width + " Height: " + header.height);
@@ -567,7 +568,7 @@ public class DDSImage {
tty.println("Raw pixel format flags: 0x" + Integer.toHexString(header.pfFlags));
tty.println("Depth: " + getDepth());
tty.println("Number of mip maps: " + getNumMipMaps());
- int fmt = getPixelFormat();
+ final int fmt = getPixelFormat();
tty.print("Pixel format: ");
switch (fmt) {
case D3DFMT_R8G8B8: tty.println("D3DFMT_R8G8B8"); break;
@@ -629,8 +630,8 @@ public class DDSImage {
int ddsCapsReserved2;
int textureStage; // stage in multitexture cascade
- void read(ByteBuffer buf) throws IOException {
- int magic = buf.getInt();
+ void read(final ByteBuffer buf) throws IOException {
+ final int magic = buf.getInt();
if (magic != MAGIC) {
throw new IOException("Incorrect magic number 0x" +
Integer.toHexString(magic) +
@@ -671,7 +672,7 @@ public class DDSImage {
}
// buf must be in little-endian byte order
- void write(ByteBuffer buf) {
+ void write(final ByteBuffer buf) {
buf.putInt(MAGIC);
buf.putInt(size);
buf.putInt(flags);
@@ -722,15 +723,15 @@ public class DDSImage {
private DDSImage() {
}
- private void readFromFile(File file) throws IOException {
+ private void readFromFile(final File file) throws IOException {
fis = new FileInputStream(file);
chan = fis.getChannel();
- ByteBuffer buf = chan.map(FileChannel.MapMode.READ_ONLY,
+ final ByteBuffer buf = chan.map(FileChannel.MapMode.READ_ONLY,
0, (int) file.length());
readFromBuffer(buf);
}
- private void readFromBuffer(ByteBuffer buf) throws IOException {
+ private void readFromBuffer(final ByteBuffer buf) throws IOException {
this.buf = buf;
buf.order(ByteOrder.LITTLE_ENDIAN);
header = new Header();
@@ -738,10 +739,10 @@ public class DDSImage {
fixupHeader();
}
- private void initFromData(int d3dFormat,
- int width,
- int height,
- ByteBuffer[] mipmapData) throws IllegalArgumentException {
+ private void initFromData(final int d3dFormat,
+ final int width,
+ final int height,
+ final ByteBuffer[] mipmapData) throws IllegalArgumentException {
// Check size of mipmap data compared against format, width and
// height
int topmostMipmapSize = width * height;
@@ -784,7 +785,7 @@ public class DDSImage {
// OK, create one large ByteBuffer to hold all of the mipmap data
totalSize += Header.writtenSize();
- ByteBuffer buf = ByteBuffer.allocate(totalSize);
+ final ByteBuffer buf = ByteBuffer.allocate(totalSize);
buf.position(Header.writtenSize());
for (int i = 0; i < mipmapData.length; i++) {
buf.put(mipmapData[i]);
@@ -845,10 +846,10 @@ public class DDSImage {
}
}
- private static int computeCompressedBlockSize(int width,
- int height,
- int depth,
- int compressionFormat) {
+ private static int computeCompressedBlockSize(final int width,
+ final int height,
+ final int depth,
+ final int compressionFormat) {
int blockSize = ((width + 3)/4) * ((height + 3)/4) * ((depth + 3)/4);
switch (compressionFormat) {
case D3DFMT_DXT1: blockSize *= 8; break;
@@ -857,10 +858,10 @@ public class DDSImage {
return blockSize;
}
- private static int computeBlockSize(int width,
- int height,
- int depth,
- int pixelFormat) {
+ private static int computeBlockSize(final int width,
+ final int height,
+ final int depth,
+ final int pixelFormat) {
int blocksize;
switch (pixelFormat) {
case D3DFMT_R8G8B8:
@@ -883,7 +884,7 @@ public class DDSImage {
return blocksize;
}
- private int mipMapWidth(int map) {
+ private int mipMapWidth(final int map) {
int width = getWidth();
for (int i = 0; i < map; i++) {
width >>= 1;
@@ -891,7 +892,7 @@ public class DDSImage {
return Math.max(width, 1);
}
- private int mipMapHeight(int map) {
+ private int mipMapHeight(final int map) {
int height = getHeight();
for (int i = 0; i < map; i++) {
height >>= 1;
@@ -899,11 +900,11 @@ public class DDSImage {
return Math.max(height, 1);
}
- private int mipMapSizeInBytes(int map) {
- int width = mipMapWidth(map);
- int height = mipMapHeight(map);
+ private int mipMapSizeInBytes(final int map) {
+ final int width = mipMapWidth(map);
+ final int height = mipMapHeight(map);
if (isCompressed()) {
- int blockSize = (getCompressionFormat() == D3DFMT_DXT1 ? 8 : 16);
+ final int blockSize = (getCompressionFormat() == D3DFMT_DXT1 ? 8 : 16);
return ((width+3)/4)*((height+3)/4)*blockSize;
} else {
return width * height * (getDepth() / 8);
@@ -924,8 +925,8 @@ public class DDSImage {
return size;
}
- private int sideShiftInBytes(int side) {
- int[] sides = {
+ private int sideShiftInBytes(final int side) {
+ final int[] sides = {
DDSCAPS2_CUBEMAP_POSITIVEX,
DDSCAPS2_CUBEMAP_NEGATIVEX,
DDSCAPS2_CUBEMAP_POSITIVEY,
@@ -935,9 +936,9 @@ public class DDSImage {
};
int shift = 0;
- int sideSize = sideSizeInBytes();
+ final int sideSize = sideSizeInBytes();
for (int i = 0; i < sides.length; i++) {
- int temp = sides[i];
+ final int temp = sides[i];
if ((temp & side) != 0) {
return shift;
}
@@ -948,7 +949,7 @@ public class DDSImage {
throw new RuntimeException("Illegal side: " + side);
}
- private boolean printIfRecognized(PrintStream tty, int flags, int flag, String what) {
+ private boolean printIfRecognized(final PrintStream tty, final int flags, final int flag, final String what) {
if ((flags & flag) != 0) {
tty.println(what);
return true;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
index 2081788ba..66a486f9b 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
@@ -51,12 +51,12 @@ public class JPEGImage {
* @return
* @throws IOException
*/
- public static JPEGImage read(InputStream in, ColorSpace cs) throws IOException {
+ public static JPEGImage read(final InputStream in, final ColorSpace cs) throws IOException {
return new JPEGImage(in, cs);
}
/** Reads a JPEG image from the specified InputStream, using the {@link ColorSpace#RGB}. */
- public static JPEGImage read(InputStream in) throws IOException {
+ public static JPEGImage read(final InputStream in) throws IOException {
return new JPEGImage(in, ColorSpace.RGB);
}
@@ -68,7 +68,7 @@ public class JPEGImage {
final ColorSpace storageCS;
ByteBuffer data = null;
- JPEGColorSink(ColorSpace storageCM) {
+ JPEGColorSink(final ColorSpace storageCM) {
this.storageCS = storageCM;
switch(storageCS) {
case RGB:
@@ -81,7 +81,7 @@ public class JPEGImage {
}
@Override
- public final ColorSpace allocate(int width, int height, ColorSpace sourceCM, int sourceComponents) throws RuntimeException {
+ public final ColorSpace allocate(final int width, final int height, final ColorSpace sourceCM, final int sourceComponents) throws RuntimeException {
this.width = width;
this.height = height;
this.sourceComponents = sourceComponents;
@@ -91,7 +91,7 @@ public class JPEGImage {
}
@Override
- public final void storeRGB(int x, int y, byte r, byte g, byte b) {
+ public final void storeRGB(final int x, final int y, final byte r, final byte g, final byte b) {
int i = ( ( height - y - 1 ) * width + x ) * storageComponents;
data.put(i++, r);
data.put(i++, g);
@@ -100,12 +100,12 @@ public class JPEGImage {
}
@Override
- public final void store2(int x, int y, byte c1, byte c2) {
+ public final void store2(final int x, final int y, final byte c1, final byte c2) {
throw new RuntimeException("not supported yet");
}
@Override
- public final void storeYCbCr(int x, int y, byte Y, byte Cb, byte Cr) {
+ public final void storeYCbCr(final int x, final int y, final byte Y, final byte Cb, final byte Cr) {
int i = ( ( height - y - 1 ) * width + x ) * storageComponents;
data.put(i++, Y);
data.put(i++, Cb);
@@ -118,7 +118,7 @@ public class JPEGImage {
}
};
- private JPEGImage(InputStream in, ColorSpace cs) throws IOException {
+ private JPEGImage(final InputStream in, final ColorSpace cs) throws IOException {
pixelStorage = new JPEGColorSink(cs);
final JPEGDecoder decoder = new JPEGDecoder();
decoder.parse(in);
@@ -139,9 +139,9 @@ public class JPEGImage {
}
decoder.clear(null);
}
- private JPEGColorSink pixelStorage;
+ private final JPEGColorSink pixelStorage;
private final int pixelWidth, pixelHeight, glFormat, bytesPerPixel;
- private boolean reversedChannels;
+ private final boolean reversedChannels;
private final ByteBuffer data;
/** Returns the color space of the pixel data */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
index 3c90d96e4..f121478e7 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
@@ -76,7 +76,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
*/
DataInputStream dataIn;
- public LEDataInputStream(InputStream in)
+ public LEDataInputStream(final InputStream in)
{
super(in);
dataIn = new DataInputStream(in);
@@ -90,32 +90,32 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
}
@Override
- public synchronized final int read(byte b[]) throws IOException
+ public synchronized final int read(final byte b[]) throws IOException
{
return dataIn.read(b, 0, b.length);
}
@Override
- public synchronized final int read(byte b[], int off, int len) throws IOException
+ public synchronized final int read(final byte b[], final int off, final int len) throws IOException
{
- int rl = dataIn.read(b, off, len);
+ final int rl = dataIn.read(b, off, len);
return rl;
}
@Override
- public final void readFully(byte b[]) throws IOException
+ public final void readFully(final byte b[]) throws IOException
{
dataIn.readFully(b, 0, b.length);
}
@Override
- public final void readFully(byte b[], int off, int len) throws IOException
+ public final void readFully(final byte b[], final int off, final int len) throws IOException
{
dataIn.readFully(b, off, len);
}
@Override
- public final int skipBytes(int n) throws IOException
+ public final int skipBytes(final int n) throws IOException
{
return dataIn.skipBytes(n);
}
@@ -123,7 +123,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
@Override
public final boolean readBoolean() throws IOException
{
- int ch = dataIn.read();
+ final int ch = dataIn.read();
if (ch < 0)
throw new EOFException();
return (ch != 0);
@@ -132,7 +132,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
@Override
public final byte readByte() throws IOException
{
- int ch = dataIn.read();
+ final int ch = dataIn.read();
if (ch < 0)
throw new EOFException();
return (byte)(ch);
@@ -141,7 +141,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
@Override
public final int readUnsignedByte() throws IOException
{
- int ch = dataIn.read();
+ final int ch = dataIn.read();
if (ch < 0)
throw new EOFException();
return ch;
@@ -150,8 +150,8 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
@Override
public final short readShort() throws IOException
{
- int ch1 = dataIn.read();
- int ch2 = dataIn.read();
+ final int ch1 = dataIn.read();
+ final int ch2 = dataIn.read();
if ((ch1 | ch2) < 0)
throw new EOFException();
return (short)((ch1 << 0) + (ch2 << 8));
@@ -160,8 +160,8 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
@Override
public final int readUnsignedShort() throws IOException
{
- int ch1 = dataIn.read();
- int ch2 = dataIn.read();
+ final int ch1 = dataIn.read();
+ final int ch2 = dataIn.read();
if ((ch1 | ch2) < 0)
throw new EOFException();
return (ch1 << 0) + (ch2 << 8);
@@ -170,8 +170,8 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
@Override
public final char readChar() throws IOException
{
- int ch1 = dataIn.read();
- int ch2 = dataIn.read();
+ final int ch1 = dataIn.read();
+ final int ch2 = dataIn.read();
if ((ch1 | ch2) < 0)
throw new EOFException();
return (char)((ch1 << 0) + (ch2 << 8));
@@ -180,10 +180,10 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
@Override
public final int readInt() throws IOException
{
- int ch1 = dataIn.read();
- int ch2 = dataIn.read();
- int ch3 = dataIn.read();
- int ch4 = dataIn.read();
+ final int ch1 = dataIn.read();
+ final int ch2 = dataIn.read();
+ final int ch3 = dataIn.read();
+ final int ch4 = dataIn.read();
if ((ch1 | ch2 | ch3 | ch4) < 0)
throw new EOFException();
return ((ch1 << 0) + (ch2 << 8) + (ch3 << 16) + (ch4 << 24));
@@ -192,9 +192,9 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
@Override
public final long readLong() throws IOException
{
- int i1 = readInt();
- int i2 = readInt();
- return ((long)i1 & 0xFFFFFFFFL) + ((long)i2 << 32);
+ final int i1 = readInt();
+ final int i2 = readInt();
+ return (i1 & 0xFFFFFFFFL) + ((long)i2 << 32);
}
@Override
@@ -233,7 +233,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
* dont call this it is not implemented
* @return empty new string
**/
- public final static String readUTF(DataInput in) throws IOException
+ public final static String readUTF(final DataInput in) throws IOException
{
return new String();
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
index 93b097500..add177546 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
@@ -72,7 +72,7 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
*/
DataOutputStream dataOut;
- public LEDataOutputStream(OutputStream out)
+ public LEDataOutputStream(final OutputStream out)
{
super(out);
dataOut = new DataOutputStream(out);
@@ -86,44 +86,44 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
}
@Override
- public synchronized final void write(byte b[]) throws IOException
+ public synchronized final void write(final byte b[]) throws IOException
{
dataOut.write(b, 0, b.length);
}
@Override
- public synchronized final void write(byte b[], int off, int len) throws IOException
+ public synchronized final void write(final byte b[], final int off, final int len) throws IOException
{
dataOut.write(b, off, len);
}
@Override
- public final void write(int b) throws IOException
+ public final void write(final int b) throws IOException
{
dataOut.write(b);
}
@Override
- public final void writeBoolean(boolean v) throws IOException
+ public final void writeBoolean(final boolean v) throws IOException
{
dataOut.writeBoolean(v);
}
@Override
- public final void writeByte(int v) throws IOException
+ public final void writeByte(final int v) throws IOException
{
dataOut.writeByte(v);
}
/** Don't call this -- not implemented */
@Override
- public final void writeBytes(String s) throws IOException
+ public final void writeBytes(final String s) throws IOException
{
throw new UnsupportedOperationException();
}
@Override
- public final void writeChar(int v) throws IOException
+ public final void writeChar(final int v) throws IOException
{
dataOut.writeChar(((v >> 8) & 0xff) |
((v & 0xff) << 8));
@@ -131,25 +131,25 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
/** Don't call this -- not implemented */
@Override
- public final void writeChars(String s) throws IOException
+ public final void writeChars(final String s) throws IOException
{
throw new UnsupportedOperationException();
}
@Override
- public final void writeDouble(double v) throws IOException
+ public final void writeDouble(final double v) throws IOException
{
writeLong(Double.doubleToRawLongBits(v));
}
@Override
- public final void writeFloat(float v) throws IOException
+ public final void writeFloat(final float v) throws IOException
{
writeInt(Float.floatToRawIntBits(v));
}
@Override
- public final void writeInt(int v) throws IOException
+ public final void writeInt(final int v) throws IOException
{
dataOut.writeInt((v >>> 24) |
((v >>> 8) & 0xff00) |
@@ -158,14 +158,14 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
}
@Override
- public final void writeLong(long v) throws IOException
+ public final void writeLong(final long v) throws IOException
{
writeInt((int) v);
writeInt((int) (v >>> 32));
}
@Override
- public final void writeShort(int v) throws IOException
+ public final void writeShort(final int v) throws IOException
{
dataOut.writeShort(((v >> 8) & 0xff) |
((v & 0xff) << 8));
@@ -173,7 +173,7 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
/** Don't call this -- not implemented */
@Override
- public final void writeUTF(String s) throws IOException
+ public final void writeUTF(final String s) throws IOException
{
throw new UnsupportedOperationException();
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
index cabf4ebc5..461ddceb8 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
@@ -63,7 +63,7 @@ public class NetPbmTextureWriter implements TextureWriter {
* magic 7 - PAM binary RGB or RGBA
* </pre>
*/
- public NetPbmTextureWriter(int magic) {
+ public NetPbmTextureWriter(final int magic) {
switch(magic) {
case 0:
case 6:
@@ -85,7 +85,7 @@ public class NetPbmTextureWriter implements TextureWriter {
public String getSuffix() { return (magic==6)?PPM:PAM; }
@Override
- public boolean write(File file, TextureData data) throws IOException {
+ public boolean write(final File file, final TextureData data) throws IOException {
boolean res;
final int magic_old = magic;
@@ -107,12 +107,12 @@ public class NetPbmTextureWriter implements TextureWriter {
return res;
}
- private boolean writeImpl(File file, TextureData data) throws IOException {
+ private boolean writeImpl(final File file, final TextureData data) throws IOException {
int pixelFormat = data.getPixelFormat();
final int pixelType = data.getPixelType();
if ((pixelFormat == GL.GL_RGB ||
pixelFormat == GL.GL_RGBA ||
- pixelFormat == GL2.GL_BGR ||
+ pixelFormat == GL2GL3.GL_BGR ||
pixelFormat == GL.GL_BGRA ) &&
(pixelType == GL.GL_BYTE ||
pixelType == GL.GL_UNSIGNED_BYTE)) {
@@ -123,13 +123,13 @@ public class NetPbmTextureWriter implements TextureWriter {
}
buf.rewind();
- int comps = ( pixelFormat == GL.GL_RGBA || pixelFormat == GL.GL_BGRA ) ? 4 : 3 ;
+ final int comps = ( pixelFormat == GL.GL_RGBA || pixelFormat == GL.GL_BGRA ) ? 4 : 3 ;
- if( pixelFormat == GL2.GL_BGR || pixelFormat == GL.GL_BGRA ) {
+ if( pixelFormat == GL2GL3.GL_BGR || pixelFormat == GL.GL_BGRA ) {
// Must reverse order of red and blue channels to get correct results
for (int i = 0; i < buf.remaining(); i += comps) {
- byte red = buf.get(i + 0);
- byte blue = buf.get(i + 2);
+ final byte red = buf.get(i + 0);
+ final byte blue = buf.get(i + 2);
buf.put(i + 0, blue);
buf.put(i + 2, red);
}
@@ -141,9 +141,9 @@ public class NetPbmTextureWriter implements TextureWriter {
throw new IOException("NetPbmTextureWriter magic 6 (PPM) doesn't RGBA pixel format, use magic 7 (PAM)");
}
- FileOutputStream fos = IOUtil.getFileOutputStream(file, true);
+ final FileOutputStream fos = IOUtil.getFileOutputStream(file, true);
- StringBuilder header = new StringBuilder();
+ final StringBuilder header = new StringBuilder();
header.append("P");
header.append(magic);
header.append("\n");
@@ -173,7 +173,7 @@ public class NetPbmTextureWriter implements TextureWriter {
fos.write(header.toString().getBytes());
- FileChannel fosc = fos.getChannel();
+ final FileChannel fosc = fos.getChannel();
fosc.write(buf);
fosc.force(true);
fosc.close();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
index cbc8e652f..27549dfe3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
@@ -54,7 +54,7 @@ import com.jogamp.common.util.IOUtil;
*/
public class SGIImage {
- private Header header;
+ private final Header header;
private int format;
private byte[] data;
// Used for decoding RLE-compressed images
@@ -105,7 +105,7 @@ public class SGIImage {
magic = MAGIC;
}
- Header(DataInputStream in) throws IOException {
+ Header(final DataInputStream in) throws IOException {
magic = in.readShort();
storage = in.readByte();
bpc = in.readByte();
@@ -116,13 +116,13 @@ public class SGIImage {
pixmin = in.readInt();
pixmax = in.readInt();
dummy = in.readInt();
- byte[] tmpname = new byte[80];
+ final byte[] tmpname = new byte[80];
in.read(tmpname);
int numChars = 0;
while (tmpname[numChars++] != 0);
imagename = new String(tmpname, 0, numChars);
colormap = in.readInt();
- byte[] tmp = new byte[404];
+ final byte[] tmp = new byte[404];
in.read(tmp);
}
@@ -142,21 +142,21 @@ public class SGIImage {
}
}
- private SGIImage(Header header) {
+ private SGIImage(final Header header) {
this.header = header;
}
/** Reads an SGI image from the specified file. */
- public static SGIImage read(String filename) throws IOException {
+ public static SGIImage read(final String filename) throws IOException {
return read(new FileInputStream(filename));
}
/** Reads an SGI image from the specified InputStream. */
- public static SGIImage read(InputStream in) throws IOException {
- DataInputStream dIn = new DataInputStream(new BufferedInputStream(in));
+ public static SGIImage read(final InputStream in) throws IOException {
+ final DataInputStream dIn = new DataInputStream(new BufferedInputStream(in));
- Header header = new Header(dIn);
- SGIImage res = new SGIImage(header);
+ final Header header = new Header(dIn);
+ final SGIImage res = new SGIImage(header);
res.decodeImage(dIn);
return res;
}
@@ -164,28 +164,28 @@ public class SGIImage {
/** Writes this SGIImage to the specified file name. If
flipVertically is set, outputs the scanlines from top to bottom
rather than the default bottom to top order. */
- public void write(String filename, boolean flipVertically) throws IOException {
+ public void write(final String filename, final boolean flipVertically) throws IOException {
write(new File(filename), flipVertically);
}
/** Writes this SGIImage to the specified file. If flipVertically is
set, outputs the scanlines from top to bottom rather than the
default bottom to top order. */
- public void write(File file, boolean flipVertically) throws IOException {
+ public void write(final File file, final boolean flipVertically) throws IOException {
writeImage(file, data, header.xsize, header.ysize, header.zsize, flipVertically);
}
/** Creates an SGIImage from the specified data in either RGB or
RGBA format. */
- public static SGIImage createFromData(int width,
- int height,
- boolean hasAlpha,
- byte[] data) {
- Header header = new Header();
+ public static SGIImage createFromData(final int width,
+ final int height,
+ final boolean hasAlpha,
+ final byte[] data) {
+ final Header header = new Header();
header.xsize = (short) width;
header.ysize = (short) height;
header.zsize = (short) (hasAlpha ? 4 : 3);
- SGIImage image = new SGIImage(header);
+ final SGIImage image = new SGIImage(header);
image.data = data;
return image;
}
@@ -201,9 +201,9 @@ public class SGIImage {
if (!in.markSupported()) {
throw new IOException("Can not test non-destructively whether given InputStream is an SGI RGB image");
}
- DataInputStream dIn = new DataInputStream(in);
+ final DataInputStream dIn = new DataInputStream(in);
dIn.mark(4);
- short magic = dIn.readShort();
+ final short magic = dIn.readShort();
dIn.reset();
return (magic == MAGIC);
}
@@ -236,10 +236,10 @@ public class SGIImage {
// Internals only below this point
//
- private void decodeImage(DataInputStream in) throws IOException {
+ private void decodeImage(final DataInputStream in) throws IOException {
if (header.storage == 1) {
// Read RLE compression data; row starts and sizes
- int x = header.ysize * header.zsize;
+ final int x = header.ysize * header.zsize;
rowStart = new int[x];
rowSize = new int[x];
rleEnd = 4 * 2 * x + 512;
@@ -253,16 +253,16 @@ public class SGIImage {
}
tmpData = readAll(in);
- int xsize = header.xsize;
- int ysize = header.ysize;
- int zsize = header.zsize;
+ final int xsize = header.xsize;
+ final int ysize = header.ysize;
+ final int zsize = header.zsize;
int lptr = 0;
data = new byte[xsize * ysize * 4];
- byte[] rbuf = new byte[xsize];
- byte[] gbuf = new byte[xsize];
- byte[] bbuf = new byte[xsize];
- byte[] abuf = new byte[xsize];
+ final byte[] rbuf = new byte[xsize];
+ final byte[] gbuf = new byte[xsize];
+ final byte[] bbuf = new byte[xsize];
+ final byte[] abuf = new byte[xsize];
for (int y = 0; y < ysize; y++) {
if (zsize >= 4) {
getRow(rbuf, y, 0);
@@ -293,15 +293,15 @@ public class SGIImage {
header.zsize = 4;
}
- private void getRow(byte[] buf, int y, int z) {
+ private void getRow(final byte[] buf, final int y, final int z) {
if (header.storage == 1) {
- int offs = rowStart[y + z * header.ysize] - rleEnd;
+ final int offs = rowStart[y + z * header.ysize] - rleEnd;
System.arraycopy(tmpData, offs, tmpRead, 0, rowSize[y + z * header.ysize]);
int iPtr = 0;
int oPtr = 0;
for (;;) {
byte pixel = tmpRead[iPtr++];
- int count = (int) (pixel & 0x7F);
+ int count = pixel & 0x7F;
if (count == 0) {
return;
}
@@ -317,12 +317,12 @@ public class SGIImage {
}
}
} else {
- int offs = (y * header.xsize) + (z * header.xsize * header.ysize);
+ final int offs = (y * header.xsize) + (z * header.xsize * header.ysize);
System.arraycopy(tmpData, offs, buf, 0, header.xsize);
}
}
- private void bwtorgba(byte[] b, byte[] dest, int lptr) {
+ private void bwtorgba(final byte[] b, final byte[] dest, final int lptr) {
for (int i = 0; i < b.length; i++) {
dest[4 * i + lptr + 0] = b[i];
dest[4 * i + lptr + 1] = b[i];
@@ -331,7 +331,7 @@ public class SGIImage {
}
}
- private void latorgba(byte[] b, byte[] a, byte[] dest, int lptr) {
+ private void latorgba(final byte[] b, final byte[] a, final byte[] dest, final int lptr) {
for (int i = 0; i < b.length; i++) {
dest[4 * i + lptr + 0] = b[i];
dest[4 * i + lptr + 1] = b[i];
@@ -340,7 +340,7 @@ public class SGIImage {
}
}
- private void rgbtorgba(byte[] r, byte[] g, byte[] b, byte[] dest, int lptr) {
+ private void rgbtorgba(final byte[] r, final byte[] g, final byte[] b, final byte[] dest, final int lptr) {
for (int i = 0; i < b.length; i++) {
dest[4 * i + lptr + 0] = r[i];
dest[4 * i + lptr + 1] = g[i];
@@ -349,7 +349,7 @@ public class SGIImage {
}
}
- private void rgbatorgba(byte[] r, byte[] g, byte[] b, byte[] a, byte[] dest, int lptr) {
+ private void rgbatorgba(final byte[] r, final byte[] g, final byte[] b, final byte[] a, final byte[] dest, final int lptr) {
for (int i = 0; i < b.length; i++) {
dest[4 * i + lptr + 0] = r[i];
dest[4 * i + lptr + 1] = g[i];
@@ -358,19 +358,19 @@ public class SGIImage {
}
}
- private static byte imgref(byte[] i,
- int x,
- int y,
- int z,
- int xs,
- int ys,
- int zs) {
+ private static byte imgref(final byte[] i,
+ final int x,
+ final int y,
+ final int z,
+ final int xs,
+ final int ys,
+ final int zs) {
return i[(xs*ys*z)+(xs*y)+x];
}
- private void writeHeader(DataOutputStream stream,
- int xsize, int ysize, int zsize, boolean rle) throws IOException {
+ private void writeHeader(final DataOutputStream stream,
+ final int xsize, final int ysize, final int zsize, final boolean rle) throws IOException {
// effects: outputs the 512-byte IRIS RGB header to STREAM, using xsize,
// ysize, and depth as the dimensions of the image. NOTE that
// the following defaults are used:
@@ -415,14 +415,14 @@ public class SGIImage {
stream.write(0);
}
- private void writeImage(File file,
+ private void writeImage(final File file,
byte[] data,
- int xsize,
- int ysize,
- int zsize,
- boolean yflip) throws IOException {
+ final int xsize,
+ final int ysize,
+ final int zsize,
+ final boolean yflip) throws IOException {
// Input data is in RGBRGBRGB or RGBARGBARGBA format; first unswizzle it
- byte[] tmpData = new byte[xsize * ysize * zsize];
+ final byte[] tmpData = new byte[xsize * ysize * zsize];
int dest = 0;
for (int i = 0; i < zsize; i++) {
for (int j = i; j < (xsize * ysize * zsize); j += zsize) {
@@ -447,8 +447,8 @@ public class SGIImage {
// x axis).
// Build the offset tables
- int[] starttab = new int[ysize * zsize];
- int[] lengthtab = new int[ysize * zsize];
+ final int[] starttab = new int[ysize * zsize];
+ final int[] lengthtab = new int[ysize * zsize];
// Temporary buffer for holding RLE data.
// Note that this makes the assumption that RLE-compressed data will
@@ -459,8 +459,8 @@ public class SGIImage {
// empirical evidence here; the break-even point seems to be a look-
// ahead of 3. (That is, if the three values following this one are all
// the same as the current value, switch to repeat mode.)
- int lookahead = 3;
- byte[] rlebuf = new byte[2 * xsize * ysize * zsize];
+ final int lookahead = 3;
+ final byte[] rlebuf = new byte[2 * xsize * ysize * zsize];
int cur_loc = 0; // current offset location.
int ptr = 0;
@@ -475,7 +475,7 @@ public class SGIImage {
yincr = -1;
}
- boolean DEBUG = false;
+ final boolean DEBUG = false;
for (int z = 0; z < zsize; z++) {
for (int y = ystart; y != yend; y += yincr) {
@@ -485,7 +485,7 @@ public class SGIImage {
byte count = 0;
boolean repeat_mode = false;
boolean should_switch = false;
- int start_ptr = ptr;
+ final int start_ptr = ptr;
int num_ptr = ptr++;
byte repeat_val = 0;
@@ -566,7 +566,7 @@ public class SGIImage {
x++;
}
// output this row's length into the length table
- int rowlen = ptr - start_ptr;
+ final int rowlen = ptr - start_ptr;
if (yflip)
lengthtab[ysize*z+(ysize-y-1)] = rowlen;
else
@@ -587,11 +587,11 @@ public class SGIImage {
if (DEBUG)
System.err.println("total_size was " + total_size);
- DataOutputStream stream = new DataOutputStream(new BufferedOutputStream(IOUtil.getFileOutputStream(file, true)));
+ final DataOutputStream stream = new DataOutputStream(new BufferedOutputStream(IOUtil.getFileOutputStream(file, true)));
writeHeader(stream, xsize, ysize, zsize, true);
- int SIZEOF_INT = 4;
+ final int SIZEOF_INT = 4;
for (int i = 0; i < (ysize * zsize); i++)
stream.writeInt(starttab[i] + 512 + (2 * ysize * zsize * SIZEOF_INT));
for (int i = 0; i < (ysize * zsize); i++)
@@ -602,7 +602,7 @@ public class SGIImage {
stream.close();
}
- private byte[] readAll(DataInputStream in) throws IOException {
+ private byte[] readAll(final DataInputStream in) throws IOException {
byte[] dest = new byte[16384];
int pos = 0;
int numRead = 0;
@@ -613,7 +613,7 @@ public class SGIImage {
numRead = in.read(dest, pos, dest.length - pos);
if (pos == dest.length) {
// Resize destination buffer
- byte[] newDest = new byte[2 * dest.length];
+ final byte[] newDest = new byte[2 * dest.length];
System.arraycopy(dest, 0, newDest, 0, pos);
dest = newDest;
}
@@ -626,7 +626,7 @@ public class SGIImage {
// Trim destination buffer
if (pos != dest.length) {
- byte[] finalDest = new byte[pos];
+ final byte[] finalDest = new byte[pos];
System.arraycopy(dest, 0, finalDest, 0, pos);
dest = finalDest;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
index 15cd63eb3..28823abb3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
@@ -71,12 +71,12 @@ import com.jogamp.common.util.IOUtil;
*/
public class TGAImage {
- private Header header;
+ private final Header header;
private int format;
private int bpp;
private ByteBuffer data;
- private TGAImage(Header header) {
+ private TGAImage(final Header header) {
this.header = header;
}
@@ -114,7 +114,7 @@ public class TGAImage {
public final static int I_FOURWAY = 2;
/** Type of this TGA file format */
- private int tgaType;
+ private final int tgaType;
/** initial TGA image data fields */
private int idLength; // byte value
@@ -142,7 +142,7 @@ public class TGAImage {
tgaType = TYPE_OLD; // dont try and get footer.
}
- Header(LEDataInputStream in) throws IOException {
+ Header(final LEDataInputStream in) throws IOException {
tgaType = TYPE_OLD; // dont try and get footer.
// initial header fields
@@ -220,24 +220,24 @@ public class TGAImage {
public int size() { return 18 + idLength; }
// buf must be in little-endian byte order
- private void write(ByteBuffer buf) {
+ private void write(final ByteBuffer buf) {
buf.put((byte) idLength);
buf.put((byte) colorMapType);
buf.put((byte) imageType);
buf.putShort((short) firstEntryIndex);
buf.putShort((short) colorMapLength);
- buf.put((byte) colorMapEntrySize);
+ buf.put(colorMapEntrySize);
buf.putShort((short) xOrigin);
buf.putShort((short) yOrigin);
buf.putShort((short) width);
buf.putShort((short) height);
- buf.put((byte) pixelDepth);
- buf.put((byte) imageDescriptor);
+ buf.put(pixelDepth);
+ buf.put(imageDescriptor);
if (idLength > 0) {
try {
- byte[] chars = imageID.getBytes("US-ASCII");
+ final byte[] chars = imageID.getBytes("US-ASCII");
buf.put(chars);
- } catch (UnsupportedEncodingException e) {
+ } catch (final UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
}
@@ -250,7 +250,7 @@ public class TGAImage {
* it into the JimiImage structure. This was taken from the
* prototype and modified for the new Jimi structure
*/
- private void decodeImage(GLProfile glp, LEDataInputStream dIn) throws IOException {
+ private void decodeImage(final GLProfile glp, final LEDataInputStream dIn) throws IOException {
switch (header.imageType()) {
case Header.UCOLORMAPPED:
throw new IOException("TGADecoder Uncompressed Colormapped images not supported");
@@ -294,14 +294,14 @@ public class TGAImage {
* This assumes that the body is for a 24 bit or 32 bit for a
* RGB or ARGB image respectively.
*/
- private void decodeRGBImageU24_32(GLProfile glp, LEDataInputStream dIn) throws IOException {
+ private void decodeRGBImageU24_32(final GLProfile glp, final LEDataInputStream dIn) throws IOException {
setupImage24_32(glp);
int i; // row index
int y; // output row index
- int rawWidth = header.width() * bpp;
- byte[] rawBuf = new byte[rawWidth];
- byte[] tmpData = new byte[rawWidth * header.height()];
+ final int rawWidth = header.width() * bpp;
+ final byte[] rawBuf = new byte[rawWidth];
+ final byte[] tmpData = new byte[rawWidth * header.height()];
for (i = 0; i < header.height(); ++i) {
dIn.readFully(rawBuf, 0, rawWidth);
@@ -323,12 +323,12 @@ public class TGAImage {
* This assumes that the body is for a 24 bit or 32 bit for a
* RGB or ARGB image respectively.
*/
- private void decodeRGBImageRLE24_32(GLProfile glp, LEDataInputStream dIn) throws IOException {
+ private void decodeRGBImageRLE24_32(final GLProfile glp, final LEDataInputStream dIn) throws IOException {
setupImage24_32(glp);
- byte[] pixel = new byte[bpp];
- int rawWidth = header.width() * bpp;
- byte[] tmpData = new byte[rawWidth * header.height()];
+ final byte[] pixel = new byte[bpp];
+ final int rawWidth = header.width() * bpp;
+ final byte[] tmpData = new byte[rawWidth * header.height()];
int i = 0, j;
int packet, len;
while (i < tmpData.length) {
@@ -348,7 +348,7 @@ public class TGAImage {
data = ByteBuffer.wrap(tmpData);
}
- private void setupImage24_32(GLProfile glp) {
+ private void setupImage24_32(final GLProfile glp) {
bpp = header.pixelDepth / 8;
switch (header.pixelDepth) {
case 24:
@@ -367,7 +367,7 @@ public class TGAImage {
}
}
- private static void swapBGR(byte[] data, int bWidth, int height, int bpp) {
+ private static void swapBGR(final byte[] data, final int bWidth, final int height, final int bpp) {
byte r,b;
int k;
for(int i=0; i<height; ++i) {
@@ -398,30 +398,30 @@ public class TGAImage {
public ByteBuffer getData() { return data; }
/** Reads a Targa image from the specified file. */
- public static TGAImage read(GLProfile glp, String filename) throws IOException {
+ public static TGAImage read(final GLProfile glp, final String filename) throws IOException {
return read(glp, new FileInputStream(filename));
}
/** Reads a Targa image from the specified InputStream. */
- public static TGAImage read(GLProfile glp, InputStream in) throws IOException {
- LEDataInputStream dIn = new LEDataInputStream(new BufferedInputStream(in));
+ public static TGAImage read(final GLProfile glp, final InputStream in) throws IOException {
+ final LEDataInputStream dIn = new LEDataInputStream(new BufferedInputStream(in));
- Header header = new Header(dIn);
- TGAImage res = new TGAImage(header);
+ final Header header = new Header(dIn);
+ final TGAImage res = new TGAImage(header);
res.decodeImage(glp, dIn);
return res;
}
/** Writes the image in Targa format to the specified file name. */
- public void write(String filename) throws IOException {
+ public void write(final String filename) throws IOException {
write(new File(filename));
}
/** Writes the image in Targa format to the specified file. */
- public void write(File file) throws IOException {
- FileOutputStream stream = IOUtil.getFileOutputStream(file, true);
- FileChannel chan = stream.getChannel();
- ByteBuffer buf = ByteBuffer.allocate(header.size());
+ public void write(final File file) throws IOException {
+ final FileOutputStream stream = IOUtil.getFileOutputStream(file, true);
+ final FileChannel chan = stream.getChannel();
+ final ByteBuffer buf = ByteBuffer.allocate(header.size());
buf.order(ByteOrder.LITTLE_ENDIAN);
header.write(buf);
buf.rewind();
@@ -437,19 +437,19 @@ public class TGAImage {
data with the passed ByteBuffer. Assumes the data is already in
the correct byte order for writing to disk, i.e., BGR or
BGRA. */
- public static TGAImage createFromData(int width,
- int height,
- boolean hasAlpha,
- boolean topToBottom,
- ByteBuffer data) {
- Header header = new Header();
+ public static TGAImage createFromData(final int width,
+ final int height,
+ final boolean hasAlpha,
+ final boolean topToBottom,
+ final ByteBuffer data) {
+ final Header header = new Header();
header.imageType = Header.UTRUECOLOR;
header.width = width;
header.height = height;
header.pixelDepth = (byte) (hasAlpha ? 32 : 24);
header.imageDescriptor = (byte) (topToBottom ? Header.ID_TOPTOBOTTOM : 0);
// Note ID not supported
- TGAImage ret = new TGAImage(header);
+ final TGAImage ret = new TGAImage(header);
ret.data = data;
return ret;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
index 18ad429d2..4174adf52 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
@@ -55,12 +55,12 @@ public class IIOTextureProvider implements TextureProvider {
private static final boolean DEBUG = Debug.debug("TextureIO");
@Override
- public TextureData newTextureData(GLProfile glp, File file,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
- String fileSuffix) throws IOException {
- BufferedImage img = ImageIO.read(file);
+ public TextureData newTextureData(final GLProfile glp, final File file,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
+ final String fileSuffix) throws IOException {
+ final BufferedImage img = ImageIO.read(file);
if (img == null) {
return null;
}
@@ -72,12 +72,12 @@ public class IIOTextureProvider implements TextureProvider {
}
@Override
- public TextureData newTextureData(GLProfile glp, InputStream stream,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
- String fileSuffix) throws IOException {
- BufferedImage img = ImageIO.read(stream);
+ public TextureData newTextureData(final GLProfile glp, final InputStream stream,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
+ final String fileSuffix) throws IOException {
+ final BufferedImage img = ImageIO.read(stream);
if (img == null) {
return null;
}
@@ -89,12 +89,12 @@ public class IIOTextureProvider implements TextureProvider {
}
@Override
- public TextureData newTextureData(GLProfile glp, URL url,
- int internalFormat,
- int pixelFormat,
- boolean mipmap,
- String fileSuffix) throws IOException {
- InputStream stream = url.openStream();
+ public TextureData newTextureData(final GLProfile glp, final URL url,
+ final int internalFormat,
+ final int pixelFormat,
+ final boolean mipmap,
+ final String fileSuffix) throws IOException {
+ final InputStream stream = url.openStream();
try {
return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
} finally {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
index be82e4fb8..60ac5680e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
@@ -54,10 +54,10 @@ import com.jogamp.opengl.util.texture.spi.*;
public class IIOTextureWriter implements TextureWriter {
@Override
- public boolean write(File file,
- TextureData data) throws IOException {
- int pixelFormat = data.getPixelFormat();
- int pixelType = data.getPixelType();
+ public boolean write(final File file,
+ final TextureData data) throws IOException {
+ final int pixelFormat = data.getPixelFormat();
+ final int pixelType = data.getPixelType();
if ((pixelFormat == GL.GL_RGB ||
pixelFormat == GL.GL_RGBA) &&
(pixelType == GL.GL_BYTE ||
@@ -68,7 +68,7 @@ public class IIOTextureWriter implements TextureWriter {
(pixelFormat == GL.GL_RGB) ?
BufferedImage.TYPE_3BYTE_BGR :
BufferedImage.TYPE_4BYTE_ABGR);
- byte[] imageData = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
+ final byte[] imageData = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
ByteBuffer buf = (ByteBuffer) data.getBuffer();
if (buf == null) {
buf = (ByteBuffer) data.getMipmapData()[0];
@@ -80,17 +80,17 @@ public class IIOTextureWriter implements TextureWriter {
// Swizzle image components to be correct
if (pixelFormat == GL.GL_RGB) {
for (int i = 0; i < imageData.length; i += 3) {
- byte red = imageData[i + 0];
- byte blue = imageData[i + 2];
+ final byte red = imageData[i + 0];
+ final byte blue = imageData[i + 2];
imageData[i + 0] = blue;
imageData[i + 2] = red;
}
} else {
for (int i = 0; i < imageData.length; i += 4) {
- byte red = imageData[i + 0];
- byte green = imageData[i + 1];
- byte blue = imageData[i + 2];
- byte alpha = imageData[i + 3];
+ final byte red = imageData[i + 0];
+ final byte green = imageData[i + 1];
+ final byte blue = imageData[i + 2];
+ final byte alpha = imageData[i + 3];
imageData[i + 0] = alpha;
imageData[i + 1] = blue;
imageData[i + 2] = green;
@@ -104,9 +104,9 @@ public class IIOTextureWriter implements TextureWriter {
// Happened to notice that writing RGBA images to JPEGS is broken
if (TextureIO.JPG.equals(IOUtil.getFileSuffix(file)) &&
image.getType() == BufferedImage.TYPE_4BYTE_ABGR) {
- BufferedImage tmpImage = new BufferedImage(image.getWidth(), image.getHeight(),
+ final BufferedImage tmpImage = new BufferedImage(image.getWidth(), image.getHeight(),
BufferedImage.TYPE_3BYTE_BGR);
- Graphics g = tmpImage.getGraphics();
+ final Graphics g = tmpImage.getGraphics();
g.drawImage(image, 0, 0, null);
g.dispose();
image = tmpImage;
diff --git a/src/jogl/classes/javax/media/opengl/DebugGL2.java b/src/jogl/classes/javax/media/opengl/DebugGL2.java
index 3c064a18f..e0d24c4a1 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGL2.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGL2.java
@@ -15,7 +15,7 @@ package javax.media.opengl;
* </p>
*/
public class DebugGL2 extends DebugGL4bc {
- public DebugGL2(GL2 downstream) {
+ public DebugGL2(final GL2 downstream) {
super((GL4bc)downstream);
}
}
diff --git a/src/jogl/classes/javax/media/opengl/DebugGL3.java b/src/jogl/classes/javax/media/opengl/DebugGL3.java
index b490a63f4..678e800f6 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGL3.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGL3.java
@@ -15,7 +15,7 @@ package javax.media.opengl;
* </p>
*/
public class DebugGL3 extends DebugGL4bc {
- public DebugGL3(GL3 downstream) {
+ public DebugGL3(final GL3 downstream) {
super((GL4bc)downstream);
}
}
diff --git a/src/jogl/classes/javax/media/opengl/DebugGL3bc.java b/src/jogl/classes/javax/media/opengl/DebugGL3bc.java
index 1d42afbc6..2636e9428 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGL3bc.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGL3bc.java
@@ -15,7 +15,7 @@ package javax.media.opengl;
* </p>
*/
public class DebugGL3bc extends DebugGL4bc {
- public DebugGL3bc(GL3bc downstream) {
+ public DebugGL3bc(final GL3bc downstream) {
super((GL4bc)downstream);
}
}
diff --git a/src/jogl/classes/javax/media/opengl/DebugGL4.java b/src/jogl/classes/javax/media/opengl/DebugGL4.java
index 249d850a3..c4f8764cb 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGL4.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGL4.java
@@ -15,7 +15,7 @@ package javax.media.opengl;
* </p>
*/
public class DebugGL4 extends DebugGL4bc {
- public DebugGL4(GL4 downstream) {
+ public DebugGL4(final GL4 downstream) {
super((GL4bc)downstream);
}
}
diff --git a/src/jogl/classes/javax/media/opengl/DebugGLES2.java b/src/jogl/classes/javax/media/opengl/DebugGLES2.java
index 6d666d82a..c4e06f347 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGLES2.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGLES2.java
@@ -15,7 +15,7 @@ package javax.media.opengl;
* </p>
*/
public class DebugGLES2 extends DebugGLES3 {
- public DebugGLES2(GLES2 downstream) {
+ public DebugGLES2(final GLES2 downstream) {
super((GLES3)downstream);
}
}
diff --git a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
index 7e243471e..412af25e0 100644
--- a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
+++ b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
@@ -41,9 +41,13 @@
package javax.media.opengl;
import javax.media.nativewindow.NativeWindowException;
+
import java.util.List;
+
import javax.media.nativewindow.CapabilitiesImmutable;
+import com.jogamp.common.util.PropertyAccess;
+
import jogamp.opengl.Debug;
/** <P> The default implementation of the {@link
@@ -89,7 +93,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
static {
Debug.initSingleton();
- DEBUG = Debug.isPropertyDefined("jogl.debug.CapabilitiesChooser", true);
+ DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.CapabilitiesChooser", true);
}
private final static int NO_SCORE = -9999999;
@@ -142,7 +146,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
}
// Create score array
- int[] scores = new int[availnum];
+ final int[] scores = new int[availnum];
for (int i = 0; i < scores.length; i++) {
scores[i] = NO_SCORE;
@@ -218,13 +222,13 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
boolean gotHW = false;
int maxAbsoluteHWScore = 0;
for (int i = 0; i < availnum; i++) {
- int score = scores[i];
+ final int score = scores[i];
if (score == NO_SCORE) {
continue;
}
final GLCapabilitiesImmutable cur = (GLCapabilitiesImmutable) available.get(i);
if (cur.getHardwareAccelerated()) {
- int absScore = Math.abs(score);
+ final int absScore = Math.abs(score);
if (!gotHW ||
(absScore > maxAbsoluteHWScore)) {
gotHW = true;
@@ -265,7 +269,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
int scoreClosestToZero = NO_SCORE;
int chosenIndex = -1;
for (int i = 0; i < availnum; i++) {
- int score = scores[i];
+ final int score = scores[i];
if (score == NO_SCORE) {
continue;
}
@@ -289,7 +293,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
return chosenIndex;
}
- private static int sign(int score) {
+ private static int sign(final int score) {
if (score < 0) {
return -1;
}
diff --git a/src/jogl/classes/javax/media/opengl/GLCapabilities.java b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
index 4dafe5262..0d65d35cb 100644
--- a/src/jogl/classes/javax/media/opengl/GLCapabilities.java
+++ b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
@@ -80,7 +80,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
* @param glp GLProfile, or null for the default GLProfile
* @throws GLException if no profile is given and no default profile is available for the default device.
*/
- public GLCapabilities(GLProfile glp) throws GLException {
+ public GLCapabilities(final GLProfile glp) throws GLException {
glProfile = (null!=glp)?glp:GLProfile.getDefault(GLProfile.getDefaultDevice());
}
@@ -93,7 +93,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
public Object clone() {
try {
return super.clone();
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
throw new GLException(e);
}
}
@@ -103,7 +103,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
* from <code>source</code> into this instance.
* @return this instance
*/
- public GLCapabilities copyFrom(GLCapabilitiesImmutable source) {
+ public GLCapabilities copyFrom(final GLCapabilitiesImmutable source) {
super.copyFrom(source);
glProfile = source.getGLProfile();
isPBuffer = source.isPBuffer();
@@ -145,12 +145,12 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if(this == obj) { return true; }
if(!(obj instanceof GLCapabilitiesImmutable)) {
return false;
}
- GLCapabilitiesImmutable other = (GLCapabilitiesImmutable)obj;
+ final GLCapabilitiesImmutable other = (GLCapabilitiesImmutable)obj;
boolean res = super.equals(obj) &&
other.getGLProfile()==glProfile &&
other.isPBuffer()==isPBuffer &&
@@ -176,7 +176,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
@Override
public int compareTo(final CapabilitiesImmutable o) {
if ( ! ( o instanceof GLCapabilitiesImmutable ) ) {
- Class<?> c = (null != o) ? o.getClass() : null ;
+ final Class<?> c = (null != o) ? o.getClass() : null ;
throw new ClassCastException("Not a GLCapabilitiesImmutable object, but " + c);
}
final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) o;
@@ -235,7 +235,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
}
/** Sets the GL profile you desire */
- public void setGLProfile(GLProfile profile) {
+ public void setGLProfile(final GLProfile profile) {
glProfile=profile;
}
@@ -256,7 +256,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
* Requesting offscreen pbuffer mode disables the offscreen auto selection.
* </p>
*/
- public void setPBuffer(boolean enable) {
+ public void setPBuffer(final boolean enable) {
if(enable) {
setOnscreen(false);
}
@@ -280,7 +280,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
* Requesting offscreen FBO mode disables the offscreen auto selection.
* </p>
*/
- public void setFBO(boolean enable) {
+ public void setFBO(final boolean enable) {
if(enable) {
setOnscreen(false);
}
@@ -293,7 +293,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
}
/** Enables or disables double buffering. */
- public void setDoubleBuffered(boolean enable) {
+ public void setDoubleBuffered(final boolean enable) {
doubleBuffered = enable;
}
@@ -303,7 +303,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
}
/** Enables or disables stereo viewing. */
- public void setStereo(boolean enable) {
+ public void setStereo(final boolean enable) {
stereo = enable;
}
@@ -313,7 +313,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
}
/** Enables or disables hardware acceleration. */
- public void setHardwareAccelerated(boolean enable) {
+ public void setHardwareAccelerated(final boolean enable) {
hardwareAccelerated = enable;
}
@@ -323,7 +323,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
}
/** Sets the number of bits requested for the depth buffer. */
- public void setDepthBits(int depthBits) {
+ public void setDepthBits(final int depthBits) {
this.depthBits = depthBits;
}
@@ -333,7 +333,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
}
/** Sets the number of bits requested for the stencil buffer. */
- public void setStencilBits(int stencilBits) {
+ public void setStencilBits(final int stencilBits) {
this.stencilBits = stencilBits;
}
@@ -346,7 +346,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
red component. On some systems only the accumulation buffer
depth, which is the sum of the red, green, and blue bits, is
considered. */
- public void setAccumRedBits(int accumRedBits) {
+ public void setAccumRedBits(final int accumRedBits) {
this.accumRedBits = accumRedBits;
}
@@ -359,7 +359,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
green component. On some systems only the accumulation buffer
depth, which is the sum of the red, green, and blue bits, is
considered. */
- public void setAccumGreenBits(int accumGreenBits) {
+ public void setAccumGreenBits(final int accumGreenBits) {
this.accumGreenBits = accumGreenBits;
}
@@ -372,7 +372,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
blue component. On some systems only the accumulation buffer
depth, which is the sum of the red, green, and blue bits, is
considered. */
- public void setAccumBlueBits(int accumBlueBits) {
+ public void setAccumBlueBits(final int accumBlueBits) {
this.accumBlueBits = accumBlueBits;
}
@@ -385,7 +385,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
component. On some systems only the accumulation buffer depth,
which is the sum of the red, green, and blue bits, is
considered. */
- public void setAccumAlphaBits(int accumAlphaBits) {
+ public void setAccumAlphaBits(final int accumAlphaBits) {
this.accumAlphaBits = accumAlphaBits;
}
@@ -393,7 +393,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
* Sets the desired extension for full-scene antialiasing
* (FSAA), default is {@link #DEFAULT_SAMPLE_EXTENSION}.
*/
- public void setSampleExtension(String se) {
+ public void setSampleExtension(final String se) {
sampleExtension = se;
}
@@ -410,7 +410,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
* If enabled this method also invokes {@link #setAlphaBits(int) setAlphaBits(1)}
* if {@link #getAlphaBits()} == 0.<br>
*/
- public void setSampleBuffers(boolean enable) {
+ public void setSampleBuffers(final boolean enable) {
sampleBuffers = enable;
if(sampleBuffers && getAlphaBits()==0) {
setAlphaBits(1);
@@ -427,7 +427,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
* to be allocated. Defaults to 2.
* @see #getNumSamples()
*/
- public void setNumSamples(int numSamples) {
+ public void setNumSamples(final int numSamples) {
this.numSamples = numSamples;
}
@@ -503,7 +503,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
object. */
@Override
public String toString() {
- StringBuilder msg = new StringBuilder();
+ final StringBuilder msg = new StringBuilder();
msg.append("GLCaps[");
toString(msg);
msg.append("]");
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index 9a4311772..16399799f 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -227,7 +227,7 @@ public abstract class GLContext {
/**
* @param isInit true if called for class initialization, otherwise false (re-init or destruction).
*/
- protected void resetStates(boolean isInit) {
+ protected void resetStates(final boolean isInit) {
if (DEBUG) {
System.err.println(getThreadName() + ": GLContext.resetStates(isInit "+isInit+")");
// Thread.dumpStack();
@@ -277,7 +277,7 @@ public abstract class GLContext {
* @param quirk the quirk to be tested, e.g. {@link GLRendererQuirks#NoDoubleBufferedPBuffer}.
* @throws IllegalArgumentException if the quirk is out of range
*/
- public final boolean hasRendererQuirk(int quirk) throws IllegalArgumentException {
+ public final boolean hasRendererQuirk(final int quirk) throws IllegalArgumentException {
return null != glRendererQuirks ? glRendererQuirks.exist(quirk) : false ;
}
@@ -460,7 +460,7 @@ public abstract class GLContext {
* @throws GLException if no context is current
*/
public static GL getCurrentGL() throws GLException {
- GLContext glc = getCurrent();
+ final GLContext glc = getCurrent();
if(null==glc) {
throw new GLException(getThreadName()+": No OpenGL context current on this thread");
}
@@ -495,7 +495,7 @@ public abstract class GLContext {
}
/** Returns a String representation of the {@link #makeCurrent()} result. */
- public static final String makeCurrentResultToString(int res) {
+ public static final String makeCurrentResultToString(final int res) {
switch(res) {
case CONTEXT_NOT_CURRENT: return "CONTEXT_NOT_CURRENT";
case CONTEXT_CURRENT: return "CONTEXT_CURRENT";
@@ -509,7 +509,7 @@ public abstract class GLContext {
* and has no other side-effects. For use by third parties adding
* new GLContext implementations; not for use by end users.
*/
- protected static void setCurrent(GLContext cur) {
+ protected static void setCurrent(final GLContext cur) {
if( TRACE_SWITCH ) {
if(null == cur) {
System.err.println(getThreadName()+": GLContext.ContextSwitch: - setCurrent() - NULL");
@@ -570,7 +570,7 @@ public abstract class GLContext {
/**
* Returns the attached user object for the given name to this GLContext.
*/
- public final Object getAttachedObject(String name) {
+ public final Object getAttachedObject(final String name) {
return attachedObjects.get(name);
}
@@ -578,11 +578,11 @@ public abstract class GLContext {
* Sets the attached user object for the given name to this GLContext.
* Returns the previously set object or null.
*/
- public final Object attachObject(String name, Object obj) {
+ public final Object attachObject(final String name, final Object obj) {
return attachedObjects.put(name, obj);
}
- public final Object detachObject(String name) {
+ public final Object detachObject(final String name) {
return attachedObjects.remove(name);
}
@@ -591,7 +591,7 @@ public abstract class GLContext {
*/
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
this.append(sb);
@@ -599,7 +599,7 @@ public abstract class GLContext {
return sb.toString();
}
- public final StringBuilder append(StringBuilder sb) {
+ public final StringBuilder append(final StringBuilder sb) {
sb.append("Version ").append(getGLVersion()).append(" [GL ").append(getGLVersionNumber()).append(", vendor ").append(getGLVendorVersionNumber());
sb.append("], options 0x");
sb.append(Integer.toHexString(ctxOptions));
@@ -816,7 +816,7 @@ public abstract class GLContext {
return "#version " + ctxGLSLVersion.getMajor() + ( minor < 10 ? "0"+minor : minor ) + esSuffix + "\n" ;
}
- protected static final VersionNumber getStaticGLSLVersionNumber(int glMajorVersion, int glMinorVersion, int ctxOptions) {
+ protected static final VersionNumber getStaticGLSLVersionNumber(final int glMajorVersion, final int glMinorVersion, final int ctxOptions) {
if( 0 != ( CTX_PROFILE_ES & ctxOptions ) ) {
if( 3 == glMajorVersion ) {
return Version300; // ES 3.0 -> GLSL 3.00
@@ -938,14 +938,14 @@ public abstract class GLContext {
final GL gl = getGL();
final int[] val = new int[] { 0 } ;
try {
- gl.glGetIntegerv(GL2GL3.GL_MAX_SAMPLES, val, 0);
+ gl.glGetIntegerv(GL2ES3.GL_MAX_SAMPLES, val, 0);
final int glerr = gl.glGetError();
if(GL.GL_NO_ERROR == glerr) {
return val[0];
} else if(DEBUG) {
System.err.println("GLContext.getMaxRenderbufferSamples: GL_MAX_SAMPLES query GL Error 0x"+Integer.toHexString(glerr));
}
- } catch (GLException gle) { gle.printStackTrace(); }
+ } catch (final GLException gle) { gle.printStackTrace(); }
}
return 0;
}
@@ -1188,7 +1188,7 @@ public abstract class GLContext {
*
* @throws GLException if the context is not current.
*/
- public final boolean setSwapInterval(int interval) throws GLException {
+ public final boolean setSwapInterval(final int interval) throws GLException {
validateCurrent();
if(0<=interval) {
if( !drawableRetargeted || !hasRendererQuirk(GLRendererQuirks.NoSetSwapIntervalPostRetarget) ) {
@@ -1200,7 +1200,7 @@ public abstract class GLContext {
}
return false;
}
- protected boolean setSwapIntervalImpl(int interval) {
+ protected boolean setSwapIntervalImpl(final int interval) {
return false;
}
/** Return the current swap interval.
@@ -1225,27 +1225,27 @@ public abstract class GLContext {
}
}
- public final boolean queryMaxSwapGroups(int[] maxGroups, int maxGroups_offset,
- int[] maxBarriers, int maxBarriers_offset) {
+ public final boolean queryMaxSwapGroups(final int[] maxGroups, final int maxGroups_offset,
+ final int[] maxBarriers, final int maxBarriers_offset) {
validateCurrent();
return queryMaxSwapGroupsImpl(maxGroups, maxGroups_offset, maxBarriers, maxBarriers_offset);
}
- protected boolean queryMaxSwapGroupsImpl(int[] maxGroups, int maxGroups_offset,
- int[] maxBarriers, int maxBarriers_offset) { return false; }
- public final boolean joinSwapGroup(int group) {
+ protected boolean queryMaxSwapGroupsImpl(final int[] maxGroups, final int maxGroups_offset,
+ final int[] maxBarriers, final int maxBarriers_offset) { return false; }
+ public final boolean joinSwapGroup(final int group) {
validateCurrent();
return joinSwapGroupImpl(group);
}
- protected boolean joinSwapGroupImpl(int group) { /** nop per default .. **/ return false; }
+ protected boolean joinSwapGroupImpl(final int group) { /** nop per default .. **/ return false; }
protected int currentSwapGroup = -1; // default: not set yet ..
public int getSwapGroup() {
return currentSwapGroup;
}
- public final boolean bindSwapBarrier(int group, int barrier) {
+ public final boolean bindSwapBarrier(final int group, final int barrier) {
validateCurrent();
return bindSwapBarrierImpl(group, barrier);
}
- protected boolean bindSwapBarrierImpl(int group, int barrier) { /** nop per default .. **/ return false; }
+ protected boolean bindSwapBarrierImpl(final int group, final int barrier) { /** nop per default .. **/ return false; }
/**
* Return the framebuffer name bound to this context,
@@ -1406,11 +1406,11 @@ public abstract class GLContext {
/* 2.*/ { 0 },
/* 3.*/ { 0 } };
- public static final int getMaxMajor(int ctxProfile) {
+ public static final int getMaxMajor(final int ctxProfile) {
return ( 0 != ( CTX_PROFILE_ES & ctxProfile ) ) ? ES_VERSIONS.length-1 : GL_VERSIONS.length-1;
}
- public static final int getMaxMinor(int ctxProfile, int major) {
+ public static final int getMaxMinor(final int ctxProfile, final int major) {
if( 1>major ) {
return -1;
}
@@ -1439,7 +1439,7 @@ public abstract class GLContext {
* and {@link #decrementGLVersion(int, int[], int[])} until invalid.
* </p>
*/
- public static final boolean isValidGLVersion(int ctxProfile, int major, int minor) {
+ public static final boolean isValidGLVersion(final int ctxProfile, final int major, final int minor) {
if( 1>major || 0>minor ) {
return false;
}
@@ -1455,7 +1455,7 @@ public abstract class GLContext {
* Clip the given GL version to the maximum known valid version if exceeding.
* @return true if clipped, i.e. given value exceeds maximum, otherwise false.
*/
- public static final boolean clipGLVersion(int ctxProfile, int major[], int minor[]) {
+ public static final boolean clipGLVersion(final int ctxProfile, final int major[], final int minor[]) {
final int m = major[0];
final int n = minor[0];
@@ -1494,7 +1494,7 @@ public abstract class GLContext {
* @param minor
* @return
*/
- public static final boolean decrementGLVersion(int ctxProfile, int major[], int minor[]) {
+ public static final boolean decrementGLVersion(final int ctxProfile, final int major[], final int minor[]) {
if( !clipGLVersion(ctxProfile, major, minor) ) {
int m = major[0];
int n = minor[0] - 1;
@@ -1520,13 +1520,13 @@ public abstract class GLContext {
return true;
}
- protected static int composeBits(int a8, int b8, int c16) {
+ protected static int composeBits(final int a8, final int b8, final int c16) {
return ( ( a8 & 0x000000FF ) << 24 ) |
( ( b8 & 0x000000FF ) << 16 ) |
( ( c16 & 0x0000FFFF ) ) ;
}
- private static void validateProfileBits(int bits, String argName) {
+ private static void validateProfileBits(final int bits, final String argName) {
int num = 0;
if( 0 != ( CTX_PROFILE_COMPAT & bits ) ) { num++; }
if( 0 != ( CTX_PROFILE_CORE & bits ) ) { num++; }
@@ -1557,13 +1557,13 @@ public abstract class GLContext {
GLContextImpl.shutdownImpl(); // well ..
}
- protected static boolean getAvailableGLVersionsSet(AbstractGraphicsDevice device) {
+ protected static boolean getAvailableGLVersionsSet(final AbstractGraphicsDevice device) {
synchronized ( deviceVersionsAvailableSet ) {
return deviceVersionsAvailableSet.containsKey(device.getUniqueID());
}
}
- protected static void setAvailableGLVersionsSet(AbstractGraphicsDevice device) {
+ protected static void setAvailableGLVersionsSet(final AbstractGraphicsDevice device) {
synchronized ( deviceVersionsAvailableSet ) {
final String devKey = device.getUniqueID();
if( null != deviceVersionsAvailableSet.put(devKey, devKey) ) {
@@ -1580,7 +1580,7 @@ public abstract class GLContext {
* Returns a unique String object using {@link String#intern()} for the given arguments,
* which object reference itself can be used as a key.
*/
- protected static String getDeviceVersionAvailableKey(AbstractGraphicsDevice device, int major, int profile) {
+ protected static String getDeviceVersionAvailableKey(final AbstractGraphicsDevice device, final int major, final int profile) {
final String r = device.getUniqueID() + "-" + toHexString(composeBits(major, profile, 0));
return r.intern();
}
@@ -1597,8 +1597,8 @@ public abstract class GLContext {
*
* @see #createContextARBMapVersionsAvailable
*/
- protected static Integer mapAvailableGLVersion(AbstractGraphicsDevice device,
- int reqMajor, int profile, int resMajor, int resMinor, int resCtp)
+ protected static Integer mapAvailableGLVersion(final AbstractGraphicsDevice device,
+ final int reqMajor, final int profile, final int resMajor, final int resMinor, int resCtp)
{
validateProfileBits(profile, "profile");
validateProfileBits(resCtp, "resCtp");
@@ -1624,7 +1624,7 @@ public abstract class GLContext {
synchronized(deviceVersionAvailable) {
final Set<String> keys = deviceVersionAvailable.keySet();
boolean needsSeparator = false;
- for(Iterator<String> i = keys.iterator(); i.hasNext(); ) {
+ for(final Iterator<String> i = keys.iterator(); i.hasNext(); ) {
if(needsSeparator) {
sb.append(Platform.getNewline());
}
@@ -1652,7 +1652,7 @@ public abstract class GLContext {
* @param reqProfile Key Value either {@link #CTX_PROFILE_COMPAT}, {@link #CTX_PROFILE_CORE} or {@link #CTX_PROFILE_ES}
* @return the available GL version as encoded with {@link #composeBits(int, int, int), otherwise <code>null</code>
*/
- protected static Integer getAvailableGLVersion(AbstractGraphicsDevice device, int reqMajor, int reqProfile) {
+ protected static Integer getAvailableGLVersion(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile) {
final String objectKey = getDeviceVersionAvailableKey(device, reqMajor, reqProfile);
Integer val;
synchronized(deviceVersionAvailable) {
@@ -1668,8 +1668,8 @@ public abstract class GLContext {
* @param minor if not null, returns the used minor version
* @param ctp if not null, returns the used context profile
*/
- protected static boolean getAvailableGLVersion(AbstractGraphicsDevice device, int reqMajor, int reqProfile,
- int[] major, int minor[], int ctp[]) {
+ protected static boolean getAvailableGLVersion(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile,
+ final int[] major, final int minor[], final int ctp[]) {
final Integer valI = getAvailableGLVersion(device, reqMajor, reqProfile);
if(null==valI) {
@@ -1694,7 +1694,7 @@ public abstract class GLContext {
* returns the highest GLProfile string regarding the implementation version and context profile bits.
* @throws GLException if version and context profile bits could not be mapped to a GLProfile
*/
- protected static String getGLProfile(int major, int minor, int ctp)
+ protected static String getGLProfile(final int major, final int minor, final int ctp)
throws GLException {
if(0 != ( CTX_PROFILE_COMPAT & ctp )) {
if(major >= 4) { return GLProfile.GL4bc; }
@@ -1714,7 +1714,7 @@ public abstract class GLContext {
/**
* Returns the GLProfile's major version number at reqMajorCTP[0] and it's context property (CTP) at reqMajorCTP[1] for availability mapping request.
*/
- protected static final void getRequestMajorAndCompat(final GLProfile glp, int[/*2*/] reqMajorCTP) {
+ protected static final void getRequestMajorAndCompat(final GLProfile glp, final int[/*2*/] reqMajorCTP) {
final GLProfile glpImpl = glp.getImpl();
if( glpImpl.isGL4() ) {
reqMajorCTP[0]=4;
@@ -1743,9 +1743,9 @@ public abstract class GLContext {
final int[] reqMajorCTP = new int[] { 0, 0 };
getRequestMajorAndCompat(glp, reqMajorCTP);
- int _major[] = { 0 };
- int _minor[] = { 0 };
- int _ctp[] = { 0 };
+ final int _major[] = { 0 };
+ final int _minor[] = { 0 };
+ final int _ctp[] = { 0 };
if( GLContext.getAvailableGLVersion(device, reqMajorCTP[0], reqMajorCTP[1], _major, _minor, _ctp)) {
return _ctp[0];
}
@@ -1758,7 +1758,7 @@ public abstract class GLContext {
* @param profile Key Value either {@link #CTX_PROFILE_COMPAT}, {@link #CTX_PROFILE_CORE} or {@link #CTX_PROFILE_ES}
* @return the highest GLProfile for the device regarding availability, version and profile bits.
*/
- protected static GLProfile getAvailableGLProfile(AbstractGraphicsDevice device, int reqMajor, int reqProfile)
+ protected static GLProfile getAvailableGLProfile(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile)
throws GLException {
final String glpName = getAvailableGLProfileName(device, reqMajor, reqProfile);
return null != glpName ? GLProfile.get(device, glpName) : null;
@@ -1770,11 +1770,11 @@ public abstract class GLContext {
* @param profile Key Value either {@link #CTX_PROFILE_COMPAT}, {@link #CTX_PROFILE_CORE} or {@link #CTX_PROFILE_ES}
* @return the highest GLProfile name for the device regarding availability, version and profile bits.
*/
- /* package */ static String getAvailableGLProfileName(AbstractGraphicsDevice device, int reqMajor, int reqProfile)
+ /* package */ static String getAvailableGLProfileName(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile)
throws GLException {
- int major[] = { 0 };
- int minor[] = { 0 };
- int ctp[] = { 0 };
+ final int major[] = { 0 };
+ final int minor[] = { 0 };
+ final int ctp[] = { 0 };
if(GLContext.getAvailableGLVersion(device, reqMajor, reqProfile, major, minor, ctp)) {
return GLContext.getGLProfile(major[0], minor[0], ctp[0]);
}
@@ -1786,10 +1786,10 @@ public abstract class GLContext {
* @param major Key Value either 1, 2, 3 or 4
* @param profile Key Value either {@link #CTX_PROFILE_COMPAT}, {@link #CTX_PROFILE_CORE} or {@link #CTX_PROFILE_ES}
*/
- protected static String getAvailableGLVersionAsString(AbstractGraphicsDevice device, int major, int profile) {
- int _major[] = { 0 };
- int _minor[] = { 0 };
- int _ctp[] = { 0 };
+ protected static String getAvailableGLVersionAsString(final AbstractGraphicsDevice device, final int major, final int profile) {
+ final int _major[] = { 0 };
+ final int _minor[] = { 0 };
+ final int _ctp[] = { 0 };
if(getAvailableGLVersion(device, major, profile, _major, _minor, _ctp)) {
return getGLVersion(_major[0], _minor[0], _ctp[0], null);
}
@@ -1809,7 +1809,7 @@ public abstract class GLContext {
* @param glp {@link GLProfile} to check for FBO capabilities
* @see GLContext#hasBasicFBOSupport()
*/
- public static final boolean isFBOAvailable(AbstractGraphicsDevice device, GLProfile glp) {
+ public static final boolean isFBOAvailable(final AbstractGraphicsDevice device, final GLProfile glp) {
return 0 != ( CTX_IMPL_FBO & getAvailableContextProperties(device, glp) );
}
@@ -1818,7 +1818,7 @@ public abstract class GLContext {
* @see GLContext#isHardwareRasterizer()
* @see GLProfile#isHardwareRasterizer()
*/
- public static final int isHardwareRasterizer(AbstractGraphicsDevice device, GLProfile glp) {
+ public static final int isHardwareRasterizer(final AbstractGraphicsDevice device, final GLProfile glp) {
final int r;
final int ctp = getAvailableContextProperties(device, glp);
if(0 == ctp) {
@@ -1838,8 +1838,8 @@ public abstract class GLContext {
* @param isHardware return value of one boolean, whether the profile is a hardware rasterizer or not
* @return true if the requested GL version is available regardless of a software or hardware rasterizer, otherwise false.
*/
- protected static boolean isGLVersionAvailable(AbstractGraphicsDevice device, int reqMajor, int reqProfile, boolean isHardware[]) {
- Integer valI = getAvailableGLVersion(device, reqMajor, reqProfile);
+ protected static boolean isGLVersionAvailable(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile, final boolean isHardware[]) {
+ final Integer valI = getAvailableGLVersion(device, reqMajor, reqProfile);
if(null==valI) {
return false;
}
@@ -1847,15 +1847,15 @@ public abstract class GLContext {
return true;
}
- public static boolean isGLES1Available(AbstractGraphicsDevice device, boolean isHardware[]) {
+ public static boolean isGLES1Available(final AbstractGraphicsDevice device, final boolean isHardware[]) {
return isGLVersionAvailable(device, 1, GLContext.CTX_PROFILE_ES, isHardware);
}
- public static boolean isGLES2Available(AbstractGraphicsDevice device, boolean isHardware[]) {
+ public static boolean isGLES2Available(final AbstractGraphicsDevice device, final boolean isHardware[]) {
return isGLVersionAvailable(device, 2, GLContext.CTX_PROFILE_ES, isHardware);
}
- public static boolean isGLES3Available(AbstractGraphicsDevice device, boolean isHardware[]) {
+ public static boolean isGLES3Available(final AbstractGraphicsDevice device, final boolean isHardware[]) {
return isGLVersionAvailable(device, 3, GLContext.CTX_PROFILE_ES, isHardware);
}
@@ -1867,10 +1867,10 @@ public abstract class GLContext {
* Includes [ GL &ge; 4.3, GL &ge; 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]
* </p>
*/
- public static final boolean isGLES3CompatibleAvailable(AbstractGraphicsDevice device) {
- int major[] = { 0 };
- int minor[] = { 0 };
- int ctp[] = { 0 };
+ public static final boolean isGLES3CompatibleAvailable(final AbstractGraphicsDevice device) {
+ final int major[] = { 0 };
+ final int minor[] = { 0 };
+ final int ctp[] = { 0 };
boolean ok;
ok = GLContext.getAvailableGLVersion(device, 3, GLContext.CTX_PROFILE_ES, major, minor, ctp);
@@ -1883,29 +1883,29 @@ public abstract class GLContext {
return 0 != ( ctp[0] & CTX_IMPL_ES3_COMPAT );
}
- public static boolean isGL4bcAvailable(AbstractGraphicsDevice device, boolean isHardware[]) {
+ public static boolean isGL4bcAvailable(final AbstractGraphicsDevice device, final boolean isHardware[]) {
return isGLVersionAvailable(device, 4, CTX_PROFILE_COMPAT, isHardware);
}
- public static boolean isGL4Available(AbstractGraphicsDevice device, boolean isHardware[]) {
+ public static boolean isGL4Available(final AbstractGraphicsDevice device, final boolean isHardware[]) {
return isGLVersionAvailable(device, 4, CTX_PROFILE_CORE, isHardware);
}
- public static boolean isGL3bcAvailable(AbstractGraphicsDevice device, boolean isHardware[]) {
+ public static boolean isGL3bcAvailable(final AbstractGraphicsDevice device, final boolean isHardware[]) {
return isGLVersionAvailable(device, 3, CTX_PROFILE_COMPAT, isHardware);
}
- public static boolean isGL3Available(AbstractGraphicsDevice device, boolean isHardware[]) {
+ public static boolean isGL3Available(final AbstractGraphicsDevice device, final boolean isHardware[]) {
return isGLVersionAvailable(device, 3, CTX_PROFILE_CORE, isHardware);
}
- public static boolean isGL2Available(AbstractGraphicsDevice device, boolean isHardware[]) {
+ public static boolean isGL2Available(final AbstractGraphicsDevice device, final boolean isHardware[]) {
return isGLVersionAvailable(device, 2, CTX_PROFILE_COMPAT, isHardware);
}
- protected static String getGLVersion(int major, int minor, int ctp, String gl_version) {
+ protected static String getGLVersion(final int major, final int minor, final int ctp, final String gl_version) {
boolean needColon = false;
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(major);
sb.append(".");
sb.append(minor);
@@ -1937,15 +1937,15 @@ public abstract class GLContext {
// internal string utils
//
- protected static String toHexString(int hex) {
+ protected static String toHexString(final int hex) {
return "0x" + Integer.toHexString(hex);
}
- protected static String toHexString(long hex) {
+ protected static String toHexString(final long hex) {
return "0x" + Long.toHexString(hex);
}
- private static boolean appendString(StringBuilder sb, String string, boolean needColon, boolean condition) {
+ private static boolean appendString(final StringBuilder sb, final String string, boolean needColon, final boolean condition) {
if(condition) {
if(needColon) {
sb.append(", ");
diff --git a/src/jogl/classes/javax/media/opengl/GLDebugMessage.java b/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
index acb33b058..325345012 100644
--- a/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
+++ b/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
@@ -51,7 +51,7 @@ public class GLDebugMessage {
* @param dbgSeverity The ARB severity level
* @param dbgMsg The debug message
*/
- public GLDebugMessage(GLContext source, long when, int dbgSource, int dbgType, int dbgId, int dbgSeverity, String dbgMsg) {
+ public GLDebugMessage(final GLContext source, final long when, final int dbgSource, final int dbgType, final int dbgId, final int dbgSeverity, final String dbgMsg) {
this.source = source;
this.when = when;
this.dbgSource = dbgSource;
@@ -71,14 +71,14 @@ public class GLDebugMessage {
* @param dbgMsg
* @return
*/
- public static GLDebugMessage translateAMDEvent(GLContext source, long when, int dbgId, int amdDbgCategory, int dbgSeverity, String dbgMsg) {
+ public static GLDebugMessage translateAMDEvent(final GLContext source, final long when, final int dbgId, final int amdDbgCategory, final int dbgSeverity, final String dbgMsg) {
int dbgSource, dbgType;
// AMD category == ARB source/type
switch(amdDbgCategory) {
case GL2GL3.GL_DEBUG_CATEGORY_API_ERROR_AMD:
- dbgSource = GL2GL3.GL_DEBUG_SOURCE_API;
- dbgType = GL2GL3.GL_DEBUG_TYPE_ERROR;
+ dbgSource = GL2ES2.GL_DEBUG_SOURCE_API;
+ dbgType = GL2ES2.GL_DEBUG_TYPE_ERROR;
break;
//
@@ -86,18 +86,18 @@ public class GLDebugMessage {
//
case GL2GL3.GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD:
- dbgSource = GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM;
- dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
+ dbgSource = GL2ES2.GL_DEBUG_SOURCE_WINDOW_SYSTEM;
+ dbgType = GL2ES2.GL_DEBUG_TYPE_OTHER;
break;
case GL2GL3.GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD:
- dbgSource = GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER;
- dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
+ dbgSource = GL2ES2.GL_DEBUG_SOURCE_SHADER_COMPILER;
+ dbgType = GL2ES2.GL_DEBUG_TYPE_OTHER;
break;
case GL2GL3.GL_DEBUG_CATEGORY_APPLICATION_AMD:
- dbgSource = GL2GL3.GL_DEBUG_SOURCE_APPLICATION;
- dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
+ dbgSource = GL2ES2.GL_DEBUG_SOURCE_APPLICATION;
+ dbgType = GL2ES2.GL_DEBUG_TYPE_OTHER;
break;
@@ -106,49 +106,49 @@ public class GLDebugMessage {
//
case GL2GL3.GL_DEBUG_CATEGORY_DEPRECATION_AMD:
- dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
- dbgType = GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR;
+ dbgSource = GL2ES2.GL_DEBUG_SOURCE_OTHER;
+ dbgType = GL2ES2.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR;
break;
case GL2GL3.GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD:
- dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
- dbgType = GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR;
+ dbgSource = GL2ES2.GL_DEBUG_SOURCE_OTHER;
+ dbgType = GL2ES2.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR;
break;
case GL2GL3.GL_DEBUG_CATEGORY_PERFORMANCE_AMD:
- dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
- dbgType = GL2GL3.GL_DEBUG_TYPE_PERFORMANCE;
+ dbgSource = GL2ES2.GL_DEBUG_SOURCE_OTHER;
+ dbgType = GL2ES2.GL_DEBUG_TYPE_PERFORMANCE;
break;
case GL2GL3.GL_DEBUG_CATEGORY_OTHER_AMD:
default:
- dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
- dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
+ dbgSource = GL2ES2.GL_DEBUG_SOURCE_OTHER;
+ dbgType = GL2ES2.GL_DEBUG_TYPE_OTHER;
}
return new GLDebugMessage(source, when, dbgSource, dbgType, dbgId, dbgSeverity, dbgMsg);
}
- public static int translateARB2AMDCategory(int dbgSource, int dbgType) {
+ public static int translateARB2AMDCategory(final int dbgSource, final int dbgType) {
switch (dbgSource) {
- case GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM:
+ case GL2ES2.GL_DEBUG_SOURCE_WINDOW_SYSTEM:
return GL2GL3.GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD;
- case GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER:
+ case GL2ES2.GL_DEBUG_SOURCE_SHADER_COMPILER:
return GL2GL3.GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD;
- case GL2GL3.GL_DEBUG_SOURCE_APPLICATION:
+ case GL2ES2.GL_DEBUG_SOURCE_APPLICATION:
return GL2GL3.GL_DEBUG_CATEGORY_APPLICATION_AMD;
}
switch(dbgType) {
- case GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
+ case GL2ES2.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
return GL2GL3.GL_DEBUG_CATEGORY_DEPRECATION_AMD;
- case GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:
+ case GL2ES2.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:
return GL2GL3.GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD;
- case GL2GL3.GL_DEBUG_TYPE_PERFORMANCE:
+ case GL2ES2.GL_DEBUG_TYPE_PERFORMANCE:
return GL2GL3.GL_DEBUG_CATEGORY_PERFORMANCE_AMD;
}
@@ -207,46 +207,46 @@ public class GLDebugMessage {
return toString(null).toString();
}
- public static String getDbgSourceString(int dbgSource) {
+ public static String getDbgSourceString(final int dbgSource) {
switch(dbgSource) {
- case GL2GL3.GL_DEBUG_SOURCE_API: return "GL API";
- case GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER: return "GLSL or extension compiler";
- case GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM: return "Native Windowing binding";
- case GL2GL3.GL_DEBUG_SOURCE_THIRD_PARTY: return "Third party";
- case GL2GL3.GL_DEBUG_SOURCE_APPLICATION: return "Application";
- case GL2GL3.GL_DEBUG_SOURCE_OTHER: return "generic";
+ case GL2ES2.GL_DEBUG_SOURCE_API: return "GL API";
+ case GL2ES2.GL_DEBUG_SOURCE_SHADER_COMPILER: return "GLSL or extension compiler";
+ case GL2ES2.GL_DEBUG_SOURCE_WINDOW_SYSTEM: return "Native Windowing binding";
+ case GL2ES2.GL_DEBUG_SOURCE_THIRD_PARTY: return "Third party";
+ case GL2ES2.GL_DEBUG_SOURCE_APPLICATION: return "Application";
+ case GL2ES2.GL_DEBUG_SOURCE_OTHER: return "generic";
default: return "Unknown (" + toHexString(dbgSource) + ")";
}
}
- public static String getDbgTypeString(int dbgType) {
+ public static String getDbgTypeString(final int dbgType) {
switch(dbgType) {
- case GL2GL3.GL_DEBUG_TYPE_ERROR: return "Error";
- case GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: return "Warning: marked for deprecation";
- case GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: return "Warning: undefined behavior";
- case GL2GL3.GL_DEBUG_TYPE_PERFORMANCE: return "Warning: implementation dependent performance";
- case GL2GL3.GL_DEBUG_TYPE_PORTABILITY: return "Warning: vendor-specific extension use";
- case GL2GL3.GL_DEBUG_TYPE_OTHER: return "Warning: generic";
+ case GL2ES2.GL_DEBUG_TYPE_ERROR: return "Error";
+ case GL2ES2.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: return "Warning: marked for deprecation";
+ case GL2ES2.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: return "Warning: undefined behavior";
+ case GL2ES2.GL_DEBUG_TYPE_PERFORMANCE: return "Warning: implementation dependent performance";
+ case GL2ES2.GL_DEBUG_TYPE_PORTABILITY: return "Warning: vendor-specific extension use";
+ case GL2ES2.GL_DEBUG_TYPE_OTHER: return "Warning: generic";
default: return "Unknown (" + toHexString(dbgType) + ")";
}
}
- public static String getDbgSeverityString(int dbgSeverity) {
+ public static String getDbgSeverityString(final int dbgSeverity) {
switch(dbgSeverity) {
- case GL2GL3.GL_DEBUG_SEVERITY_HIGH: return "High: dangerous undefined behavior";
- case GL2GL3.GL_DEBUG_SEVERITY_MEDIUM: return "Medium: Severe performance/deprecation/other warnings";
- case GL2GL3.GL_DEBUG_SEVERITY_LOW: return "Low: Performance warnings (redundancy/undefined)";
+ case GL2ES2.GL_DEBUG_SEVERITY_HIGH: return "High: dangerous undefined behavior";
+ case GL2ES2.GL_DEBUG_SEVERITY_MEDIUM: return "Medium: Severe performance/deprecation/other warnings";
+ case GL2ES2.GL_DEBUG_SEVERITY_LOW: return "Low: Performance warnings (redundancy/undefined)";
default: return "Unknown (" + toHexString(dbgSeverity) + ")";
}
}
- public static StringBuilder toHexString(StringBuilder sb, int i) {
+ public static StringBuilder toHexString(StringBuilder sb, final int i) {
if(null==sb) {
sb = new StringBuilder();
}
return sb.append("0x").append(Integer.toHexString(i));
}
- public static String toHexString(int i) {
+ public static String toHexString(final int i) {
return "0x"+Integer.toHexString(i);
}
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
index 077daf6e9..6e7caf8f8 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
@@ -43,6 +43,7 @@ package javax.media.opengl;
import java.util.ArrayList;
import java.util.List;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.ReflectionUtil;
import com.jogamp.opengl.GLAutoDrawableDelegate;
import com.jogamp.opengl.GLRendererQuirks;
@@ -142,8 +143,8 @@ public abstract class GLDrawableFactory {
final String nwt = NativeWindowFactory.getNativeWindowType(true);
GLDrawableFactory tmp = null;
- String factoryClassName = Debug.getProperty("jogl.gldrawablefactory.class.name", true);
- ClassLoader cl = GLDrawableFactory.class.getClassLoader();
+ String factoryClassName = PropertyAccess.getProperty("jogl.gldrawablefactory.class.name", true);
+ final ClassLoader cl = GLDrawableFactory.class.getClassLoader();
if (null == factoryClassName) {
if ( nwt == NativeWindowFactory.TYPE_X11 ) {
factoryClassName = "jogamp.opengl.x11.glx.X11GLXDrawableFactory";
@@ -164,7 +165,7 @@ public abstract class GLDrawableFactory {
}
try {
tmp = (GLDrawableFactory) ReflectionUtil.createInstance(factoryClassName, cl);
- } catch (Exception jre) {
+ } catch (final Exception jre) {
if (DEBUG || GLProfile.DEBUG) {
System.err.println("Info: GLDrawableFactory.static - Native Platform: "+nwt+" - not available: "+factoryClassName);
jre.printStackTrace();
@@ -179,7 +180,7 @@ public abstract class GLDrawableFactory {
if(!disableOpenGLES) {
try {
tmp = (GLDrawableFactory) ReflectionUtil.createInstance("jogamp.opengl.egl.EGLDrawableFactory", cl);
- } catch (Exception jre) {
+ } catch (final Exception jre) {
if (DEBUG || GLProfile.DEBUG) {
System.err.println("Info: GLDrawableFactory.static - EGLDrawableFactory - not available");
jre.printStackTrace();
@@ -221,7 +222,7 @@ public abstract class GLDrawableFactory {
try {
gldf.resetDisplayGamma();
gldf.shutdownImpl();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
System.err.println("GLDrawableFactory.shutdownImpl: Caught "+t.getClass().getName()+" during factory shutdown #"+(i+1)+"/"+gldfCount+" "+gldf.getClass().getName());
if( DEBUG ) {
t.printStackTrace();
@@ -322,7 +323,7 @@ public abstract class GLDrawableFactory {
* @param device which {@link AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
* @return true if a shared resource could been created, otherwise false.
*/
- protected final boolean createSharedResource(AbstractGraphicsDevice device) {
+ protected final boolean createSharedResource(final AbstractGraphicsDevice device) {
return createSharedResourceImpl(device);
}
protected abstract boolean createSharedResourceImpl(AbstractGraphicsDevice device);
@@ -343,7 +344,7 @@ public abstract class GLDrawableFactory {
* @see #getRendererQuirks(AbstractGraphicsDevice)
* @see GLRendererQuirks
*/
- public final boolean hasRendererQuirk(AbstractGraphicsDevice device, int quirk) {
+ public final boolean hasRendererQuirk(final AbstractGraphicsDevice device, final int quirk) {
final GLRendererQuirks glrq = getRendererQuirks(device);
return null != glrq ? glrq.exist(quirk) : false;
}
@@ -385,11 +386,11 @@ public abstract class GLDrawableFactory {
* @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory,
* or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL.
*/
- public static GLDrawableFactory getFactory(GLProfile glProfile) throws GLException {
+ public static GLDrawableFactory getFactory(final GLProfile glProfile) throws GLException {
return getFactoryImpl(glProfile.getImplName());
}
- protected static GLDrawableFactory getFactoryImpl(String glProfileImplName) throws GLException {
+ protected static GLDrawableFactory getFactoryImpl(final String glProfileImplName) throws GLException {
if ( GLProfile.usesNativeGLES(glProfileImplName) ) {
if(null!=eglFactory) {
return eglFactory;
@@ -400,7 +401,7 @@ public abstract class GLDrawableFactory {
throw new GLException("No GLDrawableFactory available for profile: "+glProfileImplName);
}
- protected static GLDrawableFactory getFactoryImpl(AbstractGraphicsDevice device) throws GLException {
+ protected static GLDrawableFactory getFactoryImpl(final AbstractGraphicsDevice device) throws GLException {
if(null != nativeOSFactory && nativeOSFactory.getIsDeviceCompatible(device)) {
return nativeOSFactory;
}
diff --git a/src/jogl/classes/javax/media/opengl/GLException.java b/src/jogl/classes/javax/media/opengl/GLException.java
index 460f17be9..6a287c969 100644
--- a/src/jogl/classes/javax/media/opengl/GLException.java
+++ b/src/jogl/classes/javax/media/opengl/GLException.java
@@ -50,19 +50,19 @@ public class GLException extends RuntimeException {
/** Constructs a GLException object with the specified detail
message. */
- public GLException(String message) {
+ public GLException(final String message) {
super(message);
}
/** Constructs a GLException object with the specified detail
message and root cause. */
- public GLException(String message, Throwable cause) {
+ public GLException(final String message, final Throwable cause) {
super(message, cause);
}
/** Constructs a GLException object with the specified root
cause. */
- public GLException(Throwable cause) {
+ public GLException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
index d947bada2..ab12ba17c 100644
--- a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
@@ -88,7 +88,7 @@ public class GLPipelineFactory {
* @param downstream is always the 1st argument for the upstream constructor
* @param additionalArgs additional arguments for the upstream constructor
*/
- public static final GL create(String pipelineClazzBaseName, Class<?> reqInterface, GL downstream, Object[] additionalArgs) {
+ public static final GL create(final String pipelineClazzBaseName, final Class<?> reqInterface, final GL downstream, final Object[] additionalArgs) {
Class<?> downstreamClazz = downstream.getClass();
Class<?> upstreamClazz = null;
Class<?> interfaceClazz = null;
@@ -101,7 +101,7 @@ public class GLPipelineFactory {
do {
// For all interfaces: right -> left == child -> parent
// It is important that this matches with the gluegen cfg file's 'Implements' clause !
- Class<?>[] clazzes = downstreamClazz.getInterfaces();
+ final Class<?>[] clazzes = downstreamClazz.getInterfaces();
for(int i=clazzes.length-1; null==upstreamClazz && i>=0; i--) {
if(DEBUG) {
System.out.println("GLPipelineFactory: Try "+downstreamClazz.getName()+" Interface["+i+"]: "+clazzes[i].getName());
@@ -142,7 +142,7 @@ public class GLPipelineFactory {
System.out.println("GLPipelineFactory: Got : "+ upstreamClazz.getName()+", base interface: "+interfaceClazz.getName());
}
- Class<?>[] cstrArgTypes = new Class<?>[ 1 + ( ( null==additionalArgs ) ? 0 : additionalArgs.length ) ] ;
+ final Class<?>[] cstrArgTypes = new Class<?>[ 1 + ( ( null==additionalArgs ) ? 0 : additionalArgs.length ) ] ;
{
int i = 0;
cstrArgTypes[i++] = interfaceClazz;
@@ -151,10 +151,10 @@ public class GLPipelineFactory {
}
}
// throws exception if cstr not found!
- Constructor<?> cstr = ReflectionUtil.getConstructor(upstreamClazz, cstrArgTypes);
+ final Constructor<?> cstr = ReflectionUtil.getConstructor(upstreamClazz, cstrArgTypes);
Object instance = null;
try {
- Object[] cstrArgs = new Object[ 1 + ( ( null==additionalArgs ) ? 0 : additionalArgs.length ) ] ;
+ final Object[] cstrArgs = new Object[ 1 + ( ( null==additionalArgs ) ? 0 : additionalArgs.length ) ] ;
{
int i = 0;
cstrArgs[i++] = downstream;
@@ -163,7 +163,7 @@ public class GLPipelineFactory {
}
}
instance = cstr.newInstance( cstrArgs ) ;
- } catch (Throwable t) { t.printStackTrace(); }
+ } catch (final Throwable t) { t.printStackTrace(); }
if(null==instance) {
throw new GLException("Error: Couldn't create instance of pipeline: "+upstreamClazz.getName()+
" ( "+getArgsClassNameList(downstreamClazz, additionalArgs) +" )");
@@ -174,8 +174,8 @@ public class GLPipelineFactory {
return (GL) instance;
}
- private static final String getArgsClassNameList(Class<?> arg0, Object[] args) {
- StringBuilder sb = new StringBuilder();
+ private static final String getArgsClassNameList(final Class<?> arg0, final Object[] args) {
+ final StringBuilder sb = new StringBuilder();
sb.append(arg0.getName());
if(args!=null) {
for(int j=0; j<args.length; j++) {
@@ -186,20 +186,20 @@ public class GLPipelineFactory {
return sb.toString();
}
- private static final Class<?> getUpstreamClazz(Class<?> downstreamClazz, String pipelineClazzBaseName) {
- String downstreamClazzName = downstreamClazz.getName();
+ private static final Class<?> getUpstreamClazz(final Class<?> downstreamClazz, final String pipelineClazzBaseName) {
+ final String downstreamClazzName = downstreamClazz.getName();
- StringTokenizer st = new StringTokenizer(downstreamClazzName, ".");
+ final StringTokenizer st = new StringTokenizer(downstreamClazzName, ".");
String downstreamClazzBaseName = downstreamClazzName;
while(st.hasMoreTokens()) {
downstreamClazzBaseName = st.nextToken();
}
- String upstreamClazzName = pipelineClazzBaseName+downstreamClazzBaseName;
+ final String upstreamClazzName = pipelineClazzBaseName+downstreamClazzBaseName;
Class<?> upstreamClazz = null;
try {
upstreamClazz = Class.forName(upstreamClazzName, true, GLPipelineFactory.class.getClassLoader());
- } catch (Throwable e) { e.printStackTrace(); }
+ } catch (final Throwable e) { e.printStackTrace(); }
return upstreamClazz;
}
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index addc977d8..57367adcc 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -167,7 +167,7 @@ public class GLProfile {
*
* @throws GLException if no profile for the given device is available.
*/
- public static void initProfiles(AbstractGraphicsDevice device) throws GLException {
+ public static void initProfiles(final AbstractGraphicsDevice device) throws GLException {
getProfileMap(device, true);
}
@@ -208,11 +208,11 @@ public class GLProfile {
* or <code>[ null, GL ]</code> for the default profile.
* @return true if the profile is available for the device, otherwise false.
*/
- public static boolean isAvailable(AbstractGraphicsDevice device, String profile) {
+ public static boolean isAvailable(final AbstractGraphicsDevice device, final String profile) {
initSingleton();
return isAvailableImpl(getProfileMap(device, false), profile);
}
- private static boolean isAvailableImpl(HashMap<String /*GLProfile_name*/, GLProfile> map, String profile) {
+ private static boolean isAvailableImpl(final HashMap<String /*GLProfile_name*/, GLProfile> map, final String profile) {
return null != map && null != map.get(profile);
}
@@ -223,7 +223,7 @@ public class GLProfile {
* or <code>[ null, GL ]</code> for the default profile.
* @return true if the profile is available for the default device, otherwise false.
*/
- public static boolean isAvailable(String profile) {
+ public static boolean isAvailable(final String profile) {
return isAvailable(null, profile);
}
@@ -236,21 +236,21 @@ public class GLProfile {
return isAvailable(null, null);
}
- public static String glAvailabilityToString(AbstractGraphicsDevice device) {
+ public static String glAvailabilityToString(final AbstractGraphicsDevice device) {
return glAvailabilityToString(device, null).toString();
}
- public static StringBuilder glAvailabilityToString(AbstractGraphicsDevice device, StringBuilder sb) {
+ public static StringBuilder glAvailabilityToString(final AbstractGraphicsDevice device, final StringBuilder sb) {
return glAvailabilityToString(device, sb, null, 0);
}
- private static StringBuilder doIndent(StringBuilder sb, String indent, int indentCount) {
+ private static StringBuilder doIndent(final StringBuilder sb, final String indent, int indentCount) {
while(indentCount>0) {
sb.append(indent);
indentCount--;
}
return sb;
}
- public static StringBuilder glAvailabilityToString(AbstractGraphicsDevice device, StringBuilder sb, String indent, int indentCount) {
+ public static StringBuilder glAvailabilityToString(AbstractGraphicsDevice device, StringBuilder sb, final String indent, int indentCount) {
boolean avail;
if(null == sb) {
sb = new StringBuilder();
@@ -425,7 +425,7 @@ public class GLProfile {
int profileCount = 0;
if(null != map) {
- for (Map.Entry<String,GLProfile> entry : map.entrySet()) {
+ for (final Map.Entry<String,GLProfile> entry : map.entrySet()) {
if( !GL_DEFAULT.equals(entry.getKey()) ) {
if(useIndent) {
doIndent(sb.append(Platform.getNewline()), indent, indentCount);
@@ -444,7 +444,7 @@ public class GLProfile {
}
try {
sb.append(getDefault(device));
- } catch (GLException gle) {
+ } catch (final GLException gle) {
sb.append("n/a");
}
}
@@ -628,8 +628,8 @@ public class GLProfile {
* @throws GLException if no profile is available for the device.
* @see #GL_PROFILE_LIST_ALL
*/
- public static GLProfile getDefault(AbstractGraphicsDevice device) {
- GLProfile glp = get(device, GL_DEFAULT);
+ public static GLProfile getDefault(final AbstractGraphicsDevice device) {
+ final GLProfile glp = get(device, GL_DEFAULT);
return glp;
}
@@ -650,7 +650,7 @@ public class GLProfile {
* @throws GLException if no profile is available for the device.
* @see #GL_PROFILE_LIST_MAX
*/
- public static GLProfile getMaximum(AbstractGraphicsDevice device, boolean favorHardwareRasterizer)
+ public static GLProfile getMaximum(final AbstractGraphicsDevice device, final boolean favorHardwareRasterizer)
throws GLException
{
return get(device, GL_PROFILE_LIST_MAX, favorHardwareRasterizer);
@@ -660,7 +660,7 @@ public class GLProfile {
* @throws GLException if no profile is available for the default device.
* @see #GL_PROFILE_LIST_MAX
*/
- public static GLProfile getMaximum(boolean favorHardwareRasterizer)
+ public static GLProfile getMaximum(final boolean favorHardwareRasterizer)
throws GLException
{
return get(GL_PROFILE_LIST_MAX, favorHardwareRasterizer);
@@ -673,7 +673,7 @@ public class GLProfile {
* @throws GLException if no desktop profile is available for the device.
* @see #GL_PROFILE_LIST_MIN
*/
- public static GLProfile getMinimum(AbstractGraphicsDevice device, boolean favorHardwareRasterizer)
+ public static GLProfile getMinimum(final AbstractGraphicsDevice device, final boolean favorHardwareRasterizer)
throws GLException
{
return get(device, GL_PROFILE_LIST_MIN, favorHardwareRasterizer);
@@ -683,7 +683,7 @@ public class GLProfile {
* @throws GLException if no desktop profile is available for the default device.
* @see #GL_PROFILE_LIST_MIN
*/
- public static GLProfile getMinimum(boolean favorHardwareRasterizer)
+ public static GLProfile getMinimum(final boolean favorHardwareRasterizer)
throws GLException
{
return get(GL_PROFILE_LIST_MIN, favorHardwareRasterizer);
@@ -697,7 +697,7 @@ public class GLProfile {
* @throws GLException if no fixed function profile is available for the device.
* @see #GL_PROFILE_LIST_MAX_FIXEDFUNC
*/
- public static GLProfile getMaxFixedFunc(AbstractGraphicsDevice device, boolean favorHardwareRasterizer)
+ public static GLProfile getMaxFixedFunc(final AbstractGraphicsDevice device, final boolean favorHardwareRasterizer)
throws GLException
{
return get(device, GL_PROFILE_LIST_MAX_FIXEDFUNC, favorHardwareRasterizer);
@@ -707,7 +707,7 @@ public class GLProfile {
* @throws GLException if no fixed function profile is available for the default device.
* @see #GL_PROFILE_LIST_MAX_FIXEDFUNC
*/
- public static GLProfile getMaxFixedFunc(boolean favorHardwareRasterizer)
+ public static GLProfile getMaxFixedFunc(final boolean favorHardwareRasterizer)
throws GLException
{
return get(GL_PROFILE_LIST_MAX_FIXEDFUNC, favorHardwareRasterizer);
@@ -720,7 +720,7 @@ public class GLProfile {
* @throws GLException if no programmable profile is available for the device.
* @see #GL_PROFILE_LIST_MAX_PROGSHADER
*/
- public static GLProfile getMaxProgrammable(AbstractGraphicsDevice device, boolean favorHardwareRasterizer)
+ public static GLProfile getMaxProgrammable(final AbstractGraphicsDevice device, final boolean favorHardwareRasterizer)
throws GLException
{
return get(device, GL_PROFILE_LIST_MAX_PROGSHADER, favorHardwareRasterizer);
@@ -730,7 +730,7 @@ public class GLProfile {
* @throws GLException if no programmable profile is available for the default device.
* @see #GL_PROFILE_LIST_MAX_PROGSHADER
*/
- public static GLProfile getMaxProgrammable(boolean favorHardwareRasterizer)
+ public static GLProfile getMaxProgrammable(final boolean favorHardwareRasterizer)
throws GLException
{
return get(GL_PROFILE_LIST_MAX_PROGSHADER, favorHardwareRasterizer);
@@ -743,7 +743,7 @@ public class GLProfile {
* @throws GLException if no programmable core profile is available for the device.
* @see #GL_PROFILE_LIST_MAX_PROGSHADER_CORE
*/
- public static GLProfile getMaxProgrammableCore(AbstractGraphicsDevice device, boolean favorHardwareRasterizer)
+ public static GLProfile getMaxProgrammableCore(final AbstractGraphicsDevice device, final boolean favorHardwareRasterizer)
throws GLException
{
return get(device, GL_PROFILE_LIST_MAX_PROGSHADER_CORE, favorHardwareRasterizer);
@@ -753,7 +753,7 @@ public class GLProfile {
* @throws GLException if no programmable core profile is available for the default device.
* @see #GL_PROFILE_LIST_MAX_PROGSHADER_CORE
*/
- public static GLProfile getMaxProgrammableCore(boolean favorHardwareRasterizer)
+ public static GLProfile getMaxProgrammableCore(final boolean favorHardwareRasterizer)
throws GLException
{
return get(GL_PROFILE_LIST_MAX_PROGSHADER_CORE, favorHardwareRasterizer);
@@ -772,7 +772,7 @@ public class GLProfile {
* @see #get(AbstractGraphicsDevice, String)
* @see #getImpl()
*/
- public static GLProfile getGL2ES1(AbstractGraphicsDevice device)
+ public static GLProfile getGL2ES1(final AbstractGraphicsDevice device)
throws GLException
{
return get(device, GL2ES1).getImpl();
@@ -802,7 +802,7 @@ public class GLProfile {
* @see #get(AbstractGraphicsDevice, String)
* @see #getImpl()
*/
- public static GLProfile getGL2ES2(AbstractGraphicsDevice device)
+ public static GLProfile getGL2ES2(final AbstractGraphicsDevice device)
throws GLException
{
return get(device, GL2ES2).getImpl();
@@ -832,7 +832,7 @@ public class GLProfile {
* @see #get(AbstractGraphicsDevice, String)
* @see #getImpl()
*/
- public static GLProfile getGL4ES3(AbstractGraphicsDevice device)
+ public static GLProfile getGL4ES3(final AbstractGraphicsDevice device)
throws GLException
{
return get(device, GL4ES3).getImpl();
@@ -862,7 +862,7 @@ public class GLProfile {
* @see #get(AbstractGraphicsDevice, String)
* @see #getImpl()
*/
- public static GLProfile getGL2GL3(AbstractGraphicsDevice device)
+ public static GLProfile getGL2GL3(final AbstractGraphicsDevice device)
throws GLException
{
return get(device, GL2GL3).getImpl();
@@ -889,7 +889,7 @@ public class GLProfile {
* or <code>[ null, GL ]</code> for the default profile.
* @throws GLException if the requested profile is not available for the device.
*/
- public static GLProfile get(AbstractGraphicsDevice device, String profile)
+ public static GLProfile get(final AbstractGraphicsDevice device, String profile)
throws GLException
{
if(null==profile || profile.equals("GL")) {
@@ -908,7 +908,7 @@ public class GLProfile {
* or <code>[ null, GL ]</code> for the default profile.
* @throws GLException if the requested profile is not available for the default device.
*/
- public static GLProfile get(String profile)
+ public static GLProfile get(final String profile)
throws GLException
{
return get(defaultDevice, profile);
@@ -923,12 +923,12 @@ public class GLProfile {
* @param favorHardwareRasterizer set to true, if hardware rasterizer shall be favored, otherwise false.
* @throws GLException if the non of the requested profiles is available for the device.
*/
- public static GLProfile get(AbstractGraphicsDevice device, String[] profiles, boolean favorHardwareRasterizer)
+ public static GLProfile get(final AbstractGraphicsDevice device, final String[] profiles, final boolean favorHardwareRasterizer)
throws GLException
{
GLProfile glProfileAny = null;
- HashMap<String /*GLProfile_name*/, GLProfile> map = getProfileMap(device, true);
+ final HashMap<String /*GLProfile_name*/, GLProfile> map = getProfileMap(device, true);
for(int i=0; i<profiles.length; i++) {
final GLProfile glProfile = map.get(profiles[i]);
if(null!=glProfile) {
@@ -954,7 +954,7 @@ public class GLProfile {
* @param favorHardwareRasterizer set to true, if hardware rasterizer shall be favored, otherwise false.
* @throws GLException if the non of the requested profiles is available for the default device.
*/
- public static GLProfile get(String[] profiles, boolean favorHardwareRasterizer)
+ public static GLProfile get(final String[] profiles, final boolean favorHardwareRasterizer)
throws GLException
{
return get(defaultDevice, profiles, favorHardwareRasterizer);
@@ -963,26 +963,26 @@ public class GLProfile {
/** Indicates whether the native OpenGL ES1 profile is in use.
* This requires an EGL interface.
*/
- public static boolean usesNativeGLES1(String profileImpl) {
+ public static boolean usesNativeGLES1(final String profileImpl) {
return GLES1.equals(profileImpl);
}
/** Indicates whether the native OpenGL ES3 or ES2 profile is in use.
* This requires an EGL, ES3 or ES2 compatible interface.
*/
- public static boolean usesNativeGLES2(String profileImpl) {
+ public static boolean usesNativeGLES2(final String profileImpl) {
return GLES3.equals(profileImpl) || GLES2.equals(profileImpl);
}
/** Indicates whether the native OpenGL ES2 profile is in use.
* This requires an EGL, ES3 compatible interface.
*/
- public static boolean usesNativeGLES3(String profileImpl) {
+ public static boolean usesNativeGLES3(final String profileImpl) {
return GLES3.equals(profileImpl);
}
/** Indicates whether either of the native OpenGL ES profiles are in use. */
- public static boolean usesNativeGLES(String profileImpl) {
+ public static boolean usesNativeGLES(final String profileImpl) {
return usesNativeGLES2(profileImpl) || usesNativeGLES1(profileImpl);
}
@@ -990,7 +990,7 @@ public class GLProfile {
JOGL's AWT part */
public static boolean isAWTAvailable() { return isAWTAvailable; }
- public static String getGLTypeName(int type) {
+ public static String getGLTypeName(final int type) {
switch (type) {
case GL.GL_UNSIGNED_BYTE:
return "GL_UNSIGNED_BYTE";
@@ -1006,9 +1006,9 @@ public class GLProfile {
return "GL_FIXED";
case javax.media.opengl.GL2ES2.GL_INT:
return "GL_INT";
- case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
+ case GL.GL_UNSIGNED_INT:
return "GL_UNSIGNED_INT";
- case javax.media.opengl.GL2.GL_DOUBLE:
+ case javax.media.opengl.GL2GL3.GL_DOUBLE:
return "GL_DOUBLE";
case javax.media.opengl.GL2.GL_2_BYTES:
return "GL_2_BYTES";
@@ -1020,7 +1020,7 @@ public class GLProfile {
return null;
}
- public static String getGLArrayName(int array) {
+ public static String getGLArrayName(final int array) {
switch(array) {
case GLPointerFunc.GL_VERTEX_ARRAY:
return "GL_VERTEX_ARRAY";
@@ -1037,7 +1037,7 @@ public class GLProfile {
public final String getGLImplBaseClassName() {
return getGLImplBaseClassName(getImplName());
}
- private static final String getGLImplBaseClassName(String profileImpl) {
+ private static final String getGLImplBaseClassName(final String profileImpl) {
if( GLES2 == profileImpl || GLES3 == profileImpl ) {
return "jogamp.opengl.es3.GLES3";
} else if( GLES1 == profileImpl ) {
@@ -1053,10 +1053,10 @@ public class GLProfile {
}
}
- public final Constructor<?> getGLCtor(boolean glObject) {
+ public final Constructor<?> getGLCtor(final boolean glObject) {
return getGLCtor(getImplName(), glObject);
}
- private static final Constructor<?> getGLCtor(String profileImpl, boolean glObject) {
+ private static final Constructor<?> getGLCtor(final String profileImpl, final boolean glObject) {
if( GLES2 == profileImpl || GLES3 == profileImpl ) {
return glObject ? ctorGLES3Impl : ctorGLES3ProcAddr;
} else if( GLES1 == profileImpl ) {
@@ -1078,7 +1078,7 @@ public class GLProfile {
* if both, profile and profileImpl is equal with this.
*/
@Override
- public final boolean equals(Object o) {
+ public final boolean equals(final Object o) {
if(this==o) { return true; }
if(o instanceof GLProfile) {
final GLProfile glp = (GLProfile)o;
@@ -1099,7 +1099,7 @@ public class GLProfile {
* @param glp GLProfile to compare with
* @throws GLException if given GLProfile and this aren't equal
*/
- public final void verifyEquality(GLProfile glp) throws GLException {
+ public final void verifyEquality(final GLProfile glp) throws GLException {
if(!this.equals(glp)) {
throw new GLException("GLProfiles are not equal: "+this+" != "+glp);
}
@@ -1235,7 +1235,7 @@ public class GLProfile {
* General validation if type is a valid GL data type
* for the current profile
*/
- public boolean isValidDataType(int type, boolean throwException) {
+ public boolean isValidDataType(final int type, final boolean throwException) {
switch(type) {
case GL.GL_UNSIGNED_BYTE:
case GL.GL_BYTE:
@@ -1245,11 +1245,11 @@ public class GLProfile {
case GL.GL_FIXED:
return true;
case javax.media.opengl.GL2ES2.GL_INT:
- case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
+ case GL.GL_UNSIGNED_INT:
if( isGL2ES2() ) {
return true;
}
- case javax.media.opengl.GL2.GL_DOUBLE:
+ case javax.media.opengl.GL2GL3.GL_DOUBLE:
if( isGL3() ) {
return true;
}
@@ -1266,8 +1266,8 @@ public class GLProfile {
return false;
}
- public boolean isValidArrayDataType(int index, int comps, int type,
- boolean isVertexAttribPointer, boolean throwException) {
+ public boolean isValidArrayDataType(final int index, final int comps, final int type,
+ final boolean isVertexAttribPointer, final boolean throwException) {
final String arrayName = getGLArrayName(index);
if( isGLES1() ) {
if(isVertexAttribPointer) {
@@ -1391,8 +1391,8 @@ public class GLProfile {
case GL.GL_SHORT:
case GL.GL_FLOAT:
case javax.media.opengl.GL2ES2.GL_INT:
- case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
- case javax.media.opengl.GL2.GL_DOUBLE:
+ case GL.GL_UNSIGNED_INT:
+ case javax.media.opengl.GL2GL3.GL_DOUBLE:
break;
default:
if(throwException) {
@@ -1420,7 +1420,7 @@ public class GLProfile {
case GL.GL_SHORT:
case GL.GL_FLOAT:
case javax.media.opengl.GL2ES2.GL_INT:
- case javax.media.opengl.GL2.GL_DOUBLE:
+ case javax.media.opengl.GL2GL3.GL_DOUBLE:
break;
default:
if(throwException) {
@@ -1447,7 +1447,7 @@ public class GLProfile {
case GL.GL_SHORT:
case GL.GL_FLOAT:
case javax.media.opengl.GL2ES2.GL_INT:
- case javax.media.opengl.GL2.GL_DOUBLE:
+ case javax.media.opengl.GL2GL3.GL_DOUBLE:
break;
default:
if(throwException) {
@@ -1474,8 +1474,8 @@ public class GLProfile {
case GL.GL_SHORT:
case GL.GL_FLOAT:
case javax.media.opengl.GL2ES2.GL_INT:
- case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
- case javax.media.opengl.GL2.GL_DOUBLE:
+ case GL.GL_UNSIGNED_INT:
+ case javax.media.opengl.GL2GL3.GL_DOUBLE:
break;
default:
if(throwException) {
@@ -1500,7 +1500,7 @@ public class GLProfile {
case GL.GL_SHORT:
case GL.GL_FLOAT:
case javax.media.opengl.GL2ES2.GL_INT:
- case javax.media.opengl.GL2.GL_DOUBLE:
+ case javax.media.opengl.GL2GL3.GL_DOUBLE:
break;
default:
if(throwException) {
@@ -1566,7 +1566,7 @@ public class GLProfile {
private static final Constructor<?> getCtor(final String clazzName, final boolean glObject, final ClassLoader cl) {
try {
return ReflectionUtil.getConstructor(clazzName, glObject ? ctorGLArgs : ctorProcArgs, false, cl);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if( DEBUG ) {
System.err.println("Caught: "+t.getMessage());
t.printStackTrace();
@@ -1656,16 +1656,16 @@ public class GLProfile {
try {
desktopFactory = (GLDrawableFactoryImpl) GLDrawableFactory.getFactoryImpl(GL2);
if(null != desktopFactory) {
- DesktopGLDynamicLookupHelper glLookupHelper = (DesktopGLDynamicLookupHelper) desktopFactory.getGLDynamicLookupHelper(0);
+ final DesktopGLDynamicLookupHelper glLookupHelper = (DesktopGLDynamicLookupHelper) desktopFactory.getGLDynamicLookupHelper(0);
if(null!=glLookupHelper) {
hasDesktopGLFactory = glLookupHelper.isLibComplete() && hasGL234Impl;
}
}
- } catch (LinkageError le) {
+ } catch (final LinkageError le) {
t=le;
- } catch (RuntimeException re) {
+ } catch (final RuntimeException re) {
t=re;
- } catch (Throwable tt) {
+ } catch (final Throwable tt) {
t=tt;
}
if(DEBUG) {
@@ -1696,13 +1696,13 @@ public class GLProfile {
hasGLES3Impl = null!=eglFactory.getGLDynamicLookupHelper(2) && hasGLES3Impl;
hasGLES1Impl = null!=eglFactory.getGLDynamicLookupHelper(1) && hasGLES1Impl;
}
- } catch (LinkageError le) {
+ } catch (final LinkageError le) {
t=le;
- } catch (SecurityException se) {
+ } catch (final SecurityException se) {
t=se;
- } catch (NullPointerException npe) {
+ } catch (final NullPointerException npe) {
t=npe;
- } catch (RuntimeException re) {
+ } catch (final RuntimeException re) {
t=re;
}
if(DEBUG) {
@@ -1765,13 +1765,13 @@ public class GLProfile {
* @param device the device for which profiles shall be initialized
* @return true if any profile for the device exists, otherwise false
*/
- private static boolean initProfilesForDevice(AbstractGraphicsDevice device) {
+ private static boolean initProfilesForDevice(final AbstractGraphicsDevice device) {
if(null == device) {
return false;
}
initLock.lock();
try {
- GLDrawableFactory factory = GLDrawableFactory.getFactoryImpl(device);
+ final GLDrawableFactory factory = GLDrawableFactory.getFactoryImpl(device);
factory.enterThreadCriticalZone();
try {
return initProfilesForDeviceCritical(device);
@@ -1782,8 +1782,8 @@ public class GLProfile {
initLock.unlock();
}
}
- private static boolean initProfilesForDeviceCritical(AbstractGraphicsDevice device) {
- boolean isSet = GLContext.getAvailableGLVersionsSet(device);
+ private static boolean initProfilesForDeviceCritical(final AbstractGraphicsDevice device) {
+ final boolean isSet = GLContext.getAvailableGLVersionsSet(device);
if(DEBUG) {
System.err.println("Info: GLProfile.initProfilesForDevice: "+device+" ("+device.getClass().getName()+"), isSet "+isSet+", hasDesktopGLFactory "+hasDesktopGLFactory+", hasEGLFactory "+hasEGLFactory);
@@ -1791,7 +1791,7 @@ public class GLProfile {
if(isSet) {
// Avoid recursion and check whether impl. is sane!
final String deviceKey = device.getUniqueID();
- HashMap<String /*GLProfile_name*/, GLProfile> map = deviceConn2ProfileMap.get(deviceKey);
+ final HashMap<String /*GLProfile_name*/, GLProfile> map = deviceConn2ProfileMap.get(deviceKey);
if( null == map ) {
throw new InternalError("GLContext Avail. GLVersion is set - but no profile map for device: "+device);
}
@@ -1813,7 +1813,7 @@ public class GLProfile {
if(null != sharedResourceThread) {
initLock.addOwner(sharedResourceThread);
}
- boolean desktopSharedCtxAvail = desktopFactory.createSharedResource(device);
+ final boolean desktopSharedCtxAvail = desktopFactory.createSharedResource(device);
if(null != sharedResourceThread) {
initLock.removeOwner(sharedResourceThread);
}
@@ -1841,7 +1841,7 @@ public class GLProfile {
if(null != sharedResourceThread) {
initLock.addOwner(sharedResourceThread);
}
- boolean eglSharedCtxAvail = eglFactory.createSharedResource(device);
+ final boolean eglSharedCtxAvail = eglFactory.createSharedResource(device);
if(null != sharedResourceThread) {
initLock.removeOwner(sharedResourceThread);
}
@@ -1881,13 +1881,13 @@ public class GLProfile {
System.err.println("GLProfile.initProfilesForDevice: "+device.getConnection()+": "+glAvailabilityToString(device));
if(addedDesktopProfile) {
dumpGLInfo(desktopFactory, device);
- List<GLCapabilitiesImmutable> availCaps = desktopFactory.getAvailableCapabilities(device);
+ final List<GLCapabilitiesImmutable> availCaps = desktopFactory.getAvailableCapabilities(device);
for(int i=0; i<availCaps.size(); i++) {
System.err.println(availCaps.get(i));
}
} else if(addedEGLProfile) {
dumpGLInfo(eglFactory, device);
- List<GLCapabilitiesImmutable> availCaps = eglFactory.getAvailableCapabilities(device);
+ final List<GLCapabilitiesImmutable> availCaps = eglFactory.getAvailableCapabilities(device);
for(int i=0; i<availCaps.size(); i++) {
System.err.println(availCaps.get(i));
}
@@ -1897,8 +1897,8 @@ public class GLProfile {
return addedDesktopProfile || addedEGLProfile;
}
- private static void dumpGLInfo(GLDrawableFactoryImpl factory, AbstractGraphicsDevice device) {
- GLContext ctx = factory.getOrCreateSharedContext(device);
+ private static void dumpGLInfo(final GLDrawableFactoryImpl factory, final AbstractGraphicsDevice device) {
+ final GLContext ctx = factory.getOrCreateSharedContext(device);
if(null != ctx) {
System.err.println("GLProfile.dumpGLInfo: "+ctx);
ctx.makeCurrent();
@@ -1917,8 +1917,8 @@ public class GLProfile {
return defaultDevice;
}
- private static String array2String(String[] list) {
- StringBuilder msg = new StringBuilder();
+ private static String array2String(final String[] list) {
+ final StringBuilder msg = new StringBuilder();
msg.append("[");
for (int i = 0; i < list.length; i++) {
if (i > 0)
@@ -1929,8 +1929,8 @@ public class GLProfile {
return msg.toString();
}
- private static void glAvailabilityToString(AbstractGraphicsDevice device, StringBuilder sb, int major, int profile) {
- String str = GLContext.getAvailableGLVersionAsString(device, major, profile);
+ private static void glAvailabilityToString(final AbstractGraphicsDevice device, final StringBuilder sb, final int major, final int profile) {
+ final String str = GLContext.getAvailableGLVersionAsString(device, major, profile);
if(null==str) {
throw new GLException("Internal Error");
}
@@ -1939,7 +1939,7 @@ public class GLProfile {
sb.append("]");
}
- private static boolean computeProfileMap(AbstractGraphicsDevice device, boolean desktopCtxUndef, boolean esCtxUndef) {
+ private static boolean computeProfileMap(final AbstractGraphicsDevice device, final boolean desktopCtxUndef, final boolean esCtxUndef) {
if (DEBUG) {
System.err.println("GLProfile.init map "+device.getConnection()+", desktopCtxUndef "+desktopCtxUndef+", esCtxUndef "+esCtxUndef);
}
@@ -1994,7 +1994,7 @@ public class GLProfile {
/**
* Returns the profile implementation
*/
- private static String computeProfileImpl(AbstractGraphicsDevice device, String profile, boolean desktopCtxUndef, boolean esCtxUndef, boolean isHardwareRasterizer[]) {
+ private static String computeProfileImpl(final AbstractGraphicsDevice device, final String profile, final boolean desktopCtxUndef, final boolean esCtxUndef, final boolean isHardwareRasterizer[]) {
if (GL2ES1.equals(profile)) {
final boolean es1HardwareRasterizer[] = new boolean[1];
final boolean gles1Available = hasGLES1Impl && ( esCtxUndef || GLContext.isGLES1Available(device, es1HardwareRasterizer) );
@@ -2143,7 +2143,7 @@ public class GLProfile {
* @return the GLProfile HashMap if exists, otherwise null
* @throws GLException if no profile for the given device is available.
*/
- private static HashMap<String /*GLProfile_name*/, GLProfile> getProfileMap(AbstractGraphicsDevice device, boolean throwExceptionOnZeroProfile)
+ private static HashMap<String /*GLProfile_name*/, GLProfile> getProfileMap(AbstractGraphicsDevice device, final boolean throwExceptionOnZeroProfile)
throws GLException
{
initSingleton();
@@ -2175,13 +2175,13 @@ public class GLProfile {
return map;
}
- private static void setProfileMap(AbstractGraphicsDevice device, HashMap<String /*GLProfile_name*/, GLProfile> mappedProfiles) {
+ private static void setProfileMap(final AbstractGraphicsDevice device, final HashMap<String /*GLProfile_name*/, GLProfile> mappedProfiles) {
synchronized ( deviceConn2ProfileMap ) {
deviceConn2ProfileMap.put(device.getUniqueID(), mappedProfiles);
}
}
- private GLProfile(String profile, GLProfile profileImpl, boolean isHardwareRasterizer) {
+ private GLProfile(final String profile, final GLProfile profileImpl, final boolean isHardwareRasterizer) {
this.profile = profile;
this.profileImpl = profileImpl;
this.isHardwareRasterizer = isHardwareRasterizer;
diff --git a/src/jogl/classes/javax/media/opengl/GLUniformData.java b/src/jogl/classes/javax/media/opengl/GLUniformData.java
index fac8b7a1f..67cc4c999 100644
--- a/src/jogl/classes/javax/media/opengl/GLUniformData.java
+++ b/src/jogl/classes/javax/media/opengl/GLUniformData.java
@@ -14,7 +14,7 @@ public class GLUniformData {
* Number of objects is 1
*
*/
- public GLUniformData(String name, int val) {
+ public GLUniformData(final String name, final int val) {
initScalar(name, 1, new Integer(val));
}
@@ -24,7 +24,7 @@ public class GLUniformData {
* Number of objects is 1
*
*/
- public GLUniformData(String name, float val) {
+ public GLUniformData(final String name, final float val) {
initScalar(name, 1, new Float(val));
}
@@ -35,7 +35,7 @@ public class GLUniformData {
*
* @param components number of elements of one object, ie 4 for GL_FLOAT_VEC4,
*/
- public GLUniformData(String name, int components, IntBuffer data) {
+ public GLUniformData(final String name, final int components, final IntBuffer data) {
initBuffer(name, components, data);
}
@@ -46,19 +46,19 @@ public class GLUniformData {
*
* @param components number of elements of one object, ie 4 for GL_FLOAT_VEC4,
*/
- public GLUniformData(String name, int components, FloatBuffer data) {
+ public GLUniformData(final String name, final int components, final FloatBuffer data) {
initBuffer(name, components, data);
}
- private GLUniformData(int components, String name) {
+ private GLUniformData(final int components, final String name) {
initBuffer(name, components, null);
}
- public static GLUniformData creatEmptyVector(String name, int components) {
+ public static GLUniformData creatEmptyVector(final String name, final int components) {
return new GLUniformData(components, name);
}
- public static GLUniformData creatEmptyMatrix(String name, int rows, int columns) {
+ public static GLUniformData creatEmptyMatrix(final String name, final int rows, final int columns) {
return new GLUniformData(name, rows, columns, null);
}
@@ -70,7 +70,7 @@ public class GLUniformData {
* @param rows the matrix rows
* @param column the matrix column
*/
- public GLUniformData(String name, int rows, int columns, FloatBuffer data) {
+ public GLUniformData(final String name, final int rows, final int columns, final FloatBuffer data) {
initBuffer(name, rows, columns, data);
}
@@ -114,7 +114,7 @@ public class GLUniformData {
return toString(null).toString();
}
- private void initBuffer(String name, int rows, int columns, Buffer buffer) {
+ private void initBuffer(final String name, final int rows, final int columns, final Buffer buffer) {
if( 2>rows || rows>4 || 2>columns || columns>4 ) {
throw new GLException("rowsXcolumns must be within [2..4]X[2..4], is: "+rows+"X"+columns);
}
@@ -125,7 +125,7 @@ public class GLUniformData {
this.location=-1;
initBuffer(buffer);
}
- private void initScalar(String name, int components, Object data) {
+ private void initScalar(final String name, final int components, final Object data) {
if( 1>components || components>4 ) {
throw new GLException("components must be within [1..4], is: "+components);
}
@@ -136,7 +136,7 @@ public class GLUniformData {
this.location=-1;
initScalar(data);
}
- private void initBuffer(String name, int components, Buffer buffer) {
+ private void initBuffer(final String name, final int components, final Buffer buffer) {
if( 1>components || components>4 ) {
throw new GLException("components must be within [1..4], is: "+components);
}
@@ -148,7 +148,7 @@ public class GLUniformData {
initBuffer(buffer);
}
- private void initScalar(Object data) {
+ private void initScalar(final Object data) {
if(data instanceof Buffer) {
initBuffer((Buffer)data);
} else if( null != data ) {
@@ -185,7 +185,7 @@ public class GLUniformData {
* Sets the given location of the shader uniform.
* @return the given location
*/
- public int setLocation(int location) { this.location=location; return location; }
+ public int setLocation(final int location) { this.location=location; return location; }
/**
* Retrieves the location of the shader uniform from the linked shader program.
@@ -197,7 +197,7 @@ public class GLUniformData {
* @return &ge;0 denotes a valid uniform location as found and used in the given shader program.
* &lt;0 denotes an invalid location, i.e. not found or used in the given shader program.
*/
- public int setLocation(GL2ES2 gl, int program) {
+ public int setLocation(final GL2ES2 gl, final int program) {
location = gl.glGetUniformLocation(program, name);
return location;
}
diff --git a/src/jogl/classes/javax/media/opengl/Threading.java b/src/jogl/classes/javax/media/opengl/Threading.java
index 7503e9cf7..3ee233303 100644
--- a/src/jogl/classes/javax/media/opengl/Threading.java
+++ b/src/jogl/classes/javax/media/opengl/Threading.java
@@ -168,7 +168,7 @@ public class Threading {
current thread is the OpenGL thread and either execute the
Runnable directly or perform the work inside it.
**/
- public static final void invokeOnOpenGLThread(boolean wait, Runnable r) throws GLException {
+ public static final void invokeOnOpenGLThread(final boolean wait, final Runnable r) throws GLException {
ThreadingImpl.invokeOnOpenGLThread(wait, r);
}
@@ -185,7 +185,7 @@ public class Threading {
* @param lock optional lock object to be tested
* @throws GLException
*/
- public static final void invoke(boolean wait, Runnable r, Object lock) throws GLException {
+ public static final void invoke(final boolean wait, final Runnable r, final Object lock) throws GLException {
if ( isSingleThreaded() && !isOpenGLThread() &&
( null == lock || !Thread.holdsLock(lock) ) ) {
invokeOnOpenGLThread(wait, r);
diff --git a/src/jogl/classes/javax/media/opengl/TraceGL2.java b/src/jogl/classes/javax/media/opengl/TraceGL2.java
index c577332e9..94d391d43 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGL2.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGL2.java
@@ -17,7 +17,7 @@ import java.io.PrintStream;
* </p>
*/
public class TraceGL2 extends TraceGL4bc {
- public TraceGL2(GL2 downstream, PrintStream stream) {
+ public TraceGL2(final GL2 downstream, final PrintStream stream) {
super((GL4bc)downstream, stream);
}
}
diff --git a/src/jogl/classes/javax/media/opengl/TraceGL3.java b/src/jogl/classes/javax/media/opengl/TraceGL3.java
index 5fccf40c7..96e655902 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGL3.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGL3.java
@@ -17,7 +17,7 @@ import java.io.PrintStream;
* </p>
*/
public class TraceGL3 extends TraceGL4bc {
- public TraceGL3(GL3 downstream, PrintStream stream) {
+ public TraceGL3(final GL3 downstream, final PrintStream stream) {
super((GL4bc)downstream, stream);
}
}
diff --git a/src/jogl/classes/javax/media/opengl/TraceGL3bc.java b/src/jogl/classes/javax/media/opengl/TraceGL3bc.java
index 84f537f60..2a8590236 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGL3bc.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGL3bc.java
@@ -17,7 +17,7 @@ import java.io.PrintStream;
* </p>
*/
public class TraceGL3bc extends TraceGL4bc {
- public TraceGL3bc(GL3bc downstream, PrintStream stream) {
+ public TraceGL3bc(final GL3bc downstream, final PrintStream stream) {
super((GL4bc)downstream, stream);
}
}
diff --git a/src/jogl/classes/javax/media/opengl/TraceGL4.java b/src/jogl/classes/javax/media/opengl/TraceGL4.java
index afe2cd9a1..d48f9926a 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGL4.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGL4.java
@@ -17,7 +17,7 @@ import java.io.PrintStream;
* </p>
*/
public class TraceGL4 extends TraceGL4bc {
- public TraceGL4(GL4 downstream, PrintStream stream) {
+ public TraceGL4(final GL4 downstream, final PrintStream stream) {
super((GL4bc)downstream, stream);
}
}
diff --git a/src/jogl/classes/javax/media/opengl/TraceGLES2.java b/src/jogl/classes/javax/media/opengl/TraceGLES2.java
index 4740e2e72..b58f169a7 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGLES2.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGLES2.java
@@ -17,7 +17,7 @@ import java.io.PrintStream;
* </p>
*/
public class TraceGLES2 extends TraceGLES3 {
- public TraceGLES2(GLES2 downstream, PrintStream stream) {
+ public TraceGLES2(final GLES2 downstream, final PrintStream stream) {
super((GLES3)downstream, stream);
}
}
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
index e3a7838e7..9d2d21ce5 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -184,7 +184,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
private volatile boolean isShowing;
private final HierarchyListener hierarchyListener = new HierarchyListener() {
@Override
- public void hierarchyChanged(HierarchyEvent e) {
+ public void hierarchyChanged(final HierarchyEvent e) {
isShowing = GLCanvas.this.isShowing();
}
};
@@ -212,7 +212,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
* @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
* @see GLCanvas#GLCanvas(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser, javax.media.opengl.GLContext, java.awt.GraphicsDevice)
*/
- public GLCanvas(GLCapabilitiesImmutable capsReqUser) throws GLException {
+ public GLCanvas(final GLCapabilitiesImmutable capsReqUser) throws GLException {
this(capsReqUser, null, null, null);
}
@@ -226,7 +226,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
* @deprecated Use {@link #GLCanvas(GLCapabilitiesImmutable)}
* and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}.
*/
- public GLCanvas(GLCapabilitiesImmutable capsReqUser, GLContext shareWith)
+ public GLCanvas(final GLCapabilitiesImmutable capsReqUser, final GLContext shareWith)
throws GLException
{
this(capsReqUser, null, shareWith, null);
@@ -244,9 +244,9 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
is passed for this argument.
* @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
*/
- public GLCanvas(GLCapabilitiesImmutable capsReqUser,
- GLCapabilitiesChooser chooser,
- GraphicsDevice device)
+ public GLCanvas(final GLCapabilitiesImmutable capsReqUser,
+ final GLCapabilitiesChooser chooser,
+ final GraphicsDevice device)
throws GLException
{
this(capsReqUser, chooser, null, device);
@@ -272,8 +272,8 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
* and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}.
*/
public GLCanvas(GLCapabilitiesImmutable capsReqUser,
- GLCapabilitiesChooser chooser,
- GLContext shareWith,
+ final GLCapabilitiesChooser chooser,
+ final GLContext shareWith,
GraphicsDevice device)
throws GLException
{
@@ -297,7 +297,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
if(null==device) {
- GraphicsConfiguration gc = super.getGraphicsConfiguration();
+ final GraphicsConfiguration gc = super.getGraphicsConfiguration();
if(null!=gc) {
device = gc.getDevice();
}
@@ -316,12 +316,12 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void setSharedContext(GLContext sharedContext) throws IllegalStateException {
+ public final void setSharedContext(final GLContext sharedContext) throws IllegalStateException {
helper.setSharedContext(this.context, sharedContext);
}
@Override
- public final void setSharedAutoDrawable(GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
+ public final void setSharedAutoDrawable(final GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
helper.setSharedAutoDrawable(this, sharedAutoDrawable);
}
@@ -331,7 +331,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void setShallUseOffscreenLayer(boolean v) {
+ public void setShallUseOffscreenLayer(final boolean v) {
shallUseOffscreenLayer = v;
}
@@ -410,11 +410,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
* block, both devices should have the same visual list, and the
* same configuration should be selected here.
*/
- AWTGraphicsConfiguration config = chooseGraphicsConfiguration( (GLCapabilitiesImmutable)awtConfig.getChosenCapabilities(),
+ final AWTGraphicsConfiguration config = chooseGraphicsConfiguration( (GLCapabilitiesImmutable)awtConfig.getChosenCapabilities(),
(GLCapabilitiesImmutable)awtConfig.getRequestedCapabilities(),
chooser, gc.getDevice());
final GraphicsConfiguration compatible = (null!=config)?config.getAWTGraphicsConfiguration():null;
- boolean equalCaps = config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities());
+ final boolean equalCaps = config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities());
if(DEBUG) {
System.err.println(getThreadName()+": Info:");
System.err.println("Created Config (n): HAVE GC "+chosen);
@@ -487,7 +487,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
}
- private final void setRealizedImpl(boolean realized) {
+ private final void setRealizedImpl(final boolean realized) {
final RecursiveLock _lock = lock;
_lock.lock();
try {
@@ -514,7 +514,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
};
@Override
- public final void setRealized(boolean realized) {
+ public final void setRealized(final boolean realized) {
// Make sure drawable realization happens on AWT-EDT and only there. Consider the AWTTree lock!
AWTEDTExecutor.singleton.invoke(getTreeLock(), false /* allowOnNonEDT */, true /* wait */, realized ? realizeOnEDTAction : unrealizeOnEDTAction);
}
@@ -531,7 +531,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+ public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
return awtWindowClosingProtocol.setDefaultCloseOperation(op);
}
@@ -565,7 +565,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
destroyImpl( false );
}
- protected void destroyImpl(boolean destroyJAWTWindowAndAWTDevice) {
+ protected void destroyImpl(final boolean destroyJAWTWindowAndAWTDevice) {
Threading.invoke(true, destroyOnEDTAction, getTreeLock());
if( destroyJAWTWindowAndAWTDevice ) {
AWTEDTExecutor.singleton.invoke(getTreeLock(), true /* allowOnNonEDT */, true /* wait */, disposeJAWTWindowAndAWTDeviceOnEDT);
@@ -578,21 +578,21 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
properly.
*/
@Override
- public void paint(Graphics g) {
+ public void paint(final Graphics g) {
if( Beans.isDesignTime() ) {
// Make GLCanvas behave better in NetBeans GUI builder
g.setColor(Color.BLACK);
g.fillRect(0, 0, getWidth(), getHeight());
- FontMetrics fm = g.getFontMetrics();
+ final FontMetrics fm = g.getFontMetrics();
String name = getName();
if (name == null) {
name = getClass().getName();
- int idx = name.lastIndexOf('.');
+ final int idx = name.lastIndexOf('.');
if (idx >= 0) {
name = name.substring(idx + 1);
}
}
- Rectangle2D bounds = fm.getStringBounds(name, g);
+ final Rectangle2D bounds = fm.getStringBounds(name, g);
g.setColor(Color.WHITE);
g.drawString(name,
(int) ((getWidth() - bounds.getWidth()) / 2),
@@ -801,7 +801,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
<DL><DD><CODE>reshape</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
@SuppressWarnings("deprecation")
@Override
- public void reshape(int x, int y, int width, int height) {
+ public void reshape(final int x, final int y, final int width, final int height) {
synchronized (getTreeLock()) { // super.reshape(..) claims tree lock, so we do extend it's lock over reshape
super.reshape(x, y, width, height);
reshapeImpl(width, height);
@@ -845,7 +845,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
* canvas from interfering with the OpenGL rendering.
*/
@Override
- public void update(Graphics g) {
+ public void update(final Graphics g) {
paint(g);
}
@@ -855,7 +855,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
private AWTTilePainter printAWTTiles = null;
@Override
- public void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
+ public void setupPrint(final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight) {
printActive = true;
final int componentCount = isOpaque() ? 3 : 4;
final TileRenderer printRenderer = new TileRenderer();
@@ -960,7 +960,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
};
@Override
- public void print(Graphics graphics) {
+ public void print(final Graphics graphics) {
if( !printActive || null == printGLAD ) {
throw new IllegalStateException("setupPrint() not called");
}
@@ -994,7 +994,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
printAWTTiles.resetGraphics2D();
}
}
- } catch (NoninvertibleTransformException nte) {
+ } catch (final NoninvertibleTransformException nte) {
System.err.println("Caught: Inversion failed of: "+g2d.getTransform());
nte.printStackTrace();
}
@@ -1004,12 +1004,12 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void addGLEventListener(GLEventListener listener) {
+ public void addGLEventListener(final GLEventListener listener) {
helper.addGLEventListener(listener);
}
@Override
- public void addGLEventListener(int index, GLEventListener listener) throws IndexOutOfBoundsException {
+ public void addGLEventListener(final int index, final GLEventListener listener) throws IndexOutOfBoundsException {
helper.addGLEventListener(index, listener);
}
@@ -1019,7 +1019,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
+ public GLEventListener getGLEventListener(final int index) throws IndexOutOfBoundsException {
return helper.getGLEventListener(index);
}
@@ -1029,29 +1029,29 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public boolean getGLEventListenerInitState(GLEventListener listener) {
+ public boolean getGLEventListenerInitState(final GLEventListener listener) {
return helper.getGLEventListenerInitState(listener);
}
@Override
- public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
+ public void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized) {
helper.setGLEventListenerInitState(listener, initialized);
}
@Override
- public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
+ public GLEventListener disposeGLEventListener(final GLEventListener listener, final boolean remove) {
final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
Threading.invoke(true, r, getTreeLock());
return r.listener;
}
@Override
- public GLEventListener removeGLEventListener(GLEventListener listener) {
+ public GLEventListener removeGLEventListener(final GLEventListener listener) {
return helper.removeGLEventListener(listener);
}
@Override
- public void setAnimator(GLAnimatorControl animatorControl) {
+ public void setAnimator(final GLAnimatorControl animatorControl) {
helper.setAnimator(animatorControl);
}
@@ -1061,7 +1061,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final Thread setExclusiveContextThread(Thread t) throws GLException {
+ public final Thread setExclusiveContextThread(final Thread t) throws GLException {
return helper.setExclusiveContextThread(t, context);
}
@@ -1071,7 +1071,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public boolean invoke(boolean wait, GLRunnable glRunnable) {
+ public boolean invoke(final boolean wait, final GLRunnable glRunnable) {
return helper.invoke(this, wait, glRunnable);
}
@@ -1081,7 +1081,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
+ public GLContext setContext(final GLContext newCtx, final boolean destroyPrevCtx) {
final RecursiveLock _lock = lock;
_lock.lock();
try {
@@ -1114,7 +1114,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GL setGL(GL gl) {
+ public GL setGL(final GL gl) {
final GLContext _context = context;
if (_context != null) {
_context.setGL(gl);
@@ -1125,7 +1125,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
@Override
- public void setAutoSwapBufferMode(boolean onOrOff) {
+ public void setAutoSwapBufferMode(final boolean onOrOff) {
helper.setAutoSwapBufferMode(onOrOff);
}
@@ -1140,7 +1140,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void setContextCreationFlags(int flags) {
+ public void setContextCreationFlags(final int flags) {
additionalCtxCreationFlags = flags;
final GLContext _context = context;
if(null != _context) {
@@ -1263,7 +1263,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
if(DEBUG) {
System.err.println(getThreadName()+": destroyOnEDTAction() - post ctx: "+context);
}
- } catch (GLException gle) {
+ } catch (final GLException gle) {
gle.printStackTrace();
}
}
@@ -1327,7 +1327,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
} else {
adeviceMsg = null;
}
- boolean closed = adevice.close();
+ final boolean closed = adevice.close();
if(DEBUG) {
System.err.println(getThreadName()+": GLCanvas.disposeJAWTWindowAndAWTDeviceOnEDT(): post GraphicsDevice: "+adeviceMsg+", result: "+closed);
}
@@ -1393,7 +1393,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
private class DisposeGLEventListenerAction implements Runnable {
GLEventListener listener;
private final boolean remove;
- private DisposeGLEventListenerAction(GLEventListener listener, boolean remove) {
+ private DisposeGLEventListenerAction(final GLEventListener listener, final boolean remove) {
this.listener = listener;
this.remove = remove;
}
@@ -1431,16 +1431,16 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
clazz.getDeclaredMethod("disableBackgroundErase",
new Class[] { Canvas.class });
disableBackgroundEraseMethod.setAccessible(true);
- } catch (Exception e) {
+ } catch (final Exception e) {
clazz = clazz.getSuperclass();
}
}
- } catch (Exception e) {
+ } catch (final Exception e) {
}
return null;
}
});
- } catch (Exception e) {
+ } catch (final Exception e) {
}
disableBackgroundEraseInitialized = true;
if(DEBUG) {
@@ -1452,7 +1452,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
Throwable t=null;
try {
disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this });
- } catch (Exception e) {
+ } catch (final Exception e) {
t = e;
}
if(DEBUG) {
@@ -1498,7 +1498,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
EventQueue.invokeAndWait(new Runnable() {
@Override
public void run() {
- AWTGraphicsConfiguration c = (AWTGraphicsConfiguration)
+ final AWTGraphicsConfiguration c = (AWTGraphicsConfiguration)
GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class, GLCapabilitiesImmutable.class).chooseGraphicsConfiguration(capsChosen,
capsRequested,
chooser, aScreen, VisualIDHolder.VID_UNDEFINED);
@@ -1506,9 +1506,9 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
});
config = ( bucket.size() > 0 ) ? bucket.get(0) : null ;
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
throw new GLException(e);
}
}
@@ -1525,7 +1525,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
/**
* A most simple JOGL AWT test entry
*/
- public static void main(String args[]) {
+ public static void main(final String args[]) {
System.err.println(VersionUtil.getPlatformInfo());
System.err.println(GlueGenVersion.getInstance());
// System.err.println(NativeWindowVersion.getInstance());
@@ -1542,16 +1542,16 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
glCanvas.addGLEventListener(new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
+ public void init(final GLAutoDrawable drawable) {
+ final GL gl = drawable.getGL();
System.err.println(JoglVersion.getGLInfo(gl, null));
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
@Override
- public void display(GLAutoDrawable drawable) { }
+ public void display(final GLAutoDrawable drawable) { }
@Override
- public void dispose(GLAutoDrawable drawable) { }
+ public void dispose(final GLAutoDrawable drawable) { }
});
try {
@@ -1560,7 +1560,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
public void run() {
frame.setVisible(true);
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
}
glCanvas.display();
@@ -1570,7 +1570,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
public void run() {
frame.dispose();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
}
}
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index 558970df6..eca99c6c0 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -96,6 +96,7 @@ import jogamp.opengl.awt.AWTTilePainter;
import jogamp.opengl.awt.Java2D;
import jogamp.opengl.util.glsl.GLSLTextureRaster;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.awt.AWTEDTExecutor;
import com.jogamp.nativewindow.awt.AWTPrintLifecycle;
import com.jogamp.nativewindow.awt.AWTWindowClosingProtocol;
@@ -190,11 +191,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
static {
Debug.initSingleton();
DEBUG = Debug.debug("GLJPanel");
- DEBUG_VIEWPORT = Debug.isPropertyDefined("jogl.debug.GLJPanel.Viewport", true);
- USE_GLSL_TEXTURE_RASTERIZER = !Debug.isPropertyDefined("jogl.gljpanel.noglsl", true);
- SKIP_VERTICAL_FLIP_DEFAULT = Debug.isPropertyDefined("jogl.gljpanel.noverticalflip", true);
- boolean enabled = Debug.getBooleanProperty("sun.java2d.opengl", false);
- java2dOGLEnabledByProp = enabled && !Debug.isPropertyDefined("jogl.gljpanel.noogl", true);
+ DEBUG_VIEWPORT = PropertyAccess.isPropertyDefined("jogl.debug.GLJPanel.Viewport", true);
+ USE_GLSL_TEXTURE_RASTERIZER = !PropertyAccess.isPropertyDefined("jogl.gljpanel.noglsl", true);
+ SKIP_VERTICAL_FLIP_DEFAULT = PropertyAccess.isPropertyDefined("jogl.gljpanel.noverticalflip", true);
+ boolean enabled = PropertyAccess.getBooleanProperty("sun.java2d.opengl", false);
+ java2dOGLEnabledByProp = enabled && !PropertyAccess.isPropertyDefined("jogl.gljpanel.noogl", true);
enabled = false;
if( java2dOGLEnabledByProp ) {
@@ -281,7 +282,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
private volatile boolean isShowing;
private final HierarchyListener hierarchyListener = new HierarchyListener() {
@Override
- public void hierarchyChanged(HierarchyEvent e) {
+ public void hierarchyChanged(final HierarchyEvent e) {
isShowing = GLJPanel.this.isShowing();
}
};
@@ -308,7 +309,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
selection mechanism.
* @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
*/
- public GLJPanel(GLCapabilitiesImmutable userCapsRequest) throws GLException {
+ public GLJPanel(final GLCapabilitiesImmutable userCapsRequest) throws GLException {
this(userCapsRequest, null, null);
}
@@ -320,7 +321,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
is used if null is passed for this argument.
* @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
*/
- public GLJPanel(GLCapabilitiesImmutable userCapsRequest, GLCapabilitiesChooser chooser)
+ public GLJPanel(final GLCapabilitiesImmutable userCapsRequest, final GLCapabilitiesChooser chooser)
throws GLException
{
this(userCapsRequest, chooser, null);
@@ -343,7 +344,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
* @deprecated Use {@link #GLJPanel(GLCapabilitiesImmutable, GLCapabilitiesChooser)}
* and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}.
*/
- public GLJPanel(GLCapabilitiesImmutable userCapsRequest, GLCapabilitiesChooser chooser, GLContext shareWith)
+ public GLJPanel(final GLCapabilitiesImmutable userCapsRequest, final GLCapabilitiesChooser chooser, final GLContext shareWith)
throws GLException
{
super();
@@ -393,7 +394,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
* <p>
* @param offthread
*/
- public final boolean initializeBackend(boolean offthread) {
+ public final boolean initializeBackend(final boolean offthread) {
if( offthread ) {
new Thread(getThreadName()+"-GLJPanel_Init") {
public void run() {
@@ -412,12 +413,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void setSharedContext(GLContext sharedContext) throws IllegalStateException {
+ public final void setSharedContext(final GLContext sharedContext) throws IllegalStateException {
helper.setSharedContext(this.getContext(), sharedContext);
}
@Override
- public final void setSharedAutoDrawable(GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
+ public final void setSharedAutoDrawable(final GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
helper.setSharedAutoDrawable(this, sharedAutoDrawable);
}
@@ -428,7 +429,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
* @throws IllegalArgumentException if <code>custom</code> is <code>null</code>
* @throws IllegalStateException if backend is already realized, i.e. this instanced already painted once.
*/
- public void setPixelBufferProvider(AWTGLPixelBufferProvider custom) throws IllegalArgumentException, IllegalStateException {
+ public void setPixelBufferProvider(final AWTGLPixelBufferProvider custom) throws IllegalArgumentException, IllegalStateException {
if( null == custom ) {
throw new IllegalArgumentException("Null PixelBufferProvider");
}
@@ -454,7 +455,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// so do everything on the event dispatch thread
try {
EventQueue.invokeAndWait(paintImmediatelyAction);
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new GLException(e);
}
}
@@ -469,7 +470,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if (backend != null && backend.getContext() != null) {
boolean animatorPaused = false;
- GLAnimatorControl animator = getAnimator();
+ final GLAnimatorControl animator = getAnimator();
if(null!=animator) {
animatorPaused = animator.pause();
}
@@ -517,16 +518,16 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// Make GLJPanel behave better in NetBeans GUI builder
g.setColor(Color.BLACK);
g.fillRect(0, 0, getWidth(), getHeight());
- FontMetrics fm = g.getFontMetrics();
+ final FontMetrics fm = g.getFontMetrics();
String name = getName();
if (name == null) {
name = getClass().getName();
- int idx = name.lastIndexOf('.');
+ final int idx = name.lastIndexOf('.');
if (idx >= 0) {
name = name.substring(idx + 1);
}
}
- Rectangle2D bounds = fm.getStringBounds(name, g);
+ final Rectangle2D bounds = fm.getStringBounds(name, g);
g.setColor(Color.WHITE);
g.drawString(name,
(int) ((getWidth() - bounds.getWidth()) / 2),
@@ -647,7 +648,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
*/
@SuppressWarnings("deprecation")
@Override
- public void reshape(int x, int y, int width, int height) {
+ public void reshape(final int x, final int y, final int width, final int height) {
super.reshape(x, y, width, height);
reshapeImpl(width, height);
}
@@ -675,7 +676,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
private AWTTilePainter printAWTTiles = null;
@Override
- public void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
+ public void setupPrint(final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight) {
printActive = true;
final int componentCount = isOpaque() ? 3 : 4;
final TileRenderer printRenderer = new TileRenderer();
@@ -802,7 +803,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
};
@Override
- public void print(Graphics graphics) {
+ public void print(final Graphics graphics) {
if( !printActive ) {
throw new IllegalStateException("setupPrint() not called");
}
@@ -837,7 +838,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
printAWTTiles.resetGraphics2D();
}
}
- } catch (NoninvertibleTransformException nte) {
+ } catch (final NoninvertibleTransformException nte) {
System.err.println("Caught: Inversion failed of: "+g2d.getTransform());
nte.printStackTrace();
}
@@ -846,7 +847,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
}
@Override
- protected void printComponent(Graphics g) {
+ protected void printComponent(final Graphics g) {
if( DEBUG ) {
System.err.println("AWT printComponent.X: "+printAWTTiles);
}
@@ -854,7 +855,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void setOpaque(boolean opaque) {
+ public void setOpaque(final boolean opaque) {
if (backend != null) {
backend.setOpaque(opaque);
}
@@ -862,12 +863,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void addGLEventListener(GLEventListener listener) {
+ public void addGLEventListener(final GLEventListener listener) {
helper.addGLEventListener(listener);
}
@Override
- public void addGLEventListener(int index, GLEventListener listener) {
+ public void addGLEventListener(final int index, final GLEventListener listener) {
helper.addGLEventListener(index, listener);
}
@@ -877,7 +878,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
+ public GLEventListener getGLEventListener(final int index) throws IndexOutOfBoundsException {
return helper.getGLEventListener(index);
}
@@ -887,17 +888,17 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public boolean getGLEventListenerInitState(GLEventListener listener) {
+ public boolean getGLEventListenerInitState(final GLEventListener listener) {
return helper.getGLEventListenerInitState(listener);
}
@Override
- public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
+ public void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized) {
helper.setGLEventListenerInitState(listener, initialized);
}
@Override
- public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
+ public GLEventListener disposeGLEventListener(final GLEventListener listener, final boolean remove) {
final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
if (EventQueue.isDispatchThread()) {
r.run();
@@ -906,7 +907,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// so do everything on the event dispatch thread
try {
EventQueue.invokeAndWait(r);
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new GLException(e);
}
}
@@ -914,12 +915,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GLEventListener removeGLEventListener(GLEventListener listener) {
+ public GLEventListener removeGLEventListener(final GLEventListener listener) {
return helper.removeGLEventListener(listener);
}
@Override
- public void setAnimator(GLAnimatorControl animatorControl) {
+ public void setAnimator(final GLAnimatorControl animatorControl) {
helper.setAnimator(animatorControl);
}
@@ -929,7 +930,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final Thread setExclusiveContextThread(Thread t) throws GLException {
+ public final Thread setExclusiveContextThread(final Thread t) throws GLException {
return helper.setExclusiveContextThread(t, getContext());
}
@@ -939,7 +940,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public boolean invoke(boolean wait, GLRunnable glRunnable) {
+ public boolean invoke(final boolean wait, final GLRunnable glRunnable) {
return helper.invoke(this, wait, glRunnable);
}
@@ -949,7 +950,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
final Backend b = backend;
if ( null == b ) {
return null;
@@ -958,7 +959,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void setRealized(boolean realized) {
+ public void setRealized(final boolean realized) {
}
@Override
@@ -967,7 +968,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
+ public GLContext setContext(final GLContext newCtx, final boolean destroyPrevCtx) {
final Backend b = backend;
if ( null == b ) {
return null;
@@ -1002,13 +1003,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if (Beans.isDesignTime()) {
return null;
}
- GLContext context = getContext();
+ final GLContext context = getContext();
return (context == null) ? null : context.getGL();
}
@Override
- public GL setGL(GL gl) {
- GLContext context = getContext();
+ public GL setGL(final GL gl) {
+ final GLContext context = getContext();
if (context != null) {
context.setGL(gl);
return gl;
@@ -1017,7 +1018,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void setAutoSwapBufferMode(boolean enable) {
+ public void setAutoSwapBufferMode(final boolean enable) {
this.autoSwapBufferMode = enable;
boolean backendHandlesSwapBuffer = false;
if( isInitialized ) {
@@ -1047,7 +1048,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void setContextCreationFlags(int flags) {
+ public void setContextCreationFlags(final int flags) {
additionalCtxCreationFlags = flags;
}
@@ -1111,7 +1112,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
* See constraints of {@link #isGLOriented()}.
* </p>
*/
- public final void setSkipGLOrientationVerticalFlip(boolean v) {
+ public final void setSkipGLOrientationVerticalFlip(final boolean v) {
skipGLOrientationVerticalFlip = v;
}
/** See {@link #setSkipGLOrientationVerticalFlip(boolean)}. */
@@ -1186,7 +1187,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
* @param v requested texture unit
* @see #getTextureUnit()
*/
- public final void setTextureUnit(int v) {
+ public final void setTextureUnit(final int v) {
requestedTextureUnit = v;
}
@@ -1244,7 +1245,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+ public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
return awtWindowClosingProtocol.setDefaultCloseOperation(op);
}
@@ -1265,12 +1266,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
class Updater implements GLEventListener {
private Graphics g;
- public void setGraphics(Graphics g) {
+ public void setGraphics(final Graphics g) {
this.g = g;
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
if (!backend.preGL(g)) {
return;
}
@@ -1279,12 +1280,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
helper.disposeAllGLEventListener(GLJPanel.this, false);
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
if (!backend.preGL(g)) {
return;
}
@@ -1300,12 +1301,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
backend.postGL(g, true);
}
- public void plainPaint(GLAutoDrawable drawable) {
+ public void plainPaint(final GLAutoDrawable drawable) {
helper.display(GLJPanel.this);
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
// This is handled above and dispatched directly to the appropriate context
}
}
@@ -1329,7 +1330,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// so we can continue with the destruction.
try {
helper.disposeGL(GLJPanel.this, _context, !backendDestroy);
- } catch (GLException gle) {
+ } catch (final GLException gle) {
gle.printStackTrace();
}
}
@@ -1373,7 +1374,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
private class DisposeGLEventListenerAction implements Runnable {
GLEventListener listener;
private final boolean remove;
- private DisposeGLEventListenerAction(GLEventListener listener, boolean remove) {
+ private DisposeGLEventListenerAction(final GLEventListener listener, final boolean remove) {
this.listener = listener;
this.remove = remove;
}
@@ -1387,8 +1388,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
};
- private int getGLInteger(GL gl, int which) {
- int[] tmp = new int[1];
+ private int getGLInteger(final GL gl, final int which) {
+ final int[] tmp = new int[1];
gl.glGetIntegerv(which, tmp, 0);
return tmp[0];
}
@@ -1507,7 +1508,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// For saving/restoring of OpenGL state during ReadPixels
private final GLPixelStorageModes psm = new GLPixelStorageModes();
- OffscreenBackend(GLProfile glp, AWTGLPixelBufferProvider custom) {
+ OffscreenBackend(final GLProfile glp, final AWTGLPixelBufferProvider custom) {
if(null == custom) {
pixelBufferProvider = getSingleAWTGLPixelBufferProvider();
} else {
@@ -1543,7 +1544,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if( DEBUG ) {
offscreenDrawable.getNativeSurface().addSurfaceUpdatedListener(new SurfaceUpdatedListener() {
@Override
- public final void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+ public final void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
System.err.println(getThreadName()+": OffscreenBackend.swapBuffers - frameCount "+frameCount);
} } );
}
@@ -1577,7 +1578,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
glslTextureRaster = new GLSLTextureRaster(fboDrawable.getTextureUnit(), true);
glslTextureRaster.init(gl.getGL2ES2());
glslTextureRaster.reshape(gl.getGL2ES2(), 0, 0, fboDrawable.getSurfaceWidth(), fboDrawable.getSurfaceHeight());
- } catch (Exception ex) {
+ } catch (final Exception ex) {
ex.printStackTrace();
if(null != glslTextureRaster) {
glslTextureRaster.dispose(gl.getGL2ES2());
@@ -1659,7 +1660,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void setOpaque(boolean opaque) {
+ public final void setOpaque(final boolean opaque) {
if ( opaque != isOpaque() && !useSingletonBuffer ) {
pixelBuffer.dispose();
pixelBuffer = null;
@@ -1668,7 +1669,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final boolean preGL(Graphics g) {
+ public final boolean preGL(final Graphics g) {
// Empty in this implementation
return true;
}
@@ -1687,7 +1688,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void postGL(Graphics g, boolean isDisplay) {
+ public final void postGL(final Graphics g, final boolean isDisplay) {
if (isDisplay) {
if(DEBUG) {
System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL.0: - frameCount "+frameCount);
@@ -1871,7 +1872,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void doPaintComponent(Graphics g) {
+ public final void doPaintComponent(final Graphics g) {
helper.invokeGL(offscreenDrawable, offscreenContext, updaterDisplayAction, updaterInitAction);
if ( null != alignedImage ) {
@@ -1922,12 +1923,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final GLContext createContext(GLContext shareWith) {
+ public final GLContext createContext(final GLContext shareWith) {
return (null != offscreenDrawable) ? offscreenDrawable.createContext(shareWith) : null;
}
@Override
- public final void setContext(GLContext ctx) {
+ public final void setContext(final GLContext ctx) {
offscreenContext=(GLContextImpl)ctx;
}
@@ -2041,12 +2042,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void setOpaque(boolean opaque) {
+ public final void setOpaque(final boolean opaque) {
// Empty in this implementation
}
@Override
- public final GLContext createContext(GLContext shareWith) {
+ public final GLContext createContext(final GLContext shareWith) {
if(null != shareWith) {
throw new GLException("J2DOGLBackend cannot create context w/ additional shared context, since it already needs to share the context w/ J2D.");
}
@@ -2054,7 +2055,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void setContext(GLContext ctx) {
+ public final void setContext(final GLContext ctx) {
joglContext=ctx;
}
@@ -2090,11 +2091,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final boolean preGL(Graphics g) {
+ public final boolean preGL(final Graphics g) {
final GL2 gl = joglContext.getGL().getGL2();
// Set up needed state in JOGL context from Java2D context
- gl.glEnable(GL2.GL_SCISSOR_TEST);
- Rectangle r = Java2D.getOGLScissorBox(g);
+ gl.glEnable(GL.GL_SCISSOR_TEST);
+ final Rectangle r = Java2D.getOGLScissorBox(g);
if (r == null) {
if (DEBUG) {
@@ -2107,7 +2108,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
gl.glScissor(r.x, r.y, r.width, r.height);
- Rectangle oglViewport = Java2D.getOGLViewport(g, panelWidth, panelHeight);
+ final Rectangle oglViewport = Java2D.getOGLViewport(g, panelWidth, panelHeight);
// If the viewport X or Y changes, in addition to the panel's
// width or height, we need to send a reshape operation to the
// client
@@ -2132,13 +2133,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// The texture target for Java2D's OpenGL pipeline when using FBOs
// -- either GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB
- int fboTextureTarget = Java2D.getOGLTextureType(g);
+ final int fboTextureTarget = Java2D.getOGLTextureType(g);
if (!checkedForFBObjectWorkarounds) {
checkedForFBObjectWorkarounds = true;
gl.glBindTexture(fboTextureTarget, 0);
- gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, frameBuffer[0]);
- int status = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
+ gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, frameBuffer[0]);
+ final int status = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
if (status != GL.GL_FRAMEBUFFER_COMPLETE) {
// Need to do workarounds
fbObjectWorkarounds = true;
@@ -2168,10 +2169,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
gl.glBindTexture(fboTextureTarget, frameBufferTexture[0]);
- int[] width = new int[1];
- int[] height = new int[1];
- gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2.GL_TEXTURE_WIDTH, width, 0);
- gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2.GL_TEXTURE_HEIGHT, height, 0);
+ final int[] width = new int[1];
+ final int[] height = new int[1];
+ gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2GL3.GL_TEXTURE_WIDTH, width, 0);
+ gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2GL3.GL_TEXTURE_HEIGHT, height, 0);
gl.glGenRenderbuffers(1, frameBufferDepthBuffer, 0);
if (DEBUG) {
@@ -2181,9 +2182,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, frameBufferDepthBuffer[0]);
// FIXME: may need a loop here like in Java2D
- gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, GL2GL3.GL_DEPTH_COMPONENT24, width[0], height[0]);
+ gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, GL.GL_DEPTH_COMPONENT24, width[0], height[0]);
- gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER, 0);
+ gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, 0);
createNewDepthBuffer = false;
}
@@ -2207,7 +2208,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
if (DEBUG) {
- int status = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
+ final int status = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
if (status != GL.GL_FRAMEBUFFER_COMPLETE) {
throw new GLException("Error: framebuffer was incomplete: status = 0x" +
Integer.toHexString(status));
@@ -2240,11 +2241,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final void postGL(Graphics g, boolean isDisplay) {
+ public final void postGL(final Graphics g, final boolean isDisplay) {
// Cause OpenGL pipeline to flush its results because
// otherwise it's possible we will buffer up multiple frames'
// rendering results, resulting in apparent mouse lag
- GL gl = joglContext.getGL();
+ final GL gl = joglContext.getGL();
gl.glFinish();
if (Java2D.isFBOEnabled() &&
@@ -2308,7 +2309,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// FIXME: add more checks?
j2dContext.makeCurrent();
- GL gl = j2dContext.getGL();
+ final GL gl = j2dContext.getGL();
if ((getGLInteger(gl, GL.GL_RED_BITS) < offscreenCaps.getRedBits()) ||
(getGLInteger(gl, GL.GL_GREEN_BITS) < offscreenCaps.getGreenBits()) ||
(getGLInteger(gl, GL.GL_BLUE_BITS) < offscreenCaps.getBlueBits()) ||
@@ -2346,7 +2347,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
try {
captureJ2DState(j2dContext.getGL(), g);
- Object curSurface = Java2D.getOGLSurfaceIdentifier(g);
+ final Object curSurface = Java2D.getOGLSurfaceIdentifier(g);
if (curSurface != null) {
if (j2dSurface != curSurface) {
if (joglContext != null) {
@@ -2362,7 +2363,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
j2dSurface = curSurface;
if (DEBUG) {
System.err.print(getThreadName()+": Surface type: ");
- int surfaceType = Java2D.getOGLSurfaceType(g);
+ final int surfaceType = Java2D.getOGLSurfaceType(g);
if (surfaceType == Java2D.UNDEFINED) {
System.err.println("UNDEFINED");
} else if (surfaceType == Java2D.WINDOW) {
@@ -2381,7 +2382,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
}
}
if (joglContext == null) {
- AbstractGraphicsDevice device = j2dContext.getGLDrawable().getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
+ final AbstractGraphicsDevice device = j2dContext.getGLDrawable().getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
if (factory.canCreateExternalGLDrawable(device)) {
joglDrawable = factory.createExternalGLDrawable();
joglContext = joglDrawable.createContext(j2dContext);
@@ -2410,9 +2411,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
helper.invokeGL(joglDrawable, joglContext, updaterPlainDisplayAction, updaterInitAction);
}
- private final void captureJ2DState(GL gl, Graphics g) {
- gl.glGetIntegerv(GL2.GL_DRAW_BUFFER, drawBuffer, 0);
- gl.glGetIntegerv(GL2.GL_READ_BUFFER, readBuffer, 0);
+ private final void captureJ2DState(final GL gl, final Graphics g) {
+ gl.glGetIntegerv(GL2GL3.GL_DRAW_BUFFER, drawBuffer, 0);
+ gl.glGetIntegerv(GL2ES3.GL_READ_BUFFER, readBuffer, 0);
if (Java2D.isFBOEnabled() &&
Java2D.getOGLSurfaceType(g) == Java2D.FBOBJECT) {
gl.glGetIntegerv(GL.GL_FRAMEBUFFER_BINDING, frameBuffer, 0);
@@ -2446,7 +2447,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
if (!checkedGLVendor) {
checkedGLVendor = true;
- String vendor = gl.glGetString(GL.GL_VENDOR);
+ final String vendor = gl.glGetString(GL.GL_VENDOR);
if ((vendor != null) &&
vendor.startsWith("ATI")) {
diff --git a/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java
index 9bd644223..3264062e8 100644
--- a/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java
+++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java
@@ -39,7 +39,7 @@ public class GLPointerFuncUtil {
* @param glArrayIndex the fixed function array index
* @return default fixed function array name
*/
- public static String getPredefinedArrayIndexName(int glArrayIndex) {
+ public static String getPredefinedArrayIndexName(final int glArrayIndex) {
return getPredefinedArrayIndexName(glArrayIndex, -1);
}
@@ -48,7 +48,7 @@ public class GLPointerFuncUtil {
* @param multiTexCoordIndex index for multiTexCoordIndex
* @return default fixed function array name
*/
- public static String getPredefinedArrayIndexName(int glArrayIndex, int multiTexCoordIndex) {
+ public static String getPredefinedArrayIndexName(final int glArrayIndex, final int multiTexCoordIndex) {
switch(glArrayIndex) {
case GLPointerFunc.GL_VERTEX_ARRAY:
return mgl_Vertex;
diff --git a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java
index 15a7bb2a1..c293fbe18 100644
--- a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java
+++ b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java
@@ -65,32 +65,32 @@ package javax.media.opengl.glu;
public class GLUtessellatorCallbackAdapter implements GLUtessellatorCallback {
@Override
- public void begin(int type) {}
+ public void begin(final int type) {}
@Override
- public void edgeFlag(boolean boundaryEdge) {}
+ public void edgeFlag(final boolean boundaryEdge) {}
@Override
- public void vertex(Object vertexData) {}
+ public void vertex(final Object vertexData) {}
@Override
public void end() {}
// public void mesh(jogamp.opengl.tessellator.GLUmesh mesh) {}
@Override
- public void error(int errnum) {}
+ public void error(final int errnum) {}
@Override
- public void combine(double[] coords, Object[] data,
- float[] weight, Object[] outData) {}
+ public void combine(final double[] coords, final Object[] data,
+ final float[] weight, final Object[] outData) {}
@Override
- public void beginData(int type, Object polygonData) {}
+ public void beginData(final int type, final Object polygonData) {}
@Override
- public void edgeFlagData(boolean boundaryEdge,
- Object polygonData) {}
+ public void edgeFlagData(final boolean boundaryEdge,
+ final Object polygonData) {}
@Override
- public void vertexData(Object vertexData, Object polygonData) {}
+ public void vertexData(final Object vertexData, final Object polygonData) {}
@Override
- public void endData(Object polygonData) {}
+ public void endData(final Object polygonData) {}
@Override
- public void errorData(int errnum, Object polygonData) {}
+ public void errorData(final int errnum, final Object polygonData) {}
@Override
- public void combineData(double[] coords, Object[] data,
- float[] weight, Object[] outData,
- Object polygonData) {}
+ public void combineData(final double[] coords, final Object[] data,
+ final float[] weight, final Object[] outData,
+ final Object polygonData) {}
}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
index b56a69b28..118c9b136 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
@@ -142,16 +142,16 @@ public class VBORegion2PMSAAES2 extends GLRegion {
final int initialElementCount = 256;
// Pass 1:
- indicesBuffer = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+ indicesBuffer = GLArrayDataServer.createData(3, GL.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
- gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
- gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
if( hasColorChannel() ) {
- gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL2ES2.GL_FLOAT,
+ gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
} else {
gca_ColorsAttr = null;
@@ -173,12 +173,12 @@ public class VBORegion2PMSAAES2 extends GLRegion {
// Pass 2:
gcu_FboTexUnit = new GLUniformData(UniformNames.gcu_FboTexUnit, pass2TexUnit);
- indicesFbo = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, 2, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+ indicesFbo = GLArrayDataServer.createData(3, GL.GL_SHORT, 2, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
indicesFbo.puts((short) 0); indicesFbo.puts((short) 1); indicesFbo.puts((short) 3);
indicesFbo.puts((short) 1); indicesFbo.puts((short) 2); indicesFbo.puts((short) 3);
indicesFbo.seal(true);
- gca_FboTexCoordsAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_TEXCOORDS_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
+ gca_FboTexCoordsAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_TEXCOORDS_ATTR_NAME, 2, GL.GL_FLOAT,
false, 4, GL.GL_STATIC_DRAW);
gca_FboTexCoordsAttr.putf(0); gca_FboTexCoordsAttr.putf(0);
gca_FboTexCoordsAttr.putf(0); gca_FboTexCoordsAttr.putf(1);
@@ -186,7 +186,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
gca_FboTexCoordsAttr.putf(1); gca_FboTexCoordsAttr.putf(0);
gca_FboTexCoordsAttr.seal(true);
- gca_FboVerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_FboVerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
false, 4, GL.GL_STATIC_DRAW);
}
@@ -234,7 +234,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
}
@Override
- protected final void pushIndex(int idx) {
+ protected final void pushIndex(final int idx) {
indicesBuffer.puts((short)idx);
}
@@ -432,7 +432,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
gca_FboTexCoordsAttr.enableBuffer(gl, true);
indicesFbo.bindBuffer(gl, true); // keeps VBO binding
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
indicesFbo.bindBuffer(gl, false);
gca_FboTexCoordsAttr.enableBuffer(gl, false);
@@ -463,7 +463,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
ssink.reset(gl, fboWidth, fboHeight);
// FIXME: shall not use bilinear (GL_LINEAR), due to MSAA ???
// ssink.attachTexture2D(gl, 0, true, GL2ES2.GL_LINEAR, GL2ES2.GL_LINEAR, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
- ssink.attachTexture2D(gl, 0, true, GL2ES2.GL_NEAREST, GL2ES2.GL_NEAREST, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ ssink.attachTexture2D(gl, 0, true, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
if( !blendingEnabled ) {
// no depth-buffer w/ blending
ssink.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
@@ -489,7 +489,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
gl.glViewport(0, 0, fboWidth, fboHeight);
if( blendingEnabled ) {
gl.glClearColor(0f, 0f, 0f, 0.0f);
- gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT); // no depth-buffer w/ blending
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT); // no depth-buffer w/ blending
// For already pre-multiplied alpha values, use:
// gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
@@ -500,7 +500,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
gl.glDisable(GL.GL_DEPTH_TEST);
}
} else {
- gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT | GL2ES2.GL_DEPTH_BUFFER_BIT);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
}
renderRegion(gl);
@@ -526,10 +526,10 @@ public class VBORegion2PMSAAES2 extends GLRegion {
gcu_ColorTexUnit.setData(colorTexSeq.getTextureUnit());
gl.glUniform(gcu_ColorTexUnit); // Always update, since program maybe used by multiple regions
gl.glUniform(gcu_ColorTexBBox); // Always update, since program maybe used by multiple regions
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
tex.disable(gl); // nop on core
} else {
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
}
indicesBuffer.bindBuffer(gl, false);
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
index 861d889c1..8f75e7115 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
@@ -37,6 +37,7 @@ import jogamp.graph.curve.opengl.shader.AttributeNames;
import jogamp.graph.curve.opengl.shader.UniformNames;
import jogamp.opengl.Debug;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.graph.curve.Region;
import com.jogamp.graph.curve.opengl.GLRegion;
import com.jogamp.graph.curve.opengl.RegionRenderer;
@@ -79,7 +80,7 @@ public class VBORegion2PVBAAES2 extends GLRegion {
static {
Debug.initSingleton();
final String key = "jogl.debug.graph.curve.vbaa.resizeLowerBoundary";
- RESIZE_BOUNDARY = Math.max(0, Debug.getIntProperty(key, true, 0));
+ RESIZE_BOUNDARY = Math.max(0, PropertyAccess.getIntProperty(key, true, 0));
if( RESIZE_BOUNDARY > 0 ) {
System.err.println("key: "+RESIZE_BOUNDARY);
}
@@ -178,15 +179,15 @@ public class VBORegion2PVBAAES2 extends GLRegion {
final int initialElementCount = 256;
// Pass 1:
- indicesBuffer = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+ indicesBuffer = GLArrayDataServer.createData(3, GL.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
- gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
- gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
if( hasColorChannel() ) {
- gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL2ES2.GL_FLOAT,
+ gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
} else {
gca_ColorsAttr = null;
@@ -209,12 +210,12 @@ public class VBORegion2PVBAAES2 extends GLRegion {
gcu_FboTexUnit = new GLUniformData(UniformNames.gcu_FboTexUnit, pass2TexUnit);
gcu_FboTexSize = new GLUniformData(UniformNames.gcu_FboTexSize, 2, FloatBuffer.wrap(new float[2]));
- indicesFbo = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, 2, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+ indicesFbo = GLArrayDataServer.createData(3, GL.GL_SHORT, 2, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
indicesFbo.puts((short) 0); indicesFbo.puts((short) 1); indicesFbo.puts((short) 3);
indicesFbo.puts((short) 1); indicesFbo.puts((short) 2); indicesFbo.puts((short) 3);
indicesFbo.seal(true);
- gca_FboTexCoordsAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_TEXCOORDS_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
+ gca_FboTexCoordsAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_TEXCOORDS_ATTR_NAME, 2, GL.GL_FLOAT,
false, 4, GL.GL_STATIC_DRAW);
gca_FboTexCoordsAttr.putf(0); gca_FboTexCoordsAttr.putf(0);
gca_FboTexCoordsAttr.putf(0); gca_FboTexCoordsAttr.putf(1);
@@ -222,7 +223,7 @@ public class VBORegion2PVBAAES2 extends GLRegion {
gca_FboTexCoordsAttr.putf(1); gca_FboTexCoordsAttr.putf(0);
gca_FboTexCoordsAttr.seal(true);
- gca_FboVerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_FboVerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
false, 4, GL.GL_STATIC_DRAW);
}
@@ -274,7 +275,7 @@ public class VBORegion2PVBAAES2 extends GLRegion {
}
@Override
- protected final void pushIndex(int idx) {
+ protected final void pushIndex(final int idx) {
indicesBuffer.puts((short)idx);
}
@@ -549,7 +550,7 @@ public class VBORegion2PVBAAES2 extends GLRegion {
gca_FboTexCoordsAttr.enableBuffer(gl, true);
indicesFbo.bindBuffer(gl, true); // keeps VBO binding
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
indicesFbo.bindBuffer(gl, false);
gca_FboTexCoordsAttr.enableBuffer(gl, false);
@@ -581,7 +582,7 @@ public class VBORegion2PVBAAES2 extends GLRegion {
// Shall not use bilinear (GL_LINEAR), due to own VBAA. Result is smooth w/o it now!
// FIXME: FXAA requires bilinear filtering!
// texA = fbo.attachTexture2D(gl, 0, true, GL2ES2.GL_LINEAR, GL2ES2.GL_LINEAR, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
- texA = fbo.attachTexture2D(gl, 0, true, GL2ES2.GL_NEAREST, GL2ES2.GL_NEAREST, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ texA = fbo.attachTexture2D(gl, 0, true, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
if( !blendingEnabled ) {
// no depth-buffer w/ blending
fbo.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
@@ -610,14 +611,14 @@ public class VBORegion2PVBAAES2 extends GLRegion {
gl.glViewport(0, 0, fboWidth, fboHeight);
if( blendingEnabled ) {
gl.glClearColor(0f, 0f, 0f, 0.0f);
- gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT); // no depth-buffer w/ blending
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT); // no depth-buffer w/ blending
// For already pre-multiplied alpha values, use:
// gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
// Multiply RGB w/ Alpha, preserve alpha for renderFBO(..)
gl.glBlendFuncSeparate(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA, GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
} else {
- gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT | GL2ES2.GL_DEPTH_BUFFER_BIT);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
}
renderRegion(gl);
@@ -644,10 +645,10 @@ public class VBORegion2PVBAAES2 extends GLRegion {
gcu_ColorTexUnit.setData(colorTexSeq.getTextureUnit());
gl.glUniform(gcu_ColorTexUnit); // Always update, since program maybe used by multiple regions
gl.glUniform(gcu_ColorTexBBox); // Always update, since program maybe used by multiple regions
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
tex.disable(gl); // nop on core
} else {
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
}
indicesBuffer.bindBuffer(gl, false);
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
index 8265b014a..46e991866 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
@@ -64,16 +64,16 @@ public class VBORegionSPES2 extends GLRegion {
rsLocal = new RenderState.ProgramLocal();
final int initialElementCount = 256;
- indicesBuffer = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+ indicesBuffer = GLArrayDataServer.createData(3, GL.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
- gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
- gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
+ gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
if( hasColorChannel() ) {
- gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL2ES2.GL_FLOAT,
+ gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL.GL_FLOAT,
false, initialElementCount, GL.GL_STATIC_DRAW);
} else {
gca_ColorsAttr = null;
@@ -135,7 +135,7 @@ public class VBORegionSPES2 extends GLRegion {
}
@Override
- protected final void pushIndex(int idx) {
+ protected final void pushIndex(final int idx) {
indicesBuffer.puts((short)idx);
}
@@ -244,10 +244,10 @@ public class VBORegionSPES2 extends GLRegion {
gcu_ColorTexUnit.setData(colorTexSeq.getTextureUnit());
gl.glUniform(gcu_ColorTexUnit); // Always update, since program maybe used by multiple regions
gl.glUniform(gcu_ColorTexBBox); // Always update, since program maybe used by multiple regions
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
tex.disable(gl); // nop on core
} else {
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
}
indicesBuffer.bindBuffer(gl, false);
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
index d2cfa42a1..4473d040f 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
@@ -100,7 +100,7 @@ public class CDTriangulator2D implements Triangulator {
}
@Override
- public final void generate(List<Triangle> sink) {
+ public final void generate(final List<Triangle> sink) {
final int loopsSize = loops.size();
for(int i=0;i<loopsSize;i++) {
final Loop loop = loops.get(i);
@@ -219,7 +219,7 @@ public class CDTriangulator2D implements Triangulator {
return innerOutline;
}
- private Loop getContainerLoop(Outline polyline) {
+ private Loop getContainerLoop(final Outline polyline) {
final ArrayList<Vertex> vertices = polyline.getVertices();
for(int i=0; i < loops.size(); i++) {
final Loop loop = loops.get(i);
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java b/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
index 2e8d4f58f..81e6efdad 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
@@ -44,9 +44,9 @@ public class GraphOutline {
* the curve pieces can be identified by onCurve flag
* of each cp the control polyline is open by default
*/
- public GraphOutline(Outline ol){
+ public GraphOutline(final Outline ol){
this.outline = ol;
- ArrayList<Vertex> vertices = this.outline.getVertices();
+ final ArrayList<Vertex> vertices = this.outline.getVertices();
for(int i = 0; i< vertices.size(); i++){
this.controlpoints.add(new GraphVertex(vertices.get(i)));
}
@@ -64,7 +64,7 @@ public class GraphOutline {
return outline.getVertices();
}
- public void addVertex(GraphVertex v) {
+ public void addVertex(final GraphVertex v) {
controlpoints.add(v);
outline.addVertex(v.getPoint());
}
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java b/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
index 89ad3edf1..391e71011 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
@@ -36,7 +36,7 @@ public class GraphVertex {
private ArrayList<HEdge> edges = null;
private boolean boundaryContained = false;
- public GraphVertex(Vertex point) {
+ public GraphVertex(final Vertex point) {
this.point = point;
}
@@ -59,7 +59,7 @@ public class GraphVertex {
return point.getCoord();
}
- public void setPoint(Vertex point) {
+ public void setPoint(final Vertex point) {
this.point = point;
}
@@ -67,17 +67,17 @@ public class GraphVertex {
return edges;
}
- public void setEdges(ArrayList<HEdge> edges) {
+ public void setEdges(final ArrayList<HEdge> edges) {
this.edges = edges;
}
- public void addEdge(HEdge edge){
+ public void addEdge(final HEdge edge){
if(edges == null){
edges = new ArrayList<HEdge>();
}
edges.add(edge);
}
- public void removeEdge(HEdge edge){
+ public void removeEdge(final HEdge edge){
if(edges == null)
return;
edges.remove(edge);
@@ -85,9 +85,9 @@ public class GraphVertex {
edges = null;
}
}
- public HEdge findNextEdge(GraphVertex nextVert){
+ public HEdge findNextEdge(final GraphVertex nextVert){
for(int i=0; i<edges.size(); i++) {
- HEdge e = edges.get(i);
+ final HEdge e = edges.get(i);
if(e.getNext().getGraphPoint() == nextVert){
return e;
}
@@ -96,16 +96,16 @@ public class GraphVertex {
}
public HEdge findBoundEdge(){
for(int i=0; i<edges.size(); i++) {
- HEdge e = edges.get(i);
+ final HEdge e = edges.get(i);
if((e.getType() == HEdge.BOUNDARY) || (e.getType() == HEdge.HOLE)){
return e;
}
}
return null;
}
- public HEdge findPrevEdge(GraphVertex prevVert){
+ public HEdge findPrevEdge(final GraphVertex prevVert){
for(int i=0; i<edges.size(); i++) {
- HEdge e = edges.get(i);
+ final HEdge e = edges.get(i);
if(e.getPrev().getGraphPoint() == prevVert){
return e;
}
@@ -117,7 +117,7 @@ public class GraphVertex {
return boundaryContained;
}
- public void setBoundaryContained(boolean boundaryContained) {
+ public void setBoundaryContained(final boolean boundaryContained) {
this.boundaryContained = boundaryContained;
}
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java b/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
index acaa3d708..3bdf54590 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
@@ -43,12 +43,12 @@ public class HEdge {
private int type = BOUNDARY;
private Triangle triangle = null;
- public HEdge(GraphVertex vert, int type) {
+ public HEdge(final GraphVertex vert, final int type) {
this.vert = vert;
this.type = type;
}
- public HEdge(GraphVertex vert, HEdge prev, HEdge next, HEdge sibling, int type) {
+ public HEdge(final GraphVertex vert, final HEdge prev, final HEdge next, final HEdge sibling, final int type) {
this.vert = vert;
this.prev = prev;
this.next = next;
@@ -56,7 +56,7 @@ public class HEdge {
this.type = type;
}
- public HEdge(GraphVertex vert, HEdge prev, HEdge next, HEdge sibling, int type, Triangle triangle) {
+ public HEdge(final GraphVertex vert, final HEdge prev, final HEdge next, final HEdge sibling, final int type, final Triangle triangle) {
this.vert = vert;
this.prev = prev;
this.next = next;
@@ -69,7 +69,7 @@ public class HEdge {
return vert;
}
- public void setVert(GraphVertex vert) {
+ public void setVert(final GraphVertex vert) {
this.vert = vert;
}
@@ -77,7 +77,7 @@ public class HEdge {
return prev;
}
- public void setPrev(HEdge prev) {
+ public void setPrev(final HEdge prev) {
this.prev = prev;
}
@@ -85,7 +85,7 @@ public class HEdge {
return next;
}
- public void setNext(HEdge next) {
+ public void setNext(final HEdge next) {
this.next = next;
}
@@ -93,7 +93,7 @@ public class HEdge {
return sibling;
}
- public void setSibling(HEdge sibling) {
+ public void setSibling(final HEdge sibling) {
this.sibling = sibling;
}
@@ -101,7 +101,7 @@ public class HEdge {
return type;
}
- public void setType(int type) {
+ public void setType(final int type) {
this.type = type;
}
@@ -109,16 +109,16 @@ public class HEdge {
return triangle;
}
- public void setTriangle(Triangle triangle) {
+ public void setTriangle(final Triangle triangle) {
this.triangle = triangle;
}
- public static <T extends Vertex> void connect(HEdge first, HEdge next){
+ public static <T extends Vertex> void connect(final HEdge first, final HEdge next){
first.setNext(next);
next.setPrev(first);
}
- public static <T extends Vertex> void makeSiblings(HEdge first, HEdge second){
+ public static <T extends Vertex> void makeSiblings(final HEdge first, final HEdge second){
first.setSibling(second);
second.setSibling(first);
}
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
index 1f038a930..6563219cc 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
@@ -40,7 +40,7 @@ public class Loop {
private final AABBox box = new AABBox();
private GraphOutline initialOutline = null;
- public Loop(GraphOutline polyline, VectorUtil.Winding winding){
+ public Loop(final GraphOutline polyline, final VectorUtil.Winding winding){
initialOutline = polyline;
this.root = initFromPolyline(initialOutline, winding);
}
@@ -67,7 +67,7 @@ public class Loop {
final GraphVertex v2 = next1.getGraphPoint();
final GraphVertex v3 = next2.getGraphPoint();
- HEdge v3Edge = new HEdge(v3, HEdge.INNER);
+ final HEdge v3Edge = new HEdge(v3, HEdge.INNER);
HEdge.connect(v3Edge, root);
HEdge.connect(next1, v3Edge);
@@ -94,8 +94,8 @@ public class Loop {
* from the boundary profile
* @param reqWinding requested winding of edges (CCW or CW)
*/
- private HEdge initFromPolyline(GraphOutline outline, VectorUtil.Winding reqWinding){
- ArrayList<GraphVertex> vertices = outline.getGraphPoint();
+ private HEdge initFromPolyline(final GraphOutline outline, final VectorUtil.Winding reqWinding){
+ final ArrayList<GraphVertex> vertices = outline.getGraphPoint();
if(vertices.size()<3) {
throw new IllegalArgumentException("outline's vertices < 3: " + vertices.size());
@@ -124,10 +124,10 @@ public class Loop {
}
while(index != max){
- GraphVertex v1 = vertices.get(index);
+ final GraphVertex v1 = vertices.get(index);
box.resize(v1.getX(), v1.getY(), v1.getZ());
- HEdge edge = new HEdge(v1, edgeType);
+ final HEdge edge = new HEdge(v1, edgeType);
v1.addEdge(edge);
if(lastEdge != null) {
@@ -155,15 +155,15 @@ public class Loop {
return firstEdge;
}
- public void addConstraintCurve(GraphOutline polyline) {
+ public void addConstraintCurve(final GraphOutline polyline) {
// GraphOutline outline = new GraphOutline(polyline);
/**needed to generate vertex references.*/
initFromPolyline(polyline, VectorUtil.Winding.CW);
- GraphVertex v3 = locateClosestVertex(polyline);
- HEdge v3Edge = v3.findBoundEdge();
- HEdge v3EdgeP = v3Edge.getPrev();
- HEdge crossEdge = new HEdge(root.getGraphPoint(), HEdge.INNER);
+ final GraphVertex v3 = locateClosestVertex(polyline);
+ final HEdge v3Edge = v3.findBoundEdge();
+ final HEdge v3EdgeP = v3Edge.getPrev();
+ final HEdge crossEdge = new HEdge(root.getGraphPoint(), HEdge.INNER);
HEdge.connect(root.getPrev(), crossEdge);
HEdge.connect(crossEdge, v3Edge);
@@ -184,7 +184,7 @@ public class Loop {
* to search for closestvertices
* @return the vertex that is closest to the newly set root Hedge.
*/
- private GraphVertex locateClosestVertex(GraphOutline polyline) {
+ private GraphVertex locateClosestVertex(final GraphOutline polyline) {
HEdge closestE = null;
GraphVertex closestV = null;
@@ -200,7 +200,7 @@ public class Loop {
final GraphVertex cand = vertices.get(pos);
final float distance = VectorUtil.distVec3(v.getCoord(), cand.getCoord());
if(distance < minDistance){
- for (GraphVertex vert:vertices){
+ for (final GraphVertex vert:vertices){
if(vert == v || vert == nextV || vert == cand)
continue;
inValid = VectorUtil.isInCircleVec2(v.getPoint(), nextV.getPoint(),
@@ -226,19 +226,19 @@ public class Loop {
return closestV;
}
- private HEdge findClosestValidNeighbor(HEdge edge, boolean delaunay) {
- HEdge next = root.getNext();
+ private HEdge findClosestValidNeighbor(final HEdge edge, final boolean delaunay) {
+ final HEdge next = root.getNext();
if(!VectorUtil.ccw(root.getGraphPoint().getPoint(), next.getGraphPoint().getPoint(),
edge.getGraphPoint().getPoint())){
return null;
}
- HEdge candEdge = edge;
+ final HEdge candEdge = edge;
boolean inValid = false;
if(delaunay){
- Vertex cand = candEdge.getGraphPoint().getPoint();
+ final Vertex cand = candEdge.getGraphPoint().getPoint();
HEdge e = candEdge.getNext();
while (e != candEdge){
if(e.getGraphPoint() == root.getGraphPoint()
@@ -269,7 +269,7 @@ public class Loop {
* @param root and edge of this triangle
* @return the triangle iff it satisfies, null otherwise
*/
- private Triangle createTriangle(Vertex v1, Vertex v2, Vertex v3, HEdge rootT){
+ private Triangle createTriangle(final Vertex v1, final Vertex v2, final Vertex v3, final HEdge rootT){
return new Triangle(v1, v2, v3, checkVerticesBoundary(rootT));
}
@@ -287,7 +287,7 @@ public class Loop {
return boundary;
}
- public boolean checkInside(Vertex v) {
+ public boolean checkInside(final Vertex v) {
if(!box.contains(v.getX(), v.getY(), v.getZ())){
return false;
}
@@ -296,8 +296,8 @@ public class Loop {
HEdge current = root;
HEdge next = root.getNext();
do {
- Vertex v2 = current.getGraphPoint().getPoint();
- Vertex v1 = next.getGraphPoint().getPoint();
+ final Vertex v2 = current.getGraphPoint().getPoint();
+ final Vertex v1 = next.getGraphPoint().getPoint();
if ( ((v1.getY() > v.getY()) != (v2.getY() > v.getY())) &&
(v.getX() < (v2.getX() - v1.getX()) * (v.getY() - v1.getY()) / (v2.getY() - v1.getY()) + v1.getX()) ){
diff --git a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
index e3df0af1d..1bb2bb5f3 100644
--- a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
+++ b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
@@ -78,7 +78,7 @@ public class JavaFontLoader implements FontSet {
}
}
- static boolean is(int bits, int bit) {
+ static boolean is(final int bits, final int bit) {
return 0 != ( bits & bit ) ;
}
@@ -88,7 +88,7 @@ public class JavaFontLoader implements FontSet {
}
@Override
- public Font get(int family, int style) throws IOException {
+ public Font get(final int family, final int style) throws IOException {
Font font = (Font)fontMap.get( ( family << 8 ) | style );
if (font != null) {
return font;
@@ -138,7 +138,7 @@ public class JavaFontLoader implements FontSet {
return font;
}
- Font abspath(String fname, int family, int style) throws IOException {
+ Font abspath(final String fname, final int family, final int style) throws IOException {
if(null == javaFontPath) {
throw new GLException("java font path undefined");
}
@@ -151,7 +151,7 @@ public class JavaFontLoader implements FontSet {
return f;
}
throw new IOException (err);
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
throw new IOException(err, ioe);
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
index c7efe143b..76947873e 100644
--- a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
+++ b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
@@ -76,7 +76,7 @@ public class UbuntuFontLoader implements FontSet {
private UbuntuFontLoader() {
}
- static boolean is(int bits, int bit) {
+ static boolean is(final int bits, final int bit) {
return 0 != ( bits & bit ) ;
}
@@ -86,7 +86,7 @@ public class UbuntuFontLoader implements FontSet {
}
@Override
- public Font get(int family, int style) throws IOException {
+ public Font get(final int family, final int style) throws IOException {
Font font = (Font)fontMap.get( ( family << 8 ) | style );
if (font != null) {
return font;
@@ -132,7 +132,7 @@ public class UbuntuFontLoader implements FontSet {
private static boolean attemptedJARLoading = false;
private static boolean useTempJarCache = false;
- private synchronized Font abspath(String fname, int family, int style) throws IOException {
+ private synchronized Font abspath(final String fname, final int family, final int style) throws IOException {
final String err = "Problem loading font "+fname+", stream "+relFontPath+fname;
final Exception[] privErr = { null };
try {
@@ -150,7 +150,7 @@ public class UbuntuFontLoader implements FontSet {
public Object run() {
try {
TempJarCache.addResources(UbuntuFontLoader.class, uri);
- } catch (Exception e) { privErr[0] = e; }
+ } catch (final Exception e) { privErr[0] = e; }
return null;
} } );
if( null == privErr[0] ) {
@@ -162,7 +162,7 @@ public class UbuntuFontLoader implements FontSet {
}
}
}
- } catch(Exception e) {
+ } catch(final Exception e) {
throw new IOException(err, e);
}
if( null != privErr[0] ) {
@@ -182,7 +182,7 @@ public class UbuntuFontLoader implements FontSet {
try {
final URI uri = TempJarCache.getResource(absFontPath+fname);
privConn[0] = null != uri ? uri.toURL().openConnection() : null;
- } catch (Exception e) { privErr[0] = e; }
+ } catch (final Exception e) { privErr[0] = e; }
return null;
} } );
if( null != privErr[0] ) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
index 5fb61387a..c48ef99ca 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
@@ -63,15 +63,15 @@ class TypecastFont implements Font {
// FIXME: Generic attempt to find the best CmapTable,
// which is assumed to be the one with the most entries (stupid 'eh?)
- CmapTable cmapTable = font.getCmapTable();
- CmapFormat[] _cmapFormatP = { null, null, null, null };
+ final CmapTable cmapTable = font.getCmapTable();
+ final CmapFormat[] _cmapFormatP = { null, null, null, null };
int platform = -1;
int platformLength = -1;
int encoding = -1;
for(int i=0; i<cmapTable.getNumTables(); i++) {
- CmapIndexEntry cmapIdxEntry = cmapTable.getCmapIndexEntry(i);
- int pidx = cmapIdxEntry.getPlatformId();
- CmapFormat cf = cmapIdxEntry.getFormat();
+ final CmapIndexEntry cmapIdxEntry = cmapTable.getCmapIndexEntry(i);
+ final int pidx = cmapIdxEntry.getPlatformId();
+ final CmapFormat cf = cmapIdxEntry.getFormat();
if(DEBUG) {
System.err.println("CmapFormat["+i+"]: platform " + pidx +
", encoding "+cmapIdxEntry.getEncodingId() + ": "+cf);
@@ -123,7 +123,7 @@ class TypecastFont implements Font {
{
int _cmapentries = 0;
for (int i = 0; i < cmapFormat.getRangeCount(); ++i) {
- CmapFormat.Range range = cmapFormat.getRange(i);
+ final CmapFormat.Range range = cmapFormat.getRange(i);
_cmapentries += range.getEndCode() - range.getStartCode() + 1; // end included
}
cmapentries = _cmapentries;
@@ -135,7 +135,7 @@ class TypecastFont implements Font {
System.err.println("num cmap ranges: "+cmapFormat.getRangeCount());
for (int i = 0; i < cmapFormat.getRangeCount(); ++i) {
- CmapFormat.Range range = cmapFormat.getRange(i);
+ final CmapFormat.Range range = cmapFormat.getRange(i);
for (int j = range.getStartCode(); j <= range.getEndCode(); ++j) {
final int code = cmapFormat.mapCharCode(j);
if(code < 15) {
@@ -149,15 +149,15 @@ class TypecastFont implements Font {
}
@Override
- public StringBuilder getName(StringBuilder sb, int nameIndex) {
+ public StringBuilder getName(final StringBuilder sb, final int nameIndex) {
return font.getName(nameIndex, sb);
}
@Override
- public String getName(int nameIndex) {
+ public String getName(final int nameIndex) {
return getName(null, nameIndex).toString();
}
@Override
- public StringBuilder getAllNames(StringBuilder sb, String separator) {
+ public StringBuilder getAllNames(final StringBuilder sb, final String separator) {
return font.getAllNames(sb, separator);
}
@Override
@@ -168,7 +168,7 @@ class TypecastFont implements Font {
}
@Override
- public float getAdvanceWidth(int glyphID, float pixelSize) {
+ public float getAdvanceWidth(final int glyphID, final float pixelSize) {
return font.getHmtxTable().getAdvanceWidth(glyphID) * metrics.getScale(pixelSize);
}
@@ -178,7 +178,7 @@ class TypecastFont implements Font {
}
@Override
- public Glyph getGlyph(char symbol) {
+ public Glyph getGlyph(final char symbol) {
TypecastGlyph result = (TypecastGlyph) char2Glyph.get(symbol);
if (null == result) {
// final short code = (short) char2Code.get(symbol);
@@ -226,12 +226,12 @@ class TypecastFont implements Font {
}
@Override
- public final float getPixelSize(float fontSize /* points per inch */, float resolution) {
+ public final float getPixelSize(final float fontSize /* points per inch */, final float resolution) {
return fontSize * resolution / ( 72f /* points per inch */ );
}
@Override
- public float getLineHeight(float pixelSize) {
+ public float getLineHeight(final float pixelSize) {
final Metrics metrics = getMetrics();
final float lineGap = metrics.getLineGap(pixelSize) ; // negative value!
final float ascent = metrics.getAscent(pixelSize) ; // negative value!
@@ -241,7 +241,7 @@ class TypecastFont implements Font {
}
@Override
- public float getMetricWidth(CharSequence string, float pixelSize) {
+ public float getMetricWidth(final CharSequence string, final float pixelSize) {
float width = 0;
final int len = string.length();
for (int i=0; i< len; i++) {
@@ -257,7 +257,7 @@ class TypecastFont implements Font {
}
@Override
- public float getMetricHeight(CharSequence string, float pixelSize, final AABBox tmp) {
+ public float getMetricHeight(final CharSequence string, final float pixelSize, final AABBox tmp) {
int height = 0;
for (int i=0; i<string.length(); i++) {
@@ -272,7 +272,7 @@ class TypecastFont implements Font {
}
@Override
- public AABBox getMetricBounds(CharSequence string, float pixelSize) {
+ public AABBox getMetricBounds(final CharSequence string, final float pixelSize) {
if (string == null) {
return new AABBox();
}
@@ -282,14 +282,14 @@ class TypecastFont implements Font {
float totalWidth = 0;
float curLineWidth = 0;
for (int i=0; i<charCount; i++) {
- char character = string.charAt(i);
+ final char character = string.charAt(i);
if (character == '\n') {
totalWidth = Math.max(curLineWidth, totalWidth);
curLineWidth = 0;
totalHeight += lineHeight;
continue;
}
- Glyph glyph = getGlyph(character);
+ final Glyph glyph = getGlyph(character);
curLineWidth += glyph.getAdvance(pixelSize, true);
}
if (curLineWidth > 0) {
@@ -350,7 +350,7 @@ class TypecastFont implements Font {
}
@Override
- public boolean isPrintableChar( char c ) {
+ public boolean isPrintableChar( final char c ) {
return FontFactory.isPrintableChar(c);
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
index d7db981b0..6154484d5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
@@ -45,14 +45,14 @@ public class TypecastFontConstructor implements FontConstructor {
@Override
public Font create(final File ffile) throws IOException {
- Object o = AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ final Object o = AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override
public Object run() {
OTFontCollection fontset;
try {
fontset = OTFontCollection.create(ffile);
return new TypecastFont(fontset);
- } catch (IOException e) {
+ } catch (final IOException e) {
return e;
}
}
@@ -83,7 +83,7 @@ public class TypecastFontConstructor implements FontConstructor {
}
f = create(tf);
tf.delete();
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
return f;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
index 2246b4a3c..7a3962f7c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
@@ -211,7 +211,7 @@ public class TypecastGlyph implements Font.Glyph {
@Override
public final int hashCode() {
// 31 * x == (x << 5) - x
- int hash = 31 + font.getName(Font.NAME_UNIQUNAME).hashCode();
+ final int hash = 31 + font.getName(Font.NAME_UNIQUNAME).hashCode();
return ((hash << 5) - hash) + id;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
index be8ab8f69..d5e30a500 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
@@ -52,12 +52,12 @@ class TypecastHMetrics implements Metrics {
// vheaTable = this.fontImpl.font.getVheaTable();
unitsPerEM_Inv = 1.0f / ( headTable.getUnitsPerEm() );
- int maxWidth = headTable.getXMax() - headTable.getXMin();
- int maxHeight = headTable.getYMax() - headTable.getYMin();
- float lowx= headTable.getXMin();
- float lowy = -(headTable.getYMin()+maxHeight);
- float highx = lowx + maxWidth;
- float highy = lowy + maxHeight;
+ final int maxWidth = headTable.getXMax() - headTable.getXMin();
+ final int maxHeight = headTable.getYMax() - headTable.getYMin();
+ final float lowx= headTable.getXMin();
+ final float lowy = -(headTable.getYMin()+maxHeight);
+ final float highx = lowx + maxWidth;
+ final float highy = lowy + maxHeight;
bbox = new AABBox(lowx, lowy, 0, highx, highy, 0); // invert
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
index b6e9925d4..f78656b52 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
@@ -45,23 +45,23 @@ import com.jogamp.graph.geom.Vertex.Factory;
public class TypecastRenderer {
private static final boolean DEBUG = Debug.debug("graph.font.Renderer");
- private static void addShapeMoveTo(final OutlineShape shape, Factory<? extends Vertex> vertexFactory, Point p1) {
+ private static void addShapeMoveTo(final OutlineShape shape, final Factory<? extends Vertex> vertexFactory, final Point p1) {
if( DEBUG ) { System.err.println("Shape.MoveTo: "+p1); }
shape.closeLastOutline(false);
shape.addEmptyOutline();
shape.addVertex(0, vertexFactory.create(p1.x, p1.y, 0, p1.onCurve));
}
- private static void addShapeLineTo(final OutlineShape shape, Factory<? extends Vertex> vertexFactory, Point p1) {
+ private static void addShapeLineTo(final OutlineShape shape, final Factory<? extends Vertex> vertexFactory, final Point p1) {
if( DEBUG ) { System.err.println("Shape.LineTo: "+p1); }
shape.addVertex(0, vertexFactory.create(p1.x, p1.y, 0, p1.onCurve));
}
- private static void addShapeQuadTo(final OutlineShape shape, Factory<? extends Vertex> vertexFactory, Point p1, Point p2) {
+ private static void addShapeQuadTo(final OutlineShape shape, final Factory<? extends Vertex> vertexFactory, final Point p1, final Point p2) {
if( DEBUG ) { System.err.println("Shape.QuadTo: "+p1+", "+p2); }
shape.addVertex(0, vertexFactory.create(p1.x, p1.y, 0, p1.onCurve));
shape.addVertex(0, vertexFactory.create(p2.x, p2.y, 0, p2.onCurve));
}
- private static void addShapeQuadTo(final OutlineShape shape, Factory<? extends Vertex> vertexFactory, Point p1,
- float p2x, float p2y, boolean p2OnCurve) {
+ private static void addShapeQuadTo(final OutlineShape shape, final Factory<? extends Vertex> vertexFactory, final Point p1,
+ final float p2x, final float p2y, final boolean p2OnCurve) {
if( DEBUG ) { System.err.println("Shape.QuadTo: "+p1+", p2 "+p2x+", "+p2y+", onCurve "+p2OnCurve); }
shape.addVertex(0, vertexFactory.create(p1.x, p1.y, 0, p1.onCurve));
shape.addVertex(0, vertexFactory.create(p2x, p2y, 0, p2OnCurve));
@@ -73,7 +73,7 @@ public class TypecastRenderer {
shape.addVertex(0, vertexFactory.create(p3.x, p3.y, 0, p3.onCurve));
} */
- public static OutlineShape buildShape(char symbol, OTGlyph glyph, Factory<? extends Vertex> vertexFactory) {
+ public static OutlineShape buildShape(final char symbol, final OTGlyph glyph, final Factory<? extends Vertex> vertexFactory) {
//
// See Typecast: GlyphPathFactory.addContourToPath(..)
//
@@ -108,7 +108,7 @@ public class TypecastRenderer {
}
} */
- private static void buildShapeImpl(final OutlineShape shape, char symbol, OTGlyph glyph, Factory<? extends Vertex> vertexFactory) {
+ private static void buildShapeImpl(final OutlineShape shape, final char symbol, final OTGlyph glyph, final Factory<? extends Vertex> vertexFactory) {
// Iterate through all of the points in the glyph. Each time we find a
// contour end point, add the point range to the path.
int startIndex = 0;
@@ -217,7 +217,7 @@ public class TypecastRenderer {
}
}
- private static float midValue(float a, float b) {
+ private static float midValue(final float a, final float b) {
return a + (b - a)/2f;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
index 8b685659e..181f77ee4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
@@ -22,7 +22,7 @@ public class Disassembler {
* @param ip The current instruction pointer
* @return The new instruction pointer
*/
- public static int advanceIP(short[] instructions, int ip) {
+ public static int advanceIP(final short[] instructions, int ip) {
// The high word specifies font, cvt, or glyph program
int i = ip & 0xffff;
@@ -46,8 +46,8 @@ public class Disassembler {
return ip;
}
- public static short getPushCount(short[] instructions, int ip) {
- short instr = instructions[ip & 0xffff];
+ public static short getPushCount(final short[] instructions, final int ip) {
+ final short instr = instructions[ip & 0xffff];
if ((Mnemonic.NPUSHB == instr) || (Mnemonic.NPUSHW == instr)) {
return instructions[(ip & 0xffff) + 1];
} else if ((Mnemonic.PUSHB == (instr & 0xf8)) || (Mnemonic.PUSHW == (instr & 0xf8))) {
@@ -56,11 +56,11 @@ public class Disassembler {
return 0;
}
- public static int[] getPushData(short[] instructions, int ip) {
- int count = getPushCount(instructions, ip);
- int[] data = new int[count];
- int i = ip & 0xffff;
- short instr = instructions[i];
+ public static int[] getPushData(final short[] instructions, final int ip) {
+ final int count = getPushCount(instructions, ip);
+ final int[] data = new int[count];
+ final int i = ip & 0xffff;
+ final short instr = instructions[i];
if (Mnemonic.NPUSHB == instr) {
for (int j = 0; j < count; j++) {
data[j] = instructions[i + j + 2];
@@ -81,8 +81,8 @@ public class Disassembler {
return data;
}
- public static String disassemble(short[] instructions, int leadingSpaces) {
- StringBuilder sb = new StringBuilder();
+ public static String disassemble(final short[] instructions, final int leadingSpaces) {
+ final StringBuilder sb = new StringBuilder();
int ip = 0;
while (ip < instructions.length) {
for (int i = 0; i < leadingSpaces; i++) {
@@ -91,7 +91,7 @@ public class Disassembler {
sb.append(ip).append(": ");
sb.append(Mnemonic.getMnemonic(instructions[ip]));
if (getPushCount(instructions, ip) > 0) {
- int[] data = getPushData(instructions, ip);
+ final int[] data = getPushData(instructions, ip);
for(int j = 0; j < data.length; j++) {
if ((instructions[ip] == Mnemonic.PUSHW) ||
(instructions[ip] == Mnemonic.NPUSHW)) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
index 0a4786f82..14e83814c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
@@ -812,7 +812,7 @@ public class Fixed {
* @param num Input
* @return Output
*/
- public static int arctan( int num ) {
+ public static int arctan( final int num ) {
return 0;
}
@@ -822,7 +822,7 @@ public class Fixed {
* @param num The 26.6 fixed number in question
* @return The resulting square root
*/
- public static int squareRoot(int num) {
+ public static int squareRoot(final int num) {
int n = num;
int divisor = num;
int nSquared;
@@ -841,12 +841,12 @@ public class Fixed {
return n;
}
- public static float floatValue(long fixed) {
+ public static float floatValue(final long fixed) {
return (fixed >> 16) + (float)(fixed & 0xffff) / 0x10000;
}
- public static float roundedFloatValue(long fixed, int decimalPlaces) {
- int factor = 10 * decimalPlaces;
+ public static float roundedFloatValue(final long fixed, final int decimalPlaces) {
+ final int factor = 10 * decimalPlaces;
return (float)((int)(floatValue(fixed) * factor)) / factor;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
index d6c9da268..6df892d4d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
@@ -143,7 +143,7 @@ public class Mnemonic {
* @param opcode The opcode for which the mnemonic is required
* @return The mnemonic, with a description
*/
- public static String getMnemonic(short opcode) {
+ public static String getMnemonic(final short opcode) {
if (opcode >= MIRP) return "MIRP["+((opcode&16)==0?"nrp0,":"srp0,")+((opcode&8)==0?"nmd,":"md,")+((opcode&4)==0?"nrd,":"rd,")+(opcode&3)+"]";
else if (opcode >= MDRP) return "MDRP["+((opcode&16)==0?"nrp0,":"srp0,")+((opcode&8)==0?"nmd,":"md,")+((opcode&4)==0?"nrd,":"rd,")+(opcode&3)+"]";
else if (opcode >= PUSHW) return "PUSHW["+((opcode&7)+1)+"]";
@@ -269,7 +269,7 @@ public class Mnemonic {
else return "????";
}
- public static String getComment(short opcode) {
+ public static String getComment(final short opcode) {
if (opcode >= MIRP) return "MIRP["+((opcode&16)==0?"nrp0,":"srp0,")+((opcode&8)==0?"nmd,":"md,")+((opcode&4)==0?"nrd,":"rd,")+(opcode&3)+"]\t\tMove Indirect Relative Point";
else if (opcode >= MDRP) return "MDRP["+((opcode&16)==0?"nrp0,":"srp0,")+((opcode&8)==0?"nmd,":"md,")+((opcode&4)==0?"nrd,":"rd,")+(opcode&3)+"]\t\tMove Direct Relative Point";
else if (opcode >= PUSHW) return "PUSHW["+((opcode&7)+1)+"]";
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
index 7c3b32e2c..e83a428ed 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
@@ -79,7 +79,7 @@ import jogamp.graph.font.typecast.ot.table.VheaTable;
*/
public class OTFont {
- private OTFontCollection _fc;
+ private final OTFontCollection _fc;
private TableDirectory _tableDirectory = null;
private Table[] _tables;
private Os2Table _os2;
@@ -98,17 +98,17 @@ public class OTFont {
/**
* Constructor
*/
- public OTFont(OTFontCollection fc) {
+ public OTFont(final OTFontCollection fc) {
_fc = fc;
}
- public StringBuilder getName(int nameIndex, StringBuilder sb) {
+ public StringBuilder getName(final int nameIndex, StringBuilder sb) {
if(null == sb) {
sb = new StringBuilder();
}
return _name.getRecordsRecordString(sb, nameIndex);
}
- public StringBuilder getAllNames(StringBuilder sb, String separator) {
+ public StringBuilder getAllNames(StringBuilder sb, final String separator) {
if(null != _name) {
if(null == sb) {
sb = new StringBuilder();
@@ -120,7 +120,7 @@ public class OTFont {
return sb;
}
- public Table getTable(int tableType) {
+ public Table getTable(final int tableType) {
for (int i = 0; i < _tables.length; i++) {
if ((_tables[i] != null) && (_tables[i].getType() == tableType)) {
return _tables[i];
@@ -185,7 +185,7 @@ public class OTFont {
return _maxp.getNumGlyphs();
}
- public OTGlyph getGlyph(int i) {
+ public OTGlyph getGlyph(final int i) {
final GlyfDescript _glyfDescr = _glyf.getDescription(i);
return (null != _glyfDescr)
@@ -201,11 +201,11 @@ public class OTFont {
}
private Table readTable(
- DataInputStream dis,
- int tablesOrigin,
- int tag) throws IOException {
+ final DataInputStream dis,
+ final int tablesOrigin,
+ final int tag) throws IOException {
dis.reset();
- DirectoryEntry entry = _tableDirectory.getEntryByTag(tag);
+ final DirectoryEntry entry = _tableDirectory.getEntryByTag(tag);
if (entry == null) {
return null;
}
@@ -225,9 +225,9 @@ public class OTFont {
* individual font resource data.
*/
protected void read(
- DataInputStream dis,
- int directoryOffset,
- int tablesOrigin) throws IOException {
+ final DataInputStream dis,
+ final int directoryOffset,
+ final int tablesOrigin) throws IOException {
// Load the table directory
dis.reset();
@@ -255,7 +255,7 @@ public class OTFont {
// Load all other tables
for (int i = 0; i < _tableDirectory.getNumTables(); i++) {
- DirectoryEntry entry = _tableDirectory.getEntry(i);
+ final DirectoryEntry entry = _tableDirectory.getEntry(i);
if (entry.getTag() == Table.head
|| entry.getTag() == Table.hhea
|| entry.getTag() == Table.maxp
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
index c79380f16..e5ad2900a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
@@ -48,7 +48,7 @@ public class OTFontCollection {
private String _fileName;
private TTCHeader _ttcHeader;
private OTFont[] _fonts;
- private ArrayList<Table> _tables = new ArrayList<Table>();
+ private final ArrayList<Table> _tables = new ArrayList<Table>();
private boolean _resourceFork = false;
/** Creates new FontCollection */
@@ -58,8 +58,8 @@ public class OTFontCollection {
/**
* @param file The OpenType font file
*/
- public static OTFontCollection create(File file) throws IOException {
- OTFontCollection fc = new OTFontCollection();
+ public static OTFontCollection create(final File file) throws IOException {
+ final OTFontCollection fc = new OTFontCollection();
fc.read(file);
return fc;
}
@@ -72,7 +72,7 @@ public class OTFontCollection {
return _fileName;
}
- public OTFont getFont(int i) {
+ public OTFont getFont(final int i) {
return _fonts[i];
}
@@ -84,9 +84,9 @@ public class OTFontCollection {
return _ttcHeader;
}
- public Table getTable(DirectoryEntry de) {
+ public Table getTable(final DirectoryEntry de) {
for (int i = 0; i < _tables.size(); i++) {
- Table table = _tables.get(i);
+ final Table table = _tables.get(i);
if ((table.getDirectoryEntry().getTag() == de.getTag()) &&
(table.getDirectoryEntry().getOffset() == de.getOffset())) {
return table;
@@ -95,7 +95,7 @@ public class OTFontCollection {
return null;
}
- public void addTable(Table table) {
+ public void addTable(final Table table) {
_tables.add(table);
}
@@ -120,7 +120,7 @@ public class OTFontCollection {
_resourceFork = true;
}
- DataInputStream dis = new DataInputStream(
+ final DataInputStream dis = new DataInputStream(
new BufferedInputStream(
new FileInputStream(file), (int) file.length()));
dis.mark((int) file.length());
@@ -128,22 +128,22 @@ public class OTFontCollection {
if (_resourceFork || _pathName.endsWith(".dfont")) {
// This is a Macintosh font suitcase resource
- ResourceHeader resourceHeader = new ResourceHeader(dis);
+ final ResourceHeader resourceHeader = new ResourceHeader(dis);
// Seek to the map offset and read the map
dis.reset();
dis.skip(resourceHeader.getMapOffset());
- ResourceMap map = new ResourceMap(dis);
+ final ResourceMap map = new ResourceMap(dis);
// Get the 'sfnt' resources
- ResourceType resourceType = map.getResourceType("sfnt");
+ final ResourceType resourceType = map.getResourceType("sfnt");
// Load the font data
_fonts = new OTFont[resourceType.getCount()];
for (int i = 0; i < resourceType.getCount(); i++) {
- ResourceReference resourceReference = resourceType.getReference(i);
+ final ResourceReference resourceReference = resourceType.getReference(i);
_fonts[i] = new OTFont(this);
- int offset = resourceHeader.getDataOffset() +
+ final int offset = resourceHeader.getDataOffset() +
resourceReference.getDataOffset() + 4;
_fonts[i].read(dis, offset, offset);
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
index 270507fec..7bfffd58c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
@@ -79,7 +79,7 @@ public class OTGlyph {
* @param lsb The Left Side Bearing.
* @param advance The advance width.
*/
- public OTGlyph(GlyphDescription gd, short lsb, int advance) {
+ public OTGlyph(final GlyphDescription gd, final short lsb, final int advance) {
_leftSideBearing = lsb;
_advanceWidth = advance;
describe(gd);
@@ -91,11 +91,11 @@ public class OTGlyph {
* @param lsb The Left Side Bearing.
* @param advance The advance width.
*/
- public OTGlyph(Charstring cs, short lsb, int advance) {
+ public OTGlyph(final Charstring cs, final short lsb, final int advance) {
_leftSideBearing = lsb;
_advanceWidth = advance;
if (cs instanceof CharstringType2) {
- T2Interpreter t2i = new T2Interpreter();
+ final T2Interpreter t2i = new T2Interpreter();
_points = t2i.execute((CharstringType2) cs);
} else {
//throw unsupported charstring type
@@ -118,7 +118,7 @@ public class OTGlyph {
return _leftSideBearing;
}
- public Point getPoint(int i) {
+ public Point getPoint(final int i) {
return _points[i];
}
@@ -129,7 +129,7 @@ public class OTGlyph {
/**
* @param factor a 16.16 fixed value
*/
- public void scale(int factor) {
+ public void scale(final int factor) {
for (int i = 0; i < _points.length; i++) {
//points[i].x = ( points[i].x * factor ) >> 6;
//points[i].y = ( points[i].y * factor ) >> 6;
@@ -143,11 +143,11 @@ public class OTGlyph {
/**
* Set the points of a glyph from the GlyphDescription
*/
- private void describe(GlyphDescription gd) {
+ private void describe(final GlyphDescription gd) {
int endPtIndex = 0;
_points = new Point[gd.getPointCount() /* + 2 */ ];
for (int i = 0; i < gd.getPointCount(); i++) {
- boolean endPt = gd.getEndPtOfContours(endPtIndex) == i;
+ final boolean endPt = gd.getEndPtOfContours(endPtIndex) == i;
if (endPt) {
endPtIndex++;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java
index 0cac8ab44..76b0f90f3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java
@@ -19,7 +19,7 @@ public class Point {
public boolean onCurve = true;
public boolean endOfContour = false;
- public Point(int x, int y, boolean onCurve, boolean endOfContour) {
+ public Point(final int x, final int y, final boolean onCurve, final boolean endOfContour) {
this.x = x;
this.y = y;
this.onCurve = onCurve;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
index 7a5b0c4d2..709ff9e91 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
@@ -30,11 +30,11 @@ import java.io.IOException;
*/
public class ResourceData {
- private byte[] data;
+ private final byte[] data;
/** Creates new ResourceData */
- public ResourceData(DataInput di) throws IOException {
- int dataLen = di.readInt();
+ public ResourceData(final DataInput di) throws IOException {
+ final int dataLen = di.readInt();
data = new byte[dataLen];
di.readFully(data);
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
index 468ab2e1c..767eafb6b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
@@ -31,11 +31,11 @@ import java.io.RandomAccessFile;
*/
public class ResourceFile {
- private ResourceHeader header;
- private ResourceMap map;
+ private final ResourceHeader header;
+ private final ResourceMap map;
/** Creates new Resource */
- public ResourceFile(RandomAccessFile raf) throws IOException {
+ public ResourceFile(final RandomAccessFile raf) throws IOException {
// Read header at the beginning of the file
raf.seek(0);
@@ -50,13 +50,13 @@ public class ResourceFile {
return map;
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
try {
//RandomAccessFile raf = new RandomAccessFile("/Library/Fonts/GillSans.dfont", "r");
// Tests loading a font from a resource fork on Mac OS X
- RandomAccessFile raf = new RandomAccessFile("/Library/Fonts/Georgia/..namedfork/rsrc", "r");
- ResourceFile resource = new ResourceFile(raf);
+ final RandomAccessFile raf = new RandomAccessFile("/Library/Fonts/Georgia/..namedfork/rsrc", "r");
+ final ResourceFile resource = new ResourceFile(raf);
for (int i = 0; i < resource.getResourceMap().getResourceTypeCount(); i++) {
System.out.println(resource.getResourceMap().getResourceType(i).getTypeAsString());
}
@@ -70,7 +70,7 @@ public class ResourceFile {
reference = type.getReference(i);
System.out.println(reference.getName());
}
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
index de13b116f..dea0b9843 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
@@ -30,13 +30,13 @@ import java.io.IOException;
*/
public class ResourceHeader {
- private int dataOffset;
- private int mapOffset;
- private int dataLen;
- private int mapLen;
+ private final int dataOffset;
+ private final int mapOffset;
+ private final int dataLen;
+ private final int mapLen;
/** Creates new ResourceHeader */
- public ResourceHeader(DataInput di) throws IOException {
+ public ResourceHeader(final DataInput di) throws IOException {
dataOffset = di.readInt();
mapOffset = di.readInt();
dataLen = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
index d348c645e..b22a06325 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
@@ -30,21 +30,21 @@ import java.io.IOException;
*/
public class ResourceMap {
- private byte[] headerCopy = new byte[16];
- private int nextResourceMap;
- private int fileReferenceNumber;
- private int attributes;
- private ResourceType[] types;
+ private final byte[] headerCopy = new byte[16];
+ private final int nextResourceMap;
+ private final int fileReferenceNumber;
+ private final int attributes;
+ private final ResourceType[] types;
/** Creates new ResourceMap */
- public ResourceMap(DataInput di) throws IOException {
+ public ResourceMap(final DataInput di) throws IOException {
di.readFully(headerCopy);
nextResourceMap = di.readInt();
fileReferenceNumber = di.readUnsignedShort();
attributes = di.readUnsignedShort();
- int typeOffset = di.readUnsignedShort();
- int nameOffset = di.readUnsignedShort();
- int typeCount = di.readUnsignedShort() + 1;
+ final int typeOffset = di.readUnsignedShort();
+ final int nameOffset = di.readUnsignedShort();
+ final int typeCount = di.readUnsignedShort() + 1;
// Read types
types = new ResourceType[typeCount];
@@ -63,9 +63,9 @@ public class ResourceMap {
}
}
- public ResourceType getResourceType(String typeName) {
+ public ResourceType getResourceType(final String typeName) {
for (int i = 0; i < types.length; i++) {
- String s = types[i].getTypeAsString();
+ final String s = types[i].getTypeAsString();
if (types[i].getTypeAsString().equals(typeName)) {
return types[i];
}
@@ -73,7 +73,7 @@ public class ResourceMap {
return null;
}
- public ResourceType getResourceType(int i) {
+ public ResourceType getResourceType(final int i) {
return types[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
index 9d1534821..f76b85cf4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
@@ -30,15 +30,15 @@ import java.io.IOException;
*/
public class ResourceReference {
- private int id;
- private short nameOffset;
- private short attributes;
- private int dataOffset;
- private int handle;
+ private final int id;
+ private final short nameOffset;
+ private final short attributes;
+ private final int dataOffset;
+ private final int handle;
private String name;
/** Creates new ResourceReference */
- protected ResourceReference(DataInput di) throws IOException {
+ protected ResourceReference(final DataInput di) throws IOException {
id = di.readUnsignedShort();
nameOffset = di.readShort();
attributes = (short) di.readUnsignedByte();
@@ -46,10 +46,10 @@ public class ResourceReference {
handle = di.readInt();
}
- protected void readName(DataInput di) throws IOException {
+ protected void readName(final DataInput di) throws IOException {
if (nameOffset > -1) {
- int len = di.readUnsignedByte();
- byte[] buf = new byte[len];
+ final int len = di.readUnsignedByte();
+ final byte[] buf = new byte[len];
di.readFully(buf);
name = new String(buf);
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
index 2ad002e6a..903fe1a48 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
@@ -30,26 +30,26 @@ import java.io.IOException;
*/
public class ResourceType {
- private int type;
- private int count;
- private int offset;
- private ResourceReference[] references;
+ private final int type;
+ private final int count;
+ private final int offset;
+ private final ResourceReference[] references;
/** Creates new ResourceType */
- protected ResourceType(DataInput di) throws IOException {
+ protected ResourceType(final DataInput di) throws IOException {
type = di.readInt();
count = di.readUnsignedShort() + 1;
offset = di.readUnsignedShort();
references = new ResourceReference[count];
}
- protected void readRefs(DataInput di) throws IOException {
+ protected void readRefs(final DataInput di) throws IOException {
for (int i = 0; i < count; i++) {
references[i] = new ResourceReference(di);
}
}
- protected void readNames(DataInput di) throws IOException {
+ protected void readNames(final DataInput di) throws IOException {
for (int i = 0; i < count; i++) {
references[i].readName(di);
}
@@ -76,7 +76,7 @@ public class ResourceType {
return offset;
}
- public ResourceReference getReference(int i) {
+ public ResourceReference getReference(final int i) {
return references[i];
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
index 60975dd52..49ab1d474 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
@@ -41,9 +41,9 @@ public class BaseTable implements Table {
private class BaseCoordFormat1 extends BaseCoord {
- private short _coordinate;
+ private final short _coordinate;
- protected BaseCoordFormat1(DataInput di) throws IOException {
+ protected BaseCoordFormat1(final DataInput di) throws IOException {
_coordinate = di.readShort();
}
@@ -61,11 +61,11 @@ public class BaseTable implements Table {
private class BaseCoordFormat2 extends BaseCoord {
- private short _coordinate;
- private int _referenceGlyph;
- private int _baseCoordPoint;
+ private final short _coordinate;
+ private final int _referenceGlyph;
+ private final int _baseCoordPoint;
- protected BaseCoordFormat2(DataInput di) throws IOException {
+ protected BaseCoordFormat2(final DataInput di) throws IOException {
_coordinate = di.readShort();
_referenceGlyph = di.readUnsignedShort();
_baseCoordPoint = di.readUnsignedShort();
@@ -85,10 +85,10 @@ public class BaseTable implements Table {
private class BaseCoordFormat3 extends BaseCoord {
- private short _coordinate;
- private int _deviceTableOffset;
+ private final short _coordinate;
+ private final int _deviceTableOffset;
- protected BaseCoordFormat3(DataInput di) throws IOException {
+ protected BaseCoordFormat3(final DataInput di) throws IOException {
_coordinate = di.readShort();
_deviceTableOffset = di.readUnsignedShort();
}
@@ -107,11 +107,11 @@ public class BaseTable implements Table {
private class FeatMinMaxRecord {
- private int _tag;
- private int _minCoordOffset;
- private int _maxCoordOffset;
+ private final int _tag;
+ private final int _minCoordOffset;
+ private final int _maxCoordOffset;
- protected FeatMinMaxRecord(DataInput di) throws IOException {
+ protected FeatMinMaxRecord(final DataInput di) throws IOException {
_tag = di.readInt();
_minCoordOffset = di.readUnsignedShort();
_maxCoordOffset = di.readUnsignedShort();
@@ -120,13 +120,13 @@ public class BaseTable implements Table {
private class MinMax {
- private int _minCoordOffset;
- private int _maxCoordOffset;
- private int _featMinMaxCount;
- private FeatMinMaxRecord[] _featMinMaxRecord;
+ private final int _minCoordOffset;
+ private final int _maxCoordOffset;
+ private final int _featMinMaxCount;
+ private final FeatMinMaxRecord[] _featMinMaxRecord;
- protected MinMax(int minMaxOffset) throws IOException {
- DataInput di = getDataInputForOffset(minMaxOffset);
+ protected MinMax(final int minMaxOffset) throws IOException {
+ final DataInput di = getDataInputForOffset(minMaxOffset);
_minCoordOffset = di.readUnsignedShort();
_maxCoordOffset = di.readUnsignedShort();
_featMinMaxCount = di.readUnsignedShort();
@@ -139,13 +139,13 @@ public class BaseTable implements Table {
private class BaseValues {
- private int _defaultIndex;
- private int _baseCoordCount;
- private int[] _baseCoordOffset;
- private BaseCoord[] _baseCoords;
+ private final int _defaultIndex;
+ private final int _baseCoordCount;
+ private final int[] _baseCoordOffset;
+ private final BaseCoord[] _baseCoords;
- protected BaseValues(int baseValuesOffset) throws IOException {
- DataInput di = getDataInputForOffset(baseValuesOffset);
+ protected BaseValues(final int baseValuesOffset) throws IOException {
+ final DataInput di = getDataInputForOffset(baseValuesOffset);
_defaultIndex = di.readUnsignedShort();
_baseCoordCount = di.readUnsignedShort();
_baseCoordOffset = new int[_baseCoordCount];
@@ -154,7 +154,7 @@ public class BaseTable implements Table {
}
_baseCoords = new BaseCoord[_baseCoordCount];
for (int i = 0; i < _baseCoordCount; ++i) {
- int format = di.readUnsignedShort();
+ final int format = di.readUnsignedShort();
switch (format) {
case 1:
_baseCoords[i] = new BaseCoordFormat1(di);
@@ -172,10 +172,10 @@ public class BaseTable implements Table {
private class BaseLangSysRecord {
- private int _baseLangSysTag;
- private int _minMaxOffset;
+ private final int _baseLangSysTag;
+ private final int _minMaxOffset;
- protected BaseLangSysRecord(DataInput di) throws IOException {
+ protected BaseLangSysRecord(final DataInput di) throws IOException {
_baseLangSysTag = di.readInt();
_minMaxOffset = di.readUnsignedShort();
}
@@ -191,17 +191,17 @@ public class BaseTable implements Table {
private class BaseScript {
- private int _thisOffset;
- private int _baseValuesOffset;
- private int _defaultMinMaxOffset;
- private int _baseLangSysCount;
- private BaseLangSysRecord[] _baseLangSysRecord;
+ private final int _thisOffset;
+ private final int _baseValuesOffset;
+ private final int _defaultMinMaxOffset;
+ private final int _baseLangSysCount;
+ private final BaseLangSysRecord[] _baseLangSysRecord;
private BaseValues _baseValues;
private MinMax[] _minMax;
- protected BaseScript(int baseScriptOffset) throws IOException {
+ protected BaseScript(final int baseScriptOffset) throws IOException {
_thisOffset = baseScriptOffset;
- DataInput di = getDataInputForOffset(baseScriptOffset);
+ final DataInput di = getDataInputForOffset(baseScriptOffset);
_baseValuesOffset = di.readUnsignedShort();
_defaultMinMaxOffset = di.readUnsignedShort();
_baseLangSysCount = di.readUnsignedShort();
@@ -219,7 +219,7 @@ public class BaseTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder()
+ final StringBuilder sb = new StringBuilder()
.append("\nBaseScript BaseScriptT").append(Integer.toHexString(_thisOffset))
.append("\nBaseValuesT").append(Integer.toHexString(_thisOffset + _baseValuesOffset))
.append("\nMinMaxT").append(Integer.toHexString(_thisOffset + _defaultMinMaxOffset))
@@ -241,10 +241,10 @@ public class BaseTable implements Table {
private class BaseScriptRecord {
- private int _baseScriptTag;
- private int _baseScriptOffset;
+ private final int _baseScriptTag;
+ private final int _baseScriptOffset;
- protected BaseScriptRecord(DataInput di) throws IOException {
+ protected BaseScriptRecord(final DataInput di) throws IOException {
_baseScriptTag = di.readInt();
_baseScriptOffset = di.readUnsignedShort();
}
@@ -260,14 +260,14 @@ public class BaseTable implements Table {
private class BaseScriptList {
- private int _thisOffset;
- private int _baseScriptCount;
- private BaseScriptRecord[] _baseScriptRecord;
- private BaseScript[] _baseScripts;
+ private final int _thisOffset;
+ private final int _baseScriptCount;
+ private final BaseScriptRecord[] _baseScriptRecord;
+ private final BaseScript[] _baseScripts;
- protected BaseScriptList(int baseScriptListOffset) throws IOException {
+ protected BaseScriptList(final int baseScriptListOffset) throws IOException {
_thisOffset = baseScriptListOffset;
- DataInput di = getDataInputForOffset(baseScriptListOffset);
+ final DataInput di = getDataInputForOffset(baseScriptListOffset);
_baseScriptCount = di.readUnsignedShort();
_baseScriptRecord = new BaseScriptRecord[_baseScriptCount];
for (int i = 0; i < _baseScriptCount; ++i) {
@@ -282,7 +282,7 @@ public class BaseTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder()
+ final StringBuilder sb = new StringBuilder()
.append("\nBaseScriptList BaseScriptListT").append(Integer.toHexString(_thisOffset))
.append("\n").append(Integer.toHexString(_baseScriptCount));
for (int i = 0; i < _baseScriptCount; ++i) {
@@ -299,13 +299,13 @@ public class BaseTable implements Table {
private class BaseTagList {
- private int _thisOffset;
- private int _baseTagCount;
- private int[] _baselineTag;
+ private final int _thisOffset;
+ private final int _baseTagCount;
+ private final int[] _baselineTag;
- protected BaseTagList(int baseTagListOffset) throws IOException {
+ protected BaseTagList(final int baseTagListOffset) throws IOException {
_thisOffset = baseTagListOffset;
- DataInput di = getDataInputForOffset(baseTagListOffset);
+ final DataInput di = getDataInputForOffset(baseTagListOffset);
_baseTagCount = di.readUnsignedShort();
_baselineTag = new int[_baseTagCount];
for (int i = 0; i < _baseTagCount; ++i) {
@@ -315,7 +315,7 @@ public class BaseTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder()
+ final StringBuilder sb = new StringBuilder()
.append("\nBaseTagList BaseTagListT").append(Integer.toHexString(_thisOffset))
.append("\n").append(Integer.toHexString(_baseTagCount));
for (int i = 0; i < _baseTagCount; ++i) {
@@ -327,15 +327,15 @@ public class BaseTable implements Table {
private class Axis {
- private int _thisOffset;
- private int _baseTagListOffset;
- private int _baseScriptListOffset;
+ private final int _thisOffset;
+ private final int _baseTagListOffset;
+ private final int _baseScriptListOffset;
private BaseTagList _baseTagList;
private BaseScriptList _baseScriptList;
- protected Axis(int axisOffset) throws IOException {
+ protected Axis(final int axisOffset) throws IOException {
_thisOffset = axisOffset;
- DataInput di = getDataInputForOffset(axisOffset);
+ final DataInput di = getDataInputForOffset(axisOffset);
_baseTagListOffset = di.readUnsignedShort();
_baseScriptListOffset = di.readUnsignedShort();
if (_baseTagListOffset != 0) {
@@ -359,22 +359,22 @@ public class BaseTable implements Table {
}
}
- private DirectoryEntry _de;
- private int _version;
- private int _horizAxisOffset;
- private int _vertAxisOffset;
+ private final DirectoryEntry _de;
+ private final int _version;
+ private final int _horizAxisOffset;
+ private final int _vertAxisOffset;
private Axis _horizAxis;
private Axis _vertAxis;
private byte[] _buf;
/** Creates a new instance of BaseTable */
- protected BaseTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected BaseTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
// Load entire table into a buffer, and create another input stream
_buf = new byte[de.getLength()];
di.readFully(_buf);
- DataInput di2 = getDataInputForOffset(0);
+ final DataInput di2 = getDataInputForOffset(0);
_version = di2.readInt();
_horizAxisOffset = di2.readUnsignedShort();
@@ -390,7 +390,7 @@ public class BaseTable implements Table {
_buf = null;
}
- private DataInput getDataInputForOffset(int offset) {
+ private DataInput getDataInputForOffset(final int offset) {
return new DataInputStream(new ByteArrayInputStream(
_buf, offset,
_de.getLength() - offset));
@@ -404,8 +404,8 @@ public class BaseTable implements Table {
// return String.format("%1$8x", value);
// }
- static protected String tagAsString(int tag) {
- char[] c = new char[4];
+ static protected String tagAsString(final int tag) {
+ final char[] c = new char[4];
c[0] = (char)((tag >> 24) & 0xff);
c[1] = (char)((tag >> 16) & 0xff);
c[2] = (char)((tag >> 8) & 0xff);
@@ -420,7 +420,7 @@ public class BaseTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder()
+ final StringBuilder sb = new StringBuilder()
.append("; 'BASE' Table - Baseline\n;-------------------------------------\n\n")
.append("BASEHeader BASEHeaderT").append(Integer.toHexString(0))
.append("\n").append(Integer.toHexString(_version))
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
index a36a49923..b0acff575 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
@@ -39,11 +39,11 @@ public class CffTable implements Table {
public class Dict {
- private Dictionary<Integer, Object> _entries = new Hashtable<Integer, Object>();
- private int[] _data;
+ private final Dictionary<Integer, Object> _entries = new Hashtable<Integer, Object>();
+ private final int[] _data;
private int _index;
- protected Dict(int[] data, int offset, int length) {
+ protected Dict(final int[] data, final int offset, final int length) {
_data = data;
_index = offset;
while (_index < offset + length) {
@@ -51,12 +51,12 @@ public class CffTable implements Table {
}
}
- public Object getValue(int key) {
+ public Object getValue(final int key) {
return _entries.get(key);
}
private boolean addKeyAndValueEntry() {
- ArrayList<Object> operands = new ArrayList<Object>();
+ final ArrayList<Object> operands = new ArrayList<Object>();
Object operand = null;
while (isOperandAtIndex()) {
operand = nextOperand();
@@ -76,7 +76,7 @@ public class CffTable implements Table {
}
private boolean isOperandAtIndex() {
- int b0 = _data[_index];
+ final int b0 = _data[_index];
if ((32 <= b0 && b0 <= 254)
|| b0 == 28
|| b0 == 29
@@ -87,7 +87,7 @@ public class CffTable implements Table {
}
private boolean isOperatorAtIndex() {
- int b0 = _data[_index];
+ final int b0 = _data[_index];
if (0 <= b0 && b0 <= 21) {
return true;
}
@@ -95,7 +95,7 @@ public class CffTable implements Table {
}
private Object nextOperand() {
- int b0 = _data[_index];
+ final int b0 = _data[_index];
if (32 <= b0 && b0 <= 246) {
// 1 byte integer
@@ -104,35 +104,35 @@ public class CffTable implements Table {
} else if (247 <= b0 && b0 <= 250) {
// 2 byte integer
- int b1 = _data[_index + 1];
+ final int b1 = _data[_index + 1];
_index += 2;
return new Integer((b0 - 247) * 256 + b1 + 108);
} else if (251 <= b0 && b0 <= 254) {
// 2 byte integer
- int b1 = _data[_index + 1];
+ final int b1 = _data[_index + 1];
_index += 2;
return new Integer(-(b0 - 251) * 256 - b1 - 108);
} else if (b0 == 28) {
// 3 byte integer
- int b1 = _data[_index + 1];
- int b2 = _data[_index + 2];
+ final int b1 = _data[_index + 1];
+ final int b2 = _data[_index + 2];
_index += 3;
return new Integer(b1 << 8 | b2);
} else if (b0 == 29) {
// 5 byte integer
- int b1 = _data[_index + 1];
- int b2 = _data[_index + 2];
- int b3 = _data[_index + 3];
- int b4 = _data[_index + 4];
+ final int b1 = _data[_index + 1];
+ final int b2 = _data[_index + 2];
+ final int b3 = _data[_index + 3];
+ final int b4 = _data[_index + 4];
_index += 5;
return new Integer(b1 << 24 | b2 << 16 | b3 << 8 | b4);
} else if (b0 == 30) {
// Real number
- StringBuilder fString = new StringBuilder();
+ final StringBuilder fString = new StringBuilder();
int nibble1 = 0;
int nibble2 = 0;
++_index;
@@ -149,7 +149,7 @@ public class CffTable implements Table {
}
}
- private String decodeRealNibble(int nibble) {
+ private String decodeRealNibble(final int nibble) {
if (nibble < 0xa) {
return Integer.toString(nibble);
} else if (nibble == 0xa) {
@@ -166,10 +166,10 @@ public class CffTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
- Enumeration<Integer> keys = _entries.keys();
+ final StringBuilder sb = new StringBuilder();
+ final Enumeration<Integer> keys = _entries.keys();
while (keys.hasMoreElements()) {
- Integer key = keys.nextElement();
+ final Integer key = keys.nextElement();
if ((key.intValue() & 0xc00) == 0xc00) {
sb.append("12 ").append(key.intValue() & 0xff).append(": ");
} else {
@@ -183,12 +183,12 @@ public class CffTable implements Table {
public class Index {
- private int _count;
- private int _offSize;
- private int[] _offset;
- private int[] _data;
+ private final int _count;
+ private final int _offSize;
+ private final int[] _offset;
+ private final int[] _data;
- protected Index(DataInput di) throws IOException {
+ protected Index(final DataInput di) throws IOException {
_count = di.readUnsignedShort();
_offset = new int[_count + 1];
_offSize = di.readUnsignedByte();
@@ -209,7 +209,7 @@ public class CffTable implements Table {
return _count;
}
- public int getOffset(int index) {
+ public int getOffset(final int index) {
return _offset[index];
}
@@ -223,7 +223,7 @@ public class CffTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("DICT\n");
sb.append("count: ").append(_count).append("\n");
sb.append("offSize: ").append(_offSize).append("\n");
@@ -246,19 +246,19 @@ public class CffTable implements Table {
public class TopDictIndex extends Index {
- protected TopDictIndex(DataInput di) throws IOException {
+ protected TopDictIndex(final DataInput di) throws IOException {
super(di);
}
- public Dict getTopDict(int index) {
- int offset = getOffset(index) - 1;
- int len = getOffset(index + 1) - offset - 1;
+ public Dict getTopDict(final int index) {
+ final int offset = getOffset(index) - 1;
+ final int len = getOffset(index + 1) - offset - 1;
return new Dict(getData(), offset, len);
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
for (int i = 0; i < getCount(); ++i) {
sb.append(getTopDict(i).toString()).append("\n");
}
@@ -268,18 +268,18 @@ public class CffTable implements Table {
public class NameIndex extends Index {
- protected NameIndex(DataInput di) throws IOException {
+ protected NameIndex(final DataInput di) throws IOException {
super(di);
}
- public String getName(int index) {
+ public String getName(final int index) {
String name = null;
- int offset = getOffset(index) - 1;
- int len = getOffset(index + 1) - offset - 1;
+ final int offset = getOffset(index) - 1;
+ final int len = getOffset(index + 1) - offset - 1;
// Ensure the name hasn't been deleted
if (getData()[offset] != 0) {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
for (int i = offset; i < offset + len; ++i) {
sb.append((char) getData()[i]);
}
@@ -292,7 +292,7 @@ public class CffTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
for (int i = 0; i < getCount(); ++i) {
sb.append(getName(i)).append("\n");
}
@@ -302,7 +302,7 @@ public class CffTable implements Table {
public class StringIndex extends Index {
- protected StringIndex(DataInput di) throws IOException {
+ protected StringIndex(final DataInput di) throws IOException {
super(di);
}
@@ -314,10 +314,10 @@ public class CffTable implements Table {
if (index >= getCount()) {
return null;
}
- int offset = getOffset(index) - 1;
- int len = getOffset(index + 1) - offset - 1;
+ final int offset = getOffset(index) - 1;
+ final int len = getOffset(index + 1) - offset - 1;
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
for (int i = offset; i < offset + len; ++i) {
sb.append((char) getData()[i]);
}
@@ -327,8 +327,8 @@ public class CffTable implements Table {
@Override
public String toString() {
- int nonStandardBase = CffStandardStrings.standardStrings.length;
- StringBuilder sb = new StringBuilder();
+ final int nonStandardBase = CffStandardStrings.standardStrings.length;
+ final StringBuilder sb = new StringBuilder();
for (int i = 0; i < getCount(); ++i) {
sb.append(nonStandardBase + i).append(": ");
sb.append(getString(nonStandardBase + i)).append("\n");
@@ -346,7 +346,7 @@ public class CffTable implements Table {
return _first;
}
- protected void setFirst(int first) {
+ protected void setFirst(final int first) {
_first = first;
}
@@ -354,14 +354,14 @@ public class CffTable implements Table {
return _left;
}
- protected void setLeft(int left) {
+ protected void setLeft(final int left) {
_left = left;
}
}
private class CharsetRange1 extends CharsetRange {
- protected CharsetRange1(DataInput di) throws IOException {
+ protected CharsetRange1(final DataInput di) throws IOException {
setFirst(di.readUnsignedShort());
setLeft(di.readUnsignedByte());
}
@@ -369,7 +369,7 @@ public class CffTable implements Table {
private class CharsetRange2 extends CharsetRange {
- protected CharsetRange2(DataInput di) throws IOException {
+ protected CharsetRange2(final DataInput di) throws IOException {
setFirst(di.readUnsignedShort());
setLeft(di.readUnsignedShort());
}
@@ -384,9 +384,9 @@ public class CffTable implements Table {
private class CharsetFormat0 extends Charset {
- private int[] _glyph;
+ private final int[] _glyph;
- protected CharsetFormat0(DataInput di, int glyphCount) throws IOException {
+ protected CharsetFormat0(final DataInput di, final int glyphCount) throws IOException {
_glyph = new int[glyphCount - 1]; // minus 1 because .notdef is omitted
for (int i = 0; i < glyphCount - 1; ++i) {
_glyph[i] = di.readUnsignedShort();
@@ -399,7 +399,7 @@ public class CffTable implements Table {
}
@Override
- public int getSID(int gid) {
+ public int getSID(final int gid) {
if (gid == 0) {
return 0;
}
@@ -409,12 +409,12 @@ public class CffTable implements Table {
private class CharsetFormat1 extends Charset {
- private ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
+ private final ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
- protected CharsetFormat1(DataInput di, int glyphCount) throws IOException {
+ protected CharsetFormat1(final DataInput di, final int glyphCount) throws IOException {
int glyphsCovered = glyphCount - 1; // minus 1 because .notdef is omitted
while (glyphsCovered > 0) {
- CharsetRange range = new CharsetRange1(di);
+ final CharsetRange range = new CharsetRange1(di);
_charsetRanges.add(range);
glyphsCovered -= range.getLeft() + 1;
}
@@ -426,17 +426,17 @@ public class CffTable implements Table {
}
@Override
- public int getSID(int gid) {
+ public int getSID(final int gid) {
if (gid == 0) {
return 0;
}
// Count through the ranges to find the one of interest
int count = 0;
- for (CharsetRange range : _charsetRanges) {
+ for (final CharsetRange range : _charsetRanges) {
count += range.getLeft();
if (gid < count) {
- int sid = gid - count + range.getFirst();
+ final int sid = gid - count + range.getFirst();
return sid;
}
}
@@ -446,12 +446,12 @@ public class CffTable implements Table {
private class CharsetFormat2 extends Charset {
- private ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
+ private final ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
- protected CharsetFormat2(DataInput di, int glyphCount) throws IOException {
+ protected CharsetFormat2(final DataInput di, final int glyphCount) throws IOException {
int glyphsCovered = glyphCount - 1; // minus 1 because .notdef is omitted
while (glyphsCovered > 0) {
- CharsetRange range = new CharsetRange2(di);
+ final CharsetRange range = new CharsetRange2(di);
_charsetRanges.add(range);
glyphsCovered -= range.getLeft() + 1;
}
@@ -463,16 +463,16 @@ public class CffTable implements Table {
}
@Override
- public int getSID(int gid) {
+ public int getSID(final int gid) {
if (gid == 0) {
return 0;
}
// Count through the ranges to find the one of interest
int count = 0;
- for (CharsetRange range : _charsetRanges) {
+ for (final CharsetRange range : _charsetRanges) {
if (gid < range.getLeft() + count) {
- int sid = gid - count + range.getFirst() - 1;
+ final int sid = gid - count + range.getFirst() - 1;
return sid;
}
count += range.getLeft();
@@ -481,23 +481,23 @@ public class CffTable implements Table {
}
}
- private DirectoryEntry _de;
- private int _major;
- private int _minor;
- private int _hdrSize;
- private int _offSize;
- private NameIndex _nameIndex;
- private TopDictIndex _topDictIndex;
- private StringIndex _stringIndex;
- private Index _globalSubrIndex;
- private Index _charStringsIndexArray[];
- private Charset[] _charsets;
- private Charstring[][] _charstringsArray;
-
- private byte[] _buf;
+ private final DirectoryEntry _de;
+ private final int _major;
+ private final int _minor;
+ private final int _hdrSize;
+ private final int _offSize;
+ private final NameIndex _nameIndex;
+ private final TopDictIndex _topDictIndex;
+ private final StringIndex _stringIndex;
+ private final Index _globalSubrIndex;
+ private final Index _charStringsIndexArray[];
+ private final Charset[] _charsets;
+ private final Charstring[][] _charstringsArray;
+
+ private final byte[] _buf;
/** Creates a new instance of CffTable */
- protected CffTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected CffTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
// Load entire table into a buffer, and create another input stream
@@ -537,15 +537,15 @@ public class CffTable implements Table {
// Charstrings INDEX
// We load this before Charsets because we may need to know the number
// of glyphs
- Integer charStringsOffset = (Integer) _topDictIndex.getTopDict(i).getValue(17);
+ final Integer charStringsOffset = (Integer) _topDictIndex.getTopDict(i).getValue(17);
di2 = getDataInputForOffset(charStringsOffset);
_charStringsIndexArray[i] = new Index(di2);
- int glyphCount = _charStringsIndexArray[i].getCount();
+ final int glyphCount = _charStringsIndexArray[i].getCount();
// Charsets
- Integer charsetOffset = (Integer) _topDictIndex.getTopDict(i).getValue(15);
+ final Integer charsetOffset = (Integer) _topDictIndex.getTopDict(i).getValue(15);
di2 = getDataInputForOffset(charsetOffset);
- int format = di2.readUnsignedByte();
+ final int format = di2.readUnsignedByte();
switch (format) {
case 0:
_charsets[i] = new CharsetFormat0(di2, glyphCount);
@@ -561,8 +561,8 @@ public class CffTable implements Table {
// Create the charstrings
_charstringsArray[i] = new Charstring[glyphCount];
for (int j = 0; j < glyphCount; ++j) {
- int offset = _charStringsIndexArray[i].getOffset(j) - 1;
- int len = _charStringsIndexArray[i].getOffset(j + 1) - offset - 1;
+ final int offset = _charStringsIndexArray[i].getOffset(j) - 1;
+ final int len = _charStringsIndexArray[i].getOffset(j + 1) - offset - 1;
_charstringsArray[i][j] = new CharstringType2(
i,
_stringIndex.getString(_charsets[i].getSID(j)),
@@ -575,7 +575,7 @@ public class CffTable implements Table {
}
}
- private DataInput getDataInputForOffset(int offset) {
+ private DataInput getDataInputForOffset(final int offset) {
return new DataInputStream(new ByteArrayInputStream(
_buf, offset,
_de.getLength() - offset));
@@ -585,15 +585,15 @@ public class CffTable implements Table {
return _nameIndex;
}
- public Charset getCharset(int fontIndex) {
+ public Charset getCharset(final int fontIndex) {
return _charsets[fontIndex];
}
- public Charstring getCharstring(int fontIndex, int gid) {
+ public Charstring getCharstring(final int fontIndex, final int gid) {
return _charstringsArray[fontIndex][gid];
}
- public int getCharstringCount(int fontIndex) {
+ public int getCharstringCount(final int fontIndex) {
return _charstringsArray[fontIndex].length;
}
@@ -604,7 +604,7 @@ public class CffTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'CFF' Table - Compact Font Format\n---------------------------------\n");
sb.append("\nName INDEX\n");
sb.append(_nameIndex.toString());
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
index 7a7b51890..211499357 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
@@ -106,24 +106,24 @@ public class CharstringType2 extends Charstring {
"-Reserved-"
};
- private int _index;
- private String _name;
- private int[] _data;
- private int _offset;
- private int _length;
- private CffTable.Index _localSubrIndex;
- private CffTable.Index _globalSubrIndex;
+ private final int _index;
+ private final String _name;
+ private final int[] _data;
+ private final int _offset;
+ private final int _length;
+ private final CffTable.Index _localSubrIndex;
+ private final CffTable.Index _globalSubrIndex;
private int _ip;
/** Creates a new instance of CharstringType2 */
protected CharstringType2(
- int index,
- String name,
- int[] data,
- int offset,
- int length,
- CffTable.Index localSubrIndex,
- CffTable.Index globalSubrIndex) {
+ final int index,
+ final String name,
+ final int[] data,
+ final int offset,
+ final int length,
+ final CffTable.Index localSubrIndex,
+ final CffTable.Index globalSubrIndex) {
_index = index;
_name = name;
_data = data;
@@ -143,7 +143,7 @@ public class CharstringType2 extends Charstring {
return _name;
}
- private void disassemble(StringBuilder sb) {
+ private void disassemble(final StringBuilder sb) {
Number operand = null;
while (isOperandAtIndex()) {
operand = nextOperand();
@@ -170,7 +170,7 @@ public class CharstringType2 extends Charstring {
}
public boolean isOperandAtIndex() {
- int b0 = _data[_ip];
+ final int b0 = _data[_ip];
if ((32 <= b0 && b0 <= 255) || b0 == 28) {
return true;
}
@@ -178,7 +178,7 @@ public class CharstringType2 extends Charstring {
}
public Number nextOperand() {
- int b0 = _data[_ip];
+ final int b0 = _data[_ip];
if (32 <= b0 && b0 <= 246) {
// 1 byte integer
@@ -187,29 +187,29 @@ public class CharstringType2 extends Charstring {
} else if (247 <= b0 && b0 <= 250) {
// 2 byte integer
- int b1 = _data[_ip + 1];
+ final int b1 = _data[_ip + 1];
_ip += 2;
return new Integer((b0 - 247) * 256 + b1 + 108);
} else if (251 <= b0 && b0 <= 254) {
// 2 byte integer
- int b1 = _data[_ip + 1];
+ final int b1 = _data[_ip + 1];
_ip += 2;
return new Integer(-(b0 - 251) * 256 - b1 - 108);
} else if (b0 == 28) {
// 3 byte integer
- int b1 = _data[_ip + 1];
- int b2 = _data[_ip + 2];
+ final int b1 = _data[_ip + 1];
+ final int b2 = _data[_ip + 2];
_ip += 3;
return new Integer(b1 << 8 | b2);
} else if (b0 == 255) {
// 16-bit signed integer with 16 bits of fraction
- int b1 = (byte) _data[_ip + 1];
- int b2 = _data[_ip + 2];
- int b3 = _data[_ip + 3];
- int b4 = _data[_ip + 4];
+ final int b1 = (byte) _data[_ip + 1];
+ final int b2 = _data[_ip + 2];
+ final int b3 = _data[_ip + 3];
+ final int b4 = _data[_ip + 4];
_ip += 5;
return new Float((b1 << 8 | b2) + ((b3 << 8 | b4) / 65536.0));
} else {
@@ -227,7 +227,7 @@ public class CharstringType2 extends Charstring {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
resetIP();
while (moreBytes()) {
disassemble(sb);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
index 21698c76b..a65bcd525 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
@@ -20,9 +20,9 @@ public abstract class ClassDef {
public abstract int getFormat();
- protected static ClassDef read(RandomAccessFile raf) throws IOException {
+ protected static ClassDef read(final RandomAccessFile raf) throws IOException {
ClassDef c = null;
- int format = raf.readUnsignedShort();
+ final int format = raf.readUnsignedShort();
if (format == 1) {
c = new ClassDefFormat1(raf);
} else if (format == 2) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
index 94910e4f6..cbc05393f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
@@ -18,12 +18,12 @@ import java.io.RandomAccessFile;
*/
public class ClassDefFormat1 extends ClassDef {
- private int startGlyph;
- private int glyphCount;
- private int[] classValues;
+ private final int startGlyph;
+ private final int glyphCount;
+ private final int[] classValues;
/** Creates new ClassDefFormat1 */
- public ClassDefFormat1(RandomAccessFile raf) throws IOException {
+ public ClassDefFormat1(final RandomAccessFile raf) throws IOException {
startGlyph = raf.readUnsignedShort();
glyphCount = raf.readUnsignedShort();
classValues = new int[glyphCount];
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
index 9906ecfb1..99283f026 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
@@ -18,11 +18,11 @@ import java.io.RandomAccessFile;
*/
public class ClassDefFormat2 extends ClassDef {
- private int classRangeCount;
- private RangeRecord[] classRangeRecords;
+ private final int classRangeCount;
+ private final RangeRecord[] classRangeRecords;
/** Creates new ClassDefFormat2 */
- public ClassDefFormat2(RandomAccessFile raf) throws IOException {
+ public ClassDefFormat2(final RandomAccessFile raf) throws IOException {
classRangeCount = raf.readUnsignedShort();
classRangeRecords = new RangeRecord[classRangeCount];
for (int i = 0; i < classRangeCount; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
index f7054852a..f29583ec4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
@@ -61,10 +61,10 @@ public abstract class CmapFormat {
public class Range {
- private int _startCode;
- private int _endCode;
+ private final int _startCode;
+ private final int _endCode;
- protected Range(int startCode, int endCode) {
+ protected Range(final int startCode, final int endCode) {
_startCode = startCode;
_endCode = endCode;
}
@@ -82,12 +82,12 @@ public abstract class CmapFormat {
protected int _length;
protected int _language;
- protected CmapFormat(DataInput di) throws IOException {
+ protected CmapFormat(final DataInput di) throws IOException {
_length = di.readUnsignedShort();
_language = di.readUnsignedShort();
}
- protected static CmapFormat create(int format, DataInput di)
+ protected static CmapFormat create(final int format, final DataInput di)
throws IOException {
switch(format) {
case 0:
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
index dd1ede232..505e8c942 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
@@ -61,9 +61,9 @@ import java.io.IOException;
*/
public class CmapFormat0 extends CmapFormat {
- private int[] _glyphIdArray = new int[256];
+ private final int[] _glyphIdArray = new int[256];
- protected CmapFormat0(DataInput di) throws IOException {
+ protected CmapFormat0(final DataInput di) throws IOException {
super(di);
_format = 0;
for (int i = 0; i < 256; i++) {
@@ -77,7 +77,7 @@ public class CmapFormat0 extends CmapFormat {
}
@Override
- public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+ public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
if (index != 0) {
throw new ArrayIndexOutOfBoundsException();
}
@@ -85,7 +85,7 @@ public class CmapFormat0 extends CmapFormat {
}
@Override
- public int mapCharCode(int charCode) {
+ public int mapCharCode(final int charCode) {
if (0 <= charCode && charCode < 256) {
return _glyphIdArray[charCode];
} else {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
index d071e9421..e57e509b4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
@@ -68,11 +68,11 @@ public class CmapFormat2 extends CmapFormat {
int _arrayIndex;
}
- private int[] _subHeaderKeys = new int[256];
- private SubHeader[] _subHeaders;
- private int[] _glyphIndexArray;
+ private final int[] _subHeaderKeys = new int[256];
+ private final SubHeader[] _subHeaders;
+ private final int[] _glyphIndexArray;
- protected CmapFormat2(DataInput di) throws IOException {
+ protected CmapFormat2(final DataInput di) throws IOException {
super(di);
_format = 2;
@@ -86,15 +86,15 @@ public class CmapFormat2 extends CmapFormat {
highest = Math.max(highest, _subHeaderKeys[i]);
pos += 2;
}
- int subHeaderCount = highest / 8 + 1;
+ final int subHeaderCount = highest / 8 + 1;
_subHeaders = new SubHeader[subHeaderCount];
// Read the subheaders, once again noting the highest glyphIndexArray
// index range.
- int indexArrayOffset = 8 * subHeaderCount + 518;
+ final int indexArrayOffset = 8 * subHeaderCount + 518;
highest = 0;
for (int i = 0; i < _subHeaders.length; ++i) {
- SubHeader sh = new SubHeader();
+ final SubHeader sh = new SubHeader();
sh._firstCode = di.readUnsignedShort();
sh._entryCount = di.readUnsignedShort();
sh._idDelta = di.readShort();
@@ -124,7 +124,7 @@ public class CmapFormat2 extends CmapFormat {
}
@Override
- public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+ public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
if (index < 0 || index >= _subHeaders.length) {
throw new ArrayIndexOutOfBoundsException();
}
@@ -147,18 +147,18 @@ public class CmapFormat2 extends CmapFormat {
}
@Override
- public int mapCharCode(int charCode) {
+ public int mapCharCode(final int charCode) {
// Get the appropriate subheader
int index = 0;
- int highByte = charCode >> 8;
+ final int highByte = charCode >> 8;
if (highByte != 0) {
index = _subHeaderKeys[highByte] / 8;
}
- SubHeader sh = _subHeaders[index];
+ final SubHeader sh = _subHeaders[index];
// Is the charCode out-of-range?
- int lowByte = charCode & 0xff;
+ final int lowByte = charCode & 0xff;
if (lowByte < sh._firstCode ||
lowByte >= (sh._firstCode + sh._entryCount)) {
return 0;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
index 2ae23d031..f84a4eab3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
@@ -59,18 +59,18 @@ import java.io.IOException;
*/
public class CmapFormat4 extends CmapFormat {
- private int _segCountX2;
- private int _searchRange;
- private int _entrySelector;
- private int _rangeShift;
- private int[] _endCode;
- private int[] _startCode;
- private int[] _idDelta;
- private int[] _idRangeOffset;
- private int[] _glyphIdArray;
- private int _segCount;
-
- protected CmapFormat4(DataInput di) throws IOException {
+ private final int _segCountX2;
+ private final int _searchRange;
+ private final int _entrySelector;
+ private final int _rangeShift;
+ private final int[] _endCode;
+ private final int[] _startCode;
+ private final int[] _idDelta;
+ private final int[] _idRangeOffset;
+ private final int[] _glyphIdArray;
+ private final int _segCount;
+
+ protected CmapFormat4(final DataInput di) throws IOException {
super(di); // 6
_format = 4;
_segCountX2 = di.readUnsignedShort(); // +2 (8)
@@ -97,7 +97,7 @@ public class CmapFormat4 extends CmapFormat {
} // + 2*segCount (8*segCount + 16)
// Whatever remains of this header belongs in glyphIdArray
- int count = (_length - (8*_segCount + 16)) / 2;
+ final int count = (_length - (8*_segCount + 16)) / 2;
_glyphIdArray = new int[count];
for (int i = 0; i < count; i++) {
_glyphIdArray[i] = di.readUnsignedShort();
@@ -116,7 +116,7 @@ public class CmapFormat4 extends CmapFormat {
}
@Override
- public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+ public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
if (index < 0 || index >= _segCount) {
throw new ArrayIndexOutOfBoundsException();
}
@@ -124,7 +124,7 @@ public class CmapFormat4 extends CmapFormat {
}
@Override
- public int mapCharCode(int charCode) {
+ public int mapCharCode(final int charCode) {
try {
for (int i = 0; i < _segCount; i++) {
if (_endCode[i] >= charCode) {
@@ -139,7 +139,7 @@ public class CmapFormat4 extends CmapFormat {
}
}
}
- } catch (ArrayIndexOutOfBoundsException e) {
+ } catch (final ArrayIndexOutOfBoundsException e) {
System.err.println("error: Array out of bounds - " + e.getMessage());
}
return 0;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
index 2a33d8d40..eff3d2fb1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
@@ -64,7 +64,7 @@ public class CmapFormat6 extends CmapFormat {
private short _entryCount;
private short[] _glyphIdArray;
- protected CmapFormat6(DataInput di) throws IOException {
+ protected CmapFormat6(final DataInput di) throws IOException {
super(di);
_format = 6;
@@ -79,12 +79,12 @@ public class CmapFormat6 extends CmapFormat {
}
@Override
- public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+ public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
throw new ArrayIndexOutOfBoundsException();
}
@Override
- public int mapCharCode(int charCode) {
+ public int mapCharCode(final int charCode) {
return 0;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
index 392683bcd..e9aa1d4e0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
@@ -32,7 +32,7 @@ import java.io.IOException;
public class CmapFormatUnknown extends CmapFormat {
/** Creates a new instance of CmapFormatUnknown */
- protected CmapFormatUnknown(int format, DataInput di) throws IOException {
+ protected CmapFormatUnknown(final int format, final DataInput di) throws IOException {
super(di);
_format = format;
@@ -46,12 +46,12 @@ public class CmapFormatUnknown extends CmapFormat {
}
@Override
- public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+ public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
throw new ArrayIndexOutOfBoundsException();
}
@Override
- public int mapCharCode(int charCode) {
+ public int mapCharCode(final int charCode) {
return 0;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
index 4833318d5..1f2c80286 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
@@ -59,12 +59,12 @@ import java.io.IOException;
*/
public class CmapIndexEntry implements Comparable {
- private int _platformId;
- private int _encodingId;
- private int _offset;
+ private final int _platformId;
+ private final int _encodingId;
+ private final int _offset;
private CmapFormat _format;
- protected CmapIndexEntry(DataInput di) throws IOException {
+ protected CmapIndexEntry(final DataInput di) throws IOException {
_platformId = di.readUnsignedShort();
_encodingId = di.readUnsignedShort();
_offset = di.readInt();
@@ -86,7 +86,7 @@ public class CmapIndexEntry implements Comparable {
return _format;
}
- public void setFormat(CmapFormat format) {
+ public void setFormat(final CmapFormat format) {
_format = format;
}
@@ -106,8 +106,8 @@ public class CmapIndexEntry implements Comparable {
}
@Override
- public int compareTo(java.lang.Object obj) {
- CmapIndexEntry entry = (CmapIndexEntry) obj;
+ public int compareTo(final java.lang.Object obj) {
+ final CmapIndexEntry entry = (CmapIndexEntry) obj;
if (getOffset() < entry.getOffset()) {
return -1;
} else if (getOffset() > entry.getOffset()) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
index 2cdddb3ef..4623eb5cf 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
@@ -61,12 +61,12 @@ import java.util.Arrays;
*/
public class CmapTable implements Table {
- private DirectoryEntry _de;
- private int _version;
- private int _numTables;
- private CmapIndexEntry[] _entries;
+ private final DirectoryEntry _de;
+ private final int _version;
+ private final int _numTables;
+ private final CmapIndexEntry[] _entries;
- protected CmapTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected CmapTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
_version = di.readUnsignedShort();
_numTables = di.readUnsignedShort();
@@ -98,7 +98,7 @@ public class CmapTable implements Table {
// Something is amiss
throw new IOException();
}
- int formatType = di.readUnsignedShort();
+ final int formatType = di.readUnsignedShort();
lastFormat = CmapFormat.create(formatType, di);
lastOffset = _entries[i].getOffset();
_entries[i].setFormat(lastFormat);
@@ -114,11 +114,11 @@ public class CmapTable implements Table {
return _numTables;
}
- public CmapIndexEntry getCmapIndexEntry(int i) {
+ public CmapIndexEntry getCmapIndexEntry(final int i) {
return _entries[i];
}
- public CmapFormat getCmapFormat(short platformId, short encodingId) {
+ public CmapFormat getCmapFormat(final short platformId, final short encodingId) {
// Find the requested format
for (int i = 0; i < _numTables; i++) {
@@ -137,7 +137,7 @@ public class CmapTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder().append("cmap\n");
+ final StringBuilder sb = new StringBuilder().append("cmap\n");
// Get each of the index entries
for (int i = 0; i < _numTables; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
index 4f526f51d..a6f994f95 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
@@ -69,9 +69,9 @@ public abstract class Coverage {
*/
public abstract int findGlyph(int glyphId);
- protected static Coverage read(DataInput di) throws IOException {
+ protected static Coverage read(final DataInput di) throws IOException {
Coverage c = null;
- int format = di.readUnsignedShort();
+ final int format = di.readUnsignedShort();
if (format == 1) {
c = new CoverageFormat1(di);
} else if (format == 2) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java
index 715bf11ec..3deb60202 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java
@@ -60,11 +60,11 @@ import java.io.IOException;
*/
public class CoverageFormat1 extends Coverage {
- private int _glyphCount;
- private int[] _glyphIds;
+ private final int _glyphCount;
+ private final int[] _glyphIds;
/** Creates new CoverageFormat1 */
- protected CoverageFormat1(DataInput di) throws IOException {
+ protected CoverageFormat1(final DataInput di) throws IOException {
_glyphCount = di.readUnsignedShort();
_glyphIds = new int[_glyphCount];
for (int i = 0; i < _glyphCount; i++) {
@@ -78,7 +78,7 @@ public class CoverageFormat1 extends Coverage {
}
@Override
- public int findGlyph(int glyphId) {
+ public int findGlyph(final int glyphId) {
for (int i = 0; i < _glyphCount; i++) {
if (_glyphIds[i] == glyphId) {
return i;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java
index bd2a28f79..9397f376d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java
@@ -60,11 +60,11 @@ import java.io.IOException;
*/
public class CoverageFormat2 extends Coverage {
- private int _rangeCount;
- private RangeRecord[] _rangeRecords;
+ private final int _rangeCount;
+ private final RangeRecord[] _rangeRecords;
/** Creates new CoverageFormat2 */
- protected CoverageFormat2(DataInput di) throws IOException {
+ protected CoverageFormat2(final DataInput di) throws IOException {
_rangeCount = di.readUnsignedShort();
_rangeRecords = new RangeRecord[_rangeCount];
for (int i = 0; i < _rangeCount; i++) {
@@ -78,9 +78,9 @@ public class CoverageFormat2 extends Coverage {
}
@Override
- public int findGlyph(int glyphId) {
+ public int findGlyph(final int glyphId) {
for (int i = 0; i < _rangeCount; i++) {
- int n = _rangeRecords[i].getCoverageIndex(glyphId);
+ final int n = _rangeRecords[i].getCoverageIndex(glyphId);
if (n > -1) {
return n;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
index 9e1c47de9..7f62d26ab 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
@@ -17,12 +17,12 @@ import java.io.IOException;
*/
public class CvtTable implements Table {
- private DirectoryEntry de;
- private short[] values;
+ private final DirectoryEntry de;
+ private final short[] values;
- protected CvtTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected CvtTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
- int len = de.getLength() / 2;
+ final int len = de.getLength() / 2;
values = new short[len];
for (int i = 0; i < len; i++) {
values[i] = di.readShort();
@@ -40,7 +40,7 @@ public class CvtTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'cvt ' Table - Control Value Table\n----------------------------------\n");
sb.append("Size = ").append(0).append(" bytes, ").append(values.length).append(" entries\n");
sb.append(" Values\n ------\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
index 5451f4502..a0b10e187 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
@@ -18,13 +18,13 @@ import java.io.RandomAccessFile;
*/
public class Device extends Object {
- private int startSize;
- private int endSize;
- private int deltaFormat;
- private int[] deltaValues;
+ private final int startSize;
+ private final int endSize;
+ private final int deltaFormat;
+ private final int[] deltaValues;
/** Creates new Device */
- public Device(RandomAccessFile raf) throws IOException {
+ public Device(final RandomAccessFile raf) throws IOException {
startSize = raf.readUnsignedShort();
endSize = raf.readUnsignedShort();
deltaFormat = raf.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
index e34fa32e8..54684b8e9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
@@ -59,12 +59,12 @@ import java.io.IOException;
*/
public class DirectoryEntry implements Cloneable {
- private int _tag;
- private int _checksum;
- private int _offset;
- private int _length;
+ private final int _tag;
+ private final int _checksum;
+ private final int _offset;
+ private final int _length;
- protected DirectoryEntry(DataInput di) throws IOException {
+ protected DirectoryEntry(final DataInput di) throws IOException {
_tag = di.readInt();
_checksum = di.readInt();
_offset = di.readInt();
@@ -75,7 +75,7 @@ public class DirectoryEntry implements Cloneable {
public Object clone() {
try {
return super.clone();
- } catch (CloneNotSupportedException e) {
+ } catch (final CloneNotSupportedException e) {
return null;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
index 4a09a4c34..ec7b503f1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
@@ -18,12 +18,12 @@ import java.io.DataInput;
*/
public class DsigEntry {
- private int format;
- private int length;
- private int offset;
+ private final int format;
+ private final int length;
+ private final int offset;
/** Creates new DsigEntry */
- protected DsigEntry(DataInput di) throws IOException {
+ protected DsigEntry(final DataInput di) throws IOException {
format = di.readInt();
length = di.readInt();
offset = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
index 2b85f52d8..f2b1322c0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
@@ -18,15 +18,15 @@ import java.io.DataInput;
*/
public class DsigTable implements Table {
- private DirectoryEntry de;
- private int version;
- private int numSigs;
- private int flag;
- private DsigEntry[] dsigEntry;
- private SignatureBlock[] sigBlocks;
+ private final DirectoryEntry de;
+ private final int version;
+ private final int numSigs;
+ private final int flag;
+ private final DsigEntry[] dsigEntry;
+ private final SignatureBlock[] sigBlocks;
/** Creates new DsigTable */
- protected DsigTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected DsigTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readInt();
numSigs = di.readUnsignedShort();
@@ -63,7 +63,7 @@ public class DsigTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder().append("DSIG\n");
+ final StringBuilder sb = new StringBuilder().append("DSIG\n");
for (int i = 0; i < numSigs; i++) {
sb.append(sigBlocks[i].toString());
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java
index ee27896a4..c6f912569 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java
@@ -60,12 +60,12 @@ import java.io.IOException;
*/
public class Feature {
- private int _featureParams;
- private int _lookupCount;
- private int[] _lookupListIndex;
+ private final int _featureParams;
+ private final int _lookupCount;
+ private final int[] _lookupListIndex;
/** Creates new Feature */
- protected Feature(DataInput di) throws IOException {
+ protected Feature(final DataInput di) throws IOException {
_featureParams = di.readUnsignedShort();
_lookupCount = di.readUnsignedShort();
_lookupListIndex = new int[_lookupCount];
@@ -78,7 +78,7 @@ public class Feature {
return _lookupCount;
}
- public int getLookupListIndex(int i) {
+ public int getLookupListIndex(final int i) {
return _lookupListIndex[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
index fdedca94a..933378068 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
@@ -60,12 +60,12 @@ import java.io.IOException;
*/
public class FeatureList {
- private int _featureCount;
- private FeatureRecord[] _featureRecords;
- private Feature[] _features;
+ private final int _featureCount;
+ private final FeatureRecord[] _featureRecords;
+ private final Feature[] _features;
/** Creates new FeatureList */
- public FeatureList(DataInputStream dis, int offset) throws IOException {
+ public FeatureList(final DataInputStream dis, final int offset) throws IOException {
// Ensure we're in the right place
dis.reset();
@@ -89,19 +89,19 @@ public class FeatureList {
return _featureCount;
}
- public FeatureRecord getFeatureRecord(int i) {
+ public FeatureRecord getFeatureRecord(final int i) {
return _featureRecords[i];
}
- public Feature getFeature(int i) {
+ public Feature getFeature(final int i) {
return _features[i];
}
- public Feature findFeature(LangSys langSys, String tag) {
+ public Feature findFeature(final LangSys langSys, final String tag) {
if (tag.length() != 4) {
return null;
}
- int tagVal = ((tag.charAt(0)<<24)
+ final int tagVal = ((tag.charAt(0)<<24)
| (tag.charAt(1)<<16)
| (tag.charAt(2)<<8)
| tag.charAt(3));
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
index 1da74f4d5..06506904f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
@@ -60,11 +60,11 @@ import java.io.IOException;
*/
public class FeatureRecord {
- private int _tag;
- private int _offset;
+ private final int _tag;
+ private final int _offset;
/** Creates new FeatureRecord */
- protected FeatureRecord(DataInput di) throws IOException {
+ protected FeatureRecord(final DataInput di) throws IOException {
_tag = di.readInt();
_offset = di.readUnsignedShort();
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
index 467a4f360..e44acfa02 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
@@ -19,9 +19,9 @@ import jogamp.graph.font.typecast.ot.Disassembler;
*/
public class FpgmTable extends Program implements Table {
- private DirectoryEntry de;
+ private final DirectoryEntry de;
- protected FpgmTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected FpgmTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
readInstructions(di, de.getLength());
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
index cc87b19a4..cebc51646 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
@@ -21,18 +21,18 @@ public class GaspRange {
public static final int GASP_GRIDFIT = 1;
public static final int GASP_DOGRAY = 2;
- private int rangeMaxPPEM;
- private int rangeGaspBehavior;
+ private final int rangeMaxPPEM;
+ private final int rangeGaspBehavior;
/** Creates new GaspRange */
- protected GaspRange(DataInput di) throws IOException {
+ protected GaspRange(final DataInput di) throws IOException {
rangeMaxPPEM = di.readUnsignedShort();
rangeGaspBehavior = di.readUnsignedShort();
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(" rangeMaxPPEM: ").append(rangeMaxPPEM)
.append("\n rangeGaspBehavior: 0x").append(rangeGaspBehavior);
if ((rangeGaspBehavior & GASP_GRIDFIT) != 0) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
index 8f91e6d00..7bf7f96cc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
@@ -18,13 +18,13 @@ import java.io.IOException;
*/
public class GaspTable implements Table {
- private DirectoryEntry de;
- private int version;
- private int numRanges;
- private GaspRange[] gaspRange;
+ private final DirectoryEntry de;
+ private final int version;
+ private final int numRanges;
+ private final GaspRange[] gaspRange;
/** Creates new GaspTable */
- protected GaspTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected GaspTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readUnsignedShort();
numRanges = di.readUnsignedShort();
@@ -41,7 +41,7 @@ public class GaspTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'gasp' Table - Grid-fitting And Scan-conversion Procedure\n---------------------------------------------------------");
sb.append("\n 'gasp' version: ").append(version);
sb.append("\n numRanges: ").append(numRanges);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java
index e5c86873e..4db4ddcc2 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java
@@ -69,12 +69,12 @@ public class GlyfCompositeComp {
public static final short WE_HAVE_INSTRUCTIONS = 0x0100;
public static final short USE_MY_METRICS = 0x0200;
- private int _firstIndex;
- private int _firstContour;
+ private final int _firstIndex;
+ private final int _firstContour;
private short _argument1;
private short _argument2;
- private int _flags;
- private int _glyphIndex;
+ private final int _flags;
+ private final int _glyphIndex;
private double _xscale = 1.0;
private double _yscale = 1.0;
private double _scale01 = 0.0;
@@ -84,7 +84,7 @@ public class GlyfCompositeComp {
private int _point1 = 0;
private int _point2 = 0;
- protected GlyfCompositeComp(int firstIndex, int firstContour, DataInput di)
+ protected GlyfCompositeComp(final int firstIndex, final int firstContour, final DataInput di)
throws IOException {
_firstIndex = firstIndex;
_firstContour = firstContour;
@@ -96,8 +96,8 @@ public class GlyfCompositeComp {
_argument1 = di.readShort();
_argument2 = di.readShort();
} else {
- _argument1 = (short) di.readByte();
- _argument2 = (short) di.readByte();
+ _argument1 = di.readByte();
+ _argument2 = di.readByte();
}
// Assign the arguments according to the flags
@@ -111,7 +111,7 @@ public class GlyfCompositeComp {
// Get the scale values (if any)
if ((_flags & WE_HAVE_A_SCALE) != 0) {
- int i = di.readShort();
+ final int i = di.readShort();
_xscale = _yscale = (double) i / (double) 0x4000;
} else if ((_flags & WE_HAVE_AN_X_AND_Y_SCALE) != 0) {
short i = di.readShort();
@@ -184,8 +184,8 @@ public class GlyfCompositeComp {
* @param y The y-coordinate of the point to transform
* @return The transformed x-coordinate
*/
- public int scaleX(int x, int y) {
- return (int)((double) x * _xscale + (double) y * _scale10);
+ public int scaleX(final int x, final int y) {
+ return (int)(x * _xscale + y * _scale10);
}
/**
@@ -194,7 +194,7 @@ public class GlyfCompositeComp {
* @param y The y-coordinate of the point to transform
* @return The transformed y-coordinate
*/
- public int scaleY(int x, int y) {
- return (int)((double) x * _scale01 + (double) y * _yscale);
+ public int scaleY(final int x, final int y) {
+ return (int)(x * _scale01 + y * _yscale);
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
index fabc71a77..3879da02a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
@@ -69,9 +69,9 @@ public class GlyfCompositeDescript extends GlyfDescript {
new ArrayList<GlyfCompositeComp>();
public GlyfCompositeDescript(
- GlyfTable parentTable,
- int glyphIndex,
- DataInput di) throws IOException {
+ final GlyfTable parentTable,
+ final int glyphIndex,
+ final DataInput di) throws IOException {
super(parentTable, glyphIndex, (short) -1, di);
// Get all of the composite components
@@ -81,7 +81,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
try {
do {
_components.add(comp = new GlyfCompositeComp(firstIndex, firstContour, di));
- GlyfDescript desc = parentTable.getDescription(comp.getGlyphIndex());
+ final GlyfDescript desc = parentTable.getDescription(comp.getGlyphIndex());
if (desc != null) {
firstIndex += desc.getPointCount();
firstContour += desc.getContourCount();
@@ -92,7 +92,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
if ((comp.getFlags() & GlyfCompositeComp.WE_HAVE_INSTRUCTIONS) != 0) {
readInstructions(di, di.readShort());
}
- } catch (IOException e) {
+ } catch (final IOException e) {
throw e;
// } catch (Exception e) {
// int foo = 0;
@@ -100,33 +100,33 @@ public class GlyfCompositeDescript extends GlyfDescript {
}
@Override
- public int getEndPtOfContours(int i) {
- GlyfCompositeComp c = getCompositeCompEndPt(i);
+ public int getEndPtOfContours(final int i) {
+ final GlyfCompositeComp c = getCompositeCompEndPt(i);
if (c != null) {
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
return gd.getEndPtOfContours(i - c.getFirstContour()) + c.getFirstIndex();
}
return 0;
}
@Override
- public byte getFlags(int i) {
- GlyfCompositeComp c = getCompositeComp(i);
+ public byte getFlags(final int i) {
+ final GlyfCompositeComp c = getCompositeComp(i);
if (c != null) {
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
return gd.getFlags(i - c.getFirstIndex());
}
return 0;
}
@Override
- public short getXCoordinate(int i) {
- GlyfCompositeComp c = getCompositeComp(i);
+ public short getXCoordinate(final int i) {
+ final GlyfCompositeComp c = getCompositeComp(i);
if (c != null) {
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
- int n = i - c.getFirstIndex();
- int x = gd.getXCoordinate(n);
- int y = gd.getYCoordinate(n);
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final int n = i - c.getFirstIndex();
+ final int x = gd.getXCoordinate(n);
+ final int y = gd.getYCoordinate(n);
short x1 = (short) c.scaleX(x, y);
x1 += c.getXTranslate();
return x1;
@@ -135,13 +135,13 @@ public class GlyfCompositeDescript extends GlyfDescript {
}
@Override
- public short getYCoordinate(int i) {
- GlyfCompositeComp c = getCompositeComp(i);
+ public short getYCoordinate(final int i) {
+ final GlyfCompositeComp c = getCompositeComp(i);
if (c != null) {
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
- int n = i - c.getFirstIndex();
- int x = gd.getXCoordinate(n);
- int y = gd.getYCoordinate(n);
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final int n = i - c.getFirstIndex();
+ final int x = gd.getXCoordinate(n);
+ final int y = gd.getYCoordinate(n);
short y1 = (short) c.scaleY(x, y);
y1 += c.getYTranslate();
return y1;
@@ -156,8 +156,8 @@ public class GlyfCompositeDescript extends GlyfDescript {
@Override
public int getPointCount() {
- GlyfCompositeComp c = _components.get(_components.size()-1);
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final GlyfCompositeComp c = _components.get(_components.size()-1);
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
if (gd != null) {
return c.getFirstIndex() + gd.getPointCount();
} else {
@@ -172,7 +172,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
return c.getFirstContour() + ( null != d ? d.getContourCount() : 0 );
}
- public int getComponentIndex(int i) {
+ public int getComponentIndex(final int i) {
return _components.get(i).getFirstIndex();
}
@@ -180,15 +180,15 @@ public class GlyfCompositeDescript extends GlyfDescript {
return _components.size();
}
- public GlyfCompositeComp getComponent(int i) {
+ public GlyfCompositeComp getComponent(final int i) {
return _components.get(i);
}
- protected GlyfCompositeComp getCompositeComp(int i) {
+ protected GlyfCompositeComp getCompositeComp(final int i) {
GlyfCompositeComp c;
for (int n = 0; n < _components.size(); n++) {
c = _components.get(n);
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
if (c.getFirstIndex() <= i && i < (c.getFirstIndex() + gd.getPointCount())) {
return c;
}
@@ -196,11 +196,11 @@ public class GlyfCompositeDescript extends GlyfDescript {
return null;
}
- protected GlyfCompositeComp getCompositeCompEndPt(int i) {
+ protected GlyfCompositeComp getCompositeCompEndPt(final int i) {
GlyfCompositeComp c;
for (int j = 0; j < _components.size(); j++) {
c = _components.get(j);
- GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+ final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
if (c.getFirstContour() <= i && i < (c.getFirstContour() + gd.getContourCount())) {
return c;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
index 6b06eb3de..3d2154d5a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
@@ -69,17 +69,17 @@ public abstract class GlyfDescript extends Program implements GlyphDescription {
protected GlyfTable _parentTable;
private int _glyphIndex;
- private int _numberOfContours;
- private short _xMin;
- private short _yMin;
- private short _xMax;
- private short _yMax;
+ private final int _numberOfContours;
+ private final short _xMin;
+ private final short _yMin;
+ private final short _xMax;
+ private final short _yMax;
protected GlyfDescript(
- GlyfTable parentTable,
- int glyphIndex,
- short numberOfContours,
- DataInput di) throws IOException {
+ final GlyfTable parentTable,
+ final int glyphIndex,
+ final short numberOfContours,
+ final DataInput di) throws IOException {
_parentTable = parentTable;
_numberOfContours = numberOfContours;
_xMin = di.readShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
index c06ceaa13..041c0f04c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
@@ -61,17 +61,17 @@ import jogamp.graph.font.typecast.ot.Disassembler;
*/
public class GlyfSimpleDescript extends GlyfDescript {
- private int[] _endPtsOfContours;
- private byte[] _flags;
- private short[] _xCoordinates;
- private short[] _yCoordinates;
- private int _count;
+ private final int[] _endPtsOfContours;
+ private final byte[] _flags;
+ private final short[] _xCoordinates;
+ private final short[] _yCoordinates;
+ private final int _count;
public GlyfSimpleDescript(
- GlyfTable parentTable,
- int glyphIndex,
- short numberOfContours,
- DataInput di) throws IOException {
+ final GlyfTable parentTable,
+ final int glyphIndex,
+ final short numberOfContours,
+ final DataInput di) throws IOException {
super(parentTable, glyphIndex, numberOfContours, di);
// Simple glyph description
@@ -86,29 +86,29 @@ public class GlyfSimpleDescript extends GlyfDescript {
_xCoordinates = new short[_count];
_yCoordinates = new short[_count];
- int instructionCount = di.readShort();
+ final int instructionCount = di.readShort();
readInstructions(di, instructionCount);
readFlags(_count, di);
readCoords(_count, di);
}
@Override
- public int getEndPtOfContours(int i) {
+ public int getEndPtOfContours(final int i) {
return _endPtsOfContours[i];
}
@Override
- public byte getFlags(int i) {
+ public byte getFlags(final int i) {
return _flags[i];
}
@Override
- public short getXCoordinate(int i) {
+ public short getXCoordinate(final int i) {
return _xCoordinates[i];
}
@Override
- public short getYCoordinate(int i) {
+ public short getYCoordinate(final int i) {
return _yCoordinates[i];
}
@@ -138,7 +138,7 @@ public class GlyfSimpleDescript extends GlyfDescript {
/**
* The table is stored as relative values, but we'll store them as absolutes
*/
- private void readCoords(int count, DataInput di) throws IOException {
+ private void readCoords(final int count, final DataInput di) throws IOException {
short x = 0;
short y = 0;
for (int i = 0; i < count; i++) {
@@ -175,26 +175,26 @@ public class GlyfSimpleDescript extends GlyfDescript {
/**
* The flags are run-length encoded
*/
- private void readFlags(int flagCount, DataInput di) throws IOException {
+ private void readFlags(final int flagCount, final DataInput di) throws IOException {
try {
for (int index = 0; index < flagCount; index++) {
_flags[index] = di.readByte();
if ((_flags[index] & repeat) != 0) {
- int repeats = di.readByte();
+ final int repeats = di.readByte();
for (int i = 1; i <= repeats; i++) {
_flags[index + i] = _flags[index];
}
index += repeats;
}
}
- } catch (ArrayIndexOutOfBoundsException e) {
+ } catch (final ArrayIndexOutOfBoundsException e) {
System.out.println("error: array index out of bounds");
}
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(super.toString());
sb.append("\n\n EndPoints\n ---------");
for (int i = 0; i < _endPtsOfContours.length; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
index 4b196c9e2..6750e9394 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
@@ -61,30 +61,30 @@ import java.io.IOException;
*/
public class GlyfTable implements Table {
- private DirectoryEntry _de;
- private GlyfDescript[] _descript;
+ private final DirectoryEntry _de;
+ private final GlyfDescript[] _descript;
protected GlyfTable(
- DirectoryEntry de,
- DataInput di,
- MaxpTable maxp,
- LocaTable loca) throws IOException {
+ final DirectoryEntry de,
+ final DataInput di,
+ final MaxpTable maxp,
+ final LocaTable loca) throws IOException {
_de = (DirectoryEntry) de.clone();
_descript = new GlyfDescript[maxp.getNumGlyphs()];
// Buffer the whole table so we can randomly access it
- byte[] buf = new byte[de.getLength()];
+ final byte[] buf = new byte[de.getLength()];
di.readFully(buf);
- ByteArrayInputStream bais = new ByteArrayInputStream(buf);
+ final ByteArrayInputStream bais = new ByteArrayInputStream(buf);
// Process all the simple glyphs
for (int i = 0; i < maxp.getNumGlyphs(); i++) {
- int len = loca.getOffset(i + 1) - loca.getOffset(i);
+ final int len = loca.getOffset(i + 1) - loca.getOffset(i);
if (len > 0) {
bais.reset();
bais.skip(loca.getOffset(i));
- DataInputStream dis = new DataInputStream(bais);
- short numberOfContours = dis.readShort();
+ final DataInputStream dis = new DataInputStream(bais);
+ final short numberOfContours = dis.readShort();
if (numberOfContours >= 0) {
_descript[i] = new GlyfSimpleDescript(this, i, numberOfContours, dis);
}
@@ -95,12 +95,12 @@ public class GlyfTable implements Table {
// Now do all the composite glyphs
for (int i = 0; i < maxp.getNumGlyphs(); i++) {
- int len = loca.getOffset(i + 1) - loca.getOffset(i);
+ final int len = loca.getOffset(i + 1) - loca.getOffset(i);
if (len > 0) {
bais.reset();
bais.skip(loca.getOffset(i));
- DataInputStream dis = new DataInputStream(bais);
- short numberOfContours = dis.readShort();
+ final DataInputStream dis = new DataInputStream(bais);
+ final short numberOfContours = dis.readShort();
if (numberOfContours < 0) {
_descript[i] = new GlyfCompositeDescript(this, i, dis);
}
@@ -108,7 +108,7 @@ public class GlyfTable implements Table {
}
}
- public GlyfDescript getDescription(int i) {
+ public GlyfDescript getDescription(final int i) {
if (i < _descript.length) {
return _descript[i];
} else {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
index 30ecdd051..f10d4e299 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
@@ -30,16 +30,16 @@ import java.io.IOException;
*/
public class GposTable implements Table {
- private DirectoryEntry _de;
+ private final DirectoryEntry _de;
- protected GposTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected GposTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
// GPOS Header
- int version = di.readInt();
- int scriptList = di.readInt();
- int featureList = di.readInt();
- int lookupList = di.readInt();
+ final int version = di.readInt();
+ final int scriptList = di.readInt();
+ final int featureList = di.readInt();
+ final int lookupList = di.readInt();
}
/** Get the table type, as a table directory value.
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
index c23d420a8..f09973f99 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
@@ -62,24 +62,24 @@ import java.io.IOException;
*/
public class GsubTable implements Table, LookupSubtableFactory {
- private DirectoryEntry _de;
- private ScriptList _scriptList;
- private FeatureList _featureList;
- private LookupList _lookupList;
+ private final DirectoryEntry _de;
+ private final ScriptList _scriptList;
+ private final FeatureList _featureList;
+ private final LookupList _lookupList;
- protected GsubTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected GsubTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
// Load into a temporary buffer, and create another input stream
- byte[] buf = new byte[de.getLength()];
+ final byte[] buf = new byte[de.getLength()];
di.readFully(buf);
- DataInputStream dis = new DataInputStream(new ByteArrayInputStream(buf));
+ final DataInputStream dis = new DataInputStream(new ByteArrayInputStream(buf));
// GSUB Header
- int version = dis.readInt();
- int scriptListOffset = dis.readUnsignedShort();
- int featureListOffset = dis.readUnsignedShort();
- int lookupListOffset = dis.readUnsignedShort();
+ final int version = dis.readInt();
+ final int scriptListOffset = dis.readUnsignedShort();
+ final int featureListOffset = dis.readUnsignedShort();
+ final int lookupListOffset = dis.readUnsignedShort();
// Script List
_scriptList = new ScriptList(dis, scriptListOffset);
@@ -101,9 +101,9 @@ public class GsubTable implements Table, LookupSubtableFactory {
*/
@Override
public LookupSubtable read(
- int type,
- DataInputStream dis,
- int offset) throws IOException {
+ final int type,
+ final DataInputStream dis,
+ final int offset) throws IOException {
LookupSubtable s = null;
switch (type) {
case 1:
@@ -153,7 +153,7 @@ public class GsubTable implements Table, LookupSubtableFactory {
return "GSUB";
}
- public static String lookupTypeAsString(int type) {
+ public static String lookupTypeAsString(final int type) {
switch (type) {
case 1:
return "Single";
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
index 64f5e6415..c3b875a2c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
@@ -33,11 +33,11 @@ public class HdmxTable implements Table {
public class DeviceRecord {
- private short _pixelSize;
- private short _maxWidth;
- private short[] _widths;
+ private final short _pixelSize;
+ private final short _maxWidth;
+ private final short[] _widths;
- protected DeviceRecord(int numGlyphs, DataInput di) throws IOException {
+ protected DeviceRecord(final int numGlyphs, final DataInput di) throws IOException {
_pixelSize = di.readByte();
_maxWidth = di.readByte();
_widths = new short[numGlyphs];
@@ -58,20 +58,20 @@ public class HdmxTable implements Table {
return _widths;
}
- public short getWidth(int glyphidx) {
+ public short getWidth(final int glyphidx) {
return _widths[glyphidx];
}
}
- private DirectoryEntry _de;
- private int _version;
- private short _numRecords;
- private int _sizeDeviceRecords;
- private DeviceRecord[] _records;
+ private final DirectoryEntry _de;
+ private final int _version;
+ private final short _numRecords;
+ private final int _sizeDeviceRecords;
+ private final DeviceRecord[] _records;
/** Creates a new instance of HdmxTable */
- protected HdmxTable(DirectoryEntry de, DataInput di, MaxpTable maxp)
+ protected HdmxTable(final DirectoryEntry de, final DataInput di, final MaxpTable maxp)
throws IOException {
_de = (DirectoryEntry) de.clone();
_version = di.readUnsignedShort();
@@ -89,7 +89,7 @@ public class HdmxTable implements Table {
return _numRecords;
}
- public DeviceRecord getRecord(int i) {
+ public DeviceRecord getRecord(final int i) {
return _records[i];
}
@@ -100,7 +100,7 @@ public class HdmxTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'hdmx' Table - Horizontal Device Metrics\n----------------------------------------\n");
sb.append("Size = ").append(_de.getLength()).append(" bytes\n")
.append("\t'hdmx' version: ").append(_version).append("\n")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
index 47e60f900..85158ea3e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
@@ -62,26 +62,26 @@ import jogamp.graph.font.typecast.ot.Fixed;
*/
public class HeadTable implements Table {
- private DirectoryEntry _de;
- private int _versionNumber;
- private int _fontRevision;
- private int _checkSumAdjustment;
- private int _magicNumber;
- private short _flags;
- private short _unitsPerEm;
- private long _created;
- private long _modified;
- private short _xMin;
- private short _yMin;
- private short _xMax;
- private short _yMax;
- private short _macStyle;
- private short _lowestRecPPEM;
- private short _fontDirectionHint;
- private short _indexToLocFormat;
- private short _glyphDataFormat;
-
- protected HeadTable(DirectoryEntry de, DataInput di) throws IOException {
+ private final DirectoryEntry _de;
+ private final int _versionNumber;
+ private final int _fontRevision;
+ private final int _checkSumAdjustment;
+ private final int _magicNumber;
+ private final short _flags;
+ private final short _unitsPerEm;
+ private final long _created;
+ private final long _modified;
+ private final short _xMin;
+ private final short _yMin;
+ private final short _xMax;
+ private final short _yMax;
+ private final short _macStyle;
+ private final short _lowestRecPPEM;
+ private final short _fontDirectionHint;
+ private final short _indexToLocFormat;
+ private final short _glyphDataFormat;
+
+ protected HeadTable(final DirectoryEntry de, final DataInput di) throws IOException {
this._de = (DirectoryEntry) de.clone();
_versionNumber = di.readInt();
_fontRevision = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
index 242c9b139..e67a03777 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
@@ -19,21 +19,21 @@ import jogamp.graph.font.typecast.ot.Fixed;
*/
public class HheaTable implements Table {
- private DirectoryEntry de;
- private int version;
- private short ascender;
- private short descender;
- private short lineGap;
- private short advanceWidthMax;
- private short minLeftSideBearing;
- private short minRightSideBearing;
- private short xMaxExtent;
- private short caretSlopeRise;
- private short caretSlopeRun;
- private short metricDataFormat;
- private int numberOfHMetrics;
-
- protected HheaTable(DirectoryEntry de, DataInput di) throws IOException {
+ private final DirectoryEntry de;
+ private final int version;
+ private final short ascender;
+ private final short descender;
+ private final short lineGap;
+ private final short advanceWidthMax;
+ private final short minLeftSideBearing;
+ private final short minRightSideBearing;
+ private final short xMaxExtent;
+ private final short caretSlopeRise;
+ private final short caretSlopeRun;
+ private final short metricDataFormat;
+ private final int numberOfHMetrics;
+
+ protected HheaTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readInt();
ascender = di.readShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java
index 122a0a826..3a9672a92 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java
@@ -59,15 +59,15 @@ import java.io.IOException;
*/
public class HmtxTable implements Table {
- private DirectoryEntry _de;
+ private final DirectoryEntry _de;
private int[] _hMetrics = null;
private short[] _leftSideBearing = null;
protected HmtxTable(
- DirectoryEntry de,
- DataInput di,
- HheaTable hhea,
- MaxpTable maxp) throws IOException {
+ final DirectoryEntry de,
+ final DataInput di,
+ final HheaTable hhea,
+ final MaxpTable maxp) throws IOException {
_de = (DirectoryEntry) de.clone();
_hMetrics = new int[hhea.getNumberOfHMetrics()];
for (int i = 0; i < hhea.getNumberOfHMetrics(); ++i) {
@@ -77,14 +77,14 @@ public class HmtxTable implements Table {
| di.readUnsignedByte()<<8
| di.readUnsignedByte();
}
- int lsbCount = maxp.getNumGlyphs() - hhea.getNumberOfHMetrics();
+ final int lsbCount = maxp.getNumGlyphs() - hhea.getNumberOfHMetrics();
_leftSideBearing = new short[lsbCount];
for (int i = 0; i < lsbCount; ++i) {
_leftSideBearing[i] = di.readShort();
}
}
- public int getAdvanceWidth(int i) {
+ public int getAdvanceWidth(final int i) {
if (_hMetrics == null) {
return 0;
}
@@ -95,7 +95,7 @@ public class HmtxTable implements Table {
}
}
- public short getLeftSideBearing(int i) {
+ public short getLeftSideBearing(final int i) {
if (_hMetrics == null) {
return 0;
}
@@ -113,7 +113,7 @@ public class HmtxTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'hmtx' Table - Horizontal Metrics\n---------------------------------\n");
sb.append("Size = ").append(_de.getLength()).append(" bytes, ")
.append(_hMetrics.length).append(" entries\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
index eed8c1841..ad7e4e376 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
@@ -190,7 +190,7 @@ public abstract class ID {
public static final short nameSampleText = 19;
public static final short namePostScriptCIDFindfontName = 20;
- public static String getPlatformName(short platformId) {
+ public static String getPlatformName(final short platformId) {
switch (platformId) {
case platformUnicode: return "Unicode";
case platformMacintosh: return "Macintosh";
@@ -200,7 +200,7 @@ public abstract class ID {
}
}
- public static String getEncodingName(short platformId, short encodingId) {
+ public static String getEncodingName(final short platformId, final short encodingId) {
if (platformId == platformUnicode) {
@@ -284,7 +284,7 @@ public abstract class ID {
return "";
}
- public static String getLanguageName(short platformId, short languageId) {
+ public static String getLanguageName(final short platformId, final short languageId) {
if (platformId == platformMacintosh) {
switch (languageId) {
@@ -371,7 +371,7 @@ public abstract class ID {
return "";
}
- public static String getNameName(short nameId) {
+ public static String getNameName(final short nameId) {
switch (nameId) {
case nameCopyrightNotice: return "Copyright notice";
case nameFontFamilyName: return "Font Family name";
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
index 04fd646a7..df5d0394f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
@@ -26,12 +26,12 @@ public abstract class KernSubtable {
public abstract KerningPair getKerningPair(int i);
- public static KernSubtable read(DataInput di) throws IOException {
+ public static KernSubtable read(final DataInput di) throws IOException {
KernSubtable table = null;
- int version = di.readUnsignedShort();
- int length = di.readUnsignedShort();
- int coverage = di.readUnsignedShort();
- int format = coverage >> 8;
+ final int version = di.readUnsignedShort();
+ final int length = di.readUnsignedShort();
+ final int coverage = di.readUnsignedShort();
+ final int format = coverage >> 8;
switch (format) {
case 0:
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
index 1e7ff8c2d..2d1acddd5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
@@ -18,14 +18,14 @@ import java.io.IOException;
*/
public class KernSubtableFormat0 extends KernSubtable {
- private int nPairs;
- private int searchRange;
- private int entrySelector;
- private int rangeShift;
- private KerningPair[] kerningPairs;
+ private final int nPairs;
+ private final int searchRange;
+ private final int entrySelector;
+ private final int rangeShift;
+ private final KerningPair[] kerningPairs;
/** Creates new KernSubtableFormat0 */
- protected KernSubtableFormat0(DataInput di) throws IOException {
+ protected KernSubtableFormat0(final DataInput di) throws IOException {
nPairs = di.readUnsignedShort();
searchRange = di.readUnsignedShort();
entrySelector = di.readUnsignedShort();
@@ -42,7 +42,7 @@ public class KernSubtableFormat0 extends KernSubtable {
}
@Override
- public KerningPair getKerningPair(int i) {
+ public KerningPair getKerningPair(final int i) {
return kerningPairs[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
index 9c7fc81f9..deb56c96d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
@@ -18,13 +18,13 @@ import java.io.IOException;
*/
public class KernSubtableFormat2 extends KernSubtable {
- private int rowWidth;
- private int leftClassTable;
- private int rightClassTable;
- private int array;
+ private final int rowWidth;
+ private final int leftClassTable;
+ private final int rightClassTable;
+ private final int array;
/** Creates new KernSubtableFormat2 */
- protected KernSubtableFormat2(DataInput di) throws IOException {
+ protected KernSubtableFormat2(final DataInput di) throws IOException {
rowWidth = di.readUnsignedShort();
leftClassTable = di.readUnsignedShort();
rightClassTable = di.readUnsignedShort();
@@ -37,7 +37,7 @@ public class KernSubtableFormat2 extends KernSubtable {
}
@Override
- public KerningPair getKerningPair(int i) {
+ public KerningPair getKerningPair(final int i) {
return null;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
index 006a86895..6f1d682e1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
@@ -18,13 +18,13 @@ import java.io.IOException;
*/
public class KernTable implements Table {
- private DirectoryEntry de;
- private int version;
- private int nTables;
- private KernSubtable[] tables;
+ private final DirectoryEntry de;
+ private final int version;
+ private final int nTables;
+ private final KernSubtable[] tables;
/** Creates new KernTable */
- protected KernTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected KernTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readUnsignedShort();
nTables = di.readUnsignedShort();
@@ -38,7 +38,7 @@ public class KernTable implements Table {
return nTables;
}
- public KernSubtable getSubtable(int i) {
+ public KernSubtable getSubtable(final int i) {
return tables[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
index 52f82cc85..dd5d0ba06 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
@@ -18,12 +18,12 @@ import java.io.IOException;
*/
public class KerningPair {
- private int left;
- private int right;
- private short value;
+ private final int left;
+ private final int right;
+ private final short value;
/** Creates new KerningPair */
- protected KerningPair(DataInput di) throws IOException {
+ protected KerningPair(final DataInput di) throws IOException {
left = di.readUnsignedShort();
right = di.readUnsignedShort();
value = di.readShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
index 1ab112a78..e12d2e2e7 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
@@ -60,13 +60,13 @@ import java.io.IOException;
*/
public class LangSys {
- private int _lookupOrder;
- private int _reqFeatureIndex;
- private int _featureCount;
- private int[] _featureIndex;
+ private final int _lookupOrder;
+ private final int _reqFeatureIndex;
+ private final int _featureCount;
+ private final int[] _featureIndex;
/** Creates new LangSys */
- protected LangSys(DataInput di) throws IOException {
+ protected LangSys(final DataInput di) throws IOException {
_lookupOrder = di.readUnsignedShort();
_reqFeatureIndex = di.readUnsignedShort();
_featureCount = di.readUnsignedShort();
@@ -88,11 +88,11 @@ public class LangSys {
return _featureCount;
}
- public int getFeatureIndex(int i) {
+ public int getFeatureIndex(final int i) {
return _featureIndex[i];
}
- protected boolean isFeatureIndexed(int n) {
+ protected boolean isFeatureIndexed(final int n) {
for (int i = 0; i < _featureCount; i++) {
if (_featureIndex[i] == n) {
return true;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
index f3befe3b6..08ea719f3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
@@ -60,11 +60,11 @@ import java.io.IOException;
*/
public class LangSysRecord {
- private int _tag;
- private int _offset;
+ private final int _tag;
+ private final int _offset;
/** Creates new LangSysRecord */
- public LangSysRecord(DataInput di) throws IOException {
+ public LangSysRecord(final DataInput di) throws IOException {
_tag = di.readInt();
_offset = di.readUnsignedShort();
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
index de862a983..dfd19e7ac 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
@@ -60,12 +60,12 @@ import java.io.IOException;
*/
public class Ligature {
- private int _ligGlyph;
- private int _compCount;
- private int[] _components;
+ private final int _ligGlyph;
+ private final int _compCount;
+ private final int[] _components;
/** Creates new Ligature */
- public Ligature(DataInput di) throws IOException {
+ public Ligature(final DataInput di) throws IOException {
_ligGlyph = di.readUnsignedShort();
_compCount = di.readUnsignedShort();
_components = new int[_compCount - 1];
@@ -78,7 +78,7 @@ public class Ligature {
return _compCount;
}
- public int getGlyphId(int i) {
+ public int getGlyphId(final int i) {
return (i == 0) ? _ligGlyph : _components[i-1];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java
index e261f3a88..8b7738992 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java
@@ -60,12 +60,12 @@ import java.io.IOException;
*/
public class LigatureSet {
- private int _ligatureCount;
- private int[] _ligatureOffsets;
- private Ligature[] _ligatures;
+ private final int _ligatureCount;
+ private final int[] _ligatureOffsets;
+ private final Ligature[] _ligatures;
/** Creates new LigatureSet */
- public LigatureSet(DataInputStream dis, int offset) throws IOException {
+ public LigatureSet(final DataInputStream dis, final int offset) throws IOException {
dis.reset();
dis.skipBytes(offset);
_ligatureCount = dis.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java
index c0570cde9..36a44a11e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java
@@ -60,10 +60,10 @@ import java.io.IOException;
*/
public abstract class LigatureSubst extends LookupSubtable {
- public static LigatureSubst read(DataInputStream dis, int offset) throws IOException {
+ public static LigatureSubst read(final DataInputStream dis, final int offset) throws IOException {
dis.reset();
dis.skipBytes(offset);
- int format = dis.readUnsignedShort();
+ final int format = dis.readUnsignedShort();
if (format == 1) {
return new LigatureSubstFormat1(dis, offset);
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
index 1979ea586..02d4479b3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
@@ -60,16 +60,16 @@ import java.io.IOException;
*/
public class LigatureSubstFormat1 extends LigatureSubst {
- private int _coverageOffset;
- private int _ligSetCount;
- private int[] _ligatureSetOffsets;
- private Coverage _coverage;
- private LigatureSet[] _ligatureSets;
+ private final int _coverageOffset;
+ private final int _ligSetCount;
+ private final int[] _ligatureSetOffsets;
+ private final Coverage _coverage;
+ private final LigatureSet[] _ligatureSets;
/** Creates new LigatureSubstFormat1 */
protected LigatureSubstFormat1(
- DataInputStream dis,
- int offset) throws IOException {
+ final DataInputStream dis,
+ final int offset) throws IOException {
_coverageOffset = dis.readUnsignedShort();
_ligSetCount = dis.readUnsignedShort();
_ligatureSetOffsets = new int[_ligSetCount];
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
index 2c7079fec..a955ad3e5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
@@ -17,18 +17,18 @@ import java.io.IOException;
*/
public class LocaTable implements Table {
- private DirectoryEntry _de;
+ private final DirectoryEntry _de;
private int[] _offsets = null;
private short _factor = 0;
protected LocaTable(
- DirectoryEntry de,
- DataInput di,
- HeadTable head,
- MaxpTable maxp) throws IOException {
+ final DirectoryEntry de,
+ final DataInput di,
+ final HeadTable head,
+ final MaxpTable maxp) throws IOException {
_de = (DirectoryEntry) de.clone();
_offsets = new int[maxp.getNumGlyphs() + 1];
- boolean shortEntries = head.getIndexToLocFormat() == 0;
+ final boolean shortEntries = head.getIndexToLocFormat() == 0;
if (shortEntries) {
_factor = 2;
for (int i = 0; i <= maxp.getNumGlyphs(); i++) {
@@ -42,7 +42,7 @@ public class LocaTable implements Table {
}
}
- public int getOffset(int i) {
+ public int getOffset(final int i) {
if (_offsets == null) {
return 0;
}
@@ -56,7 +56,7 @@ public class LocaTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'loca' Table - Index To Location Table\n--------------------------------------\n")
.append("Size = ").append(_de.getLength()).append(" bytes, ")
.append(_offsets.length).append(" entries\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
index 6496c3791..b80ebbee4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
@@ -66,14 +66,14 @@ public class Lookup {
public static final int IGNORE_BASE_MARKS = 0x0008;
public static final int MARK_ATTACHMENT_TYPE = 0xFF00;
- private int _type;
- private int _flag;
- private int _subTableCount;
- private int[] _subTableOffsets;
- private LookupSubtable[] _subTables;
+ private final int _type;
+ private final int _flag;
+ private final int _subTableCount;
+ private final int[] _subTableOffsets;
+ private final LookupSubtable[] _subTables;
/** Creates new Lookup */
- public Lookup(LookupSubtableFactory factory, DataInputStream dis, int offset)
+ public Lookup(final LookupSubtableFactory factory, final DataInputStream dis, final int offset)
throws IOException {
// Ensure we're in the right place
@@ -102,7 +102,7 @@ public class Lookup {
return _subTableCount;
}
- public LookupSubtable getSubtable(int i) {
+ public LookupSubtable getSubtable(final int i) {
return _subTables[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
index e70a932e4..6d8ca2a6c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
@@ -60,12 +60,12 @@ import java.io.IOException;
*/
public class LookupList {
- private int _lookupCount;
- private int[] _lookupOffsets;
- private Lookup[] _lookups;
+ private final int _lookupCount;
+ private final int[] _lookupOffsets;
+ private final Lookup[] _lookups;
/** Creates new LookupList */
- public LookupList(DataInputStream dis, int offset, LookupSubtableFactory factory)
+ public LookupList(final DataInputStream dis, final int offset, final LookupSubtableFactory factory)
throws IOException {
// Ensure we're in the right place
@@ -88,17 +88,17 @@ public class LookupList {
return _lookupCount;
}
- public int getLookupOffset(int i) {
+ public int getLookupOffset(final int i) {
return _lookupOffsets[i];
}
- public Lookup getLookup(int i) {
+ public Lookup getLookup(final int i) {
return _lookups[i];
}
- public Lookup getLookup(Feature feature, int index) {
+ public Lookup getLookup(final Feature feature, final int index) {
if (feature.getLookupCount() > index) {
- int i = feature.getLookupListIndex(index);
+ final int i = feature.getLookupListIndex(index);
return _lookups[i];
}
return null;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
index 47874cc56..efafe7bb6 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
@@ -18,13 +18,13 @@ import java.io.IOException;
*/
public class LtshTable implements Table {
- private DirectoryEntry de;
- private int version;
- private int numGlyphs;
- private int[] yPels;
+ private final DirectoryEntry de;
+ private final int version;
+ private final int numGlyphs;
+ private final int[] yPels;
/** Creates new LtshTable */
- protected LtshTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected LtshTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readUnsignedShort();
numGlyphs = di.readUnsignedShort();
@@ -45,7 +45,7 @@ public class LtshTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'LTSH' Table - Linear Threshold Table\n-------------------------------------")
.append("\n 'LTSH' Version: ").append(version)
.append("\n Number of Glyphs: ").append(numGlyphs)
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
index abb6047fc..0e9a6177f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
@@ -19,8 +19,8 @@ import jogamp.graph.font.typecast.ot.Fixed;
*/
public class MaxpTable implements Table {
- private DirectoryEntry de;
- private int versionNumber;
+ private final DirectoryEntry de;
+ private final int versionNumber;
private int numGlyphs;
private int maxPoints;
private int maxContours;
@@ -36,7 +36,7 @@ public class MaxpTable implements Table {
private int maxComponentElements;
private int maxComponentDepth;
- protected MaxpTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected MaxpTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
versionNumber = di.readInt();
@@ -128,7 +128,7 @@ public class MaxpTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'maxp' Table - Maximum Profile\n------------------------------")
.append("\n 'maxp' version: ").append(Fixed.floatValue(versionNumber))
.append("\n numGlyphs: ").append(numGlyphs);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
index a1787e3e7..5ac9ada29 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
@@ -59,15 +59,15 @@ import java.io.IOException;
*/
public class NameRecord {
- private short _platformId;
- private short _encodingId;
- private short _languageId;
- private short _nameId;
- private short _stringLength;
- private short _stringOffset;
+ private final short _platformId;
+ private final short _encodingId;
+ private final short _languageId;
+ private final short _nameId;
+ private final short _stringLength;
+ private final short _stringOffset;
private String _record;
- protected NameRecord(DataInput di) throws IOException {
+ protected NameRecord(final DataInput di) throws IOException {
_platformId = di.readShort();
_encodingId = di.readShort();
_languageId = di.readShort();
@@ -92,13 +92,13 @@ public class NameRecord {
return _platformId;
}
- public StringBuilder getRecordString(StringBuilder sb) {
+ public StringBuilder getRecordString(final StringBuilder sb) {
sb.append(_record);
return sb;
}
- protected void loadString(DataInput di) throws IOException {
- StringBuilder sb = new StringBuilder();
+ protected void loadString(final DataInput di) throws IOException {
+ final StringBuilder sb = new StringBuilder();
di.skipBytes(_stringOffset);
if (_platformId == ID.platformUnicode) {
@@ -132,7 +132,7 @@ public class NameRecord {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(" Platform ID: ").append(_platformId)
.append("\n Specific ID: ").append(_encodingId)
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
index ad8198b7f..ba9292a4b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
@@ -63,13 +63,13 @@ import java.io.IOException;
* @author <a href="mailto:[email protected]">David Schweinsberg</a>
*/
public class NameTable implements Table {
- private DirectoryEntry _de;
- private short _formatSelector;
- private short _numberOfNameRecords;
- private short _stringStorageOffset;
- private NameRecord[] _records;
+ private final DirectoryEntry _de;
+ private final short _formatSelector;
+ private final short _numberOfNameRecords;
+ private final short _stringStorageOffset;
+ private final NameRecord[] _records;
- protected NameTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected NameTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
_formatSelector = di.readShort();
_numberOfNameRecords = di.readShort();
@@ -84,7 +84,7 @@ public class NameTable implements Table {
// Load the string data into a buffer so the records can copy out the
// bits they are interested in
- byte[] buffer = new byte[_de.getLength() - _stringStorageOffset];
+ final byte[] buffer = new byte[_de.getLength() - _stringStorageOffset];
di.readFully(buffer);
// Now let the records get their hands on them
@@ -99,14 +99,14 @@ public class NameTable implements Table {
}
- public NameRecord getRecord(int i) {
+ public NameRecord getRecord(final int i) {
if(_numberOfNameRecords > i) {
return _records[i];
}
return null;
}
- public StringBuilder getRecordsRecordString(StringBuilder sb, int i) {
+ public StringBuilder getRecordsRecordString(final StringBuilder sb, final int i) {
if(_numberOfNameRecords > i) {
_records[i].getRecordString(sb);
} else {
@@ -115,7 +115,7 @@ public class NameTable implements Table {
return sb;
}
- public StringBuilder getNamedRecordString(StringBuilder sb, short nameId) {
+ public StringBuilder getNamedRecordString(final StringBuilder sb, final short nameId) {
// Search for the first instance of this name ID
boolean done = false;
for (int i = 0; !done && i < _numberOfNameRecords; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
index 5340b297c..c91127303 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
@@ -59,46 +59,46 @@ import java.io.IOException;
*/
public class Os2Table implements Table {
- private DirectoryEntry _de;
- private int _version;
- private short _xAvgCharWidth;
- private int _usWeightClass;
- private int _usWidthClass;
- private short _fsType;
- private short _ySubscriptXSize;
- private short _ySubscriptYSize;
- private short _ySubscriptXOffset;
- private short _ySubscriptYOffset;
- private short _ySuperscriptXSize;
- private short _ySuperscriptYSize;
- private short _ySuperscriptXOffset;
- private short _ySuperscriptYOffset;
- private short _yStrikeoutSize;
- private short _yStrikeoutPosition;
- private short _sFamilyClass;
- private Panose _panose;
- private int _ulUnicodeRange1;
- private int _ulUnicodeRange2;
- private int _ulUnicodeRange3;
- private int _ulUnicodeRange4;
- private int _achVendorID;
- private short _fsSelection;
- private int _usFirstCharIndex;
- private int _usLastCharIndex;
- private short _sTypoAscender;
- private short _sTypoDescender;
- private short _sTypoLineGap;
- private int _usWinAscent;
- private int _usWinDescent;
- private int _ulCodePageRange1;
- private int _ulCodePageRange2;
+ private final DirectoryEntry _de;
+ private final int _version;
+ private final short _xAvgCharWidth;
+ private final int _usWeightClass;
+ private final int _usWidthClass;
+ private final short _fsType;
+ private final short _ySubscriptXSize;
+ private final short _ySubscriptYSize;
+ private final short _ySubscriptXOffset;
+ private final short _ySubscriptYOffset;
+ private final short _ySuperscriptXSize;
+ private final short _ySuperscriptYSize;
+ private final short _ySuperscriptXOffset;
+ private final short _ySuperscriptYOffset;
+ private final short _yStrikeoutSize;
+ private final short _yStrikeoutPosition;
+ private final short _sFamilyClass;
+ private final Panose _panose;
+ private final int _ulUnicodeRange1;
+ private final int _ulUnicodeRange2;
+ private final int _ulUnicodeRange3;
+ private final int _ulUnicodeRange4;
+ private final int _achVendorID;
+ private final short _fsSelection;
+ private final int _usFirstCharIndex;
+ private final int _usLastCharIndex;
+ private final short _sTypoAscender;
+ private final short _sTypoDescender;
+ private final short _sTypoLineGap;
+ private final int _usWinAscent;
+ private final int _usWinDescent;
+ private final int _ulCodePageRange1;
+ private final int _ulCodePageRange2;
private short _sxHeight;
private short _sCapHeight;
private int _usDefaultChar;
private int _usBreakChar;
private int _usMaxContext;
- protected Os2Table(DirectoryEntry de, DataInput di) throws IOException {
+ protected Os2Table(final DirectoryEntry de, final DataInput di) throws IOException {
this._de = (DirectoryEntry) de.clone();
_version = di.readUnsignedShort();
_xAvgCharWidth = di.readShort();
@@ -116,7 +116,7 @@ public class Os2Table implements Table {
_yStrikeoutSize = di.readShort();
_yStrikeoutPosition = di.readShort();
_sFamilyClass = di.readShort();
- byte[] buf = new byte[10];
+ final byte[] buf = new byte[10];
di.readFully(buf);
_panose = new Panose(buf);
_ulUnicodeRange1 = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
index 771318108..493f43baa 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
@@ -26,7 +26,7 @@ public class Panose {
byte bXHeight = 0;
/** Creates new Panose */
- public Panose(byte[] panose) {
+ public Panose(final byte[] panose) {
bFamilyType = panose[0];
bSerifStyle = panose[1];
bWeight = panose[2];
@@ -81,7 +81,7 @@ public class Panose {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(String.valueOf(bFamilyType)).append(" ")
.append(String.valueOf(bSerifStyle)).append(" ")
.append(String.valueOf(bWeight)).append(" ")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
index a1f603d8f..63399cf0e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
@@ -18,25 +18,25 @@ import java.io.IOException;
*/
public class PcltTable implements Table {
- private DirectoryEntry de;
- private int version;
- private long fontNumber;
- private int pitch;
- private int xHeight;
- private int style;
- private int typeFamily;
- private int capHeight;
- private int symbolSet;
- private char[] typeface = new char[16];
- private short[] characterComplement = new short[8];
- private char[] fileName = new char[6];
- private short strokeWeight;
- private short widthType;
- private byte serifStyle;
- private byte reserved;
+ private final DirectoryEntry de;
+ private final int version;
+ private final long fontNumber;
+ private final int pitch;
+ private final int xHeight;
+ private final int style;
+ private final int typeFamily;
+ private final int capHeight;
+ private final int symbolSet;
+ private final char[] typeface = new char[16];
+ private final short[] characterComplement = new short[8];
+ private final char[] fileName = new char[6];
+ private final short strokeWeight;
+ private final short widthType;
+ private final byte serifStyle;
+ private final byte reserved;
/** Creates new PcltTable */
- protected PcltTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected PcltTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readInt();
fontNumber = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
index 188b441ac..faeecf909 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
@@ -284,16 +284,16 @@ public class PostTable implements Table {
"" // 257
};
- private DirectoryEntry de;
- private int version;
- private int italicAngle;
- private short underlinePosition;
- private short underlineThickness;
- private int isFixedPitch;
- private int minMemType42;
- private int maxMemType42;
- private int minMemType1;
- private int maxMemType1;
+ private final DirectoryEntry de;
+ private final int version;
+ private final int italicAngle;
+ private final short underlinePosition;
+ private final short underlineThickness;
+ private final int isFixedPitch;
+ private final int minMemType42;
+ private final int maxMemType42;
+ private final int minMemType1;
+ private final int maxMemType1;
// v2
private int numGlyphs;
@@ -301,7 +301,7 @@ public class PostTable implements Table {
private String[] psGlyphName;
/** Creates new PostTable */
- protected PostTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected PostTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
version = di.readInt();
italicAngle = di.readInt();
@@ -324,8 +324,8 @@ public class PostTable implements Table {
h -= 257;
psGlyphName = new String[h];
for (int i = 0; i < h; i++) {
- int len = di.readUnsignedByte();
- byte[] buf = new byte[len];
+ final int len = di.readUnsignedByte();
+ final byte[] buf = new byte[len];
di.readFully(buf);
psGlyphName[i] = new String(buf);
}
@@ -349,7 +349,7 @@ public class PostTable implements Table {
return high;
}
- public String getGlyphName(int i) {
+ public String getGlyphName(final int i) {
if (version == 0x00020000) {
return (glyphNameIndex[i] > 257)
? psGlyphName[glyphNameIndex[i] - 258]
@@ -359,7 +359,7 @@ public class PostTable implements Table {
}
}
- private boolean isMacGlyphName(int i) {
+ private boolean isMacGlyphName(final int i) {
if (version == 0x00020000) {
return glyphNameIndex[i] <= 257;
} else {
@@ -377,7 +377,7 @@ public class PostTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'post' Table - PostScript Metrics\n---------------------------------\n")
.append("\n 'post' version: ").append(Fixed.floatValue(version))
.append("\n italicAngle: ").append(Fixed.floatValue(italicAngle))
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
index 4c64673b7..039789d62 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
@@ -19,9 +19,9 @@ import jogamp.graph.font.typecast.ot.Disassembler;
*/
public class PrepTable extends Program implements Table {
- private DirectoryEntry de;
+ private final DirectoryEntry de;
- public PrepTable(DirectoryEntry de, DataInput di) throws IOException {
+ public PrepTable(final DirectoryEntry de, final DataInput di) throws IOException {
this.de = (DirectoryEntry) de.clone();
readInstructions(di, de.getLength());
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
index e3beabef8..c0d2c1b9d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
@@ -23,7 +23,7 @@ public abstract class Program {
return instructions;
}
- protected void readInstructions(DataInput di, int count) throws IOException {
+ protected void readInstructions(final DataInput di, final int count) throws IOException {
instructions = new short[count];
for (int i = 0; i < count; i++) {
instructions[i] = (short) di.readUnsignedByte();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
index 40ddf4215..417779703 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
@@ -61,22 +61,22 @@ import java.io.IOException;
*/
public class RangeRecord {
- private int _start;
- private int _end;
- private int _startCoverageIndex;
+ private final int _start;
+ private final int _end;
+ private final int _startCoverageIndex;
/** Creates new RangeRecord */
- public RangeRecord(DataInput di) throws IOException {
+ public RangeRecord(final DataInput di) throws IOException {
_start = di.readUnsignedShort();
_end = di.readUnsignedShort();
_startCoverageIndex = di.readUnsignedShort();
}
- public boolean isInRange(int glyphId) {
+ public boolean isInRange(final int glyphId) {
return (_start <= glyphId && glyphId <= _end);
}
- public int getCoverageIndex(int glyphId) {
+ public int getCoverageIndex(final int glyphId) {
if (isInRange(glyphId)) {
return _startCoverageIndex + glyphId - _start;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
index 04781a8f9..8846de5f0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
@@ -60,14 +60,14 @@ import java.io.IOException;
*/
public class Script {
- private int _defaultLangSysOffset;
- private int _langSysCount;
+ private final int _defaultLangSysOffset;
+ private final int _langSysCount;
private LangSysRecord[] _langSysRecords;
private LangSys _defaultLangSys;
private LangSys[] _langSys;
/** Creates new ScriptTable */
- protected Script(DataInputStream dis, int offset) throws IOException {
+ protected Script(final DataInputStream dis, final int offset) throws IOException {
// Ensure we're in the right place
dis.reset();
@@ -103,7 +103,7 @@ public class Script {
return _langSysCount;
}
- public LangSysRecord getLangSysRecord(int i) {
+ public LangSysRecord getLangSysRecord(final int i) {
return _langSysRecords[i];
}
@@ -111,7 +111,7 @@ public class Script {
return _defaultLangSys;
}
- public LangSys getLangSys(int i) {
+ public LangSys getLangSys(final int i) {
return _langSys[i];
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
index 18589b712..1c1be0d2b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
@@ -61,11 +61,11 @@ import java.io.IOException;
public class ScriptList {
private int _scriptCount = 0;
- private ScriptRecord[] _scriptRecords;
- private Script[] _scripts;
+ private final ScriptRecord[] _scriptRecords;
+ private final Script[] _scripts;
/** Creates new ScriptList */
- protected ScriptList(DataInputStream dis, int offset) throws IOException {
+ protected ScriptList(final DataInputStream dis, final int offset) throws IOException {
// Ensure we're in the right place
dis.reset();
@@ -87,19 +87,19 @@ public class ScriptList {
return _scriptCount;
}
- public ScriptRecord getScriptRecord(int i) {
+ public ScriptRecord getScriptRecord(final int i) {
return _scriptRecords[i];
}
- public Script getScript(int i) {
+ public Script getScript(final int i) {
return _scripts[i];
}
- public Script findScript(String tag) {
+ public Script findScript(final String tag) {
if (tag.length() != 4) {
return null;
}
- int tagVal = ((tag.charAt(0)<<24)
+ final int tagVal = ((tag.charAt(0)<<24)
| (tag.charAt(1)<<16)
| (tag.charAt(2)<<8)
| tag.charAt(3));
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
index 183ca2ffd..18eefe5a7 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
@@ -60,11 +60,11 @@ import java.io.IOException;
*/
public class ScriptRecord {
- private int _tag;
- private int _offset;
+ private final int _tag;
+ private final int _offset;
/** Creates new ScriptRecord */
- protected ScriptRecord(DataInput di) throws IOException {
+ protected ScriptRecord(final DataInput di) throws IOException {
_tag = di.readInt();
_offset = di.readUnsignedShort();
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
index 31a2d17c9..e6841b94c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
@@ -18,13 +18,13 @@ import java.io.DataInput;
*/
public class SignatureBlock {
- private int reserved1;
- private int reserved2;
- private int signatureLen;
- private byte[] signature;
+ private final int reserved1;
+ private final int reserved2;
+ private final int signatureLen;
+ private final byte[] signature;
/** Creates new SignatureBlock */
- protected SignatureBlock(DataInput di) throws IOException {
+ protected SignatureBlock(final DataInput di) throws IOException {
reserved1 = di.readUnsignedShort();
reserved2 = di.readUnsignedShort();
signatureLen = di.readInt();
@@ -34,7 +34,7 @@ public class SignatureBlock {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
for (int i = 0; i < signatureLen; i += 16) {
if (signatureLen - i >= 16) {
sb.append(new String(signature, i, 16)).append("\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
index e31281f2e..c398b4fbb 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
@@ -64,11 +64,11 @@ public abstract class SingleSubst extends LookupSubtable {
public abstract int substitute(int glyphId);
- public static SingleSubst read(DataInputStream dis, int offset) throws IOException {
+ public static SingleSubst read(final DataInputStream dis, final int offset) throws IOException {
SingleSubst s = null;
dis.reset();
dis.skipBytes(offset);
- int format = dis.readUnsignedShort();
+ final int format = dis.readUnsignedShort();
if (format == 1) {
s = new SingleSubstFormat1(dis, offset);
} else if (format == 2) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
index e97e62a58..b2e65dded 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
@@ -60,12 +60,12 @@ import java.io.IOException;
*/
public class SingleSubstFormat1 extends SingleSubst {
- private int _coverageOffset;
- private short _deltaGlyphID;
- private Coverage _coverage;
+ private final int _coverageOffset;
+ private final short _deltaGlyphID;
+ private final Coverage _coverage;
/** Creates new SingleSubstFormat1 */
- protected SingleSubstFormat1(DataInputStream dis, int offset) throws IOException {
+ protected SingleSubstFormat1(final DataInputStream dis, final int offset) throws IOException {
_coverageOffset = dis.readUnsignedShort();
_deltaGlyphID = dis.readShort();
dis.reset();
@@ -79,8 +79,8 @@ public class SingleSubstFormat1 extends SingleSubst {
}
@Override
- public int substitute(int glyphId) {
- int i = _coverage.findGlyph(glyphId);
+ public int substitute(final int glyphId) {
+ final int i = _coverage.findGlyph(glyphId);
if (i > -1) {
return glyphId + _deltaGlyphID;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
index 4d46b07b4..449c14c7a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
@@ -60,13 +60,13 @@ import java.io.IOException;
*/
public class SingleSubstFormat2 extends SingleSubst {
- private int _coverageOffset;
- private int _glyphCount;
- private int[] _substitutes;
- private Coverage _coverage;
+ private final int _coverageOffset;
+ private final int _glyphCount;
+ private final int[] _substitutes;
+ private final Coverage _coverage;
/** Creates new SingleSubstFormat2 */
- protected SingleSubstFormat2(DataInputStream dis, int offset) throws IOException {
+ protected SingleSubstFormat2(final DataInputStream dis, final int offset) throws IOException {
_coverageOffset = dis.readUnsignedShort();
_glyphCount = dis.readUnsignedShort();
_substitutes = new int[_glyphCount];
@@ -84,8 +84,8 @@ public class SingleSubstFormat2 extends SingleSubst {
}
@Override
- public int substitute(int glyphId) {
- int i = _coverage.findGlyph(glyphId);
+ public int substitute(final int glyphId) {
+ final int i = _coverage.findGlyph(glyphId);
if (i > -1) {
return _substitutes[i];
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
index f7c7d99b5..a6ec61887 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
@@ -20,16 +20,16 @@ public class TTCHeader {
public static final int ttcf = 0x74746366;
- private int ttcTag;
- private int version;
- private int directoryCount;
- private int[] tableDirectory;
+ private final int ttcTag;
+ private final int version;
+ private final int directoryCount;
+ private final int[] tableDirectory;
private int dsigTag;
- private int dsigLength;
- private int dsigOffset;
+ private final int dsigLength;
+ private final int dsigOffset;
/** Creates new TTCHeader */
- public TTCHeader(DataInput di) throws IOException {
+ public TTCHeader(final DataInput di) throws IOException {
ttcTag = di.readInt();
version = di.readInt();
directoryCount = di.readInt();
@@ -48,12 +48,12 @@ public class TTCHeader {
return directoryCount;
}
- public int getTableDirectory(int i) {
+ public int getTableDirectory(final int i) {
return tableDirectory[i];
}
- public static boolean isTTC(DataInput di) throws IOException {
- int ttcTag = di.readInt();
+ public static boolean isTTC(final DataInput di) throws IOException {
+ final int ttcTag = di.readInt();
return ttcTag == ttcf;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
index 23ecba804..b9448cc72 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
@@ -66,9 +66,9 @@ public class TableDirectory {
private short _searchRange = 0;
private short _entrySelector = 0;
private short _rangeShift = 0;
- private DirectoryEntry[] _entries;
+ private final DirectoryEntry[] _entries;
- public TableDirectory(DataInput di) throws IOException {
+ public TableDirectory(final DataInput di) throws IOException {
_version = di.readInt();
_numTables = di.readShort();
_searchRange = di.readShort();
@@ -80,11 +80,11 @@ public class TableDirectory {
}
}
- public DirectoryEntry getEntry(int index) {
+ public DirectoryEntry getEntry(final int index) {
return _entries[index];
}
- public DirectoryEntry getEntryByTag(int tag) {
+ public DirectoryEntry getEntryByTag(final int tag) {
for (int i = 0; i < _numTables; i++) {
if (_entries[i].getTag() == tag) {
return _entries[i];
@@ -115,7 +115,7 @@ public class TableDirectory {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder()
+ final StringBuilder sb = new StringBuilder()
.append("Offset Table\n------ -----")
.append("\n sfnt version: ").append(Fixed.floatValue(_version))
.append("\n numTables = ").append(_numTables)
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
index 65aa84bff..e0433f098 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
@@ -40,7 +40,7 @@ public class TableException extends java.lang.Exception {
* Constructs an instance of <code>TableException</code> with the specified detail message.
* @param msg the detail message.
*/
- public TableException(String msg) {
+ public TableException(final String msg) {
super(msg);
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
index 956d1aecd..d24f3b3ae 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
@@ -64,10 +64,10 @@ import jogamp.graph.font.typecast.ot.OTFontCollection;
public class TableFactory {
public static Table create(
- OTFontCollection fc,
- OTFont font,
- DirectoryEntry de,
- DataInputStream dis) throws IOException {
+ final OTFontCollection fc,
+ final OTFont font,
+ final DirectoryEntry de,
+ final DataInputStream dis) throws IOException {
Table t = null;
// First, if we have a font collection, look for the table there
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
index bebd7f946..1a390f86d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
@@ -32,12 +32,12 @@ public class VdmxTable implements Table {
private class Ratio {
- private byte _bCharSet;
- private byte _xRatio;
- private byte _yStartRatio;
- private byte _yEndRatio;
+ private final byte _bCharSet;
+ private final byte _xRatio;
+ private final byte _yStartRatio;
+ private final byte _yEndRatio;
- protected Ratio(DataInput di) throws IOException {
+ protected Ratio(final DataInput di) throws IOException {
_bCharSet = di.readByte();
_xRatio = di.readByte();
_yStartRatio = di.readByte();
@@ -63,11 +63,11 @@ public class VdmxTable implements Table {
private class VTableRecord {
- private int _yPelHeight;
- private short _yMax;
- private short _yMin;
+ private final int _yPelHeight;
+ private final short _yMax;
+ private final short _yMin;
- protected VTableRecord(DataInput di) throws IOException {
+ protected VTableRecord(final DataInput di) throws IOException {
_yPelHeight = di.readUnsignedShort();
_yMax = di.readShort();
_yMin = di.readShort();
@@ -88,12 +88,12 @@ public class VdmxTable implements Table {
private class Group {
- private int _recs;
- private int _startsz;
- private int _endsz;
- private VTableRecord[] _entry;
+ private final int _recs;
+ private final int _startsz;
+ private final int _endsz;
+ private final VTableRecord[] _entry;
- protected Group(DataInput di) throws IOException {
+ protected Group(final DataInput di) throws IOException {
_recs = di.readUnsignedShort();
_startsz = di.readUnsignedByte();
_endsz = di.readUnsignedByte();
@@ -120,16 +120,16 @@ public class VdmxTable implements Table {
}
}
- private DirectoryEntry _de;
- private int _version;
- private int _numRecs;
- private int _numRatios;
- private Ratio[] _ratRange;
- private int _offset[];
- private Group[] _groups;
+ private final DirectoryEntry _de;
+ private final int _version;
+ private final int _numRecs;
+ private final int _numRatios;
+ private final Ratio[] _ratRange;
+ private final int _offset[];
+ private final Group[] _groups;
/** Creates a new instance of VdmxTable */
- protected VdmxTable(DirectoryEntry de, DataInput di) throws IOException {
+ protected VdmxTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
_version = di.readUnsignedShort();
_numRecs = di.readUnsignedShort();
@@ -155,7 +155,7 @@ public class VdmxTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'VDMX' Table - Precomputed Vertical Device Metrics\n")
.append("--------------------------------------------------\n")
.append(" Version: ").append(_version).append("\n")
@@ -172,7 +172,7 @@ public class VdmxTable implements Table {
sb.append("\n VDMX Height Record Groups\n")
.append(" -------------------------\n");
for (int i = 0; i < _numRecs; ++i) {
- Group group = _groups[i];
+ final Group group = _groups[i];
sb.append(" ").append(i + 1)
.append(". Number of Hgt Records ").append(group.getRecs()).append("\n")
.append(" Starting Y Pel Height ").append(group.getStartSZ()).append("\n")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
index 521b87cc8..cef7b5297 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
@@ -32,21 +32,21 @@ import jogamp.graph.font.typecast.ot.Fixed;
*/
public class VheaTable implements Table {
- private DirectoryEntry _de;
- private int _version;
- private short _ascent;
- private short _descent;
- private short _lineGap;
- private short _advanceHeightMax;
- private short _minTopSideBearing;
- private short _minBottomSideBearing;
- private short _yMaxExtent;
- private short _caretSlopeRise;
- private short _caretSlopeRun;
- private short _metricDataFormat;
- private int _numberOfLongVerMetrics;
-
- protected VheaTable(DirectoryEntry de, DataInput di) throws IOException {
+ private final DirectoryEntry _de;
+ private final int _version;
+ private final short _ascent;
+ private final short _descent;
+ private final short _lineGap;
+ private final short _advanceHeightMax;
+ private final short _minTopSideBearing;
+ private final short _minBottomSideBearing;
+ private final short _yMaxExtent;
+ private final short _caretSlopeRise;
+ private final short _caretSlopeRun;
+ private final short _metricDataFormat;
+ private final int _numberOfLongVerMetrics;
+
+ protected VheaTable(final DirectoryEntry de, final DataInput di) throws IOException {
_de = (DirectoryEntry) de.clone();
_version = di.readInt();
_ascent = di.readShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java
index 1b77a6fdc..b76ed7e15 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java
@@ -30,15 +30,15 @@ import java.io.IOException;
*/
public class VmtxTable implements Table {
- private DirectoryEntry _de;
+ private final DirectoryEntry _de;
private int[] _vMetrics = null;
private short[] _topSideBearing = null;
protected VmtxTable(
- DirectoryEntry de,
- DataInput di,
- VheaTable vhea,
- MaxpTable maxp) throws IOException {
+ final DirectoryEntry de,
+ final DataInput di,
+ final VheaTable vhea,
+ final MaxpTable maxp) throws IOException {
_de = (DirectoryEntry) de.clone();
_vMetrics = new int[vhea.getNumberOfLongVerMetrics()];
for (int i = 0; i < vhea.getNumberOfLongVerMetrics(); ++i) {
@@ -48,14 +48,14 @@ public class VmtxTable implements Table {
| di.readUnsignedByte()<<8
| di.readUnsignedByte();
}
- int tsbCount = maxp.getNumGlyphs() - vhea.getNumberOfLongVerMetrics();
+ final int tsbCount = maxp.getNumGlyphs() - vhea.getNumberOfLongVerMetrics();
_topSideBearing = new short[tsbCount];
for (int i = 0; i < tsbCount; ++i) {
_topSideBearing[i] = di.readShort();
}
}
- public int getAdvanceHeight(int i) {
+ public int getAdvanceHeight(final int i) {
if (_vMetrics == null) {
return 0;
}
@@ -66,7 +66,7 @@ public class VmtxTable implements Table {
}
}
- public short getTopSideBearing(int i) {
+ public short getTopSideBearing(final int i) {
if (_vMetrics == null) {
return 0;
}
@@ -84,7 +84,7 @@ public class VmtxTable implements Table {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("'vmtx' Table - Vertical Metrics\n-------------------------------\n");
sb.append("Size = ").append(_de.getLength()).append(" bytes, ")
.append(_vMetrics.length).append(" entries\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java b/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
index 73f26b27c..7bfb8cbd5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
@@ -56,10 +56,10 @@ public class T2Interpreter {
* (dx1, dy1).
*/
private void _rmoveto() {
- int dy1 = popArg().intValue();
- int dx1 = popArg().intValue();
+ final int dy1 = popArg().intValue();
+ final int dx1 = popArg().intValue();
clearArg();
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
moveTo(lastPoint.x + dx1, lastPoint.y + dy1);
}
@@ -67,9 +67,9 @@ public class T2Interpreter {
* Moves the current point dx1 units in the horizontal direction.
*/
private void _hmoveto() {
- int dx1 = popArg().intValue();
+ final int dx1 = popArg().intValue();
clearArg();
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
moveTo(lastPoint.x + dx1, lastPoint.y);
}
@@ -77,9 +77,9 @@ public class T2Interpreter {
* Moves the current point dy1 units in the vertical direction.
*/
private void _vmoveto() {
- int dy1 = popArg().intValue();
+ final int dy1 = popArg().intValue();
clearArg();
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
moveTo(lastPoint.x, lastPoint.y + dy1);
}
@@ -90,15 +90,15 @@ public class T2Interpreter {
* lines is determined from the number of arguments on the stack.
*/
private void _rlineto() {
- int count = getArgCount() / 2;
- int[] dx = new int[count];
- int[] dy = new int[count];
+ final int count = getArgCount() / 2;
+ final int[] dx = new int[count];
+ final int[] dy = new int[count];
for (int i = 0; i < count; ++i) {
dy[count - i - 1] = popArg().intValue();
dx[count - i - 1] = popArg().intValue();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
lineTo(lastPoint.x + dx[i], lastPoint.y + dy[i]);
}
clearArg();
@@ -115,13 +115,13 @@ public class T2Interpreter {
* number of arguments on the stack.
*/
private void _hlineto() {
- int count = getArgCount();
- Number[] nums = new Number[count];
+ final int count = getArgCount();
+ final Number[] nums = new Number[count];
for (int i = 0; i < count; ++i) {
nums[count - i - 1] = popArg();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
if (i % 2 == 0) {
lineTo(lastPoint.x + nums[i].intValue(), lastPoint.y);
} else {
@@ -142,13 +142,13 @@ public class T2Interpreter {
* number of arguments on the stack.
*/
private void _vlineto() {
- int count = getArgCount();
- Number[] nums = new Number[count];
+ final int count = getArgCount();
+ final Number[] nums = new Number[count];
for (int i = 0; i < count; ++i) {
nums[count - i - 1] = popArg();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
if (i % 2 == 0) {
lineTo(lastPoint.x, lastPoint.y + nums[i].intValue());
} else {
@@ -167,13 +167,13 @@ public class T2Interpreter {
* stack.
*/
private void _rrcurveto() {
- int count = getArgCount() / 6;
- int[] dxa = new int[count];
- int[] dya = new int[count];
- int[] dxb = new int[count];
- int[] dyb = new int[count];
- int[] dxc = new int[count];
- int[] dyc = new int[count];
+ final int count = getArgCount() / 6;
+ final int[] dxa = new int[count];
+ final int[] dya = new int[count];
+ final int[] dxb = new int[count];
+ final int[] dyb = new int[count];
+ final int[] dxc = new int[count];
+ final int[] dyc = new int[count];
for (int i = 0; i < count; ++i) {
dyc[count - i - 1] = popArg().intValue();
dxc[count - i - 1] = popArg().intValue();
@@ -183,13 +183,13 @@ public class T2Interpreter {
dxa[count - i - 1] = popArg().intValue();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
- int xa = lastPoint.x + dxa[i];
- int ya = lastPoint.y + dya[i];
- int xb = xa + dxb[i];
- int yb = ya + dyb[i];
- int xc = xb + dxc[i];
- int yc = yb + dyc[i];
+ final Point lastPoint = getLastPoint();
+ final int xa = lastPoint.x + dxa[i];
+ final int ya = lastPoint.y + dya[i];
+ final int xb = xa + dxb[i];
+ final int yb = ya + dyb[i];
+ final int xc = xb + dxc[i];
+ final int yc = yb + dyc[i];
curveTo(xa, ya, xb, yb, xc, yc);
}
clearArg();
@@ -203,12 +203,12 @@ public class T2Interpreter {
* case). Note the argument order for the odd argument case.
*/
private void _hhcurveto() {
- int count = getArgCount() / 4;
+ final int count = getArgCount() / 4;
int dy1 = 0;
- int[] dxa = new int[count];
- int[] dxb = new int[count];
- int[] dyb = new int[count];
- int[] dxc = new int[count];
+ final int[] dxa = new int[count];
+ final int[] dxb = new int[count];
+ final int[] dyb = new int[count];
+ final int[] dxc = new int[count];
for (int i = 0; i < count; ++i) {
dxc[count - i - 1] = popArg().intValue();
dyb[count - i - 1] = popArg().intValue();
@@ -219,13 +219,13 @@ public class T2Interpreter {
dy1 = popArg().intValue();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
- int xa = lastPoint.x + dxa[i];
- int ya = lastPoint.y + (i == 0 ? dy1 : 0);
- int xb = xa + dxb[i];
- int yb = ya + dyb[i];
- int xc = xb + dxc[i];
- int yc = yb;
+ final Point lastPoint = getLastPoint();
+ final int xa = lastPoint.x + dxa[i];
+ final int ya = lastPoint.y + (i == 0 ? dy1 : 0);
+ final int xb = xa + dxb[i];
+ final int yb = ya + dyb[i];
+ final int xc = xb + dxc[i];
+ final int yc = yb;
curveTo(xa, ya, xb, yb, xc, yc);
}
clearArg();
@@ -243,15 +243,15 @@ public class T2Interpreter {
*/
private void _hvcurveto() {
if (getArgCount() % 8 <= 1) {
- int count = getArgCount() / 8;
- int[] dxa = new int[count];
- int[] dxb = new int[count];
- int[] dyb = new int[count];
- int[] dyc = new int[count];
- int[] dyd = new int[count];
- int[] dxe = new int[count];
- int[] dye = new int[count];
- int[] dxf = new int[count];
+ final int count = getArgCount() / 8;
+ final int[] dxa = new int[count];
+ final int[] dxb = new int[count];
+ final int[] dyb = new int[count];
+ final int[] dyc = new int[count];
+ final int[] dyd = new int[count];
+ final int[] dxe = new int[count];
+ final int[] dye = new int[count];
+ final int[] dxf = new int[count];
int dyf = 0;
if (getArgCount() % 8 == 1) {
dyf = popArg().intValue();
@@ -267,32 +267,32 @@ public class T2Interpreter {
dxa[count - i - 1] = popArg().intValue();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
- int xa = lastPoint.x + dxa[i];
- int ya = lastPoint.y;
- int xb = xa + dxb[i];
- int yb = ya + dyb[i];
- int xc = xb;
- int yc = yb + dyc[i];
- int xd = xc;
- int yd = yc + dyd[i];
- int xe = xd + dxe[i];
- int ye = yd + dye[i];
- int xf = xe + dxf[i];
- int yf = ye + dyf;
+ final Point lastPoint = getLastPoint();
+ final int xa = lastPoint.x + dxa[i];
+ final int ya = lastPoint.y;
+ final int xb = xa + dxb[i];
+ final int yb = ya + dyb[i];
+ final int xc = xb;
+ final int yc = yb + dyc[i];
+ final int xd = xc;
+ final int yd = yc + dyd[i];
+ final int xe = xd + dxe[i];
+ final int ye = yd + dye[i];
+ final int xf = xe + dxf[i];
+ final int yf = ye + dyf;
curveTo(xa, ya, xb, yb, xc, yc);
curveTo(xd, yd, xe, ye, xf, yf);
}
} else {
- int count = getArgCount() / 8;
- int[] dya = new int[count];
- int[] dxb = new int[count];
- int[] dyb = new int[count];
- int[] dxc = new int[count];
- int[] dxd = new int[count];
- int[] dxe = new int[count];
- int[] dye = new int[count];
- int[] dyf = new int[count];
+ final int count = getArgCount() / 8;
+ final int[] dya = new int[count];
+ final int[] dxb = new int[count];
+ final int[] dyb = new int[count];
+ final int[] dxc = new int[count];
+ final int[] dxd = new int[count];
+ final int[] dxe = new int[count];
+ final int[] dye = new int[count];
+ final int[] dyf = new int[count];
int dxf = 0;
if (getArgCount() % 8 == 1) {
dxf = popArg().intValue();
@@ -307,24 +307,24 @@ public class T2Interpreter {
dxb[count - i - 1] = popArg().intValue();
dya[count - i - 1] = popArg().intValue();
}
- int dy3 = popArg().intValue();
- int dy2 = popArg().intValue();
- int dx2 = popArg().intValue();
- int dx1 = popArg().intValue();
+ final int dy3 = popArg().intValue();
+ final int dy2 = popArg().intValue();
+ final int dx2 = popArg().intValue();
+ final int dx1 = popArg().intValue();
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
- int xa = lastPoint.x;
- int ya = lastPoint.y + dya[i];
- int xb = xa + dxb[i];
- int yb = ya + dyb[i];
- int xc = xb + dxc[i];
- int yc = yb;
- int xd = xc + dxd[i];
- int yd = yc;
- int xe = xd + dxe[i];
- int ye = yd + dye[i];
- int xf = xe + dxf;
- int yf = ye + dyf[i];
+ final Point lastPoint = getLastPoint();
+ final int xa = lastPoint.x;
+ final int ya = lastPoint.y + dya[i];
+ final int xb = xa + dxb[i];
+ final int yb = ya + dyb[i];
+ final int xc = xb + dxc[i];
+ final int yc = yb;
+ final int xd = xc + dxd[i];
+ final int yd = yc;
+ final int xe = xd + dxe[i];
+ final int ye = yd + dye[i];
+ final int xf = xe + dxf;
+ final int yf = ye + dyf[i];
curveTo(xa, ya, xb, yb, xc, yc);
curveTo(xd, yd, xe, ye, xf, yf);
@@ -341,15 +341,15 @@ public class T2Interpreter {
* on the argument stack.
*/
private void _rcurveline() {
- int count = (getArgCount() - 2) / 6;
- int[] dxa = new int[count];
- int[] dya = new int[count];
- int[] dxb = new int[count];
- int[] dyb = new int[count];
- int[] dxc = new int[count];
- int[] dyc = new int[count];
- int dyd = popArg().intValue();
- int dxd = popArg().intValue();
+ final int count = (getArgCount() - 2) / 6;
+ final int[] dxa = new int[count];
+ final int[] dya = new int[count];
+ final int[] dxb = new int[count];
+ final int[] dyb = new int[count];
+ final int[] dxc = new int[count];
+ final int[] dyc = new int[count];
+ final int dyd = popArg().intValue();
+ final int dxd = popArg().intValue();
for (int i = 0; i < count; ++i) {
dyc[count - i - 1] = popArg().intValue();
dxc[count - i - 1] = popArg().intValue();
@@ -361,11 +361,11 @@ public class T2Interpreter {
int xc = 0;
int yc = 0;
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
- int xa = lastPoint.x + dxa[i];
- int ya = lastPoint.y + dya[i];
- int xb = xa + dxb[i];
- int yb = ya + dyb[i];
+ final Point lastPoint = getLastPoint();
+ final int xa = lastPoint.x + dxa[i];
+ final int ya = lastPoint.y + dya[i];
+ final int xb = xa + dxb[i];
+ final int yb = ya + dyb[i];
xc = xb + dxc[i];
yc = yb + dyc[i];
curveTo(xa, ya, xb, yb, xc, yc);
@@ -381,15 +381,15 @@ public class T2Interpreter {
* items on the argument stack.
*/
private void _rlinecurve() {
- int count = (getArgCount() - 6) / 2;
- int[] dxa = new int[count];
- int[] dya = new int[count];
- int dyd = popArg().intValue();
- int dxd = popArg().intValue();
- int dyc = popArg().intValue();
- int dxc = popArg().intValue();
- int dyb = popArg().intValue();
- int dxb = popArg().intValue();
+ final int count = (getArgCount() - 6) / 2;
+ final int[] dxa = new int[count];
+ final int[] dya = new int[count];
+ final int dyd = popArg().intValue();
+ final int dxd = popArg().intValue();
+ final int dyc = popArg().intValue();
+ final int dxc = popArg().intValue();
+ final int dyb = popArg().intValue();
+ final int dxb = popArg().intValue();
for (int i = 0; i < count; ++i) {
dya[count - i - 1] = popArg().intValue();
dxa[count - i - 1] = popArg().intValue();
@@ -397,17 +397,17 @@ public class T2Interpreter {
int xa = 0;
int ya = 0;
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
xa = lastPoint.x + dxa[i];
ya = lastPoint.y + dya[i];
lineTo(xa, ya);
}
- int xb = xa + dxb;
- int yb = ya + dyb;
- int xc = xb + dxc;
- int yc = yb + dyc;
- int xd = xc + dxd;
- int yd = yc + dyd;
+ final int xb = xa + dxb;
+ final int yb = ya + dyb;
+ final int xc = xb + dxc;
+ final int yc = yb + dyc;
+ final int xd = xc + dxd;
+ final int yd = yc + dyd;
curveTo(xb, yb, xc, yc, xd, yd);
clearArg();
}
@@ -420,15 +420,15 @@ public class T2Interpreter {
*/
private void _vhcurveto() {
if (getArgCount() % 8 <= 1) {
- int count = getArgCount() / 8;
- int[] dya = new int[count];
- int[] dxb = new int[count];
- int[] dyb = new int[count];
- int[] dxc = new int[count];
- int[] dxd = new int[count];
- int[] dxe = new int[count];
- int[] dye = new int[count];
- int[] dyf = new int[count];
+ final int count = getArgCount() / 8;
+ final int[] dya = new int[count];
+ final int[] dxb = new int[count];
+ final int[] dyb = new int[count];
+ final int[] dxc = new int[count];
+ final int[] dxd = new int[count];
+ final int[] dxe = new int[count];
+ final int[] dye = new int[count];
+ final int[] dyf = new int[count];
int dxf = 0;
if (getArgCount() % 8 == 1) {
dxf = popArg().intValue();
@@ -444,24 +444,24 @@ public class T2Interpreter {
dya[count - i - 1] = popArg().intValue();
}
for (int i = 0; i < count; ++i) {
- Point lastPoint = getLastPoint();
- int xa = lastPoint.x;
- int ya = lastPoint.y + dya[i];
- int xb = xa + dxb[i];
- int yb = ya + dyb[i];
- int xc = xb + dxc[i];
- int yc = yb;
- int xd = xc + dxd[i];
- int yd = yc;
- int xe = xd + dxe[i];
- int ye = yd + dye[i];
- int xf = xe + dxf;
- int yf = ye + dyf[i];
+ final Point lastPoint = getLastPoint();
+ final int xa = lastPoint.x;
+ final int ya = lastPoint.y + dya[i];
+ final int xb = xa + dxb[i];
+ final int yb = ya + dyb[i];
+ final int xc = xb + dxc[i];
+ final int yc = yb;
+ final int xd = xc + dxd[i];
+ final int yd = yc;
+ final int xe = xd + dxe[i];
+ final int ye = yd + dye[i];
+ final int xf = xe + dxf;
+ final int yf = ye + dyf[i];
curveTo(xa, ya, xb, yb, xc, yc);
curveTo(xd, yd, xe, ye, xf, yf);
}
} else {
- int foo = 0;
+ final int foo = 0;
}
clearArg();
}
@@ -565,7 +565,7 @@ public class T2Interpreter {
* Returns the absolute value of num.
*/
private void _abs() {
- double num = popArg().doubleValue();
+ final double num = popArg().doubleValue();
pushArg(Math.abs(num));
}
@@ -573,8 +573,8 @@ public class T2Interpreter {
* Returns the sum of the two numbers num1 and num2.
*/
private void _add() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg(num1 + num2);
}
@@ -582,8 +582,8 @@ public class T2Interpreter {
* Returns the result of subtracting num2 from num1.
*/
private void _sub() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg(num1 - num2);
}
@@ -592,8 +592,8 @@ public class T2Interpreter {
* undefined if overflow occurs and is zero for underflow.
*/
private void _div() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg(num1 / num2);
}
@@ -601,7 +601,7 @@ public class T2Interpreter {
* Returns the negative of num.
*/
private void _neg() {
- double num = popArg().doubleValue();
+ final double num = popArg().doubleValue();
pushArg(-num);
}
@@ -618,8 +618,8 @@ public class T2Interpreter {
* result is undefined, and zero is returned for underflow.
*/
private void _mul() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg(num1 * num2);
}
@@ -628,7 +628,7 @@ public class T2Interpreter {
* undefined.
*/
private void _sqrt() {
- double num = popArg().doubleValue();
+ final double num = popArg().doubleValue();
pushArg(Math.sqrt(num));
}
@@ -643,8 +643,8 @@ public class T2Interpreter {
* Exchanges the top two elements on the argument stack.
*/
private void _exch() {
- Number num2 = popArg();
- Number num1 = popArg();
+ final Number num2 = popArg();
+ final Number num1 = popArg();
pushArg(num2);
pushArg(num1);
}
@@ -656,8 +656,8 @@ public class T2Interpreter {
* undefined.
*/
private void _index() {
- int i = popArg().intValue();
- Number[] nums = new Number[i];
+ final int i = popArg().intValue();
+ final Number[] nums = new Number[i];
for (int j = 0; j < i; ++j) {
nums[j] = popArg();
}
@@ -675,9 +675,9 @@ public class T2Interpreter {
* operation is undefined.
*/
private void _roll() {
- int j = popArg().intValue();
- int n = popArg().intValue();
- Number[] nums = new Number[n];
+ final int j = popArg().intValue();
+ final int n = popArg().intValue();
+ final Number[] nums = new Number[n];
for (int i = 0; i < n; ++i) {
nums[i] = popArg();
}
@@ -690,7 +690,7 @@ public class T2Interpreter {
* Duplicates the top element on the argument stack.
*/
private void _dup() {
- Number any = popArg();
+ final Number any = popArg();
pushArg(any);
pushArg(any);
}
@@ -699,8 +699,8 @@ public class T2Interpreter {
* Stores val into the transient array at the location given by i.
*/
private void _put() {
- int i = popArg().intValue();
- Number val = popArg();
+ final int i = popArg().intValue();
+ final Number val = popArg();
_transientArray[i] = val;
}
@@ -711,7 +711,7 @@ public class T2Interpreter {
* charstring, the value returned is undefined.
*/
private void _get() {
- int i = popArg().intValue();
+ final int i = popArg().intValue();
pushArg(_transientArray[i]);
}
@@ -720,8 +720,8 @@ public class T2Interpreter {
* puts a 0 on the stack if either argument is zero.
*/
private void _and() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg((num1!=0.0) && (num2!=0.0) ? 1 : 0);
}
@@ -730,8 +730,8 @@ public class T2Interpreter {
* puts a 0 on the stack if both arguments are zero.
*/
private void _or() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg((num1!=0.0) || (num2!=0.0) ? 1 : 0);
}
@@ -739,7 +739,7 @@ public class T2Interpreter {
* Returns a 0 if num1 is non-zero; returns a 1 if num1 is zero.
*/
private void _not() {
- double num1 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg((num1!=0.0) ? 0 : 1);
}
@@ -748,8 +748,8 @@ public class T2Interpreter {
* is put on the stack.
*/
private void _eq() {
- double num2 = popArg().doubleValue();
- double num1 = popArg().doubleValue();
+ final double num2 = popArg().doubleValue();
+ final double num1 = popArg().doubleValue();
pushArg(num1 == num2 ? 1 : 0);
}
@@ -759,10 +759,10 @@ public class T2Interpreter {
* number of a subroutine.
*/
private void _ifelse() {
- double v2 = popArg().doubleValue();
- double v1 = popArg().doubleValue();
- Number s2 = popArg();
- Number s1 = popArg();
+ final double v2 = popArg().doubleValue();
+ final double v1 = popArg().doubleValue();
+ final Number s2 = popArg();
+ final Number s1 = popArg();
pushArg(v1 <= v2 ? s1 : s2);
}
@@ -796,7 +796,7 @@ public class T2Interpreter {
}
- public Point[] execute(CharstringType2 cs) {
+ public Point[] execute(final CharstringType2 cs) {
_points = new ArrayList<Point>();
cs.resetIP();
while (cs.moreBytes()) {
@@ -964,7 +964,7 @@ public class T2Interpreter {
}
}
}
- Point[] pointArray = new Point[_points.size()];
+ final Point[] pointArray = new Point[_points.size()];
_points.toArray(pointArray);
return pointArray;
}
@@ -986,7 +986,7 @@ public class T2Interpreter {
/**
* Push a value on to the argument stack
*/
- private void pushArg(Number n) {
+ private void pushArg(final Number n) {
_argStack[_argStackIndex++] = n;
}
@@ -1000,7 +1000,7 @@ public class T2Interpreter {
/**
* Push a value on to the subroutine stack
*/
- private void pushSubr(int n) {
+ private void pushSubr(final int n) {
_subrStack[_subrStackIndex++] = n;
}
@@ -1012,7 +1012,7 @@ public class T2Interpreter {
}
private Point getLastPoint() {
- int size = _points.size();
+ final int size = _points.size();
if (size > 0) {
return _points.get(size - 1);
} else {
@@ -1020,23 +1020,23 @@ public class T2Interpreter {
}
}
- private void moveTo(int x, int y) {
+ private void moveTo(final int x, final int y) {
endContour();
_points.add(new Point(x, y, true, false));
}
- private void lineTo(int x, int y) {
+ private void lineTo(final int x, final int y) {
_points.add(new Point(x, y, true, false));
}
- private void curveTo(int cx1, int cy1, int cx2, int cy2, int x, int y) {
+ private void curveTo(final int cx1, final int cy1, final int cx2, final int cy2, final int x, final int y) {
_points.add(new Point(cx1, cy1, false, false));
_points.add(new Point(cx2, cy2, false, false));
_points.add(new Point(x, y, true, false));
}
private void endContour() {
- Point lastPoint = getLastPoint();
+ final Point lastPoint = getLastPoint();
if (lastPoint != null) {
lastPoint.endOfContour = true;
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
index 2bb5cec0c..b296886cc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
@@ -33,16 +33,16 @@ import jogamp.graph.font.typecast.ot.Point;
public class Interpreter {
private Parser parser = null;
- private GraphicsState gs = new GraphicsState();
- private Point[][] zone = new Point[2][];
+ private final GraphicsState gs = new GraphicsState();
+ private final Point[][] zone = new Point[2][];
private int[] stack = null;
private int[] store = null;
- private int[] cvt = new int[256];
+ private final int[] cvt = new int[256];
private int[] functionMap = null;
private int stackIndex = 0;
private boolean inFuncDef = false;
- public Interpreter(int stackMax, int storeMax, int funcMax) {
+ public Interpreter(final int stackMax, final int storeMax, final int funcMax) {
zone[0] = new Point[256];
zone[1] = new Point[256];
stack = new int[stackMax];
@@ -54,7 +54,7 @@ public class Interpreter {
* ABSolute value
*/
private void _abs() {
- int n = pop();
+ final int n = pop();
if (n >= 0) {
push(n);
} else {
@@ -66,8 +66,8 @@ public class Interpreter {
* ADD
*/
private void _add() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push(n2 + n1);
}
@@ -92,8 +92,8 @@ public class Interpreter {
* logical AND
*/
private void _and() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push(((e1 != 0) && (e2 != 0)) ? 1 : 0);
}
@@ -108,7 +108,7 @@ public class Interpreter {
* CEILING
*/
private void _ceiling() {
- int n = pop();
+ final int n = pop();
if (n >= 0) {
push((n & 0xffc0) + (((n & 0x3f) != 0) ? 0x40 : 0));
} else {
@@ -138,7 +138,7 @@ public class Interpreter {
* DELTA exception C1
*/
private void _deltac1() {
- int n = pop();
+ final int n = pop();
for (int i = 0; i < n; i++) {
pop(); // pn
pop(); // argn
@@ -149,7 +149,7 @@ public class Interpreter {
* DELTA exception C2
*/
private void _deltac2() {
- int n = pop();
+ final int n = pop();
for (int i = 0; i < n; i++) {
pop(); // pn
pop(); // argn
@@ -160,7 +160,7 @@ public class Interpreter {
* DELTA exception C3
*/
private void _deltac3() {
- int n = pop();
+ final int n = pop();
for (int i = 0; i < n; i++) {
pop(); // pn
pop(); // argn
@@ -171,7 +171,7 @@ public class Interpreter {
* DELTA exception P1
*/
private void _deltap1() {
- int n = pop();
+ final int n = pop();
for (int i = 0; i < n; i++) {
pop(); // pn
pop(); // argn
@@ -182,7 +182,7 @@ public class Interpreter {
* DELTA exception P2
*/
private void _deltap2() {
- int n = pop();
+ final int n = pop();
for (int i = 0; i < n; i++) {
pop(); // pn
pop(); // argn
@@ -193,7 +193,7 @@ public class Interpreter {
* DELTA exception P3
*/
private void _deltap3() {
- int n = pop();
+ final int n = pop();
for (int i = 0; i < n; i++) {
pop(); // pn
pop(); // argn
@@ -211,8 +211,8 @@ public class Interpreter {
* DIVide
*/
private void _div() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push((n2 / n1) >> 6);
}
@@ -220,7 +220,7 @@ public class Interpreter {
* DUPlicate top stack element
*/
private void _dup() {
- int n = pop();
+ final int n = pop();
push(n);
push(n);
}
@@ -228,7 +228,7 @@ public class Interpreter {
/**
* ELSE
*/
- private int _else(int instructionIndex) {
+ private int _else(final int instructionIndex) {
return parser.handleElse(instructionIndex);
}
@@ -236,8 +236,8 @@ public class Interpreter {
* EQual
*/
private void _eq() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push((e1 == e2) ? 1 : 0);
}
@@ -249,7 +249,7 @@ public class Interpreter {
/**
* Function DEFinition
*/
- private void _fdef(int instructionIndex) {
+ private void _fdef(final int instructionIndex) {
functionMap[pop()] = instructionIndex;
inFuncDef = true;
}
@@ -275,7 +275,7 @@ public class Interpreter {
*/
private void _flippt() {
while(gs.loop-- > 0) {
- int index = pop();
+ final int index = pop();
zone[gs.zp0][index].onCurve = !zone[gs.zp0][index].onCurve;
}
gs.loop = 1;
@@ -285,8 +285,8 @@ public class Interpreter {
* FLIP RanGe OFF
*/
private void _fliprgoff() {
- int end = pop();
- int start = pop();
+ final int end = pop();
+ final int start = pop();
for (int i = start; i <= end; i++) {
zone[1][i].onCurve = false;
}
@@ -296,8 +296,8 @@ public class Interpreter {
* FLIP RanGe ON
*/
private void _fliprgon() {
- int end = pop();
- int start = pop();
+ final int end = pop();
+ final int start = pop();
for (int i = start; i <= end; i++) {
zone[1][i].onCurve = true;
}
@@ -307,7 +307,7 @@ public class Interpreter {
* FLOOR
*/
private void _floor() {
- int n = pop();
+ final int n = pop();
if (n >= 0) {
push(n & 0xffc0);
} else {
@@ -315,7 +315,7 @@ public class Interpreter {
}
}
- private void _gc(short param) {
+ private void _gc(final short param) {
pop();
push(0);
}
@@ -345,8 +345,8 @@ public class Interpreter {
* Greater Than
*/
private void _gt() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push((e1 > e2) ? 1 : 0);
}
@@ -354,8 +354,8 @@ public class Interpreter {
* Greater Than or EQual
*/
private void _gteq() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push((e1 >= e2) ? 1 : 0);
}
@@ -370,7 +370,7 @@ public class Interpreter {
/**
* IF test
*/
- private int _if(int instructionIndex) {
+ private int _if(final int instructionIndex) {
return parser.handleIf(pop() != 0, instructionIndex);
}
@@ -425,8 +425,8 @@ public class Interpreter {
* will be used in glyph instructions.
*/
private void _instctrl() {
- int s = pop();
- int v = pop();
+ final int s = pop();
+ final int v = pop();
if (s == 1) {
gs.instruction_control |= v;
} else if (s == 2) {
@@ -446,7 +446,7 @@ public class Interpreter {
pop();
}
- private void _iup(short param) {
+ private void _iup(final short param) {
}
/**
@@ -460,8 +460,8 @@ public class Interpreter {
* Jump Relative On False
*/
private int _jrof(int instructionIndex) {
- boolean test = pop() != 0;
- int offset = pop();
+ final boolean test = pop() != 0;
+ final int offset = pop();
if (!test) {
instructionIndex += offset - 1;
}
@@ -472,8 +472,8 @@ public class Interpreter {
* Jump Relative On True
*/
private int _jrot(int instructionIndex) {
- boolean test = pop() != 0;
- int offset = pop();
+ final boolean test = pop() != 0;
+ final int offset = pop();
if (test) {
instructionIndex += offset - 1;
}
@@ -484,8 +484,8 @@ public class Interpreter {
* LOOP and CALL function
*/
private void _loopcall() {
- int index = pop();
- int count = pop();
+ final int index = pop();
+ final int count = pop();
for (int i = 0; i < count; i++) {
execute(functionMap[i]);
}
@@ -495,8 +495,8 @@ public class Interpreter {
* Less Than
*/
private void _lt() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push((e1 < e2) ? 1 : 0);
}
@@ -504,8 +504,8 @@ public class Interpreter {
* Less Than or EQual
*/
private void _lteq() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push((e1 <= e2) ? 1 : 0);
}
@@ -513,26 +513,26 @@ public class Interpreter {
* MAXimum of top two stack elements
*/
private void _max() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push((n1 > n2) ? n1 : n2);
}
- private void _md(short param) {
+ private void _md(final short param) {
pop();
pop();
push(0);
}
- private void _mdap(short param) {
+ private void _mdap(final short param) {
pop();
}
- private void _mdrp(short param) {
+ private void _mdrp(final short param) {
pop();
}
- private void _miap(short param) {
+ private void _miap(final short param) {
pop();
pop();
}
@@ -540,8 +540,8 @@ public class Interpreter {
* MINimum of top two stack elements
*/
private void _min() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push((n1 < n2) ? n1 : n2);
}
@@ -550,15 +550,15 @@ public class Interpreter {
*/
private void _mindex() {
// Move the indexed element to stackIndex, and shift the others down
- int k = pop();
- int e = stack[stackIndex - k];
+ final int k = pop();
+ final int e = stack[stackIndex - k];
for (int i = stackIndex - k; i < stackIndex - 1; i++) {
stack[i] = stack[i+1];
}
stack[stackIndex - 1] = e;
}
- private void _mirp(short param) {
+ private void _mirp(final short param) {
pop();
pop();
}
@@ -571,7 +571,7 @@ public class Interpreter {
push(0);
}
- private void _msirp(short param) {
+ private void _msirp(final short param) {
pop();
pop();
}
@@ -580,8 +580,8 @@ public class Interpreter {
* MULtiply
*/
private void _mul() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push((n1 * n2) >> 6);
}
@@ -596,8 +596,8 @@ public class Interpreter {
* Not EQual
*/
private void _neq() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push((e1 != e2) ? 1 : 0);
}
@@ -608,7 +608,7 @@ public class Interpreter {
push((pop() != 0) ? 0 : 1);
}
- private void _nround(short param) {
+ private void _nround(final short param) {
pop();
push(0);
}
@@ -622,8 +622,8 @@ public class Interpreter {
* logical OR
*/
private void _or() {
- int e2 = pop();
- int e1 = pop();
+ final int e2 = pop();
+ final int e1 = pop();
push(((e1 != 0) || (e2 != 0)) ? 1 : 0);
}
@@ -633,7 +633,7 @@ public class Interpreter {
* PUSH Bytes
* PUSH Words
*/
- private void _push(int[] data) {
+ private void _push(final int[] data) {
for (int j = 0; j < data.length; j++) {
push(data[j]);
}
@@ -664,15 +664,15 @@ public class Interpreter {
* ROLL the top three stack elements
*/
private void _roll() {
- int a = pop();
- int b = pop();
- int c = pop();
+ final int a = pop();
+ final int b = pop();
+ final int c = pop();
push(b);
push(a);
push(c);
}
- private void _round(short param) {
+ private void _round(final short param) {
pop();
push(0);
}
@@ -907,7 +907,7 @@ public class Interpreter {
/**
* Set Dual Projection_Vector To Line
*/
- private void _sdpvtl(short param) {
+ private void _sdpvtl(final short param) {
pop();
pop();
}
@@ -930,7 +930,7 @@ public class Interpreter {
/*
* Set Freedom_Vector to Coordinate Axis
*/
- private void _sfvtca(short param) {
+ private void _sfvtca(final short param) {
if (param == 1) {
gs.freedom_vector[0] = 0x4000;
gs.freedom_vector[1] = 0x0000;
@@ -943,7 +943,7 @@ public class Interpreter {
/*
* Set Freedom_Vector To Line
*/
- private void _sfvtl(short param) {
+ private void _sfvtl(final short param) {
pop();
pop();
if (param == 1) {
@@ -963,7 +963,7 @@ public class Interpreter {
gs.freedom_vector[1] = gs.projection_vector[1];
}
- private void _shc(short param) {
+ private void _shc(final short param) {
pop();
}
@@ -972,7 +972,7 @@ public class Interpreter {
*
* USES: loop
*/
- private void _shp(short param) {
+ private void _shp(final short param) {
while(gs.loop-- > 0) {
pop();
if(param == 0) {
@@ -995,7 +995,7 @@ public class Interpreter {
gs.loop = 1;
}
- private void _shz(short param) {
+ private void _shz(final short param) {
pop();
}
@@ -1024,7 +1024,7 @@ public class Interpreter {
/*
* Set Projection_Vector To Coordinate Axis
*/
- private void _spvtca(short param) {
+ private void _spvtca(final short param) {
if (param == 1) {
gs.projection_vector[0] = 0x4000;
gs.projection_vector[1] = 0x0000;
@@ -1037,14 +1037,14 @@ public class Interpreter {
/**
* Set Projection_Vector To Line
*/
- private void _spvtl(short param) {
+ private void _spvtl(final short param) {
// We'll get a copy of the line and normalize it -
// divide the x- and y-coords by the vector's dot product.
- Point p1 = zone[gs.zp2][pop()];
- Point p2 = zone[gs.zp1][pop()];
- int x = p2.x - p1.x;
- int y = p2.y - p1.y;
+ final Point p1 = zone[gs.zp2][pop()];
+ final Point p2 = zone[gs.zp1][pop()];
+ final int x = p2.x - p1.x;
+ final int y = p2.y - p1.y;
if(param == 1) {
gs.projection_vector[0] = 0x0000;
gs.projection_vector[1] = 0x0000;
@@ -1097,15 +1097,15 @@ public class Interpreter {
* SUBtract
*/
private void _sub() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push(n2 - n1);
}
/**
* Set freedom and projection Vectors To Coordinate Axis
*/
- private void _svtca(short param) {
+ private void _svtca(final short param) {
if (param == 1) {
gs.projection_vector[0] = 0x4000;
gs.projection_vector[1] = 0x0000;
@@ -1123,8 +1123,8 @@ public class Interpreter {
* SWAP the top two elements on the stack
*/
private void _swap() {
- int n1 = pop();
- int n2 = pop();
+ final int n1 = pop();
+ final int n2 = pop();
push(n1);
push(n2);
}
@@ -1165,7 +1165,7 @@ public class Interpreter {
* Write Control Value Table in FUnits
*/
private void _wcvtf() {
- int value = pop();
+ final int value = pop();
// Conversion of value goes here
cvt[pop()] = value;
}
@@ -1174,7 +1174,7 @@ public class Interpreter {
* Write Control Value Table in Pixel units
*/
private void _wcvtp() {
- int value = pop();
+ final int value = pop();
// Conversion of value goes here
cvt[pop()] = value;
}
@@ -1188,7 +1188,7 @@ public class Interpreter {
public void execute(int ip) {
while (ip < ((ip & 0xffff0000) | parser.getISLength(ip >> 16))) {
- short opcode = parser.getOpcode(ip);
+ final short opcode = parser.getOpcode(ip);
if (inFuncDef) {
// We're within a function definition, so don't execute the code
@@ -1332,7 +1332,7 @@ public class Interpreter {
return stack[--stackIndex];
}
- private void push(int i) {
+ private void push(final int i) {
stack[stackIndex++] = i;
}
@@ -1351,7 +1351,7 @@ public class Interpreter {
}
}
- public void setParser(Parser p) {
+ public void setParser(final Parser p) {
parser = p;
}
}
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java
index 1159b2c17..ff1795a28 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java
@@ -28,7 +28,7 @@ import jogamp.graph.font.typecast.ot.Mnemonic;
*/
public class Parser {
- private short[][] instructions = new short[3][];
+ private final short[][] instructions = new short[3][];
/**
* Advance the instruction pointer to the next executable opcode.
@@ -41,7 +41,7 @@ public class Parser {
public int advanceIP(int ip) {
// The high word specifies font, cvt, or glyph program
- int prog = ip >> 16;
+ final int prog = ip >> 16;
int i = ip & 0xffff;
int dataCount;
ip++;
@@ -63,16 +63,16 @@ public class Parser {
return ip;
}
- public int getISLength(int prog) {
+ public int getISLength(final int prog) {
return instructions[prog].length;
}
- public short getOpcode(int ip) {
+ public short getOpcode(final int ip) {
return instructions[ip >> 16][ip & 0xffff];
}
- public short getPushCount(int ip) {
- short instr = instructions[ip >> 16][ip & 0xffff];
+ public short getPushCount(final int ip) {
+ final short instr = instructions[ip >> 16][ip & 0xffff];
if ((Mnemonic.NPUSHB == instr) || (Mnemonic.NPUSHW == instr)) {
return instructions[ip >> 16][(ip & 0xffff) + 1];
} else if ((Mnemonic.PUSHB == (instr & 0xf8)) || (Mnemonic.PUSHW == (instr & 0xf8))) {
@@ -81,12 +81,12 @@ public class Parser {
return 0;
}
- public int[] getPushData(int ip) {
- int count = getPushCount(ip);
- int[] data = new int[count];
- int prog = ip >> 16;
- int i = ip & 0xffff;
- short instr = instructions[prog][i];
+ public int[] getPushData(final int ip) {
+ final int count = getPushCount(ip);
+ final int[] data = new int[count];
+ final int prog = ip >> 16;
+ final int i = ip & 0xffff;
+ final short instr = instructions[prog][i];
if (Mnemonic.NPUSHB == instr) {
for (int j = 0; j < count; j++) {
data[j] = instructions[prog][i + j + 2];
@@ -114,7 +114,7 @@ public class Parser {
return ip;
}
- public int handleIf(boolean test, int ip) {
+ public int handleIf(final boolean test, int ip) {
if (test == false) {
// The TrueType spec says that we merely jump to the *next* ELSE or EIF
// instruction in the instruction stream. So therefore no nesting!
@@ -130,32 +130,32 @@ public class Parser {
/**
* This program is run everytime we scale the font
*/
- public void setCvtProgram(short[] program) {
+ public void setCvtProgram(final short[] program) {
instructions[1] = program;
}
/**
* This program is only run once
*/
- public void setFontProgram(short[] program) {
+ public void setFontProgram(final short[] program) {
instructions[0] = program;
}
/**
* This program is run everytime we scale the glyph
*/
- public void setGlyphProgram(short[] program) {
+ public void setGlyphProgram(final short[] program) {
instructions[2] = program;
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
int ip = 0;
while (ip < instructions[0].length) {
sb.append(Mnemonic.getMnemonic(getOpcode(ip)));
if (getPushCount(ip) > 0) {
- int[] data = getPushData(ip);
+ final int[] data = getPushData(ip);
for(int j = 0; j < data.length; j++)
sb.append(" ").append(data[j]);
}
@@ -167,7 +167,7 @@ public class Parser {
while (ip < (0x10000 | instructions[1].length)) {
sb.append(Mnemonic.getMnemonic(getOpcode(ip)));
if(getPushCount(ip) > 0) {
- int[] data = getPushData(ip);
+ final int[] data = getPushData(ip);
for (int j = 0; j < data.length; j++) {
sb.append(" ").append(data[j]);
}
@@ -180,7 +180,7 @@ public class Parser {
while (ip < (0x20000 | instructions[2].length)) {
sb.append(Mnemonic.getMnemonic(getOpcode(ip)));
if (getPushCount(ip) > 0) {
- int[] data = getPushData(ip);
+ final int[] data = getPushData(ip);
for (int j = 0; j < data.length; j++) {
sb.append(" ").append(data[j]);
}
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java b/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
index 2a30fa6ec..909240c76 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
@@ -69,7 +69,7 @@ public class AffineTransform implements Cloneable {
setToIdentity();
}
- public AffineTransform(AffineTransform t) {
+ public AffineTransform(final AffineTransform t) {
this.type = t.type;
this.m00 = t.m00;
this.m10 = t.m10;
@@ -79,7 +79,7 @@ public class AffineTransform implements Cloneable {
this.m12 = t.m12;
}
- public AffineTransform(float m00, float m10, float m01, float m11, float m02, float m12) {
+ public AffineTransform(final float m00, final float m10, final float m01, final float m11, final float m02, final float m12) {
this.type = TYPE_UNKNOWN;
this.m00 = m00;
this.m10 = m10;
@@ -89,7 +89,7 @@ public class AffineTransform implements Cloneable {
this.m12 = m12;
}
- public AffineTransform(float[] matrix) {
+ public AffineTransform(final float[] matrix) {
this.type = TYPE_UNKNOWN;
m00 = matrix[0];
m10 = matrix[1];
@@ -144,8 +144,8 @@ public class AffineTransform implements Cloneable {
type |= TYPE_FLIP;
}
- float dx = m00 * m00 + m10 * m10;
- float dy = m01 * m01 + m11 * m11;
+ final float dx = m00 * m00 + m10 * m10;
+ final float dy = m01 * m01 + m11 * m11;
if (dx != dy) {
type |= TYPE_GENERAL_SCALE;
} else
@@ -193,7 +193,7 @@ public class AffineTransform implements Cloneable {
return getType() == TYPE_IDENTITY;
}
- public final void getMatrix(float[] matrix) {
+ public final void getMatrix(final float[] matrix) {
matrix[0] = m00;
matrix[1] = m10;
matrix[2] = m01;
@@ -208,7 +208,7 @@ public class AffineTransform implements Cloneable {
return m00 * m11 - m01 * m10;
}
- public final AffineTransform setTransform(float m00, float m10, float m01, float m11, float m02, float m12) {
+ public final AffineTransform setTransform(final float m00, final float m10, final float m01, final float m11, final float m02, final float m12) {
this.type = TYPE_UNKNOWN;
this.m00 = m00;
this.m10 = m10;
@@ -219,7 +219,7 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform setTransform(AffineTransform t) {
+ public final AffineTransform setTransform(final AffineTransform t) {
type = t.type;
setTransform(t.m00, t.m10, t.m01, t.m11, t.m02, t.m12);
return this;
@@ -232,7 +232,7 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform setToTranslation(float mx, float my) {
+ public final AffineTransform setToTranslation(final float mx, final float my) {
m00 = m11 = 1.0f;
m01 = m10 = 0.0f;
m02 = mx;
@@ -245,7 +245,7 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform setToScale(float scx, float scy) {
+ public final AffineTransform setToScale(final float scx, final float scy) {
m00 = scx;
m11 = scy;
m10 = m01 = m02 = m12 = 0.0f;
@@ -257,7 +257,7 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform setToShear(float shx, float shy) {
+ public final AffineTransform setToShear(final float shx, final float shy) {
m00 = m11 = 1.0f;
m02 = m12 = 0.0f;
m01 = shx;
@@ -270,7 +270,7 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform setToRotation(float angle) {
+ public final AffineTransform setToRotation(final float angle) {
float sin = FloatUtil.sin(angle);
float cos = FloatUtil.cos(angle);
if (FloatUtil.abs(cos) < ZERO) {
@@ -289,7 +289,7 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform setToRotation(float angle, float px, float py) {
+ public final AffineTransform setToRotation(final float angle, final float px, final float py) {
setToRotation(angle);
m02 = px * (1.0f - m00) + py * m10;
m12 = py * (1.0f - m00) - px * m10;
@@ -297,23 +297,23 @@ public class AffineTransform implements Cloneable {
return this;
}
- public final AffineTransform translate(float mx, float my, AffineTransform tmp) {
+ public final AffineTransform translate(final float mx, final float my, final AffineTransform tmp) {
return concatenate(tmp.setToTranslation(mx, my));
}
- public final AffineTransform scale(float scx, float scy, AffineTransform tmp) {
+ public final AffineTransform scale(final float scx, final float scy, final AffineTransform tmp) {
return concatenate(tmp.setToScale(scx, scy));
}
- public final AffineTransform shear(float shx, float shy, AffineTransform tmp) {
+ public final AffineTransform shear(final float shx, final float shy, final AffineTransform tmp) {
return concatenate(tmp.setToShear(shx, shy));
}
- public final AffineTransform rotate(float angle, AffineTransform tmp) {
+ public final AffineTransform rotate(final float angle, final AffineTransform tmp) {
return concatenate(tmp.setToRotation(angle));
}
- public final AffineTransform rotate(float angle, float px, float py, AffineTransform tmp) {
+ public final AffineTransform rotate(final float angle, final float px, final float py, final AffineTransform tmp) {
return concatenate(tmp.setToRotation(angle, px, py));
}
@@ -345,7 +345,7 @@ public class AffineTransform implements Cloneable {
* @param tR the right-argument of the matrix multiplication
* @return this transform for chaining
*/
- public final AffineTransform concatenate(AffineTransform tR) {
+ public final AffineTransform concatenate(final AffineTransform tR) {
// setTransform(multiply(this, tR));
type = TYPE_UNKNOWN;
setTransform(
@@ -369,7 +369,7 @@ public class AffineTransform implements Cloneable {
* @param tL the left-argument of the matrix multiplication
* @return this transform for chaining
*/
- public final AffineTransform preConcatenate(AffineTransform tL) {
+ public final AffineTransform preConcatenate(final AffineTransform tL) {
// setTransform(multiply(tL, this));
type = TYPE_UNKNOWN;
setTransform(
@@ -383,7 +383,7 @@ public class AffineTransform implements Cloneable {
}
public final AffineTransform createInverse() throws NoninvertibleTransformException {
- float det = getDeterminant();
+ final float det = getDeterminant();
if (FloatUtil.abs(det) < ZERO) {
throw new NoninvertibleTransformException(determinantIsZero);
}
@@ -425,8 +425,8 @@ public class AffineTransform implements Cloneable {
public final void transform(final Vertex[] src, int srcOff, final Vertex[] dst, int dstOff, int length) {
while (--length >= 0) {
- Vertex srcPoint = src[srcOff++];
- Vertex dstPoint = dst[dstOff];
+ final Vertex srcPoint = src[srcOff++];
+ final Vertex dstPoint = dst[dstOff];
if (dstPoint == null) {
throw new IllegalArgumentException("dst["+dstOff+"] is null");
}
@@ -489,8 +489,8 @@ public class AffineTransform implements Cloneable {
public final void deltaTransform(final float[] src, int srcOff, final float[] dst, int dstOff, int length) {
while (--length >= 0) {
- float x = src[srcOff++];
- float y = src[srcOff++];
+ final float x = src[srcOff++];
+ final float y = src[srcOff++];
dst[dstOff++] = x * m00 + y * m01;
dst[dstOff++] = x * m10 + y * m11;
}
@@ -504,7 +504,7 @@ public class AffineTransform implements Cloneable {
* @throws NoninvertibleTransformException
*/
public final Vertex inverseTransform(final Vertex src, final Vertex dst) throws NoninvertibleTransformException {
- float det = getDeterminant();
+ final float det = getDeterminant();
if (FloatUtil.abs(det) < ZERO) {
throw new NoninvertibleTransformException(determinantIsZero);
}
@@ -517,28 +517,28 @@ public class AffineTransform implements Cloneable {
public final void inverseTransform(final float[] src, int srcOff, final float[] dst, int dstOff, int length)
throws NoninvertibleTransformException
{
- float det = getDeterminant();
+ final float det = getDeterminant();
if (FloatUtil.abs(det) < ZERO) {
throw new NoninvertibleTransformException(determinantIsZero);
}
while (--length >= 0) {
- float x = src[srcOff++] - m02;
- float y = src[srcOff++] - m12;
+ final float x = src[srcOff++] - m02;
+ final float y = src[srcOff++] - m12;
dst[dstOff++] = (x * m11 - y * m01) / det;
dst[dstOff++] = (y * m00 - x * m10) / det;
}
}
- public final Path2D createTransformedShape(Path2D src) {
+ public final Path2D createTransformedShape(final Path2D src) {
if (src == null) {
return null;
}
if (src instanceof Path2D) {
return src.createTransformedShape(this);
}
- PathIterator path = src.iterator(this);
- Path2D dst = new Path2D(path.getWindingRule());
+ final PathIterator path = src.iterator(this);
+ final Path2D dst = new Path2D(path.getWindingRule());
dst.append(path, false);
return dst;
}
@@ -555,7 +555,7 @@ public class AffineTransform implements Cloneable {
public final AffineTransform clone() {
try {
return (AffineTransform) super.clone();
- } catch (CloneNotSupportedException e) {
+ } catch (final CloneNotSupportedException e) {
throw new InternalError();
}
}
@@ -573,12 +573,12 @@ public class AffineTransform implements Cloneable {
} */
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof AffineTransform) {
- AffineTransform t = (AffineTransform)obj;
+ final AffineTransform t = (AffineTransform)obj;
return
m00 == t.m00 && m01 == t.m01 &&
m02 == t.m02 && m10 == t.m10 &&
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java b/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
index 982575b53..f46dd3c94 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
@@ -51,10 +51,10 @@ public class Crossing {
* @param res - the roots of the equation
* @return a number of roots
*/
- public static int solveQuad(float eqn[], float res[]) {
- float a = eqn[2];
- float b = eqn[1];
- float c = eqn[0];
+ public static int solveQuad(final float eqn[], final float res[]) {
+ final float a = eqn[2];
+ final float b = eqn[1];
+ final float c = eqn[0];
int rc = 0;
if (a == 0.0) {
if (b == 0.0) {
@@ -83,26 +83,26 @@ public class Crossing {
* @param res - the roots of the equation
* @return a number of roots
*/
- public static int solveCubic(float eqn[], float res[]) {
- float d = eqn[3];
+ public static int solveCubic(final float eqn[], final float res[]) {
+ final float d = eqn[3];
if (d == 0) {
return solveQuad(eqn, res);
}
- float a = eqn[2] / d;
- float b = eqn[1] / d;
- float c = eqn[0] / d;
+ final float a = eqn[2] / d;
+ final float b = eqn[1] / d;
+ final float c = eqn[0] / d;
int rc = 0;
- float Q = (a * a - 3.0f * b) / 9.0f;
- float R = (2.0f * a * a * a - 9.0f * a * b + 27.0f * c) / 54.0f;
- float Q3 = Q * Q * Q;
- float R2 = R * R;
- float n = - a / 3.0f;
+ final float Q = (a * a - 3.0f * b) / 9.0f;
+ final float R = (2.0f * a * a * a - 9.0f * a * b + 27.0f * c) / 54.0f;
+ final float Q3 = Q * Q * Q;
+ final float R2 = R * R;
+ final float n = - a / 3.0f;
if (R2 < Q3) {
- float t = FloatUtil.acos(R / FloatUtil.sqrt(Q3)) / 3.0f;
- float p = 2.0f * FloatUtil.PI / 3.0f;
- float m = -2.0f * FloatUtil.sqrt(Q);
+ final float t = FloatUtil.acos(R / FloatUtil.sqrt(Q3)) / 3.0f;
+ final float p = 2.0f * FloatUtil.PI / 3.0f;
+ final float m = -2.0f * FloatUtil.sqrt(Q);
res[rc++] = m * FloatUtil.cos(t) + n;
res[rc++] = m * FloatUtil.cos(t + p) + n;
res[rc++] = m * FloatUtil.cos(t - p) + n;
@@ -116,10 +116,10 @@ public class Crossing {
if (-ROOT_DELTA < A && A < ROOT_DELTA) {
res[rc++] = n;
} else {
- float B = Q / A;
+ final float B = Q / A;
res[rc++] = A + B + n;
// if (R2 == Q3) {
- float delta = R2 - Q3;
+ final float delta = R2 - Q3;
if (-ROOT_DELTA < delta && delta < ROOT_DELTA) {
res[rc++] = - (A + B) / 2.0f + n;
}
@@ -135,7 +135,7 @@ public class Crossing {
* @param rc - the roots count
* @return new roots count
*/
- static int fixRoots(float res[], int rc) {
+ static int fixRoots(final float res[], final int rc) {
int tc = 0;
for(int i = 0; i < rc; i++) {
out: {
@@ -158,7 +158,7 @@ public class Crossing {
float ax, ay, bx, by;
float Ax, Ay, Bx, By;
- public QuadCurve(float x1, float y1, float cx, float cy, float x2, float y2) {
+ public QuadCurve(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2) {
ax = x2 - x1;
ay = y2 - y1;
bx = cx - x1;
@@ -171,11 +171,11 @@ public class Crossing {
Ay = ay - By; // Ay = ay - 2.0 * by
}
- int cross(float res[], int rc, float py1, float py2) {
+ int cross(final float res[], final int rc, final float py1, final float py2) {
int cross = 0;
for (int i = 0; i < rc; i++) {
- float t = res[i];
+ final float t = res[i];
// CURVE-OUTSIDE
if (t < -DELTA || t > 1 + DELTA) {
@@ -196,10 +196,10 @@ public class Crossing {
continue;
}
// CURVE-INSIDE
- float ry = t * (t * Ay + By);
+ final float ry = t * (t * Ay + By);
// ry = t * t * Ay + t * By
if (ry > py2) {
- float rxt = t * Ax + bx;
+ final float rxt = t * Ax + bx;
// rxt = 2.0 * t * Ax + Bx = 2.0 * t * Ax + 2.0 * bx
if (rxt > -DELTA && rxt < DELTA) {
continue;
@@ -211,12 +211,12 @@ public class Crossing {
return cross;
}
- int solvePoint(float res[], float px) {
- float eqn[] = {-px, Bx, Ax};
+ int solvePoint(final float res[], final float px) {
+ final float eqn[] = {-px, Bx, Ax};
return solveQuad(eqn, res);
}
- int solveExtrem(float res[]) {
+ int solveExtrem(final float res[]) {
int rc = 0;
if (Ax != 0.0) {
res[rc++] = - Bx / (Ax + Ax);
@@ -227,11 +227,11 @@ public class Crossing {
return rc;
}
- int addBound(float bound[], int bc, float res[], int rc, float minX, float maxX, boolean changeId, int id) {
+ int addBound(final float bound[], int bc, final float res[], final int rc, final float minX, final float maxX, final boolean changeId, int id) {
for(int i = 0; i < rc; i++) {
- float t = res[i];
+ final float t = res[i];
if (t > -DELTA && t < 1 + DELTA) {
- float rx = t * (t * Ax + Bx);
+ final float rx = t * (t * Ax + Bx);
if (minX <= rx && rx <= maxX) {
bound[bc++] = t;
bound[bc++] = rx;
@@ -257,7 +257,7 @@ public class Crossing {
float Ax, Ay, Bx, By, Cx, Cy;
float Ax3, Bx2;
- public CubicCurve(float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2) {
+ public CubicCurve(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2) {
ax = x2 - x1;
ay = y2 - y1;
bx = cx1 - x1;
@@ -277,10 +277,10 @@ public class Crossing {
Bx2 = Bx + Bx;
}
- int cross(float res[], int rc, float py1, float py2) {
+ int cross(final float res[], final int rc, final float py1, final float py2) {
int cross = 0;
for (int i = 0; i < rc; i++) {
- float t = res[i];
+ final float t = res[i];
// CURVE-OUTSIDE
if (t < -DELTA || t > 1 + DELTA) {
@@ -301,7 +301,7 @@ public class Crossing {
continue;
}
// CURVE-INSIDE
- float ry = t * (t * (t * Ay + By) + Cy);
+ final float ry = t * (t * (t * Ay + By) + Cy);
// ry = t * t * t * Ay + t * t * By + t * Cy
if (ry > py2) {
float rxt = t * (t * Ax3 + Bx2) + Cx;
@@ -322,26 +322,26 @@ public class Crossing {
return cross;
}
- int solvePoint(float res[], float px) {
- float eqn[] = {-px, Cx, Bx, Ax};
+ int solvePoint(final float res[], final float px) {
+ final float eqn[] = {-px, Cx, Bx, Ax};
return solveCubic(eqn, res);
}
- int solveExtremX(float res[]) {
- float eqn[] = {Cx, Bx2, Ax3};
+ int solveExtremX(final float res[]) {
+ final float eqn[] = {Cx, Bx2, Ax3};
return solveQuad(eqn, res);
}
- int solveExtremY(float res[]) {
- float eqn[] = {Cy, By + By, Ay + Ay + Ay};
+ int solveExtremY(final float res[]) {
+ final float eqn[] = {Cy, By + By, Ay + Ay + Ay};
return solveQuad(eqn, res);
}
- int addBound(float bound[], int bc, float res[], int rc, float minX, float maxX, boolean changeId, int id) {
+ int addBound(final float bound[], int bc, final float res[], final int rc, final float minX, final float maxX, final boolean changeId, int id) {
for(int i = 0; i < rc; i++) {
- float t = res[i];
+ final float t = res[i];
if (t > -DELTA && t < 1 + DELTA) {
- float rx = t * (t * (t * Ax + Bx) + Cx);
+ final float rx = t * (t * (t * Ax + Bx) + Cx);
if (minX <= rx && rx <= maxX) {
bound[bc++] = t;
bound[bc++] = rx;
@@ -361,7 +361,7 @@ public class Crossing {
/**
* Returns how many times ray from point (x,y) cross line.
*/
- public static int crossLine(float x1, float y1, float x2, float y2, float x, float y) {
+ public static int crossLine(final float x1, final float y1, final float x2, final float y2, final float x, final float y) {
// LEFT/RIGHT/UP/EMPTY
if ((x < x1 && x < x2) ||
@@ -399,7 +399,7 @@ public class Crossing {
/**
* Returns how many times ray from point (x,y) cross quard curve
*/
- public static int crossQuad(float x1, float y1, float cx, float cy, float x2, float y2, float x, float y) {
+ public static int crossQuad(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2, final float x, final float y) {
// LEFT/RIGHT/UP/EMPTY
if ((x < x1 && x < cx && x < x2) ||
@@ -419,11 +419,11 @@ public class Crossing {
}
// INSIDE
- QuadCurve c = new QuadCurve(x1, y1, cx, cy, x2, y2);
- float px = x - x1;
- float py = y - y1;
- float res[] = new float[3];
- int rc = c.solvePoint(res, px);
+ final QuadCurve c = new QuadCurve(x1, y1, cx, cy, x2, y2);
+ final float px = x - x1;
+ final float py = y - y1;
+ final float res[] = new float[3];
+ final int rc = c.solvePoint(res, px);
return c.cross(res, rc, py, py);
}
@@ -431,7 +431,7 @@ public class Crossing {
/**
* Returns how many times ray from point (x,y) cross cubic curve
*/
- public static int crossCubic(float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, float x, float y) {
+ public static int crossCubic(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2, final float x, final float y) {
// LEFT/RIGHT/UP/EMPTY
if ((x < x1 && x < cx1 && x < cx2 && x < x2) ||
@@ -451,18 +451,18 @@ public class Crossing {
}
// INSIDE
- CubicCurve c = new CubicCurve(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
- float px = x - x1;
- float py = y - y1;
- float res[] = new float[3];
- int rc = c.solvePoint(res, px);
+ final CubicCurve c = new CubicCurve(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
+ final float px = x - x1;
+ final float py = y - y1;
+ final float res[] = new float[3];
+ final int rc = c.solvePoint(res, px);
return c.cross(res, rc, py, py);
}
/**
* Returns how many times ray from point (x,y) cross path
*/
- public static int crossPath(PathIterator p, float x, float y) {
+ public static int crossPath(final PathIterator p, final float x, final float y) {
int cross = 0;
float mx, my, cx, cy;
mx = my = cx = cy = 0.0f;
@@ -513,7 +513,7 @@ public class Crossing {
/**
* Returns how many times ray from point (x,y) cross shape
*/
- public static int crossShape(Path2D s, float x, float y) {
+ public static int crossShape(final Path2D s, final float x, final float y) {
if (!s.getBounds2D().contains(x, y)) {
return 0;
}
@@ -523,14 +523,14 @@ public class Crossing {
/**
* Returns true if value enough small
*/
- public static boolean isZero(float val) {
+ public static boolean isZero(final float val) {
return -DELTA < val && val < DELTA;
}
/**
* Sort bound array
*/
- static void sortBound(float bound[], int bc) {
+ static void sortBound(final float bound[], final int bc) {
for(int i = 0; i < bc - 4; i += 4) {
int k = i;
for(int j = i + 4; j < bc; j += 4) {
@@ -558,7 +558,7 @@ public class Crossing {
/**
* Returns are bounds intersect or not intersect rectangle
*/
- static int crossBound(float bound[], int bc, float py1, float py2) {
+ static int crossBound(final float bound[], final int bc, final float py1, final float py2) {
// LEFT/RIGHT
if (bc == 0) {
@@ -590,7 +590,7 @@ public class Crossing {
sortBound(bound, bc);
boolean sign = bound[2] > py2;
for(int i = 6; i < bc; i += 4) {
- boolean sign2 = bound[i] > py2;
+ final boolean sign2 = bound[i] > py2;
if (sign != sign2 && bound[i + 1] != bound[i - 3]) {
return CROSSING;
}
@@ -603,7 +603,7 @@ public class Crossing {
/**
* Returns how many times rectangle stripe cross line or the are intersect
*/
- public static int intersectLine(float x1, float y1, float x2, float y2, float rx1, float ry1, float rx2, float ry2) {
+ public static int intersectLine(final float x1, final float y1, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2) {
// LEFT/RIGHT/UP
if ((rx2 < x1 && rx2 < x2) ||
@@ -631,9 +631,9 @@ public class Crossing {
bx1 = x2 < rx1 ? rx1 : x2;
bx2 = x1 < rx2 ? x1 : rx2;
}
- float k = (y2 - y1) / (x2 - x1);
- float by1 = k * (bx1 - x1) + y1;
- float by2 = k * (bx2 - x1) + y1;
+ final float k = (y2 - y1) / (x2 - x1);
+ final float by1 = k * (bx1 - x1) + y1;
+ final float by2 = k * (bx2 - x1) + y1;
// BOUND-UP
if (by1 < ry1 && by2 < ry1) {
@@ -672,7 +672,7 @@ public class Crossing {
/**
* Returns how many times rectangle stripe cross quad curve or the are intersect
*/
- public static int intersectQuad(float x1, float y1, float cx, float cy, float x2, float y2, float rx1, float ry1, float rx2, float ry2) {
+ public static int intersectQuad(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2) {
// LEFT/RIGHT/UP ------------------------------------------------------
if ((rx2 < x1 && rx2 < cx && rx2 < x2) ||
@@ -691,15 +691,15 @@ public class Crossing {
}
// INSIDE -------------------------------------------------------------
- QuadCurve c = new QuadCurve(x1, y1, cx, cy, x2, y2);
- float px1 = rx1 - x1;
- float py1 = ry1 - y1;
- float px2 = rx2 - x1;
- float py2 = ry2 - y1;
-
- float res1[] = new float[3];
- float res2[] = new float[3];
- int rc1 = c.solvePoint(res1, px1);
+ final QuadCurve c = new QuadCurve(x1, y1, cx, cy, x2, y2);
+ final float px1 = rx1 - x1;
+ final float py1 = ry1 - y1;
+ final float px2 = rx2 - x1;
+ final float py2 = ry2 - y1;
+
+ final float res1[] = new float[3];
+ final float res2[] = new float[3];
+ final int rc1 = c.solvePoint(res1, px1);
int rc2 = c.solvePoint(res2, px2);
// INSIDE-LEFT/RIGHT
@@ -708,9 +708,9 @@ public class Crossing {
}
// Build bound --------------------------------------------------------
- float minX = px1 - DELTA;
- float maxX = px2 + DELTA;
- float bound[] = new float[28];
+ final float minX = px1 - DELTA;
+ final float maxX = px2 + DELTA;
+ final float bound[] = new float[28];
int bc = 0;
// Add roots
bc = c.addBound(bound, bc, res1, rc1, minX, maxX, false, 0);
@@ -733,7 +733,7 @@ public class Crossing {
}
// End build bound ----------------------------------------------------
- int cross = crossBound(bound, bc, py1, py2);
+ final int cross = crossBound(bound, bc, py1, py2);
if (cross != UNKNOWN) {
return cross;
}
@@ -743,7 +743,7 @@ public class Crossing {
/**
* Returns how many times rectangle stripe cross cubic curve or the are intersect
*/
- public static int intersectCubic(float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, float rx1, float ry1, float rx2, float ry2) {
+ public static int intersectCubic(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2) {
// LEFT/RIGHT/UP
if ((rx2 < x1 && rx2 < cx1 && rx2 < cx2 && rx2 < x2) ||
@@ -762,15 +762,15 @@ public class Crossing {
}
// INSIDE
- CubicCurve c = new CubicCurve(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
- float px1 = rx1 - x1;
- float py1 = ry1 - y1;
- float px2 = rx2 - x1;
- float py2 = ry2 - y1;
-
- float res1[] = new float[3];
- float res2[] = new float[3];
- int rc1 = c.solvePoint(res1, px1);
+ final CubicCurve c = new CubicCurve(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
+ final float px1 = rx1 - x1;
+ final float py1 = ry1 - y1;
+ final float px2 = rx2 - x1;
+ final float py2 = ry2 - y1;
+
+ final float res1[] = new float[3];
+ final float res2[] = new float[3];
+ final int rc1 = c.solvePoint(res1, px1);
int rc2 = c.solvePoint(res2, px2);
// LEFT/RIGHT
@@ -778,11 +778,11 @@ public class Crossing {
return 0;
}
- float minX = px1 - DELTA;
- float maxX = px2 + DELTA;
+ final float minX = px1 - DELTA;
+ final float maxX = px2 + DELTA;
// Build bound --------------------------------------------------------
- float bound[] = new float[40];
+ final float bound[] = new float[40];
int bc = 0;
// Add roots
bc = c.addBound(bound, bc, res1, rc1, minX, maxX, false, 0);
@@ -807,7 +807,7 @@ public class Crossing {
}
// End build bound ----------------------------------------------------
- int cross = crossBound(bound, bc, py1, py2);
+ final int cross = crossBound(bound, bc, py1, py2);
if (cross != UNKNOWN) {
return cross;
}
@@ -817,7 +817,7 @@ public class Crossing {
/**
* Returns how many times rectangle stripe cross path or the are intersect
*/
- public static int intersectPath(PathIterator p, float x, float y, float w, float h) {
+ public static int intersectPath(final PathIterator p, final float x, final float y, final float w, final float h) {
int cross = 0;
int count;
@@ -825,10 +825,10 @@ public class Crossing {
mx = my = cx = cy = 0.0f;
final float coords[] = new float[6];
- float rx1 = x;
- float ry1 = y;
- float rx2 = x + w;
- float ry2 = y + h;
+ final float rx1 = x;
+ final float ry1 = y;
+ final float rx2 = x + w;
+ final float ry2 = y + h;
while (!p.isDone()) {
count = 0;
@@ -879,7 +879,7 @@ public class Crossing {
/**
* Returns how many times rectangle stripe cross shape or the are intersect
*/
- public static int intersectShape(Path2D s, float x, float y, float w, float h) {
+ public static int intersectShape(final Path2D s, final float x, final float y, final float w, final float h) {
if (!s.getBounds2D().intersects2DRegion(x, y, w, h)) {
return 0;
}
@@ -889,14 +889,14 @@ public class Crossing {
/**
* Returns true if cross count correspond inside location for non zero path rule
*/
- public static boolean isInsideNonZero(int cross) {
+ public static boolean isInsideNonZero(final int cross) {
return cross != 0;
}
/**
* Returns true if cross count correspond inside location for even-odd path rule
*/
- public static boolean isInsideEvenOdd(int cross) {
+ public static boolean isInsideEvenOdd(final int cross) {
return (cross & 1) != 0;
}
}
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java b/src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java
index 55211b3f9..2c18e0834 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java
@@ -26,7 +26,7 @@ public class IllegalPathStateException extends RuntimeException {
public IllegalPathStateException() {
}
- public IllegalPathStateException(String s) {
+ public IllegalPathStateException(final String s) {
super(s);
}
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java b/src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java
index 398a03fca..6e49607b7 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java
@@ -23,7 +23,7 @@ public class NoninvertibleTransformException extends java.lang.Exception {
private static final long serialVersionUID = 6137225240503990466L;
- public NoninvertibleTransformException(String s) {
+ public NoninvertibleTransformException(final String s) {
super(s);
}
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
index a87c0a0a1..3b79c28b6 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
@@ -108,7 +108,7 @@ public final class Path2D implements Cloneable {
* Constructs a new GeneralPath.Iterator for given general path
* @param path - the source GeneralPath object
*/
- Iterator(Path2D path) {
+ Iterator(final Path2D path) {
this(path, null);
}
@@ -117,7 +117,7 @@ public final class Path2D implements Cloneable {
* @param path - the source GeneralPath object
* @param at - the AffineTransform object to apply rectangle path
*/
- Iterator(Path2D path, AffineTransform at) {
+ Iterator(final Path2D path, final AffineTransform at) {
this.p = path;
this.t = at;
}
@@ -138,12 +138,12 @@ public final class Path2D implements Cloneable {
}
@Override
- public int currentSegment(float[] coords) {
+ public int currentSegment(final float[] coords) {
if (isDone()) {
throw new NoSuchElementException(iteratorOutOfBounds);
}
- int type = p.types[typeIndex];
- int count = Path2D.pointShift[type];
+ final int type = p.types[typeIndex];
+ final int count = Path2D.pointShift[type];
System.arraycopy(p.points, pointIndex, coords, 0, count);
if (t != null) {
t.transform(coords, 0, coords, 0, count / 2);
@@ -158,24 +158,24 @@ public final class Path2D implements Cloneable {
this(WIND_NON_ZERO, BUFFER_SIZE);
}
- public Path2D(int rule) {
+ public Path2D(final int rule) {
this(rule, BUFFER_SIZE);
}
- public Path2D(int rule, int initialCapacity) {
+ public Path2D(final int rule, final int initialCapacity) {
setWindingRule(rule);
types = new byte[initialCapacity];
points = new float[initialCapacity * 2];
}
- public Path2D(Path2D path) {
+ public Path2D(final Path2D path) {
this(WIND_NON_ZERO, BUFFER_SIZE);
- PathIterator p = path.iterator(null);
+ final PathIterator p = path.iterator(null);
setWindingRule(p.getWindingRule());
append(p, false);
}
- public void setWindingRule(int rule) {
+ public void setWindingRule(final int rule) {
if (rule != WIND_EVEN_ODD && rule != WIND_NON_ZERO) {
throw new NoSuchElementException(invalidWindingRuleValue);
}
@@ -190,23 +190,23 @@ public final class Path2D implements Cloneable {
* Checks points and types buffer size to add pointCount points. If necessary realloc buffers to enlarge size.
* @param pointCount - the point count to be added in buffer
*/
- void checkBuf(int pointCount, boolean checkMove) {
+ void checkBuf(final int pointCount, final boolean checkMove) {
if (checkMove && typeSize == 0) {
throw new IllegalPathStateException("First segment should be SEG_MOVETO type");
}
if (typeSize == types.length) {
- byte tmp[] = new byte[typeSize + BUFFER_CAPACITY];
+ final byte tmp[] = new byte[typeSize + BUFFER_CAPACITY];
System.arraycopy(types, 0, tmp, 0, typeSize);
types = tmp;
}
if (pointSize + pointCount > points.length) {
- float tmp[] = new float[pointSize + Math.max(BUFFER_CAPACITY * 2, pointCount)];
+ final float tmp[] = new float[pointSize + Math.max(BUFFER_CAPACITY * 2, pointCount)];
System.arraycopy(points, 0, tmp, 0, pointSize);
points = tmp;
}
}
- public void moveTo(float x, float y) {
+ public void moveTo(final float x, final float y) {
if (typeSize > 0 && types[typeSize - 1] == PathIterator.SEG_MOVETO) {
points[pointSize - 2] = x;
points[pointSize - 1] = y;
@@ -218,14 +218,14 @@ public final class Path2D implements Cloneable {
}
}
- public void lineTo(float x, float y) {
+ public void lineTo(final float x, final float y) {
checkBuf(2, true);
types[typeSize++] = PathIterator.SEG_LINETO;
points[pointSize++] = x;
points[pointSize++] = y;
}
- public void quadTo(float x1, float y1, float x2, float y2) {
+ public void quadTo(final float x1, final float y1, final float x2, final float y2) {
checkBuf(4, true);
types[typeSize++] = PathIterator.SEG_QUADTO;
points[pointSize++] = x1;
@@ -234,7 +234,7 @@ public final class Path2D implements Cloneable {
points[pointSize++] = y2;
}
- public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3) {
+ public void curveTo(final float x1, final float y1, final float x2, final float y2, final float x3, final float y3) {
checkBuf(6, true);
types[typeSize++] = PathIterator.SEG_CUBICTO;
points[pointSize++] = x1;
@@ -265,12 +265,12 @@ public final class Path2D implements Cloneable {
return "[size "+size()+", closed "+isClosed()+"]";
}
- public void append(Path2D path, boolean connect) {
- PathIterator p = path.iterator(null);
+ public void append(final Path2D path, final boolean connect) {
+ final PathIterator p = path.iterator(null);
append(p, connect);
}
- public void append(PathIterator path, boolean connect) {
+ public void append(final PathIterator path, boolean connect) {
while (!path.isDone()) {
final float coords[] = new float[6];
final int segmentType = path.currentSegment(coords);
@@ -315,7 +315,7 @@ public final class Path2D implements Cloneable {
if (types[typeSize - 1] == PathIterator.SEG_CLOSE) {
for (int i = typeSize - 2; i > 0; i--) {
- int type = types[i];
+ final int type = types[i];
if (type == PathIterator.SEG_MOVETO) {
break;
}
@@ -330,12 +330,12 @@ public final class Path2D implements Cloneable {
pointSize = 0;
}
- public void transform(AffineTransform t) {
+ public void transform(final AffineTransform t) {
t.transform(points, 0, points, 0, pointSize / 2);
}
- public Path2D createTransformedShape(AffineTransform t) {
- Path2D p = (Path2D)clone();
+ public Path2D createTransformedShape(final AffineTransform t) {
+ final Path2D p = (Path2D)clone();
if (t != null) {
p.transform(t);
}
@@ -351,8 +351,8 @@ public final class Path2D implements Cloneable {
ry1 = ry2 = points[i--];
rx1 = rx2 = points[i--];
while (i > 0) {
- float y = points[i--];
- float x = points[i--];
+ final float y = points[i--];
+ final float x = points[i--];
if (x < rx1) {
rx1 = x;
} else
@@ -375,36 +375,36 @@ public final class Path2D implements Cloneable {
* @param cross - the point cross count
* @return true if point is inside path, or false otherwise
*/
- boolean isInside(int cross) {
+ boolean isInside(final int cross) {
if (rule == WIND_NON_ZERO) {
return Crossing.isInsideNonZero(cross);
}
return Crossing.isInsideEvenOdd(cross);
}
- public boolean contains(float px, float py) {
+ public boolean contains(final float px, final float py) {
return isInside(Crossing.crossShape(this, px, py));
}
- public boolean contains(float rx, float ry, float rw, float rh) {
- int cross = Crossing.intersectShape(this, rx, ry, rw, rh);
+ public boolean contains(final float rx, final float ry, final float rw, final float rh) {
+ final int cross = Crossing.intersectShape(this, rx, ry, rw, rh);
return cross != Crossing.CROSSING && isInside(cross);
}
- public boolean intersects(float rx, float ry, float rw, float rh) {
- int cross = Crossing.intersectShape(this, rx, ry, rw, rh);
+ public boolean intersects(final float rx, final float ry, final float rw, final float rh) {
+ final int cross = Crossing.intersectShape(this, rx, ry, rw, rh);
return cross == Crossing.CROSSING || isInside(cross);
}
- public boolean contains(Vertex p) {
+ public boolean contains(final Vertex p) {
return contains(p.getX(), p.getY());
}
- public boolean contains(AABBox r) {
+ public boolean contains(final AABBox r) {
return contains(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight());
}
- public boolean intersects(AABBox r) {
+ public boolean intersects(final AABBox r) {
return intersects(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight());
}
@@ -412,7 +412,7 @@ public final class Path2D implements Cloneable {
return new Iterator(this);
}
- public PathIterator iterator(AffineTransform t) {
+ public PathIterator iterator(final AffineTransform t) {
return new Iterator(this, t);
}
@@ -423,11 +423,11 @@ public final class Path2D implements Cloneable {
@Override
public Object clone() {
try {
- Path2D p = (Path2D) super.clone();
+ final Path2D p = (Path2D) super.clone();
p.types = types.clone();
p.points = points.clone();
return p;
- } catch (CloneNotSupportedException e) {
+ } catch (final CloneNotSupportedException e) {
throw new InternalError();
}
}
diff --git a/src/jogl/classes/jogamp/opengl/Debug.java b/src/jogl/classes/jogamp/opengl/Debug.java
index 9332b670a..8fa450f51 100644
--- a/src/jogl/classes/jogamp/opengl/Debug.java
+++ b/src/jogl/classes/jogamp/opengl/Debug.java
@@ -63,7 +63,7 @@ public class Debug extends PropertyAccess {
verbose = isPropertyDefined("jogl.verbose", true);
debugAll = isPropertyDefined("jogl.debug", true);
if (verbose) {
- Package p = Package.getPackage("javax.media.opengl");
+ final Package p = Package.getPackage("javax.media.opengl");
System.err.println("JOGL specification version " + p.getSpecificationVersion());
System.err.println("JOGL implementation version " + p.getImplementationVersion());
System.err.println("JOGL implementation vendor " + p.getImplementationVendor());
@@ -81,7 +81,7 @@ public class Debug extends PropertyAccess {
return debugAll;
}
- public static final boolean debug(String subcomponent) {
+ public static final boolean debug(final String subcomponent) {
return debugAll() || isPropertyDefined("jogl.debug." + subcomponent, true);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java
index 578f416b7..270a65882 100644
--- a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java
@@ -49,7 +49,7 @@ public abstract class DesktopGLDynamicLibraryBundleInfo extends GLDynamicLibrary
}
@Override
- public final boolean useToolGetProcAdressFirst(String funcName) {
+ public final boolean useToolGetProcAdressFirst(final String funcName) {
return true;
}
diff --git a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
index c1e1d1821..6025b45ff 100644
--- a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
+++ b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
@@ -33,7 +33,7 @@ import java.util.*;
public class DesktopGLDynamicLookupHelper extends GLDynamicLookupHelper {
- public DesktopGLDynamicLookupHelper(DesktopGLDynamicLibraryBundleInfo info) {
+ public DesktopGLDynamicLookupHelper(final DesktopGLDynamicLibraryBundleInfo info) {
super(info);
}
@@ -43,7 +43,7 @@ public class DesktopGLDynamicLookupHelper extends GLDynamicLookupHelper {
public final synchronized boolean loadGLULibrary() {
/** hacky code .. where all platform GLU libs are tried ..*/
if(null==gluLib) {
- List<String> gluLibNames = new ArrayList<String>();
+ final List<String> gluLibNames = new ArrayList<String>();
gluLibNames.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib"); // osx
gluLibNames.add("libGLU.so"); // unix
gluLibNames.add("GLU32"); // windows
diff --git a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
index fd59ecfd4..1b33e1a8b 100644
--- a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
+++ b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
@@ -44,6 +44,7 @@ import java.util.HashMap;
import java.util.StringTokenizer;
import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES3;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLContext;
@@ -77,7 +78,7 @@ final class ExtensionAvailabilityCache {
/**
* Flush and rebuild the cache.
*/
- final void reset(GLContextImpl context) {
+ final void reset(final GLContextImpl context) {
flush();
initAvailableExtensions(context);
}
@@ -91,7 +92,7 @@ final class ExtensionAvailabilityCache {
return availableExtensionCache.size();
}
- final boolean isExtensionAvailable(String glExtensionName) {
+ final boolean isExtensionAvailable(final String glExtensionName) {
validateInitialization();
return null != availableExtensionCache.get(glExtensionName);
}
@@ -124,8 +125,8 @@ final class ExtensionAvailabilityCache {
throw new InternalError("ExtensionAvailabilityCache not initialized!");
}
}
- private final void initAvailableExtensions(GLContextImpl context) {
- GL gl = context.getGL();
+ private final void initAvailableExtensions(final GLContextImpl context) {
+ final GL gl = context.getGL();
// if hash is empty (meaning it was flushed), pre-cache it with the list
// of extensions that are in the GL_EXTENSIONS string
if (isInitialized()) {
@@ -155,14 +156,14 @@ final class ExtensionAvailabilityCache {
}
if(useGetStringi) {
- GL2GL3 gl2gl3 = gl.getGL2GL3();
+ final GL2GL3 gl2gl3 = gl.getGL2GL3();
final int count;
{
- int[] val = { 0 } ;
- gl2gl3.glGetIntegerv(GL2GL3.GL_NUM_EXTENSIONS, val, 0);
+ final int[] val = { 0 } ;
+ gl2gl3.glGetIntegerv(GL2ES3.GL_NUM_EXTENSIONS, val, 0);
count = val[0];
}
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
for (int i = 0; i < count; i++) {
final String ext = gl2gl3.glGetStringi(GL.GL_EXTENSIONS, i);
if( null == availableExtensionCache.put(ext, ext) ) {
@@ -229,8 +230,8 @@ final class ExtensionAvailabilityCache {
final int ctxOptions = context.getCtxOptions();
final VersionNumber version = context.getGLVersionNumber();
- int major[] = new int[] { version.getMajor() };
- int minor[] = new int[] { version.getMinor() };
+ final int major[] = new int[] { version.getMajor() };
+ final int minor[] = new int[] { version.getMinor() };
do{
final String GL_XX_VERSION = ( context.isGLES() ? "GL_ES_VERSION_" : "GL_VERSION_" ) + major[0] + "_" + minor[0];
availableExtensionCache.put(GL_XX_VERSION, GL_XX_VERSION);
diff --git a/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java b/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
index 08a1fe882..d7ac6eb1e 100644
--- a/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
+++ b/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
@@ -60,11 +60,11 @@ public class FPSCounterImpl implements FPSCounter {
final long now = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
fpsLastPeriod = now - fpsLastUpdateTime;
fpsLastPeriod = Math.max(fpsLastPeriod, 1); // div 0
- fpsLast = ( (float)fpsUpdateFramesInterval * 1000f ) / ( (float) fpsLastPeriod ) ;
+ fpsLast = ( fpsUpdateFramesInterval * 1000f ) / ( fpsLastPeriod ) ;
fpsTotalDuration = now - fpsStartTime;
fpsTotalDuration = Math.max(fpsTotalDuration, 1); // div 0
- fpsTotal= ( (float)fpsTotalFrames * 1000f ) / ( (float) fpsTotalDuration ) ;
+ fpsTotal= ( fpsTotalFrames * 1000f ) / ( fpsTotalDuration ) ;
if(null != fpsOutputStream) {
fpsOutputStream.println(toString());
@@ -93,7 +93,7 @@ public class FPSCounterImpl implements FPSCounter {
}
@Override
- public final synchronized void setUpdateFPSFrames(int frames, PrintStream out) {
+ public final synchronized void setUpdateFPSFrames(final int frames, final PrintStream out) {
fpsUpdateFramesInterval = frames;
fpsOutputStream = out;
resetFPSCounter();
diff --git a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
index 493926f25..fce5c1fcc 100644
--- a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
+++ b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
@@ -100,7 +100,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
* the drawable is created w/ it's own new instance, e.g. offscreen drawables,
* and no further lifecycle handling is applied.
*/
- public GLAutoDrawableBase(GLDrawableImpl drawable, GLContextImpl context, boolean ownsDevice) {
+ public GLAutoDrawableBase(final GLDrawableImpl drawable, final GLContextImpl context, final boolean ownsDevice) {
this.drawable = drawable;
this.context = context;
this.preserveGLELSAtDestroy = false;
@@ -114,12 +114,12 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
@Override
- public final void setSharedContext(GLContext sharedContext) throws IllegalStateException {
+ public final void setSharedContext(final GLContext sharedContext) throws IllegalStateException {
helper.setSharedContext(this.context, sharedContext);
}
@Override
- public final void setSharedAutoDrawable(GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
+ public final void setSharedAutoDrawable(final GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
helper.setSharedAutoDrawable(this, sharedAutoDrawable);
}
@@ -127,14 +127,14 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
protected abstract RecursiveLock getLock();
@Override
- public final GLStateKeeper.Listener setGLStateKeeperListener(Listener l) {
+ public final GLStateKeeper.Listener setGLStateKeeperListener(final Listener l) {
final GLStateKeeper.Listener pre = glStateKeeperListener;
glStateKeeperListener = l;
return pre;
}
@Override
- public final boolean preserveGLStateAtDestroy(boolean value) {
+ public final boolean preserveGLStateAtDestroy(final boolean value) {
final boolean res = isGLStatePreservationSupported() ? true : false;
if( res ) {
if( DEBUG ) {
@@ -363,7 +363,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
// so we can continue with the destruction.
try {
helper.disposeGL(this, context, true);
- } catch (GLException gle) {
+ } catch (final GLException gle) {
gle.printStackTrace();
}
}
@@ -451,7 +451,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
}
- protected final GLEventListener defaultDisposeGLEventListener(GLEventListener listener, boolean remove) {
+ protected final GLEventListener defaultDisposeGLEventListener(final GLEventListener listener, final boolean remove) {
final RecursiveLock _lock = getLock();
_lock.lock();
try {
@@ -472,7 +472,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
@Override
- public final GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
+ public final GLContext setContext(final GLContext newCtx, final boolean destroyPrevCtx) {
final RecursiveLock lock = getLock();
lock.lock();
try {
@@ -495,7 +495,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
@Override
- public final GL setGL(GL gl) {
+ public final GL setGL(final GL gl) {
final GLContext _context = context;
if (_context != null) {
_context.setGL(gl);
@@ -505,12 +505,12 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
@Override
- public final void addGLEventListener(GLEventListener listener) {
+ public final void addGLEventListener(final GLEventListener listener) {
helper.addGLEventListener(listener);
}
@Override
- public final void addGLEventListener(int index, GLEventListener listener) throws IndexOutOfBoundsException {
+ public final void addGLEventListener(final int index, final GLEventListener listener) throws IndexOutOfBoundsException {
helper.addGLEventListener(index, listener);
}
@@ -520,7 +520,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
@Override
- public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
+ public GLEventListener getGLEventListener(final int index) throws IndexOutOfBoundsException {
return helper.getGLEventListener(index);
}
@@ -530,27 +530,27 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
@Override
- public boolean getGLEventListenerInitState(GLEventListener listener) {
+ public boolean getGLEventListenerInitState(final GLEventListener listener) {
return helper.getGLEventListenerInitState(listener);
}
@Override
- public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
+ public void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized) {
helper.setGLEventListenerInitState(listener, initialized);
}
@Override
- public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
+ public GLEventListener disposeGLEventListener(final GLEventListener listener, final boolean remove) {
return defaultDisposeGLEventListener(listener, remove);
}
@Override
- public final GLEventListener removeGLEventListener(GLEventListener listener) {
+ public final GLEventListener removeGLEventListener(final GLEventListener listener) {
return helper.removeGLEventListener(listener);
}
@Override
- public final void setAnimator(GLAnimatorControl animatorControl)
+ public final void setAnimator(final GLAnimatorControl animatorControl)
throws GLException {
helper.setAnimator(animatorControl);
}
@@ -561,7 +561,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
@Override
- public final Thread setExclusiveContextThread(Thread t) throws GLException {
+ public final Thread setExclusiveContextThread(final Thread t) throws GLException {
return helper.setExclusiveContextThread(t, context);
}
@@ -571,7 +571,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
@Override
- public final boolean invoke(boolean wait, GLRunnable glRunnable) {
+ public final boolean invoke(final boolean wait, final GLRunnable glRunnable) {
return helper.invoke(this, wait, glRunnable);
}
@@ -581,7 +581,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
@Override
- public final void setAutoSwapBufferMode(boolean enable) {
+ public final void setAutoSwapBufferMode(final boolean enable) {
helper.setAutoSwapBufferMode(enable);
}
@@ -591,7 +591,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
@Override
- public final void setContextCreationFlags(int flags) {
+ public final void setContextCreationFlags(final int flags) {
additionalCtxCreationFlags = flags;
final GLContext _context = context;
if(null != _context) {
@@ -609,7 +609,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
//
@Override
- public final void setUpdateFPSFrames(int frames, PrintStream out) {
+ public final void setUpdateFPSFrames(final int frames, final PrintStream out) {
fpsCounter.setUpdateFPSFrames(frames, out);
}
@@ -679,7 +679,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
}
@Override
- public final void setRealized(boolean realized) {
+ public final void setRealized(final boolean realized) {
final RecursiveLock _lock = getLock();
_lock.lock();
try {
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java
index 483b9b526..34857586d 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java
@@ -36,6 +36,7 @@ import javax.media.opengl.*;
import com.jogamp.common.nio.Buffers;
import com.jogamp.common.util.IntObjectHashMap;
+import com.jogamp.common.util.PropertyAccess;
/**
* Tracking of {@link GLBufferStorage} instances via GL API callbacks.
@@ -102,7 +103,7 @@ public class GLBufferObjectTracker {
static {
Debug.initSingleton();
- DEBUG = Debug.isPropertyDefined("jogl.debug.GLBufferObjectTracker", true);
+ DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.GLBufferObjectTracker", true);
}
static final class GLBufferStorageImpl extends GLBufferStorage {
@@ -146,7 +147,7 @@ public class GLBufferObjectTracker {
* @throws GLException if a native GL-Error occurs
*/
public synchronized final void createBufferStorage(final GLBufferStateTracker bufferStateTracker, final GL caller,
- final int target, final long size, final Buffer data, int mutableUsage, int immutableFlags,
+ final int target, final long size, final Buffer data, final int mutableUsage, final int immutableFlags,
final CreateStorageDispatch dispatch, final long glProcAddress) throws GLException {
final int glerrPre = caller.glGetError(); // clear
if (DEBUG && GL.GL_NO_ERROR != glerrPre) {
@@ -195,7 +196,7 @@ public class GLBufferObjectTracker {
* @throws GLException if a native GL-Error occurs
*/
public synchronized final void createBufferStorage(final GL caller,
- final int bufferName, final long size, final Buffer data, final int mutableUsage, int immutableFlags,
+ final int bufferName, final long size, final Buffer data, final int mutableUsage, final int immutableFlags,
final CreateStorageDispatch dispatch, final long glProcAddress) throws GLException {
final int glerrPre = caller.glGetError(); // clear
if (DEBUG && GL.GL_NO_ERROR != glerrPre) {
@@ -340,7 +341,7 @@ public class GLBufferObjectTracker {
*/
private synchronized final GLBufferStorage mapBufferImpl(final GLBufferStateTracker bufferStateTracker,
final GL caller, final int target, final boolean useRange,
- long offset, long length, final int access,
+ final long offset, final long length, final int access,
final MapBufferDispatch dispatch, final long glProcAddress) throws GLException {
final int bufferName = bufferStateTracker.getBoundBufferObject(target, caller);
if( 0 == bufferName ) {
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
index 511c1b9b9..9231804be 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
@@ -43,6 +43,7 @@ package jogamp.opengl;
import javax.media.opengl.*;
import com.jogamp.common.util.IntIntHashMap;
+import com.jogamp.common.util.PropertyAccess;
/**
* Tracks as closely as possible which OpenGL buffer object is bound
@@ -82,7 +83,7 @@ public class GLBufferStateTracker {
static {
Debug.initSingleton();
- DEBUG = Debug.isPropertyDefined("jogl.debug.GLBufferStateTracker", true);
+ DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.GLBufferStateTracker", true);
}
// Maps binding targets to buffer objects. A null value indicates
@@ -104,8 +105,8 @@ public class GLBufferStateTracker {
setBoundBufferObject(GL.GL_ARRAY_BUFFER, 0);
setBoundBufferObject(GL4.GL_DRAW_INDIRECT_BUFFER, 0);
setBoundBufferObject(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
- setBoundBufferObject(GL2.GL_PIXEL_PACK_BUFFER, 0);
- setBoundBufferObject(GL2.GL_PIXEL_UNPACK_BUFFER, 0);
+ setBoundBufferObject(GL2ES3.GL_PIXEL_PACK_BUFFER, 0);
+ setBoundBufferObject(GL2ES3.GL_PIXEL_UNPACK_BUFFER, 0);
}
@@ -136,8 +137,8 @@ public class GLBufferStateTracker {
case GL4.GL_DRAW_INDIRECT_BUFFER: return GL4.GL_DRAW_INDIRECT_BUFFER_BINDING;
case GL4.GL_DISPATCH_INDIRECT_BUFFER: return GL4.GL_DISPATCH_INDIRECT_BUFFER_BINDING;
case GL.GL_ELEMENT_ARRAY_BUFFER: return GL.GL_ELEMENT_ARRAY_BUFFER_BINDING;
- case GL2.GL_PIXEL_PACK_BUFFER: return GL2.GL_PIXEL_PACK_BUFFER_BINDING;
- case GL2.GL_PIXEL_UNPACK_BUFFER: return GL2.GL_PIXEL_UNPACK_BUFFER_BINDING;
+ case GL2ES3.GL_PIXEL_PACK_BUFFER: return GL2ES3.GL_PIXEL_PACK_BUFFER_BINDING;
+ case GL2ES3.GL_PIXEL_UNPACK_BUFFER: return GL2ES3.GL_PIXEL_UNPACK_BUFFER_BINDING;
// FIXME case GL4.GL_QUERY_BUFFER: return GL4.GL_QUERY_BUFFER_BINDING;
case GL4.GL_SHADER_STORAGE_BUFFER: return GL4.GL_SHADER_STORAGE_BUFFER_BINDING;
case GL2GL3.GL_TEXTURE_BUFFER: return GL2GL3.GL_TEXTURE_BINDING_BUFFER;
@@ -159,8 +160,8 @@ public class GLBufferStateTracker {
case GL4.GL_DRAW_INDIRECT_BUFFER:
case GL4.GL_DISPATCH_INDIRECT_BUFFER:
case GL.GL_ELEMENT_ARRAY_BUFFER:
- case GL2.GL_PIXEL_PACK_BUFFER:
- case GL2.GL_PIXEL_UNPACK_BUFFER:
+ case GL2ES3.GL_PIXEL_PACK_BUFFER:
+ case GL2ES3.GL_PIXEL_UNPACK_BUFFER:
// FIXME case GL4.GL_QUERY_BUFFER:
case GL4.GL_SHADER_STORAGE_BUFFER:
case GL2GL3.GL_TEXTURE_BUFFER:
@@ -185,7 +186,7 @@ public class GLBufferStateTracker {
* @param target
* @param bufferName
*/
- public final void setBoundBufferObject(int target, int bufferName) {
+ public final void setBoundBufferObject(final int target, final int bufferName) {
checkTargetName(target);
final int oldBufferName = bindingMap.put(target, bufferName);
/***
@@ -215,7 +216,7 @@ public class GLBufferStateTracker {
specified target (e.g. GL_ARRAY_BUFFER) is currently unknown.
You must use isBoundBufferObjectKnown() to see whether the
return value is valid. */
- public final int getBoundBufferObject(int target, GL caller) {
+ public final int getBoundBufferObject(final int target, final GL caller) {
int value = bindingMap.get(target);
if (bindingNotFound == value) {
// User probably either called glPushClientAttrib /
@@ -263,5 +264,5 @@ public class GLBufferStateTracker {
}
bindingMap.clear();
}
- private final String toHexString(int i) { return Integer.toHexString(i); }
+ private final String toHexString(final int i) { return Integer.toHexString(i); }
}
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index b88bdcdae..5671334bd 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -134,7 +134,7 @@ public abstract class GLContextImpl extends GLContext {
mappedGLXProcAddress.clear();
}
- public GLContextImpl(GLDrawableImpl drawable, GLContext shareWith) {
+ public GLContextImpl(final GLDrawableImpl drawable, final GLContext shareWith) {
super();
bufferStateTracker = new GLBufferStateTracker();
@@ -162,7 +162,7 @@ public abstract class GLContextImpl extends GLContext {
}
@Override
- protected void resetStates(boolean isInit) {
+ protected void resetStates(final boolean isInit) {
if( !isInit ) {
clearStates();
}
@@ -188,7 +188,7 @@ public abstract class GLContextImpl extends GLContext {
}
@Override
- public final GLDrawable setGLReadDrawable(GLDrawable read) {
+ public final GLDrawable setGLReadDrawable(final GLDrawable read) {
if(!isGLReadDrawableAvailable()) {
throw new GLException("Setting read drawable feature not available");
}
@@ -212,7 +212,7 @@ public abstract class GLContextImpl extends GLContext {
}
@Override
- public final GLDrawable setGLDrawable(GLDrawable readWrite, boolean setWriteOnly) {
+ public final GLDrawable setGLDrawable(final GLDrawable readWrite, final boolean setWriteOnly) {
if( drawable == readWrite && ( setWriteOnly || drawableRead == readWrite ) ) {
return drawable; // no change.
}
@@ -278,7 +278,7 @@ public abstract class GLContextImpl extends GLContext {
}
@Override
- public GL setGL(GL gl) {
+ public GL setGL(final GL gl) {
if( DEBUG ) {
final String sgl1 = (null!=this.gl)?this.gl.getClass().getSimpleName()+", "+this.gl.toString():"<null>";
final String sgl2 = (null!=gl)?gl.getClass().getSimpleName()+", "+gl.toString():"<null>";
@@ -314,7 +314,7 @@ public abstract class GLContextImpl extends GLContext {
public void release() throws GLException {
release(false);
}
- private void release(boolean inDestruction) throws GLException {
+ private void release(final boolean inDestruction) throws GLException {
if( TRACE_SWITCH ) {
System.err.println(getThreadName() +": GLContext.ContextSwitch[release.0]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+", inDestruction: "+inDestruction+", "+lock);
}
@@ -339,7 +339,7 @@ public abstract class GLContextImpl extends GLContext {
if( !inDestruction ) {
try {
contextMadeCurrent(false);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
drawableContextMadeCurrentException = t;
}
}
@@ -409,7 +409,7 @@ public abstract class GLContextImpl extends GLContext {
}
try {
associateDrawable(false);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
associateDrawableException = t;
}
if ( 0 != defaultVAO ) {
@@ -452,7 +452,7 @@ public abstract class GLContextImpl extends GLContext {
protected abstract void destroyImpl() throws GLException;
@Override
- public final void copy(GLContext source, int mask) throws GLException {
+ public final void copy(final GLContext source, final int mask) throws GLException {
if (source.getHandle() == 0) {
throw new GLException("Source OpenGL context has not been created");
}
@@ -568,7 +568,7 @@ public abstract class GLContextImpl extends GLContext {
tracker.ref();
}
*/
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
unlockResources = true;
throw e;
} finally {
@@ -580,7 +580,7 @@ public abstract class GLContextImpl extends GLContext {
}
}
} /* if ( drawable.isRealized() ) */
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
unlockResources = true;
throw e;
} finally {
@@ -632,7 +632,7 @@ public abstract class GLContextImpl extends GLContext {
return res;
}
- private final int makeCurrentWithinLock(int surfaceLockRes) throws GLException {
+ private final int makeCurrentWithinLock(final int surfaceLockRes) throws GLException {
if (!isCreated()) {
if( 0 >= drawable.getSurfaceWidth() || 0 >= drawable.getSurfaceHeight() ) {
if ( DEBUG_TRACE_SWITCH ) {
@@ -728,14 +728,14 @@ public abstract class GLContextImpl extends GLContext {
/**
* Calls {@link GLDrawableImpl#associateContext(GLContext, boolean)}
*/
- protected void associateDrawable(boolean bound) {
+ protected void associateDrawable(final boolean bound) {
drawable.associateContext(this, bound);
}
/**
* Calls {@link GLDrawableImpl#contextMadeCurrent(GLContext, boolean)}
*/
- protected void contextMadeCurrent(boolean current) {
+ protected void contextMadeCurrent(final boolean current) {
drawable.contextMadeCurrent(this, current);
}
@@ -840,9 +840,9 @@ public abstract class GLContextImpl extends GLContext {
if(DEBUG) {
System.err.println(getThreadName() + ": createContextARB: Requested "+GLContext.getGLVersion(reqMajorCTP[0], 0, reqMajorCTP[0], null));
}
- int _major[] = { 0 };
- int _minor[] = { 0 };
- int _ctp[] = { 0 };
+ final int _major[] = { 0 };
+ final int _minor[] = { 0 };
+ final int _ctp[] = { 0 };
long _ctx = 0;
if( GLContext.getAvailableGLVersion(device, reqMajorCTP[0], reqMajorCTP[1],
_major, _minor, _ctp)) {
@@ -860,7 +860,7 @@ public abstract class GLContextImpl extends GLContext {
return _ctx;
}
- private final boolean mapGLVersions(AbstractGraphicsDevice device) {
+ private final boolean mapGLVersions(final AbstractGraphicsDevice device) {
synchronized (GLContext.deviceVersionAvailable) {
final long t0 = ( DEBUG ) ? System.nanoTime() : 0;
boolean success = false;
@@ -985,7 +985,7 @@ public abstract class GLContextImpl extends GLContext {
* Note: Since context creation is temporary, caller need to issue {@link #resetStates(boolean)}, if creation was successful, i.e. returns true.
* This method does not reset the states, allowing the caller to utilize the state variables.
**/
- private final boolean createContextARBMapVersionsAvailable(int reqMajor, int reqProfile) {
+ private final boolean createContextARBMapVersionsAvailable(final int reqMajor, final int reqProfile) {
long _context;
int ctp = CTX_IS_ARB_CREATED | reqProfile;
@@ -994,8 +994,8 @@ public abstract class GLContextImpl extends GLContext {
// so the user can always cast to the highest available one.
int majorMax, minorMax;
int majorMin, minorMin;
- int major[] = new int[1];
- int minor[] = new int[1];
+ final int major[] = new int[1];
+ final int minor[] = new int[1];
if( 4 == reqMajor ) {
majorMax=4; minorMax=GLContext.getMaxMinor(ctp, majorMax);
majorMin=4; minorMin=0;
@@ -1034,7 +1034,7 @@ public abstract class GLContextImpl extends GLContext {
}
final boolean res;
if( 0 != _context ) {
- AbstractGraphicsDevice device = drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
+ final AbstractGraphicsDevice device = drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
// ctxMajorVersion, ctxMinorVersion, ctxOptions is being set by
// createContextARBVersions(..) -> setGLFunctionAvailbility(..) -> setContextVersion(..)
GLContext.mapAvailableGLVersion(device, reqMajor, reqProfile, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
@@ -1052,10 +1052,10 @@ public abstract class GLContextImpl extends GLContext {
return res;
}
- private final long createContextARBVersions(long share, boolean direct, int ctxOptionFlags,
- int majorMax, int minorMax,
- int majorMin, int minorMin,
- int major[], int minor[]) {
+ private final long createContextARBVersions(final long share, final boolean direct, final int ctxOptionFlags,
+ final int majorMax, final int minorMax,
+ final int majorMin, final int minorMin,
+ final int major[], final int minor[]) {
major[0]=majorMax;
minor[0]=minorMax;
long _context=0;
@@ -1097,7 +1097,7 @@ public abstract class GLContextImpl extends GLContext {
* If major > 0 || minor > 0 : Use passed values, determined at creation time
* Otherwise .. don't touch ..
*/
- private final void setContextVersion(int major, int minor, int ctp, VersionNumberString glVendorVersion, boolean useGL) {
+ private final void setContextVersion(final int major, final int minor, final int ctp, final VersionNumberString glVendorVersion, final boolean useGL) {
if ( 0 == ctp ) {
throw new GLException("Invalid GL Version "+major+"."+minor+", ctp "+toHexString(ctp));
}
@@ -1126,16 +1126,16 @@ public abstract class GLContextImpl extends GLContext {
// Helpers for various context implementations
//
- private Object createInstance(GLProfile glp, boolean glObject, Object[] cstrArgs) {
+ private Object createInstance(final GLProfile glp, final boolean glObject, final Object[] cstrArgs) {
return ReflectionUtil.createInstance(glp.getGLCtor(glObject), cstrArgs);
}
- private boolean verifyInstance(GLProfile glp, String suffix, Object instance) {
+ private boolean verifyInstance(final GLProfile glp, final String suffix, final Object instance) {
return ReflectionUtil.instanceOf(instance, glp.getGLImplBaseClassName()+suffix);
}
/** Create the GL for this context. */
- protected GL createGL(GLProfile glp) {
+ protected GL createGL(final GLProfile glp) {
final GL gl = (GL) createInstance(glp, true, new Object[] { glp, this } );
/* FIXME: refactor dependence on Java 2D / JOGL bridge
@@ -1152,11 +1152,11 @@ public abstract class GLContextImpl extends GLContext {
* Method calls 'void finalizeInit()' of instance 'gl' as retrieved by reflection, if exist.
* </p>
*/
- private void finalizeInit(GL gl) {
+ private void finalizeInit(final GL gl) {
Method finalizeInit = null;
try {
finalizeInit = ReflectionUtil.getMethod(gl.getClass(), "finalizeInit", new Class<?>[]{ });
- } catch ( Throwable t ) {
+ } catch ( final Throwable t ) {
if(DEBUG) {
System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage());
t.printStackTrace();
@@ -1198,9 +1198,9 @@ public abstract class GLContextImpl extends GLContext {
/** Maps the given "platform-independent" function name to a real function
name. Currently this is only used to map "glAllocateMemoryNV" and
associated routines to wglAllocateMemoryNV / glXAllocateMemoryNV. */
- protected final String mapToRealGLFunctionName(String glFunctionName) {
- Map<String, String> map = getFunctionNameMap();
- String lookup = ( null != map ) ? map.get(glFunctionName) : null;
+ protected final String mapToRealGLFunctionName(final String glFunctionName) {
+ final Map<String, String> map = getFunctionNameMap();
+ final String lookup = ( null != map ) ? map.get(glFunctionName) : null;
if (lookup != null) {
return lookup;
}
@@ -1213,9 +1213,9 @@ public abstract class GLContextImpl extends GLContext {
"GL_ARB_pbuffer" to "WGL_ARB_pbuffer/GLX_SGIX_pbuffer" and
"GL_ARB_pixel_format" to "WGL_ARB_pixel_format/n.a."
*/
- protected final String mapToRealGLExtensionName(String glExtensionName) {
- Map<String, String> map = getExtensionNameMap();
- String lookup = ( null != map ) ? map.get(glExtensionName) : null;
+ protected final String mapToRealGLExtensionName(final String glExtensionName) {
+ final Map<String, String> map = getExtensionNameMap();
+ final String lookup = ( null != map ) ? map.get(glExtensionName) : null;
if (lookup != null) {
return lookup;
}
@@ -1287,12 +1287,12 @@ public abstract class GLContextImpl extends GLContext {
* Note: Non ARB ctx is limited to GL 3.0.
* </p>
*/
- private static final VersionNumber getGLVersionNumber(int ctp, String glVersionStr) {
+ private static final VersionNumber getGLVersionNumber(final int ctp, final String glVersionStr) {
if( null != glVersionStr ) {
final GLVersionNumber version = GLVersionNumber.create(glVersionStr);
if ( version.isValid() ) {
- int[] major = new int[] { version.getMajor() };
- int[] minor = new int[] { version.getMinor() };
+ final int[] major = new int[] { version.getMajor() };
+ final int[] minor = new int[] { version.getMinor() };
if ( GLContext.isValidGLVersion(ctp, major[0], minor[0]) ) {
return new VersionNumber(major[0], minor[0], 0);
}
@@ -1308,7 +1308,7 @@ public abstract class GLContextImpl extends GLContext {
* If the GL query fails, major will be zero.
* </p>
*/
- private final boolean getGLIntVersion(int[] glIntMajor, int[] glIntMinor) {
+ private final boolean getGLIntVersion(final int[] glIntMajor, final int[] glIntMinor) {
glIntMajor[0] = 0; // clear
final GLDynamicLookupHelper glDynLookupHelper = getDrawableImpl().getGLDynamicLookupHelper();
final long _glGetIntegerv = glDynLookupHelper.dynamicLookupFunction("glGetIntegerv");
@@ -1319,8 +1319,8 @@ public abstract class GLContextImpl extends GLContext {
}
return false;
} else {
- glGetIntegervInt(GL2GL3.GL_MAJOR_VERSION, glIntMajor, 0, _glGetIntegerv);
- glGetIntegervInt(GL2GL3.GL_MINOR_VERSION, glIntMinor, 0, _glGetIntegerv);
+ glGetIntegervInt(GL2ES3.GL_MAJOR_VERSION, glIntMajor, 0, _glGetIntegerv);
+ glGetIntegervInt(GL2ES3.GL_MINOR_VERSION, glIntMinor, 0, _glGetIntegerv);
return true;
}
}
@@ -1361,8 +1361,8 @@ public abstract class GLContextImpl extends GLContext {
* @see javax.media.opengl.GLContext#CTX_PROFILE_COMPAT
* @see javax.media.opengl.GLContext#CTX_IMPL_ES2_COMPAT
*/
- protected final boolean setGLFunctionAvailability(boolean force, int major, int minor, int ctxProfileBits,
- boolean strictMatch, boolean withinGLVersionsMapping) {
+ protected final boolean setGLFunctionAvailability(final boolean force, int major, int minor, int ctxProfileBits,
+ final boolean strictMatch, final boolean withinGLVersionsMapping) {
if(null!=this.gl && null!=glProcAddressTable && !force) {
return true; // already done and not forced
}
@@ -1666,10 +1666,10 @@ public abstract class GLContextImpl extends GLContext {
}
private final void setRendererQuirks(final AbstractGraphicsDevice adevice, final GLDrawableFactoryImpl factory,
- int reqMajor, int reqMinor, int reqCTP,
- int major, int minor, int ctp, final VersionNumberString vendorVersion,
- boolean withinGLVersionsMapping) {
- int[] quirks = new int[GLRendererQuirks.COUNT + 1]; // + 1 ( NoFullFBOSupport )
+ final int reqMajor, final int reqMinor, final int reqCTP,
+ final int major, final int minor, final int ctp, final VersionNumberString vendorVersion,
+ final boolean withinGLVersionsMapping) {
+ final int[] quirks = new int[GLRendererQuirks.COUNT + 1]; // + 1 ( NoFullFBOSupport )
int i = 0;
final String MesaSP = "Mesa ";
@@ -1938,7 +1938,7 @@ public abstract class GLContextImpl extends GLContext {
}
}
- private static final boolean hasFBOImpl(int major, int ctp, ExtensionAvailabilityCache extCache) {
+ private static final boolean hasFBOImpl(final int major, final int ctp, final ExtensionAvailabilityCache extCache) {
return ( 0 != (ctp & CTX_PROFILE_ES) && major >= 2 ) || // ES >= 2.0
major >= 3 || // any >= 3.0 GL ctx (core, compat and ES)
@@ -1954,7 +1954,7 @@ public abstract class GLContextImpl extends GLContext {
extCache.isExtensionAvailable(GLExtensions.OES_framebuffer_object) ) ; // OES_framebuffer_object excluded
}
- private final void removeCachedVersion(int major, int minor, int ctxProfileBits) {
+ private final void removeCachedVersion(final int major, final int minor, int ctxProfileBits) {
if(!isCurrentContextHardwareRasterizer()) {
ctxProfileBits |= GLContext.CTX_IMPL_ACCEL_SOFT;
}
@@ -2006,14 +2006,14 @@ public abstract class GLContextImpl extends GLContext {
protected abstract StringBuilder getPlatformExtensionsStringImpl();
@Override
- public final boolean isFunctionAvailable(String glFunctionName) {
+ public final boolean isFunctionAvailable(final String glFunctionName) {
// Check GL 1st (cached)
if(null!=glProcAddressTable) { // null if this context wasn't not created
try {
if( glProcAddressTable.isFunctionAvailable( glFunctionName ) ) {
return true;
}
- } catch (Exception e) {}
+ } catch (final Exception e) {}
}
// Check platform extensions 2nd (cached) - context had to be enabled once
@@ -2023,25 +2023,25 @@ public abstract class GLContextImpl extends GLContext {
if( pTable.isFunctionAvailable( glFunctionName ) ) {
return true;
}
- } catch (Exception e) {}
+ } catch (final Exception e) {}
}
// dynamic function lookup at last incl name aliasing (not cached)
final DynamicLookupHelper dynLookup = getDrawableImpl().getGLDynamicLookupHelper();
final String tmpBase = GLNameResolver.normalizeVEN(GLNameResolver.normalizeARB(glFunctionName, true), true);
boolean res = false;
- int variants = GLNameResolver.getFuncNamePermutationNumber(tmpBase);
+ final int variants = GLNameResolver.getFuncNamePermutationNumber(tmpBase);
for(int i = 0; !res && i < variants; i++) {
final String tmp = GLNameResolver.getFuncNamePermutation(tmpBase, i);
try {
res = dynLookup.isFunctionAvailable(tmp);
- } catch (Exception e) { }
+ } catch (final Exception e) { }
}
return res;
}
@Override
- public final boolean isExtensionAvailable(String glExtensionName) {
+ public final boolean isExtensionAvailable(final String glExtensionName) {
if(null!=extensionAvailability) {
return extensionAvailability.isExtensionAvailable(mapToRealGLExtensionName(glExtensionName));
}
@@ -2081,7 +2081,7 @@ public abstract class GLContextImpl extends GLContext {
return false;
}
- protected static String getContextFQN(AbstractGraphicsDevice device, int major, int minor, int ctxProfileBits) {
+ protected static String getContextFQN(final AbstractGraphicsDevice device, final int major, final int minor, int ctxProfileBits) {
// remove non-key values
ctxProfileBits &= CTX_IMPL_CACHE_MASK;
@@ -2170,7 +2170,7 @@ public abstract class GLContextImpl extends GLContext {
* Method exists merely for code validation of {@link #isCurrent()}.
* </p>
*/
- public final boolean isOwner(Thread thread) {
+ public final boolean isOwner(final Thread thread) {
return lock.isOwner(thread);
}
@@ -2208,7 +2208,7 @@ public abstract class GLContextImpl extends GLContext {
*
* <p>Does not throw an exception if <code>target</code> is unknown or <code>framebufferName</code> invalid.</p>
*/
- public final void setBoundFramebuffer(int target, int framebufferName) {
+ public final void setBoundFramebuffer(final int target, final int framebufferName) {
if(0 > framebufferName) {
return; // ignore invalid name
}
@@ -2217,22 +2217,22 @@ public abstract class GLContextImpl extends GLContext {
boundFBOTarget[0] = framebufferName; // draw
boundFBOTarget[1] = framebufferName; // read
break;
- case GL2GL3.GL_DRAW_FRAMEBUFFER:
+ case GL2ES3.GL_DRAW_FRAMEBUFFER:
boundFBOTarget[0] = framebufferName; // draw
break;
- case GL2GL3.GL_READ_FRAMEBUFFER:
+ case GL2ES3.GL_READ_FRAMEBUFFER:
boundFBOTarget[1] = framebufferName; // read
break;
default: // ignore untracked target
}
}
@Override
- public final int getBoundFramebuffer(int target) {
+ public final int getBoundFramebuffer(final int target) {
switch(target) {
case GL.GL_FRAMEBUFFER:
- case GL2GL3.GL_DRAW_FRAMEBUFFER:
+ case GL2ES3.GL_DRAW_FRAMEBUFFER:
return boundFBOTarget[0]; // draw
- case GL2GL3.GL_READ_FRAMEBUFFER:
+ case GL2ES3.GL_READ_FRAMEBUFFER:
return boundFBOTarget[1]; // read
default:
throw new InternalError("Invalid FBO target name: "+toHexString(target));
@@ -2266,7 +2266,7 @@ public abstract class GLContextImpl extends GLContext {
}
@Override
- public final void setContextCreationFlags(int flags) {
+ public final void setContextCreationFlags(final int flags) {
if(!isCreated()) {
additionalCtxCreationFlags = flags & GLContext.CTX_OPTION_DEBUG;
}
@@ -2276,12 +2276,12 @@ public abstract class GLContextImpl extends GLContext {
public final boolean isGLDebugSynchronous() { return glDebugHandler.isSynchronous(); }
@Override
- public final void setGLDebugSynchronous(boolean synchronous) {
+ public final void setGLDebugSynchronous(final boolean synchronous) {
glDebugHandler.setSynchronous(synchronous);
}
@Override
- public final void enableGLDebugMessage(boolean enable) throws GLException {
+ public final void enableGLDebugMessage(final boolean enable) throws GLException {
if(!isCreated()) {
if(enable) {
additionalCtxCreationFlags |= GLContext.CTX_OPTION_DEBUG;
@@ -2295,17 +2295,17 @@ public abstract class GLContextImpl extends GLContext {
}
@Override
- public final void addGLDebugListener(GLDebugListener listener) {
+ public final void addGLDebugListener(final GLDebugListener listener) {
glDebugHandler.addListener(listener);
}
@Override
- public final void removeGLDebugListener(GLDebugListener listener) {
+ public final void removeGLDebugListener(final GLDebugListener listener) {
glDebugHandler.removeListener(listener);
}
@Override
- public final void glDebugMessageControl(int source, int type, int severity, int count, IntBuffer ids, boolean enabled) {
+ public final void glDebugMessageControl(final int source, final int type, final int severity, final int count, final IntBuffer ids, final boolean enabled) {
if(glDebugHandler.isExtensionARB()) {
gl.getGL2GL3().glDebugMessageControl(source, type, severity, count, ids, enabled);
} else if(glDebugHandler.isExtensionAMD()) {
@@ -2314,7 +2314,7 @@ public abstract class GLContextImpl extends GLContext {
}
@Override
- public final void glDebugMessageControl(int source, int type, int severity, int count, int[] ids, int ids_offset, boolean enabled) {
+ public final void glDebugMessageControl(final int source, final int type, final int severity, final int count, final int[] ids, final int ids_offset, final boolean enabled) {
if(glDebugHandler.isExtensionARB()) {
gl.getGL2GL3().glDebugMessageControl(source, type, severity, count, ids, ids_offset, enabled);
} else if(glDebugHandler.isExtensionAMD()) {
@@ -2323,7 +2323,7 @@ public abstract class GLContextImpl extends GLContext {
}
@Override
- public final void glDebugMessageInsert(int source, int type, int id, int severity, String buf) {
+ public final void glDebugMessageInsert(final int source, final int type, final int id, final int severity, final String buf) {
final int len = (null != buf) ? buf.length() : 0;
if(glDebugHandler.isExtensionARB()) {
gl.getGL2GL3().glDebugMessageInsert(source, type, id, severity, len, buf);
diff --git a/src/jogl/classes/jogamp/opengl/GLContextShareSet.java b/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
index c057c904c..209707f33 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
@@ -143,7 +143,7 @@ public class GLContextShareSet {
if (lastContext == null) {
throw new IllegalArgumentException("Last context is null");
}
- ShareSet share = entryFor(lastContext);
+ final ShareSet share = entryFor(lastContext);
if (share == null) {
throw new GLException("Last context is unknown: "+lastContext);
}
@@ -159,8 +159,8 @@ public class GLContextShareSet {
System.err.println("GLContextShareSet: unregisterSharing: " +
toHexString(lastContext.getHandle())+", entries: "+s.size());
}
- for(Iterator<GLContext> iter = s.iterator() ; iter.hasNext() ; ) {
- GLContext ctx = iter.next();
+ for(final Iterator<GLContext> iter = s.iterator() ; iter.hasNext() ; ) {
+ final GLContext ctx = iter.next();
if(null == removeEntry(ctx)) {
throw new GLException("Removal of shareSet for context failed");
}
@@ -207,7 +207,7 @@ public class GLContextShareSet {
}
/** Returns true if the given GLContext has shared and created GLContext left including itself, otherwise false. */
- public static synchronized boolean hasCreatedSharedLeft(GLContext context) {
+ public static synchronized boolean hasCreatedSharedLeft(final GLContext context) {
final Set<GLContext> s = getCreatedSharesImpl(context);
return null != s && s.size() > 0;
}
@@ -279,7 +279,7 @@ public class GLContextShareSet {
return shareMap.remove(context);
}
- private static String toHexString(long hex) {
+ private static String toHexString(final long hex) {
return "0x" + Long.toHexString(hex);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
index 2c947693c..7519d568b 100644
--- a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
+++ b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
@@ -32,11 +32,14 @@ import java.security.PrivilegedAction;
import java.util.ArrayList;
import javax.media.nativewindow.NativeWindowException;
+import javax.media.opengl.GL2ES2;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLDebugListener;
import javax.media.opengl.GLDebugMessage;
import javax.media.opengl.GLException;
+import jogamp.common.os.PlatformPropsImpl;
+
import com.jogamp.common.os.Platform;
import com.jogamp.gluegen.runtime.ProcAddressTable;
import com.jogamp.opengl.GLExtensions;
@@ -84,7 +87,7 @@ public class GLDebugMessageHandler {
* @param ctx the associated GLContext
* @param glDebugExtension chosen extension to use
*/
- public GLDebugMessageHandler(GLContextImpl ctx) {
+ public GLDebugMessageHandler(final GLContextImpl ctx) {
this.ctx = ctx;
this.listenerImpl = new ListenerSyncedImplStub<GLDebugListener>();
this.glDebugMessageCallbackProcAddress = 0;
@@ -95,7 +98,7 @@ public class GLDebugMessageHandler {
this.synchronous = true;
}
- public void init(boolean enable) {
+ public void init(final boolean enable) {
if(DEBUG) {
System.err.println("GLDebugMessageHandler.init("+enable+")");
}
@@ -113,7 +116,7 @@ public class GLDebugMessageHandler {
public Long run() {
try {
return Long.valueOf( table.getAddressFor(functionName) );
- } catch (IllegalArgumentException iae) {
+ } catch (final IllegalArgumentException iae) {
return Long.valueOf(0);
}
}
@@ -132,7 +135,7 @@ public class GLDebugMessageHandler {
}
return;
}
- if(Platform.OS_TYPE == Platform.OSType.WINDOWS && Platform.is32Bit()) {
+ if(PlatformPropsImpl.OS_TYPE == Platform.OSType.WINDOWS && Platform.is32Bit()) {
// Currently buggy, ie. throws an exception after leaving the native callback.
// Probably a 32bit on 64bit JVM / OpenGL-driver issue.
if(DEBUG) {
@@ -216,7 +219,7 @@ public class GLDebugMessageHandler {
/**
* @see javax.media.opengl.GLContext#setGLDebugSynchronous(boolean)
*/
- public final void setSynchronous(boolean synchronous) {
+ public final void setSynchronous(final boolean synchronous) {
this.synchronous = synchronous;
if( isEnabled() ) {
setSynchronousImpl();
@@ -225,9 +228,9 @@ public class GLDebugMessageHandler {
private final void setSynchronousImpl() {
if(isExtensionARB()) {
if(synchronous) {
- ctx.getGL().glEnable(GL2GL3.GL_DEBUG_OUTPUT_SYNCHRONOUS);
+ ctx.getGL().glEnable(GL2ES2.GL_DEBUG_OUTPUT_SYNCHRONOUS);
} else {
- ctx.getGL().glDisable(GL2GL3.GL_DEBUG_OUTPUT_SYNCHRONOUS);
+ ctx.getGL().glDisable(GL2ES2.GL_DEBUG_OUTPUT_SYNCHRONOUS);
}
if(DEBUG) {
System.err.println("GLDebugMessageHandler: synchronous "+synchronous);
@@ -238,14 +241,14 @@ public class GLDebugMessageHandler {
/**
* @see javax.media.opengl.GLContext#enableGLDebugMessage(boolean)
*/
- public final void enable(boolean enable) throws GLException {
+ public final void enable(final boolean enable) throws GLException {
ctx.validateCurrent();
if(!isAvailable()) {
return;
}
enableImpl(enable);
}
- final void enableImpl(boolean enable) throws GLException {
+ final void enableImpl(final boolean enable) throws GLException {
if(enable) {
if(0 == handle) {
setSynchronousImpl();
@@ -271,19 +274,19 @@ public class GLDebugMessageHandler {
return listenerImpl.size();
}
- public final void addListener(GLDebugListener listener) {
+ public final void addListener(final GLDebugListener listener) {
listenerImpl.addListener(-1, listener);
}
- public final void addListener(int index, GLDebugListener listener) {
+ public final void addListener(final int index, final GLDebugListener listener) {
listenerImpl.addListener(index, listener);
}
- public final void removeListener(GLDebugListener listener) {
+ public final void removeListener(final GLDebugListener listener) {
listenerImpl.removeListener(listener);
}
- private final void sendMessage(GLDebugMessage msg) {
+ private final void sendMessage(final GLDebugMessage msg) {
synchronized(listenerImpl) {
if(DEBUG) {
System.err.println("GLDebugMessageHandler: "+msg);
@@ -298,11 +301,11 @@ public class GLDebugMessageHandler {
public static class StdErrGLDebugListener implements GLDebugListener {
boolean threadDump;
- public StdErrGLDebugListener(boolean threadDump) {
+ public StdErrGLDebugListener(final boolean threadDump) {
this.threadDump = threadDump;
}
@Override
- public void messageSent(GLDebugMessage event) {
+ public void messageSent(final GLDebugMessage event) {
System.err.println(event);
if(threadDump) {
Thread.dumpStack();
@@ -314,12 +317,12 @@ public class GLDebugMessageHandler {
// native -> java
//
- protected final void glDebugMessageARB(int source, int type, int id, int severity, String msg) {
+ protected final void glDebugMessageARB(final int source, final int type, final int id, final int severity, final String msg) {
final GLDebugMessage event = new GLDebugMessage(ctx, System.currentTimeMillis(), source, type, id, severity, msg);
sendMessage(event);
}
- protected final void glDebugMessageAMD(int id, int category, int severity, String msg) {
+ protected final void glDebugMessageAMD(final int id, final int category, final int severity, final String msg) {
final GLDebugMessage event = GLDebugMessage.translateAMDEvent(ctx, System.currentTimeMillis(), id, category, severity, msg);
sendMessage(event);
}
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
index a401944ef..fd8052b96 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
@@ -95,7 +95,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
if( null != device) {
return getOrCreateSharedResourceImpl( device );
}
- } catch (GLException gle) {
+ } catch (final GLException gle) {
if(DEBUG) {
System.err.println("Caught exception on thread "+getThreadName());
gle.printStackTrace();
@@ -112,7 +112,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
*
* @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
*/
- public final GLContext getOrCreateSharedContext(AbstractGraphicsDevice device) {
+ public final GLContext getOrCreateSharedContext(final AbstractGraphicsDevice device) {
final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
if(null!=sr) {
return sr.getContext();
@@ -121,7 +121,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- protected final boolean createSharedResourceImpl(AbstractGraphicsDevice device) {
+ protected final boolean createSharedResourceImpl(final AbstractGraphicsDevice device) {
final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
if(null!=sr) {
return sr.isValid();
@@ -130,7 +130,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- public final GLRendererQuirks getRendererQuirks(AbstractGraphicsDevice device) {
+ public final GLRendererQuirks getRendererQuirks(final AbstractGraphicsDevice device) {
final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
if(null!=sr) {
return sr.getRendererQuirks();
@@ -145,7 +145,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
*
* @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared device to be used, may be <code>null</code> for the platform's default device.
*/
- protected final AbstractGraphicsDevice getOrCreateSharedDevice(AbstractGraphicsDevice device) {
+ protected final AbstractGraphicsDevice getOrCreateSharedDevice(final AbstractGraphicsDevice device) {
final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
if(null!=sr) {
return sr.getDevice();
@@ -164,7 +164,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
// Dispatching GLDrawable construction in respect to the NativeSurface Capabilities
//
@Override
- public final GLDrawable createGLDrawable(NativeSurface target) {
+ public final GLDrawable createGLDrawable(final NativeSurface target) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
@@ -252,16 +252,16 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp);
@Override
- public final GLPbuffer createGLPbuffer(AbstractGraphicsDevice deviceReq,
- GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser,
- int width,
- int height,
- GLContext shareWith) {
+ public final GLPbuffer createGLPbuffer(final AbstractGraphicsDevice deviceReq,
+ final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser,
+ final int width,
+ final int height,
+ final GLContext shareWith) {
if(width<=0 || height<=0) {
throw new GLException("initial size must be positive (were (" + width + " x " + height + "))");
}
- AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
+ final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
if(null == device) {
throw new GLException("No shared device for requested: "+deviceReq);
}
@@ -285,8 +285,8 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
//
@Override
- public final boolean canCreateFBO(AbstractGraphicsDevice deviceReq, GLProfile glp) {
- AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
+ public final boolean canCreateFBO(final AbstractGraphicsDevice deviceReq, final GLProfile glp) {
+ final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
if(null == device) {
throw new GLException("No shared device for requested: "+deviceReq);
}
@@ -294,11 +294,11 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice deviceReq,
- GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser,
- int width, int height,
- GLContext shareWith) {
+ public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(final AbstractGraphicsDevice deviceReq,
+ final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser,
+ final int width, final int height,
+ final GLContext shareWith) {
final GLDrawable drawable = createOffscreenDrawable( deviceReq, capsRequested, chooser, width, height );
drawable.setRealized(true);
final GLContext context = drawable.createContext(shareWith);
@@ -309,10 +309,10 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice deviceReq,
- GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser,
- int width, int height) {
+ public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(final AbstractGraphicsDevice deviceReq,
+ final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser,
+ final int width, final int height) {
final GLDrawable drawable = createOffscreenDrawable( deviceReq, capsRequested, chooser, width, height );
drawable.setRealized(true);
if(drawable instanceof GLFBODrawableImpl) {
@@ -322,7 +322,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- public final GLAutoDrawable createDummyAutoDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+ public final GLAutoDrawable createDummyAutoDrawable(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser) {
final GLDrawable drawable = createDummyDrawable(deviceReq, createNewDevice, capsRequested, chooser);
drawable.setRealized(true);
final GLAutoDrawable sharedDrawable = new GLAutoDrawableDelegate(drawable, null, null, true /*ownDevice*/, null) { };
@@ -330,10 +330,10 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- public final GLDrawable createOffscreenDrawable(AbstractGraphicsDevice deviceReq,
- GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser,
- int width, int height) {
+ public final GLDrawable createOffscreenDrawable(final AbstractGraphicsDevice deviceReq,
+ final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser,
+ final int width, final int height) {
if(width<=0 || height<=0) {
throw new GLException("initial size must be positive (were (" + width + " x " + height + "))");
}
@@ -355,7 +355,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- public final GLDrawable createDummyDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+ public final GLDrawable createDummyDrawable(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser) {
final AbstractGraphicsDevice device = createNewDevice ? getOrCreateSharedDevice(deviceReq) : deviceReq;
if(null == device) {
throw new GLException("No shared device for requested: "+deviceReq+", createNewDevice "+createNewDevice);
@@ -374,7 +374,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
/** Creates a platform independent unrealized FBO offscreen GLDrawable */
- protected final GLFBODrawable createFBODrawableImpl(NativeSurface dummySurface, GLCapabilitiesImmutable fboCaps, int textureUnit) {
+ protected final GLFBODrawable createFBODrawableImpl(final NativeSurface dummySurface, final GLCapabilitiesImmutable fboCaps, final int textureUnit) {
final GLDrawableImpl dummyDrawable = createOnscreenDrawableImpl(dummySurface);
return new GLFBODrawableImpl(this, dummyDrawable, dummySurface, fboCaps, textureUnit);
}
@@ -424,8 +424,8 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
*
* @return the created {@link ProxySurface} instance w/o defined surface handle but platform specific {@link UpstreamSurfaceHook}.
*/
- public final ProxySurface createDummySurface(AbstractGraphicsDevice deviceReq, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser,
- int width, int height) {
+ public final ProxySurface createDummySurface(final AbstractGraphicsDevice deviceReq, final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser chooser,
+ final int width, final int height) {
final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
if(null == device) {
throw new GLException("No shared device for requested: "+deviceReq);
@@ -461,8 +461,8 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
//
@Override
- public ProxySurface createProxySurface(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle,
- GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
+ public ProxySurface createProxySurface(final AbstractGraphicsDevice deviceReq, final int screenIdx, final long windowHandle,
+ final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstream) {
final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
if(null == device) {
throw new GLException("No shared device for requested: "+deviceReq);
@@ -520,7 +520,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
* @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory,
* or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL.
*/
- public static GLDrawableFactoryImpl getFactoryImpl(GLProfile glp) {
+ public static GLDrawableFactoryImpl getFactoryImpl(final GLProfile glp) {
return (GLDrawableFactoryImpl) getFactory(glp);
}
@@ -579,7 +579,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
* @throws IllegalArgumentException if any of the parameters were
* out-of-bounds
*/
- public boolean setDisplayGamma(float gamma, float brightness, float contrast) throws IllegalArgumentException {
+ public boolean setDisplayGamma(final float gamma, final float brightness, final float contrast) throws IllegalArgumentException {
if ((brightness < -1.0f) || (brightness > 1.0f)) {
throw new IllegalArgumentException("Brightness must be between -1.0 and 1.0");
}
@@ -587,13 +587,13 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
throw new IllegalArgumentException("Contrast must be greater than 0.0");
}
// FIXME: ensure gamma is > 1.0? Are smaller / negative values legal?
- int rampLength = getGammaRampLength();
+ final int rampLength = getGammaRampLength();
if (rampLength == 0) {
return false;
}
- float[] gammaRamp = new float[rampLength];
+ final float[] gammaRamp = new float[rampLength];
for (int i = 0; i < rampLength; i++) {
- float intensity = (float) i / (float) (rampLength - 1);
+ final float intensity = (float) i / (float) (rampLength - 1);
// apply gamma
float rampEntry = (float) java.lang.Math.pow(intensity, gamma);
// apply brightness
@@ -631,7 +631,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
/** Sets the gamma ramp for the main screen. Returns false if gamma
ramp changes were not supported. */
- protected boolean setGammaRamp(float[] ramp) {
+ protected boolean setGammaRamp(final float[] ramp) {
return false;
}
@@ -644,7 +644,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
/** Resets the gamma ramp, potentially using the specified Buffer as
data to restore the original values. */
- protected void resetGammaRamp(Buffer originalGammaRamp) {
+ protected void resetGammaRamp(final Buffer originalGammaRamp) {
}
// Shutdown hook mechanism for resetting gamma
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
index bf791822f..aea9a5b7b 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
@@ -60,6 +60,8 @@ import javax.media.opengl.GLFBODrawable;
import javax.media.opengl.GLRunnable;
import javax.media.opengl.GLSharedContextSetter;
+import com.jogamp.common.util.PropertyAccess;
+
/** Encapsulates the implementation of most of the GLAutoDrawable's
methods to be able to share it between GLAutoDrawable implementations like GLAutoDrawableBase, GLCanvas and GLJPanel. */
public class GLDrawableHelper {
@@ -68,7 +70,7 @@ public class GLDrawableHelper {
static {
Debug.initSingleton();
- PERF_STATS = Debug.isPropertyDefined("jogl.debug.GLDrawable.PerfStats", true);
+ PERF_STATS = PropertyAccess.isPropertyDefined("jogl.debug.GLDrawable.PerfStats", true);
}
protected static final boolean DEBUG = GLDrawableImpl.DEBUG;
@@ -108,7 +110,7 @@ public class GLDrawableHelper {
sharedAutoDrawable = null;
}
- public final void setSharedContext(GLContext thisContext, GLContext sharedContext) throws IllegalStateException {
+ public final void setSharedContext(final GLContext thisContext, final GLContext sharedContext) throws IllegalStateException {
if( null == sharedContext ) {
throw new IllegalStateException("Null shared GLContext");
}
@@ -124,7 +126,7 @@ public class GLDrawableHelper {
this.sharedContext = sharedContext;
}
- public final void setSharedAutoDrawable(GLAutoDrawable thisAutoDrawable, GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
+ public final void setSharedAutoDrawable(final GLAutoDrawable thisAutoDrawable, final GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
if( null == sharedAutoDrawable ) {
throw new IllegalStateException("Null shared GLAutoDrawable");
}
@@ -146,7 +148,7 @@ public class GLDrawableHelper {
* @return true if initialization is pending due to a set shared GLAutoDrawable or GLContext
* which is not ready yet. Otherwise false.
*/
- public boolean isSharedGLContextPending(GLContext[] shared) {
+ public boolean isSharedGLContextPending(final GLContext[] shared) {
final GLContext shareWith;
final boolean pending;
if ( null != sharedAutoDrawable ) {
@@ -168,12 +170,12 @@ public class GLDrawableHelper {
@Override
public final String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append("GLAnimatorControl: "+animatorCtrl+", ");
synchronized(listenersLock) {
sb.append("GLEventListeners num "+listeners.size()+" [");
for (int i=0; i < listeners.size(); i++) {
- Object l = listeners.get(i);
+ final Object l = listeners.get(i);
sb.append(l);
sb.append("[init ");
sb.append( !listenersToBeInit.contains(l) );
@@ -195,7 +197,7 @@ public class GLDrawableHelper {
* </p>
* @param ctx
*/
- public static final void forceNativeRelease(GLContext ctx) {
+ public static final void forceNativeRelease(final GLContext ctx) {
int releaseCount = 0;
do {
ctx.release();
@@ -236,7 +238,7 @@ public class GLDrawableHelper {
*
* @see GLAutoDrawable#setContext(GLContext, boolean)
*/
- public static final void switchContext(GLDrawable drawable, GLContext oldCtx, boolean destroyOldCtx, GLContext newCtx, int newCtxCreationFlags) {
+ public static final void switchContext(final GLDrawable drawable, final GLContext oldCtx, final boolean destroyOldCtx, final GLContext newCtx, final int newCtxCreationFlags) {
if( null != oldCtx ) {
if( destroyOldCtx ) {
oldCtx.destroy();
@@ -268,7 +270,7 @@ public class GLDrawableHelper {
* @param context maybe null
* @return the new drawable
*/
- public static final GLDrawableImpl recreateGLDrawable(GLDrawableImpl drawable, GLContext context) {
+ public static final GLDrawableImpl recreateGLDrawable(GLDrawableImpl drawable, final GLContext context) {
if( ! drawable.isRealized() ) {
return drawable;
}
@@ -335,7 +337,7 @@ public class GLDrawableHelper {
* @throws NativeWindowException is drawable is not offscreen or it's surface lock couldn't be claimed
* @throws GLException may be thrown a resize operation
*/
- public static final GLDrawableImpl resizeOffscreenDrawable(GLDrawableImpl drawable, GLContext context, int newWidth, int newHeight)
+ public static final GLDrawableImpl resizeOffscreenDrawable(GLDrawableImpl drawable, final GLContext context, int newWidth, int newHeight)
throws NativeWindowException, GLException
{
final NativeSurface ns = drawable.getNativeSurface();
@@ -385,11 +387,11 @@ public class GLDrawableHelper {
return drawable;
}
- public final void addGLEventListener(GLEventListener listener) {
+ public final void addGLEventListener(final GLEventListener listener) {
addGLEventListener(-1, listener);
}
- public final void addGLEventListener(int index, GLEventListener listener) {
+ public final void addGLEventListener(int index, final GLEventListener listener) {
synchronized(listenersLock) {
if(0>index) {
index = listeners.size();
@@ -408,7 +410,7 @@ public class GLDrawableHelper {
* Consider calling {@link #disposeGLEventListener(GLAutoDrawable, GLDrawable, GLContext, GLEventListener)}.
* @return the removed listener, or null if listener was not added
*/
- public final GLEventListener removeGLEventListener(GLEventListener listener) {
+ public final GLEventListener removeGLEventListener(final GLEventListener listener) {
synchronized(listenersLock) {
listenersToBeInit.remove(listener);
return listeners.remove(listener) ? listener : null;
@@ -447,13 +449,13 @@ public class GLDrawableHelper {
}
}
- public final boolean getGLEventListenerInitState(GLEventListener listener) {
+ public final boolean getGLEventListenerInitState(final GLEventListener listener) {
synchronized(listenersLock) {
return !listenersToBeInit.contains(listener);
}
}
- public final void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
+ public final void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized) {
synchronized(listenersLock) {
if(initialized) {
listenersToBeInit.remove(listener);
@@ -478,7 +480,7 @@ public class GLDrawableHelper {
* @param remove if true, the listener gets removed
* @return the disposed and/or removed listener, otherwise null if neither action is performed
*/
- public final GLEventListener disposeGLEventListener(GLAutoDrawable autoDrawable, GLEventListener listener, boolean remove) {
+ public final GLEventListener disposeGLEventListener(final GLAutoDrawable autoDrawable, final GLEventListener listener, final boolean remove) {
synchronized(listenersLock) {
if( remove ) {
if( listeners.remove(listener) ) {
@@ -512,7 +514,7 @@ public class GLDrawableHelper {
* @param autoDrawable
* @return the disposal count
*/
- public final int disposeAllGLEventListener(GLAutoDrawable autoDrawable, boolean remove) {
+ public final int disposeAllGLEventListener(final GLAutoDrawable autoDrawable, final boolean remove) {
int disposeCount = 0;
synchronized(listenersLock) {
if( remove ) {
@@ -613,7 +615,7 @@ public class GLDrawableHelper {
}
}
- private final void init(GLEventListener l, GLAutoDrawable drawable, boolean sendReshape, boolean setViewport) {
+ private final void init(final GLEventListener l, final GLAutoDrawable drawable, final boolean sendReshape, final boolean setViewport) {
l.init(drawable);
if(sendReshape) {
reshape(l, drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), setViewport, false /* checkInit */);
@@ -624,7 +626,7 @@ public class GLDrawableHelper {
* The default init action to be called once after ctx is being created @ 1st makeCurrent().
* @param sendReshape set to true if the subsequent display call won't reshape, otherwise false to avoid double reshape.
**/
- public final void init(GLAutoDrawable drawable, boolean sendReshape) {
+ public final void init(final GLAutoDrawable drawable, final boolean sendReshape) {
synchronized(listenersLock) {
final ArrayList<GLEventListener> _listeners = listeners;
final int listenerCount = _listeners.size();
@@ -645,13 +647,13 @@ public class GLDrawableHelper {
}
}
- public final void display(GLAutoDrawable drawable) {
+ public final void display(final GLAutoDrawable drawable) {
displayImpl(drawable);
if( glRunnables.size()>0 && !execGLRunnables(drawable) ) { // glRunnables volatile OK; execGL.. only executed if size > 0
displayImpl(drawable);
}
}
- private final void displayImpl(GLAutoDrawable drawable) {
+ private final void displayImpl(final GLAutoDrawable drawable) {
synchronized(listenersLock) {
final ArrayList<GLEventListener> _listeners = listeners;
final int listenerCount = _listeners.size();
@@ -667,8 +669,8 @@ public class GLDrawableHelper {
}
}
- private final void reshape(GLEventListener listener, GLAutoDrawable drawable,
- int x, int y, int width, int height, boolean setViewport, boolean checkInit) {
+ private final void reshape(final GLEventListener listener, final GLAutoDrawable drawable,
+ final int x, final int y, final int width, final int height, final boolean setViewport, final boolean checkInit) {
if(checkInit) {
// GLEventListener may need to be init,
// in case this one is added after the realization of the GLAutoDrawable
@@ -692,7 +694,7 @@ public class GLDrawableHelper {
listener.reshape(drawable, x, y, width, height);
}
- public final void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public final void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
synchronized(listenersLock) {
for (int i=0; i < listeners.size(); i++) {
reshape(listeners.get(i), drawable, x, y, width, height, 0==i /* setViewport */, true /* checkInit */);
@@ -700,7 +702,7 @@ public class GLDrawableHelper {
}
}
- private final boolean execGLRunnables(GLAutoDrawable drawable) { // glRunnables.size()>0
+ private final boolean execGLRunnables(final GLAutoDrawable drawable) { // glRunnables.size()>0
boolean res = true;
// swap one-shot list asap
final ArrayList<GLRunnableTask> _glRunnables;
@@ -742,7 +744,7 @@ public class GLDrawableHelper {
}
}
- public final void setAnimator(GLAnimatorControl animator) throws GLException {
+ public final void setAnimator(final GLAnimatorControl animator) throws GLException {
synchronized(glRunnablesLock) {
if(animatorCtrl!=animator && null!=animator && null!=animatorCtrl) {
throw new GLException("Trying to register GLAnimatorControl "+animator+", where "+animatorCtrl+" is already registered. Unregister first.");
@@ -789,14 +791,14 @@ public class GLDrawableHelper {
* @param glRunnable the {@link GLRunnable} to execute within {@link #display()}
* @return <code>true</code> if the {@link GLRunnable} has been processed or queued, otherwise <code>false</code>.
*/
- public final boolean invoke(GLAutoDrawable drawable, boolean wait, GLRunnable glRunnable) {
+ public final boolean invoke(final GLAutoDrawable drawable, boolean wait, final GLRunnable glRunnable) {
if( null == glRunnable || null == drawable ||
wait && ( !drawable.isRealized() || null==drawable.getContext() ) ) {
return false;
}
GLRunnableTask rTask = null;
- Object rTaskLock = new Object();
+ final Object rTaskLock = new Object();
Throwable throwable = null;
synchronized(rTaskLock) {
final boolean deferred;
@@ -815,7 +817,7 @@ public class GLDrawableHelper {
} else if( wait ) {
try {
rTaskLock.wait(); // free lock, allow execution of rTask
- } catch (InterruptedException ie) {
+ } catch (final InterruptedException ie) {
throwable = ie;
}
if(null==throwable) {
@@ -829,7 +831,7 @@ public class GLDrawableHelper {
return true;
}
- public final boolean invoke(GLAutoDrawable drawable, boolean wait, List<GLRunnable> newGLRunnables) {
+ public final boolean invoke(final GLAutoDrawable drawable, boolean wait, final List<GLRunnable> newGLRunnables) {
if( null == newGLRunnables || newGLRunnables.size() == 0 || null == drawable ||
wait && ( !drawable.isRealized() || null==drawable.getContext() ) ) {
return false;
@@ -837,7 +839,7 @@ public class GLDrawableHelper {
final int count = newGLRunnables.size();
GLRunnableTask rTask = null;
- Object rTaskLock = new Object();
+ final Object rTaskLock = new Object();
Throwable throwable = null;
synchronized(rTaskLock) {
final boolean deferred;
@@ -859,7 +861,7 @@ public class GLDrawableHelper {
} else if( wait ) {
try {
rTaskLock.wait(); // free lock, allow execution of rTask
- } catch (InterruptedException ie) {
+ } catch (final InterruptedException ie) {
throwable = ie;
}
if(null==throwable) {
@@ -873,7 +875,7 @@ public class GLDrawableHelper {
return true;
}
- public final void enqueue(GLRunnable glRunnable) {
+ public final void enqueue(final GLRunnable glRunnable) {
if( null == glRunnable) {
return;
}
@@ -882,7 +884,7 @@ public class GLDrawableHelper {
}
}
- public final void setAutoSwapBufferMode(boolean enable) {
+ public final void setAutoSwapBufferMode(final boolean enable) {
autoSwapBufferMode = enable;
}
@@ -921,7 +923,7 @@ public class GLDrawableHelper {
* @return previous exclusive context thread
* @throws GLException If an exclusive thread is still active but a new one is attempted to be set
*/
- public final Thread setExclusiveContextThread(Thread t, GLContext context) throws GLException {
+ public final Thread setExclusiveContextThread(final Thread t, final GLContext context) throws GLException {
if (DEBUG) {
System.err.println("GLDrawableHelper.setExclusiveContextThread(): START switch "+getExclusiveContextSwitchString()+", thread "+exclusiveContextThread+" -> "+t+" -- currentThread "+Thread.currentThread());
}
@@ -938,7 +940,7 @@ public class GLDrawableHelper {
if( null != context && context.isCurrent() ) {
try {
forceNativeRelease(context);
- } catch (Throwable ex) {
+ } catch (final Throwable ex) {
ex.printStackTrace();
throw new GLException(ex);
}
@@ -982,7 +984,7 @@ public class GLDrawableHelper {
final Runnable initAction) {
if(null==context) {
if (DEBUG) {
- Exception e = new GLException(getThreadName()+" Info: GLDrawableHelper " + this + ".invokeGL(): NULL GLContext");
+ final Exception e = new GLException(getThreadName()+" Info: GLDrawableHelper " + this + ".invokeGL(): NULL GLContext");
e.printStackTrace();
}
return;
@@ -1010,7 +1012,7 @@ public class GLDrawableHelper {
* @param destroyContext destroy context in the end while holding the lock
*/
public final void disposeGL(final GLAutoDrawable autoDrawable,
- final GLContext context, boolean destroyContext) {
+ final GLContext context, final boolean destroyContext) {
// Support for recursive makeCurrent() calls as well as calling
// other drawables' display() methods from within another one's
GLContext lastContext = GLContext.getCurrent();
@@ -1044,7 +1046,7 @@ public class GLDrawableHelper {
forceNativeRelease(context);
}
flushGLRunnables();
- } catch (Exception e) {
+ } catch (final Exception e) {
System.err.println("Caught exception on thread "+getThreadName());
e.printStackTrace();
}
@@ -1130,7 +1132,7 @@ public class GLDrawableHelper {
if( releaseContext ) {
try {
context.release();
- } catch (Exception e) {
+ } catch (final Exception e) {
System.err.println("Caught exception on thread "+getThreadName());
e.printStackTrace();
}
@@ -1188,14 +1190,14 @@ public class GLDrawableHelper {
}
}
- long t0 = System.currentTimeMillis();
+ final long t0 = System.currentTimeMillis();
long tdA = 0; // makeCurrent
long tdR = 0; // render time
long tdS = 0; // swapBuffers
long tdX = 0; // release
boolean ctxClaimed = false;
boolean ctxReleased = false;
- boolean ctxDestroyed = false;
+ final boolean ctxDestroyed = false;
try {
final boolean releaseContext;
if( GLContext.CONTEXT_NOT_CURRENT == res ) {
@@ -1236,7 +1238,7 @@ public class GLDrawableHelper {
try {
context.release();
ctxReleased = true;
- } catch (Exception e) {
+ } catch (final Exception e) {
System.err.println("Caught exception on thread "+getThreadName());
e.printStackTrace();
}
@@ -1252,7 +1254,7 @@ public class GLDrawableHelper {
}
}
}
- long td = System.currentTimeMillis() - t0;
+ final long td = System.currentTimeMillis() - t0;
System.err.println("td0 "+td+"ms, fps "+(1.0/(td/1000.0))+", td-makeCurrent: "+tdA+"ms, td-render "+tdR+"ms, td-swap "+tdS+"ms, td-release "+tdX+"ms, ctx claimed: "+ctxClaimed+", ctx release: "+ctxReleased+", ctx destroyed "+ctxDestroyed);
}
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
index 2070c2f4e..3bb22612f 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
@@ -54,11 +54,11 @@ import javax.media.opengl.GLProfile;
public abstract class GLDrawableImpl implements GLDrawable {
protected static final boolean DEBUG = GLDrawableFactoryImpl.DEBUG;
- protected GLDrawableImpl(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
+ protected GLDrawableImpl(final GLDrawableFactory factory, final NativeSurface comp, final boolean realized) {
this(factory, comp, (GLCapabilitiesImmutable) comp.getGraphicsConfiguration().getRequestedCapabilities(), realized);
}
- protected GLDrawableImpl(GLDrawableFactory factory, NativeSurface comp, GLCapabilitiesImmutable requestedCapabilities, boolean realized) {
+ protected GLDrawableImpl(final GLDrawableFactory factory, final NativeSurface comp, final GLCapabilitiesImmutable requestedCapabilities, final boolean realized) {
this.factory = factory;
this.surface = comp;
this.realized = realized;
@@ -120,7 +120,7 @@ public abstract class GLDrawableImpl implements GLDrawable {
*/
protected abstract void swapBuffersImpl(boolean doubleBuffered);
- public final static String toHexString(long hex) {
+ public final static String toHexString(final long hex) {
return "0x" + Long.toHexString(hex);
}
@@ -170,14 +170,14 @@ public abstract class GLDrawableImpl implements GLDrawable {
}
@Override
- public final void setRealized(boolean realizedArg) {
+ public final void setRealized(final boolean realizedArg) {
if ( realized != realizedArg ) { // volatile: OK (locked below)
final boolean isProxySurface = surface instanceof ProxySurface;
if(DEBUG) {
System.err.println(getThreadName() + ": setRealized: drawable "+getClass().getSimpleName()+", surface "+surface.getClass().getSimpleName()+", isProxySurface "+isProxySurface+": "+realized+" -> "+realizedArg);
Thread.dumpStack();
}
- AbstractGraphicsDevice aDevice = surface.getGraphicsConfiguration().getScreen().getDevice();
+ final AbstractGraphicsDevice aDevice = surface.getGraphicsConfiguration().getScreen().getDevice();
if(realizedArg) {
if(isProxySurface) {
((ProxySurface)surface).createNotify();
@@ -238,7 +238,7 @@ public abstract class GLDrawableImpl implements GLDrawable {
* @param ctx the just bounded or unbounded context
* @param bound if <code>true</code> create an association, otherwise remove it
*/
- protected void associateContext(GLContext ctx, boolean bound) { }
+ protected void associateContext(final GLContext ctx, final boolean bound) { }
/**
* Callback for special implementations, allowing GLContext to trigger GL related lifecycle: <code>makeCurrent</code>, <code>release</code>.
@@ -253,14 +253,14 @@ public abstract class GLDrawableImpl implements GLDrawable {
* </p>
* @see #associateContext(GLContext, boolean)
*/
- protected void contextMadeCurrent(GLContext glc, boolean current) { }
+ protected void contextMadeCurrent(final GLContext glc, final boolean current) { }
/** Callback for special implementations, allowing GLContext to fetch a custom default render framebuffer. Defaults to zero.*/
protected int getDefaultDrawFramebuffer() { return 0; }
/** Callback for special implementations, allowing GLContext to fetch a custom default read framebuffer. Defaults to zero. */
protected int getDefaultReadFramebuffer() { return 0; }
/** Callback for special implementations, allowing GLContext to fetch a custom default read buffer of current framebuffer. */
- protected int getDefaultReadBuffer(GL gl, boolean hasDedicatedDrawableRead) {
+ protected int getDefaultReadBuffer(final GL gl, final boolean hasDedicatedDrawableRead) {
if( gl.isGLES() || hasDedicatedDrawableRead || getChosenGLCapabilities().getDoubleBuffered() ) {
// Note-1: Neither ES1 nor ES2 supports selecting the read buffer via glReadBuffer
// Note-2: ES3 only supports GL_BACK, GL_NONE or GL_COLOR_ATTACHMENT0+i
diff --git a/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java b/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
index 421f06205..95e13e26a 100644
--- a/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
@@ -32,7 +32,7 @@ import com.jogamp.common.os.DynamicLibraryBundle;
public class GLDynamicLookupHelper extends DynamicLibraryBundle {
- public GLDynamicLookupHelper(GLDynamicLibraryBundleInfo info) {
+ public GLDynamicLookupHelper(final GLDynamicLibraryBundleInfo info) {
super(info);
}
diff --git a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
index bf6a56afe..6046527d1 100644
--- a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
@@ -11,6 +11,7 @@ import javax.media.opengl.GLContext;
import javax.media.opengl.GLException;
import javax.media.opengl.GLFBODrawable;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.VersionUtil;
import com.jogamp.nativewindow.MutableGraphicsConfiguration;
import com.jogamp.opengl.FBObject;
@@ -43,7 +44,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
static {
Debug.initSingleton();
DEBUG = GLDrawableImpl.DEBUG || Debug.debug("FBObject");
- DEBUG_SWAP = DEBUG || Debug.isPropertyDefined("jogl.debug.FBObject.Swap", true);
+ DEBUG_SWAP = DEBUG || PropertyAccess.isPropertyDefined("jogl.debug.FBObject.Swap", true);
}
private final GLDrawableImpl parent;
@@ -84,8 +85,8 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
* @param fboCaps the requested FBO capabilities
* @param textureUnit
*/
- protected GLFBODrawableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, NativeSurface surface,
- GLCapabilitiesImmutable fboCaps, int textureUnit) {
+ protected GLFBODrawableImpl(final GLDrawableFactoryImpl factory, final GLDrawableImpl parent, final NativeSurface surface,
+ final GLCapabilitiesImmutable fboCaps, final int textureUnit) {
super(factory, surface, fboCaps, false);
this.initialized = false;
@@ -101,7 +102,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
this.swapBufferContext = null;
}
- private final void initialize(boolean realize, GL gl) {
+ private final void initialize(final boolean realize, final GL gl) {
if( !initialized && !realize ) {
if( DEBUG ) {
System.err.println("GLFBODrawableImpl.initialize(): WARNING - Already unrealized!");
@@ -175,11 +176,11 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
}
- public final void setSwapBufferContext(SwapBufferContext sbc) {
+ public final void setSwapBufferContext(final SwapBufferContext sbc) {
swapBufferContext = sbc;
}
- private final void reset(GL gl, int idx, int width, int height, int samples, int alphaBits, int stencilBits) {
+ private final void reset(final GL gl, final int idx, final int width, final int height, final int samples, final int alphaBits, final int stencilBits) {
if( !fboResetQuirk ) {
try {
fbos[idx].reset(gl, width, height, samples, false);
@@ -187,7 +188,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
throw new InternalError("Sample number mismatch: "+samples+", fbos["+idx+"] "+fbos[idx]);
}
return;
- } catch (GLException e) {
+ } catch (final GLException e) {
fboResetQuirk = true;
if(DEBUG) {
if(!resetQuirkInfoDumped) {
@@ -227,7 +228,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
}
- private final void reset(GL gl, int newSamples) throws GLException {
+ private final void reset(final GL gl, int newSamples) throws GLException {
if(!initialized) {
// NOP if not yet initializes
return;
@@ -275,7 +276,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
final GLCapabilities fboCapsNative = (GLCapabilities) surface.getGraphicsConfiguration().getChosenCapabilities();
fbos[0].formatToGLCapabilities(fboCapsNative);
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
tFBO = t;
} finally {
try {
@@ -283,7 +284,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
if(ctxSwitch) {
curContext.makeCurrent();
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
tGL = t;
}
}
@@ -303,7 +304,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
//
@Override
- public final GLContext createContext(GLContext shareWith) {
+ public final GLContext createContext(final GLContext shareWith) {
final GLContext ctx = parent.createContext(shareWith);
ctx.setGLDrawable(this, false);
return ctx;
@@ -325,7 +326,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
protected final int getDefaultReadFramebuffer() { return initialized ? fbos[fboIFront].getReadFramebuffer() : 0; }
@Override
- protected final int getDefaultReadBuffer(GL gl, boolean hasDedicatedDrawableRead) {
+ protected final int getDefaultReadBuffer(final GL gl, final boolean hasDedicatedDrawableRead) {
return initialized ? fbos[fboIFront].getDefaultReadBuffer() : GL.GL_COLOR_ATTACHMENT0 ;
}
@@ -345,12 +346,12 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
@Override
- protected void associateContext(GLContext glc, boolean bound) {
+ protected void associateContext(final GLContext glc, final boolean bound) {
initialize(bound, glc.getGL());
}
@Override
- protected final void contextMadeCurrent(GLContext glc, boolean current) {
+ protected final void contextMadeCurrent(final GLContext glc, final boolean current) {
final GL gl = glc.getGL();
if(current) {
if( !initialized ) {
@@ -371,7 +372,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
@Override
- protected void swapBuffersImpl(boolean doubleBuffered) {
+ protected void swapBuffersImpl(final boolean doubleBuffered) {
final GLContext ctx = GLContext.getCurrent();
boolean doPostSwap;
if( null != ctx && ctx.getGLDrawable() == this && fboBound ) {
@@ -392,7 +393,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
}
- private final void swapFBOImplPost(GLContext glc) {
+ private final void swapFBOImplPost(final GLContext glc) {
// Safely reset the previous front FBO - after completing propagating swap
if(0 <= pendingFBOReset) {
final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) surface.getGraphicsConfiguration().getChosenCapabilities();
@@ -401,12 +402,12 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
}
- private final void swapFBOImpl(GLContext glc) {
+ private final void swapFBOImpl(final GLContext glc) {
final GL gl = glc.getGL();
fbos[fboIBack].markUnbound(); // fast path, use(gl,..) is called below
if(DEBUG) {
- int _fboIFront = ( fboIFront + 1 ) % fbos.length;
+ final int _fboIFront = ( fboIFront + 1 ) % fbos.length;
if(_fboIFront != fboIBack) { throw new InternalError("XXX: "+_fboIFront+"!="+fboIBack); }
}
fboIFront = fboIBack;
@@ -446,7 +447,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
@Override
- public final void resetSize(GL gl) throws GLException {
+ public final void resetSize(final GL gl) throws GLException {
reset(gl, samples);
}
@@ -454,20 +455,20 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
public final int getTextureUnit() { return texUnit; }
@Override
- public final void setTextureUnit(int u) { texUnit = u; }
+ public final void setTextureUnit(final int u) { texUnit = u; }
@Override
public final int getNumSamples() { return samples; }
@Override
- public void setNumSamples(GL gl, int newSamples) throws GLException {
+ public void setNumSamples(final GL gl, final int newSamples) throws GLException {
if(samples != newSamples) {
reset(gl, newSamples);
}
}
@Override
- public final int setNumBuffers(int bufferCount) throws GLException {
+ public final int setNumBuffers(final int bufferCount) throws GLException {
// FIXME: Implement
return bufferCount;
}
@@ -495,7 +496,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
} */
@Override
- public FBObject getFBObject(int bufferName) throws IllegalArgumentException {
+ public FBObject getFBObject(final int bufferName) throws IllegalArgumentException {
if(!initialized) {
return null;
}
@@ -518,7 +519,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
@Override
- public final TextureAttachment getTextureBuffer(int bufferName) throws IllegalArgumentException {
+ public final TextureAttachment getTextureBuffer(final int bufferName) throws IllegalArgumentException {
if(!initialized) {
return null;
}
@@ -559,17 +560,17 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
public static class ResizeableImpl extends GLFBODrawableImpl implements GLFBODrawable.Resizeable {
- protected ResizeableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, ProxySurface surface,
- GLCapabilitiesImmutable fboCaps, int textureUnit) {
+ protected ResizeableImpl(final GLDrawableFactoryImpl factory, final GLDrawableImpl parent, final ProxySurface surface,
+ final GLCapabilitiesImmutable fboCaps, final int textureUnit) {
super(factory, parent, surface, fboCaps, textureUnit);
}
@Override
- public final void setSurfaceSize(GLContext context, int newWidth, int newHeight) throws NativeWindowException, GLException {
+ public final void setSurfaceSize(final GLContext context, final int newWidth, final int newHeight) throws NativeWindowException, GLException {
if(DEBUG) {
System.err.println("GLFBODrawableImpl.ResizeableImpl setSize: ("+getThreadName()+"): "+newWidth+"x"+newHeight+" - surfaceHandle 0x"+Long.toHexString(getNativeSurface().getSurfaceHandle()));
}
- int lockRes = lockSurface();
+ final int lockRes = lockSurface();
if (NativeSurface.LOCK_SURFACE_NOT_READY >= lockRes) {
throw new NativeWindowException("Could not lock surface: "+this);
}
diff --git a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationFactory.java
index 5c6b475b2..90d18eb60 100644
--- a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationFactory.java
@@ -37,8 +37,8 @@ import javax.media.opengl.DefaultGLCapabilitiesChooser;
public abstract class GLGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
- protected static int chooseCapabilities(CapabilitiesChooser chooser, CapabilitiesImmutable capsRequested,
- List<? extends CapabilitiesImmutable> availableCaps, int recommendedIndex) {
+ protected static int chooseCapabilities(CapabilitiesChooser chooser, final CapabilitiesImmutable capsRequested,
+ final List<? extends CapabilitiesImmutable> availableCaps, final int recommendedIndex) {
if (null == capsRequested) {
throw new NativeWindowException("Null requested capabilities");
}
@@ -69,7 +69,7 @@ public abstract class GLGraphicsConfigurationFactory extends GraphicsConfigurati
}
return chosenIndex;
}
- } catch (NativeWindowException e) {
+ } catch (final NativeWindowException e) {
if (DEBUG) {
e.printStackTrace();
}
diff --git a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
index 702fb77de..1fb27cfcf 100644
--- a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
+++ b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
@@ -45,7 +45,7 @@ public class GLGraphicsConfigurationUtil {
public static final int FBO_BIT = 1 << 3; // generic bit must be mapped to native one at impl. level
public static final int ALL_BITS = WINDOW_BIT | BITMAP_BIT | PBUFFER_BIT | FBO_BIT ;
- public static final StringBuilder winAttributeBits2String(StringBuilder sb, int winattrbits) {
+ public static final StringBuilder winAttributeBits2String(StringBuilder sb, final int winattrbits) {
if(null==sb) {
sb = new StringBuilder();
}
@@ -101,7 +101,7 @@ public class GLGraphicsConfigurationUtil {
/**
* @return bitmask representing the input boolean in exclusive or logic, ie only one bit will be set.
*/
- public static final int getExclusiveWinAttributeBits(boolean isOnscreen, boolean isFBO, boolean isPBuffer, boolean isBitmap) {
+ public static final int getExclusiveWinAttributeBits(final boolean isOnscreen, final boolean isFBO, final boolean isPBuffer, final boolean isBitmap) {
final int winattrbits;
if(isOnscreen) {
winattrbits = WINDOW_BIT;
@@ -120,11 +120,11 @@ public class GLGraphicsConfigurationUtil {
/**
* @see #getExclusiveWinAttributeBits(boolean, boolean, boolean, boolean)
*/
- public static final int getExclusiveWinAttributeBits(GLCapabilitiesImmutable caps) {
+ public static final int getExclusiveWinAttributeBits(final GLCapabilitiesImmutable caps) {
return getExclusiveWinAttributeBits(caps.isOnscreen(), caps.isFBO(), caps.isPBuffer(), caps.isBitmap());
}
- public static final GLCapabilities fixWinAttribBitsAndHwAccel(AbstractGraphicsDevice device, int winattrbits, GLCapabilities caps) {
+ public static final GLCapabilities fixWinAttribBitsAndHwAccel(final AbstractGraphicsDevice device, final int winattrbits, final GLCapabilities caps) {
caps.setBitmap ( 0 != ( BITMAP_BIT & winattrbits ) );
caps.setPBuffer ( 0 != ( PBUFFER_BIT & winattrbits ) );
caps.setFBO ( 0 != ( FBO_BIT & winattrbits ) );
@@ -150,15 +150,15 @@ public class GLGraphicsConfigurationUtil {
* @param device the device on which the drawable will be created, maybe null for the {@link GLDrawableFactory#getDefaultDevice() default device}.
* @return either the given requested {@link GLCapabilitiesImmutable} instance if no modifications were required, or a modified {@link GLCapabilitiesImmutable} instance.
*/
- public static GLCapabilitiesImmutable fixGLCapabilities(GLCapabilitiesImmutable capsRequested,
- GLDrawableFactory factory, AbstractGraphicsDevice device) {
+ public static GLCapabilitiesImmutable fixGLCapabilities(final GLCapabilitiesImmutable capsRequested,
+ final GLDrawableFactory factory, final AbstractGraphicsDevice device) {
if( !capsRequested.isOnscreen() ) {
return fixOffscreenGLCapabilities(capsRequested, factory, device);
}
return capsRequested;
}
- public static GLCapabilitiesImmutable fixOnscreenGLCapabilities(GLCapabilitiesImmutable capsRequested)
+ public static GLCapabilitiesImmutable fixOnscreenGLCapabilities(final GLCapabilitiesImmutable capsRequested)
{
if( !capsRequested.isOnscreen() || capsRequested.isFBO() || capsRequested.isPBuffer() || capsRequested.isBitmap() ) {
// fix caps ..
@@ -172,7 +172,7 @@ public class GLGraphicsConfigurationUtil {
return capsRequested;
}
- public static GLCapabilitiesImmutable fixOffscreenBitOnly(GLCapabilitiesImmutable capsRequested)
+ public static GLCapabilitiesImmutable fixOffscreenBitOnly(final GLCapabilitiesImmutable capsRequested)
{
if( capsRequested.isOnscreen() ) {
// fix caps ..
@@ -195,8 +195,8 @@ public class GLGraphicsConfigurationUtil {
* @param device the device on which the drawable will be created, maybe null for the {@link GLDrawableFactory#getDefaultDevice() default device}.
* @return either the given requested {@link GLCapabilitiesImmutable} instance if no modifications were required, or a modified {@link GLCapabilitiesImmutable} instance.
*/
- public static GLCapabilitiesImmutable fixOffscreenGLCapabilities(GLCapabilitiesImmutable capsRequested,
- GLDrawableFactory factory, AbstractGraphicsDevice device) {
+ public static GLCapabilitiesImmutable fixOffscreenGLCapabilities(final GLCapabilitiesImmutable capsRequested,
+ final GLDrawableFactory factory, AbstractGraphicsDevice device) {
if(null == device) {
device = factory.getDefaultDevice();
}
@@ -250,7 +250,7 @@ public class GLGraphicsConfigurationUtil {
return capsRequested;
}
- public static GLCapabilitiesImmutable fixGLPBufferGLCapabilities(GLCapabilitiesImmutable capsRequested)
+ public static GLCapabilitiesImmutable fixGLPBufferGLCapabilities(final GLCapabilitiesImmutable capsRequested)
{
if( capsRequested.isOnscreen() ||
!capsRequested.isPBuffer() ||
@@ -268,7 +268,7 @@ public class GLGraphicsConfigurationUtil {
}
/** Fix opaque setting while preserve alpha bits */
- public static GLCapabilities fixOpaqueGLCapabilities(GLCapabilities capsRequested, boolean isOpaque)
+ public static GLCapabilities fixOpaqueGLCapabilities(final GLCapabilities capsRequested, final boolean isOpaque)
{
if( capsRequested.isBackgroundOpaque() != isOpaque) {
final int alphaBits = capsRequested.getAlphaBits();
@@ -279,7 +279,7 @@ public class GLGraphicsConfigurationUtil {
}
/** Fix double buffered setting */
- public static GLCapabilitiesImmutable fixDoubleBufferedGLCapabilities(GLCapabilitiesImmutable capsRequested, boolean doubleBuffered)
+ public static GLCapabilitiesImmutable fixDoubleBufferedGLCapabilities(final GLCapabilitiesImmutable capsRequested, final boolean doubleBuffered)
{
if( capsRequested.getDoubleBuffered() != doubleBuffered) {
final GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
@@ -289,7 +289,7 @@ public class GLGraphicsConfigurationUtil {
return capsRequested;
}
- public static GLCapabilitiesImmutable clipRGBAGLCapabilities(GLCapabilitiesImmutable caps, boolean allowRGB555, boolean allowAlpha)
+ public static GLCapabilitiesImmutable clipRGBAGLCapabilities(final GLCapabilitiesImmutable caps, final boolean allowRGB555, final boolean allowAlpha)
{
final int iR = caps.getRedBits();
final int iG = caps.getGreenBits();
@@ -320,7 +320,7 @@ public class GLGraphicsConfigurationUtil {
return compOut;
}
- public static GLCapabilitiesImmutable fixGLProfile(GLCapabilitiesImmutable caps, GLProfile glp)
+ public static GLCapabilitiesImmutable fixGLProfile(final GLCapabilitiesImmutable caps, final GLProfile glp)
{
if( caps.getGLProfile() != glp ) {
final GLCapabilities caps2 = (GLCapabilities) caps.cloneMutable();
diff --git a/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
index edfebdcfe..95c4ceb98 100644
--- a/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
@@ -52,12 +52,12 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
* @param upstreamWidget optional UI element holding this instance, see {@link #getUpstreamWidget()}.
* @param lock optional upstream lock, may be null
*/
- public GLOffscreenAutoDrawableImpl(GLDrawable drawable, GLContext context, Object upstreamWidget, RecursiveLock lock) {
+ public GLOffscreenAutoDrawableImpl(final GLDrawable drawable, final GLContext context, final Object upstreamWidget, final RecursiveLock lock) {
super(drawable, context, upstreamWidget, true, lock);
}
@Override
- public void setSurfaceSize(int newWidth, int newHeight) throws NativeWindowException, GLException {
+ public void setSurfaceSize(final int newWidth, final int newHeight) throws NativeWindowException, GLException {
this.defaultWindowResizedOp(newWidth, newHeight);
}
@@ -71,7 +71,7 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
* @param upstreamWidget optional UI element holding this instance, see {@link #getUpstreamWidget()}.
* @param lock optional upstream lock, may be null
*/
- public FBOImpl(GLFBODrawableImpl drawable, GLContext context, Object upstreamWidget, RecursiveLock lock) {
+ public FBOImpl(final GLFBODrawableImpl drawable, final GLContext context, final Object upstreamWidget, final RecursiveLock lock) {
super(drawable, context, upstreamWidget, lock);
}
@@ -86,7 +86,7 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
}
@Override
- public final void setTextureUnit(int unit) {
+ public final void setTextureUnit(final int unit) {
((GLFBODrawableImpl)drawable).setTextureUnit(unit);
}
@@ -96,13 +96,13 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
}
@Override
- public final void setNumSamples(GL gl, int newSamples) throws GLException {
+ public final void setNumSamples(final GL gl, final int newSamples) throws GLException {
((GLFBODrawableImpl)drawable).setNumSamples(gl, newSamples);
windowRepaintOp();
}
@Override
- public final int setNumBuffers(int bufferCount) throws GLException {
+ public final int setNumBuffers(final int bufferCount) throws GLException {
return ((GLFBODrawableImpl)drawable).setNumBuffers(bufferCount);
}
@@ -123,17 +123,17 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
} */
@Override
- public final FBObject getFBObject(int bufferName) {
+ public final FBObject getFBObject(final int bufferName) {
return ((GLFBODrawableImpl)drawable).getFBObject(bufferName);
}
@Override
- public final FBObject.TextureAttachment getTextureBuffer(int bufferName) {
+ public final FBObject.TextureAttachment getTextureBuffer(final int bufferName) {
return ((GLFBODrawableImpl)drawable).getTextureBuffer(bufferName);
}
@Override
- public void resetSize(GL gl) throws GLException {
+ public void resetSize(final GL gl) throws GLException {
((GLFBODrawableImpl)drawable).resetSize(gl);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
index c32957b86..ac5487961 100644
--- a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
@@ -50,7 +50,7 @@ import com.jogamp.common.util.locks.RecursiveLock;
@SuppressWarnings("deprecation")
public class GLPbufferImpl extends GLAutoDrawableBase implements GLPbuffer {
- public GLPbufferImpl(GLDrawableImpl pbufferDrawable, GLContextImpl pbufferContext) {
+ public GLPbufferImpl(final GLDrawableImpl pbufferDrawable, final GLContextImpl pbufferContext) {
super(pbufferDrawable, pbufferContext, true); // drawable := pbufferDrawable, context := pbufferContext
}
diff --git a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
index 6de92f533..0ceef6bf7 100644
--- a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
+++ b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
@@ -44,7 +44,7 @@ public class GLRunnableTask implements GLRunnable {
Throwable runnableException;
- public GLRunnableTask(GLRunnable runnable, Object notifyObject, boolean catchExceptions) {
+ public GLRunnableTask(final GLRunnable runnable, final Object notifyObject, final boolean catchExceptions) {
this.runnable = runnable ;
this.notifyObject = notifyObject ;
this.catchExceptions = catchExceptions;
@@ -53,12 +53,12 @@ public class GLRunnableTask implements GLRunnable {
}
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
boolean res = true;
if(null == notifyObject) {
try {
res = runnable.run(drawable);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
runnableException = t;
if(catchExceptions) {
runnableException.printStackTrace();
@@ -72,7 +72,7 @@ public class GLRunnableTask implements GLRunnable {
synchronized (notifyObject) {
try {
res = runnable.run(drawable);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
runnableException = t;
if(catchExceptions) {
runnableException.printStackTrace();
diff --git a/src/jogl/classes/jogamp/opengl/GLStateTracker.java b/src/jogl/classes/jogamp/opengl/GLStateTracker.java
index 706d51323..d532a2567 100644
--- a/src/jogl/classes/jogamp/opengl/GLStateTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLStateTracker.java
@@ -78,7 +78,7 @@ public class GLStateTracker {
/**
* set (client) pixel-store state, deep copy
*/
- private final void setPixelStateMap(IntIntHashMap pixelStateMap) {
+ private final void setPixelStateMap(final IntIntHashMap pixelStateMap) {
this.pixelStateMap = (IntIntHashMap) pixelStateMap.clone();
}
@@ -102,7 +102,7 @@ public class GLStateTracker {
pixelStateMap.clear();
}
- public final void setEnabled(boolean on) {
+ public final void setEnabled(final boolean on) {
enabled = on;
}
diff --git a/src/jogl/classes/jogamp/opengl/GLVersionNumber.java b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
index 431c1a387..ddcd9626e 100644
--- a/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
+++ b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
@@ -39,7 +39,7 @@ public class GLVersionNumber extends VersionNumberString {
private final boolean valid;
- private GLVersionNumber(int[] val, int strEnd, short state, String versionString, boolean valid) {
+ private GLVersionNumber(final int[] val, final int strEnd, final short state, final String versionString, final boolean valid) {
super(val[0], val[1], val[2], strEnd, state, versionString);
this.valid = valid;
}
@@ -56,8 +56,8 @@ public class GLVersionNumber extends VersionNumberString {
}
private static volatile java.util.regex.Pattern _Pattern = null;
- public static final GLVersionNumber create(String versionString) {
- int[] val = new int[] { 0, 0, 0 };
+ public static final GLVersionNumber create(final String versionString) {
+ final int[] val = new int[] { 0, 0, 0 };
int strEnd = 0;
short state = 0;
boolean valid = false;
@@ -67,7 +67,7 @@ public class GLVersionNumber extends VersionNumberString {
if (versionString.startsWith("GL_VERSION_")) {
versionPattern = getUnderscorePattern();
} else {
- versionPattern = VersionNumberString.getDefaultVersionNumberPattern();
+ versionPattern = VersionNumber.getDefaultVersionNumberPattern();
}
final VersionNumberString version = new VersionNumberString(versionString, versionPattern);
strEnd = version.endOfStringMatch();
@@ -76,7 +76,7 @@ public class GLVersionNumber extends VersionNumberString {
state = (short) ( ( version.hasMajor() ? VersionNumber.HAS_MAJOR : (short)0 ) |
( version.hasMinor() ? VersionNumber.HAS_MINOR : (short)0 ) );
valid = version.hasMajor() && version.hasMinor(); // Requires at least a defined major and minor version component!
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
System.err.println("Info: ExtensionAvailabilityCache: FunctionAvailabilityCache.Version.<init>: " + e);
val[0] = 1;
@@ -101,7 +101,7 @@ public class GLVersionNumber extends VersionNumberString {
* 4.3.0 NVIDIA 310.32 -> 310.32 (310.32)
* </pre>
*/
- public static final VersionNumberString createVendorVersion(String versionString) {
+ public static final VersionNumberString createVendorVersion(final String versionString) {
if (versionString == null || versionString.length() <= 0) {
return null;
}
diff --git a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
index 100b46a5e..131e6f3ac 100644
--- a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
+++ b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
@@ -86,7 +86,7 @@ public class GLWorkerThread {
thread.start();
try {
lock.wait();
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
}
}
@@ -149,7 +149,7 @@ public class GLWorkerThread {
}
}
- public static void invoke(boolean wait, Runnable runnable)
+ public static void invoke(final boolean wait, final Runnable runnable)
throws InvocationTargetException, InterruptedException {
if(wait) {
invokeAndWait(runnable);
@@ -158,13 +158,13 @@ public class GLWorkerThread {
}
}
- public static void invokeAndWait(Runnable runnable)
+ public static void invokeAndWait(final Runnable runnable)
throws InvocationTargetException, InterruptedException {
if (!started) {
throw new RuntimeException(getThreadName()+": May not invokeAndWait on worker thread without starting it first");
}
- Object lockTemp = lock;
+ final Object lockTemp = lock;
if (lockTemp == null) {
return; // Terminating
}
@@ -179,19 +179,19 @@ public class GLWorkerThread {
lockTemp.notifyAll();
lockTemp.wait();
if (exception != null) {
- Throwable localException = exception;
+ final Throwable localException = exception;
exception = null;
throw new InvocationTargetException(localException);
}
}
}
- public static void invokeLater(Runnable runnable) {
+ public static void invokeLater(final Runnable runnable) {
if (!started) {
throw new RuntimeException(getThreadName()+": May not invokeLater on worker thread without starting it first");
}
- Object lockTemp = lock;
+ final Object lockTemp = lock;
if (lockTemp == null) {
return; // Terminating
}
@@ -237,7 +237,7 @@ public class GLWorkerThread {
try {
// Avoid race conditions with wanting to release contexts on this thread
lock.wait(1000);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
}
if (GLContext.getCurrent() != null) {
@@ -256,7 +256,7 @@ public class GLWorkerThread {
if (work != null) {
try {
work.run();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
exception = t;
} finally {
work = null;
@@ -266,19 +266,19 @@ public class GLWorkerThread {
while (!queue.isEmpty()) {
try {
- Runnable curAsync = queue.remove(0);
+ final Runnable curAsync = queue.remove(0);
curAsync.run();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
System.err.println(getThreadName()+": Exception occurred on JOGL OpenGL worker thread:");
t.printStackTrace();
}
}
// See about releasing current context
- GLContext curContext = GLContext.getCurrent();
+ final GLContext curContext = GLContext.getCurrent();
if (curContext != null &&
(curContext instanceof GLContextImpl)) {
- GLContextImpl impl = (GLContextImpl) curContext;
+ final GLContextImpl impl = (GLContextImpl) curContext;
if (impl.hasWaiters()) {
impl.release();
}
diff --git a/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java b/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
index a64a2f5cd..12384ad1e 100644
--- a/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
+++ b/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
@@ -58,18 +58,18 @@ public class ListenerSyncedImplStub<E> {
return listeners.size();
}
- public synchronized final void addListener(E listener) {
+ public synchronized final void addListener(final E listener) {
addListener(-1, listener);
}
- public synchronized final void addListener(int index, E listener) {
+ public synchronized final void addListener(int index, final E listener) {
if(0>index) {
index = listeners.size();
}
listeners.add(index, listener);
}
- public synchronized final void removeListener(E listener) {
+ public synchronized final void removeListener(final E listener) {
listeners.remove(listener);
}
diff --git a/src/jogl/classes/jogamp/opengl/MemoryObject.java b/src/jogl/classes/jogamp/opengl/MemoryObject.java
index 6ebefc517..942d62b9e 100644
--- a/src/jogl/classes/jogamp/opengl/MemoryObject.java
+++ b/src/jogl/classes/jogamp/opengl/MemoryObject.java
@@ -43,13 +43,13 @@ public class MemoryObject {
private final long size;
private final int hash;
private ByteBuffer buffer=null;
- public MemoryObject(long addr, long size) {
+ public MemoryObject(final long addr, final long size) {
this.addr = addr;
this.size = size;
this.hash = HashUtil.getAddrSizeHash32_EqualDist(addr, size);
}
- public void setBuffer(ByteBuffer buffer) {
+ public void setBuffer(final ByteBuffer buffer) {
this.buffer = buffer;
}
@@ -76,7 +76,7 @@ public class MemoryObject {
* @return true of reference is equal or <code>obj</code> is of type <code>MemoryObject</code>
* and <code>addr</code> and <code>size</code> is equal.<br>
*/
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if(this == obj) { return true; }
if(obj instanceof MemoryObject) {
final MemoryObject m = (MemoryObject) obj;
@@ -90,7 +90,7 @@ public class MemoryObject {
* @param obj0 the MemoryObject
* @return either the already mapped MemoryObject - not changing the map, or the newly mapped one.
*/
- public static MemoryObject getOrAddSafe(HashMap<MemoryObject,MemoryObject> map, MemoryObject obj0) {
+ public static MemoryObject getOrAddSafe(final HashMap<MemoryObject,MemoryObject> map, final MemoryObject obj0) {
final MemoryObject obj1 = map.get(obj0); // get identity (fast)
if(null == obj1) {
map.put(obj0, obj0);
diff --git a/src/jogl/classes/jogamp/opengl/ProjectFloat.java b/src/jogl/classes/jogamp/opengl/ProjectFloat.java
index 91fcbd7a4..2c7989237 100644
--- a/src/jogl/classes/jogamp/opengl/ProjectFloat.java
+++ b/src/jogl/classes/jogamp/opengl/ProjectFloat.java
@@ -158,7 +158,7 @@ public class ProjectFloat {
* @param bottom
* @param top
*/
- public void gluOrtho2D(GLMatrixFunc gl, float left, float right, float bottom, float top) {
+ public void gluOrtho2D(final GLMatrixFunc gl, final float left, final float right, final float bottom, final float top) {
gl.glOrthof(left, right, bottom, top, -1, 1);
}
@@ -170,7 +170,7 @@ public class ProjectFloat {
* @param zNear
* @param zFar
*/
- public void gluPerspective(GLMatrixFunc gl, float fovy, float aspect, float zNear, float zFar) {
+ public void gluPerspective(final GLMatrixFunc gl, final float fovy, final float aspect, final float zNear, final float zFar) {
gl.glMultMatrixf(FloatUtil.makePerspective(mat4Tmp1, 0, true, fovy / 2 * (float) Math.PI / 180, aspect, zNear, zFar), 0);
}
@@ -187,10 +187,10 @@ public class ProjectFloat {
* @param upy
* @param upz
*/
- public void gluLookAt(GLMatrixFunc gl,
- float eyex, float eyey, float eyez,
- float centerx, float centery, float centerz,
- float upx, float upy, float upz) {
+ public void gluLookAt(final GLMatrixFunc gl,
+ final float eyex, final float eyey, final float eyez,
+ final float centerx, final float centery, final float centerz,
+ final float upx, final float upy, final float upz) {
mat4Tmp2[0+0] = eyex;
mat4Tmp2[1+0] = eyey;
mat4Tmp2[2+0] = eyez;
@@ -235,11 +235,11 @@ public class ProjectFloat {
/**
* Map object coordinates to window coordinates.
*/
- public boolean gluProject(float objx, float objy, float objz,
- FloatBuffer modelMatrix,
- FloatBuffer projMatrix,
- int[] viewport, int viewport_offset,
- float[] win_pos, int win_pos_offset ) {
+ public boolean gluProject(final float objx, final float objy, final float objz,
+ final FloatBuffer modelMatrix,
+ final FloatBuffer projMatrix,
+ final int[] viewport, final int viewport_offset,
+ final float[] win_pos, final int win_pos_offset ) {
final float[] in = this.mat4Tmp1;
final float[] out = this.mat4Tmp2;
@@ -283,11 +283,11 @@ public class ProjectFloat {
*
* @return
*/
- public boolean gluProject(float objx, float objy, float objz,
- FloatBuffer modelMatrix,
- FloatBuffer projMatrix,
- IntBuffer viewport,
- FloatBuffer win_pos) {
+ public boolean gluProject(final float objx, final float objy, final float objz,
+ final FloatBuffer modelMatrix,
+ final FloatBuffer projMatrix,
+ final IntBuffer viewport,
+ final FloatBuffer win_pos) {
final float[] in = this.mat4Tmp1;
final float[] out = this.mat4Tmp2;
@@ -337,11 +337,11 @@ public class ProjectFloat {
* @param obj_pos_offset
* @return true if successful, otherwise false (failed to invert matrix, or becomes infinity due to zero z)
*/
- public boolean gluUnProject(float winx, float winy, float winz,
- float[] modelMatrix, int modelMatrix_offset,
- float[] projMatrix, int projMatrix_offset,
- int[] viewport, int viewport_offset,
- float[] obj_pos, int obj_pos_offset) {
+ public boolean gluUnProject(final float winx, final float winy, final float winz,
+ final float[] modelMatrix, final int modelMatrix_offset,
+ final float[] projMatrix, final int projMatrix_offset,
+ final int[] viewport, final int viewport_offset,
+ final float[] obj_pos, final int obj_pos_offset) {
return FloatUtil.mapWinToObjCoords(winx, winy, winz,
modelMatrix, modelMatrix_offset,
projMatrix, projMatrix_offset,
@@ -422,11 +422,11 @@ public class ProjectFloat {
*
* @return true if successful, otherwise false (failed to invert matrix, or becomes z is infinity)
*/
- public boolean gluUnProject(float winx, float winy, float winz,
- FloatBuffer modelMatrix,
- FloatBuffer projMatrix,
- IntBuffer viewport,
- FloatBuffer obj_pos) {
+ public boolean gluUnProject(final float winx, final float winy, final float winz,
+ final FloatBuffer modelMatrix,
+ final FloatBuffer projMatrix,
+ final IntBuffer viewport,
+ final FloatBuffer obj_pos) {
final int vPos = viewport.position();
final int oPos = obj_pos.position();
@@ -580,7 +580,7 @@ public class ProjectFloat {
*/
public void gluPickMatrix(final GLMatrixFunc gl,
final float x, final float y,
- float deltaX, final float deltaY,
+ final float deltaX, final float deltaY,
final IntBuffer viewport) {
if (deltaX <= 0 || deltaY <= 0) {
return;
diff --git a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
index 1688d1044..93a4eb32e 100644
--- a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
+++ b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
@@ -89,17 +89,17 @@ public class SharedResourceRunner implements Runnable {
String initConnection;
String releaseConnection;
- private boolean getDeviceTried(String connection) { // synchronized call
+ private boolean getDeviceTried(final String connection) { // synchronized call
return devicesTried.contains(connection);
}
- private void addDeviceTried(String connection) { // synchronized call
+ private void addDeviceTried(final String connection) { // synchronized call
devicesTried.add(connection);
}
- private void removeDeviceTried(String connection) { // synchronized call
+ private void removeDeviceTried(final String connection) { // synchronized call
devicesTried.remove(connection);
}
- public SharedResourceRunner(Implementation impl) {
+ public SharedResourceRunner(final Implementation impl) {
this.impl = impl;
resetState();
}
@@ -144,7 +144,7 @@ public class SharedResourceRunner implements Runnable {
while (!running) {
try {
this.wait();
- } catch (InterruptedException ex) { }
+ } catch (final InterruptedException ex) { }
}
}
}
@@ -164,14 +164,14 @@ public class SharedResourceRunner implements Runnable {
while (running) {
try {
this.wait();
- } catch (InterruptedException ex) { }
+ } catch (final InterruptedException ex) { }
}
}
}
}
}
- public SharedResourceRunner.Resource getOrCreateShared(AbstractGraphicsDevice device) {
+ public SharedResourceRunner.Resource getOrCreateShared(final AbstractGraphicsDevice device) {
SharedResourceRunner.Resource sr = null;
if(null != device) {
synchronized (this) {
@@ -198,7 +198,7 @@ public class SharedResourceRunner implements Runnable {
return sr;
}
- public SharedResourceRunner.Resource releaseShared(AbstractGraphicsDevice device) {
+ public SharedResourceRunner.Resource releaseShared(final AbstractGraphicsDevice device) {
SharedResourceRunner.Resource sr = null;
if(null != device) {
synchronized (this) {
@@ -219,7 +219,7 @@ public class SharedResourceRunner implements Runnable {
return sr;
}
- private final void doAndWait(String initConnection, String releaseConnection) {
+ private final void doAndWait(final String initConnection, final String releaseConnection) {
synchronized (this) {
// wait until thread becomes ready to init new device,
// pass the device and release the sync
@@ -230,7 +230,7 @@ public class SharedResourceRunner implements Runnable {
while (!ready && running) {
try {
this.wait();
- } catch (InterruptedException ex) { }
+ } catch (final InterruptedException ex) { }
}
if (DEBUG) {
System.err.println("SharedResourceRunner.doAndWait() set command: " + initConnection + ", release: "+releaseConnection+" - "+threadName);
@@ -243,7 +243,7 @@ public class SharedResourceRunner implements Runnable {
while ( running && ( !ready || null != this.initConnection || null != this.releaseConnection ) ) {
try {
this.wait();
- } catch (InterruptedException ex) { }
+ } catch (final InterruptedException ex) { }
}
if (DEBUG) {
System.err.println("SharedResourceRunner.initializeAndWait END init: " + initConnection + ", release: "+releaseConnection+" - "+threadName);
@@ -272,7 +272,7 @@ public class SharedResourceRunner implements Runnable {
}
notifyAll();
this.wait();
- } catch (InterruptedException ex) {
+ } catch (final InterruptedException ex) {
shouldRelease = true;
if(DEBUG) {
System.err.println("SharedResourceRunner.run(): INTERRUPTED - "+threadName);
@@ -293,7 +293,7 @@ public class SharedResourceRunner implements Runnable {
Resource sr = null;
try {
sr = impl.createSharedResource(initConnection);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
if (null != sr) {
@@ -304,12 +304,12 @@ public class SharedResourceRunner implements Runnable {
if (DEBUG) {
System.err.println("SharedResourceRunner.run(): release Shared for: " + releaseConnection + " - " + threadName);
}
- Resource sr = impl.mapGet(releaseConnection);
+ final Resource sr = impl.mapGet(releaseConnection);
if (null != sr) {
try {
impl.releaseSharedResource(sr);
impl.mapPut(releaseConnection, null);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -338,11 +338,11 @@ public class SharedResourceRunner implements Runnable {
private void releaseSharedResources() { // synchronized call
devicesTried.clear();
- Collection<Resource> sharedResources = impl.mapValues();
- for (Iterator<Resource> iter = sharedResources.iterator(); iter.hasNext();) {
+ final Collection<Resource> sharedResources = impl.mapValues();
+ for (final Iterator<Resource> iter = sharedResources.iterator(); iter.hasNext();) {
try {
impl.releaseSharedResource(iter.next());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
System.err.println("Caught exception on thread "+getThreadName());
t.printStackTrace();
}
diff --git a/src/jogl/classes/jogamp/opengl/SystemUtil.java b/src/jogl/classes/jogamp/opengl/SystemUtil.java
index befe1a315..e7f078079 100644
--- a/src/jogl/classes/jogamp/opengl/SystemUtil.java
+++ b/src/jogl/classes/jogamp/opengl/SystemUtil.java
@@ -5,11 +5,11 @@ public class SystemUtil {
private static volatile boolean getenvSupported = true;
/** Wrapper for System.getenv(), which doesn't work on platforms
earlier than JDK 5 */
- public static String getenv(String variableName) {
+ public static String getenv(final String variableName) {
if (getenvSupported) {
try {
return System.getenv(variableName);
- } catch (Error e) {
+ } catch (final Error e) {
getenvSupported = false;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
index bf700d970..2b017e8e9 100644
--- a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
+++ b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
@@ -43,6 +43,7 @@ import javax.media.opengl.GLException;
import javax.media.opengl.GLProfile;
import com.jogamp.common.JogampRuntimeException;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.ReflectionUtil;
/** Implementation of the {@link javax.media.opengl.Threading} class. */
@@ -53,7 +54,7 @@ public class ThreadingImpl {
public final int id;
- Mode(int id){
+ Mode(final int id){
this.id = id;
}
}
@@ -76,10 +77,10 @@ public class ThreadingImpl {
public ToolkitThreadingPlugin run() {
final String singleThreadProp;
{
- final String w = Debug.getProperty("jogl.1thread", true);
+ final String w = PropertyAccess.getProperty("jogl.1thread", true);
singleThreadProp = null != w ? w.toLowerCase() : null;
}
- ClassLoader cl = ThreadingImpl.class.getClassLoader();
+ final ClassLoader cl = ThreadingImpl.class.getClassLoader();
// Default to using the AWT thread on all platforms except
// Windows. On OS X there is instability apparently due to
// using the JAWT on non-AWT threads. On X11 platforms there
@@ -121,7 +122,7 @@ public class ThreadingImpl {
Exception error=null;
try {
threadingPlugin = (ToolkitThreadingPlugin) ReflectionUtil.createInstance("jogamp.opengl.awt.AWTThreadingPlugin", cl);
- } catch (JogampRuntimeException jre) { error = jre; }
+ } catch (final JogampRuntimeException jre) { error = jre; }
if( Mode.ST_AWT == mode && null==threadingPlugin ) {
throw new GLException("Mode is AWT, but class 'jogamp.opengl.awt.AWTThreadingPlugin' is not available", error);
}
@@ -201,7 +202,7 @@ public class ThreadingImpl {
false). It is up to the end user to check to see whether the
current thread is the OpenGL thread and either execute the
Runnable directly or perform the work inside it. */
- public static final void invokeOnOpenGLThread(boolean wait, Runnable r) throws GLException {
+ public static final void invokeOnOpenGLThread(final boolean wait, final Runnable r) throws GLException {
if(null!=threadingPlugin) {
threadingPlugin.invokeOnOpenGLThread(wait, r);
return;
@@ -217,13 +218,13 @@ public class ThreadingImpl {
}
}
- public static final void invokeOnWorkerThread(boolean wait, Runnable r) throws GLException {
+ public static final void invokeOnWorkerThread(final boolean wait, final Runnable r) throws GLException {
GLWorkerThread.start(); // singleton start via volatile-dbl-checked-locking
try {
GLWorkerThread.invoke(wait, r);
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
throw new GLException(e);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 5778a1b6c..9aa1c882a 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -41,9 +41,9 @@ import com.jogamp.opengl.util.av.GLMediaPlayer;
import com.jogamp.opengl.util.texture.Texture;
import com.jogamp.opengl.util.texture.TextureSequence;
+import jogamp.common.os.PlatformPropsImpl;
import jogamp.common.os.android.StaticContext;
import jogamp.opengl.util.av.GLMediaPlayerImpl;
-
import android.graphics.SurfaceTexture;
import android.graphics.SurfaceTexture.OnFrameAvailableListener;
import android.hardware.Camera;
@@ -81,7 +81,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
static {
boolean _avail = false;
- if(Platform.OS_TYPE.equals(Platform.OSType.ANDROID)) {
+ if(PlatformPropsImpl.OS_TYPE.equals(Platform.OSType.ANDROID)) {
if(AndroidVersion.SDK_INT >= 14) {
_avail = true;
}
@@ -116,18 +116,18 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
}
@Override
- protected final boolean setPlaySpeedImpl(float rate) {
+ protected final boolean setPlaySpeedImpl(final float rate) {
// FIXME
return false;
}
@Override
- protected final boolean setAudioVolumeImpl(float v) {
+ protected final boolean setAudioVolumeImpl(final float v) {
if(null != mp) {
try {
mp.setVolume(v, v);
return true;
- } catch (IllegalStateException ise) {
+ } catch (final IllegalStateException ise) {
if(DEBUG) {
ise.printStackTrace();
}
@@ -145,7 +145,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
eos = false;
mp.setOnCompletionListener(onCompletionListener);
return true;
- } catch (IllegalStateException ise) {
+ } catch (final IllegalStateException ise) {
if(DEBUG) {
ise.printStackTrace();
}
@@ -156,7 +156,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
cam.startPreview();
}
return true;
- } catch (IllegalStateException ise) {
+ } catch (final IllegalStateException ise) {
if(DEBUG) {
ise.printStackTrace();
}
@@ -172,7 +172,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
try {
mp.pause();
return true;
- } catch (IllegalStateException ise) {
+ } catch (final IllegalStateException ise) {
if(DEBUG) {
ise.printStackTrace();
}
@@ -182,7 +182,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
try {
cam.stopPreview();
return true;
- } catch (IllegalStateException ise) {
+ } catch (final IllegalStateException ise) {
if(DEBUG) {
ise.printStackTrace();
}
@@ -192,7 +192,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
}
@Override
- protected final int seekImpl(int msec) {
+ protected final int seekImpl(final int msec) {
if(null != mp) {
mp.seekTo(msec);
return mp.getCurrentPosition();
@@ -200,7 +200,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
return 0;
}
- private void wakeUp(boolean newFrame) {
+ private void wakeUp(final boolean newFrame) {
synchronized(updateSurfaceLock) {
if(newFrame) {
updateSurface = true;
@@ -213,12 +213,12 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
protected final int getAudioPTSImpl() { return null != mp ? mp.getCurrentPosition() : 0; }
@Override
- protected final void destroyImpl(GL gl) {
+ protected final void destroyImpl(final GL gl) {
if(null != mp) {
wakeUp(false);
try {
mp.stop();
- } catch (IllegalStateException ise) {
+ } catch (final IllegalStateException ise) {
if(DEBUG) {
ise.printStackTrace();
}
@@ -230,7 +230,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
wakeUp(false);
try {
cam.stopPreview();
- } catch (IllegalStateException ise) {
+ } catch (final IllegalStateException ise) {
if(DEBUG) {
ise.printStackTrace();
}
@@ -241,7 +241,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
}
public static class SurfaceTextureFrame extends TextureSequence.TextureFrame {
- public SurfaceTextureFrame(Texture t, SurfaceTexture stex) {
+ public SurfaceTextureFrame(final Texture t, final SurfaceTexture stex) {
super(t);
this.surfaceTex = stex;
}
@@ -264,7 +264,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
int cameraId = 0;
try {
cameraId = Integer.valueOf(cameraPath);
- } catch (NumberFormatException nfe) {}
+ } catch (final NumberFormatException nfe) {}
if( 0 <= cameraId && cameraId < Camera.getNumberOfCameras() ) {
cam = Camera.open(cameraId);
} else {
@@ -282,17 +282,17 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
try {
final Uri _uri = Uri.parse(getURI().toString());
mp.setDataSource(StaticContext.getContext(), _uri);
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
throw new RuntimeException(e);
- } catch (SecurityException e) {
+ } catch (final SecurityException e) {
throw new RuntimeException(e);
- } catch (IllegalStateException e) {
+ } catch (final IllegalStateException e) {
throw new RuntimeException(e);
}
mp.setSurface(null);
try {
mp.prepare();
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
throw new IOException("MediaPlayer failed to process stream <"+getURI().toString()+">: "+ioe.getMessage(), ioe);
}
final int r_aid = GLMediaPlayer.STREAM_ID_NONE == aid ? GLMediaPlayer.STREAM_ID_NONE : 1 /* fake */;
@@ -340,7 +340,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
0, 0, 0, icodec, icodec);
}
}
- private static String camSz2Str(Camera.Size csize) {
+ private static String camSz2Str(final Camera.Size csize) {
if( null != csize ) {
return csize.width+"x"+csize.height;
} else {
@@ -348,7 +348,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
}
}
@Override
- protected final void initGLImpl(GL gl) throws IOException, GLException {
+ protected final void initGLImpl(final GL gl) throws IOException, GLException {
// NOP
}
@@ -359,12 +359,12 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
* </p>
*/
@Override
- protected int validateTextureCount(int desiredTextureCount) {
+ protected int validateTextureCount(final int desiredTextureCount) {
return TEXTURE_COUNT_MIN;
}
@Override
- protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
+ protected final int getNextTextureImpl(final GL gl, final TextureFrame nextFrame) {
int pts = TimeFrameI.INVALID_PTS;
if(null != mp || null != cam) {
final SurfaceTextureFrame sTexFrame = null != nextFrame ? (SurfaceTextureFrame) nextFrame : singleSTexFrame;
@@ -380,7 +380,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
try {
cam.setPreviewTexture(sTexFrame.surfaceTex);
cam.startPreview();
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
throw new RuntimeException("MediaPlayer failed to process stream <"+getURI().toString()+">: "+ioe.getMessage(), ioe);
}
}
@@ -401,7 +401,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
if(!updateSurface) { // volatile OK.
try {
updateSurfaceLock.wait();
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -432,7 +432,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
* </p>
*/
@Override
- protected TextureFrame[] createTexFrames(GL gl, final int count) {
+ protected TextureFrame[] createTexFrames(final GL gl, final int count) {
final int[] texNames = new int[1];
gl.glGenTextures(1, texNames, 0);
final int err = gl.glGetError();
@@ -452,7 +452,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
* </p>
*/
@Override
- protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
+ protected final TextureSequence.TextureFrame createTexImage(final GL gl, final int texName) {
sTexFrameCount++;
if( 1 == sTexFrameCount ) {
singleSTexFrame = new SurfaceTextureFrame( createTexImageImpl(gl, texName, getWidth(), getHeight()), new SurfaceTexture(texName) );
@@ -467,7 +467,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
* </p>
*/
@Override
- protected final void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) {
+ protected final void destroyTexFrame(final GL gl, final TextureSequence.TextureFrame frame) {
sTexFrameCount--;
if( 0 == sTexFrameCount ) {
singleSTexFrame = null;
@@ -480,14 +480,14 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
private final OnFrameAvailableListener onFrameAvailableListener = new OnFrameAvailableListener() {
@Override
- public void onFrameAvailable(SurfaceTexture surfaceTexture) {
+ public void onFrameAvailable(final SurfaceTexture surfaceTexture) {
wakeUp(true);
}
};
private final OnCompletionListener onCompletionListener = new OnCompletionListener() {
@Override
- public void onCompletion(MediaPlayer mp) {
+ public void onCompletion(final MediaPlayer mp) {
eos = true;
}
};
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
index 72c9ac54b..26ec62785 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
@@ -86,7 +86,7 @@ public class AWTThreadingPlugin implements ToolkitThreadingPlugin {
}
@Override
- public final void invokeOnOpenGLThread(boolean wait, Runnable r) throws GLException {
+ public final void invokeOnOpenGLThread(final boolean wait, final Runnable r) throws GLException {
switch (ThreadingImpl.getMode()) {
case ST_AWT:
// FIXME: ideally should run all OpenGL work on the Java2D QFT
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
index 1c1d2350a..a5f5b4702 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
@@ -83,11 +83,11 @@ public class AWTTilePainter {
private Graphics2D g2d = null;
private AffineTransform saveAT = null;
- public static void dumpHintsAndScale(Graphics2D g2d) {
+ public static void dumpHintsAndScale(final Graphics2D g2d) {
final RenderingHints rHints = g2d.getRenderingHints();
final Set<Entry<Object, Object>> rEntries = rHints.entrySet();
int count = 0;
- for(Iterator<Entry<Object, Object>> rEntryIter = rEntries.iterator(); rEntryIter.hasNext(); count++) {
+ for(final Iterator<Entry<Object, Object>> rEntryIter = rEntries.iterator(); rEntryIter.hasNext(); count++) {
final Entry<Object, Object> rEntry = rEntryIter.next();
System.err.println("Hint["+count+"]: "+rEntry.getKey()+" -> "+rEntry.getValue());
}
@@ -105,7 +105,7 @@ public class AWTTilePainter {
/**
* @return resulting number of samples by comparing w/ {@link #customNumSamples} and the caps-config, 0 if disabled
*/
- public int getNumSamples(GLCapabilitiesImmutable caps) {
+ public int getNumSamples(final GLCapabilitiesImmutable caps) {
if( 0 > customNumSamples ) {
return 0;
} else if( 0 < customNumSamples ) {
@@ -137,7 +137,7 @@ public class AWTTilePainter {
* @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
* @param verbose
*/
- public AWTTilePainter(TileRenderer renderer, int componentCount, double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight, boolean verbose) {
+ public AWTTilePainter(final TileRenderer renderer, final int componentCount, final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight, final boolean verbose) {
this.renderer = renderer;
this.renderer.setGLEventListener(preTileGLEL, postTileGLEL);
this.componentCount = componentCount;
@@ -160,16 +160,16 @@ public class AWTTilePainter {
* @param flipVertical if <code>true</code>, the image will be flipped vertically (Default for OpenGL).
* @param originBottomLeft if <code>true</code>, the image's origin is on the bottom left (Default for OpenGL).
*/
- public void setGLOrientation(boolean flipVertical, boolean originBottomLeft) {
+ public void setGLOrientation(final boolean flipVertical, final boolean originBottomLeft) {
this.flipVertical = flipVertical;
this.originBottomLeft = originBottomLeft;
}
- private static Rectangle2D getClipBounds2D(Graphics2D g) {
+ private static Rectangle2D getClipBounds2D(final Graphics2D g) {
final Shape shape = g.getClip();
return null != shape ? shape.getBounds2D() : null;
}
- private static Rectangle2D clipNegative(Rectangle2D in) {
+ private static Rectangle2D clipNegative(final Rectangle2D in) {
if( null == in ) { return null; }
double x=in.getX(), y=in.getY(), width=in.getWidth(), height=in.getHeight();
if( 0 > x ) {
@@ -201,7 +201,7 @@ public class AWTTilePainter {
* @throws NoninvertibleTransformException if the {@link Graphics2D}'s {@link AffineTransform} {@link AffineTransform#invert() inversion} fails.
* Since inversion is tested before scaling the given {@link Graphics2D}, caller shall ignore the whole <i>term</i>.
*/
- public void setupGraphics2DAndClipBounds(Graphics2D g2d, int width, int height) throws NoninvertibleTransformException {
+ public void setupGraphics2DAndClipBounds(final Graphics2D g2d, final int width, final int height) throws NoninvertibleTransformException {
this.g2d = g2d;
saveAT = g2d.getTransform();
if( null == saveAT ) {
@@ -278,11 +278,11 @@ public class AWTTilePainter {
final GLEventListener preTileGLEL = new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {}
+ public void init(final GLAutoDrawable drawable) {}
@Override
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GL gl = drawable.getGL();
if( null == tBuffer ) {
final int tWidth = renderer.getParam(TileRenderer.TR_TILE_WIDTH);
@@ -302,17 +302,17 @@ public class AWTTilePainter {
}
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
};
static int _counter = 0;
final GLEventListener postTileGLEL = new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
}
@Override
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final DimensionImmutable cis = renderer.getClippedImageSize();
final int tWidth = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_WIDTH);
final int tHeight = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_HEIGHT);
@@ -337,7 +337,7 @@ public class AWTTilePainter {
final File fout = new File(fname);
try {
ImageIO.write(tBuffer.image, "png", fout);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
}
@@ -368,7 +368,7 @@ public class AWTTilePainter {
final File fout = new File(fname);
try {
ImageIO.write(dstImage, "png", fout);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
_counter++;
@@ -395,6 +395,6 @@ public class AWTTilePainter {
}
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
};
}
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
index dc286ca59..e34ec18b6 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
@@ -59,7 +59,7 @@ public class AWTUtil {
isOGLPipelineActive = j2dClazz.getMethod("isOGLPipelineActive", (Class[])null);
isQueueFlusherThread = j2dClazz.getMethod("isQueueFlusherThread", (Class[])null);
j2dOk = true;
- } catch (Exception e) {}
+ } catch (final Exception e) {}
}
}
@@ -84,7 +84,7 @@ public class AWTUtil {
!((Boolean)isQueueFlusherThread.invoke(null, (Object[])null)).booleanValue() ) {
NativeWindowFactory.getAWTToolkitLock().lock();
}
- } catch (Exception e) { j2dOk=false; }
+ } catch (final Exception e) { j2dOk=false; }
}
if(!j2dOk) {
NativeWindowFactory.getAWTToolkitLock().lock();
@@ -107,7 +107,7 @@ public class AWTUtil {
!((Boolean)isQueueFlusherThread.invoke(null, (Object[])null)).booleanValue() ) {
NativeWindowFactory.getAWTToolkitLock().unlock();
}
- } catch (Exception e) { j2dOk=false; }
+ } catch (final Exception e) { j2dOk=false; }
}
if(!j2dOk) {
NativeWindowFactory.getAWTToolkitLock().unlock();
diff --git a/src/jogl/classes/jogamp/opengl/awt/Java2D.java b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
index 5735b875e..86ca7650f 100644
--- a/src/jogl/classes/jogamp/opengl/awt/Java2D.java
+++ b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
@@ -59,6 +59,7 @@ import javax.media.opengl.GLProfile;
import com.jogamp.common.os.Platform;
+import jogamp.common.os.PlatformPropsImpl;
import jogamp.opengl.Debug;
@@ -128,7 +129,7 @@ public class Java2D {
// OpenGL graphics configuration
final GraphicsConfiguration cfg;
final String cfgName;
- final boolean java2dOGLDisabledByOS = Platform.OS_TYPE == Platform.OSType.MACOS;
+ final boolean java2dOGLDisabledByOS = PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS;
final boolean java2dOGLDisabledByProp;
{
boolean enabled = true;
@@ -160,7 +161,7 @@ public class Java2D {
if (isOGLPipelineActive) {
try {
// Try to get methods we need to integrate
- Class<?> utils = Class.forName("sun.java2d.opengl.OGLUtilities");
+ final Class<?> utils = Class.forName("sun.java2d.opengl.OGLUtilities");
invokeWithOGLContextCurrentMethod = utils.getDeclaredMethod("invokeWithOGLContextCurrent",
new Class[] {
Graphics.class,
@@ -208,7 +209,7 @@ public class Java2D {
Graphics.class
});
getOGLSurfaceTypeMethod.setAccessible(true);
- } catch (Exception e) {
+ } catch (final Exception e) {
fbObjectSupportInitialized = false;
if (DEBUG) {
e.printStackTrace();
@@ -223,7 +224,7 @@ public class Java2D {
Graphics.class
});
getOGLTextureTypeMethod.setAccessible(true);
- } catch (Exception e) {
+ } catch (final Exception e) {
if (DEBUG) {
e.printStackTrace();
System.err.println("Info: GL_ARB_texture_rectangle FBO support disabled");
@@ -236,7 +237,7 @@ public class Java2D {
Class<?> cglSurfaceData = null;
try {
cglSurfaceData = Class.forName("sun.java2d.opengl.CGLSurfaceData");
- } catch (Exception e) {
+ } catch (final Exception e) {
if (DEBUG) {
e.printStackTrace();
System.err.println("Info: Unable to find class sun.java2d.opengl.CGLSurfaceData for OS X");
@@ -268,7 +269,7 @@ public class Java2D {
destroyOGLContextMethod.setAccessible(true);
}
}
- } catch (Exception e) {
+ } catch (final Exception e) {
caught = e;
if (DEBUG) {
System.err.println("Info: Disabling Java2D/JOGL integration");
@@ -277,9 +278,9 @@ public class Java2D {
isOGLPipelineResourceCompatible = false;
}
}
- } catch (HeadlessException e) {
+ } catch (final HeadlessException e) {
// The AWT is running in headless mode, so the Java 2D / JOGL bridge is clearly disabled
- } catch (Error e) {
+ } catch (final Error e) {
// issued on OSX Java7: java.lang.Error: Could not find class: sun.awt.HeadlessGraphicsEnvironment
caught = e;
}
@@ -312,9 +313,9 @@ public class Java2D {
try {
return ((Boolean) isQueueFlusherThreadMethod.invoke(null, (Object[])null)).booleanValue();
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw (InternalError) new InternalError().initCause(e);
}
}
@@ -322,7 +323,7 @@ public class Java2D {
/** Makes current the OpenGL context associated with the passed
Graphics object and runs the given Runnable on the Queue
Flushing Thread in one atomic action. */
- public static void invokeWithOGLContextCurrent(Graphics g, Runnable r) throws GLException {
+ public static void invokeWithOGLContextCurrent(final Graphics g, final Runnable r) throws GLException {
checkActive();
try {
@@ -341,9 +342,9 @@ public class Java2D {
} finally {
AWTUtil.unlockToolkit();
}
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw (InternalError) new InternalError().initCause(e);
}
}
@@ -356,7 +357,7 @@ public class Java2D {
JOGL must share textures and display lists with it. Returns
false if the passed GraphicsConfiguration was not an OpenGL
GraphicsConfiguration. */
- public static boolean invokeWithOGLSharedContextCurrent(GraphicsConfiguration g, Runnable r) throws GLException {
+ public static boolean invokeWithOGLSharedContextCurrent(final GraphicsConfiguration g, final Runnable r) throws GLException {
checkCompatible();
try {
@@ -366,9 +367,9 @@ public class Java2D {
} finally {
AWTUtil.unlockToolkit();
}
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw (InternalError) new InternalError().initCause(e);
}
}
@@ -379,18 +380,18 @@ public class Java2D {
call glViewport() with the returned rectangle's bounds in order
to get correct rendering results. Should only be called from the
Queue Flusher Thread. */
- public static Rectangle getOGLViewport(Graphics g,
- int componentWidth,
- int componentHeight) {
+ public static Rectangle getOGLViewport(final Graphics g,
+ final int componentWidth,
+ final int componentHeight) {
checkCompatible();
try {
return (Rectangle) getOGLViewportMethod.invoke(null, new Object[] {g,
new Integer(componentWidth),
new Integer(componentHeight)});
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw (InternalError) new InternalError().initCause(e);
}
}
@@ -401,14 +402,14 @@ public class Java2D {
method should be called and the resulting rectangle's bounds
passed to a call to glScissor(). Should only be called from the
Queue Flusher Thread. */
- public static Rectangle getOGLScissorBox(Graphics g) {
+ public static Rectangle getOGLScissorBox(final Graphics g) {
checkCompatible();
try {
return (Rectangle) getOGLScissorBoxMethod.invoke(null, new Object[] {g});
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw (InternalError) new InternalError().initCause(e);
}
}
@@ -419,14 +420,14 @@ public class Java2D {
changed and a new external GLDrawable and GLContext should be
created (and the old ones destroyed). Should only be called from
the Queue Flusher Thread.*/
- public static Object getOGLSurfaceIdentifier(Graphics g) {
+ public static Object getOGLSurfaceIdentifier(final Graphics g) {
checkCompatible();
try {
return getOGLSurfaceIdentifierMethod.invoke(null, new Object[] {g});
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw (InternalError) new InternalError().initCause(e);
}
}
@@ -434,7 +435,7 @@ public class Java2D {
/** Returns the underlying surface type for the given Graphics
object. This indicates, in particular, whether Java2D is
currently rendering into a pbuffer or FBO. */
- public static int getOGLSurfaceType(Graphics g) {
+ public static int getOGLSurfaceType(final Graphics g) {
checkCompatible();
try {
@@ -445,9 +446,9 @@ public class Java2D {
}
return ((Integer) getOGLSurfaceTypeMethod.invoke(null, new Object[] { g })).intValue();
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw (InternalError) new InternalError().initCause(e);
}
}
@@ -455,7 +456,7 @@ public class Java2D {
/** Returns the underlying texture target of the given Graphics
object assuming it is rendering to an FBO. Returns either
GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB. */
- public static int getOGLTextureType(Graphics g) {
+ public static int getOGLTextureType(final Graphics g) {
checkCompatible();
if (getOGLTextureTypeMethod == null) {
@@ -464,9 +465,9 @@ public class Java2D {
try {
return ((Integer) getOGLTextureTypeMethod.invoke(null, new Object[] { g })).intValue();
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw (InternalError) new InternalError().initCause(e);
}
}
@@ -477,7 +478,7 @@ public class Java2D {
used for rendering. FIXME: may need to alter the API in the
future to indicate which GraphicsDevice the source context is
associated with. */
- public static GLContext filterShareContext(GLContext shareContext) {
+ public static GLContext filterShareContext(final GLContext shareContext) {
if (isHeadless)
return shareContext;
@@ -495,7 +496,7 @@ public class Java2D {
context", with which all contexts created by JOGL must share
textures and display lists when the FBO option is enabled for
the Java2D/OpenGL pipeline. */
- public static GLContext getShareContext(GraphicsDevice device) {
+ public static GLContext getShareContext(final GraphicsDevice device) {
initFBOShareContext(device);
// FIXME: for full generality probably need to have multiple of
// these, one per GraphicsConfiguration seen?
@@ -509,41 +510,41 @@ public class Java2D {
/** (Mac OS X-specific) Creates a new OpenGL context on the surface
associated with the given Graphics object, sharing textures and
display lists with the specified (CGLContextObj) share context. */
- public static long createOGLContextOnSurface(Graphics g, long shareCtx) {
+ public static long createOGLContextOnSurface(final Graphics g, final long shareCtx) {
checkCompatible();
try {
return ((Long) createOGLContextOnSurfaceMethod.invoke(null, new Object[] { g, new Long(shareCtx) })).longValue();
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw (InternalError) new InternalError().initCause(e);
}
}
/** (Mac OS X-specific) Makes the given OpenGL context current on
the surface associated with the given Graphics object. */
- public static boolean makeOGLContextCurrentOnSurface(Graphics g, long ctx) {
+ public static boolean makeOGLContextCurrentOnSurface(final Graphics g, final long ctx) {
checkCompatible();
try {
return ((Boolean) makeOGLContextCurrentOnSurfaceMethod.invoke(null, new Object[] { g, new Long(ctx) })).booleanValue();
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw (InternalError) new InternalError().initCause(e);
}
}
/** (Mac OS X-specific) Destroys the given OpenGL context. */
- public static void destroyOGLContext(long ctx) {
+ public static void destroyOGLContext(final long ctx) {
checkCompatible();
try {
destroyOGLContextMethod.invoke(null, new Object[] { new Long(ctx) });
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new GLException(e.getTargetException());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw (InternalError) new InternalError().initCause(e);
}
}
@@ -565,15 +566,15 @@ public class Java2D {
}
private static int getOGLUtilitiesIntField(final String name) {
- Integer i = AccessController.doPrivileged(new PrivilegedAction<Integer>() {
+ final Integer i = AccessController.doPrivileged(new PrivilegedAction<Integer>() {
@Override
public Integer run() {
try {
- Class<?> utils = Class.forName("sun.java2d.opengl.OGLUtilities");
- Field f = utils.getField(name);
+ final Class<?> utils = Class.forName("sun.java2d.opengl.OGLUtilities");
+ final Field f = utils.getField(name);
f.setAccessible(true);
return (Integer) f.get(null);
- } catch (Exception e) {
+ } catch (final Exception e) {
if (DEBUG) {
e.printStackTrace();
}
diff --git a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
index 9173a38cb..2f87f01a9 100644
--- a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
+++ b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
@@ -31,12 +31,12 @@ public class VersionApplet extends Applet {
TextArea tareaCaps;
GLCanvas canvas;
- public static void main(String[] args) {
- Frame frame = new Frame("JOGL Version Applet");
+ public static void main(final String[] args) {
+ final Frame frame = new Frame("JOGL Version Applet");
frame.setSize(800, 600);
frame.setLayout(new BorderLayout());
- VersionApplet va = new VersionApplet();
+ final VersionApplet va = new VersionApplet();
frame.addWindowListener(new ClosingWindowAdapter(frame, va));
va.init();
@@ -50,12 +50,12 @@ public class VersionApplet extends Applet {
static class ClosingWindowAdapter extends WindowAdapter {
Frame f;
VersionApplet va;
- public ClosingWindowAdapter(Frame f, VersionApplet va) {
+ public ClosingWindowAdapter(final Frame f, final VersionApplet va) {
this.f = f;
this.va = va;
}
@Override
- public void windowClosing(WindowEvent ev) {
+ public void windowClosing(final WindowEvent ev) {
f.setVisible(false);
va.stop();
va.destroy();
@@ -70,8 +70,8 @@ public class VersionApplet extends Applet {
setEnabled(true);
- GLProfile glp = GLProfile.getDefault();
- GLCapabilities glcaps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getDefault();
+ final GLCapabilities glcaps = new GLCapabilities(glp);
setLayout(new BorderLayout());
String s;
@@ -96,16 +96,16 @@ public class VersionApplet extends Applet {
tareaVersion.append(s);
tareaCaps = new TextArea(120, 20);
- GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
- List<GLCapabilitiesImmutable> availCaps = factory.getAvailableCapabilities(null);
+ final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
+ final List<GLCapabilitiesImmutable> availCaps = factory.getAvailableCapabilities(null);
for(int i=0; i<availCaps.size(); i++) {
- s = ((GLCapabilitiesImmutable) availCaps.get(i)).toString();
+ s = availCaps.get(i).toString();
System.err.println(s);
tareaCaps.append(s);
tareaCaps.append(Platform.getNewline());
}
- Container grid = new Container();
+ final Container grid = new Container();
grid.setLayout(new GridLayout(2, 1));
grid.add(tareaVersion);
grid.add(tareaCaps);
@@ -160,23 +160,23 @@ public class VersionApplet extends Applet {
class GLInfo implements GLEventListener {
@Override
- public void init(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
- String s = JoglVersion.getGLInfo(gl, null).toString();
+ public void init(final GLAutoDrawable drawable) {
+ final GL gl = drawable.getGL();
+ final String s = JoglVersion.getGLInfo(gl, null).toString();
System.err.println(s);
tareaVersion.append(s);
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
index 7b85c3e75..8c6091273 100644
--- a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
@@ -49,18 +49,18 @@ public final class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBu
@Override
public final List<String> getToolGetProcAddressFuncNameList() {
- List<String> res = new ArrayList<String>();
+ final List<String> res = new ArrayList<String>();
res.add("eglGetProcAddress");
return res;
}
@Override
- public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+ public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
return EGL.eglGetProcAddress(toolGetProcAddressHandle, funcName);
}
@Override
- public final boolean useToolGetProcAdressFirst(String funcName) {
+ public final boolean useToolGetProcAdressFirst(final String funcName) {
return true;
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
index da1c8aa47..964401244 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
@@ -65,13 +65,13 @@ public class EGLContext extends GLContextImpl {
// EGL extension functions.
private EGLExtProcAddressTable eglExtProcAddressTable;
- EGLContext(GLDrawableImpl drawable,
- GLContext shareWith) {
+ EGLContext(final GLDrawableImpl drawable,
+ final GLContext shareWith) {
super(drawable, shareWith);
}
@Override
- protected void resetStates(boolean isInit) {
+ protected void resetStates(final boolean isInit) {
eglQueryStringInitialized = false;
eglQueryStringAvailable = false;
eglExtProcAddressTable = null;
@@ -140,12 +140,12 @@ public class EGLContext extends GLContextImpl {
}
@Override
- protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+ protected long createContextARBImpl(final long share, final boolean direct, final int ctp, final int major, final int minor) {
return 0; // FIXME
}
@Override
- protected void destroyContextARBImpl(long _context) {
+ protected void destroyContextARBImpl(final long _context) {
if (!EGL.eglDestroyContext(drawable.getNativeSurface().getDisplayHandle(), _context)) {
final int eglError = EGL.eglGetError();
if(EGL.EGL_SUCCESS != eglError) { /* oops, Mesa EGL impl. may return false, but has no EGL error */
@@ -175,7 +175,7 @@ public class EGLContext extends GLContextImpl {
if( !EGL.eglBindAPI(EGL.EGL_OPENGL_ES_API) ) {
throw new GLException("Caught: eglBindAPI to ES failed , error "+toHexString(EGL.eglGetError()));
}
- } catch (GLException glex) {
+ } catch (final GLException glex) {
if (DEBUG) {
glex.printStackTrace();
}
@@ -272,7 +272,7 @@ public class EGLContext extends GLContextImpl {
@Override
protected final StringBuilder getPlatformExtensionsStringImpl() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
if (!eglQueryStringInitialized) {
eglQueryStringAvailable = getDrawableImpl().getGLDynamicLookupHelper().isFunctionAvailable("eglQueryString");
eglQueryStringInitialized = true;
@@ -288,7 +288,7 @@ public class EGLContext extends GLContextImpl {
}
@Override
- protected boolean setSwapIntervalImpl(int interval) {
+ protected boolean setSwapIntervalImpl(final int interval) {
if( hasRendererQuirk(GLRendererQuirks.NoSetSwapInterval) ) {
return false;
}
@@ -299,11 +299,11 @@ public class EGLContext extends GLContextImpl {
// Accessible ..
//
- /* pp */ void mapCurrentAvailableGLVersion(AbstractGraphicsDevice device) {
+ /* pp */ void mapCurrentAvailableGLVersion(final AbstractGraphicsDevice device) {
mapStaticGLVersion(device, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
}
/* pp */ int getContextOptions() { return ctxOptions; }
- /* pp */ static void mapStaticGLESVersion(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps) {
+ /* pp */ static void mapStaticGLESVersion(final AbstractGraphicsDevice device, final GLCapabilitiesImmutable caps) {
final GLProfile glp = caps.getGLProfile();
final int[] reqMajorCTP = new int[2];
GLContext.getRequestMajorAndCompat(glp, reqMajorCTP);
@@ -319,7 +319,7 @@ public class EGLContext extends GLContextImpl {
}
mapStaticGLVersion(device, reqMajorCTP[0], 0, reqMajorCTP[1]);
}
- /* pp */ static void mapStaticGLVersion(AbstractGraphicsDevice device, int major, int minor, int ctp) {
+ /* pp */ static void mapStaticGLVersion(final AbstractGraphicsDevice device, final int major, final int minor, final int ctp) {
if( 0 != ( ctp & GLContext.CTX_PROFILE_ES) ) {
// ES1, ES2, ES3, ..
mapStaticGLVersion(device, major /* reqMajor */, major, minor, ctp);
@@ -329,28 +329,28 @@ public class EGLContext extends GLContextImpl {
}
}
}
- private static void mapStaticGLVersion(AbstractGraphicsDevice device, int reqMajor, int major, int minor, int ctp) {
+ private static void mapStaticGLVersion(final AbstractGraphicsDevice device, final int reqMajor, final int major, final int minor, final int ctp) {
GLContext.mapAvailableGLVersion(device, reqMajor, GLContext.CTX_PROFILE_ES, major, minor, ctp);
if(! ( device instanceof EGLGraphicsDevice ) ) {
final EGLGraphicsDevice eglDevice = new EGLGraphicsDevice(device.getHandle(), EGL.EGL_NO_DISPLAY, device.getConnection(), device.getUnitID(), null);
GLContext.mapAvailableGLVersion(eglDevice, reqMajor, GLContext.CTX_PROFILE_ES, major, minor, ctp);
}
}
- protected static String getGLVersion(int major, int minor, int ctp, String gl_version) {
+ protected static String getGLVersion(final int major, final int minor, final int ctp, final String gl_version) {
return GLContext.getGLVersion(major, minor, ctp, gl_version);
}
- protected static boolean getAvailableGLVersionsSet(AbstractGraphicsDevice device) {
+ protected static boolean getAvailableGLVersionsSet(final AbstractGraphicsDevice device) {
return GLContext.getAvailableGLVersionsSet(device);
}
- protected static void setAvailableGLVersionsSet(AbstractGraphicsDevice device) {
+ protected static void setAvailableGLVersionsSet(final AbstractGraphicsDevice device) {
GLContext.setAvailableGLVersionsSet(device);
}
- protected static String toHexString(int hex) {
+ protected static String toHexString(final int hex) {
return GLContext.toHexString(hex);
}
- protected static String toHexString(long hex) {
+ protected static String toHexString(final long hex) {
return GLContext.toHexString(hex);
}
@@ -359,17 +359,17 @@ public class EGLContext extends GLContextImpl {
//
@Override
- protected void copyImpl(GLContext source, int mask) throws GLException {
+ protected void copyImpl(final GLContext source, final int mask) throws GLException {
throw new GLException("Not yet implemented");
}
@Override
- public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
+ public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) {
throw new GLException("Should not call this");
}
@Override
- public final void glFreeMemoryNV(ByteBuffer pointer) {
+ public final void glFreeMemoryNV(final ByteBuffer pointer) {
throw new GLException("Should not call this");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
index c5f76f667..9499c70f4 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
@@ -75,7 +75,7 @@ public class EGLDisplayUtil {
* </p>
*/
static EGLDisplayRef getOrCreateOpened(final long eglDisplay, final IntBuffer major, final IntBuffer minor) {
- EGLDisplayRef o = (EGLDisplayRef) openEGLDisplays.get(eglDisplay);
+ final EGLDisplayRef o = (EGLDisplayRef) openEGLDisplays.get(eglDisplay);
if( null == o ) {
if( EGL.eglInitialize(eglDisplay, major, minor) ) {
final EGLDisplayRef n = new EGLDisplayRef(eglDisplay);
@@ -123,7 +123,7 @@ public class EGLDisplayUtil {
return o;
}
- private EGLDisplayRef(long eglDisplay) {
+ private EGLDisplayRef(final long eglDisplay) {
this.eglDisplay = eglDisplay;
this.initRefCount = 0;
this.createdStack = DEBUG ? new Throwable() : null;
@@ -144,7 +144,7 @@ public class EGLDisplayUtil {
/**
* @return number of unclosed EGL Displays.<br>
*/
- public static int shutdown(boolean verbose) {
+ public static int shutdown(final boolean verbose) {
if(DEBUG || verbose || openEGLDisplays.size() > 0 ) {
System.err.println("EGLDisplayUtil.EGLDisplays: Shutdown (open: "+openEGLDisplays.size()+")");
if(DEBUG) {
@@ -160,7 +160,7 @@ public class EGLDisplayUtil {
public static void dumpOpenDisplayConnections() {
System.err.println("EGLDisplayUtil: Open EGL Display Connections: "+openEGLDisplays.size());
int i=0;
- for(Iterator<LongObjectHashMap.Entry> iter = openEGLDisplays.iterator(); iter.hasNext(); i++) {
+ for(final Iterator<LongObjectHashMap.Entry> iter = openEGLDisplays.iterator(); iter.hasNext(); i++) {
final LongObjectHashMap.Entry e = iter.next();
final EGLDisplayRef v = (EGLDisplayRef) e.value;
System.err.println("EGLDisplayUtil: Open["+i+"]: 0x"+Long.toHexString(e.key)+": "+v);
@@ -170,9 +170,9 @@ public class EGLDisplayUtil {
}
}
- /* pp */ static synchronized void setSingletonEGLDisplayOnly(boolean v) { useSingletonEGLDisplay = v; }
+ /* pp */ static synchronized void setSingletonEGLDisplayOnly(final boolean v) { useSingletonEGLDisplay = v; }
- private static synchronized long eglGetDisplay(long nativeDisplay_id) {
+ private static synchronized long eglGetDisplay(final long nativeDisplay_id) {
if( useSingletonEGLDisplay && null != singletonEGLDisplay ) {
if(DEBUG) {
System.err.println("EGLDisplayUtil.eglGetDisplay.s: eglDisplay("+EGLContext.toHexString(nativeDisplay_id)+"): "+
@@ -198,7 +198,7 @@ public class EGLDisplayUtil {
*
* @see EGL#eglInitialize(long, IntBuffer, IntBuffer)
*/
- private static synchronized boolean eglInitialize(long eglDisplay, IntBuffer major, IntBuffer minor) {
+ private static synchronized boolean eglInitialize(final long eglDisplay, final IntBuffer major, final IntBuffer minor) {
if( EGL.EGL_NO_DISPLAY == eglDisplay) {
return false;
}
@@ -222,7 +222,7 @@ public class EGLDisplayUtil {
* @see #eglGetDisplay(long)
* @see #eglInitialize(long, IntBuffer, IntBuffer)
*/
- private static synchronized int eglGetDisplayAndInitialize(long nativeDisplayID, long[] eglDisplay, int[] eglErr, IntBuffer major, IntBuffer minor) {
+ private static synchronized int eglGetDisplayAndInitialize(final long nativeDisplayID, final long[] eglDisplay, final int[] eglErr, final IntBuffer major, final IntBuffer minor) {
eglDisplay[0] = EGL.EGL_NO_DISPLAY;
final long _eglDisplay = eglGetDisplay( nativeDisplayID );
if ( EGL.EGL_NO_DISPLAY == _eglDisplay ) {
@@ -247,7 +247,7 @@ public class EGLDisplayUtil {
* @return the initialized EGL display ID
* @throws GLException if not successful
*/
- private static synchronized long eglGetDisplayAndInitialize(long[] nativeDisplayID) {
+ private static synchronized long eglGetDisplayAndInitialize(final long[] nativeDisplayID) {
final long[] eglDisplay = new long[1];
final int[] eglError = new int[1];
int eglRes = EGLDisplayUtil.eglGetDisplayAndInitialize(nativeDisplayID[0], eglDisplay, eglError, null, null);
@@ -271,7 +271,7 @@ public class EGLDisplayUtil {
* @param eglDisplay the EGL display handle
* @return true if the eglDisplay is valid and it's reference counter becomes zero and {@link EGL#eglTerminate(long)} was successful, otherwise false
*/
- private static synchronized boolean eglTerminate(long eglDisplay) {
+ private static synchronized boolean eglTerminate(final long eglDisplay) {
if( EGL.EGL_NO_DISPLAY == eglDisplay) {
return false;
}
@@ -286,11 +286,11 @@ public class EGLDisplayUtil {
private static final EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback = new EGLGraphicsDevice.EGLDisplayLifecycleCallback() {
@Override
- public long eglGetAndInitDisplay(long[] nativeDisplayID) {
+ public long eglGetAndInitDisplay(final long[] nativeDisplayID) {
return eglGetDisplayAndInitialize(nativeDisplayID);
}
@Override
- public void eglTerminate(long eglDisplayHandle) {
+ public void eglTerminate(final long eglDisplayHandle) {
EGLDisplayUtil.eglTerminate(eglDisplayHandle);
}
};
@@ -309,7 +309,7 @@ public class EGLDisplayUtil {
* @param unitID
* @return an uninitialized {@link EGLGraphicsDevice}
*/
- public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(long nativeDisplayID, String connection, int unitID) {
+ public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(final long nativeDisplayID, final String connection, final int unitID) {
return new EGLGraphicsDevice(nativeDisplayID, EGL.EGL_NO_DISPLAY, connection, unitID, eglLifecycleCallback);
}
@@ -325,7 +325,7 @@ public class EGLDisplayUtil {
* @param surface
* @return an uninitialized EGLGraphicsDevice
*/
- public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(NativeSurface surface) {
+ public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(final NativeSurface surface) {
final long nativeDisplayID;
if( NativeWindowFactory.TYPE_WINDOWS == NativeWindowFactory.getNativeWindowType(false) ) {
nativeDisplayID = surface.getSurfaceHandle(); // don't even ask ..
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
index 76c6e5beb..bacf9f18e 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
@@ -52,7 +52,7 @@ import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
public abstract class EGLDrawable extends GLDrawableImpl {
- protected EGLDrawable(EGLDrawableFactory factory, NativeSurface component) throws GLException {
+ protected EGLDrawable(final EGLDrawableFactory factory, final NativeSurface component) throws GLException {
super(factory, component, false);
}
@@ -131,7 +131,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
}
}
- protected static boolean isValidEGLSurface(long eglDisplayHandle, long surfaceHandle) {
+ protected static boolean isValidEGLSurface(final long eglDisplayHandle, final long surfaceHandle) {
if( 0 == surfaceHandle ) {
return false;
}
@@ -154,7 +154,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
}
@Override
- protected final void swapBuffersImpl(boolean doubleBuffered) {
+ protected final void swapBuffersImpl(final boolean doubleBuffered) {
if(doubleBuffered) {
final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) surface.getGraphicsConfiguration().getScreen().getDevice();
// single-buffer is already filtered out @ GLDrawableImpl#swapBuffers()
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
index e50cb7262..71e5afe33 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
@@ -65,6 +65,7 @@ import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.GLException;
import javax.media.opengl.GLProfile;
+import jogamp.common.os.PlatformPropsImpl;
import jogamp.nativewindow.WrappedSurface;
import jogamp.opengl.Debug;
import jogamp.opengl.GLContextImpl;
@@ -77,6 +78,7 @@ import jogamp.opengl.SharedResourceRunner;
import com.jogamp.common.nio.Buffers;
import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.ReflectionUtil;
import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
import com.jogamp.opengl.GLRendererQuirks;
@@ -88,14 +90,14 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
static {
Debug.initSingleton();
- QUERY_EGL_ES_NATIVE_TK = Debug.isPropertyDefined("jogl.debug.EGLDrawableFactory.QueryNativeTK", true);
+ QUERY_EGL_ES_NATIVE_TK = PropertyAccess.isPropertyDefined("jogl.debug.EGLDrawableFactory.QueryNativeTK", true);
}
private static GLDynamicLookupHelper eglES1DynamicLookupHelper = null;
private static GLDynamicLookupHelper eglES2DynamicLookupHelper = null;
- private static final boolean isANGLE(GLDynamicLookupHelper dl) {
- if(Platform.OSType.WINDOWS == Platform.OS_TYPE) {
+ private static final boolean isANGLE(final GLDynamicLookupHelper dl) {
+ if(Platform.OSType.WINDOWS == PlatformPropsImpl.OS_TYPE) {
return dl.isFunctionAvailable("eglQuerySurfacePointerANGLE") ||
dl.isFunctionAvailable("glBlitFramebufferANGLE") ||
dl.isFunctionAvailable("glRenderbufferStorageMultisampleANGLE");
@@ -104,7 +106,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
}
- private static final boolean includesES1(GLDynamicLookupHelper dl) {
+ private static final boolean includesES1(final GLDynamicLookupHelper dl) {
return dl.isFunctionAvailable("glLoadIdentity") &&
dl.isFunctionAvailable("glEnableClientState") &&
dl.isFunctionAvailable("glColorPointer");
@@ -122,7 +124,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
hasX11 = true;
try {
ReflectionUtil.createInstance("jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory", EGLDrawableFactory.class.getClassLoader());
- } catch (Exception jre) { /* n/a .. */ }
+ } catch (final Exception jre) { /* n/a .. */ }
}
// FIXME: Probably need to move EGL from a static model
@@ -136,7 +138,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
GLDynamicLookupHelper tmp=null;
try {
tmp = new GLDynamicLookupHelper(new EGLES1DynamicLibraryBundleInfo());
- } catch (GLException gle) {
+ } catch (final GLException gle) {
if(DEBUG) {
gle.printStackTrace();
}
@@ -157,7 +159,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
GLDynamicLookupHelper tmp=null;
try {
tmp = new GLDynamicLookupHelper(new EGLES2DynamicLibraryBundleInfo());
- } catch (GLException gle) {
+ } catch (final GLException gle) {
if(DEBUG) {
gle.printStackTrace();
}
@@ -214,9 +216,9 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
if(DEBUG) {
dumpMap();
}
- Collection<SharedResource> srl = sharedMap.values();
- for(Iterator<SharedResource> sri = srl.iterator(); sri.hasNext(); ) {
- SharedResource sr = sri.next();
+ final Collection<SharedResource> srl = sharedMap.values();
+ for(final Iterator<SharedResource> sri = srl.iterator(); sri.hasNext(); ) {
+ final SharedResource sr = sri.next();
if(DEBUG) {
System.err.println("EGLDrawableFactory.shutdown: "+sr.device.toString());
}
@@ -253,10 +255,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
synchronized(sharedMap) {
System.err.println("EGLDrawableFactory.map "+sharedMap.size());
int i=0;
- Set<String> keys = sharedMap.keySet();
- for(Iterator<String> keyI = keys.iterator(); keyI.hasNext(); i++) {
- String key = keyI.next();
- SharedResource sr = sharedMap.get(key);
+ final Set<String> keys = sharedMap.keySet();
+ for(final Iterator<String> keyI = keys.iterator(); keyI.hasNext(); i++) {
+ final String key = keyI.next();
+ final SharedResource sr = sharedMap.get(key);
System.err.println("EGLDrawableFactory.map["+i+"] "+key+" -> "+sr.getDevice()+", "+
"es1 [avail "+sr.wasES1ContextCreated+", pbuffer "+sr.hasPBufferES1+", quirks "+sr.rendererQuirksES1+", ctp "+EGLContext.getGLVersion(1, 0, sr.ctpES1, null)+"], "+
"es2/3 [es2 "+sr.wasES2ContextCreated+", es3 "+sr.wasES3ContextCreated+", [pbuffer "+sr.hasPBufferES3ES2+", quirks "+sr.rendererQuirksES3ES2+", ctp "+EGLContext.getGLVersion(2, 0, sr.ctpES3ES2, null)+"]]");
@@ -287,10 +289,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
private final boolean hasPBufferES1;
private final boolean hasPBufferES3ES2;
- SharedResource(EGLGraphicsDevice dev,
- boolean wasContextES1Created, boolean hasPBufferES1, GLRendererQuirks rendererQuirksES1, int ctpES1,
- boolean wasContextES2Created, boolean wasContextES3Created,
- boolean hasPBufferES3ES2, GLRendererQuirks rendererQuirksES3ES2, int ctpES3ES2) {
+ SharedResource(final EGLGraphicsDevice dev,
+ final boolean wasContextES1Created, final boolean hasPBufferES1, final GLRendererQuirks rendererQuirksES1, final int ctpES1,
+ final boolean wasContextES2Created, final boolean wasContextES3Created,
+ final boolean hasPBufferES3ES2, final GLRendererQuirks rendererQuirksES3ES2, final int ctpES3ES2) {
this.device = dev;
// this.contextES1 = ctxES1;
this.wasES1ContextCreated = wasContextES1Created;
@@ -340,12 +342,12 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+ public final boolean getIsDeviceCompatible(final AbstractGraphicsDevice device) {
// via mappings (X11/WGL/.. -> EGL) we shall be able to handle all types.
return null != sharedMap ; // null!=eglES2DynamicLookupHelper || null!=eglES1DynamicLookupHelper;
}
- private static List<GLCapabilitiesImmutable> getAvailableEGLConfigs(EGLGraphicsDevice eglDisplay, GLCapabilitiesImmutable caps) {
+ private static List<GLCapabilitiesImmutable> getAvailableEGLConfigs(final EGLGraphicsDevice eglDisplay, final GLCapabilitiesImmutable caps) {
final IntBuffer numConfigs = Buffers.newDirectIntBuffer(1);
if(!EGL.eglGetConfigs(eglDisplay.getHandle(), null, 0, numConfigs)) {
throw new GLException("EGLDrawableFactory.getAvailableEGLConfigs: Get maxConfigs (eglGetConfigs) call failed, error "+EGLContext.toHexString(EGL.eglGetError()));
@@ -368,8 +370,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
System.err.println(prefix+"EGL vendor "+eglVendor+", version "+eglVersion+", clientAPIs "+eglClientAPIs);
}
- private boolean mapAvailableEGLESConfig(AbstractGraphicsDevice adevice, int[] esProfile,
- boolean[] hasPBuffer, GLRendererQuirks[] rendererQuirks, int[] ctp) {
+ private boolean mapAvailableEGLESConfig(final AbstractGraphicsDevice adevice, final int[] esProfile,
+ final boolean[] hasPBuffer, final GLRendererQuirks[] rendererQuirks, final int[] ctp) {
final String profileString;
switch( esProfile[0] ) {
case 3:
@@ -532,7 +534,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
}
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if (DEBUG) {
System.err.println("EGLDrawableFactory.mapAvailableEGLESConfig: INFO: context create/makeCurrent failed");
t.printStackTrace();
@@ -543,7 +545,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
drawable.setRealized(false);
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if(DEBUG) {
System.err.println("Caught exception on thread "+getThreadName());
t.printStackTrace();
@@ -565,7 +567,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
return success;
}
- private final boolean needsToCreateSharedResource(String key, SharedResource[] existing) {
+ private final boolean needsToCreateSharedResource(final String key, final SharedResource[] existing) {
synchronized(sharedMap) {
final SharedResource sr = sharedMap.get(key);
if( null == sr ) {
@@ -584,7 +586,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice adevice) {
+ protected final SharedResource getOrCreateSharedResourceImpl(final AbstractGraphicsDevice adevice) {
if(null == sharedMap) { // null == eglES1DynamicLookupHelper && null == eglES2DynamicLookupHelper
return null;
}
@@ -617,16 +619,16 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
}
- private SharedResource createEGLSharedResourceImpl(AbstractGraphicsDevice adevice) {
+ private SharedResource createEGLSharedResourceImpl(final AbstractGraphicsDevice adevice) {
final boolean madeCurrentES1;
- boolean[] hasPBufferES1 = new boolean[] { false };
- boolean[] hasPBufferES3ES2 = new boolean[] { false };
+ final boolean[] hasPBufferES1 = new boolean[] { false };
+ final boolean[] hasPBufferES3ES2 = new boolean[] { false };
// EGLContext[] eglCtxES1 = new EGLContext[] { null };
// EGLContext[] eglCtxES2 = new EGLContext[] { null };
- GLRendererQuirks[] rendererQuirksES1 = new GLRendererQuirks[] { null };
- GLRendererQuirks[] rendererQuirksES3ES2 = new GLRendererQuirks[] { null };
- int[] ctpES1 = new int[] { -1 };
- int[] ctpES3ES2 = new int[] { -1 };
+ final GLRendererQuirks[] rendererQuirksES1 = new GLRendererQuirks[] { null };
+ final GLRendererQuirks[] rendererQuirksES3ES2 = new GLRendererQuirks[] { null };
+ final int[] ctpES1 = new int[] { -1 };
+ final int[] ctpES3ES2 = new int[] { -1 };
if (DEBUG) {
@@ -682,7 +684,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
return sr;
}
- private void handleDontCloseX11DisplayQuirk(GLRendererQuirks quirks) {
+ private void handleDontCloseX11DisplayQuirk(final GLRendererQuirks quirks) {
if( null != quirks && quirks.exist( GLRendererQuirks.DontCloseX11Display ) ) {
jogamp.nativewindow.x11.X11Util.markAllDisplaysUnclosable();
}
@@ -698,7 +700,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public GLDynamicLookupHelper getGLDynamicLookupHelper(int esProfile) {
+ public GLDynamicLookupHelper getGLDynamicLookupHelper(final int esProfile) {
if ( 2==esProfile || 3==esProfile ) {
return eglES2DynamicLookupHelper;
} else if (1==esProfile) {
@@ -709,7 +711,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+ protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(final AbstractGraphicsDevice device) {
if(null == sharedMap) { // null == eglES1DynamicLookupHelper && null == eglES2DynamicLookupHelper
return new ArrayList<GLCapabilitiesImmutable>(); // null
}
@@ -717,7 +719,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+ protected GLDrawableImpl createOnscreenDrawableImpl(final NativeSurface target) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
@@ -725,12 +727,12 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
+ protected GLDrawableImpl createOffscreenDrawableImpl(final NativeSurface target) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
- AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
- GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+ final AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
+ final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
if(!caps.isPBuffer()) {
throw new GLException("Non pbuffer not yet implemented");
}
@@ -739,16 +741,16 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) {
+ public boolean canCreateGLPbuffer(final AbstractGraphicsDevice device, final GLProfile glp) {
// SharedResource sr = getOrCreateEGLSharedResource(device);
// return sr.hasES1PBuffer() || sr.hasES2PBuffer();
return true;
}
@Override
- protected ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
+ protected ProxySurface createMutableSurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+ final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstreamHook) {
final boolean ownDevice;
final EGLGraphicsDevice device;
if( createNewDevice || ! (deviceReq instanceof EGLGraphicsDevice) ) {
@@ -770,8 +772,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
+ public final ProxySurface createDummySurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+ GLCapabilitiesImmutable chosenCaps, final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser chooser, final int width, final int height) {
chosenCaps = GLGraphicsConfigurationUtil.fixGLPBufferGLCapabilities(chosenCaps); // complete validation in EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(..) above
return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser, new EGLDummyUpstreamSurfaceHook(width, height));
}
@@ -782,10 +784,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
* @param useTexture
* @return the passed {@link MutableSurface} which now has the EGL pbuffer surface set as it's handle
*/
- protected static MutableSurface createPBufferSurfaceImpl(MutableSurface ms, boolean useTexture) {
+ protected static MutableSurface createPBufferSurfaceImpl(final MutableSurface ms, final boolean useTexture) {
return null;
}
- protected static long createPBufferSurfaceImpl(EGLGraphicsConfiguration config, int width, int height, boolean useTexture) {
+ protected static long createPBufferSurfaceImpl(final EGLGraphicsConfiguration config, final int width, final int height, final boolean useTexture) {
final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) config.getScreen().getDevice();
final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
final int texFormat;
@@ -811,7 +813,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
+ protected ProxySurface createProxySurfaceImpl(final AbstractGraphicsDevice deviceReq, final int screenIdx, final long windowHandle, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstream) {
final EGLGraphicsDevice eglDeviceReq = (EGLGraphicsDevice) deviceReq;
final EGLGraphicsDevice device = EGLDisplayUtil.eglCreateEGLGraphicsDevice(eglDeviceReq.getNativeDisplayID(), deviceReq.getConnection(), deviceReq.getUnitID());
device.open();
@@ -822,12 +824,12 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
@Override
protected GLContext createExternalGLContextImpl() {
- AbstractGraphicsScreen absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_EGL);
+ final AbstractGraphicsScreen absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_EGL);
return new EGLExternalContext(absScreen);
}
@Override
- public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+ public boolean canCreateExternalGLDrawable(final AbstractGraphicsDevice device) {
return false;
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java b/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
index 205a94951..f00d7059d 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
@@ -17,12 +17,12 @@ public class EGLDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
* not the actual dummy surface height,
* The latter is platform specific and small
*/
- public EGLDummyUpstreamSurfaceHook(int width, int height) {
+ public EGLDummyUpstreamSurfaceHook(final int width, final int height) {
super(width, height);
}
@Override
- public final void create(ProxySurface s) {
+ public final void create(final ProxySurface s) {
final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) s.getGraphicsConfiguration().getScreen().getDevice();
eglDevice.lock();
try {
@@ -41,7 +41,7 @@ public class EGLDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
}
@Override
- public final void destroy(ProxySurface s) {
+ public final void destroy(final ProxySurface s) {
if( s.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) s.getGraphicsConfiguration().getScreen().getDevice();
if( EGL.EGL_NO_SURFACE == s.getSurfaceHandle() ) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
index ebe8f49c8..05dae0b9d 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
@@ -33,6 +33,7 @@ import com.jogamp.common.os.Platform;
import java.util.*;
+import jogamp.common.os.PlatformPropsImpl;
import jogamp.opengl.*;
/**
@@ -61,7 +62,7 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
*/
@Override
public final boolean shallLookupGlobal() {
- if ( Platform.OSType.ANDROID == Platform.OS_TYPE ) {
+ if ( Platform.OSType.ANDROID == PlatformPropsImpl.OS_TYPE ) {
// Android requires global symbol lookup
return true;
}
@@ -71,18 +72,18 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
@Override
public final List<String> getToolGetProcAddressFuncNameList() {
- List<String> res = new ArrayList<String>();
+ final List<String> res = new ArrayList<String>();
res.add("eglGetProcAddress");
return res;
}
@Override
- public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+ public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
return EGL.eglGetProcAddress(toolGetProcAddressHandle, funcName);
}
@Override
- public final boolean useToolGetProcAdressFirst(String funcName) {
+ public final boolean useToolGetProcAdressFirst(final String funcName) {
if ( AndroidVersion.isAvailable ) {
// Android requires global dlsym lookup
return false;
@@ -92,7 +93,7 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
}
protected final List<String> getEGLLibNamesList() {
- List<String> eglLibNames = new ArrayList<String>();
+ final List<String> eglLibNames = new ArrayList<String>();
// this is the default EGL lib name, according to the spec
eglLibNames.add("libEGL.so.1");
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java
index aff18fc81..babea4240 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java
@@ -43,7 +43,7 @@ import javax.media.nativewindow.*;
public class EGLExternalContext extends EGLContext {
- public EGLExternalContext(AbstractGraphicsScreen screen) {
+ public EGLExternalContext(final AbstractGraphicsScreen screen) {
super(null, null);
GLContextShareSet.contextCreated(this);
if( !setGLFunctionAvailability(false, 0, 0, CTX_PROFILE_ES, false /* strictMatch */, false /* withinGLVersionsMapping */) ) { // use GL_VERSION
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java b/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
index e28b53235..a8dd7d5c8 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
@@ -52,7 +52,7 @@ public class EGLGLCapabilities extends GLCapabilities {
*
* May throw GLException if given GLProfile is not compatible w/ renderableType
*/
- public EGLGLCapabilities(long eglcfg, int eglcfgid, int visualID, GLProfile glp, int renderableType) {
+ public EGLGLCapabilities(final long eglcfg, final int eglcfgid, final int visualID, final GLProfile glp, final int renderableType) {
super( glp );
this.eglcfg = eglcfg;
this.eglcfgid = eglcfgid;
@@ -73,19 +73,19 @@ public class EGLGLCapabilities extends GLCapabilities {
public Object clone() {
try {
return super.clone();
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
throw new GLException(e);
}
}
- final protected void setEGLConfig(long v) { eglcfg=v; }
+ final protected void setEGLConfig(final long v) { eglcfg=v; }
final public long getEGLConfig() { return eglcfg; }
final public int getEGLConfigID() { return eglcfgid; }
final public int getRenderableType() { return renderableType; }
final public int getNativeVisualID() { return nativeVisualID; }
@Override
- final public int getVisualID(VIDType type) throws NativeWindowException {
+ final public int getVisualID(final VIDType type) throws NativeWindowException {
switch(type) {
case INTRINSIC:
case EGL_CONFIG:
@@ -97,7 +97,7 @@ public class EGLGLCapabilities extends GLCapabilities {
}
}
- public static boolean isCompatible(GLProfile glp, int renderableType) {
+ public static boolean isCompatible(final GLProfile glp, final int renderableType) {
if(null == glp) {
return true;
}
@@ -116,7 +116,7 @@ public class EGLGLCapabilities extends GLCapabilities {
return false;
}
- public static GLProfile getCompatible(EGLGraphicsDevice device, int renderableType) {
+ public static GLProfile getCompatible(final EGLGraphicsDevice device, final int renderableType) {
if(0 != (renderableType & EGLExt.EGL_OPENGL_ES3_BIT_KHR) && GLProfile.isAvailable(device, GLProfile.GLES3)) {
return GLProfile.get(device, GLProfile.GLES3);
}
@@ -132,7 +132,7 @@ public class EGLGLCapabilities extends GLCapabilities {
return null;
}
- public static StringBuilder renderableTypeToString(StringBuilder sink, int renderableType) {
+ public static StringBuilder renderableTypeToString(StringBuilder sink, final int renderableType) {
if(null == sink) {
sink = new StringBuilder();
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
index 88ed0be92..1d90e63af 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
@@ -72,8 +72,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
return ((EGLGLCapabilities)capabilitiesChosen).getEGLConfigID();
}
- EGLGraphicsConfiguration(AbstractGraphicsScreen absScreen,
- EGLGLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+ EGLGraphicsConfiguration(final AbstractGraphicsScreen absScreen,
+ final EGLGLCapabilities capsChosen, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser) {
super(absScreen, capsChosen, capsRequested);
this.chooser = chooser;
}
@@ -85,7 +85,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
* @return
* @throws GLException if invalid EGL display.
*/
- public static EGLGraphicsConfiguration create(GLCapabilitiesImmutable capsRequested, AbstractGraphicsScreen absScreen, int eglConfigID) {
+ public static EGLGraphicsConfiguration create(final GLCapabilitiesImmutable capsRequested, final AbstractGraphicsScreen absScreen, final int eglConfigID) {
final AbstractGraphicsDevice absDevice = absScreen.getDevice();
if(null==absDevice || !(absDevice instanceof EGLGraphicsDevice)) {
throw new GLException("GraphicsDevice must be a valid EGLGraphicsDevice");
@@ -110,8 +110,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
}
void updateGraphicsConfiguration() {
- CapabilitiesImmutable capsChosen = getChosenCapabilities();
- EGLGraphicsConfiguration newConfig = (EGLGraphicsConfiguration)
+ final CapabilitiesImmutable capsChosen = getChosenCapabilities();
+ final EGLGraphicsConfiguration newConfig = (EGLGraphicsConfiguration)
GraphicsConfigurationFactory.getFactory(getScreen().getDevice(), capsChosen).chooseGraphicsConfiguration(
capsChosen, getRequestedCapabilities(), chooser, getScreen(), VisualIDHolder.VID_UNDEFINED);
if(null!=newConfig) {
@@ -123,7 +123,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
}
}
- public static long EGLConfigId2EGLConfig(long display, int configID) {
+ public static long EGLConfigId2EGLConfig(final long display, final int configID) {
final IntBuffer attrs = Buffers.newDirectIntBuffer(new int[] {
EGL.EGL_CONFIG_ID, configID,
EGL.EGL_NONE
@@ -142,7 +142,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
return configs.get(0);
}
- public static boolean isEGLConfigValid(long display, long config) {
+ public static boolean isEGLConfigValid(final long display, final long config) {
if(0 == config) {
return false;
}
@@ -190,8 +190,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
* @param forceTransparentFlag
* @return
*/
- public static EGLGLCapabilities EGLConfig2Capabilities(GLRendererQuirks defaultQuirks, EGLGraphicsDevice device, GLProfile glp,
- long config, int winattrmask, boolean forceTransparentFlag) {
+ public static EGLGLCapabilities EGLConfig2Capabilities(final GLRendererQuirks defaultQuirks, final EGLGraphicsDevice device, GLProfile glp,
+ final long config, final int winattrmask, final boolean forceTransparentFlag) {
final long display = device.getHandle();
final int cfgID;
final int rType;
@@ -267,7 +267,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
return null;
}
caps = new EGLGLCapabilities(config, cfgID, visualID, glp, rType);
- } catch (GLException gle) {
+ } catch (final GLException gle) {
if(DEBUG) {
System.err.println("config "+toHexString(config)+": "+gle);
}
@@ -381,7 +381,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
return (EGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, caps);
}
- public static IntBuffer GLCapabilities2AttribList(GLCapabilitiesImmutable caps) {
+ public static IntBuffer GLCapabilities2AttribList(final GLCapabilitiesImmutable caps) {
final IntBuffer attrs = Buffers.newDirectIntBuffer(32);
int idx=0;
@@ -480,8 +480,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
return attrs;
}
- public static IntBuffer CreatePBufferSurfaceAttribList(int width, int height, int texFormat) {
- IntBuffer attrs = Buffers.newDirectIntBuffer(16);
+ public static IntBuffer CreatePBufferSurfaceAttribList(final int width, final int height, final int texFormat) {
+ final IntBuffer attrs = Buffers.newDirectIntBuffer(16);
int idx=0;
attrs.put(idx++, EGL.EGL_WIDTH);
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
index 5cfa378cb..9962c0617 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
@@ -77,7 +77,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
static GraphicsConfigurationFactory fallbackGraphicsConfigurationFactory = null;
static void registerFactory() {
- GraphicsConfigurationFactory eglFactory = new EGLGraphicsConfigurationFactory();
+ final GraphicsConfigurationFactory eglFactory = new EGLGraphicsConfigurationFactory();
// become the pre-selector for X11/.. to match the native visual id w/ EGL, if native ES is selected
final String nwType = NativeWindowFactory.getNativeWindowType(false);
@@ -117,8 +117,8 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl (
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
- CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+ final CapabilitiesChooser chooser, final AbstractGraphicsScreen absScreen, final int nativeVisualID) {
if (absScreen == null) {
throw new IllegalArgumentException("This NativeWindowFactory accepts only AbstractGraphicsDevice objects");
}
@@ -137,7 +137,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
}
- AbstractGraphicsDevice absDevice = absScreen.getDevice();
+ final AbstractGraphicsDevice absDevice = absScreen.getDevice();
if(null==absDevice) {
throw new GLException("Null AbstractGraphicsDevice");
}
@@ -181,7 +181,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
return cfg;
}
- protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(EGLDrawableFactory factory, AbstractGraphicsDevice device) {
+ protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(final EGLDrawableFactory factory, final AbstractGraphicsDevice device) {
final EGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
if(null == sharedResource) {
throw new GLException("Shared resource for device n/a: "+device);
@@ -192,7 +192,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
throw new GLException("null eglDisplay");
}
List<GLCapabilitiesImmutable> availableCaps = null;
- IntBuffer numConfigs = Buffers.newDirectIntBuffer(1);
+ final IntBuffer numConfigs = Buffers.newDirectIntBuffer(1);
if(!EGL.eglGetConfigs(eglDisplay, null, 0, numConfigs)) {
throw new GLException("Graphics configuration get maxConfigs (eglGetConfigs) call failed, error "+toHexString(EGL.eglGetError()));
@@ -201,7 +201,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
throw new GLException("Graphics configuration get maxConfigs (eglGetConfigs) no configs");
}
- PointerBuffer configs = PointerBuffer.allocateDirect(numConfigs.get(0));
+ final PointerBuffer configs = PointerBuffer.allocateDirect(numConfigs.get(0));
if(!EGL.eglGetConfigs(eglDisplay, configs, configs.capacity(), numConfigs)) {
throw new GLException("Graphics configuration get all configs (eglGetConfigs) call failed, error "+toHexString(EGL.eglGetError()));
@@ -216,10 +216,10 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
}
public static EGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
- GLCapabilitiesImmutable capsReq,
- GLCapabilitiesChooser chooser,
- AbstractGraphicsScreen absScreen, int nativeVisualID,
- boolean forceTransparentFlag) {
+ final GLCapabilitiesImmutable capsReq,
+ final GLCapabilitiesChooser chooser,
+ final AbstractGraphicsScreen absScreen, final int nativeVisualID,
+ final boolean forceTransparentFlag) {
if (capsChosen == null) {
capsChosen = new GLCapabilities(null);
}
@@ -227,7 +227,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
if(null==absScreen) {
throw new GLException("Null AbstractGraphicsScreen");
}
- AbstractGraphicsDevice absDevice = absScreen.getDevice();
+ final AbstractGraphicsDevice absDevice = absScreen.getDevice();
if(null==absDevice) {
throw new GLException("Null AbstractGraphicsDevice");
}
@@ -323,18 +323,18 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
}
- static EGLGraphicsConfiguration eglChooseConfig(EGLGraphicsDevice device,
- GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser,
- AbstractGraphicsScreen absScreen,
- int nativeVisualID, boolean forceTransparentFlag) {
+ static EGLGraphicsConfiguration eglChooseConfig(final EGLGraphicsDevice device,
+ final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser,
+ final AbstractGraphicsScreen absScreen,
+ final int nativeVisualID, final boolean forceTransparentFlag) {
final long eglDisplay = device.getHandle();
final GLProfile glp = capsChosen.getGLProfile();
final int winattrmask = GLGraphicsConfigurationUtil.getExclusiveWinAttributeBits(capsChosen);
List<GLCapabilitiesImmutable> availableCaps = null;
int recommendedIndex = -1;
long recommendedEGLConfig = -1;
- IntBuffer numConfigs = Buffers.newDirectIntBuffer(1);
+ final IntBuffer numConfigs = Buffers.newDirectIntBuffer(1);
if(!EGL.eglGetConfigs(eglDisplay, null, 0, numConfigs)) {
throw new GLException("EGLGraphicsConfiguration.eglChooseConfig: Get maxConfigs (eglGetConfigs) call failed, error "+toHexString(EGL.eglGetError()));
@@ -353,7 +353,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
}
final IntBuffer attrs = EGLGraphicsConfiguration.GLCapabilities2AttribList(capsChosen);
- PointerBuffer configs = PointerBuffer.allocateDirect(numConfigs.get(0));
+ final PointerBuffer configs = PointerBuffer.allocateDirect(numConfigs.get(0));
// 1st choice: get GLCapabilities based on users GLCapabilities
// setting recommendedIndex as preferred choice
@@ -428,7 +428,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
}
if( VisualIDHolder.VID_UNDEFINED != nativeVisualID ) { // implies !hasEGLChosenCaps
- List<GLCapabilitiesImmutable> removedCaps = new ArrayList<GLCapabilitiesImmutable>();
+ final List<GLCapabilitiesImmutable> removedCaps = new ArrayList<GLCapabilitiesImmutable>();
for(int i=0; i<availableCaps.size(); ) {
final GLCapabilitiesImmutable aCap = availableCaps.get(i);
if(aCap.getVisualID(VIDType.NATIVE) != nativeVisualID) {
@@ -475,9 +475,9 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
return res;
}
- static List<GLCapabilitiesImmutable> eglConfigs2GLCaps(EGLGraphicsDevice device, GLProfile glp, PointerBuffer configs, int num, int winattrmask, boolean forceTransparentFlag, boolean onlyFirstValid) {
+ static List<GLCapabilitiesImmutable> eglConfigs2GLCaps(final EGLGraphicsDevice device, final GLProfile glp, final PointerBuffer configs, final int num, final int winattrmask, final boolean forceTransparentFlag, final boolean onlyFirstValid) {
final GLRendererQuirks defaultQuirks = GLRendererQuirks.getStickyDeviceQuirks( GLDrawableFactory.getEGLFactory().getDefaultDevice() );
- List<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>(num);
+ final List<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>(num);
for(int i=0; i<num; i++) {
final GLCapabilitiesImmutable caps = EGLGraphicsConfiguration.EGLConfig2Capabilities(defaultQuirks, device, glp, configs.get(i), winattrmask, forceTransparentFlag);
if(null != caps) {
@@ -490,7 +490,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
return bucket;
}
- static void printCaps(String prefix, List<GLCapabilitiesImmutable> caps, PrintStream out) {
+ static void printCaps(final String prefix, final List<GLCapabilitiesImmutable> caps, final PrintStream out) {
for(int i=0; i<caps.size(); i++) {
out.println(prefix+"["+i+"] "+caps.get(i));
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java
index 065f80dcb..4c018fe25 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java
@@ -44,17 +44,17 @@ import javax.media.opengl.*;
import javax.media.nativewindow.*;
public class EGLOnscreenDrawable extends EGLDrawable {
- protected EGLOnscreenDrawable(EGLDrawableFactory factory, NativeSurface component) throws GLException {
+ protected EGLOnscreenDrawable(final EGLDrawableFactory factory, final NativeSurface component) throws GLException {
super(factory, component);
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new EGLContext(this, shareWith);
}
@Override
- protected long createSurface(EGLGraphicsConfiguration config, int width, int height, long nativeSurfaceHandle) {
+ protected long createSurface(final EGLGraphicsConfiguration config, final int width, final int height, final long nativeSurfaceHandle) {
return EGL.eglCreateWindowSurface(config.getScreen().getDevice().getHandle(), config.getNativeConfig(), nativeSurfaceHandle, null);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLPbufferDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLPbufferDrawable.java
index 45e39f5d1..8842edbc0 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLPbufferDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLPbufferDrawable.java
@@ -46,17 +46,17 @@ import javax.media.opengl.GLContext;
public class EGLPbufferDrawable extends EGLDrawable {
protected static final boolean useTexture = false; // No yet ..
- protected EGLPbufferDrawable(EGLDrawableFactory factory, NativeSurface target) {
+ protected EGLPbufferDrawable(final EGLDrawableFactory factory, final NativeSurface target) {
super(factory, target);
}
@Override
- protected long createSurface(EGLGraphicsConfiguration config, int width, int height, long nativeSurfaceHandle) {
+ protected long createSurface(final EGLGraphicsConfiguration config, final int width, final int height, final long nativeSurfaceHandle) {
return EGLDrawableFactory.createPBufferSurfaceImpl(config, width, height, false);
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new EGLContext(this, shareWith);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java b/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
index 052872122..305899fff 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
@@ -25,7 +25,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
private final NativeSurface upstreamSurface;
private final UpstreamSurfaceHook.MutableSize upstreamSurfaceHookMutableSize;
- public EGLUpstreamSurfaceHook(NativeSurface upstream) {
+ public EGLUpstreamSurfaceHook(final NativeSurface upstream) {
upstreamSurface = upstream;
if(upstreamSurface instanceof ProxySurface) {
final UpstreamSurfaceHook ush = ((ProxySurface)upstreamSurface).getUpstreamSurfaceHook();
@@ -52,14 +52,14 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
public final NativeSurface getUpstreamSurface() { return upstreamSurface; }
@Override
- public final void setSurfaceSize(int width, int height) {
+ public final void setSurfaceSize(final int width, final int height) {
if(null != upstreamSurfaceHookMutableSize) {
upstreamSurfaceHookMutableSize.setSurfaceSize(width, height);
}
}
@Override
- public final void create(ProxySurface surface) {
+ public final void create(final ProxySurface surface) {
final String dbgPrefix;
if(DEBUG) {
dbgPrefix = getThreadName() + ": EGLUpstreamSurfaceHook.create( up "+upstreamSurface.getClass().getSimpleName()+" -> this "+surface.getClass().getSimpleName()+" ): ";
@@ -84,7 +84,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
}
}
- private final void evalUpstreamSurface(String dbgPrefix, ProxySurface surface) {
+ private final void evalUpstreamSurface(final String dbgPrefix, final ProxySurface surface) {
//
// evaluate nature of upstreamSurface, may create EGL instances if required
//
@@ -195,7 +195,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
}
@Override
- public final void destroy(ProxySurface surface) {
+ public final void destroy(final ProxySurface surface) {
if(EGLDrawableFactory.DEBUG) {
System.err.println("EGLUpstreamSurfaceHook.destroy("+surface.getClass().getSimpleName()+"): "+this);
}
@@ -206,12 +206,12 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
}
@Override
- public final int getSurfaceWidth(ProxySurface s) {
+ public final int getSurfaceWidth(final ProxySurface s) {
return upstreamSurface.getSurfaceWidth();
}
@Override
- public final int getSurfaceHeight(ProxySurface s) {
+ public final int getSurfaceHeight(final ProxySurface s) {
return upstreamSurface.getSurfaceHeight();
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java b/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
index 4a5113b51..89024eed3 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
@@ -13,14 +13,14 @@ import jogamp.nativewindow.WrappedSurface;
*/
public class EGLWrappedSurface extends WrappedSurface {
- public static EGLWrappedSurface get(NativeSurface surface) {
+ public static EGLWrappedSurface get(final NativeSurface surface) {
if(surface instanceof EGLWrappedSurface) {
return (EGLWrappedSurface)surface;
}
return new EGLWrappedSurface(surface);
}
- public EGLWrappedSurface(NativeSurface surface) {
+ public EGLWrappedSurface(final NativeSurface surface) {
super(surface.getGraphicsConfiguration(), EGL.EGL_NO_SURFACE, new EGLUpstreamSurfaceHook(surface), false /* tbd in UpstreamSurfaceHook */);
if(EGLDrawableFactory.DEBUG) {
System.err.println("EGLWrappedSurface.ctor(): "+this);
diff --git a/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java b/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
index e0ec0f401..f0922644b 100644
--- a/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
+++ b/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
@@ -190,7 +190,7 @@ public class ProjectDouble {
upBuf = slice(locbuf, pos, sz);
}
- private static DoubleBuffer slice(DoubleBuffer buf, int pos, int len) {
+ private static DoubleBuffer slice(final DoubleBuffer buf, final int pos, final int len) {
buf.position(pos);
buf.limit(pos + len);
return buf.slice();
@@ -199,8 +199,8 @@ public class ProjectDouble {
/**
* Make matrix an identity matrix
*/
- private void __gluMakeIdentityd(DoubleBuffer m) {
- int oldPos = m.position();
+ private void __gluMakeIdentityd(final DoubleBuffer m) {
+ final int oldPos = m.position();
m.put(IDENTITY_MATRIX);
m.position(oldPos);
}
@@ -208,7 +208,7 @@ public class ProjectDouble {
/**
* Make matrix an identity matrix
*/
- private void __gluMakeIdentityd(double[] m) {
+ private void __gluMakeIdentityd(final double[] m) {
for (int i = 0; i < 16; i++) {
m[i] = IDENTITY_MATRIX[i];
}
@@ -221,7 +221,7 @@ public class ProjectDouble {
* @param in
* @param out
*/
- private void __gluMultMatrixVecd(double[] matrix, int matrix_offset, double[] in, double[] out) {
+ private void __gluMultMatrixVecd(final double[] matrix, final int matrix_offset, final double[] in, final double[] out) {
for (int i = 0; i < 4; i++) {
out[i] =
in[0] * matrix[0*4+i+matrix_offset] +
@@ -238,10 +238,10 @@ public class ProjectDouble {
* @param in
* @param out
*/
- private void __gluMultMatrixVecd(DoubleBuffer matrix, DoubleBuffer in, DoubleBuffer out) {
- int inPos = in.position();
- int outPos = out.position();
- int matrixPos = matrix.position();
+ private void __gluMultMatrixVecd(final DoubleBuffer matrix, final DoubleBuffer in, final DoubleBuffer out) {
+ final int inPos = in.position();
+ final int outPos = out.position();
+ final int matrixPos = matrix.position();
for (int i = 0; i < 4; i++) {
out.put(i + outPos,
in.get(0+inPos) * matrix.get(0*4+i+matrixPos) +
@@ -257,10 +257,10 @@ public class ProjectDouble {
*
* @return
*/
- private boolean __gluInvertMatrixd(double[] src, double[] inverse) {
+ private boolean __gluInvertMatrixd(final double[] src, final double[] inverse) {
int i, j, k, swap;
double t;
- double[][] temp = tempMatrix;
+ final double[][] temp = tempMatrix;
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
@@ -327,14 +327,14 @@ public class ProjectDouble {
*
* @return
*/
- private boolean __gluInvertMatrixd(DoubleBuffer src, DoubleBuffer inverse) {
+ private boolean __gluInvertMatrixd(final DoubleBuffer src, final DoubleBuffer inverse) {
int i, j, k, swap;
double t;
- int srcPos = src.position();
- int invPos = inverse.position();
+ final int srcPos = src.position();
+ final int invPos = inverse.position();
- DoubleBuffer temp = tempMatrixBuf;
+ final DoubleBuffer temp = tempMatrixBuf;
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
@@ -401,7 +401,7 @@ public class ProjectDouble {
* @param b
* @param r
*/
- private void __gluMultMatricesd(double[] a, int a_offset, double[] b, int b_offset, double[] r) {
+ private void __gluMultMatricesd(final double[] a, final int a_offset, final double[] b, final int b_offset, final double[] r) {
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
r[i*4+j] =
@@ -419,10 +419,10 @@ public class ProjectDouble {
* @param b
* @param r
*/
- private void __gluMultMatricesd(DoubleBuffer a, DoubleBuffer b, DoubleBuffer r) {
- int aPos = a.position();
- int bPos = b.position();
- int rPos = r.position();
+ private void __gluMultMatricesd(final DoubleBuffer a, final DoubleBuffer b, final DoubleBuffer r) {
+ final int aPos = a.position();
+ final int bPos = b.position();
+ final int rPos = r.position();
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
@@ -440,10 +440,10 @@ public class ProjectDouble {
*
* @param v
*/
- private static void normalize(DoubleBuffer v) {
+ private static void normalize(final DoubleBuffer v) {
double r;
- int vPos = v.position();
+ final int vPos = v.position();
r = Math.sqrt(v.get(0+vPos) * v.get(0+vPos) +
v.get(1+vPos) * v.get(1+vPos) +
@@ -468,10 +468,10 @@ public class ProjectDouble {
* @param v2
* @param result
*/
- private static void cross(DoubleBuffer v1, DoubleBuffer v2, DoubleBuffer result) {
- int v1Pos = v1.position();
- int v2Pos = v2.position();
- int rPos = result.position();
+ private static void cross(final DoubleBuffer v1, final DoubleBuffer v2, final DoubleBuffer result) {
+ final int v1Pos = v1.position();
+ final int v2Pos = v2.position();
+ final int rPos = result.position();
result.put(0+rPos, v1.get(1+v1Pos) * v2.get(2+v2Pos) - v1.get(2+v1Pos) * v2.get(1+v2Pos));
result.put(1+rPos, v1.get(2+v1Pos) * v2.get(0+v2Pos) - v1.get(0+v1Pos) * v2.get(2+v2Pos));
@@ -486,7 +486,7 @@ public class ProjectDouble {
* @param bottom
* @param top
*/
- public void gluOrtho2D(GL2 gl, double left, double right, double bottom, double top) {
+ public void gluOrtho2D(final GL2 gl, final double left, final double right, final double bottom, final double top) {
gl.glOrtho(left, right, bottom, top, -1, 1);
}
@@ -498,9 +498,9 @@ public class ProjectDouble {
* @param zNear
* @param zFar
*/
- public void gluPerspective(GL2 gl, double fovy, double aspect, double zNear, double zFar) {
+ public void gluPerspective(final GL2 gl, final double fovy, final double aspect, final double zNear, final double zFar) {
double sine, cotangent, deltaZ;
- double radians = fovy / 2 * Math.PI / 180;
+ final double radians = fovy / 2 * Math.PI / 180;
deltaZ = zFar - zNear;
sine = Math.sin(radians);
@@ -536,19 +536,19 @@ public class ProjectDouble {
* @param upy
* @param upz
*/
- public void gluLookAt(GL2 gl,
- double eyex,
- double eyey,
- double eyez,
- double centerx,
- double centery,
- double centerz,
- double upx,
- double upy,
- double upz) {
- DoubleBuffer forward = this.forwardBuf;
- DoubleBuffer side = this.sideBuf;
- DoubleBuffer up = this.upBuf;
+ public void gluLookAt(final GL2 gl,
+ final double eyex,
+ final double eyey,
+ final double eyez,
+ final double centerx,
+ final double centery,
+ final double centerz,
+ final double upx,
+ final double upy,
+ final double upz) {
+ final DoubleBuffer forward = this.forwardBuf;
+ final DoubleBuffer side = this.sideBuf;
+ final DoubleBuffer up = this.upBuf;
forward.put(0, centerx - eyex);
forward.put(1, centery - eyey);
@@ -597,20 +597,20 @@ public class ProjectDouble {
*
* @return
*/
- public boolean gluProject(double objx,
- double objy,
- double objz,
- double[] modelMatrix,
- int modelMatrix_offset,
- double[] projMatrix,
- int projMatrix_offset,
- int[] viewport,
- int viewport_offset,
- double[] win_pos,
- int win_pos_offset ) {
-
- double[] in = this.in;
- double[] out = this.out;
+ public boolean gluProject(final double objx,
+ final double objy,
+ final double objz,
+ final double[] modelMatrix,
+ final int modelMatrix_offset,
+ final double[] projMatrix,
+ final int projMatrix_offset,
+ final int[] viewport,
+ final int viewport_offset,
+ final double[] win_pos,
+ final int win_pos_offset ) {
+
+ final double[] in = this.in;
+ final double[] out = this.out;
in[0] = objx;
in[1] = objy;
@@ -651,16 +651,16 @@ public class ProjectDouble {
*
* @return
*/
- public boolean gluProject(double objx,
- double objy,
- double objz,
- DoubleBuffer modelMatrix,
- DoubleBuffer projMatrix,
- IntBuffer viewport,
- DoubleBuffer win_pos) {
+ public boolean gluProject(final double objx,
+ final double objy,
+ final double objz,
+ final DoubleBuffer modelMatrix,
+ final DoubleBuffer projMatrix,
+ final IntBuffer viewport,
+ final DoubleBuffer win_pos) {
- DoubleBuffer in = this.inBuf;
- DoubleBuffer out = this.outBuf;
+ final DoubleBuffer in = this.inBuf;
+ final DoubleBuffer out = this.outBuf;
in.put(0, objx);
in.put(1, objy);
@@ -681,8 +681,8 @@ public class ProjectDouble {
in.put(2, in.get(2) * in.get(3) + 0.5f);
// Map x,y to viewport
- int vPos = viewport.position();
- int wPos = win_pos.position();
+ final int vPos = viewport.position();
+ final int wPos = win_pos.position();
win_pos.put(0+wPos, in.get(0) * viewport.get(2+vPos) + viewport.get(0+vPos));
win_pos.put(1+wPos, in.get(1) * viewport.get(3+vPos) + viewport.get(1+vPos));
win_pos.put(2+wPos, in.get(2));
@@ -704,19 +704,19 @@ public class ProjectDouble {
*
* @return
*/
- public boolean gluUnProject(double winx,
- double winy,
- double winz,
- double[] modelMatrix,
- int modelMatrix_offset,
- double[] projMatrix,
- int projMatrix_offset,
- int[] viewport,
- int viewport_offset,
- double[] obj_pos,
- int obj_pos_offset) {
- double[] in = this.in;
- double[] out = this.out;
+ public boolean gluUnProject(final double winx,
+ final double winy,
+ final double winz,
+ final double[] modelMatrix,
+ final int modelMatrix_offset,
+ final double[] projMatrix,
+ final int projMatrix_offset,
+ final int[] viewport,
+ final int viewport_offset,
+ final double[] obj_pos,
+ final int obj_pos_offset) {
+ final double[] in = this.in;
+ final double[] out = this.out;
__gluMultMatricesd(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
@@ -765,15 +765,15 @@ public class ProjectDouble {
*
* @return
*/
- public boolean gluUnProject(double winx,
- double winy,
- double winz,
- DoubleBuffer modelMatrix,
- DoubleBuffer projMatrix,
- IntBuffer viewport,
- DoubleBuffer obj_pos) {
- DoubleBuffer in = this.inBuf;
- DoubleBuffer out = this.outBuf;
+ public boolean gluUnProject(final double winx,
+ final double winy,
+ final double winz,
+ final DoubleBuffer modelMatrix,
+ final DoubleBuffer projMatrix,
+ final IntBuffer viewport,
+ final DoubleBuffer obj_pos) {
+ final DoubleBuffer in = this.inBuf;
+ final DoubleBuffer out = this.outBuf;
__gluMultMatricesd(modelMatrix, projMatrix, matrixBuf);
@@ -786,8 +786,8 @@ public class ProjectDouble {
in.put(3, 1.0);
// Map x and y from window coordinates
- int vPos = viewport.position();
- int oPos = obj_pos.position();
+ final int vPos = viewport.position();
+ final int oPos = obj_pos.position();
in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
@@ -827,22 +827,22 @@ public class ProjectDouble {
*
* @return
*/
- public boolean gluUnProject4(double winx,
- double winy,
- double winz,
- double clipw,
- double[] modelMatrix,
- int modelMatrix_offset,
- double[] projMatrix,
- int projMatrix_offset,
- int[] viewport,
- int viewport_offset,
- double near,
- double far,
- double[] obj_pos,
- int obj_pos_offset ) {
- double[] in = this.in;
- double[] out = this.out;
+ public boolean gluUnProject4(final double winx,
+ final double winy,
+ final double winz,
+ final double clipw,
+ final double[] modelMatrix,
+ final int modelMatrix_offset,
+ final double[] projMatrix,
+ final int projMatrix_offset,
+ final int[] viewport,
+ final int viewport_offset,
+ final double near,
+ final double far,
+ final double[] obj_pos,
+ final int obj_pos_offset ) {
+ final double[] in = this.in;
+ final double[] out = this.out;
__gluMultMatricesd(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
@@ -892,18 +892,18 @@ public class ProjectDouble {
*
* @return
*/
- public boolean gluUnProject4(double winx,
- double winy,
- double winz,
- double clipw,
- DoubleBuffer modelMatrix,
- DoubleBuffer projMatrix,
- IntBuffer viewport,
- double near,
- double far,
- DoubleBuffer obj_pos) {
- DoubleBuffer in = this.inBuf;
- DoubleBuffer out = this.outBuf;
+ public boolean gluUnProject4(final double winx,
+ final double winy,
+ final double winz,
+ final double clipw,
+ final DoubleBuffer modelMatrix,
+ final DoubleBuffer projMatrix,
+ final IntBuffer viewport,
+ final double near,
+ final double far,
+ final DoubleBuffer obj_pos) {
+ final DoubleBuffer in = this.inBuf;
+ final DoubleBuffer out = this.outBuf;
__gluMultMatricesd(modelMatrix, projMatrix, matrixBuf);
@@ -916,7 +916,7 @@ public class ProjectDouble {
in.put(3, clipw);
// Map x and y from window coordinates
- int vPos = viewport.position();
+ final int vPos = viewport.position();
in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
in.put(2, (in.get(2) - near) / (far - near));
@@ -931,7 +931,7 @@ public class ProjectDouble {
if (out.get(3) == 0.0)
return false;
- int oPos = obj_pos.position();
+ final int oPos = obj_pos.position();
obj_pos.put(0+oPos, out.get(0));
obj_pos.put(1+oPos, out.get(1));
obj_pos.put(2+oPos, out.get(2));
@@ -949,18 +949,18 @@ public class ProjectDouble {
* @param deltaY
* @param viewport
*/
- public void gluPickMatrix(GL2 gl,
- double x,
- double y,
- double deltaX,
- double deltaY,
- IntBuffer viewport) {
+ public void gluPickMatrix(final GL2 gl,
+ final double x,
+ final double y,
+ final double deltaX,
+ final double deltaY,
+ final IntBuffer viewport) {
if (deltaX <= 0 || deltaY <= 0) {
return;
}
/* Translate and scale the picked region to the entire window */
- int vPos = viewport.position();
+ final int vPos = viewport.position();
gl.glTranslated((viewport.get(2+vPos) - 2 * (x - viewport.get(0+vPos))) / deltaX,
(viewport.get(3+vPos) - 2 * (y - viewport.get(1+vPos))) / deltaY,
0);
@@ -977,13 +977,13 @@ public class ProjectDouble {
* @param viewport
* @param viewport_offset
*/
- public void gluPickMatrix(GL2 gl,
- double x,
- double y,
- double deltaX,
- double deltaY,
- int[] viewport,
- int viewport_offset) {
+ public void gluPickMatrix(final GL2 gl,
+ final double x,
+ final double y,
+ final double deltaX,
+ final double deltaY,
+ final int[] viewport,
+ final int viewport_offset) {
if (deltaX <= 0 || deltaY <= 0) {
return;
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
index 717b1255c..977881e6b 100644
--- a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
@@ -132,7 +132,7 @@ import com.jogamp.opengl.util.glsl.ShaderState;
*/
public class GLUquadricImpl implements GLUquadric {
- private boolean useGLSL;
+ private final boolean useGLSL;
private int drawStyle;
private int orientation;
private boolean textureFlag;
@@ -149,7 +149,7 @@ public class GLUquadricImpl implements GLUquadric {
private ImmModeSink immModeSink=null;
- public GLUquadricImpl(GL gl, boolean useGLSL, ShaderState st, int shaderProgram) {
+ public GLUquadricImpl(final GL gl, final boolean useGLSL, final ShaderState st, final int shaderProgram) {
this.gl=gl;
this.useGLSL = useGLSL;
this.drawStyle = GLU.GLU_FILL;
@@ -165,7 +165,7 @@ public class GLUquadricImpl implements GLUquadric {
}
@Override
- public void enableImmModeSink(boolean val) {
+ public void enableImmModeSink(final boolean val) {
if(gl.isGL2()) {
immModeSinkEnabled=val;
} else {
@@ -182,7 +182,7 @@ public class GLUquadricImpl implements GLUquadric {
}
@Override
- public void setImmMode(boolean val) {
+ public void setImmMode(final boolean val) {
if(immModeSinkEnabled) {
immModeSinkImmediate=val;
} else {
@@ -199,7 +199,7 @@ public class GLUquadricImpl implements GLUquadric {
public ImmModeSink replaceImmModeSink() {
if(!immModeSinkEnabled) return null;
- ImmModeSink res = immModeSink;
+ final ImmModeSink res = immModeSink;
if(useGLSL) {
if(null != shaderState) {
immModeSink = ImmModeSink.createGLSL (32,
@@ -228,7 +228,7 @@ public class GLUquadricImpl implements GLUquadric {
}
@Override
- public void resetImmModeSink(GL gl) {
+ public void resetImmModeSink(final GL gl) {
if(immModeSinkEnabled) {
immModeSink.reset(gl);
}
@@ -252,7 +252,7 @@ public class GLUquadricImpl implements GLUquadric {
*
* @param drawStyle The drawStyle to set
*/
- public void setDrawStyle(int drawStyle) {
+ public void setDrawStyle(final int drawStyle) {
this.drawStyle = drawStyle;
}
@@ -269,7 +269,7 @@ public class GLUquadricImpl implements GLUquadric {
*
* @param normals The normals to set
*/
- public void setNormals(int normals) {
+ public void setNormals(final int normals) {
this.normals = normals;
}
@@ -286,7 +286,7 @@ public class GLUquadricImpl implements GLUquadric {
*
* @param orientation The orientation to set
*/
- public void setOrientation(int orientation) {
+ public void setOrientation(final int orientation) {
this.orientation = orientation;
}
@@ -301,7 +301,7 @@ public class GLUquadricImpl implements GLUquadric {
*
* @param textureFlag The textureFlag to set
*/
- public void setTextureFlag(boolean textureFlag) {
+ public void setTextureFlag(final boolean textureFlag) {
this.textureFlag = textureFlag;
}
@@ -363,7 +363,7 @@ public class GLUquadricImpl implements GLUquadric {
* @param slices Specifies the number of subdivisions around the z axis.
* @param stacks Specifies the number of subdivisions along the z axis.
*/
- public void drawCylinder(GL gl, float baseRadius, float topRadius, float height, int slices, int stacks) {
+ public void drawCylinder(final GL gl, final float baseRadius, final float topRadius, final float height, final int slices, final int stacks) {
float da, r, dr, dz;
float x, y, z, nz, nsign;
@@ -446,8 +446,8 @@ public class GLUquadricImpl implements GLUquadric {
}
glEnd(gl);
} else if (drawStyle == GLU.GLU_FILL) {
- float ds = 1.0f / slices;
- float dt = 1.0f / stacks;
+ final float ds = 1.0f / slices;
+ final float dt = 1.0f / stacks;
float t = 0.0f;
z = 0.0f;
r = baseRadius;
@@ -505,7 +505,7 @@ public class GLUquadricImpl implements GLUquadric {
* (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5), and at
* (0, -r, 0) it is (0.5, 0).
*/
- public void drawDisk(GL gl, float innerRadius, float outerRadius, int slices, int loops)
+ public void drawDisk(final GL gl, final float innerRadius, final float outerRadius, final int slices, final int loops)
{
float da, dr;
@@ -529,12 +529,12 @@ public class GLUquadricImpl implements GLUquadric {
* x, y in [-outerRadius, +outerRadius]; s, t in [0, 1]
* (linear mapping)
*/
- float dtc = 2.0f * outerRadius;
+ final float dtc = 2.0f * outerRadius;
float sa, ca;
float r1 = innerRadius;
int l;
for (l = 0; l < loops; l++) {
- float r2 = r1 + dr;
+ final float r2 = r1 + dr;
if (orientation == GLU.GLU_OUTSIDE) {
int s;
glBegin(gl, ImmModeSink.GL_QUAD_STRIP);
@@ -580,22 +580,22 @@ public class GLUquadricImpl implements GLUquadric {
int l, s;
/* draw loops */
for (l = 0; l <= loops; l++) {
- float r = innerRadius + l * dr;
+ final float r = innerRadius + l * dr;
glBegin(gl, GL.GL_LINE_LOOP);
for (s = 0; s < slices; s++) {
- float a = s * da;
+ final float a = s * da;
glVertex2f(gl, r * sin(a), r * cos(a));
}
glEnd(gl);
}
/* draw spokes */
for (s = 0; s < slices; s++) {
- float a = s * da;
- float x = sin(a);
- float y = cos(a);
+ final float a = s * da;
+ final float x = sin(a);
+ final float y = cos(a);
glBegin(gl, GL.GL_LINE_STRIP);
for (l = 0; l <= loops; l++) {
- float r = innerRadius + l * dr;
+ final float r = innerRadius + l * dr;
glVertex2f(gl, r * x, r * y);
}
glEnd(gl);
@@ -607,12 +607,12 @@ public class GLUquadricImpl implements GLUquadric {
int s;
glBegin(gl, GL.GL_POINTS);
for (s = 0; s < slices; s++) {
- float a = s * da;
- float x = sin(a);
- float y = cos(a);
+ final float a = s * da;
+ final float x = sin(a);
+ final float y = cos(a);
int l;
for (l = 0; l <= loops; l++) {
- float r = innerRadius * l * dr;
+ final float r = innerRadius * l * dr;
glVertex2f(gl, r * x, r * y);
}
}
@@ -625,8 +625,8 @@ public class GLUquadricImpl implements GLUquadric {
float a;
glBegin(gl, GL.GL_LINE_LOOP);
for (a = 0.0f; a < 2.0 * PI; a += da) {
- float x = innerRadius * sin(a);
- float y = innerRadius * cos(a);
+ final float x = innerRadius * sin(a);
+ final float y = innerRadius * cos(a);
glVertex2f(gl, x, y);
}
glEnd(gl);
@@ -635,8 +635,8 @@ public class GLUquadricImpl implements GLUquadric {
float a;
glBegin(gl, GL.GL_LINE_LOOP);
for (a = 0; a < 2.0f * PI; a += da) {
- float x = outerRadius * sin(a);
- float y = outerRadius * cos(a);
+ final float x = outerRadius * sin(a);
+ final float y = outerRadius * cos(a);
glVertex2f(gl, x, y);
}
glEnd(gl);
@@ -671,16 +671,16 @@ public class GLUquadricImpl implements GLUquadric {
* is (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5),
* and at (0, -r, 0) it is (0.5, 0).
*/
- public void drawPartialDisk(GL gl,
- float innerRadius,
- float outerRadius,
+ public void drawPartialDisk(final GL gl,
+ final float innerRadius,
+ final float outerRadius,
int slices,
- int loops,
+ final int loops,
float startAngle,
float sweepAngle) {
int i, j;
- float[] sinCache = new float[CACHE_SIZE];
- float[] cosCache = new float[CACHE_SIZE];
+ final float[] sinCache = new float[CACHE_SIZE];
+ final float[] cosCache = new float[CACHE_SIZE];
float angle;
float sintemp, costemp;
float deltaRadius;
@@ -952,7 +952,7 @@ public class GLUquadricImpl implements GLUquadric {
* 0.0 at the +y axis, to 0.25 at the +x axis, to 0.5 at the -y axis, to 0.75
* at the -x axis, and back to 1.0 at the +y axis.
*/
- public void drawSphere(GL gl, float radius, int slices, int stacks) {
+ public void drawSphere(final GL gl, final float radius, final int slices, final int stacks) {
// TODO
float rho, drho, theta, dtheta;
@@ -1121,7 +1121,7 @@ public class GLUquadricImpl implements GLUquadric {
private static final float PI = (float)Math.PI;
private static final int CACHE_SIZE = 240;
- private final void glBegin(GL gl, int mode) {
+ private final void glBegin(final GL gl, final int mode) {
if(immModeSinkEnabled) {
immModeSink.glBegin(mode);
} else {
@@ -1129,7 +1129,7 @@ public class GLUquadricImpl implements GLUquadric {
}
}
- private final void glEnd(GL gl) {
+ private final void glEnd(final GL gl) {
if(immModeSinkEnabled) {
immModeSink.glEnd(gl, immModeSinkImmediate);
} else {
@@ -1137,7 +1137,7 @@ public class GLUquadricImpl implements GLUquadric {
}
}
- private final void glVertex2f(GL gl, float x, float y) {
+ private final void glVertex2f(final GL gl, final float x, final float y) {
if(immModeSinkEnabled) {
immModeSink.glVertex2f(x, y);
} else {
@@ -1145,7 +1145,7 @@ public class GLUquadricImpl implements GLUquadric {
}
}
- private final void glVertex3f(GL gl, float x, float y, float z) {
+ private final void glVertex3f(final GL gl, final float x, final float y, final float z) {
if(immModeSinkEnabled) {
immModeSink.glVertex3f(x, y, z);
} else {
@@ -1153,10 +1153,10 @@ public class GLUquadricImpl implements GLUquadric {
}
}
- private final void glNormal3f_s(GL gl, float x, float y, float z) {
- short a=(short)(x*0xFFFF);
- short b=(short)(y*0xFFFF);
- short c=(short)(z*0xFFFF);
+ private final void glNormal3f_s(final GL gl, final float x, final float y, final float z) {
+ final short a=(short)(x*0xFFFF);
+ final short b=(short)(y*0xFFFF);
+ final short c=(short)(z*0xFFFF);
if(immModeSinkEnabled) {
immModeSink.glNormal3s(a, b, c);
} else {
@@ -1164,10 +1164,10 @@ public class GLUquadricImpl implements GLUquadric {
}
}
- private final void glNormal3f_b(GL gl, float x, float y, float z) {
- byte a=(byte)(x*0xFF);
- byte b=(byte)(y*0xFF);
- byte c=(byte)(z*0xFF);
+ private final void glNormal3f_b(final GL gl, final float x, final float y, final float z) {
+ final byte a=(byte)(x*0xFF);
+ final byte b=(byte)(y*0xFF);
+ final byte c=(byte)(z*0xFF);
if(immModeSinkEnabled) {
immModeSink.glNormal3b(a, b, c);
} else {
@@ -1175,7 +1175,7 @@ public class GLUquadricImpl implements GLUquadric {
}
}
- private final void glNormal3f(GL gl, float x, float y, float z) {
+ private final void glNormal3f(final GL gl, final float x, final float y, final float z) {
switch(normalType) {
case GL.GL_FLOAT:
if(immModeSinkEnabled) {
@@ -1193,7 +1193,7 @@ public class GLUquadricImpl implements GLUquadric {
}
}
- private final void glTexCoord2f(GL gl, float x, float y) {
+ private final void glTexCoord2f(final GL gl, final float x, final float y) {
if(immModeSinkEnabled) {
immModeSink.glTexCoord2f(x, y);
} else {
@@ -1208,7 +1208,7 @@ public class GLUquadricImpl implements GLUquadric {
* @param y
* @param z
*/
- private void normal3f(GL gl, float x, float y, float z) {
+ private void normal3f(final GL gl, float x, float y, float z) {
float mag;
mag = (float)Math.sqrt(x * x + y * y + z * z);
@@ -1220,15 +1220,15 @@ public class GLUquadricImpl implements GLUquadric {
glNormal3f(gl, x, y, z);
}
- private final void TXTR_COORD(GL gl, float x, float y) {
+ private final void TXTR_COORD(final GL gl, final float x, final float y) {
if (textureFlag) glTexCoord2f(gl, x,y);
}
- private float sin(float r) {
+ private float sin(final float r) {
return (float)Math.sin(r);
}
- private float cos(float r) {
+ private float cos(final float r) {
return (float)Math.cos(r);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/Glue.java b/src/jogl/classes/jogamp/opengl/glu/Glue.java
index 2ad3d8c89..fc85b137f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/Glue.java
+++ b/src/jogl/classes/jogamp/opengl/glu/Glue.java
@@ -94,7 +94,7 @@ public class Glue {
public Glue() {
}
- public static String __gluNURBSErrorString( int errno ) {
+ public static String __gluNURBSErrorString( final int errno ) {
return( __gluNurbsErrors[ errno ] );
}
@@ -108,7 +108,7 @@ public class Glue {
"need combine callback"
};
- public static String __gluTessErrorString( int errno ) {
+ public static String __gluTessErrorString( final int errno ) {
return( __gluTessErrors[ errno ] );
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/error/Error.java b/src/jogl/classes/jogamp/opengl/glu/error/Error.java
index ffb8d9471..235c59717 100644
--- a/src/jogl/classes/jogamp/opengl/glu/error/Error.java
+++ b/src/jogl/classes/jogamp/opengl/glu/error/Error.java
@@ -76,7 +76,7 @@ public class Error {
public Error() {
}
- public static String gluErrorString( int errorCode ) {
+ public static String gluErrorString( final int errorCode ) {
if( errorCode == 0 ) {
return( "no error" );
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
index 4213dfd46..96da49a80 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
@@ -1,42 +1,9 @@
package jogamp.opengl.glu.gl2.nurbs;
import jogamp.opengl.glu.nurbs.*;
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
+import javax.media.opengl.GL2GL3;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.gl2.GLUgl2;
@@ -55,7 +22,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
/**
* OpenGL object
*/
- private GL2 gl;
+ private final GL2 gl;
/**
* Not used
@@ -130,8 +97,8 @@ class GL2CurveEvaluator implements CurveEvaluator {
* @param ps control points
*/
@Override
- public void map1f(int type, float ulo, float uhi, int stride, int order,
- CArrayOfFloats ps) {
+ public void map1f(final int type, final float ulo, final float uhi, final int stride, final int order,
+ final CArrayOfFloats ps) {
if (output_triangles) {
// TODO code for callback (output_triangles probably indicates callback)
// System.out.println("TODO curveevaluator.map1f-output_triangles");
@@ -157,7 +124,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
* @param type what to enable
*/
@Override
- public void enable(int type) {
+ public void enable(final int type) {
// DONE
gl.glEnable(type);
}
@@ -169,7 +136,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
* @param u2 high u
*/
@Override
- public void mapgrid1f(int nu, float u1, float u2) {
+ public void mapgrid1f(final int nu, final float u1, final float u2) {
if (output_triangles) {
// System.out.println("TODO curveevaluator.mapgrid1f");
} else
@@ -185,7 +152,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
* @param to highest param
*/
@Override
- public void mapmesh1f(int style, int from, int to) {
+ public void mapmesh1f(final int style, final int from, final int to) {
/* //DEBUG drawing control points
this.poradi++;
if (poradi % 2 == 0)
@@ -200,10 +167,10 @@ class GL2CurveEvaluator implements CurveEvaluator {
switch (style) {
case Backend.N_MESHFILL:
case Backend.N_MESHLINE:
- gl.glEvalMesh1(GL2.GL_LINE, from, to);
+ gl.glEvalMesh1(GL2GL3.GL_LINE, from, to);
break;
case Backend.N_MESHPOINT:
- gl.glEvalMesh1(GL2.GL_POINT, from, to);
+ gl.glEvalMesh1(GL2GL3.GL_POINT, from, to);
break;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
index e9c9fca3f..e5cb715ab 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
@@ -1,42 +1,9 @@
package jogamp.opengl.glu.gl2.nurbs;
import jogamp.opengl.glu.nurbs.*;
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
+import javax.media.opengl.GL2GL3;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.gl2.GLUgl2;
@@ -50,7 +17,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
/**
* JOGL OpenGL object
*/
- private GL2 gl;
+ private final GL2 gl;
/**
* Output triangles (callback)
@@ -90,18 +57,18 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
* @param style polygon mode (N_MESHFILL/N_MESHLINE/N_MESHPOINT)
*/
@Override
- public void polymode(int style) {
+ public void polymode(final int style) {
if (!output_triangles) {
switch (style) {
default:
case NurbsConsts.N_MESHFILL:
- gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
+ gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_FILL);
break;
case NurbsConsts.N_MESHLINE:
- gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
+ gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_LINE);
break;
case NurbsConsts.N_MESHPOINT:
- gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_POINT);
+ gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_POINT);
break;
}
}
@@ -130,7 +97,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
* @param vhi
*/
@Override
- public void domain2f(float ulo, float uhi, float vlo, float vhi) {
+ public void domain2f(final float ulo, final float uhi, final float vlo, final float vhi) {
// DONE
}
@@ -144,7 +111,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
* @param v1 highest v
*/
@Override
- public void mapgrid2f(int nu, float u0, float u1, int nv, float v0, float v1) {
+ public void mapgrid2f(final int nu, final float u0, final float u1, final int nv, final float v0, final float v1) {
if (output_triangles) {
// System.out.println("TODO openglsurfaceavaluator.mapgrid2f output_triangles");
@@ -163,7 +130,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
* @param vmax maximum V
*/
@Override
- public void mapmesh2f(int style, int umin, int umax, int vmin, int vmax) {
+ public void mapmesh2f(final int style, final int umin, final int umax, final int vmin, final int vmax) {
if (output_triangles) {
// System.out.println("TODO openglsurfaceavaluator.mapmesh2f output_triangles");
} else {
@@ -176,13 +143,13 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
*/
switch (style) {
case NurbsConsts.N_MESHFILL:
- gl.glEvalMesh2(GL2.GL_FILL, umin, umax, vmin, vmax);
+ gl.glEvalMesh2(GL2GL3.GL_FILL, umin, umax, vmin, vmax);
break;
case NurbsConsts.N_MESHLINE:
- gl.glEvalMesh2(GL2.GL_LINE, umin, umax, vmin, vmax);
+ gl.glEvalMesh2(GL2GL3.GL_LINE, umin, umax, vmin, vmax);
break;
case NurbsConsts.N_MESHPOINT:
- gl.glEvalMesh2(GL2.GL_POINT, umin, umax, vmin, vmax);
+ gl.glEvalMesh2(GL2GL3.GL_POINT, umin, umax, vmin, vmax);
break;
}
}
@@ -202,8 +169,8 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
* @param pts control points
*/
@Override
- public void map2f(int type, float ulo, float uhi, int ustride, int uorder,
- float vlo, float vhi, int vstride, int vorder, CArrayOfFloats pts) {
+ public void map2f(final int type, final float ulo, final float uhi, final int ustride, final int uorder,
+ final float vlo, final float vhi, final int vstride, final int vorder, final CArrayOfFloats pts) {
// TODO Auto-generated method stub
if (output_triangles) {
// System.out.println("TODO openglsurfaceevaluator.map2f output_triangles");
@@ -218,7 +185,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
* @param type what to enable
*/
@Override
- public void enable(int type) {
+ public void enable(final int type) {
//DONE
gl.glEnable(type);
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
index f83b3a805..338d7e6d6 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
@@ -67,17 +67,17 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Matrixes autoloading
*/
- private boolean autoloadmode;
+ private final boolean autoloadmode;
/**
* Using callback
*/
- private int callBackFlag;
+ private final int callBackFlag;
/**
* Object for error call backs
*/
- private Object errorCallback;
+ private final Object errorCallback;
/**
* List of map definitions
@@ -122,7 +122,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Object holding rendering settings
*/
- private Renderhints renderhints;
+ private final Renderhints renderhints;
/**
* Display list
@@ -132,7 +132,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Object for subdividing curves and surfaces
*/
- private Subdivider subdivider;
+ private final Subdivider subdivider;
/**
* Object responsible for rendering
@@ -221,13 +221,13 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
defineMap(GL2.GL_MAP1_INDEX, 0, 1);
setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_SAMPLINGMETHOD,
- (float) NurbsConsts.N_PATHLENGTH);
+ NurbsConsts.N_PATHLENGTH);
setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_SAMPLINGMETHOD,
- (float) NurbsConsts.N_PATHLENGTH);
+ NurbsConsts.N_PATHLENGTH);
setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_SAMPLINGMETHOD,
- (float) NurbsConsts.N_PATHLENGTH);
+ NurbsConsts.N_PATHLENGTH);
setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_SAMPLINGMETHOD,
- (float) NurbsConsts.N_PATHLENGTH);
+ NurbsConsts.N_PATHLENGTH);
setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_PIXEL_TOLERANCE,
(float) 50.0);
@@ -276,7 +276,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param d
* distance
*/
- private void set_domain_distance_u_rate(double d) {
+ private void set_domain_distance_u_rate(final double d) {
// DONE
subdivider.set_domain_distance_u_rate(d);
}
@@ -287,7 +287,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param d
* distance
*/
- private void set_domain_distance_v_rate(double d) {
+ private void set_domain_distance_v_rate(final double d) {
// DONE
subdivider.set_domain_distance_v_rate(d);
}
@@ -297,7 +297,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
*/
public void bgncurve() {
// DONE
- O_curve o_curve = new O_curve();
+ final O_curve o_curve = new O_curve();
thread("do_bgncurve", o_curve);
}
@@ -309,9 +309,9 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param arg
* parameter to be passed to called method
*/
- private void thread(String name, Object arg) {
+ private void thread(final String name, final Object arg) {
// DONE
- Class partype[] = new Class[1];
+ final Class partype[] = new Class[1];
partype[0] = arg.getClass();
Method m;
try {
@@ -321,7 +321,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
} else {
m.invoke(this, new Object[] { arg });
}
- } catch (Throwable e) {
+ } catch (final Throwable e) {
e.printStackTrace();
}
@@ -333,16 +333,16 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param name
* name of a method to be called
*/
- private void thread2(String name) {
+ private void thread2(final String name) {
// DONE
try {
- Method m = this.getClass().getMethod(name, (Class[]) null);
+ final Method m = this.getClass().getMethod(name, (Class[]) null);
if (dl != null) {
dl.append(this, m, null);
} else {
m.invoke(this, (Object[]) null);
}
- } catch (Throwable e) {
+ } catch (final Throwable e) {
e.printStackTrace();
}
}
@@ -353,7 +353,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param o_curve
* curve object
*/
- public void do_bgncurve(O_curve o_curve) {
+ public void do_bgncurve(final O_curve o_curve) {
if (inCurve > 0) {
do_nurbserror(6);
endcurve();
@@ -385,7 +385,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param o_surface
* surface object
*/
- public void do_bgnsurface(O_surface o_surface) {
+ public void do_bgnsurface(final O_surface o_surface) {
// DONE
if (inSurface > 0) {
do_nurbserror(27);
@@ -507,7 +507,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param i
* error code
*/
- private void do_nurbserror(int i) {
+ private void do_nurbserror(final int i) {
// TODO nurberror
// System.out.println("TODO nurbserror " + i);
}
@@ -553,10 +553,10 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param realType
* type of the curve
*/
- public void nurbscurve(int nknots, float[] knot, int stride,
- float[] ctlarray, int order, int realType) {
+ public void nurbscurve(final int nknots, final float[] knot, final int stride,
+ final float[] ctlarray, final int order, final int realType) {
// DONE
- Mapdesc mapdesc = maplist.locate(realType);
+ final Mapdesc mapdesc = maplist.locate(realType);
if (mapdesc == null) {
do_nurbserror(35);
isDataValid = 0;
@@ -572,14 +572,14 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
isDataValid = 0;
return;
}
- Knotvector knots = new Knotvector(nknots, stride, order, knot);
+ final Knotvector knots = new Knotvector(nknots, stride, order, knot);
if (!do_check_knots(knots, "curve"))
return;
- O_nurbscurve o_nurbscurve = new O_nurbscurve(realType);
+ final O_nurbscurve o_nurbscurve = new O_nurbscurve(realType);
o_nurbscurve.bezier_curves = new Quilt(mapdesc);
- CArrayOfFloats ctrlcarr = new CArrayOfFloats(ctlarray);
+ final CArrayOfFloats ctrlcarr = new CArrayOfFloats(ctlarray);
o_nurbscurve.bezier_curves.toBezier(knots, ctrlcarr, mapdesc
.getNCoords());
thread("do_nurbscurve", o_nurbscurve);
@@ -594,9 +594,9 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* error message
* @return knot vector is / is not valid
*/
- public boolean do_check_knots(Knotvector knots, String msg) {
+ public boolean do_check_knots(final Knotvector knots, final String msg) {
// DONE
- int status = knots.validate();
+ final int status = knots.validate();
if (status > 0) {
do_nurbserror(status);
if (renderhints.errorchecking != NurbsConsts.N_NOMSG)
@@ -611,7 +611,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param o_nurbscurve
* NURBS curve object
*/
- public void do_nurbscurve(O_nurbscurve o_nurbscurve) {
+ public void do_nurbscurve(final O_nurbscurve o_nurbscurve) {
// DONE
if (inCurve <= 0) {
@@ -664,7 +664,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param o_nurbssurface
* NURBS surface object
*/
- public void do_nurbssurface(O_nurbssurface o_nurbssurface) {
+ public void do_nurbssurface(final O_nurbssurface o_nurbssurface) {
// DONE
if (inSurface <= 0) {
bgnsurface();
@@ -712,7 +712,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param ncoords
* number of control point coordinates
*/
- public void defineMap(int type, int rational, int ncoords) {
+ public void defineMap(final int type, final int rational, final int ncoords) {
// DONE
maplist.define(type, rational, ncoords);
}
@@ -727,9 +727,9 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param value
* property value
*/
- public void setnurbsproperty(int type, int tag, float value) {
+ public void setnurbsproperty(final int type, final int tag, final float value) {
// DONE
- Mapdesc mapdesc = maplist.locate(type);
+ final Mapdesc mapdesc = maplist.locate(type);
if (mapdesc == null) {
do_nurbserror(35);
return;
@@ -738,7 +738,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
do_nurbserror(26);
return;
}
- Property prop = new Property(type, tag, value);
+ final Property prop = new Property(type, tag, value);
thread("do_setnurbsproperty2", prop);
}
@@ -748,8 +748,8 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param prop
* property
*/
- public void do_setnurbsproperty2(Property prop) {
- Mapdesc mapdesc = maplist.find(prop.type);
+ public void do_setnurbsproperty2(final Property prop) {
+ final Mapdesc mapdesc = maplist.find(prop.type);
mapdesc.setProperty(prop.tag, prop.value);
}
@@ -759,7 +759,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param prop
* property to be set
*/
- public void do_setnurbsproperty(Property prop) {
+ public void do_setnurbsproperty(final Property prop) {
// DONE
renderhints.setProperty(prop);
// TODO freeproperty?
@@ -771,7 +771,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param i
* domain distance sampling flag
*/
- public void set_is_domain_distance_sampling(int i) {
+ public void set_is_domain_distance_sampling(final int i) {
// DONE
subdivider.set_is_domain_distance_sampling(i);
}
@@ -781,7 +781,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
*/
public void bgnsurface() {
// DONE
- O_surface o_surface = new O_surface();
+ final O_surface o_surface = new O_surface();
// TODO nuid
// System.out.println("TODO glunurbs.bgnsurface nuid");
thread("do_bgnsurface", o_surface);
@@ -827,11 +827,11 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
* @param type
* NURBS surface type (rational,...)
*/
- public void nurbssurface(int sknot_count, float[] sknot, int tknot_count,
- float[] tknot, int s_stride, int t_stride, float[] ctlarray,
- int sorder, int torder, int type) {
+ public void nurbssurface(final int sknot_count, final float[] sknot, final int tknot_count,
+ final float[] tknot, final int s_stride, final int t_stride, final float[] ctlarray,
+ final int sorder, final int torder, final int type) {
// DONE
- Mapdesc mapdesc = maplist.locate(type);
+ final Mapdesc mapdesc = maplist.locate(type);
if (mapdesc == null) {
do_nurbserror(35);
isDataValid = 0;
@@ -842,19 +842,19 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
isDataValid = 0;
return;
}
- Knotvector sknotvector = new Knotvector(sknot_count, s_stride, sorder,
+ final Knotvector sknotvector = new Knotvector(sknot_count, s_stride, sorder,
sknot);
if (!do_check_knots(sknotvector, "surface"))
return;
- Knotvector tknotvector = new Knotvector(tknot_count, t_stride, torder,
+ final Knotvector tknotvector = new Knotvector(tknot_count, t_stride, torder,
tknot);
if (!do_check_knots(tknotvector, "surface"))
return;
- O_nurbssurface o_nurbssurface = new O_nurbssurface(type);
+ final O_nurbssurface o_nurbssurface = new O_nurbssurface(type);
o_nurbssurface.bezier_patches = new Quilt(mapdesc);
- CArrayOfFloats ctrlarr = new CArrayOfFloats(ctlarray);
+ final CArrayOfFloats ctrlarr = new CArrayOfFloats(ctlarray);
o_nurbssurface.bezier_patches.toBezier(sknotvector, tknotvector,
ctrlarr, mapdesc.getNCoords());
thread("do_nurbssurface", o_nurbssurface);
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
index 81a99beab..337d93b80 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
@@ -46,9 +46,15 @@ package jogamp.opengl.glu.mipmap;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL2ES3;
+import javax.media.opengl.GL2GL3;
import javax.media.opengl.glu.GLU;
+
import jogamp.opengl.Debug;
+
import com.jogamp.common.nio.Buffers;
+
import java.nio.*;
import java.io.*;
@@ -65,9 +71,9 @@ public class BuildMipmap {
public BuildMipmap() {
}
- public static int gluBuild1DMipmapLevelsCore( GL gl, int target, int internalFormat,
- int width, int widthPowerOf2, int format, int type, int userLevel,
- int baseLevel, int maxLevel, ByteBuffer data ) {
+ public static int gluBuild1DMipmapLevelsCore( final GL gl, final int target, final int internalFormat,
+ final int width, final int widthPowerOf2, final int format, final int type, final int userLevel,
+ final int baseLevel, final int maxLevel, final ByteBuffer data ) {
int newwidth;
int level, levels;
ShortBuffer newImage = null;
@@ -75,9 +81,9 @@ public class BuildMipmap {
ShortBuffer otherImage = null;
ShortBuffer imageTemp = null;
int memReq;
- int maxsize;
+ final int maxsize;
int cmpts;
- PixelStorageModes psm = new PixelStorageModes();
+ final PixelStorageModes psm = new PixelStorageModes();
assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
assert( width >= 1 );
@@ -90,40 +96,40 @@ public class BuildMipmap {
Mipmap.retrieveStoreModes( gl, psm );
try {
newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, 1, format,
- GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
- } catch( OutOfMemoryError ome ) {
+ GL.GL_UNSIGNED_SHORT ) ).asShortBuffer();
+ } catch( final OutOfMemoryError ome ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
newImage_width = width;
Image.fill_image( psm, width, 1, format, type, Mipmap.is_index( format ), data, newImage );
cmpts = Mipmap.elements_per_group( format, type );
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, 2 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, 0 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, 0 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, 0 );
// if swap_bytes was set, swapping occurred in fill_image
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, GL.GL_FALSE );
for( level = userLevel; level <= levels; level++ ) {
if( newImage_width == newwidth ) {
// user newimage for this level
if( baseLevel <= level && level <= maxLevel ) {
gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0, format,
- GL2.GL_UNSIGNED_SHORT, newImage );
+ GL.GL_UNSIGNED_SHORT, newImage );
}
} else {
if( otherImage == null ) {
- memReq = Mipmap.image_size( newwidth, 1, format, GL2.GL_UNSIGNED_SHORT );
+ memReq = Mipmap.image_size( newwidth, 1, format, GL.GL_UNSIGNED_SHORT );
try {
otherImage = Buffers.newDirectByteBuffer( memReq ).asShortBuffer();
- } catch( OutOfMemoryError ome ) {
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ } catch( final OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
return( GLU.GLU_OUT_OF_MEMORY );
}
}
@@ -136,26 +142,26 @@ public class BuildMipmap {
newImage_width = newwidth;
if( baseLevel <= level && level <= maxLevel ) {
gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0,
- format, GL2.GL_UNSIGNED_SHORT, newImage );
+ format, GL.GL_UNSIGNED_SHORT, newImage );
}
}
if( newwidth > 1 ) {
newwidth /= 2;
}
}
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
return( 0 );
}
- public static int bitmapBuild2DMipmaps( GL gl, int target, int internalFormat,
- int width, int height, int format, int type, ByteBuffer data ) {
- int newwidth[] = new int[1];
- int newheight[] = new int[1];
+ public static int bitmapBuild2DMipmaps( final GL gl, final int target, final int internalFormat,
+ final int width, final int height, final int format, final int type, final ByteBuffer data ) {
+ final int newwidth[] = new int[1];
+ final int newheight[] = new int[1];
int level, levels;
ShortBuffer newImage = null;
int newImage_width;
@@ -163,9 +169,9 @@ public class BuildMipmap {
ShortBuffer otherImage = null;
ShortBuffer tempImage = null;
int memReq;
- int maxsize;
+ final int maxsize;
int cmpts;
- PixelStorageModes psm = new PixelStorageModes();
+ final PixelStorageModes psm = new PixelStorageModes();
Mipmap.retrieveStoreModes( gl, psm );
@@ -179,8 +185,8 @@ public class BuildMipmap {
try {
newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, height,
- format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
- } catch( OutOfMemoryError ome ) {
+ format, GL.GL_UNSIGNED_SHORT ) ).asShortBuffer();
+ } catch( final OutOfMemoryError ome ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
newImage_width = width;
@@ -189,30 +195,30 @@ public class BuildMipmap {
Image.fill_image( psm, width, height, format, type, Mipmap.is_index( format ), data, newImage );
cmpts = Mipmap.elements_per_group( format, type );
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, 2 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, 0 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, 0 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, 0 );
// if swap_bytes is set, swapping occurred in fill_image
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, GL.GL_FALSE );
for( level = 0; level < levels; level++ ) {
if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
newImage.rewind();
gl.glTexImage2D( target, level, internalFormat, newImage_width,
- newImage_height, 0, format, GL2.GL_UNSIGNED_SHORT, newImage );
+ newImage_height, 0, format, GL.GL_UNSIGNED_SHORT, newImage );
} else {
if( otherImage == null ) {
- memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_SHORT );
+ memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL.GL_UNSIGNED_SHORT );
try {
otherImage = Buffers.newDirectByteBuffer( memReq ).asShortBuffer();
- } catch( OutOfMemoryError ome ) {
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ } catch( final OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
return( GLU.GLU_OUT_OF_MEMORY );
}
}
@@ -227,7 +233,7 @@ public class BuildMipmap {
newImage_height = newheight[0];
newImage.rewind();
gl.glTexImage2D( target, level, internalFormat, newImage_width, newImage_height,
- 0, format, GL2.GL_UNSIGNED_SHORT, newImage );
+ 0, format, GL.GL_UNSIGNED_SHORT, newImage );
}
if( newheight[0] > 1 ) {
newwidth[0] /= 2;
@@ -236,38 +242,38 @@ public class BuildMipmap {
newheight[0] /= 2;
}
}
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
return( 0 );
}
- public static int gluBuild2DMipmapLevelsCore( GL gl, int target, int internalFormat,
- int width, int height, int widthPowerOf2, int heightPowerOf2,
- int format, int type, int userLevel, int baseLevel, int maxLevel,
- ByteBuffer data ) { // PointerWrapper data
+ public static int gluBuild2DMipmapLevelsCore( final GL gl, final int target, final int internalFormat,
+ final int width, final int height, final int widthPowerOf2, final int heightPowerOf2,
+ final int format, final int type, final int userLevel, final int baseLevel, final int maxLevel,
+ final ByteBuffer data ) { // PointerWrapper data
int newwidth;
int newheight;
int level, levels;
- int usersImage;
+ final int usersImage;
ByteBuffer srcImage = null;
ByteBuffer dstImage = null;
ByteBuffer tempImage = null;
- int newImage_width;
- int newImage_height;
- short[] SWAP_IMAGE = null;
+ final int newImage_width;
+ final int newImage_height;
+ final short[] SWAP_IMAGE = null;
int memReq;
- int maxsize;
+ final int maxsize;
int cmpts;
int mark=-1;
boolean myswap_bytes;
int groups_per_line, element_size, group_size;
int rowsize, padding;
- PixelStorageModes psm = new PixelStorageModes();
+ final PixelStorageModes psm = new PixelStorageModes();
assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
assert( width >= 1 && height >= 1 );
@@ -310,9 +316,9 @@ public class BuildMipmap {
mark = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
data.position( mark );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, 0 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, 0 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, 0 );
level = userLevel;
@@ -324,11 +330,11 @@ public class BuildMipmap {
gl.glTexImage2D( target, level, internalFormat, width, height, 0, format, type, data );
}
if( levels == 0 ) { /* we're done. clean up and return */
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
return( 0 );
}
int nextWidth = newwidth / 2;
@@ -345,97 +351,97 @@ public class BuildMipmap {
try {
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
- case( GL2.GL_BYTE ):
- case( GL2.GL_UNSIGNED_SHORT ):
- case( GL2.GL_SHORT ):
- case( GL2.GL_UNSIGNED_INT ):
- case( GL2.GL_INT ):
- case( GL2.GL_FLOAT ):
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL.GL_UNSIGNED_BYTE ):
+ case( GL.GL_BYTE ):
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL.GL_SHORT ):
+ case( GL.GL_UNSIGNED_INT ):
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_FLOAT ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
}
- } catch( OutOfMemoryError ome ) {
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ } catch( final OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
return( GLU.GLU_OUT_OF_MEMORY );
}
if( dstImage != null ) {
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL.GL_UNSIGNED_BYTE ):
HalveImage.halveImage_ubyte( cmpts, width, height, data, dstImage, element_size, rowsize, group_size );
break;
- case( GL2.GL_BYTE ):
+ case( GL.GL_BYTE ):
HalveImage.halveImage_byte( cmpts, width, height, data, dstImage, element_size, rowsize, group_size );
break;
- case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL.GL_UNSIGNED_SHORT ):
HalveImage.halveImage_ushort( cmpts, width, height, data, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_SHORT ):
+ case( GL.GL_SHORT ):
HalveImage.halveImage_short( cmpts, width, height, data, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT ):
+ case( GL.GL_UNSIGNED_INT ):
HalveImage.halveImage_uint( cmpts, width, height, data, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_INT ):
+ case( GL2ES2.GL_INT ):
HalveImage.halveImage_int( cmpts, width, height, data, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_FLOAT ):
+ case( GL.GL_FLOAT ):
HalveImage.halveImage_float( cmpts, width, height, data, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
- assert( format == GL2.GL_RGB );
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+ assert( format == GL.GL_RGB );
HalveImage.halveImagePackedPixel( 3, new Extract332(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
- assert( format == GL2.GL_RGB );
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ assert( format == GL.GL_RGB );
HalveImage.halveImagePackedPixel( 3, new Extract233rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
HalveImage.halveImagePackedPixel( 3, new Extract565(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
HalveImage.halveImagePackedPixel( 3, new Extract565rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
HalveImage.halveImagePackedPixel( 4, new Extract4444(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
HalveImage.halveImagePackedPixel( 4, new Extract4444rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
HalveImage.halveImagePackedPixel( 4, new Extract5551(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
HalveImage.halveImagePackedPixel( 4, new Extract1555rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
HalveImage.halveImagePackedPixel( 4, new Extract8888(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
HalveImage.halveImagePackedPixel( 4, new Extract8888rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
HalveImage.halveImagePackedPixel( 4, new Extract1010102(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
HalveImage.halveImagePackedPixel( 4, new Extract2101010rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
break;
default:
@@ -462,36 +468,36 @@ public class BuildMipmap {
dstImage = tempImage;
try {
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
- case( GL2.GL_BYTE ):
- case( GL2.GL_UNSIGNED_SHORT ):
- case( GL2.GL_SHORT ):
- case( GL2.GL_UNSIGNED_INT ):
- case( GL2.GL_INT ):
- case( GL2.GL_FLOAT ):
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL.GL_UNSIGNED_BYTE ):
+ case( GL.GL_BYTE ):
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL.GL_SHORT ):
+ case( GL.GL_UNSIGNED_INT ):
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_FLOAT ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
}
- } catch( OutOfMemoryError ome ) {
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ } catch( final OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
return( GLU.GLU_OUT_OF_MEMORY );
}
// level userLevel+1 is in srcImage; level userLevel already saved
@@ -500,113 +506,113 @@ public class BuildMipmap {
memReq = Mipmap.image_size( newwidth, newheight, format, type );
try {
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
- case( GL2.GL_BYTE ):
- case( GL2.GL_UNSIGNED_SHORT ):
- case( GL2.GL_SHORT ):
- case( GL2.GL_UNSIGNED_INT ):
- case( GL2.GL_INT ):
- case( GL2.GL_FLOAT ):
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL.GL_UNSIGNED_BYTE ):
+ case( GL.GL_BYTE ):
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL.GL_SHORT ):
+ case( GL.GL_UNSIGNED_INT ):
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_FLOAT ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
}
- } catch( OutOfMemoryError ome ) {
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ } catch( final OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
return( GLU.GLU_OUT_OF_MEMORY );
}
data.position( mark );
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL.GL_UNSIGNED_BYTE ):
ScaleInternal.scale_internal_ubyte( cmpts, width, height, data,
newwidth, newheight, dstImage, element_size, rowsize, group_size );
break;
- case( GL2.GL_BYTE ):
+ case( GL.GL_BYTE ):
ScaleInternal.scale_internal_byte( cmpts, width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, group_size );
break;
- case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL.GL_UNSIGNED_SHORT ):
ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth,
newheight, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_SHORT ):
+ case( GL.GL_SHORT ):
ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth,
newheight, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT ):
+ case( GL.GL_UNSIGNED_INT ):
ScaleInternal.scale_internal_uint( cmpts, width, height, data, newwidth,
newheight, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_INT ):
+ case( GL2ES2.GL_INT ):
ScaleInternal.scale_internal_int( cmpts, width, height, data, newwidth,
newheight, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_FLOAT ):
+ case( GL.GL_FLOAT ):
ScaleInternal.scale_internal_float( cmpts, width, height, data, newwidth,
newheight, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
ScaleInternal.scaleInternalPackedPixel( 3, new Extract332(), width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
ScaleInternal.scaleInternalPackedPixel( 3, new Extract233rev(), width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
ScaleInternal.scaleInternalPackedPixel( 3, new Extract565(), width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
ScaleInternal.scaleInternalPackedPixel( 3, new Extract565rev(), width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
ScaleInternal.scaleInternalPackedPixel( 4, new Extract4444(), width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
ScaleInternal.scaleInternalPackedPixel( 4, new Extract4444rev(), width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
ScaleInternal.scaleInternalPackedPixel( 4, new Extract5551(), width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
ScaleInternal.scaleInternalPackedPixel( 4, new Extract1555rev(), width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
ScaleInternal.scaleInternalPackedPixel( 4, new Extract8888(), width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
ScaleInternal.scaleInternalPackedPixel( 4, new Extract8888rev(), width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
ScaleInternal.scaleInternalPackedPixel( 4, new Extract1010102(), width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
ScaleInternal.scaleInternalPackedPixel( 4, new Extract2101010rev(), width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, myswap_bytes );
break;
@@ -634,36 +640,36 @@ public class BuildMipmap {
memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
try {
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
- case( GL2.GL_BYTE ):
- case( GL2.GL_UNSIGNED_SHORT ):
- case( GL2.GL_SHORT ):
- case( GL2.GL_UNSIGNED_INT ):
- case( GL2.GL_INT ):
- case( GL2.GL_FLOAT ):
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL.GL_UNSIGNED_BYTE ):
+ case( GL.GL_BYTE ):
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL.GL_SHORT ):
+ case( GL.GL_UNSIGNED_INT ):
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_FLOAT ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
}
- } catch( OutOfMemoryError ome ) {
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ } catch( final OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
return( GLU.GLU_OUT_OF_MEMORY );
}
}
@@ -671,7 +677,7 @@ public class BuildMipmap {
level = userLevel;
}
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, GL.GL_FALSE );
if( baseLevel <= level && level <= maxLevel ) {
srcImage.rewind();
gl.glTexImage2D( target, level, internalFormat, newwidth, newheight, 0, format, type, srcImage );
@@ -691,63 +697,63 @@ public class BuildMipmap {
srcImage.rewind();
dstImage.rewind();
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL.GL_UNSIGNED_BYTE ):
HalveImage.halveImage_ubyte( cmpts, newwidth, newheight, srcImage, dstImage, element_size, rowsize, group_size );
break;
- case( GL2.GL_BYTE ):
+ case( GL.GL_BYTE ):
HalveImage.halveImage_byte( cmpts, newwidth, newheight, srcImage, dstImage, element_size, rowsize, group_size );
break;
- case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL.GL_UNSIGNED_SHORT ):
HalveImage.halveImage_ushort( cmpts, newwidth, newheight, srcImage, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_SHORT ):
+ case( GL.GL_SHORT ):
HalveImage.halveImage_short( cmpts, newwidth, newheight, srcImage, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT ):
+ case( GL.GL_UNSIGNED_INT ):
HalveImage.halveImage_uint( cmpts, newwidth, newheight, srcImage, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_INT ):
+ case( GL2ES2.GL_INT ):
HalveImage.halveImage_int( cmpts, newwidth, newheight, srcImage, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_FLOAT ):
+ case( GL.GL_FLOAT ):
HalveImage.halveImage_float( cmpts, newwidth, newheight, srcImage, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
- assert( format == GL2.GL_RGB );
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+ assert( format == GL.GL_RGB );
HalveImage.halveImagePackedPixel( 3, new Extract332(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
- assert( format == GL2.GL_RGB );
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ assert( format == GL.GL_RGB );
HalveImage.halveImagePackedPixel( 3, new Extract233rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
HalveImage.halveImagePackedPixel( 3, new Extract565(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
HalveImage.halveImagePackedPixel( 3, new Extract565rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
HalveImage.halveImagePackedPixel( 4, new Extract4444(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
HalveImage.halveImagePackedPixel( 4, new Extract4444rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
HalveImage.halveImagePackedPixel( 4, new Extract5551(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
HalveImage.halveImagePackedPixel( 4, new Extract1555rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
HalveImage.halveImagePackedPixel( 4, new Extract8888(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
HalveImage.halveImagePackedPixel( 4, new Extract8888rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
HalveImage.halveImagePackedPixel( 4, new Extract1010102(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
break;
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
HalveImage.halveImagePackedPixel( 4, new Extract2101010rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
break;
default:
@@ -768,7 +774,7 @@ public class BuildMipmap {
newheight /= 2;
}
// compute amount to pad per row if any
- int rowPad = rowsize % psm.getUnpackAlignment();
+ final int rowPad = rowsize % psm.getUnpackAlignment();
// should row be padded
if( rowPad == 0 ) {
@@ -788,21 +794,21 @@ public class BuildMipmap {
}
} else {
// compute length of new row in bytes, including padding
- int newRowLength = rowsize + psm.getUnpackAlignment() - rowPad;
+ final int newRowLength = rowsize + psm.getUnpackAlignment() - rowPad;
int ii, jj;
- int dstTrav;
- int srcTrav;
+ final int dstTrav;
+ final int srcTrav;
// allocate new image for mipmap of size newRowLength x newheight
ByteBuffer newMipmapImage = null;
try {
newMipmapImage = ByteBuffer.allocateDirect( newRowLength * newheight );
- } catch( OutOfMemoryError ome ) {
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ } catch( final OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
return( GLU.GLU_OUT_OF_MEMORY );
}
srcImage.rewind();
@@ -828,19 +834,19 @@ public class BuildMipmap {
}
}
}
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
return( 0 );
}
- public static int fastBuild2DMipmaps( GL gl, PixelStorageModes psm, int target,
- int components, int width, int height, int format, int type, ByteBuffer data ) {
- int[] newwidth = new int[1];
- int[] newheight = new int[1];
+ public static int fastBuild2DMipmaps( final GL gl, final PixelStorageModes psm, final int target,
+ final int components, final int width, final int height, final int format, final int type, final ByteBuffer data ) {
+ final int[] newwidth = new int[1];
+ final int[] newheight = new int[1];
int level, levels;
ByteBuffer newImage;
int newImage_width;
@@ -848,7 +854,7 @@ public class BuildMipmap {
ByteBuffer otherImage;
ByteBuffer imageTemp;
int memReq;
- int maxsize;
+ final int maxsize;
int cmpts;
Mipmap.closestFit( gl, target, width, height, components, format, type, newwidth,
@@ -876,12 +882,12 @@ public class BuildMipmap {
int elements_per_line;
int start;
int iter;
- int iter2;
+ final int iter2;
int i, j;
try {
- newImage = Buffers.newDirectByteBuffer( Mipmap.image_size(width, height, format, GL2.GL_UNSIGNED_BYTE ) );
- } catch( OutOfMemoryError err ) {
+ newImage = Buffers.newDirectByteBuffer( Mipmap.image_size(width, height, format, GL.GL_UNSIGNED_BYTE ) );
+ } catch( final OutOfMemoryError err ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
newImage_width = width;
@@ -907,29 +913,29 @@ public class BuildMipmap {
}
}
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 1 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, 1 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, 0 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, 0 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, 0 );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, GL.GL_FALSE );
for( level = 0; level <= levels; level++ ) {
if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
// use newImage for this level
newImage.rewind();
gl.glTexImage2D( target, level, components, newImage_width, newImage_height,
- 0, format, GL2.GL_UNSIGNED_BYTE, newImage );
+ 0, format, GL.GL_UNSIGNED_BYTE, newImage );
} else {
if( otherImage == null ) {
- memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_BYTE );
+ memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL.GL_UNSIGNED_BYTE );
try {
otherImage = Buffers.newDirectByteBuffer( memReq );
- } catch( OutOfMemoryError err ) {
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
+ } catch( final OutOfMemoryError err ) {
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
return( GLU.GLU_OUT_OF_MEMORY );
}
}
@@ -942,7 +948,7 @@ public class BuildMipmap {
newImage_height = newheight[0];
newImage.rewind();
gl.glTexImage2D( target, level, components, newImage_width, newImage_height,
- 0, format, GL2.GL_UNSIGNED_BYTE, newImage );
+ 0, format, GL.GL_UNSIGNED_BYTE, newImage );
}
if( newwidth[0] > 1 ) {
newwidth[0] /= 2;
@@ -951,30 +957,30 @@ public class BuildMipmap {
newheight[0] /= 2;
}
}
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
return( 0 );
}
- public static int gluBuild3DMipmapLevelsCore( GL gl, int target, int internalFormat,
- int width, int height, int depth, int widthPowerOf2, int heightPowerOf2,
- int depthPowerOf2, int format, int type, int userLevel, int baseLevel,
- int maxLevel, ByteBuffer data ) {
+ public static int gluBuild3DMipmapLevelsCore( final GL gl, final int target, final int internalFormat,
+ final int width, final int height, final int depth, final int widthPowerOf2, final int heightPowerOf2,
+ final int depthPowerOf2, final int format, final int type, final int userLevel, final int baseLevel,
+ final int maxLevel, final ByteBuffer data ) {
int newWidth;
int newHeight;
int newDepth;
int level, levels;
ByteBuffer usersImage;
ByteBuffer srcImage, dstImage, tempImage;
- int newImageWidth;
- int newImageHeight;
- int newImageDepth;
+ final int newImageWidth;
+ final int newImageHeight;
+ final int newImageDepth;
int memReq;
- int maxSize;
+ final int maxSize;
int cmpts;
int mark=-1;
@@ -982,7 +988,7 @@ public class BuildMipmap {
int groupsPerLine, elementSize, groupSize;
int rowsPerImage, imageSize;
int rowSize, padding;
- PixelStorageModes psm = new PixelStorageModes();
+ final PixelStorageModes psm = new PixelStorageModes();
assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
assert( width >= 1 && height >= 1 && depth >= 1 );
@@ -1041,11 +1047,11 @@ public class BuildMipmap {
psm.getUnpackSkipImages() * imageSize;
usersImage.position( mark );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, 0 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, 0 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, 0 );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, 0 );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, 0 );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, 0 );
level = userLevel;
@@ -1056,13 +1062,13 @@ public class BuildMipmap {
0, format, type, usersImage );
}
if( levels == 0 ) { /* we're done. clean up and return */
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
- gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
return( 0 );
}
int nextWidth = newWidth / 2;
@@ -1082,44 +1088,44 @@ public class BuildMipmap {
memReq = Mipmap.imageSize3D( nextWidth, nextHeight, nextDepth, format, type );
try {
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
- case( GL2.GL_BYTE ):
- case( GL2.GL_UNSIGNED_SHORT ):
- case( GL2.GL_SHORT ):
- case( GL2.GL_UNSIGNED_INT ):
- case( GL2.GL_INT ):
- case( GL2.GL_FLOAT ):
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL.GL_UNSIGNED_BYTE ):
+ case( GL.GL_BYTE ):
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL.GL_SHORT ):
+ case( GL.GL_UNSIGNED_INT ):
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_FLOAT ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
}
- } catch( OutOfMemoryError err ) {
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
- gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+ } catch( final OutOfMemoryError err ) {
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
return( GLU.GLU_OUT_OF_MEMORY );
}
if( dstImage != null ) {
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL.GL_UNSIGNED_BYTE ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractUByte(), width, height, depth,
usersImage, dstImage, elementSize,
@@ -1129,7 +1135,7 @@ public class BuildMipmap {
dstImage, elementSize, rowSize, groupSize );
}
break;
- case( GL2.GL_BYTE ):
+ case( GL.GL_BYTE ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractSByte(), width, height, depth,
usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1139,7 +1145,7 @@ public class BuildMipmap {
dstImage, elementSize, rowSize, groupSize );
}
break;
- case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL.GL_UNSIGNED_SHORT ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractUShort(), width, height, depth,
usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1149,7 +1155,7 @@ public class BuildMipmap {
dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
}
break;
- case( GL2.GL_SHORT ):
+ case( GL.GL_SHORT ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractSShort(), width, height, depth,
usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1159,7 +1165,7 @@ public class BuildMipmap {
dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
}
break;
- case( GL2.GL_UNSIGNED_INT ):
+ case( GL.GL_UNSIGNED_INT ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractUInt(), width, height, depth,
usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1169,7 +1175,7 @@ public class BuildMipmap {
dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
}
break;
- case( GL2.GL_INT ):
+ case( GL2ES2.GL_INT ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractSInt(), width, height, depth,
usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1179,7 +1185,7 @@ public class BuildMipmap {
dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
}
break;
- case( GL2.GL_FLOAT ):
+ case( GL.GL_FLOAT ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractFloat(), width, height, depth,
usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1189,53 +1195,53 @@ public class BuildMipmap {
dstImage.asFloatBuffer(), elementSize, rowSize, groupSize, myswapBytes );
}
break;
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
- assert( format == GL2.GL_RGB );
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+ assert( format == GL.GL_RGB );
HalveImage.halveImagePackedPixel3D( 3, new Extract332(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
- assert( format == GL2.GL_RGB );
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ assert( format == GL.GL_RGB );
HalveImage.halveImagePackedPixel3D( 3, new Extract233rev(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
HalveImage.halveImagePackedPixel3D( 3, new Extract565(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
HalveImage.halveImagePackedPixel3D( 3, new Extract565rev(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
HalveImage.halveImagePackedPixel3D( 4, new Extract4444(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
HalveImage.halveImagePackedPixel3D( 4, new Extract4444rev(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
HalveImage.halveImagePackedPixel3D( 4, new Extract5551(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
HalveImage.halveImagePackedPixel3D( 4, new Extract1555rev(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
HalveImage.halveImagePackedPixel3D( 4, new Extract8888(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
HalveImage.halveImagePackedPixel3D( 4, new Extract8888rev(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
HalveImage.halveImagePackedPixel3D( 4, new Extract1010102(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
HalveImage.halveImagePackedPixel3D( 4, new Extract2101010rev(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
@@ -1268,38 +1274,38 @@ public class BuildMipmap {
dstImage = tempImage;
try {
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
- case( GL2.GL_BYTE ):
- case( GL2.GL_UNSIGNED_SHORT ):
- case( GL2.GL_SHORT ):
- case( GL2.GL_UNSIGNED_INT ):
- case( GL2.GL_INT ):
- case( GL2.GL_FLOAT ):
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL.GL_UNSIGNED_BYTE ):
+ case( GL.GL_BYTE ):
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL.GL_SHORT ):
+ case( GL.GL_UNSIGNED_INT ):
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_FLOAT ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
}
- } catch( OutOfMemoryError err ) {
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
- gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+ } catch( final OutOfMemoryError err ) {
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
return( GLU.GLU_OUT_OF_MEMORY );
}
@@ -1309,38 +1315,38 @@ public class BuildMipmap {
memReq = Mipmap.imageSize3D( newWidth, newHeight, newDepth, format, type );
try {
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
- case( GL2.GL_BYTE ):
- case( GL2.GL_UNSIGNED_SHORT ):
- case( GL2.GL_SHORT ):
- case( GL2.GL_UNSIGNED_INT ):
- case( GL2.GL_INT ):
- case( GL2.GL_FLOAT ):
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL.GL_UNSIGNED_BYTE ):
+ case( GL.GL_BYTE ):
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL.GL_SHORT ):
+ case( GL.GL_UNSIGNED_INT ):
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_FLOAT ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
}
- } catch( OutOfMemoryError err ) {
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
- gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+ } catch( final OutOfMemoryError err ) {
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
return( GLU.GLU_OUT_OF_MEMORY );
}
@@ -1371,38 +1377,38 @@ public class BuildMipmap {
memReq = Mipmap.imageSize3D( nextWidth, nextHeight, nextDepth, format, type );
try {
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
- case( GL2.GL_BYTE ):
- case( GL2.GL_UNSIGNED_SHORT ):
- case( GL2.GL_SHORT ):
- case( GL2.GL_UNSIGNED_INT ):
- case( GL2.GL_INT ):
- case( GL2.GL_FLOAT ):
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL.GL_UNSIGNED_BYTE ):
+ case( GL.GL_BYTE ):
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL.GL_SHORT ):
+ case( GL.GL_UNSIGNED_INT ):
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_FLOAT ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
dstImage = Buffers.newDirectByteBuffer( memReq );
break;
default:
return( GLU.GLU_INVALID_ENUM );
}
- } catch( OutOfMemoryError err ) {
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
- gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+ } catch( final OutOfMemoryError err ) {
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
return( GLU.GLU_OUT_OF_MEMORY );
}
}
@@ -1410,7 +1416,7 @@ public class BuildMipmap {
level = userLevel;
}
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, GL.GL_FALSE );
if( baseLevel <= level && level <= maxLevel ) {
usersImage.position( mark );
gl.getGL2().glTexImage3D( target, level, internalFormat, width, height, depth,
@@ -1419,7 +1425,7 @@ public class BuildMipmap {
level++;
for( ; level <= levels; level++ ) {
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL.GL_UNSIGNED_BYTE ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractUByte(), width, height, depth,
usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1429,7 +1435,7 @@ public class BuildMipmap {
dstImage, elementSize, rowSize, groupSize );
}
break;
- case( GL2.GL_BYTE ):
+ case( GL.GL_BYTE ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractSByte(), width, height, depth,
usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1439,7 +1445,7 @@ public class BuildMipmap {
dstImage, elementSize, rowSize, groupSize );
}
break;
- case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL.GL_UNSIGNED_SHORT ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractUShort(), width, height, depth,
usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1449,7 +1455,7 @@ public class BuildMipmap {
dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
}
break;
- case( GL2.GL_SHORT ):
+ case( GL.GL_SHORT ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractSShort(), width, height, depth,
usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1459,7 +1465,7 @@ public class BuildMipmap {
dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
}
break;
- case( GL2.GL_UNSIGNED_INT ):
+ case( GL.GL_UNSIGNED_INT ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractUInt(), width, height, depth,
usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1469,7 +1475,7 @@ public class BuildMipmap {
dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
}
break;
- case( GL2.GL_INT ):
+ case( GL2ES2.GL_INT ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractSInt(), width, height, depth,
usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1479,7 +1485,7 @@ public class BuildMipmap {
dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
}
break;
- case( GL2.GL_FLOAT ):
+ case( GL.GL_FLOAT ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractFloat(), width, height, depth,
usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1489,51 +1495,51 @@ public class BuildMipmap {
dstImage.asFloatBuffer(), elementSize, rowSize, groupSize, myswapBytes );
}
break;
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
HalveImage.halveImagePackedPixel3D( 3, new Extract332(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
HalveImage.halveImagePackedPixel3D( 3, new Extract233rev(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
HalveImage.halveImagePackedPixel3D( 3, new Extract565(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
HalveImage.halveImagePackedPixel3D( 3, new Extract565rev(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
HalveImage.halveImagePackedPixel3D( 4, new Extract4444(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
HalveImage.halveImagePackedPixel3D( 4, new Extract4444rev(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
HalveImage.halveImagePackedPixel3D( 4, new Extract5551(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
HalveImage.halveImagePackedPixel3D( 4, new Extract1555rev(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
HalveImage.halveImagePackedPixel3D( 4, new Extract8888(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
HalveImage.halveImagePackedPixel3D( 4, new Extract8888rev(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
HalveImage.halveImagePackedPixel3D( 4, new Extract1010102(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
HalveImage.halveImagePackedPixel3D( 4, new Extract2101010rev(), width, height, depth, usersImage,
dstImage, elementSize, rowSize, imageSize, myswapBytes );
break;
@@ -1563,22 +1569,22 @@ public class BuildMipmap {
0, format, type, usersImage );
}
}
- gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
- gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
- gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
- gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
- gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+ gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+ gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
return( 0 );
}
private static final int TARGA_HEADER_SIZE = 18;
- private static void writeTargaFile(String filename, ByteBuffer data,
- int width, int height) {
+ private static void writeTargaFile(final String filename, final ByteBuffer data,
+ final int width, final int height) {
try {
- FileOutputStream fos = new FileOutputStream(new File(filename));
- ByteBuffer header = ByteBuffer.allocateDirect(TARGA_HEADER_SIZE);
+ final FileOutputStream fos = new FileOutputStream(new File(filename));
+ final ByteBuffer header = ByteBuffer.allocateDirect(TARGA_HEADER_SIZE);
header.put(0, (byte) 0).put(1, (byte) 0);
header.put(2, (byte) 2); // uncompressed type
header.put(12, (byte) (width & 0xFF)); // width
@@ -1590,7 +1596,7 @@ public class BuildMipmap {
fos.write(data.array());
data.clear();
fos.close();
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
index 0c155ff96..fe9c15e60 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
@@ -57,7 +57,7 @@ public class Extract1010102 implements Extract {
}
@Override
- public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
long uint = 0;
if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract1010102 implements Extract {
// 00000000,00000000,00001111,11111100 == 0x00000FFC
// 00000000,00000000,00000000,00000011 == 0x00000003
- extractComponents[0] = (float)( ( uint & 0xFFC00000 ) >> 22 ) / 1023.0f;
- extractComponents[1] = (float)( ( uint & 0x003FF000 ) >> 12 ) / 1023.0f;
- extractComponents[2] = (float)( ( uint & 0x00000FFC ) >> 2 ) / 1023.0f;
- extractComponents[3] = (float)( ( uint & 0x00000003 ) ) / 3.0f;
+ extractComponents[0] = ( ( uint & 0xFFC00000 ) >> 22 ) / 1023.0f;
+ extractComponents[1] = ( ( uint & 0x003FF000 ) >> 12 ) / 1023.0f;
+ extractComponents[2] = ( ( uint & 0x00000FFC ) >> 2 ) / 1023.0f;
+ extractComponents[3] = ( ( uint & 0x00000003 ) ) / 3.0f;
}
@Override
- public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
index 5208ea537..d619502be 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
@@ -57,7 +57,7 @@ public class Extract1555rev implements Extract {
}
@Override
- public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
int ushort = 0;
if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract1555rev implements Extract {
// 01111100,00000000 == 0x7C00
// 10000000,00000000 == 0x8000
- extractComponents[0] = (float)( ( ushort & 0x001F ) ) / 31.0f;
- extractComponents[1] = (float)( ( ushort & 0x003E ) >> 5 ) / 31.0f;
- extractComponents[2] = (float)( ( ushort & 0x7C00 ) >> 10) / 31.0f;
- extractComponents[3] = (float)( ( ushort & 0x8000 ) >> 15);
+ extractComponents[0] = ( ( ushort & 0x001F ) ) / 31.0f;
+ extractComponents[1] = ( ( ushort & 0x003E ) >> 5 ) / 31.0f;
+ extractComponents[2] = ( ( ushort & 0x7C00 ) >> 10) / 31.0f;
+ extractComponents[3] = ( ushort & 0x8000 ) >> 15;
}
@Override
- public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
// 00000000,00011111 == 0x001F
// 00000011,11100000 == 0x03E0
// 01111100,00000000 == 0x7C00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
index 1bf8abcc3..9d00badcb 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
@@ -57,7 +57,7 @@ public class Extract2101010rev implements Extract {
}
@Override
- public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
long uint = 0;
if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract2101010rev implements Extract {
// 00000000,00000000,00001111,11111100 == 0x00000FFC
// 00000000,00000000,00000000,00000011 == 0x00000003
- extractComponents[0] = (float)( ( uint & 0x000003FF ) ) / 1023.0f;
- extractComponents[1] = (float)( ( uint & 0x000FFC00 ) >> 10 ) / 1023.0f;
- extractComponents[2] = (float)( ( uint & 0x3FF00000 ) >> 20 ) / 1023.0f;
- extractComponents[3] = (float)( ( uint & 0xC0000000 ) >> 30 ) / 3.0f;
+ extractComponents[0] = ( ( uint & 0x000003FF ) ) / 1023.0f;
+ extractComponents[1] = ( ( uint & 0x000FFC00 ) >> 10 ) / 1023.0f;
+ extractComponents[2] = ( ( uint & 0x3FF00000 ) >> 20 ) / 1023.0f;
+ extractComponents[3] = ( ( uint & 0xC0000000 ) >> 30 ) / 3.0f;
}
@Override
- public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
index c86b39e63..3bc797518 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
@@ -57,18 +57,18 @@ public class Extract233rev implements Extract {
}
@Override
- public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
// 11100000 == 0xe0
// 00011100 == 0x1c
// 00000011 == 0x03
- byte ubyte = packedPixel.get();
- extractComponents[0] = (float)((ubyte & 0x07) ) / 7.0f;
- extractComponents[1] = (float)((ubyte & 0x38) >> 3) / 7.0f;
- extractComponents[2] = (float)((ubyte & 0xC0) >> 6) / 3.0f;
+ final byte ubyte = packedPixel.get();
+ extractComponents[0] = ((ubyte & 0x07) ) / 7.0f;
+ extractComponents[1] = ((ubyte & 0x38) >> 3) / 7.0f;
+ extractComponents[2] = ((ubyte & 0xC0) >> 6) / 3.0f;
}
@Override
- public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
// 11100000 == 0xE0
// 00011100 == 0x1C
// 00000011 == 0x03
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
index 706f0c3f2..93983f1d7 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
@@ -57,18 +57,18 @@ public class Extract332 implements Extract {
}
@Override
- public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
// 11100000 == 0xe0
// 00011100 == 0x1c
// 00000011 == 0x03
- byte ubyte = packedPixel.get();
- extractComponents[0] = (float)((ubyte & 0xe0) >> 5) / 7.0f;
- extractComponents[1] = (float)((ubyte & 0x1c) >> 2) / 7.0f;
- extractComponents[2] = (float)((ubyte & 0x03)) / 3.0f;
+ final byte ubyte = packedPixel.get();
+ extractComponents[0] = ((ubyte & 0xe0) >> 5) / 7.0f;
+ extractComponents[1] = ((ubyte & 0x1c) >> 2) / 7.0f;
+ extractComponents[2] = ((ubyte & 0x03)) / 3.0f;
}
@Override
- public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
// 11100000 == 0xE0
// 00011100 == 0x1C
// 00000011 == 0x03
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
index 182d66ce2..323ca7f1a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
@@ -57,7 +57,7 @@ public class Extract4444 implements Extract {
}
@Override
- public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
int ushort = 0;
if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract4444 implements Extract {
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
- extractComponents[0] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
- extractComponents[1] = (float)( ( ushort & 0x0F00 ) >> 8 ) / 15.0f;
- extractComponents[2] = (float)( ( ushort & 0x00F0 ) >> 4 ) / 15.0f;
- extractComponents[3] = (float)( ( ushort & 0x000F ) ) / 15.0f;
+ extractComponents[0] = ( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
+ extractComponents[1] = ( ( ushort & 0x0F00 ) >> 8 ) / 15.0f;
+ extractComponents[2] = ( ( ushort & 0x00F0 ) >> 4 ) / 15.0f;
+ extractComponents[3] = ( ( ushort & 0x000F ) ) / 15.0f;
}
@Override
- public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
index 52ecdc17c..267286519 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
@@ -57,7 +57,7 @@ public class Extract4444rev implements Extract {
}
@Override
- public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
int ushort = 0;
if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract4444rev implements Extract {
// 00001111,00000000 == 0x0F00
// 11110000,00000000 == 0xF000
- extractComponents[0] = (float)( ( ushort & 0x000F ) ) / 15.0f;
- extractComponents[1] = (float)( ( ushort & 0x00F0 ) >> 4 ) / 15.0f;
- extractComponents[2] = (float)( ( ushort & 0x0F00 ) >> 8 ) / 15.0f;
- extractComponents[3] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
+ extractComponents[0] = ( ( ushort & 0x000F ) ) / 15.0f;
+ extractComponents[1] = ( ( ushort & 0x00F0 ) >> 4 ) / 15.0f;
+ extractComponents[2] = ( ( ushort & 0x0F00 ) >> 8 ) / 15.0f;
+ extractComponents[3] = ( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
}
@Override
- public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
index 21f53aa1d..ee33ca7c1 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
@@ -57,7 +57,7 @@ public class Extract5551 implements Extract {
}
@Override
- public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
int ushort = 0;
if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract5551 implements Extract {
// 00000000,00111110 == 0x003E
// 00000000,00000001 == 0x0001
- extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
- extractComponents[1] = (float)( ( ushort & 0x00F0 ) >> 6 ) / 31.0f;
- extractComponents[2] = (float)( ( ushort & 0x0F00 ) >> 1 ) / 31.0f;
- extractComponents[3] = (float)( ( ushort & 0xF000 ) );
+ extractComponents[0] = ( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
+ extractComponents[1] = ( ( ushort & 0x00F0 ) >> 6 ) / 31.0f;
+ extractComponents[2] = ( ( ushort & 0x0F00 ) >> 1 ) / 31.0f;
+ extractComponents[3] = ( ( ushort & 0xF000 ) );
}
@Override
- public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
index 7408c45b2..d63943a2e 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
@@ -57,7 +57,7 @@ public class Extract565 implements Extract {
}
@Override
- public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
int ushort = 0;
if( isSwap ) {
@@ -70,13 +70,13 @@ public class Extract565 implements Extract {
// 00000111,11100000 == 0x07E0
// 00000000,00111111 == 0x001F
- extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
- extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
- extractComponents[2] = (float)( ( ushort & 0x001F ) ) / 31.0f;
+ extractComponents[0] = ( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
+ extractComponents[1] = ( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
+ extractComponents[2] = ( ( ushort & 0x001F ) ) / 31.0f;
}
@Override
- public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
// 11111000,00000000 == 0xF800
// 00000111,11100000 == 0x07E0
// 00000000,00111111 == 0x001F
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
index adaafa7ea..cfea71487 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
@@ -57,7 +57,7 @@ public class Extract565rev implements Extract {
}
@Override
- public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
int ushort = 0;
if( isSwap ) {
@@ -70,13 +70,13 @@ public class Extract565rev implements Extract {
// 00000111,11100000 == 0x07E0
// 11111000,00000000 == 0xF800
- extractComponents[0] = (float)( ( ushort & 0x001F ) ) / 31.0f;
- extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
- extractComponents[2] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
+ extractComponents[0] = ( ( ushort & 0x001F ) ) / 31.0f;
+ extractComponents[1] = ( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
+ extractComponents[2] = ( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
}
@Override
- public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
// 00000000,00111111 == 0x001F
// 00000111,11100000 == 0x07E0
// 11111000,00000000 == 0xF800
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
index be155d578..f6fe92c82 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
@@ -57,7 +57,7 @@ public class Extract8888 implements Extract {
}
@Override
- public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
long uint = 0;
if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract8888 implements Extract {
// 00000000,00111110 == 0x003E
// 00000000,00000001 == 0x0001
- extractComponents[0] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
- extractComponents[1] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
- extractComponents[2] = (float)( ( uint & 0x0000FF00 ) >> 8 ) / 255.0f;
- extractComponents[3] = (float)( ( uint & 0x000000FF ) ) / 255.0f;
+ extractComponents[0] = ( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
+ extractComponents[1] = ( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
+ extractComponents[2] = ( ( uint & 0x0000FF00 ) >> 8 ) / 255.0f;
+ extractComponents[3] = ( ( uint & 0x000000FF ) ) / 255.0f;
}
@Override
- public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
index 294e60e12..942f6d88a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
@@ -57,7 +57,7 @@ public class Extract8888rev implements Extract {
}
@Override
- public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
long uint = 0;
if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract8888rev implements Extract {
// 00000000,00111110 == 0x003E
// 00000000,00000001 == 0x0001
- extractComponents[0] = (float)( ( uint & 0x000000FF ) ) / 255.0f;
- extractComponents[1] = (float)( ( uint & 0x0000FF00 ) >> 8 ) / 255.0f;
- extractComponents[2] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
- extractComponents[3] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
+ extractComponents[0] = ( ( uint & 0x000000FF ) ) / 255.0f;
+ extractComponents[1] = ( ( uint & 0x0000FF00 ) >> 8 ) / 255.0f;
+ extractComponents[2] = ( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
+ extractComponents[3] = ( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
}
@Override
- public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
index 1dd8bff8a..09d70e492 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
@@ -57,7 +57,7 @@ public class ExtractFloat implements ExtractPrimitive {
}
@Override
- public double extract( boolean isSwap, ByteBuffer data ) {
+ public double extract( final boolean isSwap, final ByteBuffer data ) {
float f = 0;
if( isSwap ) {
f = Mipmap.GLU_SWAP_4_BYTES( data.getInt() );
@@ -69,7 +69,7 @@ public class ExtractFloat implements ExtractPrimitive {
}
@Override
- public void shove( double value, int index, ByteBuffer data ) {
+ public void shove( final double value, final int index, final ByteBuffer data ) {
assert(0.0 <= value && value < 1.0);
data.asFloatBuffer().put( index, (float)value );
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
index dcbe52a40..e9b021413 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
@@ -57,14 +57,14 @@ public class ExtractSByte implements ExtractPrimitive {
}
@Override
- public double extract( boolean isSwap, ByteBuffer sbyte ) {
- byte b = sbyte.get();
+ public double extract( final boolean isSwap, final ByteBuffer sbyte ) {
+ final byte b = sbyte.get();
assert( b <= 127 );
return( b );
}
@Override
- public void shove( double value, int index, ByteBuffer data ) {
+ public void shove( final double value, final int index, final ByteBuffer data ) {
data.position( index );
data.put( (byte)value );
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
index 547bd944a..9532fdade 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
@@ -57,7 +57,7 @@ public class ExtractSInt implements ExtractPrimitive {
}
@Override
- public double extract( boolean isSwap, ByteBuffer uint ) {
+ public double extract( final boolean isSwap, final ByteBuffer uint ) {
int i = 0;
if( isSwap ) {
i = Mipmap.GLU_SWAP_4_BYTES( uint.getInt() );
@@ -69,9 +69,9 @@ public class ExtractSInt implements ExtractPrimitive {
}
@Override
- public void shove( double value, int index, ByteBuffer data ) {
+ public void shove( final double value, final int index, final ByteBuffer data ) {
assert(0.0 <= value && value < Integer.MAX_VALUE);
- IntBuffer ib = data.asIntBuffer();
+ final IntBuffer ib = data.asIntBuffer();
ib.position( index );
ib.put( (int)value );
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
index 7dc172976..6e14f89c0 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
@@ -57,7 +57,7 @@ public class ExtractSShort implements ExtractPrimitive {
}
@Override
- public double extract( boolean isSwap, ByteBuffer ushort ) {
+ public double extract( final boolean isSwap, final ByteBuffer ushort ) {
short s = 0;
if( isSwap ) {
s = Mipmap.GLU_SWAP_2_BYTES( ushort.getShort() );
@@ -69,9 +69,9 @@ public class ExtractSShort implements ExtractPrimitive {
}
@Override
- public void shove( double value, int index, ByteBuffer data ) {
+ public void shove( final double value, final int index, final ByteBuffer data ) {
assert(0.0 <= value && value < 32768.0);
- ShortBuffer sb = data.asShortBuffer();
+ final ShortBuffer sb = data.asShortBuffer();
sb.position( index );
sb.put( (short)value );
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
index 3e933811c..d9db0019b 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
@@ -57,14 +57,14 @@ public class ExtractUByte implements ExtractPrimitive {
}
@Override
- public double extract( boolean isSwap, ByteBuffer ubyte ) {
- int i = 0x000000FF & ubyte.get();
+ public double extract( final boolean isSwap, final ByteBuffer ubyte ) {
+ final int i = 0x000000FF & ubyte.get();
assert( i <= 255 );
return( i );
}
@Override
- public void shove( double value, int index, ByteBuffer data ) {
+ public void shove( final double value, final int index, final ByteBuffer data ) {
assert(0.0 <= value && value < 256.0);
data.position( index );
data.put( (byte)value );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
index 1c34828b3..3e4ad41c2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
@@ -57,7 +57,7 @@ public class ExtractUInt implements ExtractPrimitive {
}
@Override
- public double extract( boolean isSwap, ByteBuffer uint ) {
+ public double extract( final boolean isSwap, final ByteBuffer uint ) {
long i = 0;
if( isSwap ) {
i = 0xFFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( uint.getInt() );
@@ -69,9 +69,9 @@ public class ExtractUInt implements ExtractPrimitive {
}
@Override
- public void shove( double value, int index, ByteBuffer data ) {
+ public void shove( final double value, final int index, final ByteBuffer data ) {
assert(0.0 <= value && value < 0xFFFFFFFF);
- IntBuffer ib = data.asIntBuffer();
+ final IntBuffer ib = data.asIntBuffer();
ib.position( index );
ib.put( (int)value );
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
index 8e0d25c42..b121c1054 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
@@ -57,7 +57,7 @@ public class ExtractUShort implements ExtractPrimitive {
}
@Override
- public double extract( boolean isSwap, ByteBuffer ushort ) {
+ public double extract( final boolean isSwap, final ByteBuffer ushort ) {
int i = 0;
if( isSwap ) {
i = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( ushort.getShort() );
@@ -69,9 +69,9 @@ public class ExtractUShort implements ExtractPrimitive {
}
@Override
- public void shove( double value, int index, ByteBuffer data ) {
+ public void shove( final double value, final int index, final ByteBuffer data ) {
assert(0.0 <= value && value < 65536.0);
- ShortBuffer sb = data.asShortBuffer();
+ final ShortBuffer sb = data.asShortBuffer();
sb.position( index );
sb.put( (short)value );
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
index 184c5fda8..100c6ba1f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
@@ -57,8 +57,8 @@ public class HalveImage {
private static final int BOX4 = 4;
private static final int BOX8 = 8;
- public static void halveImage( int components, int width, int height,
- ShortBuffer datain, ShortBuffer dataout ) {
+ public static void halveImage( final int components, final int width, final int height,
+ final ShortBuffer datain, final ShortBuffer dataout ) {
int i, j, k;
int newwidth, newheight;
int delta;
@@ -92,9 +92,9 @@ public class HalveImage {
}
}
- public static void halveImage_ubyte( int components, int width, int height,
- ByteBuffer datain, ByteBuffer dataout,
- int element_size, int ysize, int group_size ) {
+ public static void halveImage_ubyte( final int components, final int width, final int height,
+ final ByteBuffer datain, final ByteBuffer dataout,
+ final int element_size, final int ysize, final int group_size ) {
int i, j, k;
int newwidth, newheight;
int s;
@@ -134,9 +134,9 @@ public class HalveImage {
}
}
- public static void halve1Dimage_ubyte( int components, int width, int height,
- ByteBuffer datain, ByteBuffer dataout,
- int element_size, int ysize, int group_size ) {
+ public static void halve1Dimage_ubyte( final int components, final int width, final int height,
+ final ByteBuffer datain, final ByteBuffer dataout,
+ final int element_size, final int ysize, final int group_size ) {
int halfWidth = width / 2;
int halfHeight = height / 2;
int src = 0;
@@ -170,10 +170,10 @@ public class HalveImage {
}
src += group_size; // skip to next 2
}
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
src += padBytes; // for assertion only
} else if( width == 1 ) { // 1 column
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
assert( height != 1 );
halfWidth = 1;
// one vertical column with possible pad bytes per row
@@ -203,12 +203,12 @@ public class HalveImage {
assert( dest == components * element_size * halfWidth * halfHeight );
}
- public static void halveImage_byte( int components, int width, int height,
- ByteBuffer datain, ByteBuffer dataout, int element_size,
- int ysize, int group_size ) {
+ public static void halveImage_byte( final int components, final int width, final int height,
+ final ByteBuffer datain, final ByteBuffer dataout, final int element_size,
+ final int ysize, final int group_size ) {
int i, j, k;
int newwidth, newheight;
- int s = 0;
+ final int s = 0;
int t = 0;
byte temp = (byte)0;
@@ -245,9 +245,9 @@ public class HalveImage {
}
}
- public static void halve1Dimage_byte( int components, int width, int height,
- ByteBuffer datain, ByteBuffer dataout,
- int element_size, int ysize, int group_size ) {
+ public static void halve1Dimage_byte( final int components, final int width, final int height,
+ final ByteBuffer datain, final ByteBuffer dataout,
+ final int element_size, final int ysize, final int group_size ) {
int halfWidth = width / 2;
int halfHeight = width / 2;
int src = 0;
@@ -276,10 +276,10 @@ public class HalveImage {
}
src += group_size; // skip to next 2
}
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
src += padBytes; // for assert only
} else if( width == 1 ) { // 1 column
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
assert( height != 1 ); // widthxheight can't be 1
halfWidth = 1;
// one vertical column with possible pad bytes per row
@@ -304,12 +304,13 @@ public class HalveImage {
assert( dest == components * element_size * halfWidth * halfHeight );
}
- public static void halveImage_ushort( int components, int width, int height,
- ByteBuffer datain, ShortBuffer dataout, int element_size,
- int ysize, int group_size, boolean myswap_bytes ) {
- int i, j, k, l;
+ public static void halveImage_ushort( final int components, final int width, final int height,
+ final ByteBuffer datain, final ShortBuffer dataout, final int element_size,
+ final int ysize, final int group_size, final boolean myswap_bytes ) {
+ int i, j, k;
+ final int l;
int newwidth, newheight;
- int s = 0;
+ final int s = 0;
int t = 0;
int temp = 0;
// handle case where there is only 1 column/row
@@ -365,9 +366,9 @@ public class HalveImage {
}
}
- public static void halve1Dimage_ushort( int components, int width, int height,
- ByteBuffer datain, ShortBuffer dataout, int element_size,
- int ysize, int group_size, boolean myswap_bytes ) {
+ public static void halve1Dimage_ushort( final int components, final int width, final int height,
+ final ByteBuffer datain, final ShortBuffer dataout, final int element_size,
+ final int ysize, final int group_size, final boolean myswap_bytes ) {
int halfWidth = width / 2;
int halfHeight = height / 2;
int src = 0;
@@ -384,7 +385,7 @@ public class HalveImage {
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < halfHeight; kk++ ) {
- int[] ushort = new int[BOX2];
+ final int[] ushort = new int[BOX2];
if( myswap_bytes ) {
datain.position( src );
ushort[0] = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
@@ -402,10 +403,10 @@ public class HalveImage {
}
src += group_size; // skip to next 2
}
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
src += padBytes; // for assertion only
} else if( width == 1 ) { // 1 column
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
assert( height != 1 ); // widthxheight can't be 1
halfWidth = 1;
// one vertical column with possible pad bytes per row
@@ -414,7 +415,7 @@ public class HalveImage {
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
- int[] ushort = new int[BOX2];
+ final int[] ushort = new int[BOX2];
if( myswap_bytes ) {
datain.position( src );
ushort[0] = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
@@ -438,12 +439,13 @@ public class HalveImage {
assert( dest == components * element_size * halfWidth * halfHeight );
}
- public static void halveImage_short( int components, int width, int height,
- ByteBuffer datain, ShortBuffer dataout, int element_size,
- int ysize, int group_size, boolean myswap_bytes ) {
- int i, j, k, l;
+ public static void halveImage_short( final int components, final int width, final int height,
+ final ByteBuffer datain, final ShortBuffer dataout, final int element_size,
+ final int ysize, final int group_size, final boolean myswap_bytes ) {
+ int i, j, k;
+ final int l;
int newwidth, newheight;
- int s = 0;
+ final int s = 0;
int t = 0;
short temp = (short)0;
// handle case where there is only 1 column/row
@@ -472,7 +474,7 @@ public class HalveImage {
temp += datain.getShort();
temp += 2;
temp /= 4;
- dataout.put( (short)temp );
+ dataout.put( temp );
t += element_size;
}
t += group_size;
@@ -483,8 +485,8 @@ public class HalveImage {
for( i = 0; i < newheight; i++ ) {
for( j = 0; j < newwidth; j++ ) {
for( k = 0; k < components; k++ ) {
- short b;
- int buf;
+ final short b;
+ final int buf;
datain.position( t );
temp = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
datain.position( t + group_size );
@@ -505,9 +507,9 @@ public class HalveImage {
}
}
- public static void halve1Dimage_short( int components, int width, int height,
- ByteBuffer datain, ShortBuffer dataout, int element_size, int ysize,
- int group_size, boolean myswap_bytes ) {
+ public static void halve1Dimage_short( final int components, final int width, final int height,
+ final ByteBuffer datain, final ShortBuffer dataout, final int element_size, final int ysize,
+ final int group_size, final boolean myswap_bytes ) {
int halfWidth = width / 2;
int halfHeight = height / 2;
int src = 0;
@@ -524,7 +526,7 @@ public class HalveImage {
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
- short[] sshort = new short[BOX2];
+ final short[] sshort = new short[BOX2];
if( myswap_bytes ) {
datain.position( src );
sshort[0] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
@@ -542,10 +544,10 @@ public class HalveImage {
}
src += group_size; // skip to next 2
}
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
src += padBytes; // for assertion only
} else if( width == 1 ) {
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
assert( height != 1 );
halfWidth = 1;
// one vertical column with possible pad bytes per row
@@ -554,7 +556,7 @@ public class HalveImage {
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
- short[] sshort = new short[BOX2];
+ final short[] sshort = new short[BOX2];
if( myswap_bytes ) {
datain.position( src );
sshort[0] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
@@ -578,12 +580,13 @@ public class HalveImage {
assert( dest == ( components * element_size * halfWidth * halfHeight ) );
}
- public static void halveImage_uint( int components, int width, int height,
- ByteBuffer datain, IntBuffer dataout, int element_size,
- int ysize, int group_size, boolean myswap_bytes ) {
- int i, j, k, l;
+ public static void halveImage_uint( final int components, final int width, final int height,
+ final ByteBuffer datain, final IntBuffer dataout, final int element_size,
+ final int ysize, final int group_size, final boolean myswap_bytes ) {
+ int i, j, k;
+ final int l;
int newwidth, newheight;
- int s = 0;
+ final int s = 0;
int t = 0;
double temp = 0;
@@ -644,9 +647,9 @@ public class HalveImage {
}
}
- public static void halve1Dimage_uint( int components, int width, int height,
- ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
- int group_size, boolean myswap_bytes ) {
+ public static void halve1Dimage_uint( final int components, final int width, final int height,
+ final ByteBuffer datain, final IntBuffer dataout, final int element_size, final int ysize,
+ final int group_size, final boolean myswap_bytes ) {
int halfWidth = width / 2;
int halfHeight = height / 2;
int src = 0;
@@ -663,7 +666,7 @@ public class HalveImage {
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < halfHeight; kk++ ) {
- long[] uint = new long[BOX2];
+ final long[] uint = new long[BOX2];
if( myswap_bytes ) {
datain.position( src );
uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
@@ -681,10 +684,10 @@ public class HalveImage {
}
src += group_size; // skip to next 2
}
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
src += padBytes; // for assertion only
} else if( width == 1 ) { // 1 column
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
assert( height != 1 ); // widthxheight can't be 1
halfWidth = 1;
// one vertical column with possible pad bytes per row
@@ -693,7 +696,7 @@ public class HalveImage {
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
- long[] uint = new long[BOX2];
+ final long[] uint = new long[BOX2];
if( myswap_bytes ) {
datain.position( src );
uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
@@ -717,12 +720,13 @@ public class HalveImage {
assert( dest == components * element_size * halfWidth * halfHeight );
}
- public static void halveImage_int( int components, int width, int height,
- ByteBuffer datain, IntBuffer dataout, int element_size,
- int ysize, int group_size, boolean myswap_bytes ) {
- int i, j, k, l;
+ public static void halveImage_int( final int components, final int width, final int height,
+ final ByteBuffer datain, final IntBuffer dataout, final int element_size,
+ final int ysize, final int group_size, final boolean myswap_bytes ) {
+ int i, j, k;
+ final int l;
int newwidth, newheight;
- int s = 0;
+ final int s = 0;
int t = 0;
int temp = 0;
@@ -786,9 +790,9 @@ public class HalveImage {
}
}
- public static void halve1Dimage_int( int components, int width, int height,
- ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
- int group_size, boolean myswap_bytes ) {
+ public static void halve1Dimage_int( final int components, final int width, final int height,
+ final ByteBuffer datain, final IntBuffer dataout, final int element_size, final int ysize,
+ final int group_size, final boolean myswap_bytes ) {
int halfWidth = width / 2;
int halfHeight = height / 2;
int src = 0;
@@ -805,7 +809,7 @@ public class HalveImage {
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
- long[] uint = new long[BOX2];
+ final long[] uint = new long[BOX2];
if( myswap_bytes ) {
datain.position( src );
uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
@@ -823,10 +827,10 @@ public class HalveImage {
}
src += group_size; // skip to next 2
}
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
src += padBytes; // for assertion only
} else if( width == 1 ) {
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
assert( height != 1 );
halfWidth = 1;
// one vertical column with possible pad bytes per row
@@ -835,7 +839,7 @@ public class HalveImage {
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
- long[] uint = new long[BOX2];
+ final long[] uint = new long[BOX2];
if( myswap_bytes ) {
datain.position( src );
uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
@@ -859,12 +863,13 @@ public class HalveImage {
assert( dest == ( components * element_size * halfWidth * halfHeight ) );
}
- public static void halveImage_float( int components, int width, int height,
- ByteBuffer datain, FloatBuffer dataout, int element_size,
- int ysize, int group_size, boolean myswap_bytes ) {
- int i, j, k, l;
+ public static void halveImage_float( final int components, final int width, final int height,
+ final ByteBuffer datain, final FloatBuffer dataout, final int element_size,
+ final int ysize, final int group_size, final boolean myswap_bytes ) {
+ int i, j, k;
+ final int l;
int newwidth, newheight;
- int s = 0;
+ final int s = 0;
int t = 0;
float temp = 0.0f;
// handle case where there is only 1 column/row
@@ -921,9 +926,9 @@ public class HalveImage {
}
}
- public static void halve1Dimage_float( int components, int width, int height,
- ByteBuffer datain, FloatBuffer dataout, int element_size, int ysize,
- int group_size, boolean myswap_bytes ) {
+ public static void halve1Dimage_float( final int components, final int width, final int height,
+ final ByteBuffer datain, final FloatBuffer dataout, final int element_size, final int ysize,
+ final int group_size, final boolean myswap_bytes ) {
int halfWidth = width / 2;
int halfHeight = height / 2;
int src = 0;
@@ -940,7 +945,7 @@ public class HalveImage {
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
- float[] sfloat = new float[BOX2];
+ final float[] sfloat = new float[BOX2];
if( myswap_bytes ) {
datain.position( src );
sfloat[0] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
@@ -958,10 +963,10 @@ public class HalveImage {
}
src += group_size; // skip to next 2
}
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
src += padBytes; // for assertion only
} else if( width == 1 ) {
- int padBytes = ysize - ( width * group_size );
+ final int padBytes = ysize - ( width * group_size );
assert( height != 1 );
halfWidth = 1;
// one vertical column with possible pad bytes per row
@@ -970,7 +975,7 @@ public class HalveImage {
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
- float[] sfloat = new float[BOX2];
+ final float[] sfloat = new float[BOX2];
if( myswap_bytes ) {
datain.position( src );
sfloat[0] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
@@ -994,9 +999,9 @@ public class HalveImage {
assert( dest == ( components * element_size * halfWidth * halfHeight ) );
}
- public static void halveImagePackedPixel( int components, Extract extract, int width,
- int height, ByteBuffer datain, ByteBuffer dataout,
- int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
+ public static void halveImagePackedPixel( final int components, final Extract extract, final int width,
+ final int height, final ByteBuffer datain, final ByteBuffer dataout,
+ final int pixelSizeInBytes, final int rowSizeInBytes, final boolean isSwap ) {
if( width == 1 || height == 1 ) {
assert( !( width == 1 && height == 1 ) );
halve1DimagePackedPixel( components, extract, width, height, datain, dataout,
@@ -1005,16 +1010,16 @@ public class HalveImage {
}
int ii, jj;
- int halfWidth = width / 2;
- int halfHeight = height / 2;
+ final int halfWidth = width / 2;
+ final int halfHeight = height / 2;
int src = 0;
- int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+ final int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
int outIndex = 0;
for( ii = 0; ii < halfHeight; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
- float totals[] = new float[4];
- float extractTotals[][] = new float[BOX4][4];
+ final float totals[] = new float[4];
+ final float extractTotals[][] = new float[BOX4][4];
int cc;
datain.position( src );
@@ -1046,9 +1051,9 @@ public class HalveImage {
assert( outIndex == halfWidth * halfHeight );
}
- public static void halve1DimagePackedPixel( int components, Extract extract, int width,
- int height, ByteBuffer datain, ByteBuffer dataout,
- int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
+ public static void halve1DimagePackedPixel( final int components, final Extract extract, final int width,
+ final int height, final ByteBuffer datain, final ByteBuffer dataout,
+ final int pixelSizeInBytes, final int rowSizeInBytes, final boolean isSwap ) {
int halfWidth = width / 2;
int halfHeight = height / 2;
int src = 0;
@@ -1066,8 +1071,8 @@ public class HalveImage {
// one horizontal row with possible pad bytes
for( jj = 0; jj < halfWidth; jj++ ) {
- float[] totals = new float[4];
- float[][] extractTotals = new float[BOX2][4];
+ final float[] totals = new float[4];
+ final float[][] extractTotals = new float[BOX2][4];
int cc;
datain.position( src );
@@ -1088,7 +1093,7 @@ public class HalveImage {
// skip over to next group of 2
src += pixelSizeInBytes + pixelSizeInBytes;
}
- int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+ final int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
src += padBytes;
assert( src == rowSizeInBytes );
@@ -1102,8 +1107,8 @@ public class HalveImage {
// average two at a time
for( jj = 0; jj < halfHeight; jj++ ) {
- float[] totals = new float[4];
- float[][] extractTotals = new float[BOX2][4];
+ final float[] totals = new float[4];
+ final float[][] extractTotals = new float[BOX2][4];
int cc;
// average two at a time, instead of four
datain.position( src );
@@ -1129,16 +1134,16 @@ public class HalveImage {
}
}
- public static void halveImagePackedPixelSlice( int components, Extract extract,
- int width, int height, int depth, ByteBuffer dataIn,
- ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
- int imageSizeInBytes, boolean isSwap ) {
+ public static void halveImagePackedPixelSlice( final int components, final Extract extract,
+ final int width, final int height, final int depth, final ByteBuffer dataIn,
+ final ByteBuffer dataOut, final int pixelSizeInBytes, final int rowSizeInBytes,
+ final int imageSizeInBytes, final boolean isSwap ) {
int ii, jj;
- int halfWidth = width / 2;
- int halfHeight = height / 2;
- int halfDepth = depth / 2;
+ final int halfWidth = width / 2;
+ final int halfHeight = height / 2;
+ final int halfDepth = depth / 2;
int src = 0;
- int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+ final int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
int outIndex = 0;
assert( (width == 1 || height == 1) && depth >= 2 );
@@ -1148,8 +1153,8 @@ public class HalveImage {
assert( depth >= 2 );
for( ii = 0; ii < halfDepth; ii++ ) {
- float totals[] = new float[4];
- float extractTotals[][] = new float[BOX2][4];
+ final float totals[] = new float[4];
+ final float extractTotals[][] = new float[BOX2][4];
int cc;
dataIn.position( src );
@@ -1178,8 +1183,8 @@ public class HalveImage {
for( ii = 0; ii < halfDepth; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
- float totals[] = new float[4];
- float extractTotals[][] = new float[BOX4][4];
+ final float totals[] = new float[4];
+ final float extractTotals[][] = new float[BOX4][4];
int cc;
dataIn.position( src );
@@ -1199,7 +1204,7 @@ public class HalveImage {
for( kk = 0; kk < BOX4; kk++ ) {
totals[cc]+= extractTotals[kk][cc];
}
- totals[cc]/= (float)BOX4;
+ totals[cc]/= BOX4;
}
extract.shove( totals, outIndex, dataOut );
outIndex++;
@@ -1212,8 +1217,8 @@ public class HalveImage {
for( ii = 0; ii < halfDepth; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
- float totals[] = new float[4];
- float extractTotals[][] = new float[BOX4][4];
+ final float totals[] = new float[4];
+ final float extractTotals[][] = new float[BOX4][4];
int cc;
dataIn.position( src );
@@ -1233,7 +1238,7 @@ public class HalveImage {
for( kk = 0; kk < BOX4; kk++ ) {
totals[cc]+= extractTotals[kk][cc];
}
- totals[cc]/= (float)BOX4;
+ totals[cc]/= BOX4;
}
extract.shove( totals, outIndex, dataOut );
outIndex++;
@@ -1244,16 +1249,16 @@ public class HalveImage {
}
}
- public static void halveImageSlice( int components, ExtractPrimitive extract, int width,
- int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
- int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
- int imageSizeInBytes, boolean isSwap ) {
+ public static void halveImageSlice( final int components, final ExtractPrimitive extract, final int width,
+ final int height, final int depth, final ByteBuffer dataIn, final ByteBuffer dataOut,
+ final int elementSizeInBytes, final int groupSizeInBytes, final int rowSizeInBytes,
+ final int imageSizeInBytes, final boolean isSwap ) {
int ii, jj;
- int halfWidth = width / 2;
- int halfHeight = height / 2;
- int halfDepth = depth / 2;
+ final int halfWidth = width / 2;
+ final int halfHeight = height / 2;
+ final int halfDepth = depth / 2;
int src = 0;
- int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
+ final int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
int outIndex = 0;
assert( (width == 1 || height == 1) && depth >= 2 );
@@ -1265,8 +1270,8 @@ public class HalveImage {
for( ii = 0; ii < halfDepth; ii++ ) {
int cc;
for( cc = 0; cc < components; cc++ ) {
- double[] totals = new double[4];
- double[][] extractTotals = new double[BOX2][4];
+ final double[] totals = new double[4];
+ final double[][] extractTotals = new double[BOX2][4];
int kk;
dataIn.position( src );
@@ -1281,7 +1286,7 @@ public class HalveImage {
for( kk = 0; kk < BOX2; kk++ ) {
totals[cc] += extractTotals[kk][cc];
}
- totals[cc] /= (double)BOX2;
+ totals[cc] /= BOX2;
extract.shove( totals[cc], outIndex, dataOut );
outIndex++;
@@ -1301,8 +1306,8 @@ public class HalveImage {
int cc;
for( cc = 0; cc < components; cc++ ) {
int kk;
- double totals[] = new double[4];
- double extractTotals[][] = new double[BOX4][4];
+ final double totals[] = new double[4];
+ final double extractTotals[][] = new double[BOX4][4];
dataIn.position( src );
extractTotals[0][cc] = extract.extract( isSwap, dataIn );
@@ -1321,7 +1326,7 @@ public class HalveImage {
for( kk = 0; kk < BOX4; kk++ ) {
totals[cc] += extractTotals[kk][cc];
}
- totals[cc] /= (double)BOX4;
+ totals[cc] /= BOX4;
extract.shove( totals[cc], outIndex, dataOut );
outIndex++;
@@ -1343,8 +1348,8 @@ public class HalveImage {
int cc;
for( cc = 0; cc < components; cc++ ) {
int kk;
- double totals[] = new double[4];
- double extractTotals[][] = new double[BOX4][4];
+ final double totals[] = new double[4];
+ final double extractTotals[][] = new double[BOX4][4];
dataIn.position( src );
extractTotals[0][cc] = extract.extract( isSwap, dataIn );
@@ -1364,7 +1369,7 @@ public class HalveImage {
for( kk = 0; kk < BOX4; kk++ ) {
totals[cc] += extractTotals[kk][cc];
}
- totals[cc] /= (double)BOX4;
+ totals[cc] /= BOX4;
extract.shove( totals[cc], outIndex, dataOut );
outIndex++;
@@ -1381,10 +1386,10 @@ public class HalveImage {
}
}
- public static void halveImage3D( int components, ExtractPrimitive extract,
- int width, int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
- int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
- int imageSizeInBytes, boolean isSwap ) {
+ public static void halveImage3D( final int components, final ExtractPrimitive extract,
+ final int width, final int height, final int depth, final ByteBuffer dataIn, final ByteBuffer dataOut,
+ final int elementSizeInBytes, final int groupSizeInBytes, final int rowSizeInBytes,
+ final int imageSizeInBytes, final boolean isSwap ) {
assert( depth > 1 );
// horizontal/vertical/onecolumn slice viewed from top
@@ -1399,11 +1404,11 @@ public class HalveImage {
int ii, jj, dd;
- int halfWidth = width / 2;
- int halfHeight = height / 2;
- int halfDepth = depth / 2;
+ final int halfWidth = width / 2;
+ final int halfHeight = height / 2;
+ final int halfDepth = depth / 2;
int src = 0;
- int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
+ final int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
int outIndex = 0;
for( dd = 0; dd < halfDepth; dd++ ) {
@@ -1412,8 +1417,8 @@ public class HalveImage {
int cc;
for( cc = 0; cc < components; cc++ ) {
int kk;
- double totals[] = new double[4];
- double extractTotals[][] = new double[BOX8][4];
+ final double totals[] = new double[4];
+ final double extractTotals[][] = new double[BOX8][4];
dataIn.position( src );
extractTotals[0][cc] = extract.extract( isSwap, dataIn );
@@ -1437,7 +1442,7 @@ public class HalveImage {
for( kk = 0; kk < BOX8; kk++ ) {
totals[cc] += extractTotals[kk][cc];
}
- totals[cc] /= (double)BOX8;
+ totals[cc] /= BOX8;
extract.shove( totals[cc], outIndex, dataOut );
outIndex++;
@@ -1457,10 +1462,10 @@ public class HalveImage {
assert( outIndex == halfWidth * halfHeight * halfDepth * components );
}
- public static void halveImagePackedPixel3D( int components, Extract extract,
- int width, int height, int depth, ByteBuffer dataIn,
- ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
- int imageSizeInBytes, boolean isSwap ) {
+ public static void halveImagePackedPixel3D( final int components, final Extract extract,
+ final int width, final int height, final int depth, final ByteBuffer dataIn,
+ final ByteBuffer dataOut, final int pixelSizeInBytes, final int rowSizeInBytes,
+ final int imageSizeInBytes, final boolean isSwap ) {
if( depth == 1 ) {
assert( 1 <= width && 1 <= height );
@@ -1476,18 +1481,18 @@ public class HalveImage {
}
int ii, jj, dd;
- int halfWidth = width / 2;
- int halfHeight = height / 2;
- int halfDepth = depth / 2;
+ final int halfWidth = width / 2;
+ final int halfHeight = height / 2;
+ final int halfDepth = depth / 2;
int src = 0;
- int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+ final int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
int outIndex = 0;
for( dd = 0; dd < halfDepth; dd++ ) {
for( ii = 0; ii < halfHeight; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
- float totals[] = new float[4]; // 4 is max components
- float extractTotals[][] = new float[BOX8][4];
+ final float totals[] = new float[4]; // 4 is max components
+ final float extractTotals[][] = new float[BOX8][4];
int cc;
dataIn.position( src );
@@ -1514,7 +1519,7 @@ public class HalveImage {
for( kk = 0; kk < BOX8; kk++ ) {
totals[cc] += extractTotals[kk][cc];
}
- totals[cc] /= (float)BOX8;
+ totals[cc] /= BOX8;
}
extract.shove( totals, outIndex, dataOut );
outIndex++;
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
index 18f814dde..ef77f3555 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
@@ -46,6 +46,9 @@ package jogamp.opengl.glu.mipmap;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL2GL3;
+
import java.nio.*;
/**
@@ -58,14 +61,14 @@ public class Image {
public Image() {
}
- public static short getShortFromByteArray( byte[] array, int index ) {
+ public static short getShortFromByteArray( final byte[] array, final int index ) {
short s;
s = (short)(array[index] << 8 );
s |= (short)(0x00FF & array[index+1]);
return( s );
}
- public static int getIntFromByteArray( byte[] array, int index ) {
+ public static int getIntFromByteArray( final byte[] array, final int index ) {
int i;
i = ( array[index] << 24 ) & 0xFF000000;
i |= ( array[index+1] << 16 ) & 0x00FF0000;
@@ -74,8 +77,8 @@ public class Image {
return( i );
}
- public static float getFloatFromByteArray( byte[] array, int index ) {
- int i = getIntFromByteArray( array, index );
+ public static float getFloatFromByteArray( final byte[] array, final int index ) {
+ final int i = getIntFromByteArray( array, index );
return( Float.intBitsToFloat(i) );
}
@@ -83,9 +86,9 @@ public class Image {
* Extract array from user's data applying all pixel store modes.
* The internal format used is an array of unsigned shorts.
*/
- public static void fill_image( PixelStorageModes psm, int width, int height,
- int format, int type, boolean index_format, ByteBuffer userdata,
- ShortBuffer newimage ) {
+ public static void fill_image( final PixelStorageModes psm, final int width, final int height,
+ final int format, final int type, final boolean index_format, final ByteBuffer userdata,
+ final ShortBuffer newimage ) {
int components;
int element_size;
int rowsize;
@@ -102,40 +105,40 @@ public class Image {
// Create a Extract interface object
Extract extract = null;
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
extract = new Extract332();
break;
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
extract = new Extract233rev();
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
extract = new Extract565();
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
extract = new Extract565rev();
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
extract = new Extract4444();
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
extract = new Extract4444rev();
break;
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
extract = new Extract5551();
break;
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
extract = new Extract1555rev();
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
extract = new Extract8888();
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
extract = new Extract8888rev();
break;
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
extract = new Extract1010102();
break;
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
extract = new Extract2101010rev();
break;
}
@@ -214,74 +217,74 @@ public class Image {
iter = start;
userdata.position( iter ); //***************************************
for( j = 0; j < elements_per_line; j++ ) {
- Type_Widget widget = new Type_Widget();
- float[] extractComponents = new float[4];
+ final Type_Widget widget = new Type_Widget();
+ final float[] extractComponents = new float[4];
userdata.position( iter );
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
extract.extract( false, userdata /*userdata[iter]*/, extractComponents );
for( k = 0; k < 3; k++ ) {
newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
extract.extract( false, userdata /*userdata[iter]*/, extractComponents );
for( k = 0; k < 3; k++ ) {
newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL.GL_UNSIGNED_BYTE ):
if( index_format ) {
newimage.put( iter2++, (short)( 0x000000FF & userdata.get() ) );//userdata[iter];
} else {
newimage.put( iter2++, (short)( 0x000000FF & userdata.get()/*userdata[iter]*/ * 257 ) );
}
break;
- case( GL2.GL_BYTE ):
+ case( GL.GL_BYTE ):
if( index_format ) {
newimage.put( iter2++, userdata.get() ); //userdata[iter];
} else {
newimage.put( iter2++, (short)(userdata.get()/*userdata[iter]*/ * 516 ) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
extract.extract( myswap_bytes, userdata/*userdata[iter]*/, extractComponents );
for( k = 0; k < 3; k++ ) {
newimage.put( iter2++, (short)(extractComponents[k] * 65535) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
extract.extract( myswap_bytes, userdata, extractComponents );
for( k = 0; k < 3; k++ ) {
newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
extract.extract( myswap_bytes, userdata, extractComponents );
for( k = 0; k < 4; k++ ) {
newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
extract.extract( myswap_bytes, userdata, extractComponents );
for( k = 0; k < 4; k++ ) {
newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
extract.extract( myswap_bytes, userdata, extractComponents );
for( k = 0; k < 4; k++ ) {
newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
extract.extract( myswap_bytes, userdata, extractComponents );
for( k = 0; k < 4; k++ ) {
newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT ):
- case( GL2.GL_SHORT ):
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL.GL_SHORT ):
if( myswap_bytes ) {
widget.setUB1( userdata.get() );
widget.setUB0( userdata.get() );
@@ -289,7 +292,7 @@ public class Image {
widget.setUB0( userdata.get() );
widget.setUB1( userdata.get() );
}
- if( type == GL2.GL_SHORT ) {
+ if( type == GL.GL_SHORT ) {
if( index_format ) {
newimage.put( iter2++, widget.getS0() );
} else {
@@ -299,33 +302,33 @@ public class Image {
newimage.put( iter2++, widget.getUS0() );
}
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
extract.extract( myswap_bytes, userdata, extractComponents );
for( k = 0; k < 4; k++ ) {
newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
extract.extract( myswap_bytes, userdata, extractComponents );
for( k = 0; k < 4; k++ ) {
newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
extract.extract( myswap_bytes, userdata, extractComponents );
for( k = 0; k < 4; k++ ) {
newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
extract.extract( myswap_bytes, userdata, extractComponents );
for( k = 0; k < 4; k++ ) {
newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_INT ):
- case( GL2.GL_UNSIGNED_INT ):
- case( GL2.GL_FLOAT ):
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_UNSIGNED_INT ):
+ case( GL.GL_FLOAT ):
if( myswap_bytes ) {
widget.setUB3( userdata.get() );
widget.setUB2( userdata.get() );
@@ -337,13 +340,13 @@ public class Image {
widget.setUB2( userdata.get() );
widget.setUB3( userdata.get() );
}
- if( type == GL2.GL_FLOAT ) {
+ if( type == GL.GL_FLOAT ) {
if( index_format ) {
newimage.put( iter2++, (short)widget.getF() );
} else {
newimage.put( iter2++, (short)(widget.getF() * 65535 ) );
}
- } else if( type == GL2.GL_UNSIGNED_INT ) {
+ } else if( type == GL.GL_UNSIGNED_INT ) {
if( index_format ) {
newimage.put( iter2++, (short)( widget.getUI() ) );
} else {
@@ -380,9 +383,9 @@ public class Image {
* Theinternal format is an array of unsigned shorts.
* empty_image() because it is the opposet of fill_image().
*/
- public static void empty_image( PixelStorageModes psm, int width, int height,
- int format, int type, boolean index_format,
- ShortBuffer oldimage, ByteBuffer userdata ) {
+ public static void empty_image( final PixelStorageModes psm, final int width, final int height,
+ final int format, final int type, final boolean index_format,
+ final ShortBuffer oldimage, final ByteBuffer userdata ) {
int components;
int element_size;
@@ -400,40 +403,40 @@ public class Image {
// Create a Extract interface object
Extract extract = null;
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
extract = new Extract332();
break;
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
extract = new Extract233rev();
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
extract = new Extract565();
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
extract = new Extract565rev();
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
extract = new Extract4444();
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
extract = new Extract4444rev();
break;
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
extract = new Extract5551();
break;
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
extract = new Extract1555rev();
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
extract = new Extract8888();
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
extract = new Extract8888rev();
break;
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
extract = new Extract1010102();
break;
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
extract = new Extract2101010rev();
break;
}
@@ -499,7 +502,7 @@ public class Image {
start += rowsize;
}
} else {
- float shoveComponents[] = new float[4];
+ final float shoveComponents[] = new float[4];
element_size = Mipmap.bytes_per_element( type );
group_size = element_size * components;
@@ -519,22 +522,22 @@ public class Image {
for( i = 0; i < height; i++ ) {
iter = start;
for( j = 0; j < elements_per_line; j++ ) {
- Type_Widget widget = new Type_Widget();
+ final Type_Widget widget = new Type_Widget();
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
for( k = 0; k < 3; k++ ) {
shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
}
extract.shove( shoveComponents, 0, userdata );
break;
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
for( k = 0; k < 3; k++ ) {
shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
}
extract.shove( shoveComponents, 0, userdata );
break;
- case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL.GL_UNSIGNED_BYTE ):
if( index_format ) {
//userdata[iter] = (byte)oldimage[iter2++];
userdata.put( iter, (byte)oldimage.get(iter2++) );
@@ -543,7 +546,7 @@ public class Image {
userdata.put( iter, (byte)( oldimage.get(iter2++) ) );
}
break;
- case( GL2.GL_BYTE ):
+ case( GL.GL_BYTE ):
if( index_format ) {
//userdata[iter] = (byte)oldimage[iter2++];
userdata.put( iter, (byte)oldimage.get(iter2++) );
@@ -552,7 +555,7 @@ public class Image {
userdata.put( iter, (byte)( oldimage.get(iter2++) ) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
for( k = 0; k < 3; k++ ) {
shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
}
@@ -569,7 +572,7 @@ public class Image {
userdata.put( iter + 1, widget.getUB1() );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
for( k = 0; k < 3; k++ ) {
shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
}
@@ -586,7 +589,7 @@ public class Image {
userdata.put( iter, widget.getUB1() );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
}
@@ -603,7 +606,7 @@ public class Image {
userdata.put( iter + 1, widget.getUB1() );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
}
@@ -620,7 +623,7 @@ public class Image {
userdata.put( iter + 1, widget.getUB1() );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
}
@@ -637,7 +640,7 @@ public class Image {
userdata.put( iter + 1, widget.getUB1() );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
}
@@ -654,9 +657,9 @@ public class Image {
userdata.put( iter + 1, widget.getUB1() );
}
break;
- case( GL2.GL_UNSIGNED_SHORT ):
- case( GL2.GL_SHORT ):
- if( type == GL2.GL_SHORT ) {
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL.GL_SHORT ):
+ if( type == GL.GL_SHORT ) {
if( index_format ) {
widget.setS0( oldimage.get( iter2++ ) );
} else {
@@ -677,7 +680,7 @@ public class Image {
userdata.put( iter + 1, widget.getUB1() );
}
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
}
@@ -695,7 +698,7 @@ public class Image {
userdata.putInt( iter, widget.getUI() );
}
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
}
@@ -713,7 +716,7 @@ public class Image {
userdata.putInt( iter, widget.getUI() );
}
break;
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
}
@@ -731,7 +734,7 @@ public class Image {
userdata.putInt( iter, widget.getUI() );
}
break;
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
}
@@ -749,16 +752,16 @@ public class Image {
userdata.putInt( iter, widget.getUI() );
}
break;
- case( GL2.GL_INT ):
- case( GL2.GL_UNSIGNED_INT ):
- case( GL2.GL_FLOAT ):
- if( type == GL2.GL_FLOAT ) {
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_UNSIGNED_INT ):
+ case( GL.GL_FLOAT ):
+ if( type == GL.GL_FLOAT ) {
if( index_format ) {
widget.setF( oldimage.get( iter2++ ) );
} else {
widget.setF( oldimage.get( iter2++ ) / 65535.0f );
}
- } else if( type == GL2.GL_UNSIGNED_INT ) {
+ } else if( type == GL.GL_UNSIGNED_INT ) {
if( index_format ) {
widget.setUI( oldimage.get( iter2++ ) );
} else {
@@ -800,9 +803,9 @@ public class Image {
}
}
- public static void fillImage3D( PixelStorageModes psm, int width, int height,
- int depth, int format, int type, boolean indexFormat, ByteBuffer userImage,
- ShortBuffer newImage ) {
+ public static void fillImage3D( final PixelStorageModes psm, final int width, final int height,
+ final int depth, final int format, final int type, final boolean indexFormat, final ByteBuffer userImage,
+ final ShortBuffer newImage ) {
boolean myswapBytes;
int components;
int groupsPerLine;
@@ -817,46 +820,46 @@ public class Image {
int iter = 0;
int iter2 = 0;
int ww, hh, dd, k;
- Type_Widget widget = new Type_Widget();
- float extractComponents[] = new float[4];
+ final Type_Widget widget = new Type_Widget();
+ final float extractComponents[] = new float[4];
// Create a Extract interface object
Extract extract = null;
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
extract = new Extract332();
break;
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
extract = new Extract233rev();
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
extract = new Extract565();
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
extract = new Extract565rev();
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
extract = new Extract4444();
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
extract = new Extract4444rev();
break;
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
extract = new Extract5551();
break;
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
extract = new Extract1555rev();
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
extract = new Extract8888();
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
extract = new Extract8888rev();
break;
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
extract = new Extract1010102();
break;
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
extract = new Extract2101010rev();
break;
}
@@ -903,78 +906,78 @@ public class Image {
for( ww = 0; ww < elementsPerLine; ww++ ) {
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL.GL_UNSIGNED_BYTE ):
if( indexFormat ) {
newImage.put( iter2++, (short)(0x000000FF & userImage.get( iter ) ) );
} else {
newImage.put( iter2++, (short)((0x000000FF & userImage.get( iter ) ) * 257 ) );
}
break;
- case( GL2.GL_BYTE ):
+ case( GL.GL_BYTE ):
if( indexFormat ) {
newImage.put( iter2++, userImage.get( iter ) );
} else {
newImage.put( iter2++, (short)(userImage.get( iter ) * 516 ) );
}
break;
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
userImage.position( iter );
extract.extract( false, userImage, extractComponents );
for( k = 0; k < 3; k++ ) {
newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
}
break;
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
userImage.position( iter );
extract.extract( false, userImage, extractComponents );
for( k = 0; k < 3; k++ ) {
newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
userImage.position( iter );
extract.extract( myswapBytes, userImage, extractComponents );
for( k = 0; k < 4; k++ ) {
newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
userImage.position( iter );
extract.extract( myswapBytes, userImage, extractComponents );
for( k = 0; k < 4; k++ ) {
newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
userImage.position( iter );
extract.extract( myswapBytes, userImage, extractComponents );
for( k = 0; k < 4; k++ ) {
newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
userImage.position( iter );
extract.extract( myswapBytes, userImage, extractComponents );
for( k = 0; k < 4; k++ ) {
newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
userImage.position( iter );
extract.extract( myswapBytes, userImage, extractComponents );
for( k = 0; k < 4; k++ ) {
newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
userImage.position( iter );
extract.extract( myswapBytes, userImage, extractComponents );
for( k = 0; k < 4; k++ ) {
newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
}
break;
- case( GL2.GL_UNSIGNED_SHORT ):
- case( GL2.GL_SHORT ):
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL.GL_SHORT ):
if( myswapBytes ) {
widget.setUB0( userImage.get( iter + 1 ) );
widget.setUB1( userImage.get( iter ) );
@@ -982,7 +985,7 @@ public class Image {
widget.setUB0( userImage.get( iter ) );
widget.setUB1( userImage.get( iter + 1 ) );
}
- if( type == GL2.GL_SHORT ) {
+ if( type == GL.GL_SHORT ) {
if( indexFormat ) {
newImage.put( iter2++, widget.getUS0() );
} else {
@@ -992,36 +995,36 @@ public class Image {
newImage.put( iter2++, widget.getUS0() );
}
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
userImage.position( iter );
extract.extract( myswapBytes, userImage, extractComponents );
for( k = 0; k < 4; k++ ) {
newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
userImage.position( iter );
extract.extract( myswapBytes, userImage, extractComponents );
for( k = 0; k < 4; k++ ) {
newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
userImage.position( iter );
extract.extract( myswapBytes, userImage, extractComponents );
for( k = 0; k < 4; k++ ) {
newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
extract.extract( myswapBytes, userImage, extractComponents );
for( k = 0; k < 4; k++ ) {
newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
}
break;
- case( GL2.GL_INT ):
- case( GL2.GL_UNSIGNED_INT ):
- case( GL2.GL_FLOAT ):
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_UNSIGNED_INT ):
+ case( GL.GL_FLOAT ):
if( myswapBytes ) {
widget.setUB0( userImage.get( iter + 3 ) );
widget.setUB1( userImage.get( iter + 2 ) );
@@ -1033,13 +1036,13 @@ public class Image {
widget.setUB2( userImage.get( iter + 2 ) );
widget.setUB3( userImage.get( iter + 3 ) );
}
- if( type == GL2.GL_FLOAT ) {
+ if( type == GL.GL_FLOAT ) {
if( indexFormat ) {
newImage.put( iter2++, (short)widget.getF() );
} else {
newImage.put( iter2++, (short)( widget.getF() * 65535.0f ) );
}
- } else if( type == GL2.GL_UNSIGNED_INT ) {
+ } else if( type == GL.GL_UNSIGNED_INT ) {
if( indexFormat ) {
newImage.put( iter2++, (short)widget.getUI() );
} else {
@@ -1075,8 +1078,8 @@ public class Image {
psm.getUnpackSkipImages() * imageSize );
}
- public static void emptyImage3D( PixelStorageModes psm, int width, int height, int depth,
- int format, int type, boolean indexFormat, ShortBuffer oldImage, ByteBuffer userImage ) {
+ public static void emptyImage3D( final PixelStorageModes psm, final int width, final int height, final int depth,
+ final int format, final int type, final boolean indexFormat, final ShortBuffer oldImage, final ByteBuffer userImage ) {
boolean myswapBytes;
int components;
int groupsPerLine;
@@ -1090,46 +1093,46 @@ public class Image {
int ii, jj, dd, k;
int rowsPerImage;
int imageSize;
- Type_Widget widget = new Type_Widget();
- float[] shoveComponents = new float[4];
+ final Type_Widget widget = new Type_Widget();
+ final float[] shoveComponents = new float[4];
// Create a Extract interface object
Extract extract = null;
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
extract = new Extract332();
break;
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
extract = new Extract233rev();
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
extract = new Extract565();
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
extract = new Extract565rev();
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
extract = new Extract4444();
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
extract = new Extract4444rev();
break;
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
extract = new Extract5551();
break;
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
extract = new Extract1555rev();
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
extract = new Extract8888();
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
extract = new Extract8888rev();
break;
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
extract = new Extract1010102();
break;
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
extract = new Extract2101010rev();
break;
}
@@ -1182,33 +1185,33 @@ public class Image {
for( jj = 0; jj < elementsPerLine; jj++ ) {
switch( type ) {
- case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL.GL_UNSIGNED_BYTE ):
if( indexFormat ) {
userImage.put( iter, (byte)(oldImage.get( iter2++ ) ) );
} else {
userImage.put( iter, (byte)(oldImage.get( iter2++ ) >> 8 ) );
}
break;
- case( GL2.GL_BYTE ):
+ case( GL.GL_BYTE ):
if( indexFormat ) {
userImage.put( iter, (byte)(oldImage.get(iter2++) ) );
} else {
userImage.put( iter, (byte)(oldImage.get(iter2++) >> 9) );
}
break;
- case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
for( k = 0; k < 3; k++ ) {
shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
}
extract.shove( shoveComponents, 0, userImage );
break;
- case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
for( k = 0; k < 3; k++ ) {
shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
}
extract.shove( shoveComponents, 0, userImage );
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
}
@@ -1220,7 +1223,7 @@ public class Image {
userImage.putShort( iter, widget.getUS0() );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
}
@@ -1232,7 +1235,7 @@ public class Image {
userImage.putShort( iter, widget.getUS0() );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
}
@@ -1244,7 +1247,7 @@ public class Image {
userImage.putShort( iter, widget.getUS0() );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
}
@@ -1256,7 +1259,7 @@ public class Image {
userImage.putShort( iter, widget.getUS0() );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
}
@@ -1268,7 +1271,7 @@ public class Image {
userImage.putShort( iter, widget.getUS0() );
}
break;
- case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
}
@@ -1280,16 +1283,16 @@ public class Image {
userImage.putShort( iter, widget.getUS0() );
}
break;
- case( GL2.GL_UNSIGNED_SHORT ):
- case( GL2.GL_SHORT ):
- if( type == GL2.GL_SHORT ) {
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL.GL_SHORT ):
+ if( type == GL.GL_SHORT ) {
if( indexFormat ) {
- widget.setS0( (short)oldImage.get( iter2++ ) );
+ widget.setS0( oldImage.get( iter2++ ) );
} else {
widget.setS0( (short)(oldImage.get( iter2++ ) >> 1) );
}
} else {
- widget.setUS0( (short)oldImage.get( iter2++ ) );
+ widget.setUS0( oldImage.get( iter2++ ) );
}
if( myswapBytes ) {
userImage.put( iter, widget.getUB1() );
@@ -1299,7 +1302,7 @@ public class Image {
userImage.put( iter + 1, widget.getUB1() );
}
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
}
@@ -1313,7 +1316,7 @@ public class Image {
userImage.putInt( iter, widget.getUI() );
}
break;
- case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
}
@@ -1327,7 +1330,7 @@ public class Image {
userImage.putInt( iter, widget.getUI() );
}
break;
- case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
}
@@ -1341,7 +1344,7 @@ public class Image {
userImage.putInt( iter, widget.getUI() );
}
break;
- case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
for( k = 0; k < 4; k++ ) {
shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
}
@@ -1355,16 +1358,16 @@ public class Image {
userImage.putInt( iter, widget.getUI() );
}
break;
- case( GL2.GL_INT ):
- case( GL2.GL_UNSIGNED_INT ):
- case( GL2.GL_FLOAT ):
- if( type == GL2.GL_FLOAT ) {
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_UNSIGNED_INT ):
+ case( GL.GL_FLOAT ):
+ if( type == GL.GL_FLOAT ) {
if( indexFormat ) {
widget.setF( oldImage.get( iter2++ ) );
} else {
widget.setF( oldImage.get( iter2++ ) / 65535.0f );
}
- } else if( type == GL2.GL_UNSIGNED_INT ) {
+ } else if( type == GL.GL_UNSIGNED_INT ) {
if( indexFormat ) {
widget.setUI( oldImage.get( iter2++ ) );
} else {
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
index 938873ec5..fba6a231a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
@@ -46,10 +46,14 @@ package jogamp.opengl.glu.mipmap;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL2ES3;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.GLException;
+
import java.nio.*;
+
import com.jogamp.common.nio.Buffers;
/**
@@ -108,7 +112,7 @@ public class Mipmap {
return( s );
}
- public static int GLU_SWAP_4_BYTES( int i ) {
+ public static int GLU_SWAP_4_BYTES( final int i ) {
int t = i << 24;
t |= 0x00FF0000 & ( i << 8 );
t |= 0x0000FF00 & ( i >>> 8 );
@@ -116,17 +120,17 @@ public class Mipmap {
return( t );
}
- public static float GLU_SWAP_4_BYTES( float f ) {
- int i = Float.floatToRawIntBits( f );
- float temp = Float.intBitsToFloat( i );
+ public static float GLU_SWAP_4_BYTES( final float f ) {
+ final int i = Float.floatToRawIntBits( f );
+ final float temp = Float.intBitsToFloat( i );
return( temp );
}
- public static int checkMipmapArgs( int internalFormat, int format, int type ) {
+ public static int checkMipmapArgs( final int internalFormat, final int format, final int type ) {
if( !legalFormat( format ) || !legalType( type ) ) {
return( GLU.GLU_INVALID_ENUM );
}
- if( format == GL2GL3.GL_STENCIL_INDEX ) {
+ if( format == GL2ES2.GL_STENCIL_INDEX ) {
return( GLU.GLU_INVALID_ENUM );
}
if( !isLegalFormatForPackedPixelType( format, type ) ) {
@@ -135,19 +139,19 @@ public class Mipmap {
return( 0 );
}
- public static boolean legalFormat( int format ) {
+ public static boolean legalFormat( final int format ) {
switch( format ) {
case( GL2.GL_COLOR_INDEX ):
- case( GL2GL3.GL_STENCIL_INDEX ):
- case( GL2GL3.GL_DEPTH_COMPONENT ):
- case( GL2GL3.GL_RED ):
- case( GL2GL3.GL_GREEN ):
- case( GL2GL3.GL_BLUE ):
- case( GL2GL3.GL_ALPHA ):
- case( GL2GL3.GL_RGB ):
- case( GL2GL3.GL_RGBA ):
- case( GL2GL3.GL_LUMINANCE ):
- case( GL2GL3.GL_LUMINANCE_ALPHA ):
+ case( GL2ES2.GL_STENCIL_INDEX ):
+ case( GL2ES2.GL_DEPTH_COMPONENT ):
+ case( GL2ES2.GL_RED ):
+ case( GL2ES3.GL_GREEN ):
+ case( GL2ES3.GL_BLUE ):
+ case( GL.GL_ALPHA ):
+ case( GL.GL_RGB ):
+ case( GL.GL_RGBA ):
+ case( GL.GL_LUMINANCE ):
+ case( GL.GL_LUMINANCE_ALPHA ):
case( GL2GL3.GL_BGR ):
case( GL.GL_BGRA ):
return( true );
@@ -156,55 +160,55 @@ public class Mipmap {
}
}
- public static boolean legalType( int type ) {
+ public static boolean legalType( final int type ) {
switch( type ) {
case( GL2.GL_BITMAP ):
- case( GL2GL3.GL_BYTE ):
- case( GL2GL3.GL_UNSIGNED_BYTE ):
- case( GL2GL3.GL_SHORT ):
- case( GL2GL3.GL_UNSIGNED_SHORT ):
- case( GL2GL3.GL_INT ):
- case( GL2GL3.GL_UNSIGNED_INT ):
- case( GL2GL3.GL_FLOAT ):
+ case( GL.GL_BYTE ):
+ case( GL.GL_UNSIGNED_BYTE ):
+ case( GL.GL_SHORT ):
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_UNSIGNED_INT ):
+ case( GL.GL_FLOAT ):
case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
- case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
- case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
- case( GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
- case( GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ):
- case( GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
return( true );
default:
return( false );
}
}
- public static boolean isTypePackedPixel( int type ) {
+ public static boolean isTypePackedPixel( final int type ) {
assert( legalType( type ) );
if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
- type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ||
+ type == GL.GL_UNSIGNED_SHORT_5_6_5 ||
type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ||
- type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
+ type == GL.GL_UNSIGNED_SHORT_4_4_4_4 ||
type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- type == GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ||
+ type == GL.GL_UNSIGNED_SHORT_5_5_5_1 ||
type == GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ||
type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ||
type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ||
- type == GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ||
- type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) {
+ type == GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ||
+ type == GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ) {
return( true );
}
return( false );
}
- public static boolean isLegalFormatForPackedPixelType( int format, int type ) {
+ public static boolean isLegalFormatForPackedPixelType( final int format, final int type ) {
// if not a packed pixel type then return true
if( isTypePackedPixel( type ) ) {
return( true );
@@ -212,29 +216,29 @@ public class Mipmap {
// 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB
if( (type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 || type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
- type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 || type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV )
- & format != GL2GL3.GL_RGB ) {
+ type == GL.GL_UNSIGNED_SHORT_5_6_5 || type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV )
+ & format != GL.GL_RGB ) {
return( false );
}
// 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV &
// 10_10_10_2/2_10_10_10_REV are only campatible with RGBA, BGRA & ARGB_EXT
- if( ( type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
+ if( ( type == GL.GL_UNSIGNED_SHORT_4_4_4_4 ||
type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- type == GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ||
+ type == GL.GL_UNSIGNED_SHORT_5_5_5_1 ||
type == GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ||
type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ||
type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ||
- type == GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ||
- type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) &&
+ type == GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ||
+ type == GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ) &&
(format != GL.GL_RGBA && format != GL.GL_BGRA) ) {
return( false );
}
return( true );
}
- public static boolean isLegalLevels( int userLevel, int baseLevel, int maxLevel,
- int totalLevels ) {
+ public static boolean isLegalLevels( final int userLevel, final int baseLevel, final int maxLevel,
+ final int totalLevels ) {
if( (baseLevel < 0) || (baseLevel < userLevel) || (maxLevel < baseLevel) ||
(totalLevels < maxLevel) ) {
return( false );
@@ -249,13 +253,13 @@ public class Mipmap {
* advertise the texture extension.
* Note that proxy textures are implemented but not according to spec in IMPACT*
*/
- public static void closestFit( GL gl, int target, int width, int height, int internalFormat,
- int format, int type, int[] newWidth, int[] newHeight ) {
+ public static void closestFit( final GL gl, final int target, final int width, final int height, final int internalFormat,
+ final int format, final int type, final int[] newWidth, final int[] newHeight ) {
// Use proxy textures if OpenGL version >= 1.1
if( Double.parseDouble( gl.glGetString( GL.GL_VERSION ).trim().substring( 0, 3 ) ) >= 1.1 ) {
int widthPowerOf2 = nearestPower( width );
int heightPowerOf2 = nearestPower( height );
- int[] proxyWidth = new int[1];
+ final int[] proxyWidth = new int[1];
boolean noProxyTextures = false;
// Some drivers (in particular, ATI's) seem to set a GL error
@@ -265,24 +269,24 @@ public class Mipmap {
try {
do {
// compute level 1 width & height, clamping each at 1
- int widthAtLevelOne = ( ( width > 1 ) ? (widthPowerOf2 >> 1) : widthPowerOf2 );
- int heightAtLevelOne = ( ( height > 1 ) ? (heightPowerOf2 >> 1) : heightPowerOf2 );
+ final int widthAtLevelOne = ( ( width > 1 ) ? (widthPowerOf2 >> 1) : widthPowerOf2 );
+ final int heightAtLevelOne = ( ( height > 1 ) ? (heightPowerOf2 >> 1) : heightPowerOf2 );
int proxyTarget;
assert( widthAtLevelOne > 0 );
assert( heightAtLevelOne > 0 );
// does width x height at level 1 & all their mipmaps fit?
- if( target == GL2GL3.GL_TEXTURE_2D || target == GL2GL3.GL_PROXY_TEXTURE_2D ) {
+ if( target == GL.GL_TEXTURE_2D || target == GL2GL3.GL_PROXY_TEXTURE_2D ) {
proxyTarget = GL2GL3.GL_PROXY_TEXTURE_2D;
gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
heightAtLevelOne, 0, format, type, null );
- } else if( (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_X) ||
- (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_X) ||
- (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Y) ||
- (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) ||
- (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Z) ||
- (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) ) {
+ } else if( (target == GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X) ||
+ (target == GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X) ||
+ (target == GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y) ||
+ (target == GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) ||
+ (target == GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Z) ||
+ (target == GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) ) {
proxyTarget = GL2GL3.GL_PROXY_TEXTURE_CUBE_MAP;
gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
heightAtLevelOne, 0, format, type, null );
@@ -313,7 +317,7 @@ public class Mipmap {
}
// else it does fit
} while( proxyWidth[0] == 0 );
- } catch (GLException e) {
+ } catch (final GLException e) {
noProxyTextures = true;
}
// loop must terminate
@@ -324,8 +328,8 @@ public class Mipmap {
return;
}
}
- int[] maxsize = new int[1];
- gl.glGetIntegerv( GL2GL3.GL_MAX_TEXTURE_SIZE, maxsize , 0);
+ final int[] maxsize = new int[1];
+ gl.glGetIntegerv( GL.GL_MAX_TEXTURE_SIZE, maxsize , 0);
// clamp user's texture sizes to maximum sizes, if necessary
newWidth[0] = nearestPower( width );
if( newWidth[0] > maxsize[0] ) {
@@ -337,26 +341,26 @@ public class Mipmap {
}
}
- public static void closestFit3D( GL gl, int target, int width, int height, int depth,
- int internalFormat, int format, int type, int[] newWidth, int[] newHeight,
- int[] newDepth ) {
+ public static void closestFit3D( final GL gl, final int target, final int width, final int height, final int depth,
+ final int internalFormat, final int format, final int type, final int[] newWidth, final int[] newHeight,
+ final int[] newDepth ) {
int widthPowerOf2 = nearestPower( width );
int heightPowerOf2 = nearestPower( height );
int depthPowerOf2 = nearestPower( depth );
- int[] proxyWidth = new int[1];
+ final int[] proxyWidth = new int[1];
do {
// compute level 1 width & height & depth, clamping each at 1
- int widthAtLevelOne = (widthPowerOf2 > 1) ? widthPowerOf2 >> 1 : widthPowerOf2;
- int heightAtLevelOne = (heightPowerOf2 > 1) ? heightPowerOf2 >> 1 : heightPowerOf2;
- int depthAtLevelOne = (depthPowerOf2 > 1) ? depthPowerOf2 >> 1 : depthPowerOf2;
+ final int widthAtLevelOne = (widthPowerOf2 > 1) ? widthPowerOf2 >> 1 : widthPowerOf2;
+ final int heightAtLevelOne = (heightPowerOf2 > 1) ? heightPowerOf2 >> 1 : heightPowerOf2;
+ final int depthAtLevelOne = (depthPowerOf2 > 1) ? depthPowerOf2 >> 1 : depthPowerOf2;
int proxyTarget = 0;
assert( widthAtLevelOne > 0 );
assert( heightAtLevelOne > 0 );
assert( depthAtLevelOne > 0 );
// does width x height x depth at level 1 & all their mipmaps fit?
- if( target == GL2GL3.GL_TEXTURE_3D || target == GL2GL3.GL_PROXY_TEXTURE_3D ) {
+ if( target == GL2ES2.GL_TEXTURE_3D || target == GL2GL3.GL_PROXY_TEXTURE_3D ) {
proxyTarget = GL2GL3.GL_PROXY_TEXTURE_3D;
gl.getGL2GL3().glTexImage3D( proxyTarget, 1, internalFormat, widthAtLevelOne,
heightAtLevelOne, depthAtLevelOne, 0, format, type, null );
@@ -385,31 +389,31 @@ public class Mipmap {
newDepth[0] = depthPowerOf2;
}
- public static int elements_per_group( int format, int type ) {
+ public static int elements_per_group( final int format, final int type ) {
// Return the number of elements per grtoup of a specified gromat
// If the type is packedpixels then answer is 1
if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
- type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ||
+ type == GL.GL_UNSIGNED_SHORT_5_6_5 ||
type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ||
- type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
+ type == GL.GL_UNSIGNED_SHORT_4_4_4_4 ||
type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ||
- type == GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ||
+ type == GL.GL_UNSIGNED_SHORT_5_5_5_1 ||
type == GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ||
type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ||
type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ||
- type == GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ||
- type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) {
+ type == GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ||
+ type == GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ) {
return( 1 );
}
// Types are not packed pixels so get elements per group
switch( format ) {
- case( GL2GL3.GL_RGB ):
+ case( GL.GL_RGB ):
case( GL2GL3.GL_BGR ):
return( 3 );
- case( GL2GL3.GL_LUMINANCE_ALPHA ):
+ case( GL.GL_LUMINANCE_ALPHA ):
return( 2 );
case( GL.GL_RGBA ):
case( GL.GL_BGRA ):
@@ -419,45 +423,45 @@ public class Mipmap {
}
}
- public static int bytes_per_element( int type ) {
+ public static int bytes_per_element( final int type ) {
// return the number of bytes per element, based on the element type
switch( type ) {
case( GL2.GL_BITMAP ):
- case( GL2GL3.GL_BYTE ):
- case( GL2GL3.GL_UNSIGNED_BYTE ):
+ case( GL.GL_BYTE ):
+ case( GL.GL_UNSIGNED_BYTE ):
case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
return( 1 );
- case( GL2GL3.GL_SHORT ):
- case( GL2GL3.GL_UNSIGNED_SHORT ):
- case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL.GL_SHORT ):
+ case( GL.GL_UNSIGNED_SHORT ):
+ case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
- case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
- case( GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
return( 2 );
- case( GL2GL3.GL_INT ):
- case( GL2GL3.GL_UNSIGNED_INT ):
+ case( GL2ES2.GL_INT ):
+ case( GL.GL_UNSIGNED_INT ):
case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
- case( GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ):
- case( GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ):
- case( GL2GL3.GL_FLOAT ):
+ case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ case( GL.GL_FLOAT ):
return( 4 );
default:
return( 4 );
}
}
- public static boolean is_index( int format ) {
- return( format == GL2.GL_COLOR_INDEX || format == GL2GL3.GL_STENCIL_INDEX );
+ public static boolean is_index( final int format ) {
+ return( format == GL2.GL_COLOR_INDEX || format == GL2ES2.GL_STENCIL_INDEX );
}
/* Compute memory required for internal packed array of data of given type and format. */
- public static int image_size( int width, int height, int format, int type ) {
+ public static int image_size( final int width, final int height, final int format, final int type ) {
int bytes_per_row;
int components;
@@ -472,9 +476,9 @@ public class Mipmap {
return( bytes_per_row * height * components );
}
- public static int imageSize3D( int width, int height, int depth, int format, int type ) {
- int components = elements_per_group( format, type );
- int bytes_per_row = bytes_per_element( type ) * width;
+ public static int imageSize3D( final int width, final int height, final int depth, final int format, final int type ) {
+ final int components = elements_per_group( format, type );
+ final int bytes_per_row = bytes_per_element( type ) * width;
assert( width > 0 && height > 0 && depth > 0 );
assert( type != GL2.GL_BITMAP );
@@ -482,28 +486,28 @@ public class Mipmap {
return( bytes_per_row * height * depth * components );
}
- public static void retrieveStoreModes( GL gl, PixelStorageModes psm ) {
- int[] a = new int[1];
- gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
+ public static void retrieveStoreModes( final GL gl, final PixelStorageModes psm ) {
+ final int[] a = new int[1];
+ gl.glGetIntegerv( GL.GL_UNPACK_ALIGNMENT, a, 0);
psm.setUnpackAlignment( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_UNPACK_ROW_LENGTH, a, 0);
+ gl.glGetIntegerv( GL2ES2.GL_UNPACK_ROW_LENGTH, a, 0);
psm.setUnpackRowLength( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_ROWS, a, 0);
+ gl.glGetIntegerv( GL2ES2.GL_UNPACK_SKIP_ROWS, a, 0);
psm.setUnpackSkipRows( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_PIXELS, a, 0);
+ gl.glGetIntegerv( GL2ES2.GL_UNPACK_SKIP_PIXELS, a, 0);
psm.setUnpackSkipPixels( a[0] );
gl.glGetIntegerv( GL2GL3.GL_UNPACK_LSB_FIRST, a, 0);
psm.setUnpackLsbFirst( ( a[0] == 1 ) );
gl.glGetIntegerv( GL2GL3.GL_UNPACK_SWAP_BYTES, a, 0);
psm.setUnpackSwapBytes( ( a[0] == 1 ) );
- gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
+ gl.glGetIntegerv( GL.GL_PACK_ALIGNMENT, a, 0);
psm.setPackAlignment( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
+ gl.glGetIntegerv( GL2ES3.GL_PACK_ROW_LENGTH, a, 0);
psm.setPackRowLength( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_ROWS, a, 0);
+ gl.glGetIntegerv( GL2ES3.GL_PACK_SKIP_ROWS, a, 0);
psm.setPackSkipRows( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_PIXELS, a, 0);
+ gl.glGetIntegerv( GL2ES3.GL_PACK_SKIP_PIXELS, a, 0);
psm.setPackSkipPixels( a[0] );
gl.glGetIntegerv( GL2GL3.GL_PACK_LSB_FIRST, a, 0);
psm.setPackLsbFirst( ( a[0] == 1 ) );
@@ -511,32 +515,32 @@ public class Mipmap {
psm.setPackSwapBytes( ( a[0] == 1 ) );
}
- public static void retrieveStoreModes3D( GL gl, PixelStorageModes psm ) {
- int[] a = new int[1];
- gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
+ public static void retrieveStoreModes3D( final GL gl, final PixelStorageModes psm ) {
+ final int[] a = new int[1];
+ gl.glGetIntegerv( GL.GL_UNPACK_ALIGNMENT, a, 0);
psm.setUnpackAlignment( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_UNPACK_ROW_LENGTH, a, 0);
+ gl.glGetIntegerv( GL2ES2.GL_UNPACK_ROW_LENGTH, a, 0);
psm.setUnpackRowLength( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_ROWS, a, 0);
+ gl.glGetIntegerv( GL2ES2.GL_UNPACK_SKIP_ROWS, a, 0);
psm.setUnpackSkipRows( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_PIXELS, a, 0);
+ gl.glGetIntegerv( GL2ES2.GL_UNPACK_SKIP_PIXELS, a, 0);
psm.setUnpackSkipPixels( a[0] );
gl.glGetIntegerv( GL2GL3.GL_UNPACK_LSB_FIRST, a, 0);
psm.setUnpackLsbFirst( ( a[0] == 1 ) );
gl.glGetIntegerv( GL2GL3.GL_UNPACK_SWAP_BYTES, a, 0);
psm.setUnpackSwapBytes( ( a[0] == 1 ) );
- gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_IMAGES, a, 0);
+ gl.glGetIntegerv( GL2ES3.GL_UNPACK_SKIP_IMAGES, a, 0);
psm.setUnpackSkipImages( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_UNPACK_IMAGE_HEIGHT, a, 0);
+ gl.glGetIntegerv( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, a, 0);
psm.setUnpackImageHeight( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
+ gl.glGetIntegerv( GL.GL_PACK_ALIGNMENT, a, 0);
psm.setPackAlignment( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
+ gl.glGetIntegerv( GL2ES3.GL_PACK_ROW_LENGTH, a, 0);
psm.setPackRowLength( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_ROWS, a, 0);
+ gl.glGetIntegerv( GL2ES3.GL_PACK_SKIP_ROWS, a, 0);
psm.setPackSkipRows( a[0] );
- gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_PIXELS, a, 0 );
+ gl.glGetIntegerv( GL2ES3.GL_PACK_SKIP_PIXELS, a, 0 );
psm.setPackSkipPixels( a[0] );
gl.glGetIntegerv( GL2GL3.GL_PACK_LSB_FIRST, a, 0 );
psm.setPackLsbFirst( ( a[0] == 1 ) );
@@ -548,17 +552,17 @@ public class Mipmap {
psm.setPackImageHeight( a[0] );
}
- public static int gluScaleImage( GL gl, int format, int widthin, int heightin,
- int typein, ByteBuffer datain, int widthout, int heightout,
- int typeout, ByteBuffer dataout ) {
- int datainPos = datain.position();
- int dataoutPos = dataout.position();
+ public static int gluScaleImage( final GL gl, final int format, final int widthin, final int heightin,
+ final int typein, final ByteBuffer datain, final int widthout, final int heightout,
+ final int typeout, final ByteBuffer dataout ) {
+ final int datainPos = datain.position();
+ final int dataoutPos = dataout.position();
try {
int components;
ByteBuffer beforeimage;
ByteBuffer afterimage;
- PixelStorageModes psm = new PixelStorageModes();
+ final PixelStorageModes psm = new PixelStorageModes();
if( (widthin == 0) || (heightin == 0) || (widthout == 0) || (heightout == 0) ) {
return( 0 );
@@ -575,8 +579,8 @@ public class Mipmap {
if( !isLegalFormatForPackedPixelType( format, typeout ) ) {
return( GLU.GLU_INVALID_OPERATION );
}
- beforeimage = Buffers.newDirectByteBuffer( image_size( widthin, heightin, format, GL2GL3.GL_UNSIGNED_SHORT ) );
- afterimage = Buffers.newDirectByteBuffer( image_size( widthout, heightout, format, GL2GL3.GL_UNSIGNED_SHORT ) );
+ beforeimage = Buffers.newDirectByteBuffer( image_size( widthin, heightin, format, GL.GL_UNSIGNED_SHORT ) );
+ afterimage = Buffers.newDirectByteBuffer( image_size( widthout, heightout, format, GL.GL_UNSIGNED_SHORT ) );
if( beforeimage == null || afterimage == null ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
@@ -594,15 +598,15 @@ public class Mipmap {
}
}
- public static int gluBuild1DMipmapLevels( GL gl, int target, int internalFormat,
- int width, int format, int type, int userLevel, int baseLevel,
- int maxLevel, ByteBuffer data ) {
- int dataPos = data.position();
+ public static int gluBuild1DMipmapLevels( final GL gl, final int target, final int internalFormat,
+ final int width, final int format, final int type, final int userLevel, final int baseLevel,
+ final int maxLevel, final ByteBuffer data ) {
+ final int dataPos = data.position();
try {
int levels;
- int rc = checkMipmapArgs( internalFormat, format, type );
+ final int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
@@ -625,16 +629,16 @@ public class Mipmap {
}
}
- public static int gluBuild1DMipmaps( GL gl, int target, int internalFormat, int width,
- int format, int type, ByteBuffer data ) {
- int dataPos = data.position();
+ public static int gluBuild1DMipmaps( final GL gl, final int target, final int internalFormat, final int width,
+ final int format, final int type, final ByteBuffer data ) {
+ final int dataPos = data.position();
try {
- int[] widthPowerOf2 = new int[1];
+ final int[] widthPowerOf2 = new int[1];
int levels;
- int[] dummy = new int[1];
+ final int[] dummy = new int[1];
- int rc = checkMipmapArgs( internalFormat, format, type );
+ final int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
@@ -654,14 +658,14 @@ public class Mipmap {
}
- public static int gluBuild2DMipmapLevels( GL gl, int target, int internalFormat,
- int width, int height, int format, int type, int userLevel,
- int baseLevel, int maxLevel, Object data ) {
+ public static int gluBuild2DMipmapLevels( final GL gl, final int target, final int internalFormat,
+ final int width, final int height, final int format, final int type, final int userLevel,
+ final int baseLevel, final int maxLevel, final Object data ) {
int dataPos = 0;
int level, levels;
- int rc = checkMipmapArgs( internalFormat, format, type );
+ final int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
@@ -687,23 +691,23 @@ public class Mipmap {
buffer = (ByteBuffer)data;
dataPos = buffer.position();
} else if( data instanceof byte[] ) {
- byte[] array = (byte[])data;
+ final byte[] array = (byte[])data;
buffer = ByteBuffer.allocateDirect(array.length);
buffer.put(array);
} else if( data instanceof short[] ) {
- short[] array = (short[])data;
+ final short[] array = (short[])data;
buffer = ByteBuffer.allocateDirect( array.length * 2 );
- ShortBuffer sb = buffer.asShortBuffer();
+ final ShortBuffer sb = buffer.asShortBuffer();
sb.put( array );
} else if( data instanceof int[] ) {
- int[] array = (int[])data;
+ final int[] array = (int[])data;
buffer = ByteBuffer.allocateDirect( array.length * 4 );
- IntBuffer ib = buffer.asIntBuffer();
+ final IntBuffer ib = buffer.asIntBuffer();
ib.put( array );
} else if( data instanceof float[] ) {
- float[] array = (float[])data;
+ final float[] array = (float[])data;
buffer = ByteBuffer.allocateDirect( array.length * 4 );
- FloatBuffer fb = buffer.asFloatBuffer();
+ final FloatBuffer fb = buffer.asFloatBuffer();
fb.put( array );
}
@@ -717,15 +721,15 @@ public class Mipmap {
}
- public static int gluBuild2DMipmaps( GL gl, int target, int internalFormat,
- int width, int height, int format, int type, Object data ) {
+ public static int gluBuild2DMipmaps( final GL gl, final int target, final int internalFormat,
+ final int width, final int height, final int format, final int type, final Object data ) {
int dataPos = 0;
- int[] widthPowerOf2 = new int[1];
- int[] heightPowerOf2 = new int[1];
+ final int[] widthPowerOf2 = new int[1];
+ final int[] heightPowerOf2 = new int[1];
int level, levels;
- int rc = checkMipmapArgs( internalFormat, format, type );
+ final int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
@@ -749,23 +753,23 @@ public class Mipmap {
buffer = (ByteBuffer)data;
dataPos = buffer.position();
} else if( data instanceof byte[] ) {
- byte[] array = (byte[])data;
+ final byte[] array = (byte[])data;
buffer = ByteBuffer.allocateDirect(array.length);
buffer.put(array);
} else if( data instanceof short[] ) {
- short[] array = (short[])data;
+ final short[] array = (short[])data;
buffer = ByteBuffer.allocateDirect( array.length * 2 );
- ShortBuffer sb = buffer.asShortBuffer();
+ final ShortBuffer sb = buffer.asShortBuffer();
sb.put( array );
} else if( data instanceof int[] ) {
- int[] array = (int[])data;
+ final int[] array = (int[])data;
buffer = ByteBuffer.allocateDirect( array.length * 4 );
- IntBuffer ib = buffer.asIntBuffer();
+ final IntBuffer ib = buffer.asIntBuffer();
ib.put( array );
} else if( data instanceof float[] ) {
- float[] array = (float[])data;
+ final float[] array = (float[])data;
buffer = ByteBuffer.allocateDirect( array.length * 4 );
- FloatBuffer fb = buffer.asFloatBuffer();
+ final FloatBuffer fb = buffer.asFloatBuffer();
fb.put( array );
}
@@ -779,17 +783,17 @@ public class Mipmap {
}
- public static int gluBuild3DMipmaps( GL gl, int target, int internalFormat,
- int width, int height, int depth, int format, int type, ByteBuffer data ) {
- int dataPos = data.position();
+ public static int gluBuild3DMipmaps( final GL gl, final int target, final int internalFormat,
+ final int width, final int height, final int depth, final int format, final int type, final ByteBuffer data ) {
+ final int dataPos = data.position();
try {
- int[] widthPowerOf2 = new int[1];
- int[] heightPowerOf2 = new int[1];
- int[] depthPowerOf2 = new int[1];
+ final int[] widthPowerOf2 = new int[1];
+ final int[] heightPowerOf2 = new int[1];
+ final int[] depthPowerOf2 = new int[1];
int level, levels;
- int rc = checkMipmapArgs( internalFormat, format, type );
+ final int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
@@ -823,14 +827,14 @@ public class Mipmap {
}
}
- public static int gluBuild3DMipmapLevels( GL gl, int target, int internalFormat,
- int width, int height, int depth, int format, int type, int userLevel,
- int baseLevel, int maxLevel, ByteBuffer data ) {
- int dataPos = data.position();
+ public static int gluBuild3DMipmapLevels( final GL gl, final int target, final int internalFormat,
+ final int width, final int height, final int depth, final int format, final int type, final int userLevel,
+ final int baseLevel, final int maxLevel, final ByteBuffer data ) {
+ final int dataPos = data.position();
try {
int level, levels;
- int rc = checkMipmapArgs( internalFormat, format, type );
+ final int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
index 7eb98db35..9b26647a8 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
@@ -147,7 +147,7 @@ public class PixelStorageModes {
* Setter for property packAlignment.
* @param packAlignment New value of property packAlignment.
*/
- public void setPackAlignment(int packAlignment) {
+ public void setPackAlignment(final int packAlignment) {
this.packAlignment = packAlignment;
}
@@ -165,7 +165,7 @@ public class PixelStorageModes {
* Setter for property packRowLength.
* @param packRowLength New value of property packRowLength.
*/
- public void setPackRowLength(int packRowLength) {
+ public void setPackRowLength(final int packRowLength) {
this.packRowLength = packRowLength;
}
@@ -183,7 +183,7 @@ public class PixelStorageModes {
* Setter for property packSkipRows.
* @param packSkipRows New value of property packSkipRows.
*/
- public void setPackSkipRows(int packSkipRows) {
+ public void setPackSkipRows(final int packSkipRows) {
this.packSkipRows = packSkipRows;
}
@@ -201,7 +201,7 @@ public class PixelStorageModes {
* Setter for property packSkipPixels.
* @param packSkipPixels New value of property packSkipPixels.
*/
- public void setPackSkipPixels(int packSkipPixels) {
+ public void setPackSkipPixels(final int packSkipPixels) {
this.packSkipPixels = packSkipPixels;
}
@@ -219,7 +219,7 @@ public class PixelStorageModes {
* Setter for property packLsbFirst.
* @param packLsbFirst New value of property packLsbFirst.
*/
- public void setPackLsbFirst(boolean packLsbFirst) {
+ public void setPackLsbFirst(final boolean packLsbFirst) {
this.packLsbFirst = packLsbFirst;
}
@@ -237,7 +237,7 @@ public class PixelStorageModes {
* Setter for property packSwapBytes.
* @param packSwapBytes New value of property packSwapBytes.
*/
- public void setPackSwapBytes(boolean packSwapBytes) {
+ public void setPackSwapBytes(final boolean packSwapBytes) {
this.packSwapBytes = packSwapBytes;
}
@@ -255,7 +255,7 @@ public class PixelStorageModes {
* Setter for property packSkipImages.
* @param packSkipImages New value of property packSkipImages.
*/
- public void setPackSkipImages(int packSkipImages) {
+ public void setPackSkipImages(final int packSkipImages) {
this.packSkipImages = packSkipImages;
}
@@ -273,7 +273,7 @@ public class PixelStorageModes {
* Setter for property packImageHeight.
* @param packImageHeight New value of property packImageHeight.
*/
- public void setPackImageHeight(int packImageHeight) {
+ public void setPackImageHeight(final int packImageHeight) {
this.packImageHeight = packImageHeight;
}
@@ -291,7 +291,7 @@ public class PixelStorageModes {
* Setter for property unpackAlignment.
* @param unpackAlignment New value of property unpackAlignment.
*/
- public void setUnpackAlignment(int unpackAlignment) {
+ public void setUnpackAlignment(final int unpackAlignment) {
this.unpackAlignment = unpackAlignment;
}
@@ -309,7 +309,7 @@ public class PixelStorageModes {
* Setter for property unpackRowLength.
* @param unpackRowLength New value of property unpackRowLength.
*/
- public void setUnpackRowLength(int unpackRowLength) {
+ public void setUnpackRowLength(final int unpackRowLength) {
this.unpackRowLength = unpackRowLength;
}
@@ -327,7 +327,7 @@ public class PixelStorageModes {
* Setter for property unpackSkipRows.
* @param unpackSkipRows New value of property unpackSkipRows.
*/
- public void setUnpackSkipRows(int unpackSkipRows) {
+ public void setUnpackSkipRows(final int unpackSkipRows) {
this.unpackSkipRows = unpackSkipRows;
}
@@ -345,7 +345,7 @@ public class PixelStorageModes {
* Setter for property unpackSkipPixels.
* @param unpackSkipPixels New value of property unpackSkipPixels.
*/
- public void setUnpackSkipPixels(int unpackSkipPixels) {
+ public void setUnpackSkipPixels(final int unpackSkipPixels) {
this.unpackSkipPixels = unpackSkipPixels;
}
@@ -363,7 +363,7 @@ public class PixelStorageModes {
* Setter for property unpackLsbFirst.
* @param unpackLsbFirst New value of property unpackLsbFirst.
*/
- public void setUnpackLsbFirst(boolean unpackLsbFirst) {
+ public void setUnpackLsbFirst(final boolean unpackLsbFirst) {
this.unpackLsbFirst = unpackLsbFirst;
}
@@ -381,7 +381,7 @@ public class PixelStorageModes {
* Setter for property unpackSwapBytes.
* @param unpackSwapBytes New value of property unpackSwapBytes.
*/
- public void setUnpackSwapBytes(boolean unpackSwapBytes) {
+ public void setUnpackSwapBytes(final boolean unpackSwapBytes) {
this.unpackSwapBytes = unpackSwapBytes;
}
@@ -399,7 +399,7 @@ public class PixelStorageModes {
* Setter for property unpackSkipImages.
* @param unpackSkipImages New value of property unpackSkipImages.
*/
- public void setUnpackSkipImages(int unpackSkipImages) {
+ public void setUnpackSkipImages(final int unpackSkipImages) {
this.unpackSkipImages = unpackSkipImages;
}
@@ -417,7 +417,7 @@ public class PixelStorageModes {
* Setter for property unpackImageHeight.
* @param unpackImageHeight New value of property unpackImageHeight.
*/
- public void setUnpackImageHeight(int unpackImageHeight) {
+ public void setUnpackImageHeight(final int unpackImageHeight) {
this.unpackImageHeight = unpackImageHeight;
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
index 9aca1fb03..ccb75091c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
@@ -56,16 +56,16 @@ import com.jogamp.common.nio.Buffers;
*/
public class ScaleInternal {
- public static final float UINT_MAX = (float)(0x00000000FFFFFFFF);
+ public static final float UINT_MAX = (0x00000000FFFFFFFF);
- public static void scale_internal( int components, int widthin, int heightin,
- ShortBuffer datain, int widthout, int heightout, ShortBuffer dataout ) {
+ public static void scale_internal( final int components, final int widthin, final int heightin,
+ final ShortBuffer datain, final int widthout, final int heightout, final ShortBuffer dataout ) {
float x, lowx, highx, convx, halfconvx;
float y, lowy, highy, convy, halfconvy;
float xpercent, ypercent;
float percent;
// Max components in a format is 4, so...
- float[] totals = new float[4];
+ final float[] totals = new float[4];
float area;
int i, j, k, yint, xint, xindex, yindex;
int temp;
@@ -147,14 +147,16 @@ public class ScaleInternal {
}
}
- public static void scale_internal_ubyte( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- ByteBuffer dataout, int element_size, int ysize, int group_size ) {
- float x, convx;
- float y, convy;
+ public static void scale_internal_ubyte( final int components, final int widthin, final int heightin,
+ final ByteBuffer datain, final int widthout, final int heightout,
+ final ByteBuffer dataout, final int element_size, final int ysize, final int group_size ) {
+ final float x;
+ float convx;
+ final float y;
+ float convy;
float percent;
// Max components in a format is 4, so...
- float[] totals = new float[4];
+ final float[] totals = new float[4];
float area;
int i, j, k, xindex;
@@ -356,7 +358,7 @@ public class ScaleInternal {
// Clamp to make sure we don't run off the right edge
if (highx_int > widthin - 1) {
- int delta = (highx_int - widthin + 1);
+ final int delta = (highx_int - widthin + 1);
lowx_int -= delta;
highx_int -= delta;
}
@@ -372,15 +374,17 @@ public class ScaleInternal {
}
}
- public static void scale_internal_byte( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- ByteBuffer dataout, int element_size, int ysize,
- int group_size ) {
- float x, convx;
- float y, convy;
+ public static void scale_internal_byte( final int components, final int widthin, final int heightin,
+ final ByteBuffer datain, final int widthout, final int heightout,
+ final ByteBuffer dataout, final int element_size, final int ysize,
+ final int group_size ) {
+ final float x;
+ float convx;
+ final float y;
+ float convy;
float percent;
// Max components in a format is 4, so...
- float[] totals = new float[4];
+ final float[] totals = new float[4];
float area;
int i, j, k, xindex;
@@ -581,7 +585,7 @@ public class ScaleInternal {
// Clamp to make sure we don't run off the right edge
if (highx_int > widthin - 1) {
- int delta = (highx_int - widthin + 1);
+ final int delta = (highx_int - widthin + 1);
lowx_int -= delta;
highx_int -= delta;
}
@@ -597,15 +601,17 @@ public class ScaleInternal {
}
}
- public static void scale_internal_ushort( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- ShortBuffer dataout, int element_size, int ysize,
- int group_size, boolean myswap_bytes ) {
- float x, convx;
- float y, convy;
+ public static void scale_internal_ushort( final int components, final int widthin, final int heightin,
+ final ByteBuffer datain, final int widthout, final int heightout,
+ final ShortBuffer dataout, final int element_size, final int ysize,
+ final int group_size, final boolean myswap_bytes ) {
+ final float x;
+ float convx;
+ final float y;
+ float convy;
float percent;
// Max components in a format is 4, so...
- float[] totals = new float[4];
+ final float[] totals = new float[4];
float area;
int i, j, k, xindex;
@@ -673,7 +679,7 @@ public class ScaleInternal {
for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
datain.position( temp_index );
if( myswap_bytes ) {
- totals[k] += ( 0x0000FFFF & ((int)Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * percent;
+ totals[k] += ( 0x0000FFFF & (Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * percent;
} else {
totals[k] += ( 0x0000FFFF & datain.getShort() ) * percent;
}
@@ -684,7 +690,7 @@ public class ScaleInternal {
for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
datain.position( temp_index );
if( myswap_bytes ) {
- totals[k] += ( 0x0000FFFF & ((int)Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * y_percent;
+ totals[k] += ( 0x0000FFFF & (Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * y_percent;
} else {
totals[k] += ( 0x0000FFFF & datain.getShort()) * y_percent;
}
@@ -869,7 +875,7 @@ public class ScaleInternal {
// Clamp to make sure we don't run off the right edge
if (highx_int > widthin - 1) {
- int delta = (highx_int - widthin + 1);
+ final int delta = (highx_int - widthin + 1);
lowx_int -= delta;
highx_int -= delta;
}
@@ -885,15 +891,17 @@ public class ScaleInternal {
}
}
- public static void scale_internal_short( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- ShortBuffer dataout, int element_size, int ysize,
- int group_size, boolean myswap_bytes ) {
- float x, convx;
- float y, convy;
+ public static void scale_internal_short( final int components, final int widthin, final int heightin,
+ final ByteBuffer datain, final int widthout, final int heightout,
+ final ShortBuffer dataout, final int element_size, final int ysize,
+ final int group_size, final boolean myswap_bytes ) {
+ final float x;
+ float convx;
+ final float y;
+ float convy;
float percent;
// Max components in a format is 4, so...
- float[] totals = new float[4];
+ final float[] totals = new float[4];
float area;
int i, j, k, xindex;
@@ -1173,7 +1181,7 @@ public class ScaleInternal {
// Clamp to make sure we don't run off the right edge
if (highx_int > widthin - 1) {
- int delta = (highx_int - widthin + 1);
+ final int delta = (highx_int - widthin + 1);
lowx_int -= delta;
highx_int -= delta;
}
@@ -1189,15 +1197,17 @@ public class ScaleInternal {
}
}
- public static void scale_internal_uint( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- IntBuffer dataout, int element_size, int ysize,
- int group_size, boolean myswap_bytes ) {
- float x, convx;
- float y, convy;
+ public static void scale_internal_uint( final int components, final int widthin, final int heightin,
+ final ByteBuffer datain, final int widthout, final int heightout,
+ final IntBuffer dataout, final int element_size, final int ysize,
+ final int group_size, final boolean myswap_bytes ) {
+ final float x;
+ float convx;
+ final float y;
+ float convy;
float percent;
// Max components in a format is 4, so...
- float[] totals = new float[4];
+ final float[] totals = new float[4];
float area;
int i, j, k, xindex;
@@ -1416,9 +1426,9 @@ public class ScaleInternal {
percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
temp = xindex + (lowy_int * ysize);
for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
- long tempInt0 = ( 0xFFFFFFFFL & datain.getInt( temp_index ) );
+ final long tempInt0 = ( 0xFFFFFFFFL & datain.getInt( temp_index ) );
datain.position( temp_index );
- long tempInt1 = ( 0xFFFFFFFFL & datain.getInt() );
+ final long tempInt1 = ( 0xFFFFFFFFL & datain.getInt() );
datain.position( temp_index );
if( myswap_bytes ) {
totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
@@ -1468,7 +1478,7 @@ public class ScaleInternal {
// Clamp to make sure we don't run off the right edge
if (highx_int > widthin - 1) {
- int delta = (highx_int - widthin + 1);
+ final int delta = (highx_int - widthin + 1);
lowx_int -= delta;
highx_int -= delta;
}
@@ -1484,15 +1494,17 @@ public class ScaleInternal {
}
}
- public static void scale_internal_int( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- IntBuffer dataout, int element_size, int ysize,
- int group_size, boolean myswap_bytes ) {
- float x, convx;
- float y, convy;
+ public static void scale_internal_int( final int components, final int widthin, final int heightin,
+ final ByteBuffer datain, final int widthout, final int heightout,
+ final IntBuffer dataout, final int element_size, final int ysize,
+ final int group_size, final boolean myswap_bytes ) {
+ final float x;
+ float convx;
+ final float y;
+ float convy;
float percent;
// Max components in a format is 4, so...
- float[] totals = new float[4];
+ final float[] totals = new float[4];
float area;
int i, j, k, xindex;
@@ -1772,7 +1784,7 @@ public class ScaleInternal {
// Clamp to make sure we don't run off the right edge
if (highx_int > widthin - 1) {
- int delta = (highx_int - widthin + 1);
+ final int delta = (highx_int - widthin + 1);
lowx_int -= delta;
highx_int -= delta;
}
@@ -1788,15 +1800,17 @@ public class ScaleInternal {
}
}
- public static void scale_internal_float( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- FloatBuffer dataout, int element_size, int ysize,
- int group_size, boolean myswap_bytes ) {
- float x, convx;
- float y, convy;
+ public static void scale_internal_float( final int components, final int widthin, final int heightin,
+ final ByteBuffer datain, final int widthout, final int heightout,
+ final FloatBuffer dataout, final int element_size, final int ysize,
+ final int group_size, final boolean myswap_bytes ) {
+ final float x;
+ float convx;
+ final float y;
+ float convy;
float percent;
// Max components in a format is 4, so...
- float[] totals = new float[4];
+ final float[] totals = new float[4];
float area;
int i, j, k, xindex;
@@ -2076,7 +2090,7 @@ public class ScaleInternal {
// Clamp to make sure we don't run off the right edge
if (highx_int > widthin - 1) {
- int delta = (highx_int - widthin + 1);
+ final int delta = (highx_int - widthin + 1);
lowx_int -= delta;
highx_int -= delta;
}
@@ -2092,25 +2106,27 @@ public class ScaleInternal {
}
}
- public static void scaleInternalPackedPixel( int components, Extract extract,
- int widthIn, int heightIn, ByteBuffer dataIn, int widthOut,
- int heightOut, ByteBuffer dataOut, int pixelSizeInBytes,
- int rowSizeInBytes, boolean isSwap ) {
- float x, convx;
- float y, convy;
+ public static void scaleInternalPackedPixel( final int components, final Extract extract,
+ final int widthIn, final int heightIn, final ByteBuffer dataIn, final int widthOut,
+ final int heightOut, final ByteBuffer dataOut, final int pixelSizeInBytes,
+ final int rowSizeInBytes, final boolean isSwap ) {
+ final float x;
+ float convx;
+ final float y;
+ float convy;
float percent;
// max components in a format is 4, so
- float[] totals = new float[4];
- float[] extractTotals = new float[4];
- float[] extractMoreTotals = new float[4];
- float[] shoveTotals = new float[4];
+ final float[] totals = new float[4];
+ final float[] extractTotals = new float[4];
+ final float[] extractMoreTotals = new float[4];
+ final float[] shoveTotals = new float[4];
float area;
int i, j, k, xindex;
int temp, temp0;
- int temp_index;
+ final int temp_index;
int outIndex = 0;
int lowx_int, highx_int, lowy_int, highy_int;
@@ -2309,7 +2325,7 @@ public class ScaleInternal {
// Clamp to make sure we don't run off the right edge
if (highx_int > widthIn - 1) {
- int delta = (highx_int - widthIn + 1);
+ final int delta = (highx_int - widthIn + 1);
lowx_int -= delta;
highx_int -= delta;
}
@@ -2326,16 +2342,16 @@ public class ScaleInternal {
assert( outIndex == ( widthOut * heightOut - 1) );
}
- public static void scaleInternal3D( int components, int widthIn, int heightIn,
- int depthIn, ShortBuffer dataIn, int widthOut, int heightOut,
- int depthOut, ShortBuffer dataOut ) {
+ public static void scaleInternal3D( final int components, final int widthIn, final int heightIn,
+ final int depthIn, final ShortBuffer dataIn, final int widthOut, final int heightOut,
+ final int depthOut, final ShortBuffer dataOut ) {
float x, lowx, highx, convx, halfconvx;
float y, lowy, highy, convy, halfconvy;
float z, lowz, highz, convz, halfconvz;
float xpercent, ypercent, zpercent;
float percent;
// max compnents in a format is 4
- float[] totals = new float[4];
+ final float[] totals = new float[4];
float volume;
int i, j, d, k, zint, yint, xint, xindex, yindex, zindex;
int temp;
@@ -2442,12 +2458,12 @@ public class ScaleInternal {
}
}
- public static int gluScaleImage3D( GL gl, int format, int widthIn, int heightIn,
- int depthIn, int typeIn, ByteBuffer dataIn, int widthOut, int heightOut,
- int depthOut, int typeOut, ByteBuffer dataOut ) {
+ public static int gluScaleImage3D( final GL gl, final int format, final int widthIn, final int heightIn,
+ final int depthIn, final int typeIn, final ByteBuffer dataIn, final int widthOut, final int heightOut,
+ final int depthOut, final int typeOut, final ByteBuffer dataOut ) {
int components;
ShortBuffer beforeImage, afterImage;
- PixelStorageModes psm = new PixelStorageModes();
+ final PixelStorageModes psm = new PixelStorageModes();
if( widthIn == 0 || heightIn == 0 || depthIn == 0 ||
widthOut == 0 || heightOut == 0 || depthOut == 0 ) {
@@ -2475,10 +2491,10 @@ public class ScaleInternal {
try {
beforeImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
- heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
+ heightIn, depthIn, format, GL.GL_UNSIGNED_SHORT ) ).asShortBuffer();
afterImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
- heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
- } catch( OutOfMemoryError err ) {
+ heightIn, depthIn, format, GL.GL_UNSIGNED_SHORT ) ).asShortBuffer();
+ } catch( final OutOfMemoryError err ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
Mipmap.retrieveStoreModes3D( gl, psm );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
index dc401880d..8683f75ac 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
@@ -61,7 +61,7 @@ public class Type_Widget {
buffer = ByteBuffer.allocate( 4 );
}
- public void setUB0( byte b ) {
+ public void setUB0( final byte b ) {
buffer.position( 0 );
buffer.put( b );
}
@@ -71,7 +71,7 @@ public class Type_Widget {
return( buffer.get() );
}
- public void setUB1( byte b ) {
+ public void setUB1( final byte b ) {
buffer.position( 1 );
buffer.put( b );
}
@@ -81,7 +81,7 @@ public class Type_Widget {
return( buffer.get() );
}
- public void setUB2( byte b ) {
+ public void setUB2( final byte b ) {
buffer.position( 2 );
buffer.put( b );
}
@@ -91,7 +91,7 @@ public class Type_Widget {
return( buffer.get() );
}
- public void setUB3( byte b ) {
+ public void setUB3( final byte b ) {
buffer.position( 3 );
buffer.put( b );
}
@@ -101,7 +101,7 @@ public class Type_Widget {
return( buffer.get() );
}
- public void setUS0( short s ) {
+ public void setUS0( final short s ) {
buffer.position( 0 );
buffer.putShort( s );
}
@@ -111,7 +111,7 @@ public class Type_Widget {
return( buffer.getShort() );
}
- public void setUS1( short s ) {
+ public void setUS1( final short s ) {
buffer.position( 2 );
buffer.putShort( s );
}
@@ -121,7 +121,7 @@ public class Type_Widget {
return( buffer.getShort() );
}
- public void setUI( int i ) {
+ public void setUI( final int i ) {
buffer.position( 0 );
buffer.putInt( i );
}
@@ -131,7 +131,7 @@ public class Type_Widget {
return( buffer.getInt() );
}
- public void setB0( byte b ) {
+ public void setB0( final byte b ) {
buffer.position( 0 );
buffer.put( b );
}
@@ -141,7 +141,7 @@ public class Type_Widget {
return( buffer.get() );
}
- public void setB1( byte b ) {
+ public void setB1( final byte b ) {
buffer.position( 1 );
buffer.put( b );
}
@@ -151,7 +151,7 @@ public class Type_Widget {
return( buffer.get() );
}
- public void setB2( byte b ) {
+ public void setB2( final byte b ) {
buffer.position( 2 );
buffer.put( b );
}
@@ -161,7 +161,7 @@ public class Type_Widget {
return( buffer.get() );
}
- public void setB3( byte b ) {
+ public void setB3( final byte b ) {
buffer.position( 3 );
buffer.put( b );
}
@@ -171,7 +171,7 @@ public class Type_Widget {
return( buffer.get() );
}
- public void setS0( short s ) {
+ public void setS0( final short s ) {
buffer.position( 0 );
buffer.putShort( s );
}
@@ -181,7 +181,7 @@ public class Type_Widget {
return( buffer.getShort() );
}
- public void setS1( short s ) {
+ public void setS1( final short s ) {
buffer.position( 2 );
buffer.putShort( s );
}
@@ -191,7 +191,7 @@ public class Type_Widget {
return( buffer.getShort() );
}
- public void setI( int i ) {
+ public void setI( final int i ) {
buffer.position( 0 );
buffer.putInt( i );
}
@@ -201,7 +201,7 @@ public class Type_Widget {
return( buffer.getInt() );
}
- public void setF( float f ) {
+ public void setF( final float f ) {
buffer.position( 0 );
buffer.putFloat( f );
}
@@ -216,8 +216,8 @@ public class Type_Widget {
return( buffer );
}
- public static void main( String args[] ) {
- Type_Widget t = new Type_Widget();
+ public static void main( final String args[] ) {
+ final Type_Widget t = new Type_Widget();
t.setI( 1000000 );
System.out.println("int: " + Integer.toHexString( t.getI() ) );
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
index df2b9a147..2194eb672 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
@@ -68,7 +68,7 @@ public class Arc {
/**
* Corresponding berizer type arc
*/
- private BezierArc bezierArc;
+ private final BezierArc bezierArc;
/**
* Makes new arc at specified side
@@ -76,7 +76,7 @@ public class Arc {
* @param side
* which side doeas this arc form
*/
- public Arc(int side) {
+ public Arc(final int side) {
bezierArc = null;
pwlArc = null;
type = 0;
@@ -90,7 +90,7 @@ public class Arc {
* @param side
* arc side
*/
- private void setside(int side) {
+ private void setside(final int side) {
// DONE
clearside();
type |= side << 8;
@@ -152,7 +152,7 @@ public class Arc {
* arc to be append
* @return this
*/
- public Arc append(Arc jarc) {
+ public Arc append(final Arc jarc) {
// DONE
if (jarc != null) {
next = jarc.next;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
index c299b10af..68263b90d 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
@@ -45,7 +45,7 @@ public class ArcSdirSorter {
* Makes new ArcSdirSorter with Subdivider
* @param subdivider subdivider
*/
- public ArcSdirSorter(Subdivider subdivider) {
+ public ArcSdirSorter(final Subdivider subdivider) {
//TODO
// System.out.println("TODO arcsdirsorter.constructor");
}
@@ -55,7 +55,7 @@ public class ArcSdirSorter {
* @param list arc list to be sorted
* @param count size of list
*/
- public void qsort(CArrayOfArcs list, int count) {
+ public void qsort(final CArrayOfArcs list, final int count) {
// TODO
// System.out.println("TODO arcsdirsorter.qsort");
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
index 1a584c396..dcd7d9fdc 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
@@ -44,7 +44,7 @@ public class ArcTdirSorter {
* Makes new ArcSdirSorter with Subdivider
* @param subdivider subdivider
*/
- public ArcTdirSorter(Subdivider subdivider) {
+ public ArcTdirSorter(final Subdivider subdivider) {
// TODO Auto-generated constructor stub
// System.out.println("TODO arcTsorter.konstruktor");
}
@@ -53,7 +53,7 @@ public class ArcTdirSorter {
* @param list arc list to be sorted
* @param count size of list
*/
- public void qsort(CArrayOfArcs list, int count) {
+ public void qsort(final CArrayOfArcs list, final int count) {
// TODO Auto-generated method stub
// System.out.println("TODO arcTsorter.qsort");
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java
index bd6311414..119ccbc81 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java
@@ -49,9 +49,9 @@ public class ArcTesselator {
* @param t1 minimum t param
* @param t2 maximum s param
*/
- public void bezier(Arc arc, float s1, float s2, float t1, float t2) {
+ public void bezier(final Arc arc, final float s1, final float s2, final float t1, final float t2) {
// DONE
- TrimVertex[] p = new TrimVertex[2];
+ final TrimVertex[] p = new TrimVertex[2];
p[0] = new TrimVertex();
p[1] = new TrimVertex();
arc.pwlArc = new PwlArc(2, p);
@@ -70,7 +70,7 @@ public class ArcTesselator {
* @param t1 third tail
* @param f stepsize
*/
- public void pwl_right(Arc newright, float s, float t1, float t2, float f) {
+ public void pwl_right(final Arc newright, final float s, final float t1, final float t2, final float f) {
// TODO Auto-generated method stub
// System.out.println("TODO arctesselator.pwl_right");
}
@@ -83,7 +83,7 @@ public class ArcTesselator {
* @param t1 third tail
* @param f stepsize
*/
- public void pwl_left(Arc newright, float s, float t2, float t1, float f) {
+ public void pwl_left(final Arc newright, final float s, final float t2, final float t1, final float f) {
// TODO Auto-generated method stub
// System.out.println("TODO arctesselator.pwl_left");
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
index 3e974247b..bde1e2cbb 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
@@ -101,8 +101,8 @@ public abstract class Backend {
* @param ulo smallest u
* @param uhi highest u
*/
- public void curvpts(int type, CArrayOfFloats ps, int stride, int order,
- float ulo, float uhi) {
+ public void curvpts(final int type, final CArrayOfFloats ps, final int stride, final int order,
+ final float ulo, final float uhi) {
// DONE
curveEvaluator.map1f(type, ulo, uhi, stride, order, ps);
curveEvaluator.enable(type);
@@ -114,7 +114,7 @@ public abstract class Backend {
* @param u2 highest u
* @param nu number of pieces
*/
- public void curvgrid(float u1, float u2, int nu) {
+ public void curvgrid(final float u1, final float u2, final int nu) {
// DONE
curveEvaluator.mapgrid1f(nu, u1, u2);
@@ -125,7 +125,7 @@ public abstract class Backend {
* @param from low param
* @param n step
*/
- public void curvmesh(int from, int n) {
+ public void curvmesh(final int from, final int n) {
// DONE
curveEvaluator.mapmesh1f(N_MESHFILL, from, from + n);
}
@@ -135,7 +135,7 @@ public abstract class Backend {
* @param wiretris use triangles
* @param wirequads use quads
*/
- public void bgnsurf(int wiretris, int wirequads) {
+ public void bgnsurf(final int wiretris, final int wirequads) {
// DONE
surfaceEvaluator.bgnmap2f();
@@ -160,7 +160,7 @@ public abstract class Backend {
* @param vlo low v param
* @param vhi high v param
*/
- public void patch(float ulo, float uhi, float vlo, float vhi) {
+ public void patch(final float ulo, final float uhi, final float vlo, final float vhi) {
// DONE
surfaceEvaluator.domain2f(ulo, uhi, vlo, vhi);
}
@@ -174,7 +174,7 @@ public abstract class Backend {
* @param v1 highest v
* @param nv number of pieces in v direction
*/
- public void surfgrid(float u0, float u1, int nu, float v0, float v1, int nv) {
+ public void surfgrid(final float u0, final float u1, final int nu, final float v0, final float v1, final int nv) {
// DONE
surfaceEvaluator.mapgrid2f(nu, u0, u1, nv, v0, v1);
@@ -187,7 +187,7 @@ public abstract class Backend {
* @param n step in u direction
* @param m step in v direction
*/
- public void surfmesh(int u, int v, int n, int m) {
+ public void surfmesh(final int u, final int v, final int n, final int m) {
// System.out.println("TODO backend.surfmesh wireframequads");
// TODO wireframequads
surfaceEvaluator.mapmesh2f(NurbsConsts.N_MESHFILL, u, u + n, v, v + m);
@@ -206,8 +206,8 @@ public abstract class Backend {
* @param vlo lowest v
* @param vhi hightest v
*/
- public void surfpts(int type, CArrayOfFloats pts, int ustride, int vstride,
- int uorder, int vorder, float ulo, float uhi, float vlo, float vhi) {
+ public void surfpts(final int type, final CArrayOfFloats pts, final int ustride, final int vstride,
+ final int uorder, final int vorder, final float ulo, final float uhi, final float vlo, final float vhi) {
// DONE
surfaceEvaluator.map2f(type, ulo, uhi, ustride, uorder, vlo, vhi,
vstride, vorder, pts);
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
index 17437ef01..638b018c9 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
@@ -64,7 +64,7 @@ public class Bin {
* Adds and arc to linked list
* @param jarc added arc
*/
- public void addarc(Arc jarc) {
+ public void addarc(final Arc jarc) {
// DONE
// if (head == null)
// head = jarc;
@@ -93,7 +93,7 @@ public class Bin {
*/
public Arc removearc() {
// DONE
- Arc jarc = head;
+ final Arc jarc = head;
if (jarc != null)
head = jarc.link;
return jarc;
@@ -147,7 +147,7 @@ public class Bin {
*/
private Arc nextarc() {
// DONE
- Arc jarc = current;
+ final Arc jarc = current;
if (jarc != null)
current = jarc.link;
return jarc;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
index b67764c30..6d2ab362b 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
@@ -20,7 +20,7 @@ public class CArrayOfArcs {
/**
* Don't check for array borders?
*/
- private boolean noCheck = true;
+ private final boolean noCheck = true;
/**
* Makes new CArray
@@ -30,7 +30,7 @@ public class CArrayOfArcs {
* @param pointer
* pointer (index) to array
*/
- public CArrayOfArcs(Arc[] array, int pointer) {
+ public CArrayOfArcs(final Arc[] array, final int pointer) {
this.array = array;
// this.pointer=pointer;
setPointer(pointer);
@@ -42,7 +42,7 @@ public class CArrayOfArcs {
* @param carray
* reference array
*/
- public CArrayOfArcs(CArrayOfArcs carray) {
+ public CArrayOfArcs(final CArrayOfArcs carray) {
this.array = carray.array;
// this.pointer=carray.pointer;
setPointer(carray.pointer);
@@ -54,7 +54,7 @@ public class CArrayOfArcs {
* @param ctlarray
* underlaying array
*/
- public CArrayOfArcs(Arc[] ctlarray) {
+ public CArrayOfArcs(final Arc[] ctlarray) {
this.array = ctlarray;
this.pointer = 0;
}
@@ -82,7 +82,7 @@ public class CArrayOfArcs {
* @param f
* desired value
*/
- public void set(Arc f) {
+ public void set(final Arc f) {
array[pointer] = f;
}
@@ -94,7 +94,7 @@ public class CArrayOfArcs {
* array index
* @return element at index
*/
- public Arc get(int i) {
+ public Arc get(final int i) {
return array[i];
}
@@ -105,7 +105,7 @@ public class CArrayOfArcs {
* relative index
* @return element at relative index
*/
- public Arc getRelative(int i) {
+ public Arc getRelative(final int i) {
return array[pointer + i];
}
@@ -117,7 +117,7 @@ public class CArrayOfArcs {
* @param value
* value to be set
*/
- public void setRelative(int i, Arc value) {
+ public void setRelative(final int i, final Arc value) {
array[pointer + i] = value;
}
@@ -127,7 +127,7 @@ public class CArrayOfArcs {
* @param i
* lessen by
*/
- public void lessenPointerBy(int i) {
+ public void lessenPointerBy(final int i) {
// pointer-=i;
setPointer(pointer - i);
}
@@ -147,7 +147,7 @@ public class CArrayOfArcs {
* @param pointer
* pointer value to be set
*/
- public void setPointer(int pointer) {
+ public void setPointer(final int pointer) {
if (!noCheck && pointer > array.length)
throw new IllegalArgumentException("Pointer " + pointer
+ " out of bounds " + array.length);
@@ -160,7 +160,7 @@ public class CArrayOfArcs {
* @param i
* raise by
*/
- public void raisePointerBy(int i) {
+ public void raisePointerBy(final int i) {
// pointer+=i;
setPointer(pointer + i);
}
@@ -188,7 +188,7 @@ public class CArrayOfArcs {
* @param array
* underlaying array
*/
- public void setArray(Arc[] array) {
+ public void setArray(final Arc[] array) {
this.array = array;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
index b5f588960..1c80289a3 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
@@ -10,7 +10,7 @@ public class CArrayOfBreakpts {
/**
* Underlaying array
*/
- private Breakpt[] pole;
+ private final Breakpt[] pole;
/**
* Pointer to array member
@@ -25,7 +25,7 @@ public class CArrayOfBreakpts {
* @param pointer
* pointer (index) to array
*/
- public CArrayOfBreakpts(Breakpt[] array, int pointer) {
+ public CArrayOfBreakpts(final Breakpt[] array, final int pointer) {
this.pole = array;
this.pointer = pointer;
}
@@ -36,7 +36,7 @@ public class CArrayOfBreakpts {
* @param carray
* reference array
*/
- public CArrayOfBreakpts(CArrayOfBreakpts carray) {
+ public CArrayOfBreakpts(final CArrayOfBreakpts carray) {
this.pole = carray.pole;
this.pointer = carray.pointer;
}
@@ -63,7 +63,7 @@ public class CArrayOfBreakpts {
* @param f
* desired value
*/
- public void set(Breakpt f) {
+ public void set(final Breakpt f) {
pole[pointer] = f;
}
@@ -75,7 +75,7 @@ public class CArrayOfBreakpts {
* array index
* @return element at index
*/
- public Breakpt get(int i) {
+ public Breakpt get(final int i) {
return pole[i];
}
@@ -85,7 +85,7 @@ public class CArrayOfBreakpts {
* @param i
* lessen by
*/
- public void lessenPointerBy(int i) {
+ public void lessenPointerBy(final int i) {
pointer -= i;
}
@@ -105,7 +105,7 @@ public class CArrayOfBreakpts {
* @param pointer
* pointer value to be set
*/
- public void setPointer(int pointer) {
+ public void setPointer(final int pointer) {
this.pointer = pointer;
}
@@ -115,7 +115,7 @@ public class CArrayOfBreakpts {
* @param i
* raise by
*/
- public void raisePointerBy(int i) {
+ public void raisePointerBy(final int i) {
pointer += i;
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
index d9e4d0ff1..c9d6a59ad 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
@@ -21,7 +21,7 @@ public class CArrayOfFloats {
/**
* Don't check for array borders?
*/
- private boolean noCheck = true;
+ private final boolean noCheck = true;
/**
* Makes new CArray
@@ -31,7 +31,7 @@ public class CArrayOfFloats {
* @param pointer
* pointer (index) to array
*/
- public CArrayOfFloats(float[] array, int pointer) {
+ public CArrayOfFloats(final float[] array, final int pointer) {
this.array = array;
// this.pointer=pointer;
setPointer(pointer);
@@ -43,7 +43,7 @@ public class CArrayOfFloats {
* @param carray
* reference array
*/
- public CArrayOfFloats(CArrayOfFloats carray) {
+ public CArrayOfFloats(final CArrayOfFloats carray) {
this.array = carray.array;
// this.pointer=carray.pointer;
setPointer(carray.pointer);
@@ -55,7 +55,7 @@ public class CArrayOfFloats {
* @param ctlarray
* underlaying array
*/
- public CArrayOfFloats(float[] ctlarray) {
+ public CArrayOfFloats(final float[] ctlarray) {
this.array = ctlarray;
this.pointer = 0;
}
@@ -83,7 +83,7 @@ public class CArrayOfFloats {
* @param f
* desired value
*/
- public void set(float f) {
+ public void set(final float f) {
array[pointer] = f;
}
@@ -95,7 +95,7 @@ public class CArrayOfFloats {
* array index
* @return element at index
*/
- public float get(int i) {
+ public float get(final int i) {
return array[i];
}
@@ -106,7 +106,7 @@ public class CArrayOfFloats {
* relative index
* @return element at relative index
*/
- public float getRelative(int i) {
+ public float getRelative(final int i) {
return array[pointer + i];
}
@@ -118,7 +118,7 @@ public class CArrayOfFloats {
* @param value
* value to be set
*/
- public void setRelative(int i, float value) {
+ public void setRelative(final int i, final float value) {
array[pointer + i] = value;
}
@@ -128,7 +128,7 @@ public class CArrayOfFloats {
* @param i
* lessen by
*/
- public void lessenPointerBy(int i) {
+ public void lessenPointerBy(final int i) {
// pointer-=i;
setPointer(pointer - i);
}
@@ -148,7 +148,7 @@ public class CArrayOfFloats {
* @param pointer
* pointer value to be set
*/
- public void setPointer(int pointer) {
+ public void setPointer(final int pointer) {
if (!noCheck && pointer > array.length)
throw new IllegalArgumentException("Pointer " + pointer
+ " out of bounds " + array.length);
@@ -161,7 +161,7 @@ public class CArrayOfFloats {
* @param i
* raise by
*/
- public void raisePointerBy(int i) {
+ public void raisePointerBy(final int i) {
// pointer+=i;
setPointer(pointer + i);
}
@@ -189,7 +189,7 @@ public class CArrayOfFloats {
* @param array
* underlaying array
*/
- public void setArray(float[] array) {
+ public void setArray(final float[] array) {
this.array = array;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
index e7bbac16a..0d769004a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
@@ -25,7 +25,7 @@ public class CArrayOfQuiltspecs {
* @param pointer
* pointer (index) to array
*/
- public CArrayOfQuiltspecs(Quiltspec[] array, int pointer) {
+ public CArrayOfQuiltspecs(final Quiltspec[] array, final int pointer) {
this.array = array;
this.pointer = pointer;
}
@@ -36,7 +36,7 @@ public class CArrayOfQuiltspecs {
* @param carray
* reference array
*/
- public CArrayOfQuiltspecs(CArrayOfQuiltspecs carray) {
+ public CArrayOfQuiltspecs(final CArrayOfQuiltspecs carray) {
this.array = carray.array;
this.pointer = carray.pointer;
}
@@ -47,7 +47,7 @@ public class CArrayOfQuiltspecs {
* @param array
* underlaying array
*/
- public CArrayOfQuiltspecs(Quiltspec[] array) {
+ public CArrayOfQuiltspecs(final Quiltspec[] array) {
this.array = array;
this.pointer = 0;
}
@@ -74,7 +74,7 @@ public class CArrayOfQuiltspecs {
* @param f
* desired value
*/
- public void set(Quiltspec f) {
+ public void set(final Quiltspec f) {
array[pointer] = f;
}
@@ -86,7 +86,7 @@ public class CArrayOfQuiltspecs {
* array index
* @return element at index
*/
- public Quiltspec get(int i) {
+ public Quiltspec get(final int i) {
return array[i];
}
@@ -96,7 +96,7 @@ public class CArrayOfQuiltspecs {
* @param i
* lessen by
*/
- public void lessenPointerBy(int i) {
+ public void lessenPointerBy(final int i) {
pointer -= i;
}
@@ -116,7 +116,7 @@ public class CArrayOfQuiltspecs {
* @param pointer
* pointer value to be set
*/
- public void setPointer(int pointer) {
+ public void setPointer(final int pointer) {
this.pointer = pointer;
}
@@ -126,7 +126,7 @@ public class CArrayOfQuiltspecs {
* @param i
* raise by
*/
- public void raisePointerBy(int i) {
+ public void raisePointerBy(final int i) {
pointer += i;
}
@@ -154,7 +154,7 @@ public class CArrayOfQuiltspecs {
* @param array
* underlaying array
*/
- public void setArray(Quiltspec[] array) {
+ public void setArray(final Quiltspec[] array) {
this.array = array;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
index ea3a3d14e..5fccbc598 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
@@ -59,32 +59,32 @@ public class Curve {
/**
* OpenGL maps
*/
- private Mapdesc mapdesc;
+ private final Mapdesc mapdesc;
/**
* Does the curve need sampling
*/
- private boolean needsSampling;
+ private final boolean needsSampling;
/**
* Culling
*/
- private int cullval;
+ private final int cullval;
/**
* Number of coords
*/
- private int stride;
+ private final int stride;
/**
* Curve order
*/
- private int order;
+ private final int order;
/**
* Holds conversion range borders
*/
- private float[] range;
+ private final float[] range;
/**
* Subdivision stepsize
@@ -110,7 +110,7 @@ public class Curve {
* @param c
* next curve in linked list
*/
- public Curve(Quilt geo, float[] pta, float[] ptb, Curve c) {
+ public Curve(final Quilt geo, final float[] pta, final float[] ptb, final Curve c) {
spts = new float[MAXORDER * MAXCOORDS];
@@ -125,8 +125,8 @@ public class Curve {
stride = MAXCOORDS;
// CArrayOfFloats ps = geo.cpts;
- CArrayOfFloats ps = new CArrayOfFloats(geo.cpts.getArray(), 0);
- CArrayOfQuiltspecs qs = geo.qspec;
+ final CArrayOfFloats ps = new CArrayOfFloats(geo.cpts.getArray(), 0);
+ final CArrayOfQuiltspecs qs = geo.qspec;
ps.raisePointerBy(qs.get().offset);
ps.raisePointerBy(qs.get().index * qs.get().order * qs.get().stride);
@@ -182,11 +182,11 @@ public class Curve {
} else {
assert (order <= MAXORDER);
- float tmp[][] = new float[MAXORDER][MAXCOORDS];
+ final float tmp[][] = new float[MAXORDER][MAXCOORDS];
- int tstride = (MAXORDER);
+ final int tstride = (MAXORDER);
- int val = 0;
+ final int val = 0;
// mapdesc.project(spts,stride,tmp,tstride,order);
// System.out.println("TODO curve.getsptepsize mapdesc.project");
@@ -194,7 +194,7 @@ public class Curve {
if (val == 0) {
setstepsize(mapdesc.maxrate);
} else {
- float t = mapdesc.getProperty(NurbsConsts.N_PIXEL_TOLERANCE);
+ final float t = mapdesc.getProperty(NurbsConsts.N_PIXEL_TOLERANCE);
if (mapdesc.isParametricDistanceSampling()) {
// System.out.println("TODO curve.getstepsize - parametric");
} else if (mapdesc.isPathLengthSampling()) {
@@ -212,7 +212,7 @@ public class Curve {
* Sets maximum subdivision step size
* @param max maximum subdivision step size
*/
- private void setstepsize(float max) {
+ private void setstepsize(final float max) {
// DONE
stepsize = (max >= 1) ? (range[2] / max) : range[2];
minstepsize = stepsize;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curvelist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curvelist.java
index 80baf207b..96081a8ec 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curvelist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curvelist.java
@@ -67,7 +67,7 @@ public class Curvelist {
* @param pta range start
* @param ptb range end
*/
- public Curvelist(Quilt qlist, float[] pta, float[] ptb) {
+ public Curvelist(final Quilt qlist, final float[] pta, final float[] ptb) {
// DONE
curve = null;
range = new float[3];
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java
index d9d012606..e1b4cb2bb 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java
@@ -49,7 +49,7 @@ public class DisplayList {
* @param m invoked method
* @param arg method argument
*/
- public void append(Object src, Method m, Object arg) {
+ public void append(final Object src, final Method m, final Object arg) {
// TODO Auto-generated method stub
// System.out.println("TODO displaylist append");
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
index f9c4c2d6f..30f52d5cc 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
@@ -68,7 +68,7 @@ public class Flist {
* Grows list
* @param maxpts maximum desired size
*/
- public void grow(int maxpts) {
+ public void grow(final int maxpts) {
// DONE
if (npts < maxpts) {
// npts=2*maxpts;
@@ -106,7 +106,7 @@ public class Flist {
* @param from start from
* @param to end at
*/
- public void taper(float from, float to) {
+ public void taper(final float from, final float to) {
// DONE
while (pts[start] != from) {
@@ -123,7 +123,7 @@ public class Flist {
* Adds breakpoint value
* @param f value
*/
- public void add(float f) {
+ public void add(final float f) {
//DONE
pts[end++] = f;
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
index 1dcf393a9..b7fa722ec 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
@@ -175,7 +175,7 @@ public class Knotspec {
break;
}
- CArrayOfFloats k = new CArrayOfFloats(kfirst);
+ final CArrayOfFloats k = new CArrayOfFloats(kfirst);
k.mm();
for (; k.getPointer() >= inkbegin.getPointer(); k.mm())
@@ -183,7 +183,7 @@ public class Knotspec {
break;
k.pp();
- Breakpt[] bbeginArray = new Breakpt[(klast.getPointer() - kfirst
+ final Breakpt[] bbeginArray = new Breakpt[(klast.getPointer() - kfirst
.getPointer()) + 1];
for (int i = 0; i < bbeginArray.length; i++)
bbeginArray[i] = new Breakpt();
@@ -218,7 +218,7 @@ public class Knotspec {
*/
private void factors() {
// DONE
- CArrayOfFloats mid = new CArrayOfFloats(outkend.getArray(), (outkend
+ final CArrayOfFloats mid = new CArrayOfFloats(outkend.getArray(), (outkend
.getPointer() - 1)
- order + bend.get().multi);
@@ -226,18 +226,18 @@ public class Knotspec {
if (sbegin != null)
fptr = new CArrayOfFloats(sbegin);
- for (CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend); bpt
+ for (final CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend); bpt
.getPointer() >= bbegin.getPointer(); bpt.mm()) {
mid.lessenPointerBy(bpt.get().multi);
- int def = bpt.get().def - 1;
+ final int def = bpt.get().def - 1;
if (def < 0)
continue;
- float kv = bpt.get().value;
+ final float kv = bpt.get().value;
- CArrayOfFloats kf = new CArrayOfFloats(mid.getArray(), (mid
+ final CArrayOfFloats kf = new CArrayOfFloats(mid.getArray(), (mid
.getPointer() - def)
+ (order - 1));
- for (CArrayOfFloats kl = new CArrayOfFloats(kf.getArray(), kf
+ for (final CArrayOfFloats kl = new CArrayOfFloats(kf.getArray(), kf
.getPointer()
+ def); kl.getPointer() != kf.getPointer(); kl.mm()) {
CArrayOfFloats kh, kt;
@@ -257,10 +257,10 @@ public class Knotspec {
*/
private void knots() {
// DONE
- CArrayOfFloats inkpt = new CArrayOfFloats(kleft.getArray(), kleft
+ final CArrayOfFloats inkpt = new CArrayOfFloats(kleft.getArray(), kleft
.getPointer()
- order);
- CArrayOfFloats inkend = new CArrayOfFloats(kright.getArray(), kright
+ final CArrayOfFloats inkend = new CArrayOfFloats(kright.getArray(), kright
.getPointer()
+ bend.get().def);
@@ -279,8 +279,8 @@ public class Knotspec {
*/
private void breakpoints() {
// DONE
- CArrayOfBreakpts ubpt = new CArrayOfBreakpts(bbegin);
- CArrayOfBreakpts ubend = new CArrayOfBreakpts(bend);
+ final CArrayOfBreakpts ubpt = new CArrayOfBreakpts(bbegin);
+ final CArrayOfBreakpts ubend = new CArrayOfBreakpts(bend);
int nfactors = 0;
ubpt.get().value = ubend.get().value;
@@ -320,13 +320,13 @@ public class Knotspec {
* @param _outpt
* output control points
*/
- public void copy(CArrayOfFloats _inpt, CArrayOfFloats _outpt) {
- CArrayOfFloats inpt = new CArrayOfFloats(_inpt);
- CArrayOfFloats outpt = new CArrayOfFloats(_outpt);
+ public void copy(final CArrayOfFloats _inpt, final CArrayOfFloats _outpt) {
+ final CArrayOfFloats inpt = new CArrayOfFloats(_inpt);
+ final CArrayOfFloats outpt = new CArrayOfFloats(_outpt);
inpt.raisePointerBy(preoffset);
if (next != null) {
- for (CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
+ for (final CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
outpt.getPointer() + prewidth); outpt.getPointer() != lpt
.getPointer(); outpt.raisePointerBy(poststride)) {
next.copy(inpt, outpt);
@@ -334,7 +334,7 @@ public class Knotspec {
}
} else {
- for (CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
+ for (final CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
outpt.getPointer() + prewidth); outpt.getPointer() != lpt
.getPointer(); outpt.raisePointerBy(poststride)) {
pt_io_copy(outpt, inpt);
@@ -352,7 +352,7 @@ public class Knotspec {
* @param frompt
* destination control point
*/
- private void pt_io_copy(CArrayOfFloats topt, CArrayOfFloats frompt) {
+ private void pt_io_copy(final CArrayOfFloats topt, final CArrayOfFloats frompt) {
// DONE
switch (ncoords) {
case 4:
@@ -378,8 +378,8 @@ public class Knotspec {
* @param _p
* inserted knot
*/
- public void transform(CArrayOfFloats _p) {
- CArrayOfFloats p = new CArrayOfFloats(_p);
+ public void transform(final CArrayOfFloats _p) {
+ final CArrayOfFloats p = new CArrayOfFloats(_p);
// DONE
if (next != null) {//surface code
if (this.equals(kspectotrans)) {
@@ -387,13 +387,13 @@ public class Knotspec {
} else {
if (istransformed) {
p.raisePointerBy(postoffset);
- for (CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
+ for (final CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
p.getPointer() + postwidth); p.getPointer() != pend
.getPointer(); p.raisePointerBy(poststride))
next.transform(p);
} else {
- CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
+ final CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
.getPointer()
+ prewidth);
for (; p.getPointer() != pend.getPointer(); p
@@ -408,13 +408,13 @@ public class Knotspec {
} else {
if (istransformed) {
p.raisePointerBy(postoffset);
- for (CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
+ for (final CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
p.getPointer() + postwidth); p.getPointer() != pend
.getPointer(); p.raisePointerBy(poststride)) {
kspectotrans.insert(p);
}
} else {
- CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
+ final CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
.getPointer()
+ prewidth);
for (; p.getPointer() != pend.getPointer(); p
@@ -432,27 +432,27 @@ public class Knotspec {
* @param p
* inserted knot
*/
- private void insert(CArrayOfFloats p) {
+ private void insert(final CArrayOfFloats p) {
// DONE
CArrayOfFloats fptr = null;
if (sbegin != null)
fptr = new CArrayOfFloats(sbegin);
- CArrayOfFloats srcpt = new CArrayOfFloats(p.getArray(), p.getPointer()
+ final CArrayOfFloats srcpt = new CArrayOfFloats(p.getArray(), p.getPointer()
+ prewidth - poststride);
// CArrayOfFloats srcpt = new CArrayOfFloats(p.getArray(), prewidth -
// poststride);
- CArrayOfFloats dstpt = new CArrayOfFloats(p.getArray(), p.getPointer()
+ final CArrayOfFloats dstpt = new CArrayOfFloats(p.getArray(), p.getPointer()
+ postwidth + postoffset - poststride);
// CArrayOfFloats dstpt = new CArrayOfFloats(p.getArray(), postwidth +
// postoffset - poststride);
- CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend);
+ final CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend);
- for (CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(), srcpt
+ for (final CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(), srcpt
.getPointer()
- poststride * bpt.get().def); srcpt.getPointer() != pend
.getPointer(); pend.raisePointerBy(poststride)) {
- CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
- for (CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(), srcpt
+ final CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
+ for (final CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(), srcpt
.getPointer()
- poststride); p2.getPointer() != pend.getPointer(); p1
.setPointer(p2.getPointer()), p2
@@ -469,15 +469,15 @@ public class Knotspec {
dstpt.lessenPointerBy(poststride);
srcpt.lessenPointerBy(poststride);
}
- for (CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(),
+ for (final CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(),
srcpt.getPointer() - poststride * bpt.get().def); srcpt
.getPointer() != pend.getPointer(); pend
.raisePointerBy(poststride), dstpt
.lessenPointerBy(poststride)) {
pt_oo_copy(dstpt, srcpt);
- CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
+ final CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
- for (CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(),
+ for (final CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(),
srcpt.getPointer() - poststride); p2.getPointer() != pend
.getPointer(); p1.setPointer(p2.getPointer()), p2
.lessenPointerBy(poststride)) {
@@ -496,7 +496,7 @@ public class Knotspec {
* @param frompt
* distance ctrl point
*/
- private void pt_oo_copy(CArrayOfFloats topt, CArrayOfFloats frompt) {
+ private void pt_oo_copy(final CArrayOfFloats topt, final CArrayOfFloats frompt) {
// DONE
// this is a "trick" with case - "break" is omitted so it comes through all cases
switch (ncoords) {
@@ -531,8 +531,8 @@ public class Knotspec {
* @param b
* 1 - alpha
*/
- private void pt_oo_sum(CArrayOfFloats x, CArrayOfFloats y,
- CArrayOfFloats z, float a, double b) {
+ private void pt_oo_sum(final CArrayOfFloats x, final CArrayOfFloats y,
+ final CArrayOfFloats z, final float a, final double b) {
// DONE
switch (ncoords) {
case 4:
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
index 571f44f06..76b59231c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
@@ -85,7 +85,7 @@ public class Knotvector {
* @param knot
* knots
*/
- public Knotvector(int nknots, int stride, int order, float[] knot) {
+ public Knotvector(final int nknots, final int stride, final int order, final float[] knot) {
// DONE
init(nknots, stride, order, knot);
}
@@ -102,7 +102,7 @@ public class Knotvector {
* @param knot
* knots
*/
- public void init(int nknots, int stride, int order, float[] knot) {
+ public void init(final int nknots, final int stride, final int order, final float[] knot) {
// DONE
this.knotcount = nknots;
this.stride = stride;
@@ -158,7 +158,7 @@ public class Knotvector {
* @param msg
* message to be shown
*/
- public void show(String msg) {
+ public void show(final String msg) {
// TODO Auto-generated method stub
// System.out.println("TODO knotvector.show");
@@ -173,7 +173,7 @@ public class Knotvector {
* second knot
* @return knots are/are not equal
*/
- public static boolean identical(float a, float b) {
+ public static boolean identical(final float a, final float b) {
return ((a - b) < TOLERANCE) ? true : false;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
index 86638a827..95ce60c25 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
@@ -64,22 +64,22 @@ public class Mapdesc {
/**
* Map type
*/
- private int type;
+ private final int type;
/**
* Number of homogenous coords
*/
- private int hcoords;
+ private final int hcoords;
/**
* Number of inhomogenous coords
*/
- private int inhcoords;
+ private final int inhcoords;
/**
* Not used
*/
- private int mask;
+ private final int mask;
/**
* Value of N_PIXEL_TOLERANCE property
@@ -144,22 +144,22 @@ public class Mapdesc {
/**
* Not used
*/
- private float[][] bmat;
+ private final float[][] bmat;
/**
* Sampling matrix
*/
- private float[][] smat;
+ private final float[][] smat;
/**
* Not used
*/
- private float[][] cmat;
+ private final float[][] cmat;
/**
* Not used
*/
- private float[] bboxsize;
+ private final float[] bboxsize;
/**
* Makes new mapdesc
@@ -168,7 +168,7 @@ public class Mapdesc {
* @param ncoords number of control points coords
* @param backend backend object
*/
- public Mapdesc(int type, int rational, int ncoords, Backend backend) {
+ public Mapdesc(final int type, final int rational, final int ncoords, final Backend backend) {
// DONE
this.type = type;
this.isrational = rational;
@@ -210,7 +210,7 @@ public class Mapdesc {
* Make matrix identity matrix
* @param arr matrix
*/
- private void identify(float[][] arr) {
+ private void identify(final float[][] arr) {
// DONE
for (int i = 0; i < MAXCOORDS; i++)
for (int j = 0; j < MAXCOORDS; j++)
@@ -225,7 +225,7 @@ public class Mapdesc {
* @param tag property tag
* @return is/is not property
*/
- public boolean isProperty(int tag) {
+ public boolean isProperty(final int tag) {
boolean ret;
switch (tag) {
case NurbsConsts.N_PIXEL_TOLERANCE:
@@ -347,7 +347,7 @@ public class Mapdesc {
* @param tag property tag
* @return property value
*/
- public float getProperty(int tag) {
+ public float getProperty(final int tag) {
// TODO Auto-generated method stub
// System.out.println("TODO mapdesc.getproperty");
return 0;
@@ -358,7 +358,7 @@ public class Mapdesc {
* @param tag property tag
* @param value desired value
*/
- public void setProperty(int tag, float value) {
+ public void setProperty(final int tag, float value) {
// TODO Auto-generated method stub
switch (tag) {
case NurbsConsts.N_PIXEL_TOLERANCE:
@@ -412,8 +412,8 @@ public class Mapdesc {
* @param sp breakpoints
* @param outstride output number of control points' coordinates
*/
- public void xformSampling(CArrayOfFloats pts, int order, int stride,
- float[] sp, int outstride) {
+ public void xformSampling(final CArrayOfFloats pts, final int order, final int stride,
+ final float[] sp, final int outstride) {
// DONE
xFormMat(smat, pts, order, stride, sp, outstride);
}
@@ -427,8 +427,8 @@ public class Mapdesc {
* @param cp breakpoints
* @param outstride output number of control points' coordinates
*/
- private void xFormMat(float[][] mat, CArrayOfFloats pts, int order,
- int stride, float[] cp, int outstride) {
+ private void xFormMat(final float[][] mat, final CArrayOfFloats pts, final int order,
+ final int stride, final float[] cp, final int outstride) {
// TODO Auto-generated method stub
// System.out.println("TODO mapdsc.xformmat ; change cp from float[] to carrayoffloats");
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Maplist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Maplist.java
index af8024109..7f9d7c5a0 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Maplist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Maplist.java
@@ -48,13 +48,13 @@ public class Maplist {
/**
* Backend class
*/
- private Backend backend;
+ private final Backend backend;
/**
* Makes new Maplist
* @param backend Backend class
*/
- public Maplist(Backend backend) {
+ public Maplist(final Backend backend) {
this.backend = backend;
}
@@ -72,9 +72,9 @@ public class Maplist {
* @param rational is map rational
* @param ncoords number of coords
*/
- public void define(int type, int rational, int ncoords) {
+ public void define(final int type, final int rational, final int ncoords) {
// DONE
- Mapdesc m = locate(type);
+ final Mapdesc m = locate(type);
assert (m == null || (m.isrational == rational && m.ncoords == ncoords));
add(type, rational, ncoords);
@@ -86,9 +86,9 @@ public class Maplist {
* @param rational is map rational
* @param ncoords number of coords
*/
- private void add(int type, int rational, int ncoords) {
+ private void add(final int type, final int rational, final int ncoords) {
// DONE
- Mapdesc map = new Mapdesc(type, rational, ncoords, backend);
+ final Mapdesc map = new Mapdesc(type, rational, ncoords, backend);
if (maps == null) {
maps = map;
} else {
@@ -102,7 +102,7 @@ public class Maplist {
* @param type map type
* @return Mapdesc of type or null if there is no such map
*/
- public Mapdesc locate(int type) {
+ public Mapdesc locate(final int type) {
// DONE
Mapdesc m = null;
for (m = maps; m != null; m = m.next)
@@ -116,7 +116,7 @@ public class Maplist {
* @param type maptype
* @return Mapdesc of type or null if there is no such map
*/
- public Mapdesc find(int type) {
+ public Mapdesc find(final int type) {
return locate(type);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
index a686da696..a957c21a8 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
@@ -70,7 +70,7 @@ public class O_nurbscurve {
* Makes new O_nurbscurve
* @param realType type of curve
*/
- public O_nurbscurve(int realType) {
+ public O_nurbscurve(final int realType) {
// DONE
this.type = realType;
this.owner = null;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbssurface.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbssurface.java
index 867f43657..4df3c14ca 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbssurface.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbssurface.java
@@ -64,13 +64,13 @@ public class O_nurbssurface {
/**
* Surface type
*/
- private int type;
+ private final int type;
/**
* Makes new O_nurbssurface of type
* @param type surface type
*/
- public O_nurbssurface(int type) {
+ public O_nurbssurface(final int type) {
this.type = type;
this.owner = null;
this.next = null;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java
index a44f2451c..0fd4baa81 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java
@@ -48,7 +48,7 @@ public class Patch {
* @param ptb
* @param patch
*/
- public Patch(Quilt q, float[] pta, float[] ptb, Patch patch) {
+ public Patch(final Quilt q, final float[] pta, final float[] ptb, final Patch patch) {
// System.out.println("TODO patch.constructor");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
index 240c905a2..68b01d8d0 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
@@ -57,7 +57,7 @@ public class Patchlist {
* @param pta low border
* @param ptb high border
*/
- public Patchlist(Quilt quilts, float[] pta, float[] ptb) {
+ public Patchlist(final Quilt quilts, final float[] pta, final float[] ptb) {
// DONE
patch = null;
@@ -81,7 +81,7 @@ public class Patchlist {
* @param param
* @param mid
*/
- public Patchlist(Patchlist patchlist, int param, float mid) {
+ public Patchlist(final Patchlist patchlist, final int param, final float mid) {
// TODO Auto-generated constructor stub
// System.out.println("TODO patchlist.konstruktor 2");
}
@@ -120,7 +120,7 @@ public class Patchlist {
* @param i
* @return false
*/
- public boolean needsSubdivision(int i) {
+ public boolean needsSubdivision(final int i) {
// TODO Auto-generated method stub
// System.out.println("TODO patchlist.needsSubdivision");
return false;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
index 79f36ce43..155549bce 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
@@ -67,7 +67,7 @@ public class Property {
* @param value
* property value
*/
- public Property(int type, int tag, float value) {
+ public Property(final int type, final int tag, final float value) {
this.type = type;
this.tag = tag;
this.value = value;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/PwlArc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/PwlArc.java
index bcbd20a16..8e04baf88 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/PwlArc.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/PwlArc.java
@@ -44,7 +44,7 @@ public class PwlArc {
/**
* Number of points
*/
- private int npts;
+ private final int npts;
/**
* Vertexes
@@ -54,14 +54,14 @@ public class PwlArc {
/**
* Arc type
*/
- private int type;
+ private final int type;
/**
* Makes new trimming arc
* @param i num ber of vertexes
* @param p trimming vertexes array
*/
- public PwlArc(int i, TrimVertex[] p) {
+ public PwlArc(final int i, final TrimVertex[] p) {
// DONE
this.npts = i;
this.pts = p;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java
index 6bea4928c..2e2532a35 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java
@@ -74,10 +74,10 @@ public class Quilt {
* Makes new quilt with mapdesc
* @param mapdesc map description
*/
- public Quilt(Mapdesc mapdesc) {
+ public Quilt(final Mapdesc mapdesc) {
// DONE
this.mapdesc = mapdesc;
- Quiltspec[] tmpquilts = new Quiltspec[MAXDIM];
+ final Quiltspec[] tmpquilts = new Quiltspec[MAXDIM];
for (int i = 0; i < tmpquilts.length; i++)
tmpquilts[i] = new Quiltspec();
this.qspec = new CArrayOfQuiltspecs(tmpquilts);
@@ -91,9 +91,9 @@ public class Quilt {
* @param ctrlarr control points
* @param coords control points coords
*/
- public void toBezier(Knotvector sknotvector, Knotvector tknotvector,
- CArrayOfFloats ctrlarr, int coords) {
- Splinespec spline = new Splinespec(2);
+ public void toBezier(final Knotvector sknotvector, final Knotvector tknotvector,
+ final CArrayOfFloats ctrlarr, final int coords) {
+ final Splinespec spline = new Splinespec(2);
spline.kspecinit(sknotvector, tknotvector);
spline.select();
spline.layout(coords);
@@ -108,9 +108,9 @@ public class Quilt {
* @param ctlarray control points
* @param ncoords number of coordinates
*/
- public void toBezier(Knotvector knots, CArrayOfFloats ctlarray, int ncoords) {
+ public void toBezier(final Knotvector knots, final CArrayOfFloats ctlarray, final int ncoords) {
// DONE
- Splinespec spline = new Splinespec(1);
+ final Splinespec spline = new Splinespec(1);
spline.kspecinit(knots);
spline.select();
spline.layout(ncoords);
@@ -125,7 +125,7 @@ public class Quilt {
* @param ptb high border
* @param backend Backend
*/
- public void downloadAll(float[] pta, float[] ptb, Backend backend) {
+ public void downloadAll(final float[] pta, final float[] ptb, final Backend backend) {
// DONE
for (Quilt m = this; m != null; m = m.next) {
m.select(pta, ptb);
@@ -138,11 +138,11 @@ public class Quilt {
* Renders arcs/patches
* @param backend Backend for rendering
*/
- private void download(Backend backend) {
+ private void download(final Backend backend) {
// DONE
if (getDimension() == 2) {
- CArrayOfFloats ps = new CArrayOfFloats(cpts);
+ final CArrayOfFloats ps = new CArrayOfFloats(cpts);
ps.raisePointerBy(qspec.get(0).offset);
ps.raisePointerBy(qspec.get(1).offset);
ps.raisePointerBy(qspec.get(0).index * qspec.get(0).order
@@ -159,7 +159,7 @@ public class Quilt {
} else {// code for curves
// CArrayOfFloats ps=new CArrayOfFloats(cpts);
- CArrayOfFloats ps = new CArrayOfFloats(cpts.getArray(), 0);
+ final CArrayOfFloats ps = new CArrayOfFloats(cpts.getArray(), 0);
ps.raisePointerBy(qspec.get(0).offset);
ps.raisePointerBy(qspec.get(0).index * qspec.get(0).order
* qspec.get(0).stride);
@@ -185,9 +185,9 @@ public class Quilt {
* @param pta range
* @param ptb range
*/
- private void select(float[] pta, float[] ptb) {
+ private void select(final float[] pta, final float[] ptb) {
// DONE
- int dim = eqspec.getPointer() - qspec.getPointer();
+ final int dim = eqspec.getPointer() - qspec.getPointer();
int i, j;
for (i = 0; i < dim; i++) {
for (j = qspec.get(i).width - 1; j >= 0; j--)
@@ -205,7 +205,7 @@ public class Quilt {
* @param to high param
* @param bpts breakpoints
*/
- public void getRange(float[] from, float[] to, Flist bpts) {
+ public void getRange(final float[] from, final float[] to, final Flist bpts) {
// DONE
getRange(from, to, 0, bpts);
@@ -218,9 +218,9 @@ public class Quilt {
* @param i from/to array index
* @param list breakpoints
*/
- private void getRange(float[] from, float[] to, int i, Flist list) {
+ private void getRange(final float[] from, final float[] to, final int i, final Flist list) {
// DONE
- Quilt maps = this;
+ final Quilt maps = this;
from[i] = maps.qspec.get(i).breakpoints[0];
to[i] = maps.qspec.get(i).breakpoints[maps.qspec.get(i).width];
int maxpts = 0;
@@ -262,7 +262,7 @@ public class Quilt {
* @param slist u direction breakpoints
* @param tlist v direction breakpoints
*/
- public void getRange(float[] from, float[] to, Flist slist, Flist tlist) {
+ public void getRange(final float[] from, final float[] to, final Flist slist, final Flist tlist) {
// DONE
getRange(from, to, 0, slist);
getRange(from, to, 1, tlist);
@@ -275,7 +275,7 @@ public class Quilt {
* @param tbrkpts
* @param rate
*/
- public void findRates(Flist sbrkpts, Flist tbrkpts, float[] rate) {
+ public void findRates(final Flist sbrkpts, final Flist tbrkpts, final float[] rate) {
// TODO Auto-generated method stub
// System.out.println("TODO quilt.findrates");
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
index 7c636122f..5c180f345 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
@@ -85,7 +85,7 @@ public class Renderhints {
* Set property value
* @param prop property
*/
- public void setProperty(Property prop) {
+ public void setProperty(final Property prop) {
switch (prop.type) {
case NurbsConsts.N_DISPLAY:
display_method = (int) prop.value;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Splinespec.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Splinespec.java
index f1c779c2f..5e44c3259 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Splinespec.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Splinespec.java
@@ -44,7 +44,7 @@ public class Splinespec {
/**
* Dimension
*/
- private int dim;
+ private final int dim;
/**
* Knot vector specs
@@ -60,7 +60,7 @@ public class Splinespec {
* Makes new Splinespec with given dimension
* @param i dimension
*/
- public Splinespec(int i) {
+ public Splinespec(final int i) {
// DONE
this.dim = i;
}
@@ -69,7 +69,7 @@ public class Splinespec {
* Initializes knotspec according to knotvector
* @param knotvector basic knotvector
*/
- public void kspecinit(Knotvector knotvector) {
+ public void kspecinit(final Knotvector knotvector) {
// DONE
this.kspec = new Knotspec();
kspec.inkbegin = new CArrayOfFloats(knotvector.knotlist, 0);
@@ -85,10 +85,10 @@ public class Splinespec {
* @param sknotvector knotvector in u dir
* @param tknotvector knotvector in v dir
*/
- public void kspecinit(Knotvector sknotvector, Knotvector tknotvector) {
+ public void kspecinit(final Knotvector sknotvector, final Knotvector tknotvector) {
// DONE
this.kspec = new Knotspec();
- Knotspec tkspec = new Knotspec();
+ final Knotspec tkspec = new Knotspec();
kspec.inkbegin = new CArrayOfFloats(sknotvector.knotlist, 0);
kspec.inkend = new CArrayOfFloats(sknotvector.knotlist,
@@ -121,7 +121,7 @@ public class Splinespec {
* Prepares for conversion
* @param ncoords number of coords
*/
- public void layout(int ncoords) {
+ public void layout(final int ncoords) {
// DONE
int stride = ncoords;
for (Knotspec knotspec = kspec; knotspec != null; knotspec = knotspec.next) {
@@ -143,9 +143,9 @@ public class Splinespec {
* Prepares quilt for conversion
* @param quilt quilt to work with
*/
- public void setupquilt(Quilt quilt) {
+ public void setupquilt(final Quilt quilt) {
// DONE
- CArrayOfQuiltspecs qspec = new CArrayOfQuiltspecs(quilt.qspec);
+ final CArrayOfQuiltspecs qspec = new CArrayOfQuiltspecs(quilt.qspec);
quilt.eqspec = new CArrayOfQuiltspecs(qspec.getArray(), dim);
for (Knotspec knotspec = kspec; knotspec != null;) {
qspec.get().stride = knotspec.poststride;
@@ -159,8 +159,8 @@ public class Splinespec {
qspec.get().bdry[1] = (knotspec.kright.getPointer() == knotspec.klast
.getPointer()) ? 1 : 0;
qspec.get().breakpoints = new float[qspec.get().width + 1];
- CArrayOfFloats k = new CArrayOfFloats(qspec.get().breakpoints, 0);
- for (CArrayOfBreakpts bk = new CArrayOfBreakpts(knotspec.bbegin); bk
+ final CArrayOfFloats k = new CArrayOfFloats(qspec.get().breakpoints, 0);
+ for (final CArrayOfBreakpts bk = new CArrayOfBreakpts(knotspec.bbegin); bk
.getPointer() <= knotspec.bend.getPointer(); bk.pp()) {
k.set(bk.get().value);
k.pp();
@@ -177,7 +177,7 @@ public class Splinespec {
* Copies array of control points to output array
* @param ctlarray control points array
*/
- public void copy(CArrayOfFloats ctlarray) {
+ public void copy(final CArrayOfFloats ctlarray) {
// DONE
kspec.copy(ctlarray, outcpts);
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
index 4d8296cca..d7c1dbf3c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
@@ -148,7 +148,7 @@ public class Subdivider {
/**
* Initializes quilt list
*/
- public void beginQuilts(Backend backend) {
+ public void beginQuilts(final Backend backend) {
// DONE
qlist = null;
renderhints = new Renderhints();
@@ -162,7 +162,7 @@ public class Subdivider {
* Adds quilt to linked list
* @param quilt added quilt
*/
- public void addQuilt(Quilt quilt) {
+ public void addQuilt(final Quilt quilt) {
// DONE
if (qlist == null)
qlist = quilt;
@@ -198,8 +198,8 @@ public class Subdivider {
}
}
- float[] from = new float[2];
- float[] to = new float[2];
+ final float[] from = new float[2];
+ final float[] to = new float[2];
spbrkpts = new Flist();
tpbrkpts = new Flist();
@@ -215,7 +215,7 @@ public class Subdivider {
makeBorderTrim(from, to);
}
} else {
- float[] rate = new float[2];
+ final float[] rate = new float[2];
qlist.findRates(spbrkpts, tpbrkpts, rate);
// System.out.println("subdivider.drawsurfaces decompose");
}
@@ -231,8 +231,8 @@ public class Subdivider {
int num_v_steps;
for (i = spbrkpts.start; i < spbrkpts.end - 1; i++) {
for (j = tpbrkpts.start; j < tpbrkpts.end - 1; j++) {
- float[] pta = new float[2];
- float[] ptb = new float[2];
+ final float[] pta = new float[2];
+ final float[] ptb = new float[2];
pta[0] = spbrkpts.pts[i];
ptb[0] = spbrkpts.pts[i + 1];
@@ -266,7 +266,7 @@ public class Subdivider {
* Empty method
* @param initialbin2
*/
- private void freejarcs(Bin initialbin2) {
+ private void freejarcs(final Bin initialbin2) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.freejarcs");
}
@@ -275,7 +275,7 @@ public class Subdivider {
* Subdivide in U direction
* @param source Trimming arcs source
*/
- private void subdivideInS(Bin source) {
+ private void subdivideInS(final Bin source) {
// DONE
if (renderhints.display_method == NurbsConsts.N_OUTLINE_PARAM) {
outline(source);
@@ -294,13 +294,13 @@ public class Subdivider {
* @param start breakpoints start
* @param end breakpoints end
*/
- private void splitInS(Bin source, int start, int end) {
+ private void splitInS(final Bin source, final int start, final int end) {
// DONE
if (source.isnonempty()) {
if (start != end) {
- int i = start + (end - start) / 2;
- Bin left = new Bin();
- Bin right = new Bin();
+ final int i = start + (end - start) / 2;
+ final Bin left = new Bin();
+ final Bin right = new Bin();
split(source, left, right, 0, spbrkpts.pts[i]);
splitInS(left, start, i);
@@ -329,15 +329,15 @@ public class Subdivider {
* @param start
* @param end
*/
- private void splitInT(Bin source, int start, int end) {
+ private void splitInT(final Bin source, final int start, final int end) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.splitint");
if (source.isnonempty()) {
if (start != end) {
- int i = start + (end - start) / 2;
- Bin left = new Bin();
- Bin right = new Bin();
+ final int i = start + (end - start) / 2;
+ final Bin left = new Bin();
+ final Bin right = new Bin();
split(source, left, right, 1, tpbrkpts.pts[i + 1]);
splitInT(left, start, i);
splitInT(right, i + 1, end);
@@ -352,8 +352,8 @@ public class Subdivider {
setArcTypeBezier();
setDegenerate();
- float[] pta = new float[2];
- float[] ptb = new float[2];
+ final float[] pta = new float[2];
+ final float[] ptb = new float[2];
pta[0] = spbrkpts.pts[s_index - 1];
pta[1] = tpbrkpts.pts[t_index - 1];
@@ -362,7 +362,7 @@ public class Subdivider {
ptb[1] = tpbrkpts.pts[t_index];
qlist.downloadAll(pta, ptb, backend);
- Patchlist patchlist = new Patchlist(qlist, pta, ptb);
+ final Patchlist patchlist = new Patchlist(qlist, pta, ptb);
samplingSplit(source, patchlist,
renderhints.maxsubdivisions, 0);
@@ -381,8 +381,8 @@ public class Subdivider {
* @param subdivisions
* @param param
*/
- private void samplingSplit(Bin source, Patchlist patchlist,
- int subdivisions, int param) {
+ private void samplingSplit(final Bin source, final Patchlist patchlist,
+ final int subdivisions, int param) {
// DONE
if (!source.isnonempty())
return;
@@ -408,13 +408,13 @@ public class Subdivider {
else
param = 1 - param;
- Bin left = new Bin();
- Bin right = new Bin();
+ final Bin left = new Bin();
+ final Bin right = new Bin();
- float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
+ final float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
split(source, left, right, param, mid);
- Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
+ final Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
samplingSplit(left, subpatchlist, subdivisions - 1, param);
samplingSplit(right, subpatchlist, subdivisions - 1, param);
} else {
@@ -433,18 +433,18 @@ public class Subdivider {
* @param subdivisions
* @param param
*/
- private void nonSamplingSplit(Bin source, Patchlist patchlist,
- int subdivisions, int param) {
+ private void nonSamplingSplit(final Bin source, final Patchlist patchlist,
+ final int subdivisions, int param) {
// DONE
if (patchlist.needsNonSamplingSubdivision() && subdivisions > 0) {
param = 1 - param;
- Bin left = new Bin();
- Bin right = new Bin();
+ final Bin left = new Bin();
+ final Bin right = new Bin();
- float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
+ final float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
split(source, left, right, param, mid);
- Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
+ final Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
if (left.isnonempty()) {
if (subpatchlist.cullCheck() == CULL_TRIVIAL_REJECT)
freejarcs(left);
@@ -483,7 +483,7 @@ public class Subdivider {
* @param start
* @param end
*/
- private void monosplitInS(Bin source, int start, int end) {
+ private void monosplitInS(final Bin source, final int start, final int end) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.monosplitins");
}
@@ -492,7 +492,7 @@ public class Subdivider {
* Not used
* @param source
*/
- private void findIrregularS(Bin source) {
+ private void findIrregularS(final Bin source) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.findIrregularS");
}
@@ -510,7 +510,7 @@ public class Subdivider {
* @param source
* @param patchlist
*/
- private void tesselation(Bin source, Patchlist patchlist) {
+ private void tesselation(final Bin source, final Patchlist patchlist) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.tesselation");
}
@@ -531,19 +531,19 @@ public class Subdivider {
* @param param
* @param value
*/
- private void split(Bin bin, Bin left, Bin right, int param, float value) {
+ private void split(final Bin bin, final Bin left, final Bin right, final int param, final float value) {
// DONE
- Bin intersections = new Bin();
- Bin unknown = new Bin();
+ final Bin intersections = new Bin();
+ final Bin unknown = new Bin();
partition(bin, left, intersections, right, unknown, param, value);
- int count = intersections.numarcs();
+ final int count = intersections.numarcs();
// TODO jumpbuffer ??
if (count % 2 == 0) {
- Arc[] arclist = new Arc[MAXARCS];
+ final Arc[] arclist = new Arc[MAXARCS];
CArrayOfArcs list;
if (count >= MAXARCS) {
list = new CArrayOfArcs(new Arc[count]);
@@ -559,7 +559,7 @@ public class Subdivider {
last.set(jarc);
if (param == 0) {// sort into incrasing t order
- ArcSdirSorter sorter = new ArcSdirSorter(this);
+ final ArcSdirSorter sorter = new ArcSdirSorter(this);
sorter.qsort(list, count);
for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
@@ -578,7 +578,7 @@ public class Subdivider {
}
} else {// sort into decreasing s order
- ArcTdirSorter sorter = new ArcTdirSorter(this);
+ final ArcTdirSorter sorter = new ArcTdirSorter(this);
sorter.qsort(list, count);
for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
@@ -609,7 +609,7 @@ public class Subdivider {
* @param arc
* @param relative
*/
- private void join_t(Bin left, Bin right, Arc arc, Arc relative) {
+ private void join_t(final Bin left, final Bin right, final Arc arc, final Arc relative) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.join_t");
}
@@ -619,7 +619,7 @@ public class Subdivider {
* @param arc
* @param relative
*/
- private void check_t(Arc arc, Arc relative) {
+ private void check_t(final Arc arc, final Arc relative) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.check_t");
}
@@ -631,22 +631,22 @@ public class Subdivider {
* @param jarc1
* @param jarc2
*/
- private void join_s(Bin left, Bin right, Arc jarc1, Arc jarc2) {
+ private void join_s(final Bin left, final Bin right, Arc jarc1, Arc jarc2) {
// DONE
if (!jarc1.getitail())
jarc1 = jarc1.next;
if (!jarc2.getitail())
jarc2 = jarc2.next;
- float s = jarc1.tail()[0];
- float t1 = jarc1.tail()[1];
- float t2 = jarc2.tail()[1];
+ final float s = jarc1.tail()[0];
+ final float t1 = jarc1.tail()[1];
+ final float t2 = jarc2.tail()[1];
if (t1 == t2) {
simplelink(jarc1, jarc2);
} else {
- Arc newright = new Arc(Arc.ARC_RIGHT);
- Arc newleft = new Arc(Arc.ARC_LEFT);
+ final Arc newright = new Arc(Arc.ARC_RIGHT);
+ final Arc newleft = new Arc(Arc.ARC_LEFT);
if (isBezierArcType()) {
arctesselator.bezier(newright, s, s, t1, t2);
arctesselator.bezier(newleft, s, s, t2, t1);
@@ -668,7 +668,7 @@ public class Subdivider {
* @param newright
* @param newleft
*/
- private void link(Arc jarc1, Arc jarc2, Arc newright, Arc newleft) {
+ private void link(final Arc jarc1, final Arc jarc2, final Arc newright, final Arc newleft) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.link");
}
@@ -688,7 +688,7 @@ public class Subdivider {
* @param jarc1
* @param jarc2
*/
- private void simplelink(Arc jarc1, Arc jarc2) {
+ private void simplelink(final Arc jarc1, final Arc jarc2) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.simplelink");
}
@@ -698,7 +698,7 @@ public class Subdivider {
* @param arc
* @param relative
*/
- private void check_s(Arc arc, Arc relative) {
+ private void check_s(final Arc arc, final Arc relative) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.check_s");
@@ -714,17 +714,17 @@ public class Subdivider {
* @param param
* @param value
*/
- private void partition(Bin bin, Bin left, Bin intersections, Bin right,
- Bin unknown, int param, float value) {
+ private void partition(final Bin bin, final Bin left, final Bin intersections, final Bin right,
+ final Bin unknown, final int param, final float value) {
- Bin headonleft = new Bin();
- Bin headonright = new Bin();
- Bin tailonleft = new Bin();
- Bin tailonright = new Bin();
+ final Bin headonleft = new Bin();
+ final Bin headonright = new Bin();
+ final Bin tailonleft = new Bin();
+ final Bin tailonright = new Bin();
for (Arc jarc = bin.removearc(); jarc != null; jarc = bin.removearc()) {
- float tdiff = jarc.tail()[param] - value;
- float hdiff = jarc.head()[param] - value;
+ final float tdiff = jarc.tail()[param] - value;
+ final float hdiff = jarc.head()[param] - value;
if (tdiff > 0) {
if (hdiff > 0) {
@@ -732,7 +732,7 @@ public class Subdivider {
} else if (hdiff == 0) {
tailonright.addarc(jarc);
} else {
- Arc jtemp;
+ final Arc jtemp;
switch (arc_split(jarc, param, value, 0)) {
case 2:
tailonright.addarc(jarc);
@@ -785,8 +785,8 @@ public class Subdivider {
* @param right
* @param value
*/
- private void classify_tailonright_t(Bin tailonright, Bin intersections,
- Bin right, float value) {
+ private void classify_tailonright_t(final Bin tailonright, final Bin intersections,
+ final Bin right, final float value) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.classify_tailonright_t");
@@ -799,14 +799,14 @@ public class Subdivider {
* @param out
* @param val
*/
- private void classify_tailonleft_s(Bin bin, Bin in, Bin out, float val) {
+ private void classify_tailonleft_s(final Bin bin, final Bin in, final Bin out, final float val) {
// DONE
Arc j;
while ((j = bin.removearc()) != null) {
j.clearitail();
- float diff = j.next.head()[0] - val;
+ final float diff = j.next.head()[0] - val;
if (diff > 0) {
in.addarc(j);
} else if (diff < 0) {
@@ -831,13 +831,13 @@ public class Subdivider {
* @param out
* @param val
*/
- private void classify_headonright_s(Bin bin, Bin in, Bin out, float val) {
+ private void classify_headonright_s(final Bin bin, final Bin in, final Bin out, final float val) {
// DONE
Arc j;
while ((j = bin.removearc()) != null) {
j.setitail();
- float diff = j.prev.tail()[0] - val;
+ final float diff = j.prev.tail()[0] - val;
if (diff > 0) {
if (ccwTurn_sr(j.prev, j))
out.addarc(j);
@@ -860,7 +860,7 @@ public class Subdivider {
* @param j
* @return false
*/
- private boolean ccwTurn_sr(Arc prev, Arc j) {
+ private boolean ccwTurn_sr(final Arc prev, final Arc j) {
// TODO Auto-generated method stub
// System.out.println("TODO ccwTurn_sr");
return false;
@@ -873,8 +873,8 @@ public class Subdivider {
* @param right
* @param value
*/
- private void classify_headonright_t(Bin headonright, Bin intersections,
- Bin right, float value) {
+ private void classify_headonright_t(final Bin headonright, final Bin intersections,
+ final Bin right, final float value) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.classify_headonright_t");
}
@@ -886,8 +886,8 @@ public class Subdivider {
* @param left
* @param value
*/
- private void classify_tailonleft_t(Bin tailonleft, Bin intersections,
- Bin left, float value) {
+ private void classify_tailonleft_t(final Bin tailonleft, final Bin intersections,
+ final Bin left, final float value) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.classify_tailonleft_t");
}
@@ -899,13 +899,13 @@ public class Subdivider {
* @param out
* @param val
*/
- private void classify_headonleft_t(Bin bin, Bin in, Bin out, float val) {
+ private void classify_headonleft_t(final Bin bin, final Bin in, final Bin out, final float val) {
// DONE
Arc j;
while ((j = bin.removearc()) != null) {
j.setitail();
- float diff = j.prev.tail()[1] - val;
+ final float diff = j.prev.tail()[1] - val;
if (diff > 0) {
out.addarc(j);
} else if (diff < 0) {
@@ -928,7 +928,7 @@ public class Subdivider {
* @param j
* @return false
*/
- private boolean ccwTurn_tl(Arc prev, Arc j) {
+ private boolean ccwTurn_tl(final Arc prev, final Arc j) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.ccwTurn_tl");
return false;
@@ -941,13 +941,13 @@ public class Subdivider {
* @param out
* @param val
*/
- private void classify_tailonright_s(Bin bin, Bin in, Bin out, float val) {
+ private void classify_tailonright_s(final Bin bin, final Bin in, final Bin out, final float val) {
// DONE
Arc j;
while ((j = bin.removearc()) != null) {
j.clearitail();
- float diff = j.next.head()[0] - val;
+ final float diff = j.next.head()[0] - val;
if (diff > 0) {
if (ccwTurn_sr(j, j.next))
out.addarc(j);
@@ -972,13 +972,13 @@ public class Subdivider {
* @param out
* @param val
*/
- private void classify_headonleft_s(Bin bin, Bin in, Bin out, float val) {
+ private void classify_headonleft_s(final Bin bin, final Bin in, final Bin out, final float val) {
// DONE
Arc j;
while ((j = bin.removearc()) != null) {
j.setitail();
- float diff = j.prev.tail()[0] - val;
+ final float diff = j.prev.tail()[0] - val;
if (diff > 0) {
out.addarc(j);
} else if (diff < 0) {
@@ -1002,7 +1002,7 @@ public class Subdivider {
* @param j
* @return false
*/
- private boolean ccwTurn_sl(Arc prev, Arc j) {
+ private boolean ccwTurn_sl(final Arc prev, final Arc j) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.ccwTurn_sl");
return false;
@@ -1016,7 +1016,7 @@ public class Subdivider {
* @param i
* @return 0
*/
- private int arc_split(Arc jarc, int param, float value, int i) {
+ private int arc_split(final Arc jarc, final int param, final float value, final int i) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.arc_split");
return 0;
@@ -1043,7 +1043,7 @@ public class Subdivider {
* Not used
* @param source
*/
- private void outline(Bin source) {
+ private void outline(final Bin source) {
// TODO Auto-generated method stub
// System.out.println("TODO subdivider.outline");
}
@@ -1053,13 +1053,13 @@ public class Subdivider {
* @param from range beginnings
* @param to range ends
*/
- private void makeBorderTrim(float[] from, float[] to) {
+ private void makeBorderTrim(final float[] from, final float[] to) {
// DONE
- float smin = from[0];
- float smax = to[0];
+ final float smin = from[0];
+ final float smax = to[0];
- float tmin = from[1];
- float tmax = to[1];
+ final float tmin = from[1];
+ final float tmax = to[1];
pjarc = null;
Arc jarc = null;
@@ -1092,10 +1092,10 @@ public class Subdivider {
*/
public void drawCurves() {
// DONE
- float[] from = new float[1];
- float[] to = new float[1];
+ final float[] from = new float[1];
+ final float[] to = new float[1];
- Flist bpts = new Flist();
+ final Flist bpts = new Flist();
qlist.getRange(from, to, bpts);
renderhints.init();
@@ -1103,13 +1103,13 @@ public class Subdivider {
backend.bgncurv();
for (int i = bpts.start; i < bpts.end - 1; i++) {
- float[] pta = new float[1];
- float[] ptb = new float[1];
+ final float[] pta = new float[1];
+ final float[] ptb = new float[1];
pta[0] = bpts.pts[i];
ptb[0] = bpts.pts[i + 1];
qlist.downloadAll(pta, ptb, backend);
- Curvelist curvelist = new Curvelist(qlist, pta, ptb);
+ final Curvelist curvelist = new Curvelist(qlist, pta, ptb);
samplingSplit(curvelist, renderhints.maxsubdivisions);
}
backend.endcurv();
@@ -1120,7 +1120,7 @@ public class Subdivider {
* @param curvelist list of curves
* @param maxsubdivisions maximum number of subdivisions
*/
- private void samplingSplit(Curvelist curvelist, int maxsubdivisions) {
+ private void samplingSplit(final Curvelist curvelist, final int maxsubdivisions) {
if (curvelist.cullCheck() == CULL_TRIVIAL_REJECT)
return;
@@ -1130,7 +1130,7 @@ public class Subdivider {
// TODO kód
// System.out.println("TODO subdivider-needsSamplingSubdivision");
} else {
- int nu = (int) (1 + curvelist.range[2] / curvelist.stepsize);
+ final int nu = (int) (1 + curvelist.range[2] / curvelist.stepsize);
backend.curvgrid(curvelist.range[0], curvelist.range[1], nu);
backend.curvmesh(0, nu);
}
@@ -1142,7 +1142,7 @@ public class Subdivider {
* @param d new domain_distance_u_rate value
*/
- public void set_domain_distance_u_rate(double d) {
+ public void set_domain_distance_u_rate(final double d) {
// DONE
domain_distance_u_rate = (float) d;
}
@@ -1151,7 +1151,7 @@ public class Subdivider {
* Sets new domain_distance_v_rate value
* @param d new domain_distance_v_rate value
*/
- public void set_domain_distance_v_rate(double d) {
+ public void set_domain_distance_v_rate(final double d) {
// DONE
domain_distance_v_rate = (float) d;
}
@@ -1160,7 +1160,7 @@ public class Subdivider {
* Sets new is_domain_distance_sampling value
* @param i new is_domain_distance_sampling value
*/
- public void set_is_domain_distance_sampling(int i) {
+ public void set_is_domain_distance_sampling(final int i) {
// DONE
this.is_domain_distance_sampling = i;
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java b/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
index 9c8523e51..5cae679a2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
+++ b/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
@@ -56,7 +56,7 @@ public class Registry {
public Registry() {
}
- public static String gluGetString(int name) {
+ public static String gluGetString(final int name) {
if( name == GLU.GLU_VERSION ) {
return( "1.3" );
} else if( name == GLU.GLU_EXTENSIONS ) {
@@ -65,7 +65,7 @@ public class Registry {
return( null );
}
- public static boolean gluCheckExtension( String extName, String extString ) {
+ public static boolean gluCheckExtension( final String extName, final String extString ) {
if( extName == null || extString == null ) {
return( false );
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java
index 3ac9df67a..3bb759359 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java
@@ -60,8 +60,8 @@ class Dict {
private Dict() {
}
- static Dict dictNewDict(Object frame, DictLeq leq) {
- Dict dict = new Dict();
+ static Dict dictNewDict(final Object frame, final DictLeq leq) {
+ final Dict dict = new Dict();
dict.head = new DictNode();
dict.head.key = null;
@@ -74,22 +74,22 @@ class Dict {
return dict;
}
- static void dictDeleteDict(Dict dict) {
+ static void dictDeleteDict(final Dict dict) {
dict.head = null;
dict.frame = null;
dict.leq = null;
}
- static DictNode dictInsert(Dict dict, Object key) {
+ static DictNode dictInsert(final Dict dict, final Object key) {
return dictInsertBefore(dict, dict.head, key);
}
- static DictNode dictInsertBefore(Dict dict, DictNode node, Object key) {
+ static DictNode dictInsertBefore(final Dict dict, DictNode node, final Object key) {
do {
node = node.prev;
} while (node.key != null && !dict.leq.leq(dict.frame, node.key, key));
- DictNode newNode = new DictNode();
+ final DictNode newNode = new DictNode();
newNode.key = key;
newNode.next = node.next;
node.next.prev = newNode;
@@ -99,32 +99,32 @@ class Dict {
return newNode;
}
- static Object dictKey(DictNode aNode) {
+ static Object dictKey(final DictNode aNode) {
return aNode.key;
}
- static DictNode dictSucc(DictNode aNode) {
+ static DictNode dictSucc(final DictNode aNode) {
return aNode.next;
}
- static DictNode dictPred(DictNode aNode) {
+ static DictNode dictPred(final DictNode aNode) {
return aNode.prev;
}
- static DictNode dictMin(Dict aDict) {
+ static DictNode dictMin(final Dict aDict) {
return aDict.head.next;
}
- static DictNode dictMax(Dict aDict) {
+ static DictNode dictMax(final Dict aDict) {
return aDict.head.prev;
}
- static void dictDelete(Dict dict, DictNode node) {
+ static void dictDelete(final Dict dict, final DictNode node) {
node.next.prev = node.prev;
node.prev.next = node.next;
}
- static DictNode dictSearch(Dict dict, Object key) {
+ static DictNode dictSearch(final Dict dict, final Object key) {
DictNode node = dict.head;
do {
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
index 29944f9b2..a849058c8 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
@@ -65,7 +65,7 @@ class GLUhalfEdge {
public int winding; /* change in winding number when crossing */
public boolean first;
- public GLUhalfEdge(boolean first) {
+ public GLUhalfEdge(final boolean first) {
this.first = first;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
index d594cb3eb..6f89a95f2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
@@ -177,11 +177,11 @@ public class GLUtessellatorImpl implements GLUtessellator {
mesh = null;
}
- private void requireState(int newState) {
+ private void requireState(final int newState) {
if (state != newState) gotoState(newState);
}
- private void gotoState(int newState) {
+ private void gotoState(final int newState) {
while (state != newState) {
/* We change the current state one level at a time, to get to
* the desired state.
@@ -211,7 +211,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
requireState(TessState.T_DORMANT);
}
- public void gluTessProperty(int which, double value) {
+ public void gluTessProperty(final int which, final double value) {
switch (which) {
case GLU.GLU_TESS_TOLERANCE:
if (value < 0.0 || value > 1.0) break;
@@ -219,7 +219,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
return;
case GLU.GLU_TESS_WINDING_RULE:
- int windingRule = (int) value;
+ final int windingRule = (int) value;
if (windingRule != value) break; /* not an integer */
switch (windingRule) {
@@ -250,7 +250,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
}
/* Returns tessellator property */
- public void gluGetTessProperty(int which, double[] value, int value_offset) {
+ public void gluGetTessProperty(final int which, final double[] value, final int value_offset) {
switch (which) {
case GLU.GLU_TESS_TOLERANCE:
/* tolerance should be in range [0..1] */
@@ -279,13 +279,13 @@ public class GLUtessellatorImpl implements GLUtessellator {
}
} /* gluGetTessProperty() */
- public void gluTessNormal(double x, double y, double z) {
+ public void gluTessNormal(final double x, final double y, final double z) {
normal[0] = x;
normal[1] = y;
normal[2] = z;
}
- public void gluTessCallback(int which, GLUtessellatorCallback aCallback) {
+ public void gluTessCallback(final int which, final GLUtessellatorCallback aCallback) {
switch (which) {
case GLU.GLU_TESS_BEGIN:
callBegin = aCallback == null ? NULL_CB : aCallback;
@@ -340,7 +340,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
}
}
- private boolean addVertex(double[] coords, Object vertexData) {
+ private boolean addVertex(final double[] coords, final Object vertexData) {
GLUhalfEdge e;
e = lastEdge;
@@ -377,12 +377,12 @@ public class GLUtessellatorImpl implements GLUtessellator {
return true;
}
- private void cacheVertex(double[] coords, Object vertexData) {
+ private void cacheVertex(final double[] coords, final Object vertexData) {
if (cache[cacheCount] == null) {
cache[cacheCount] = new CachedVertex();
}
- CachedVertex v = cache[cacheCount];
+ final CachedVertex v = cache[cacheCount];
v.data = vertexData;
v.coords[0] = coords[0];
@@ -393,13 +393,13 @@ public class GLUtessellatorImpl implements GLUtessellator {
private boolean flushCache() {
- CachedVertex[] v = cache;
+ final CachedVertex[] v = cache;
mesh = Mesh.__gl_meshNewMesh();
if (mesh == null) return false;
for (int i = 0; i < cacheCount; i++) {
- CachedVertex vertex = v[i];
+ final CachedVertex vertex = v[i];
if (!addVertex(vertex.coords, vertex.data)) return false;
}
cacheCount = 0;
@@ -408,11 +408,11 @@ public class GLUtessellatorImpl implements GLUtessellator {
return true;
}
- public void gluTessVertex(double[] coords, int coords_offset, Object vertexData) {
+ public void gluTessVertex(final double[] coords, final int coords_offset, final Object vertexData) {
int i;
boolean tooLarge = false;
double x;
- double[] clamped = new double[3];
+ final double[] clamped = new double[3];
requireState(TessState.T_IN_CONTOUR);
@@ -456,7 +456,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
}
- public void gluTessBeginPolygon(Object data) {
+ public void gluTessBeginPolygon(final Object data) {
requireState(TessState.T_DORMANT);
state = TessState.T_IN_POLYGON;
@@ -573,7 +573,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
Mesh.__gl_meshDeleteMesh(mesh);
polygonData = null;
mesh = null;
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
}
@@ -590,7 +590,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
/*ARGSUSED*/
- public void gluNextContour(int type) {
+ public void gluNextContour(final int type) {
gluTessEndContour();
gluTessBeginContour();
}
@@ -601,21 +601,21 @@ public class GLUtessellatorImpl implements GLUtessellator {
gluTessEndPolygon();
}
- void callBeginOrBeginData(int a) {
+ void callBeginOrBeginData(final int a) {
if (callBeginData != NULL_CB)
callBeginData.beginData(a, polygonData);
else
callBegin.begin(a);
}
- void callVertexOrVertexData(Object a) {
+ void callVertexOrVertexData(final Object a) {
if (callVertexData != NULL_CB)
callVertexData.vertexData(a, polygonData);
else
callVertex.vertex(a);
}
- void callEdgeFlagOrEdgeFlagData(boolean a) {
+ void callEdgeFlagOrEdgeFlagData(final boolean a) {
if (callEdgeFlagData != NULL_CB)
callEdgeFlagData.edgeFlagData(a, polygonData);
else
@@ -629,14 +629,14 @@ public class GLUtessellatorImpl implements GLUtessellator {
callEnd.end();
}
- void callCombineOrCombineData(double[] coords, Object[] vertexData, float[] weights, Object[] outData) {
+ void callCombineOrCombineData(final double[] coords, final Object[] vertexData, final float[] weights, final Object[] outData) {
if (callCombineData != NULL_CB)
callCombineData.combineData(coords, vertexData, weights, outData, polygonData);
else
callCombine.combine(coords, vertexData, weights, outData);
}
- void callErrorOrErrorData(int a) {
+ void callErrorOrErrorData(final int a) {
if (callErrorData != NULL_CB)
callErrorData.errorData(a, polygonData);
else
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java
index 3da2d267e..493052f79 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java
@@ -66,7 +66,7 @@ class Geom {
* let r be the negated result (this evaluates (uw)(v->s)), then
* r is guaranteed to satisfy MIN(u->t,w->t) <= r <= MAX(u->t,w->t).
*/
- static double EdgeEval(GLUvertex u, GLUvertex v, GLUvertex w) {
+ static double EdgeEval(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
double gapL, gapR;
assert (VertLeq(u, v) && VertLeq(v, w));
@@ -85,7 +85,7 @@ class Geom {
return 0;
}
- static double EdgeSign(GLUvertex u, GLUvertex v, GLUvertex w) {
+ static double EdgeSign(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
double gapL, gapR;
assert (VertLeq(u, v) && VertLeq(v, w));
@@ -105,7 +105,7 @@ class Geom {
* Define versions of EdgeSign, EdgeEval with s and t transposed.
*/
- static double TransEval(GLUvertex u, GLUvertex v, GLUvertex w) {
+ static double TransEval(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
/* Given three vertices u,v,w such that TransLeq(u,v) && TransLeq(v,w),
* evaluates the t-coord of the edge uw at the s-coord of the vertex v.
* Returns v->s - (uw)(v->t), ie. the signed distance from uw to v.
@@ -134,7 +134,7 @@ class Geom {
return 0;
}
- static double TransSign(GLUvertex u, GLUvertex v, GLUvertex w) {
+ static double TransSign(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
/* Returns a number whose sign matches TransEval(u,v,w) but which
* is cheaper to evaluate. Returns > 0, == 0 , or < 0
* as v is above, on, or below the edge uw.
@@ -154,7 +154,7 @@ class Geom {
}
- static boolean VertCCW(GLUvertex u, GLUvertex v, GLUvertex w) {
+ static boolean VertCCW(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
/* For almost-degenerate situations, the results are not reliable.
* Unless the floating-point arithmetic can be performed without
* rounding errors, *any* implementation will give incorrect results
@@ -172,7 +172,7 @@ class Geom {
* MIN(x,y) <= r <= MAX(x,y), and the results are very accurate
* even when a and b differ greatly in magnitude.
*/
- static double Interpolate(double a, double x, double b, double y) {
+ static double Interpolate(double a, final double x, double b, final double y) {
a = (a < 0) ? 0 : a;
b = (b < 0) ? 0 : b;
if (a <= b) {
@@ -188,7 +188,7 @@ class Geom {
static void EdgeIntersect(GLUvertex o1, GLUvertex d1,
GLUvertex o2, GLUvertex d2,
- GLUvertex v)
+ final GLUvertex v)
/* Given edges (o1,d1) and (o2,d2), compute their point of intersection.
* The computed point is guaranteed to lie in the intersection of the
* bounding rectangles defined by each edge.
@@ -204,12 +204,12 @@ class Geom {
*/
if (!VertLeq(o1, d1)) {
- GLUvertex temp = o1;
+ final GLUvertex temp = o1;
o1 = d1;
d1 = temp;
}
if (!VertLeq(o2, d2)) {
- GLUvertex temp = o2;
+ final GLUvertex temp = o2;
o2 = d2;
d2 = temp;
}
@@ -248,12 +248,12 @@ class Geom {
/* Now repeat the process for t */
if (!TransLeq(o1, d1)) {
- GLUvertex temp = o1;
+ final GLUvertex temp = o1;
o1 = d1;
d1 = temp;
}
if (!TransLeq(o2, d2)) {
- GLUvertex temp = o2;
+ final GLUvertex temp = o2;
o2 = d2;
d2 = temp;
}
@@ -290,29 +290,29 @@ class Geom {
}
}
- static boolean VertEq(GLUvertex u, GLUvertex v) {
+ static boolean VertEq(final GLUvertex u, final GLUvertex v) {
return u.s == v.s && u.t == v.t;
}
- static boolean VertLeq(GLUvertex u, GLUvertex v) {
+ static boolean VertLeq(final GLUvertex u, final GLUvertex v) {
return u.s < v.s || (u.s == v.s && u.t <= v.t);
}
/* Versions of VertLeq, EdgeSign, EdgeEval with s and t transposed. */
- static boolean TransLeq(GLUvertex u, GLUvertex v) {
+ static boolean TransLeq(final GLUvertex u, final GLUvertex v) {
return u.t < v.t || (u.t == v.t && u.s <= v.s);
}
- static boolean EdgeGoesLeft(GLUhalfEdge e) {
+ static boolean EdgeGoesLeft(final GLUhalfEdge e) {
return VertLeq(e.Sym.Org, e.Org);
}
- static boolean EdgeGoesRight(GLUhalfEdge e) {
+ static boolean EdgeGoesRight(final GLUhalfEdge e) {
return VertLeq(e.Org, e.Sym.Org);
}
- static double VertL1dist(GLUvertex u, GLUvertex v) {
+ static double VertL1dist(final GLUvertex u, final GLUvertex v) {
return Math.abs(u.s - v.s) + Math.abs(u.t - v.t);
}
@@ -320,13 +320,13 @@ class Geom {
// Compute the cosine of the angle between the edges between o and
// v1 and between o and v2
- static double EdgeCos(GLUvertex o, GLUvertex v1, GLUvertex v2) {
- double ov1s = v1.s - o.s;
- double ov1t = v1.t - o.t;
- double ov2s = v2.s - o.s;
- double ov2t = v2.t - o.t;
+ static double EdgeCos(final GLUvertex o, final GLUvertex v1, final GLUvertex v2) {
+ final double ov1s = v1.s - o.s;
+ final double ov1t = v1.t - o.t;
+ final double ov2s = v2.s - o.s;
+ final double ov2t = v2.t - o.t;
double dotp = ov1s * ov2s + ov1t * ov2t;
- double len = Math.sqrt(ov1s * ov1s + ov1t * ov1t) * Math.sqrt(ov2s * ov2s + ov2t * ov2t);
+ final double len = Math.sqrt(ov1s * ov1s + ov1t * ov1t) * Math.sqrt(ov2s * ov2s + ov2t * ov2t);
if (len > 0.0) {
dotp /= len;
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
index eb48aa5a4..e855a5531 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
@@ -115,9 +115,9 @@ class Mesh {
* depending on whether a and b belong to different face or vertex rings.
* For more explanation see __gl_meshSplice() below.
*/
- static void Splice(jogamp.opengl.glu.tessellator.GLUhalfEdge a, jogamp.opengl.glu.tessellator.GLUhalfEdge b) {
- jogamp.opengl.glu.tessellator.GLUhalfEdge aOnext = a.Onext;
- jogamp.opengl.glu.tessellator.GLUhalfEdge bOnext = b.Onext;
+ static void Splice(final jogamp.opengl.glu.tessellator.GLUhalfEdge a, final jogamp.opengl.glu.tessellator.GLUhalfEdge b) {
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge aOnext = a.Onext;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge bOnext = b.Onext;
aOnext.Sym.Lnext = b;
bOnext.Sym.Lnext = a;
@@ -131,11 +131,11 @@ class Mesh {
* the new vertex *before* vNext so that algorithms which walk the vertex
* list will not see the newly created vertices.
*/
- static void MakeVertex(jogamp.opengl.glu.tessellator.GLUvertex newVertex,
- jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, jogamp.opengl.glu.tessellator.GLUvertex vNext) {
+ static void MakeVertex(final jogamp.opengl.glu.tessellator.GLUvertex newVertex,
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, final jogamp.opengl.glu.tessellator.GLUvertex vNext) {
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
jogamp.opengl.glu.tessellator.GLUvertex vPrev;
- jogamp.opengl.glu.tessellator.GLUvertex vNew = newVertex;
+ final jogamp.opengl.glu.tessellator.GLUvertex vNew = newVertex;
assert (vNew != null);
@@ -164,10 +164,10 @@ class Mesh {
* the new face *before* fNext so that algorithms which walk the face
* list will not see the newly created faces.
*/
- static void MakeFace(jogamp.opengl.glu.tessellator.GLUface newFace, jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, jogamp.opengl.glu.tessellator.GLUface fNext) {
+ static void MakeFace(final jogamp.opengl.glu.tessellator.GLUface newFace, final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, final jogamp.opengl.glu.tessellator.GLUface fNext) {
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
jogamp.opengl.glu.tessellator.GLUface fPrev;
- jogamp.opengl.glu.tessellator.GLUface fNew = newFace;
+ final jogamp.opengl.glu.tessellator.GLUface fNew = newFace;
assert (fNew != null);
@@ -218,8 +218,9 @@ class Mesh {
/* KillVertex( vDel ) destroys a vertex and removes it from the global
* vertex list. It updates the vertex loop to point to a given new vertex.
*/
- static void KillVertex(jogamp.opengl.glu.tessellator.GLUvertex vDel, jogamp.opengl.glu.tessellator.GLUvertex newOrg) {
- jogamp.opengl.glu.tessellator.GLUhalfEdge e, eStart = vDel.anEdge;
+ static void KillVertex(final jogamp.opengl.glu.tessellator.GLUvertex vDel, final jogamp.opengl.glu.tessellator.GLUvertex newOrg) {
+ jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eStart = vDel.anEdge;
jogamp.opengl.glu.tessellator.GLUvertex vPrev, vNext;
/* change the origin of all affected edges */
@@ -239,8 +240,9 @@ class Mesh {
/* KillFace( fDel ) destroys a face and removes it from the global face
* list. It updates the face loop to point to a given new face.
*/
- static void KillFace(jogamp.opengl.glu.tessellator.GLUface fDel, jogamp.opengl.glu.tessellator.GLUface newLface) {
- jogamp.opengl.glu.tessellator.GLUhalfEdge e, eStart = fDel.anEdge;
+ static void KillFace(final jogamp.opengl.glu.tessellator.GLUface fDel, final jogamp.opengl.glu.tessellator.GLUface newLface) {
+ jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eStart = fDel.anEdge;
jogamp.opengl.glu.tessellator.GLUface fPrev, fNext;
/* change the left face of all affected edges */
@@ -263,10 +265,10 @@ class Mesh {
/* __gl_meshMakeEdge creates one edge, two vertices, and a loop (face).
* The loop consists of the two new half-edges.
*/
- public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshMakeEdge(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
- jogamp.opengl.glu.tessellator.GLUvertex newVertex1 = new jogamp.opengl.glu.tessellator.GLUvertex();
- jogamp.opengl.glu.tessellator.GLUvertex newVertex2 = new jogamp.opengl.glu.tessellator.GLUvertex();
- jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+ public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshMakeEdge(final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+ final jogamp.opengl.glu.tessellator.GLUvertex newVertex1 = new jogamp.opengl.glu.tessellator.GLUvertex();
+ final jogamp.opengl.glu.tessellator.GLUvertex newVertex2 = new jogamp.opengl.glu.tessellator.GLUvertex();
+ final jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
e = MakeEdge(mesh.eHead);
@@ -302,7 +304,7 @@ class Mesh {
* If eDst == eOrg->Onext, the new vertex will have a single edge.
* If eDst == eOrg->Oprev, the old vertex will have a single edge.
*/
- public static boolean __gl_meshSplice(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
+ public static boolean __gl_meshSplice(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, final jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
boolean joiningLoops = false;
boolean joiningVertices = false;
@@ -323,7 +325,7 @@ class Mesh {
Splice(eDst, eOrg);
if (!joiningVertices) {
- jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
+ final jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
/* We split one vertex into two -- the new vertex is eDst.Org.
* Make sure the old vertex points to a valid half-edge.
@@ -332,7 +334,7 @@ class Mesh {
eOrg.Org.anEdge = eOrg;
}
if (!joiningLoops) {
- jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+ final jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
/* We split one loop into two -- the new loop is eDst.Lface.
* Make sure the old face points to a valid half-edge.
@@ -355,8 +357,8 @@ class Mesh {
* plus a few calls to memFree, but this would allocate and delete
* unnecessary vertices and faces.
*/
- static boolean __gl_meshDelete(jogamp.opengl.glu.tessellator.GLUhalfEdge eDel) {
- jogamp.opengl.glu.tessellator.GLUhalfEdge eDelSym = eDel.Sym;
+ static boolean __gl_meshDelete(final jogamp.opengl.glu.tessellator.GLUhalfEdge eDel) {
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eDelSym = eDel.Sym;
boolean joiningLoops = false;
/* First step: disconnect the origin vertex eDel.Org. We make all
@@ -377,7 +379,7 @@ class Mesh {
Splice(eDel, eDel.Sym.Lnext);
if (!joiningLoops) {
- jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+ final jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
/* We are splitting one loop into two -- create a new loop for eDel. */
MakeFace(newFace, eDel, eDel.Lface);
@@ -415,9 +417,9 @@ class Mesh {
* eNew == eOrg.Lnext, and eNew.Dst is a newly created vertex.
* eOrg and eNew will have the same left face.
*/
- static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshAddEdgeVertex(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
+ static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshAddEdgeVertex(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
jogamp.opengl.glu.tessellator.GLUhalfEdge eNewSym;
- jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
eNewSym = eNew.Sym;
@@ -427,7 +429,7 @@ class Mesh {
/* Set the vertex and face information */
eNew.Org = eOrg.Sym.Org;
{
- jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
+ final jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
MakeVertex(newVertex, eNewSym, eNew.Org);
}
@@ -441,9 +443,9 @@ class Mesh {
* such that eNew == eOrg.Lnext. The new vertex is eOrg.Sym.Org == eNew.Org.
* eOrg and eNew will have the same left face.
*/
- public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshSplitEdge(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
+ public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshSplitEdge(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
jogamp.opengl.glu.tessellator.GLUhalfEdge eNew;
- jogamp.opengl.glu.tessellator.GLUhalfEdge tempHalfEdge = __gl_meshAddEdgeVertex(eOrg);
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge tempHalfEdge = __gl_meshAddEdgeVertex(eOrg);
eNew = tempHalfEdge.Sym;
@@ -472,10 +474,10 @@ class Mesh {
* If (eOrg.Lnext == eDst), the old face is reduced to a single edge.
* If (eOrg.Lnext.Lnext == eDst), the old face is reduced to two edges.
*/
- static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshConnect(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
+ static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshConnect(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, final jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
jogamp.opengl.glu.tessellator.GLUhalfEdge eNewSym;
boolean joiningLoops = false;
- jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
eNewSym = eNew.Sym;
@@ -498,7 +500,7 @@ class Mesh {
eOrg.Lface.anEdge = eNewSym;
if (!joiningLoops) {
- jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+ final jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
/* We split one loop into two -- the new loop is eNew.Lface */
MakeFace(newFace, eNew, eOrg.Lface);
@@ -516,8 +518,8 @@ class Mesh {
* An entire mesh can be deleted by zapping its faces, one at a time,
* in any order. Zapped faces cannot be used in further mesh operations!
*/
- static void __gl_meshZapFace(jogamp.opengl.glu.tessellator.GLUface fZap) {
- jogamp.opengl.glu.tessellator.GLUhalfEdge eStart = fZap.anEdge;
+ static void __gl_meshZapFace(final jogamp.opengl.glu.tessellator.GLUface fZap) {
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eStart = fZap.anEdge;
jogamp.opengl.glu.tessellator.GLUhalfEdge e, eNext, eSym;
jogamp.opengl.glu.tessellator.GLUface fPrev, fNext;
@@ -566,7 +568,7 @@ class Mesh {
jogamp.opengl.glu.tessellator.GLUface f;
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
jogamp.opengl.glu.tessellator.GLUhalfEdge eSym;
- jogamp.opengl.glu.tessellator.GLUmesh mesh = new jogamp.opengl.glu.tessellator.GLUmesh();
+ final jogamp.opengl.glu.tessellator.GLUmesh mesh = new jogamp.opengl.glu.tessellator.GLUmesh();
v = mesh.vHead;
f = mesh.fHead;
@@ -609,13 +611,13 @@ class Mesh {
/* __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in
* both meshes, and returns the new mesh (the old meshes are destroyed).
*/
- static jogamp.opengl.glu.tessellator.GLUmesh __gl_meshUnion(jogamp.opengl.glu.tessellator.GLUmesh mesh1, jogamp.opengl.glu.tessellator.GLUmesh mesh2) {
- jogamp.opengl.glu.tessellator.GLUface f1 = mesh1.fHead;
- jogamp.opengl.glu.tessellator.GLUvertex v1 = mesh1.vHead;
- jogamp.opengl.glu.tessellator.GLUhalfEdge e1 = mesh1.eHead;
- jogamp.opengl.glu.tessellator.GLUface f2 = mesh2.fHead;
- jogamp.opengl.glu.tessellator.GLUvertex v2 = mesh2.vHead;
- jogamp.opengl.glu.tessellator.GLUhalfEdge e2 = mesh2.eHead;
+ static jogamp.opengl.glu.tessellator.GLUmesh __gl_meshUnion(final jogamp.opengl.glu.tessellator.GLUmesh mesh1, final jogamp.opengl.glu.tessellator.GLUmesh mesh2) {
+ final jogamp.opengl.glu.tessellator.GLUface f1 = mesh1.fHead;
+ final jogamp.opengl.glu.tessellator.GLUvertex v1 = mesh1.vHead;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge e1 = mesh1.eHead;
+ final jogamp.opengl.glu.tessellator.GLUface f2 = mesh2.fHead;
+ final jogamp.opengl.glu.tessellator.GLUvertex v2 = mesh2.vHead;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge e2 = mesh2.eHead;
/* Add the faces, vertices, and edges of mesh2 to those of mesh1 */
if (f2.next != f2) {
@@ -645,8 +647,8 @@ class Mesh {
/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
*/
- static void __gl_meshDeleteMeshZap(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
- jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
+ static void __gl_meshDeleteMeshZap(final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+ final jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
while (fHead.next != fHead) {
__gl_meshZapFace(fHead.next);
@@ -656,7 +658,7 @@ class Mesh {
/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
*/
- public static void __gl_meshDeleteMesh(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+ public static void __gl_meshDeleteMesh(final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
jogamp.opengl.glu.tessellator.GLUface f, fNext;
jogamp.opengl.glu.tessellator.GLUvertex v, vNext;
jogamp.opengl.glu.tessellator.GLUhalfEdge e, eNext;
@@ -677,10 +679,10 @@ class Mesh {
/* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency.
*/
- public static void __gl_meshCheckMesh(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
- jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
- jogamp.opengl.glu.tessellator.GLUvertex vHead = mesh.vHead;
- jogamp.opengl.glu.tessellator.GLUhalfEdge eHead = mesh.eHead;
+ public static void __gl_meshCheckMesh(final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+ final jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
+ final jogamp.opengl.glu.tessellator.GLUvertex vHead = mesh.vHead;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge eHead = mesh.eHead;
jogamp.opengl.glu.tessellator.GLUface f, fPrev;
jogamp.opengl.glu.tessellator.GLUvertex v, vPrev;
jogamp.opengl.glu.tessellator.GLUhalfEdge e, ePrev;
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
index 196e6cf27..44668a943 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
@@ -83,11 +83,11 @@ class Normal {
}
}
- private static double Dot(double[] u, double[] v) {
+ private static double Dot(final double[] u, final double[] v) {
return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2]);
}
- static void Normalize(double[] v) {
+ static void Normalize(final double[] v) {
double len = v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
assert (len > 0);
@@ -97,7 +97,7 @@ class Normal {
v[2] /= len;
}
- static int LongAxis(double[] v) {
+ static int LongAxis(final double[] v) {
int i = 0;
if (Math.abs(v[1]) > Math.abs(v[0])) {
@@ -109,12 +109,12 @@ class Normal {
return i;
}
- static void ComputeNormal(GLUtessellatorImpl tess, double[] norm) {
+ static void ComputeNormal(final GLUtessellatorImpl tess, final double[] norm) {
jogamp.opengl.glu.tessellator.GLUvertex v, v1, v2;
double c, tLen2, maxLen2;
double[] maxVal, minVal, d1, d2, tNorm;
jogamp.opengl.glu.tessellator.GLUvertex[] maxVert, minVert;
- jogamp.opengl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
+ final jogamp.opengl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
int i;
maxVal = new double[3];
@@ -192,10 +192,12 @@ class Normal {
}
}
- static void CheckOrientation(GLUtessellatorImpl tess) {
+ static void CheckOrientation(final GLUtessellatorImpl tess) {
double area;
- jogamp.opengl.glu.tessellator.GLUface f, fHead = tess.mesh.fHead;
- jogamp.opengl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead;
+ jogamp.opengl.glu.tessellator.GLUface f;
+ final jogamp.opengl.glu.tessellator.GLUface fHead = tess.mesh.fHead;
+ jogamp.opengl.glu.tessellator.GLUvertex v;
+ final jogamp.opengl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
/* When we compute the normal automatically, we choose the orientation
@@ -224,10 +226,11 @@ class Normal {
/* Determine the polygon normal and project vertices onto the plane
* of the polygon.
*/
- public static void __gl_projectPolygon(GLUtessellatorImpl tess) {
- jogamp.opengl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead;
+ public static void __gl_projectPolygon(final GLUtessellatorImpl tess) {
+ jogamp.opengl.glu.tessellator.GLUvertex v;
+ final jogamp.opengl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
double w;
- double[] norm = new double[3];
+ final double[] norm = new double[3];
double[] sUnit, tUnit;
int i;
boolean computedNormal = false;
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java
index 25405ad64..1f9b9e5ed 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java
@@ -75,11 +75,11 @@ abstract class PriorityQ {
// #else
/* Violates modularity, but a little faster */
// #include "geom.h"
- public static boolean LEQ(Leq leq, Object x, Object y) {
+ public static boolean LEQ(final Leq leq, final Object x, final Object y) {
return jogamp.opengl.glu.tessellator.Geom.VertLeq((jogamp.opengl.glu.tessellator.GLUvertex) x, (jogamp.opengl.glu.tessellator.GLUvertex) y);
}
- static PriorityQ pqNewPriorityQ(Leq leq) {
+ static PriorityQ pqNewPriorityQ(final Leq leq) {
return new PriorityQSort(leq);
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
index 1ac0fd438..74d981907 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
@@ -61,7 +61,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
jogamp.opengl.glu.tessellator.PriorityQ.Leq leq;
/* really __gl_pqHeapNewPriorityQ */
- public PriorityQHeap(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
+ public PriorityQHeap(final jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
size = 0;
max = jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE;
nodes = new jogamp.opengl.glu.tessellator.PriorityQ.PQnode[jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE + 1];
@@ -88,8 +88,8 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
}
void FloatDown(int curr) {
- jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
- jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
int hCurr, hChild;
int child;
@@ -117,8 +117,8 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
void FloatUp(int curr) {
- jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
- jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
int hCurr, hParent;
int parent;
@@ -155,19 +155,19 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
/* really __gl_pqHeapInsert */
/* returns LONG_MAX iff out of memory */
@Override
- int pqInsert(Object keyNew) {
+ int pqInsert(final Object keyNew) {
int curr;
int free;
curr = ++size;
if ((curr * 2) > max) {
- jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] saveNodes = nodes;
- jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] saveHandles = handles;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] saveNodes = nodes;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] saveHandles = handles;
/* If the heap overflows, double its size. */
max <<= 1;
// pq->nodes = (PQnode *)memRealloc( pq->nodes, (size_t) ((pq->max + 1) * sizeof( pq->nodes[0] )));
- PriorityQ.PQnode[] pqNodes = new PriorityQ.PQnode[max + 1];
+ final PriorityQ.PQnode[] pqNodes = new PriorityQ.PQnode[max + 1];
System.arraycopy( nodes, 0, pqNodes, 0, nodes.length );
for (int i = nodes.length; i < pqNodes.length; i++) {
pqNodes[i] = new PQnode();
@@ -179,7 +179,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
}
// pq->handles = (PQhandleElem *)memRealloc( pq->handles,(size_t)((pq->max + 1) * sizeof( pq->handles[0] )));
- PriorityQ.PQhandleElem[] pqHandles = new PriorityQ.PQhandleElem[max + 1];
+ final PriorityQ.PQhandleElem[] pqHandles = new PriorityQ.PQhandleElem[max + 1];
System.arraycopy( handles, 0, pqHandles, 0, handles.length );
for (int i = handles.length; i < pqHandles.length; i++) {
pqHandles[i] = new PQhandleElem();
@@ -212,10 +212,10 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
/* really __gl_pqHeapExtractMin */
@Override
Object pqExtractMin() {
- jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
- jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
- int hMin = n[1].handle;
- Object min = h[hMin].key;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+ final int hMin = n[1].handle;
+ final Object min = h[hMin].key;
if (size > 0) {
n[1].handle = n[size].handle;
@@ -234,9 +234,9 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
/* really __gl_pqHeapDelete */
@Override
- void pqDelete(int hCurr) {
- jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
- jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+ void pqDelete(final int hCurr) {
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+ final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
int curr;
assert (hCurr >= 1 && hCurr <= max && h[hCurr].key != null);
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
index cf54b15c3..45e994b67 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
@@ -59,7 +59,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
boolean initialized;
jogamp.opengl.glu.tessellator.PriorityQ.Leq leq;
- public PriorityQSort(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
+ public PriorityQSort(final jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
heap = new jogamp.opengl.glu.tessellator.PriorityQHeap(leq);
keys = new Object[jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE];
@@ -78,17 +78,17 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
keys = null;
}
- private static boolean LT(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, Object x, Object y) {
- return (!jogamp.opengl.glu.tessellator.PriorityQHeap.LEQ(leq, y, x));
+ private static boolean LT(final jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, final Object x, final Object y) {
+ return (!PriorityQ.LEQ(leq, y, x));
}
- private static boolean GT(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, Object x, Object y) {
- return (!jogamp.opengl.glu.tessellator.PriorityQHeap.LEQ(leq, x, y));
+ private static boolean GT(final jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, final Object x, final Object y) {
+ return (!PriorityQ.LEQ(leq, x, y));
}
- private static void Swap(int[] array, int a, int b) {
+ private static void Swap(final int[] array, final int a, final int b) {
if (true) {
- int tmp = array[a];
+ final int tmp = array[a];
array[a] = array[b];
array[b] = tmp;
} else {
@@ -105,7 +105,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
boolean pqInit() {
int p, r, i, j;
int piv;
- Stack[] stack = new Stack[50];
+ final Stack[] stack = new Stack[50];
for (int k = 0; k < stack.length; k++) {
stack[k] = new Stack();
}
@@ -194,7 +194,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
/* really __gl_pqSortInsert */
/* returns LONG_MAX iff out of memory */
@Override
- int pqInsert(Object keyNew) {
+ int pqInsert(final Object keyNew) {
int curr;
if (initialized) {
@@ -202,12 +202,12 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
}
curr = size;
if (++size >= max) {
- Object[] saveKey = keys;
+ final Object[] saveKey = keys;
/* If the heap overflows, double its size. */
max <<= 1;
// pq->keys = (PQHeapKey *)memRealloc( pq->keys,(size_t)(pq->max * sizeof( pq->keys[0] )));
- Object[] pqKeys = new Object[max];
+ final Object[] pqKeys = new Object[max];
System.arraycopy( keys, 0, pqKeys, 0, keys.length );
keys = pqKeys;
if (keys == null) {
@@ -254,7 +254,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
sortMin = keys[order[size - 1]];
if (!heap.pqIsEmpty()) {
heapMin = heap.pqMinimum();
- if (jogamp.opengl.glu.tessellator.PriorityQHeap.LEQ(leq, heapMin, sortMin)) {
+ if (PriorityQ.LEQ(leq, heapMin, sortMin)) {
return heapMin;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
index a2e973508..6325de8d2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
@@ -73,7 +73,7 @@ class Render {
public FaceCount() {
}
- public FaceCount(long size, jogamp.opengl.glu.tessellator.GLUhalfEdge eStart, renderCallBack render) {
+ public FaceCount(final long size, final jogamp.opengl.glu.tessellator.GLUhalfEdge eStart, final renderCallBack render) {
this.size = size;
this.eStart = eStart;
this.render = render;
@@ -97,7 +97,7 @@ class Render {
*
* The rendering output is provided as callbacks (see the api).
*/
- public static void __gl_renderMesh(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+ public static void __gl_renderMesh(final GLUtessellatorImpl tess, final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
jogamp.opengl.glu.tessellator.GLUface f;
/* Make a list of separate triangles so we can render them all at once */
@@ -124,7 +124,7 @@ class Render {
}
- static void RenderMaximumFaceGroup(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUface fOrig) {
+ static void RenderMaximumFaceGroup(final GLUtessellatorImpl tess, final jogamp.opengl.glu.tessellator.GLUface fOrig) {
/* We want to find the largest triangle fan or strip of unmarked faces
* which includes the given face fOrig. There are 3 possible fans
* passing through fOrig (one centered at each vertex), and 3 possible
@@ -132,7 +132,7 @@ class Render {
* is to try all of these, and take the primitive which uses the most
* triangles (a greedy approach).
*/
- jogamp.opengl.glu.tessellator.GLUhalfEdge e = fOrig.anEdge;
+ final jogamp.opengl.glu.tessellator.GLUhalfEdge e = fOrig.anEdge;
FaceCount max = new FaceCount();
FaceCount newFace = new FaceCount();
@@ -178,11 +178,11 @@ class Render {
* more complicated, and we need a general tracking method like the
* one here.
*/
- private static boolean Marked(jogamp.opengl.glu.tessellator.GLUface f) {
+ private static boolean Marked(final jogamp.opengl.glu.tessellator.GLUface f) {
return !f.inside || f.marked;
}
- private static GLUface AddToTrail(jogamp.opengl.glu.tessellator.GLUface f, jogamp.opengl.glu.tessellator.GLUface t) {
+ private static GLUface AddToTrail(final jogamp.opengl.glu.tessellator.GLUface f, final jogamp.opengl.glu.tessellator.GLUface t) {
f.trail = t;
f.marked = true;
return f;
@@ -199,12 +199,12 @@ class Render {
}
}
- static FaceCount MaximumFan(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
+ static FaceCount MaximumFan(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
/* eOrig.Lface is the face we want to render. We want to find the size
* of a maximal fan around eOrig.Org. To do this we just walk around
* the origin vertex as far as possible in both directions.
*/
- FaceCount newFace = new FaceCount(0, null, renderFan);
+ final FaceCount newFace = new FaceCount(0, null, renderFan);
jogamp.opengl.glu.tessellator.GLUface trail = null;
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
@@ -223,11 +223,11 @@ class Render {
}
- private static boolean IsEven(long n) {
+ private static boolean IsEven(final long n) {
return (n & 0x1L) == 0;
}
- static FaceCount MaximumStrip(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
+ static FaceCount MaximumStrip(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
/* Here we are looking for a maximal strip that contains the vertices
* eOrig.Org, eOrig.Dst, eOrig.Lnext.Dst (in that order or the
* reverse, such that all triangles are oriented CCW).
@@ -238,7 +238,7 @@ class Render {
* We walk the strip starting on a side with an even number of triangles;
* if both side have an odd number, we are forced to shorten one side.
*/
- FaceCount newFace = new FaceCount(0, null, renderStrip);
+ final FaceCount newFace = new FaceCount(0, null, renderStrip);
long headSize = 0, tailSize = 0;
jogamp.opengl.glu.tessellator.GLUface trail = null;
jogamp.opengl.glu.tessellator.GLUhalfEdge e, eTail, eHead;
@@ -280,7 +280,7 @@ class Render {
private static class RenderTriangle implements renderCallBack {
@Override
- public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
+ public void render(final GLUtessellatorImpl tess, final jogamp.opengl.glu.tessellator.GLUhalfEdge e, final long size) {
/* Just add the triangle to a triangle list, so we can render all
* the separate triangles at once.
*/
@@ -290,7 +290,7 @@ class Render {
}
- static void RenderLonelyTriangles(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUface f) {
+ static void RenderLonelyTriangles(final GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUface f) {
/* Now we render all the separate triangles which could not be
* grouped into a triangle fan or strip.
*/
@@ -325,7 +325,7 @@ class Render {
private static class RenderFan implements renderCallBack {
@Override
- public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
+ public void render(final GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
/* Render as many CCW triangles as possible in a fan starting from
* edge "e". The fan *should* contain exactly "size" triangles
* (otherwise we've goofed up somewhere).
@@ -348,7 +348,7 @@ class Render {
private static class RenderStrip implements renderCallBack {
@Override
- public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
+ public void render(final GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
/* Render as many CCW triangles as possible in a strip starting from
* edge "e". The strip *should* contain exactly "size" triangles
* (otherwise we've goofed up somewhere).
@@ -381,7 +381,7 @@ class Render {
* contour for each face marked "inside". The rendering output is
* provided as callbacks (see the api).
*/
- public static void __gl_renderBoundary(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+ public static void __gl_renderBoundary(final GLUtessellatorImpl tess, final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
jogamp.opengl.glu.tessellator.GLUface f;
jogamp.opengl.glu.tessellator.GLUhalfEdge e;
@@ -403,7 +403,7 @@ class Render {
private static final int SIGN_INCONSISTENT = 2;
- static int ComputeNormal(GLUtessellatorImpl tess, double[] norm, boolean check)
+ static int ComputeNormal(final GLUtessellatorImpl tess, final double[] norm, final boolean check)
/*
* If check==false, we compute the polygon normal and place it in norm[].
* If check==true, we check that each triangle in the fan from v0 has a
@@ -412,13 +412,13 @@ class Render {
* are degenerate return 0; otherwise (no consistent orientation) return
* SIGN_INCONSISTENT.
*/ {
- jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
+ final jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
// CachedVertex vn = v0 + tess.cacheCount;
- int vn = tess.cacheCount;
+ final int vn = tess.cacheCount;
// CachedVertex vc;
int vc;
double dot, xc, yc, zc, xp, yp, zp;
- double[] n = new double[3];
+ final double[] n = new double[3];
int sign = 0;
/* Find the polygon normal. It is important to get a reasonable
@@ -490,13 +490,13 @@ class Render {
* Returns true if the polygon was successfully rendered. The rendering
* output is provided as callbacks (see the api).
*/
- public static boolean __gl_renderCache(GLUtessellatorImpl tess) {
- jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
+ public static boolean __gl_renderCache(final GLUtessellatorImpl tess) {
+ final jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
// CachedVertex vn = v0 + tess.cacheCount;
- int vn = tess.cacheCount;
+ final int vn = tess.cacheCount;
// CachedVertex vc;
int vc;
- double[] norm = new double[3];
+ final double[] norm = new double[3];
int sign;
if (tess.cacheCount < 3) {
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
index d2c0db61e..9cf05378c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
@@ -62,7 +62,7 @@ class Sweep {
// #ifdef FOR_TRITE_TEST_PROGRAM
// extern void DebugEvent( GLUtessellator *tess );
// #else
- private static void DebugEvent(GLUtessellatorImpl tess) {
+ private static void DebugEvent(final GLUtessellatorImpl tess) {
}
// #endif
@@ -100,21 +100,21 @@ class Sweep {
/* When we merge two edges into one, we need to compute the combined
* winding of the new edge.
*/
- private static void AddWinding(GLUhalfEdge eDst, GLUhalfEdge eSrc) {
+ private static void AddWinding(final GLUhalfEdge eDst, final GLUhalfEdge eSrc) {
eDst.winding += eSrc.winding;
eDst.Sym.winding += eSrc.Sym.winding;
}
- private static ActiveRegion RegionBelow(ActiveRegion r) {
+ private static ActiveRegion RegionBelow(final ActiveRegion r) {
return ((ActiveRegion) Dict.dictKey(Dict.dictPred(r.nodeUp)));
}
- private static ActiveRegion RegionAbove(ActiveRegion r) {
+ private static ActiveRegion RegionAbove(final ActiveRegion r) {
return ((ActiveRegion) Dict.dictKey(Dict.dictSucc(r.nodeUp)));
}
- static boolean EdgeLeq(GLUtessellatorImpl tess, ActiveRegion reg1, ActiveRegion reg2)
+ static boolean EdgeLeq(final GLUtessellatorImpl tess, final ActiveRegion reg1, final ActiveRegion reg2)
/*
* Both edges must be directed from right to left (this is the canonical
* direction for the upper edge of each region).
@@ -126,7 +126,7 @@ class Sweep {
* Special case: if both edge destinations are at the sweep event,
* we sort the edges by slope (they would otherwise compare equally).
*/ {
- GLUvertex event = tess.event;
+ final GLUvertex event = tess.event;
GLUhalfEdge e1, e2;
double t1, t2;
@@ -156,7 +156,7 @@ class Sweep {
}
- static void DeleteRegion(GLUtessellatorImpl tess, ActiveRegion reg) {
+ static void DeleteRegion(final GLUtessellatorImpl tess, final ActiveRegion reg) {
if (reg.fixUpperEdge) {
/* It was created with zero winding number, so it better be
* deleted with zero winding number (ie. it better not get merged
@@ -169,7 +169,7 @@ class Sweep {
}
- static boolean FixUpperEdge(ActiveRegion reg, GLUhalfEdge newEdge)
+ static boolean FixUpperEdge(final ActiveRegion reg, final GLUhalfEdge newEdge)
/*
* Replace an upper edge which needs fixing (see ConnectRightVertex).
*/ {
@@ -183,7 +183,7 @@ class Sweep {
}
static ActiveRegion TopLeftRegion(ActiveRegion reg) {
- GLUvertex org = reg.eUp.Org;
+ final GLUvertex org = reg.eUp.Org;
GLUhalfEdge e;
/* Find the region above the uppermost edge with the same origin */
@@ -204,7 +204,7 @@ class Sweep {
}
static ActiveRegion TopRightRegion(ActiveRegion reg) {
- GLUvertex dst = reg.eUp.Sym.Org;
+ final GLUvertex dst = reg.eUp.Sym.Org;
/* Find the region above the uppermost edge with the same destination */
do {
@@ -213,16 +213,16 @@ class Sweep {
return reg;
}
- static ActiveRegion AddRegionBelow(GLUtessellatorImpl tess,
- ActiveRegion regAbove,
- GLUhalfEdge eNewUp)
+ static ActiveRegion AddRegionBelow(final GLUtessellatorImpl tess,
+ final ActiveRegion regAbove,
+ final GLUhalfEdge eNewUp)
/*
* Add a new active region to the sweep line, *somewhere* below "regAbove"
* (according to where the new edge belongs in the sweep-line dictionary).
* The upper edge of the new region will be "eNewUp".
* Winding number and "inside" flag are not updated.
*/ {
- ActiveRegion regNew = new ActiveRegion();
+ final ActiveRegion regNew = new ActiveRegion();
if (regNew == null) throw new RuntimeException();
regNew.eUp = eNewUp;
@@ -237,7 +237,7 @@ class Sweep {
return regNew;
}
- static boolean IsWindingInside(GLUtessellatorImpl tess, int n) {
+ static boolean IsWindingInside(final GLUtessellatorImpl tess, final int n) {
switch (tess.windingRule) {
case GLU.GLU_TESS_WINDING_ODD:
return (n & 1) != 0;
@@ -257,13 +257,13 @@ class Sweep {
}
- static void ComputeWinding(GLUtessellatorImpl tess, ActiveRegion reg) {
+ static void ComputeWinding(final GLUtessellatorImpl tess, final ActiveRegion reg) {
reg.windingNumber = RegionAbove(reg).windingNumber + reg.eUp.winding;
reg.inside = IsWindingInside(tess, reg.windingNumber);
}
- static void FinishRegion(GLUtessellatorImpl tess, ActiveRegion reg)
+ static void FinishRegion(final GLUtessellatorImpl tess, final ActiveRegion reg)
/*
* Delete a region from the sweep line. This happens when the upper
* and lower chains of a region meet (at a vertex on the sweep line).
@@ -271,8 +271,8 @@ class Sweep {
* not do this before -- since the structure of the mesh is always
* changing, this face may not have even existed until now).
*/ {
- GLUhalfEdge e = reg.eUp;
- GLUface f = e.Lface;
+ final GLUhalfEdge e = reg.eUp;
+ final GLUface f = e.Lface;
f.inside = reg.inside;
f.anEdge = e; /* optimization for __gl_meshTessellateMonoRegion() */
@@ -280,8 +280,8 @@ class Sweep {
}
- static GLUhalfEdge FinishLeftRegions(GLUtessellatorImpl tess,
- ActiveRegion regFirst, ActiveRegion regLast)
+ static GLUhalfEdge FinishLeftRegions(final GLUtessellatorImpl tess,
+ final ActiveRegion regFirst, final ActiveRegion regLast)
/*
* We are given a vertex with one or more left-going edges. All affected
* edges should be in the edge dictionary. Starting at regFirst.eUp,
@@ -335,9 +335,9 @@ class Sweep {
}
- static void AddRightEdges(GLUtessellatorImpl tess, ActiveRegion regUp,
- GLUhalfEdge eFirst, GLUhalfEdge eLast, GLUhalfEdge eTopLeft,
- boolean cleanUp)
+ static void AddRightEdges(final GLUtessellatorImpl tess, final ActiveRegion regUp,
+ final GLUhalfEdge eFirst, final GLUhalfEdge eLast, GLUhalfEdge eTopLeft,
+ final boolean cleanUp)
/*
* Purpose: insert right-going edges into the edge dictionary, and update
* winding numbers and mesh connectivity appropriately. All right-going
@@ -406,16 +406,16 @@ class Sweep {
}
- static void CallCombine(GLUtessellatorImpl tess, GLUvertex isect,
- Object[] data, float[] weights, boolean needed) {
- double[] coords = new double[3];
+ static void CallCombine(final GLUtessellatorImpl tess, final GLUvertex isect,
+ final Object[] data, final float[] weights, final boolean needed) {
+ final double[] coords = new double[3];
/* Copy coord data in case the callback changes it. */
coords[0] = isect.coords[0];
coords[1] = isect.coords[1];
coords[2] = isect.coords[2];
- Object[] outData = new Object[1];
+ final Object[] outData = new Object[1];
tess.callCombineOrCombineData(coords, data, weights, outData);
isect.data = outData[0];
if (isect.data == null) {
@@ -432,14 +432,14 @@ class Sweep {
}
}
- static void SpliceMergeVertices(GLUtessellatorImpl tess, GLUhalfEdge e1,
- GLUhalfEdge e2)
+ static void SpliceMergeVertices(final GLUtessellatorImpl tess, final GLUhalfEdge e1,
+ final GLUhalfEdge e2)
/*
* Two vertices with idential coordinates are combined into one.
* e1.Org is kept, while e2.Org is discarded.
*/ {
- Object[] data = new Object[4];
- float[] weights = new float[]{0.5f, 0.5f, 0.0f, 0.0f};
+ final Object[] data = new Object[4];
+ final float[] weights = new float[]{0.5f, 0.5f, 0.0f, 0.0f};
data[0] = e1.Org.data;
data[1] = e2.Org.data;
@@ -447,8 +447,8 @@ class Sweep {
if (!Mesh.__gl_meshSplice(e1, e2)) throw new RuntimeException();
}
- static void VertexWeights(GLUvertex isect, GLUvertex org, GLUvertex dst,
- float[] weights)
+ static void VertexWeights(final GLUvertex isect, final GLUvertex org, final GLUvertex dst,
+ final float[] weights)
/*
* Find some weights which describe how the intersection vertex is
* a linear combination of "org" and "dest". Each of the two edges
@@ -456,8 +456,8 @@ class Sweep {
* splits the weight between its org and dst according to the
* relative distance to "isect".
*/ {
- double t1 = Geom.VertL1dist(org, isect);
- double t2 = Geom.VertL1dist(dst, isect);
+ final double t1 = Geom.VertL1dist(org, isect);
+ final double t2 = Geom.VertL1dist(dst, isect);
weights[0] = (float) (0.5 * t2 / (t1 + t2));
weights[1] = (float) (0.5 * t1 / (t1 + t2));
@@ -467,18 +467,18 @@ class Sweep {
}
- static void GetIntersectData(GLUtessellatorImpl tess, GLUvertex isect,
- GLUvertex orgUp, GLUvertex dstUp,
- GLUvertex orgLo, GLUvertex dstLo)
+ static void GetIntersectData(final GLUtessellatorImpl tess, final GLUvertex isect,
+ final GLUvertex orgUp, final GLUvertex dstUp,
+ final GLUvertex orgLo, final GLUvertex dstLo)
/*
* We've computed a new intersection point, now we need a "data" pointer
* from the user so that we can refer to this new vertex in the
* rendering callbacks.
*/ {
- Object[] data = new Object[4];
- float[] weights = new float[4];
- float[] weights1 = new float[2];
- float[] weights2 = new float[2];
+ final Object[] data = new Object[4];
+ final float[] weights = new float[4];
+ final float[] weights1 = new float[2];
+ final float[] weights2 = new float[2];
data[0] = orgUp.data;
data[1] = dstUp.data;
@@ -494,7 +494,7 @@ class Sweep {
CallCombine(tess, isect, data, weights, true);
}
- static boolean CheckForRightSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
+ static boolean CheckForRightSplice(final GLUtessellatorImpl tess, final ActiveRegion regUp)
/*
* Check the upper and lower edge of "regUp", to make sure that the
* eUp.Org is above eLo, or eLo.Org is below eUp (depending on which
@@ -520,9 +520,9 @@ class Sweep {
* This is a guaranteed solution, no matter how degenerate things get.
* Basically this is a combinatorial solution to a numerical problem.
*/ {
- ActiveRegion regLo = RegionBelow(regUp);
- GLUhalfEdge eUp = regUp.eUp;
- GLUhalfEdge eLo = regLo.eUp;
+ final ActiveRegion regLo = RegionBelow(regUp);
+ final GLUhalfEdge eUp = regUp.eUp;
+ final GLUhalfEdge eLo = regLo.eUp;
if (Geom.VertLeq(eUp.Org, eLo.Org)) {
if (Geom.EdgeSign(eLo.Sym.Org, eUp.Org, eLo.Org) > 0) return false;
@@ -550,7 +550,7 @@ class Sweep {
return true;
}
- static boolean CheckForLeftSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
+ static boolean CheckForLeftSplice(final GLUtessellatorImpl tess, final ActiveRegion regUp)
/*
* Check the upper and lower edge of "regUp", to make sure that the
* eUp.Sym.Org is above eLo, or eLo.Sym.Org is below eUp (depending on which
@@ -569,9 +569,9 @@ class Sweep {
* We fix the problem by just splicing the offending vertex into the
* other edge.
*/ {
- ActiveRegion regLo = RegionBelow(regUp);
- GLUhalfEdge eUp = regUp.eUp;
- GLUhalfEdge eLo = regLo.eUp;
+ final ActiveRegion regLo = RegionBelow(regUp);
+ final GLUhalfEdge eUp = regUp.eUp;
+ final GLUhalfEdge eLo = regLo.eUp;
GLUhalfEdge e;
assert (!Geom.VertEq(eUp.Sym.Org, eLo.Sym.Org));
@@ -599,7 +599,7 @@ class Sweep {
}
- static boolean CheckForIntersect(GLUtessellatorImpl tess, ActiveRegion regUp)
+ static boolean CheckForIntersect(final GLUtessellatorImpl tess, ActiveRegion regUp)
/*
* Check the upper and lower edges of the given region to see if
* they intersect. If so, create the intersection and add it
@@ -612,12 +612,12 @@ class Sweep {
ActiveRegion regLo = RegionBelow(regUp);
GLUhalfEdge eUp = regUp.eUp;
GLUhalfEdge eLo = regLo.eUp;
- GLUvertex orgUp = eUp.Org;
- GLUvertex orgLo = eLo.Org;
- GLUvertex dstUp = eUp.Sym.Org;
- GLUvertex dstLo = eLo.Sym.Org;
+ final GLUvertex orgUp = eUp.Org;
+ final GLUvertex orgLo = eLo.Org;
+ final GLUvertex dstUp = eUp.Sym.Org;
+ final GLUvertex dstLo = eLo.Sym.Org;
double tMinUp, tMaxLo;
- GLUvertex isect = new GLUvertex();
+ final GLUvertex isect = new GLUvertex();
GLUvertex orgMin;
GLUhalfEdge e;
@@ -752,7 +752,7 @@ class Sweep {
return false;
}
- static void WalkDirtyRegions(GLUtessellatorImpl tess, ActiveRegion regUp)
+ static void WalkDirtyRegions(final GLUtessellatorImpl tess, ActiveRegion regUp)
/*
* When the upper or lower edge of any region changes, the region is
* marked "dirty". This routine walks through all the dirty regions
@@ -837,7 +837,7 @@ class Sweep {
}
- static void ConnectRightVertex(GLUtessellatorImpl tess, ActiveRegion regUp,
+ static void ConnectRightVertex(final GLUtessellatorImpl tess, ActiveRegion regUp,
GLUhalfEdge eBottomLeft)
/*
* Purpose: connect a "right" vertex vEvent (one where all edges go left)
@@ -872,9 +872,9 @@ class Sweep {
*/ {
GLUhalfEdge eNew;
GLUhalfEdge eTopLeft = eBottomLeft.Onext;
- ActiveRegion regLo = RegionBelow(regUp);
- GLUhalfEdge eUp = regUp.eUp;
- GLUhalfEdge eLo = regLo.eUp;
+ final ActiveRegion regLo = RegionBelow(regUp);
+ final GLUhalfEdge eUp = regUp.eUp;
+ final GLUhalfEdge eLo = regLo.eUp;
boolean degenerate = false;
if (eUp.Sym.Org != eLo.Sym.Org) {
@@ -930,8 +930,8 @@ class Sweep {
*/
private static final boolean TOLERANCE_NONZERO = false;
- static void ConnectLeftDegenerate(GLUtessellatorImpl tess,
- ActiveRegion regUp, GLUvertex vEvent)
+ static void ConnectLeftDegenerate(final GLUtessellatorImpl tess,
+ ActiveRegion regUp, final GLUvertex vEvent)
/*
* The event vertex lies exacty on an already-processed edge or vertex.
* Adding the new vertex involves splicing it into the already-processed
@@ -989,7 +989,7 @@ class Sweep {
}
- static void ConnectLeftVertex(GLUtessellatorImpl tess, GLUvertex vEvent)
+ static void ConnectLeftVertex(final GLUtessellatorImpl tess, final GLUvertex vEvent)
/*
* Purpose: connect a "left" vertex (one where both edges go right)
* to the processed portion of the mesh. Let R be the active region
@@ -1007,7 +1007,7 @@ class Sweep {
*/ {
ActiveRegion regUp, regLo, reg;
GLUhalfEdge eUp, eLo, eNew;
- ActiveRegion tmp = new ActiveRegion();
+ final ActiveRegion tmp = new ActiveRegion();
/* assert ( vEvent.anEdge.Onext.Onext == vEvent.anEdge ); */
@@ -1035,7 +1035,7 @@ class Sweep {
eNew = Mesh.__gl_meshConnect(vEvent.anEdge.Sym, eUp.Lnext);
if (eNew == null) throw new RuntimeException();
} else {
- GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(eLo.Sym.Onext.Sym, vEvent.anEdge);
+ final GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(eLo.Sym.Onext.Sym, vEvent.anEdge);
if (tempHalfEdge == null) throw new RuntimeException();
eNew = tempHalfEdge.Sym;
@@ -1055,7 +1055,7 @@ class Sweep {
}
- static void SweepEvent(GLUtessellatorImpl tess, GLUvertex vEvent)
+ static void SweepEvent(final GLUtessellatorImpl tess, final GLUvertex vEvent)
/*
* Does everything necessary when the sweep line crosses a vertex.
* Updates the mesh and the edge dictionary.
@@ -1114,13 +1114,13 @@ class Sweep {
*/
private static final double SENTINEL_COORD = (4.0 * GLU.GLU_TESS_MAX_COORD);
- static void AddSentinel(GLUtessellatorImpl tess, double t)
+ static void AddSentinel(final GLUtessellatorImpl tess, final double t)
/*
* We add two sentinel edges above and below all other edges,
* to avoid special cases at the top and bottom.
*/ {
GLUhalfEdge e;
- ActiveRegion reg = new ActiveRegion();
+ final ActiveRegion reg = new ActiveRegion();
if (reg == null) throw new RuntimeException();
e = Mesh.__gl_meshMakeEdge(tess.mesh);
@@ -1151,7 +1151,7 @@ class Sweep {
/* __gl_dictListNewDict */
tess.dict = Dict.dictNewDict(tess, new Dict.DictLeq() {
@Override
- public boolean leq(Object frame, Object key1, Object key2) {
+ public boolean leq(final Object frame, final Object key1, final Object key2) {
return EdgeLeq(tess, (ActiveRegion) key1, (ActiveRegion) key2);
}
});
@@ -1162,7 +1162,7 @@ class Sweep {
}
- static void DoneEdgeDict(GLUtessellatorImpl tess) {
+ static void DoneEdgeDict(final GLUtessellatorImpl tess) {
ActiveRegion reg;
int fixedEdges = 0;
@@ -1185,12 +1185,12 @@ class Sweep {
}
- static void RemoveDegenerateEdges(GLUtessellatorImpl tess)
+ static void RemoveDegenerateEdges(final GLUtessellatorImpl tess)
/*
* Remove zero-length edges, and contours with fewer than 3 vertices.
*/ {
GLUhalfEdge e, eNext, eLnext;
- GLUhalfEdge eHead = tess.mesh.eHead;
+ final GLUhalfEdge eHead = tess.mesh.eHead;
/*LINTED*/
for (e = eHead.next; e != eHead; e = eNext) {
@@ -1222,7 +1222,7 @@ class Sweep {
}
}
- static boolean InitPriorityQ(GLUtessellatorImpl tess)
+ static boolean InitPriorityQ(final GLUtessellatorImpl tess)
/*
* Insert all vertices into the priority queue which determines the
* order in which vertices cross the sweep line.
@@ -1233,7 +1233,7 @@ class Sweep {
/* __gl_pqSortNewPriorityQ */
pq = tess.pq = PriorityQ.pqNewPriorityQ(new PriorityQ.Leq() {
@Override
- public boolean leq(Object key1, Object key2) {
+ public boolean leq(final Object key1, final Object key2) {
return Geom.VertLeq(((GLUvertex) key1), (GLUvertex) key2);
}
});
@@ -1254,12 +1254,12 @@ class Sweep {
}
- static void DonePriorityQ(GLUtessellatorImpl tess) {
+ static void DonePriorityQ(final GLUtessellatorImpl tess) {
tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
}
- static boolean RemoveDegenerateFaces(GLUmesh mesh)
+ static boolean RemoveDegenerateFaces(final GLUmesh mesh)
/*
* Delete any degenerate faces with only two edges. WalkDirtyRegions()
* will catch almost all of these, but it won't catch degenerate faces
@@ -1292,7 +1292,7 @@ class Sweep {
return true;
}
- public static boolean __gl_computeInterior(GLUtessellatorImpl tess)
+ public static boolean __gl_computeInterior(final GLUtessellatorImpl tess)
/*
* __gl_computeInterior( tess ) computes the planar arrangement specified
* by the given contours, and further subdivides this arrangement
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java
index 5db543c80..63994ba82 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java
@@ -80,7 +80,7 @@ class TessMono {
* to the fan is a simple orientation test. By making the fan as large
* as possible, we restore the invariant (check it yourself).
*/
- static boolean __gl_meshTessellateMonoRegion(GLUface face, boolean avoidDegenerateTris) {
+ static boolean __gl_meshTessellateMonoRegion(final GLUface face, final boolean avoidDegenerateTris) {
GLUhalfEdge up, lo;
/* All edges are oriented CCW around the boundary of the region.
@@ -135,7 +135,7 @@ class TessMono {
*/
while (lo.Lnext != up && (Geom.EdgeGoesLeft(lo.Lnext)
|| Geom.EdgeSign(lo.Org, lo.Sym.Org, lo.Lnext.Sym.Org) <= 0)) {
- GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
+ final GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
mustConnect = false;
if (tempHalfEdge == null) return false;
lo = tempHalfEdge.Sym;
@@ -145,7 +145,7 @@ class TessMono {
/* lo.Org is on the left. We can make CCW triangles from up.Sym.Org. */
while (lo.Lnext != up && (Geom.EdgeGoesRight(up.Onext.Sym)
|| Geom.EdgeSign(up.Sym.Org, up.Org, up.Onext.Sym.Org) >= 0)) {
- GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(up, up.Onext.Sym);
+ final GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(up, up.Onext.Sym);
mustConnect = false;
if (tempHalfEdge == null) return false;
up = tempHalfEdge.Sym;
@@ -159,7 +159,7 @@ class TessMono {
*/
assert (lo.Lnext != up);
while (lo.Lnext.Lnext != up) {
- GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
+ final GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
if (tempHalfEdge == null) return false;
lo = tempHalfEdge.Sym;
}
@@ -172,7 +172,7 @@ class TessMono {
* the mesh which is marked "inside" the polygon. Each such region
* must be monotone.
*/
- public static boolean __gl_meshTessellateInterior(GLUmesh mesh, boolean avoidDegenerateTris) {
+ public static boolean __gl_meshTessellateInterior(final GLUmesh mesh, final boolean avoidDegenerateTris) {
GLUface f, next;
/*LINTED*/
@@ -193,7 +193,7 @@ class TessMono {
* on NULL faces are not allowed, the main purpose is to clean up the
* mesh so that exterior loops are not represented in the data structure.
*/
- public static void __gl_meshDiscardExterior(GLUmesh mesh) {
+ public static void __gl_meshDiscardExterior(final GLUmesh mesh) {
GLUface f, next;
/*LINTED*/
@@ -216,7 +216,7 @@ class TessMono {
* If keepOnlyBoundary is TRUE, it also deletes all edges which do not
* separate an interior region from an exterior one.
*/
- public static boolean __gl_meshSetWindingNumber(GLUmesh mesh, int value, boolean keepOnlyBoundary) {
+ public static boolean __gl_meshSetWindingNumber(final GLUmesh mesh, final int value, final boolean keepOnlyBoundary) {
GLUhalfEdge e, eNext;
for (e = mesh.eHead.next; e != mesh.eHead; e = eNext) {
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
index dadad1e15..a6ab635e4 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -59,6 +59,7 @@ import javax.media.opengl.GLContext;
import javax.media.opengl.GLException;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import jogamp.nativewindow.macosx.OSXUtil;
import jogamp.opengl.GLContextImpl;
@@ -107,9 +108,9 @@ public class MacOSXCGLContext extends GLContextImpl
isMavericksOrLater = osvn.compareTo(Platform.OSXVersion.Mavericks) >= 0;
}
- static boolean isGLProfileSupported(int ctp, int major, int minor) {
- boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
- boolean ctCore = 0 != ( CTX_PROFILE_CORE & ctp ) ;
+ static boolean isGLProfileSupported(final int ctp, final int major, final int minor) {
+ final boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
+ final boolean ctCore = 0 != ( CTX_PROFILE_CORE & ctp ) ;
// We exclude 3.0, since we would map it's core to GL2. Hence we force mapping 2.1 to GL2
if( 3 < major || 3 == major && 1 <= minor ) {
@@ -135,7 +136,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
return false; // 3.0 && > 3.2
}
- static int GLProfile2CGLOGLProfileValue(AbstractGraphicsDevice device, int ctp, int major, int minor) {
+ static int GLProfile2CGLOGLProfileValue(final AbstractGraphicsDevice device, final int ctp, final int major, final int minor) {
if(!MacOSXCGLContext.isGLProfileSupported(ctp, major, minor)) {
throw new GLException("OpenGL profile not supported: "+getGLVersion(major, minor, ctp, "@GLProfile2CGLOGLProfileVersion"));
}
@@ -158,7 +159,7 @@ public class MacOSXCGLContext extends GLContextImpl
private static final String shaderBasename = "texture01_xxx";
- private static ShaderProgram createCALayerShader(GL3ES3 gl) {
+ private static ShaderProgram createCALayerShader(final GL3ES3 gl) {
// Create & Link the shader program
final ShaderProgram sp = new ShaderProgram();
final ShaderCode vp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MacOSXCGLContext.class,
@@ -176,9 +177,9 @@ public class MacOSXCGLContext extends GLContextImpl
// setup mgl_PMVMatrix
final PMVMatrix pmvMatrix = new PMVMatrix();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
pmvMatrixUniform.setLocation(gl, sp.program());
@@ -203,14 +204,14 @@ public class MacOSXCGLContext extends GLContextImpl
private long updateHandle = 0;
private int lastWidth, lastHeight;
- protected MacOSXCGLContext(GLDrawableImpl drawable,
- GLContext shareWith) {
+ protected MacOSXCGLContext(final GLDrawableImpl drawable,
+ final GLContext shareWith) {
super(drawable, shareWith);
initOpenGLImpl(getOpenGLMode());
}
@Override
- protected void resetStates(boolean isInit) {
+ protected void resetStates(final boolean isInit) {
// no inner state _cglExt = null;
cglExtProcAddressTable = null;
super.resetStates(isInit);
@@ -248,7 +249,7 @@ public class MacOSXCGLContext extends GLContextImpl
protected Map<String, String> getExtensionNameMap() { return null; }
@Override
- protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+ protected long createContextARBImpl(final long share, final boolean direct, final int ctp, final int major, final int minor) {
if(!isGLProfileSupported(ctp, major, minor)) {
if(DEBUG) {
System.err.println(getThreadName() + ": createContextARBImpl: Not supported "+getGLVersion(major, minor, ctp, "@creation on OSX "+Platform.getOSVersionNumber()));
@@ -276,7 +277,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
@Override
- protected void destroyContextARBImpl(long _context) {
+ protected void destroyContextARBImpl(final long _context) {
impl.release(_context);
impl.destroy(_context);
}
@@ -380,7 +381,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
@Override
- protected void associateDrawable(boolean bound) {
+ protected void associateDrawable(final boolean bound) {
// context stuff depends on drawable stuff
if(bound) {
super.associateDrawable(true); // 1) init drawable stuff
@@ -399,7 +400,7 @@ public class MacOSXCGLContext extends GLContextImpl
@Override
- protected void copyImpl(GLContext source, int mask) throws GLException {
+ protected void copyImpl(final GLContext source, final int mask) throws GLException {
if( isNSContext() != ((MacOSXCGLContext)source).isNSContext() ) {
throw new GLException("Source/Destination OpenGL Context tyoe mismatch: source "+source+", dest: "+this);
}
@@ -416,18 +417,18 @@ public class MacOSXCGLContext extends GLContextImpl
}
@Override
- protected boolean setSwapIntervalImpl(int interval) {
+ protected boolean setSwapIntervalImpl(final int interval) {
return impl.setSwapInterval(interval);
}
@Override
- public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
+ public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) {
// FIXME: apparently the Apple extension doesn't require a custom memory allocator
throw new GLException("Not yet implemented");
}
@Override
- public final void glFreeMemoryNV(ByteBuffer pointer) {
+ public final void glFreeMemoryNV(final ByteBuffer pointer) {
// FIXME: apparently the Apple extension doesn't require a custom memory allocator
throw new GLException("Not yet implemented");
}
@@ -467,7 +468,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
// Support for "mode switching" as described in MacOSXCGLDrawable
- public void setOpenGLMode(GLBackendType mode) {
+ public void setOpenGLMode(final GLBackendType mode) {
if (mode == openGLMode) {
return;
}
@@ -485,7 +486,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
public final GLBackendType getOpenGLMode() { return openGLMode; }
- protected void initOpenGLImpl(GLBackendType backend) {
+ protected void initOpenGLImpl(final GLBackendType backend) {
switch (backend) {
case NSOPENGL:
impl = new NSOpenGLImpl();
@@ -500,7 +501,7 @@ public class MacOSXCGLContext extends GLContextImpl
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
super.append(sb);
@@ -528,7 +529,7 @@ public class MacOSXCGLContext extends GLContextImpl
/** Only returns a valid NSView. If !NSView, return null and mark either pbuffer and FBO. */
- private long getNSViewHandle(boolean[] isPBuffer, boolean[] isFBO) {
+ private long getNSViewHandle(final boolean[] isPBuffer, final boolean[] isFBO) {
final long nsViewHandle;
if(drawable instanceof GLFBODrawableImpl) {
nsViewHandle = 0;
@@ -562,7 +563,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
@Override
- public long create(long share, int ctp, int major, int minor) {
+ public long create(final long share, final int ctp, final int major, final int minor) {
long ctx = 0;
final NativeSurface surface = drawable.getNativeSurface();
final MacOSXCGLGraphicsConfiguration config = (MacOSXCGLGraphicsConfiguration) surface.getGraphicsConfiguration();
@@ -571,8 +572,8 @@ public class MacOSXCGLContext extends GLContextImpl
final boolean isPBuffer;
final boolean isFBO;
{
- boolean[] _isPBuffer = { false };
- boolean[] _isFBO = { false };
+ final boolean[] _isPBuffer = { false };
+ final boolean[] _isFBO = { false };
nsViewHandle = getNSViewHandle(_isPBuffer, _isFBO);
isPBuffer = _isPBuffer[0];
isFBO = _isFBO[0];
@@ -654,7 +655,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
@Override
- public boolean destroy(long ctx) {
+ public boolean destroy(final long ctx) {
if(0!=pixelFormat) {
CGL.deletePixelFormat(pixelFormat);
pixelFormat = 0;
@@ -690,8 +691,8 @@ public class MacOSXCGLContext extends GLContextImpl
/** Synchronized by instance's monitor */
boolean valid;
- AttachGLLayerCmd(OffscreenLayerSurface ols, long ctx, int shaderProgram, long pfmt, long pbuffer, int texID,
- boolean isOpaque, int texWidth, int texHeight, int winWidth, int winHeight) {
+ AttachGLLayerCmd(final OffscreenLayerSurface ols, final long ctx, final int shaderProgram, final long pfmt, final long pbuffer, final int texID,
+ final boolean isOpaque, final int texWidth, final int texHeight, final int winWidth, final int winHeight) {
this.ols = ols;
this.ctx = ctx;
this.shaderProgram = shaderProgram;
@@ -745,7 +746,7 @@ public class MacOSXCGLContext extends GLContextImpl
surfaceLock.unlock();
}
}
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
if( !valid ) {
@@ -764,7 +765,7 @@ public class MacOSXCGLContext extends GLContextImpl
class DetachGLLayerCmd implements Runnable {
final AttachGLLayerCmd cmd;
- DetachGLLayerCmd(AttachGLLayerCmd cmd) {
+ DetachGLLayerCmd(final AttachGLLayerCmd cmd) {
this.cmd = cmd;
}
@@ -784,7 +785,7 @@ public class MacOSXCGLContext extends GLContextImpl
if( 0 != l ) {
ols.detachSurfaceLayer();
}
- } catch(Throwable t) {
+ } catch(final Throwable t) {
System.err.println("Caught exception on thread "+getThreadName());
t.printStackTrace();
}
@@ -802,7 +803,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
@Override
- public void associateDrawable(boolean bound) {
+ public void associateDrawable(final boolean bound) {
backingLayerHost = NativeWindowFactory.getOffscreenLayerSurface(drawable.getNativeSurface(), true);
if(DEBUG) {
@@ -831,7 +832,7 @@ public class MacOSXCGLContext extends GLContextImpl
pbufferHandle = 0;
fbod.setSwapBufferContext(new GLFBODrawableImpl.SwapBufferContext() {
@Override
- public void swapBuffers(boolean doubleBuffered) {
+ public void swapBuffers(final boolean doubleBuffered) {
MacOSXCGLContext.NSOpenGLImpl.this.swapBuffers();
} } ) ;
} else if( CGL.isNSOpenGLPixelBuffer(drawableHandle) ) {
@@ -870,8 +871,8 @@ public class MacOSXCGLContext extends GLContextImpl
} else { // -> null == backingLayerHost
lastWidth = drawable.getSurfaceWidth();
lastHeight = drawable.getSurfaceHeight();
- boolean[] isPBuffer = { false };
- boolean[] isFBO = { false };
+ final boolean[] isPBuffer = { false };
+ final boolean[] isFBO = { false };
CGL.setContextView(contextHandle, getNSViewHandle(isPBuffer, isFBO));
}
} else { // -> !bound
@@ -906,7 +907,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
}
- private final void validatePBufferConfig(long ctx) {
+ private final void validatePBufferConfig(final long ctx) {
final long drawableHandle = drawable.getHandle();
if( needsSetContextPBuffer && 0 != drawableHandle && CGL.isNSOpenGLPixelBuffer(drawableHandle) ) {
// Must associate the pbuffer with our newly-created context
@@ -919,7 +920,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
/** Returns true if size has been updated, otherwise false (same size). */
- private final boolean validateDrawableSizeConfig(long ctx) {
+ private final boolean validateDrawableSizeConfig(final long ctx) {
final int width = drawable.getSurfaceWidth();
final int height = drawable.getSurfaceHeight();
if( lastWidth != width || lastHeight != height ) {
@@ -934,13 +935,13 @@ public class MacOSXCGLContext extends GLContextImpl
}
@Override
- public boolean copyImpl(long src, int mask) {
+ public boolean copyImpl(final long src, final int mask) {
CGL.copyContext(contextHandle, src, mask);
return true;
}
@Override
- public boolean makeCurrent(long ctx) {
+ public boolean makeCurrent(final long ctx) {
final long cglCtx = CGL.getCGLContext(ctx);
if(0 == cglCtx) {
throw new InternalError("Null CGLContext for: "+this);
@@ -956,12 +957,12 @@ public class MacOSXCGLContext extends GLContextImpl
}
@Override
- public boolean release(long ctx) {
+ public boolean release(final long ctx) {
try {
if( hasRendererQuirk(GLRendererQuirks.GLFlushBeforeRelease) && null != MacOSXCGLContext.this.getGLProcAddressTable() ) {
gl.glFlush();
}
- } catch (GLException gle) {
+ } catch (final GLException gle) {
if(DEBUG) {
System.err.println("MacOSXCGLContext.NSOpenGLImpl.release: INFO: glFlush() caught exception:");
gle.printStackTrace();
@@ -987,7 +988,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
@Override
- public boolean setSwapInterval(int interval) {
+ public boolean setSwapInterval(final int interval) {
final AttachGLLayerCmd cmd = attachGLLayerCmd;
if(null != cmd) {
synchronized(cmd) {
@@ -1001,7 +1002,7 @@ public class MacOSXCGLContext extends GLContextImpl
return true;
}
- private void setSwapIntervalImpl(final long l, int interval) {
+ private void setSwapIntervalImpl(final long l, final int interval) {
if( 0 != l ) {
CGL.setNSOpenGLLayerSwapInterval(l, interval);
if( 0 < interval ) {
@@ -1124,7 +1125,7 @@ public class MacOSXCGLContext extends GLContextImpl
public boolean isNSContext() { return false; }
@Override
- public long create(long share, int ctp, int major, int minor) {
+ public long create(final long share, final int ctp, final int major, final int minor) {
long ctx = 0;
final MacOSXCGLGraphicsConfiguration config = (MacOSXCGLGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration();
final GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable)config.getChosenCapabilities();
@@ -1135,7 +1136,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
try {
// Create new context
- PointerBuffer ctxPB = PointerBuffer.allocateDirect(1);
+ final PointerBuffer ctxPB = PointerBuffer.allocateDirect(1);
if (DEBUG) {
System.err.println("Share context for CGL-based pbuffer context is " + toHexString(share));
}
@@ -1173,22 +1174,22 @@ public class MacOSXCGLContext extends GLContextImpl
}
@Override
- public boolean destroy(long ctx) {
+ public boolean destroy(final long ctx) {
return CGL.CGLDestroyContext(ctx) == CGL.kCGLNoError;
}
@Override
- public void associateDrawable(boolean bound) {
+ public void associateDrawable(final boolean bound) {
}
@Override
- public boolean copyImpl(long src, int mask) {
+ public boolean copyImpl(final long src, final int mask) {
CGL.CGLCopyContext(src, contextHandle, mask);
return true;
}
@Override
- public boolean makeCurrent(long ctx) {
+ public boolean makeCurrent(final long ctx) {
int err = CGL.CGLLockContext(ctx);
if(CGL.kCGLNoError == err) {
err = CGL.CGLSetCurrentContext(ctx);
@@ -1204,22 +1205,22 @@ public class MacOSXCGLContext extends GLContextImpl
}
@Override
- public boolean release(long ctx) {
+ public boolean release(final long ctx) {
try {
if( hasRendererQuirk(GLRendererQuirks.GLFlushBeforeRelease) && null != MacOSXCGLContext.this.getGLProcAddressTable() ) {
gl.glFlush();
}
- } catch (GLException gle) {
+ } catch (final GLException gle) {
if(DEBUG) {
System.err.println("MacOSXCGLContext.CGLImpl.release: INFO: glFlush() caught exception:");
gle.printStackTrace();
}
}
- int err = CGL.CGLSetCurrentContext(0);
+ final int err = CGL.CGLSetCurrentContext(0);
if(DEBUG && CGL.kCGLNoError != err) {
System.err.println("CGL: Could not release current context: err 0x"+Integer.toHexString(err)+": "+this);
}
- int err2 = CGL.CGLUnlockContext(ctx);
+ final int err2 = CGL.CGLUnlockContext(ctx);
if(DEBUG && CGL.kCGLNoError != err2) {
System.err.println("CGL: Could not unlock context: err 0x"+Integer.toHexString(err2)+": "+this);
}
@@ -1237,7 +1238,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
@Override
- public boolean setSwapInterval(int interval) {
+ public boolean setSwapInterval(final int interval) {
final IntBuffer lval = Buffers.newDirectIntBuffer(1);
lval.put(0, interval);
CGL.CGLSetParameter(contextHandle, CGL.kCGLCPSwapInterval, lval);
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
index 448e3e221..8ea84a32d 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
@@ -91,7 +91,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
public final int id;
- GLBackendType(int id){
+ GLBackendType(final int id){
this.id = id;
}
}
@@ -100,7 +100,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
private boolean haveSetOpenGLMode = false;
private GLBackendType openGLMode = GLBackendType.NSOPENGL;
- public MacOSXCGLDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
+ public MacOSXCGLDrawable(final GLDrawableFactory factory, final NativeSurface comp, final boolean realized) {
super(factory, comp, realized);
initOpenGLImpl(getOpenGLMode());
}
@@ -110,7 +110,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
}
@Override
- protected void associateContext(GLContext ctx, boolean bound) {
+ protected void associateContext(final GLContext ctx, final boolean bound) {
// NOTE: we need to keep track of the created contexts in order to
// implement swapBuffers() because of how Mac OS X implements its
// OpenGL window interface
@@ -132,7 +132,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
}
@Override
- protected final void swapBuffersImpl(boolean doubleBuffered) {
+ protected final void swapBuffersImpl(final boolean doubleBuffered) {
if(doubleBuffered) {
synchronized (createdContexts) {
for(int i=0; i<createdContexts.size(); ) {
@@ -154,7 +154,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
}
// Support for "mode switching" as described in MacOSXCGLDrawable
- public void setOpenGLMode(GLBackendType mode) {
+ public void setOpenGLMode(final GLBackendType mode) {
if (mode == openGLMode) {
return;
}
@@ -171,6 +171,6 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
}
public final GLBackendType getOpenGLMode() { return openGLMode; }
- protected void initOpenGLImpl(GLBackendType backend) { /* nop */ }
+ protected void initOpenGLImpl(final GLBackendType backend) { /* nop */ }
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
index 8931045d1..7c05b8eab 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
@@ -89,7 +89,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
DesktopGLDynamicLookupHelper tmp = null;
try {
tmp = new DesktopGLDynamicLookupHelper(new MacOSXCGLDynamicLibraryBundleInfo());
- } catch (GLException gle) {
+ } catch (final GLException gle) {
if(DEBUG) {
gle.printStackTrace();
}
@@ -113,7 +113,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
try {
ReflectionUtil.callStaticMethod("jogamp.opengl.macosx.cgl.awt.MacOSXAWTCGLGraphicsConfigurationFactory",
"registerFactory", null, null, getClass().getClassLoader());
- } catch (Exception jre) { /* n/a .. */ }
+ } catch (final Exception jre) { /* n/a .. */ }
}
sharedMap = new HashMap<String, SharedResource>();
@@ -144,7 +144,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
+ public GLDynamicLookupHelper getGLDynamicLookupHelper(final int profile) {
return macOSXCGLDynamicLookupHelper;
}
@@ -161,9 +161,9 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
boolean hasRECTTextures;
boolean hasAppleFloatPixels;
- SharedResource(MacOSXGraphicsDevice device, boolean valid,
- boolean hasNPOTTextures, boolean hasRECTTextures, boolean hasAppletFloatPixels
- /* MacOSXCGLDrawable draw, MacOSXCGLContext ctx */, GLRendererQuirks glRendererQuirks) {
+ SharedResource(final MacOSXGraphicsDevice device, final boolean valid,
+ final boolean hasNPOTTextures, final boolean hasRECTTextures, final boolean hasAppletFloatPixels
+ /* MacOSXCGLDrawable draw, MacOSXCGLContext ctx */, final GLRendererQuirks glRendererQuirks) {
// drawable = draw;
// this.context = ctx;
this.glRendererQuirks = glRendererQuirks;
@@ -207,7 +207,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+ public final boolean getIsDeviceCompatible(final AbstractGraphicsDevice device) {
if(null!=macOSXCGLDynamicLookupHelper && device instanceof MacOSXGraphicsDevice) {
return true;
}
@@ -216,24 +216,24 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
private final HashSet<String> devicesTried = new HashSet<String>();
- private boolean getDeviceTried(String connection) {
+ private boolean getDeviceTried(final String connection) {
synchronized (devicesTried) {
return devicesTried.contains(connection);
}
}
- private void addDeviceTried(String connection) {
+ private void addDeviceTried(final String connection) {
synchronized (devicesTried) {
devicesTried.add(connection);
}
}
- private void removeDeviceTried(String connection) {
+ private void removeDeviceTried(final String connection) {
synchronized (devicesTried) {
devicesTried.remove(connection);
}
}
@Override
- protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice adevice) {
+ protected final SharedResource getOrCreateSharedResourceImpl(final AbstractGraphicsDevice adevice) {
final String connection = adevice.getConnection();
SharedResource sr;
synchronized(sharedMap) {
@@ -248,7 +248,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
boolean hasRECTTextures = false;
boolean hasAppleFloatPixels = false;
{
- GLProfile glp = GLProfile.get(sharedDevice, GLProfile.GL_PROFILE_LIST_MIN_DESKTOP, false);
+ final GLProfile glp = GLProfile.get(sharedDevice, GLProfile.GL_PROFILE_LIST_MIN_DESKTOP, false);
if (null == glp) {
throw new GLException("Couldn't get default GLProfile for device: "+sharedDevice);
}
@@ -265,13 +265,13 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
sharedContext.makeCurrent(); // could cause exception
isValid = sharedContext.isCurrent();
if(isValid) {
- GL gl = sharedContext.getGL();
+ final GL gl = sharedContext.getGL();
hasNPOTTextures = gl.isNPOTTextureAvailable();
hasRECTTextures = gl.isExtensionAvailable(GLExtensions.EXT_texture_rectangle);
hasAppleFloatPixels = gl.isExtensionAvailable(GLExtensions.APPLE_float_pixels);
glRendererQuirks = sharedContext.getRendererQuirks();
}
- } catch (GLException gle) {
+ } catch (final GLException gle) {
if (DEBUG) {
System.err.println("MacOSXCGLDrawableFactory.createShared: INFO: makeCurrent caught exception:");
gle.printStackTrace();
@@ -279,7 +279,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
} finally {
try {
sharedContext.destroy();
- } catch (GLException gle) {
+ } catch (final GLException gle) {
if (DEBUG) {
System.err.println("MacOSXCGLDrawableFactory.createShared: INFO: destroy caught exception:");
gle.printStackTrace();
@@ -308,12 +308,12 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+ protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(final AbstractGraphicsDevice device) {
return MacOSXCGLGraphicsConfiguration.getAvailableCapabilities(this, device);
}
@Override
- protected GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+ protected GLDrawableImpl createOnscreenDrawableImpl(final NativeSurface target) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
@@ -321,7 +321,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
+ protected GLDrawableImpl createOffscreenDrawableImpl(final NativeSurface target) {
final MutableGraphicsConfiguration config = (MutableGraphicsConfiguration) target.getGraphicsConfiguration();
final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
if(!caps.isPBuffer()) {
@@ -336,7 +336,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) {
+ public boolean canCreateGLPbuffer(final AbstractGraphicsDevice device, final GLProfile glp) {
if( glp.isGL2() ) {
// OSX only supports pbuffer w/ compatible, non-core, context.
return true;
@@ -346,9 +346,9 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
+ protected ProxySurface createMutableSurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+ final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstreamHook) {
final MacOSXGraphicsDevice device;
if( createNewDevice || !(deviceReq instanceof MacOSXGraphicsDevice) ) {
device = new MacOSXGraphicsDevice(deviceReq.getUnitID());
@@ -364,15 +364,15 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
+ public final ProxySurface createDummySurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+ GLCapabilitiesImmutable chosenCaps, final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser chooser, final int width, final int height) {
chosenCaps = GLGraphicsConfigurationUtil.fixOnscreenGLCapabilities(chosenCaps);
return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser,
new OSXDummyUpstreamSurfaceHook(width, height));
}
@Override
- protected ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
+ protected ProxySurface createProxySurfaceImpl(final AbstractGraphicsDevice deviceReq, final int screenIdx, final long windowHandle, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstream) {
final MacOSXGraphicsDevice device = new MacOSXGraphicsDevice(deviceReq.getUnitID());
final AbstractGraphicsScreen screen = new DefaultGraphicsScreen(device, screenIdx);
final MacOSXCGLGraphicsConfiguration config = MacOSXCGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen, true);
@@ -385,7 +385,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+ public boolean canCreateExternalGLDrawable(final AbstractGraphicsDevice device) {
return false;
}
@@ -409,7 +409,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected boolean setGammaRamp(float[] ramp) {
+ protected boolean setGammaRamp(final float[] ramp) {
final FloatBuffer rampNIO = Buffers.newDirectFloatBuffer(ramp);
return CGL.setGammaRamp(ramp.length, rampNIO, rampNIO, rampNIO);
@@ -421,7 +421,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected void resetGammaRamp(Buffer originalGammaRamp) {
+ protected void resetGammaRamp(final Buffer originalGammaRamp) {
CGL.resetGammaRamp();
}
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
index cda8307c7..3ec40ffce 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
@@ -56,7 +56,7 @@ public final class MacOSXCGLDynamicLibraryBundleInfo extends DesktopGLDynamicLib
}
@Override
- public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+ public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
return 0;
/** OSX manual says: NSImage use is discouraged
return CGL.getProcAddress(glFuncName); // manual implementation
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
index 481c0b94b..cd89ad526 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
@@ -53,8 +53,8 @@ import com.jogamp.nativewindow.MutableGraphicsConfiguration;
public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration implements Cloneable {
- MacOSXCGLGraphicsConfiguration(AbstractGraphicsScreen screen,
- GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested) {
+ MacOSXCGLGraphicsConfiguration(final AbstractGraphicsScreen screen,
+ final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested) {
super(screen, capsChosen, capsRequested);
}
@@ -63,8 +63,8 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
return super.clone();
}
- protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(MacOSXCGLDrawableFactory factory, AbstractGraphicsDevice device) {
- MacOSXCGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
+ protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(final MacOSXCGLDrawableFactory factory, final AbstractGraphicsDevice device) {
+ final MacOSXCGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
if(null == sharedResource) {
throw new GLException("Shared resource for device n/a: "+device);
}
@@ -88,7 +88,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
CGL.NSOpenGLPFASampleBuffers,
CGL.NSOpenGLPFASamples });
- static IntBuffer GLCapabilities2NSAttribList(AbstractGraphicsDevice device, IntBuffer attrToken, GLCapabilitiesImmutable caps, int ctp, int major, int minor) {
+ static IntBuffer GLCapabilities2NSAttribList(final AbstractGraphicsDevice device, final IntBuffer attrToken, final GLCapabilitiesImmutable caps, final int ctp, final int major, final int minor) {
final int len = attrToken.remaining();
final int off = attrToken.position();
final IntBuffer ivalues = Buffers.newDirectIntBuffer(len);
@@ -155,7 +155,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
return ivalues;
}
- static long GLCapabilities2NSPixelFormat(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps, int ctp, int major, int minor) {
+ static long GLCapabilities2NSPixelFormat(final AbstractGraphicsDevice device, final GLCapabilitiesImmutable caps, final int ctp, final int major, final int minor) {
final IntBuffer attrToken = cglInternalAttributeToken.duplicate();
if ( !MacOSXCGLContext.isLionOrLater ) {
// no OpenGLProfile
@@ -165,11 +165,11 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
return CGL.createPixelFormat(attrToken, attrToken.remaining(), ivalues);
}
- static GLCapabilities NSPixelFormat2GLCapabilities(GLProfile glp, long pixelFormat) {
+ static GLCapabilities NSPixelFormat2GLCapabilities(final GLProfile glp, final long pixelFormat) {
return PixelFormat2GLCapabilities(glp, pixelFormat, true);
}
- static long GLCapabilities2CGLPixelFormat(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps, int ctp, int major, int minor) {
+ static long GLCapabilities2CGLPixelFormat(final AbstractGraphicsDevice device, final GLCapabilitiesImmutable caps, final int ctp, final int major, final int minor) {
// Set up pixel format attributes
final IntBuffer attrs = Buffers.newDirectIntBuffer(256);
int i = 0;
@@ -214,20 +214,20 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
}
// Use attribute array to select pixel format
- PointerBuffer fmt = PointerBuffer.allocateDirect(1);
- IntBuffer numScreens = Buffers.newDirectIntBuffer(1);
- int res = CGL.CGLChoosePixelFormat(attrs, fmt, numScreens);
+ final PointerBuffer fmt = PointerBuffer.allocateDirect(1);
+ final IntBuffer numScreens = Buffers.newDirectIntBuffer(1);
+ final int res = CGL.CGLChoosePixelFormat(attrs, fmt, numScreens);
if (res != CGL.kCGLNoError) {
throw new GLException("Error code " + res + " while choosing pixel format");
}
return fmt.get(0);
}
- static GLCapabilities CGLPixelFormat2GLCapabilities(long pixelFormat) {
+ static GLCapabilities CGLPixelFormat2GLCapabilities(final long pixelFormat) {
return PixelFormat2GLCapabilities(null, pixelFormat, false);
}
- private static GLCapabilities PixelFormat2GLCapabilities(GLProfile glp, long pixelFormat, boolean nsUsage) {
+ private static GLCapabilities PixelFormat2GLCapabilities(GLProfile glp, final long pixelFormat, final boolean nsUsage) {
final IntBuffer attrToken = cglInternalAttributeToken.duplicate();
final int off;
if ( !MacOSXCGLContext.isLionOrLater ) {
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
index db2a1df68..50de70227 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
@@ -61,8 +61,8 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
- CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+ final CapabilitiesChooser chooser, final AbstractGraphicsScreen absScreen, final int nativeVisualID) {
if (absScreen == null) {
throw new IllegalArgumentException("AbstractGraphicsScreen is null");
@@ -84,15 +84,15 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
}
static MacOSXCGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
- GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser,
- AbstractGraphicsScreen absScreen, boolean usePBuffer) {
+ final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser,
+ final AbstractGraphicsScreen absScreen, final boolean usePBuffer) {
if (absScreen == null) {
throw new IllegalArgumentException("AbstractGraphicsScreen is null");
}
final AbstractGraphicsDevice device = absScreen.getDevice();
capsChosen = GLGraphicsConfigurationUtil.fixGLCapabilities( capsChosen, GLDrawableFactory.getDesktopFactory(), device);
- return new MacOSXCGLGraphicsConfiguration(absScreen, (GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested);
+ return new MacOSXCGLGraphicsConfiguration(absScreen, capsChosen, capsRequested);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java
index 150feac55..c17ed7d59 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java
@@ -56,7 +56,7 @@ import jogamp.opengl.macosx.cgl.MacOSXCGLDrawable.GLBackendType;
public class MacOSXExternalCGLContext extends MacOSXCGLContext {
- private MacOSXExternalCGLContext(Drawable drawable, boolean isNSContext, long handle) {
+ private MacOSXExternalCGLContext(final Drawable drawable, final boolean isNSContext, final long handle) {
super(drawable, null);
setOpenGLMode(isNSContext ? GLBackendType.NSOPENGL : GLBackendType.CGL );
this.contextHandle = handle;
@@ -67,13 +67,13 @@ public class MacOSXExternalCGLContext extends MacOSXCGLContext {
getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
}
- protected static MacOSXExternalCGLContext create(GLDrawableFactory factory) {
+ protected static MacOSXExternalCGLContext create(final GLDrawableFactory factory) {
long pixelFormat = 0;
long currentDrawable = 0;
long contextHandle = CGL.getCurrentContext(); // Check: MacOSX 10.3 ..
- boolean isNSContext = 0 != contextHandle;
+ final boolean isNSContext = 0 != contextHandle;
if( isNSContext ) {
- long ctx = CGL.getCGLContext(contextHandle);
+ final long ctx = CGL.getCGLContext(contextHandle);
if (ctx == 0) {
throw new GLException("Error: NULL Context (CGL) of Context (NS) 0x" +Long.toHexString(contextHandle));
}
@@ -100,19 +100,19 @@ public class MacOSXExternalCGLContext extends MacOSXCGLContext {
if (0 == pixelFormat) {
throw new GLException("Error: current pixelformat of current Context 0x"+Long.toHexString(contextHandle)+" is null");
}
- GLCapabilitiesImmutable caps = MacOSXCGLGraphicsConfiguration.CGLPixelFormat2GLCapabilities(pixelFormat);
+ final GLCapabilitiesImmutable caps = MacOSXCGLGraphicsConfiguration.CGLPixelFormat2GLCapabilities(pixelFormat);
if(DEBUG) {
System.err.println("MacOSXExternalCGLContext Create "+caps);
}
- AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_MACOSX);
- MacOSXCGLGraphicsConfiguration cfg = new MacOSXCGLGraphicsConfiguration(aScreen, caps, caps);
+ final AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_MACOSX);
+ final MacOSXCGLGraphicsConfiguration cfg = new MacOSXCGLGraphicsConfiguration(aScreen, caps, caps);
if(0 == currentDrawable) {
// set a fake marker stating a valid drawable
currentDrawable = 1;
}
- WrappedSurface ns = new WrappedSurface(cfg, currentDrawable, 64, 64, true);
+ final WrappedSurface ns = new WrappedSurface(cfg, currentDrawable, 64, 64, true);
return new MacOSXExternalCGLContext(new Drawable(factory, ns), isNSContext, contextHandle);
}
@@ -135,12 +135,12 @@ public class MacOSXExternalCGLContext extends MacOSXCGLContext {
// Need to provide the display connection to extension querying APIs
static class Drawable extends MacOSXCGLDrawable {
- Drawable(GLDrawableFactory factory, NativeSurface comp) {
+ Drawable(final GLDrawableFactory factory, final NativeSurface comp) {
super(factory, comp, true);
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
throw new GLException("Should not call this");
}
@@ -154,7 +154,7 @@ public class MacOSXExternalCGLContext extends MacOSXCGLContext {
throw new GLException("Should not call this");
}
- public void setSize(int width, int height) {
+ public void setSize(final int width, final int height) {
throw new GLException("Should not call this");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
index 446a834b9..c613efa63 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
@@ -46,13 +46,13 @@ import javax.media.opengl.GLDrawableFactory;
public class MacOSXOffscreenCGLDrawable extends MacOSXPbufferCGLDrawable {
- public MacOSXOffscreenCGLDrawable(GLDrawableFactory factory,
- NativeSurface target) {
+ public MacOSXOffscreenCGLDrawable(final GLDrawableFactory factory,
+ final NativeSurface target) {
super(factory, target);
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new MacOSXCGLContext(this, shareWith);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
index c6f0c1383..e9ea2ff61 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
@@ -46,12 +46,12 @@ import javax.media.opengl.GLDrawableFactory;
public class MacOSXOnscreenCGLDrawable extends MacOSXCGLDrawable {
- protected MacOSXOnscreenCGLDrawable(GLDrawableFactory factory, NativeSurface component) {
+ protected MacOSXOnscreenCGLDrawable(final GLDrawableFactory factory, final NativeSurface component) {
super(factory, component, false);
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new MacOSXCGLContext(this, shareWith);
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
index eba97a9ca..b1d560f4a 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
@@ -73,7 +73,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
protected int pBufferTexTarget, pBufferTexWidth, pBufferTexHeight;
- public MacOSXPbufferCGLDrawable(GLDrawableFactory factory, NativeSurface target) {
+ public MacOSXPbufferCGLDrawable(final GLDrawableFactory factory, final NativeSurface target) {
super(factory, target, false);
}
@@ -87,7 +87,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new MacOSXCGLContext(this, shareWith);
}
@@ -121,7 +121,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
final DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) ms.getGraphicsConfiguration();
final GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
final GLProfile glProfile = capabilities.getGLProfile();
- MacOSXCGLDrawableFactory.SharedResource sr = ((MacOSXCGLDrawableFactory)factory).getOrCreateSharedResourceImpl(config.getScreen().getDevice());
+ final MacOSXCGLDrawableFactory.SharedResource sr = ((MacOSXCGLDrawableFactory)factory).getOrCreateSharedResourceImpl(config.getScreen().getDevice());
if (DEBUG) {
System.out.println(getThreadName()+": Pbuffer config: " + config);
@@ -160,13 +160,13 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
}
@Override
- public void setOpenGLMode(GLBackendType mode) {
+ public void setOpenGLMode(final GLBackendType mode) {
super.setOpenGLMode(mode);
createPbuffer(); // recreate
}
@Override
- protected void initOpenGLImpl(GLBackendType backend) {
+ protected void initOpenGLImpl(final GLBackendType backend) {
switch (backend) {
case NSOPENGL:
impl = new NSOpenGLImpl();
@@ -182,12 +182,12 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
// NSOpenGLPixelBuffer implementation
class NSOpenGLImpl implements GLBackendImpl {
@Override
- public long create(int renderTarget, int internalFormat, int width, int height) {
+ public long create(final int renderTarget, final int internalFormat, final int width, final int height) {
return CGL.createPBuffer(renderTarget, internalFormat, width, height);
}
@Override
- public void destroy(long pbuffer) {
+ public void destroy(final long pbuffer) {
CGL.destroyPBuffer(pbuffer);
}
}
@@ -195,9 +195,9 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
// CGL implementation
class CGLImpl implements GLBackendImpl {
@Override
- public long create(int renderTarget, int internalFormat, int width, int height) {
- PointerBuffer pbuffer = PointerBuffer.allocateDirect(1);
- int res = CGL.CGLCreatePBuffer(width, height, renderTarget, internalFormat, 0, pbuffer);
+ public long create(final int renderTarget, final int internalFormat, final int width, final int height) {
+ final PointerBuffer pbuffer = PointerBuffer.allocateDirect(1);
+ final int res = CGL.CGLCreatePBuffer(width, height, renderTarget, internalFormat, 0, pbuffer);
if (res != CGL.kCGLNoError) {
throw new GLException("Error creating CGL-based pbuffer: error code " + res);
}
@@ -205,8 +205,8 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
}
@Override
- public void destroy(long pbuffer) {
- int res = CGL.CGLDestroyPBuffer(pbuffer);
+ public void destroy(final long pbuffer) {
+ final int res = CGL.CGLDestroyPBuffer(pbuffer);
if (res != CGL.kCGLNoError) {
throw new GLException("Error destroying CGL-based pbuffer: error code " + res);
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
index 21923531f..01300b005 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
@@ -65,8 +65,8 @@ public class MacOSXAWTCGLGraphicsConfigurationFactory extends GLGraphicsConfigur
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
- CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+ final CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, final int nativeVisualID) {
GraphicsDevice device = null;
if (absScreen != null &&
!(absScreen instanceof AWTGraphicsScreen)) {
@@ -76,7 +76,7 @@ public class MacOSXAWTCGLGraphicsConfigurationFactory extends GLGraphicsConfigur
if(null==absScreen) {
absScreen = AWTGraphicsScreen.createDefault();
}
- AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
+ final AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
if ( !(capsChosen instanceof GLCapabilitiesImmutable) ) {
@@ -96,14 +96,14 @@ public class MacOSXAWTCGLGraphicsConfigurationFactory extends GLGraphicsConfigur
System.err.println("MacOSXAWTCGLGraphicsConfigurationFactory: got "+absScreen);
}
- MacOSXGraphicsDevice macDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
- DefaultGraphicsScreen macScreen = new DefaultGraphicsScreen(macDevice, awtScreen.getIndex());
+ final MacOSXGraphicsDevice macDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
+ final DefaultGraphicsScreen macScreen = new DefaultGraphicsScreen(macDevice, awtScreen.getIndex());
if(DEBUG) {
System.err.println("MacOSXAWTCGLGraphicsConfigurationFactory: made "+macScreen);
}
- GraphicsConfiguration gc = device.getDefaultConfiguration();
- MacOSXCGLGraphicsConfiguration macConfig = (MacOSXCGLGraphicsConfiguration)
+ final GraphicsConfiguration gc = device.getDefaultConfiguration();
+ final MacOSXCGLGraphicsConfiguration macConfig = (MacOSXCGLGraphicsConfiguration)
GraphicsConfigurationFactory.getFactory(macDevice, capsChosen).chooseGraphicsConfiguration(capsChosen,
capsRequested,
chooser, macScreen, nativeVisualID);
diff --git a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
index 6817ece8f..b6ffced9f 100644
--- a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
@@ -34,13 +34,16 @@ import java.util.Arrays;
import jogamp.opengl.Debug;
import com.jogamp.common.util.LFRingbuffer;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.Ringbuffer;
import com.jogamp.common.util.locks.LockFactory;
import com.jogamp.common.util.locks.RecursiveLock;
import com.jogamp.openal.AL;
import com.jogamp.openal.ALC;
+import com.jogamp.openal.ALCConstants;
import com.jogamp.openal.ALCcontext;
import com.jogamp.openal.ALCdevice;
+import com.jogamp.openal.ALConstants;
import com.jogamp.openal.ALExt;
import com.jogamp.openal.ALFactory;
import com.jogamp.openal.util.ALHelpers;
@@ -74,10 +77,10 @@ public class ALAudioSink implements AudioSink {
static class ALAudioFrame extends AudioFrame {
private final int alBuffer;
- ALAudioFrame(int alBuffer) {
+ ALAudioFrame(final int alBuffer) {
this.alBuffer = alBuffer;
}
- public ALAudioFrame(int alBuffer, int pts, int duration, int dataSize) {
+ public ALAudioFrame(final int alBuffer, final int pts, final int duration, final int dataSize) {
super(pts, duration, dataSize);
this.alBuffer = alBuffer;
}
@@ -112,7 +115,7 @@ public class ALAudioSink implements AudioSink {
static {
Debug.initSingleton();
- DEBUG_TRACE = Debug.isPropertyDefined("jogl.debug.AudioSink.trace", true);
+ DEBUG_TRACE = PropertyAccess.isPropertyDefined("jogl.debug.AudioSink.trace", true);
ALC _alc = null;
AL _al = null;
@@ -121,7 +124,7 @@ public class ALAudioSink implements AudioSink {
_alc = ALFactory.getALC();
_al = ALFactory.getAL();
_alExt = ALFactory.getALExt();
- } catch(Throwable t) {
+ } catch(final Throwable t) {
if( DEBUG ) {
System.err.println("ALAudioSink: Caught "+t.getClass().getName()+": "+t.getMessage());
t.printStackTrace();
@@ -139,7 +142,7 @@ public class ALAudioSink implements AudioSink {
private boolean checkALError(final String prefix) {
final int alcErr = alc.alcGetError(device);
final int alErr = al.alGetError();
- final boolean ok = ALC.ALC_NO_ERROR == alcErr && AL.AL_NO_ERROR == alErr;
+ final boolean ok = ALCConstants.ALC_NO_ERROR == alcErr && ALConstants.AL_NO_ERROR == alErr;
if( DEBUG ) {
System.err.println("ALAudioSink."+prefix+": ok "+ok+", err [alc "+toHexString(alcErr)+", al "+toHexString(alErr)+"]");
}
@@ -165,7 +168,7 @@ public class ALAudioSink implements AudioSink {
clearPreALError("init."+checkErrIter++);
// Get the device specifier.
- deviceSpecifier = alc.alcGetString(device, ALC.ALC_DEVICE_SPECIFIER);
+ deviceSpecifier = alc.alcGetString(device, ALCConstants.ALC_DEVICE_SPECIFIER);
if (deviceSpecifier == null) {
throw new RuntimeException(getThreadName()+": ALAudioSink: Error getting specifier for default OpenAL device");
}
@@ -181,7 +184,7 @@ public class ALAudioSink implements AudioSink {
lockContext();
try {
// Check for an error.
- if ( alc.alcGetError(device) != ALC.ALC_NO_ERROR ) {
+ if ( alc.alcGetError(device) != ALCConstants.ALC_NO_ERROR ) {
throw new RuntimeException(getThreadName()+": ALAudioSink: Error making OpenAL context current");
}
@@ -191,11 +194,11 @@ public class ALAudioSink implements AudioSink {
clearPreALError("init."+checkErrIter++);
preferredAudioFormat = new AudioFormat(querySampleRate(), DefaultFormat.sampleSize, DefaultFormat.channelCount, DefaultFormat.signed, DefaultFormat.fixedP, DefaultFormat.planar, DefaultFormat.littleEndian);
if( DEBUG ) {
- System.out.println("ALAudioSink: OpenAL Extensions:"+al.alGetString(AL.AL_EXTENSIONS));
+ System.out.println("ALAudioSink: OpenAL Extensions:"+al.alGetString(ALConstants.AL_EXTENSIONS));
clearPreALError("init."+checkErrIter++);
- System.out.println("ALAudioSink: Null device OpenAL Extensions:"+alc.alcGetString(null, ALC.ALC_EXTENSIONS));
+ System.out.println("ALAudioSink: Null device OpenAL Extensions:"+alc.alcGetString(null, ALCConstants.ALC_EXTENSIONS));
clearPreALError("init."+checkErrIter++);
- System.out.println("ALAudioSink: Device "+deviceSpecifier+" OpenAL Extensions:"+alc.alcGetString(device, ALC.ALC_EXTENSIONS));
+ System.out.println("ALAudioSink: Device "+deviceSpecifier+" OpenAL Extensions:"+alc.alcGetString(device, ALCConstants.ALC_EXTENSIONS));
System.out.println("ALAudioSink: hasSOFTBufferSamples "+hasSOFTBufferSamples);
System.out.println("ALAudioSink: hasALC_thread_local_context "+hasALC_thread_local_context);
System.out.println("ALAudioSink: preferredAudioFormat "+preferredAudioFormat);
@@ -207,7 +210,7 @@ public class ALAudioSink implements AudioSink {
alSource = new int[1];
al.alGenSources(1, alSource, 0);
final int err = al.alGetError();
- if( AL.AL_NO_ERROR != err ) {
+ if( ALConstants.AL_NO_ERROR != err ) {
alSource = null;
throw new RuntimeException(getThreadName()+": ALAudioSink: Error generating Source: 0x"+Integer.toHexString(err));
}
@@ -221,7 +224,7 @@ public class ALAudioSink implements AudioSink {
unlockContext();
}
return;
- } catch ( Exception e ) {
+ } catch ( final Exception e ) {
if( DEBUG ) {
System.err.println(e.getMessage());
e.printStackTrace();
@@ -234,10 +237,10 @@ public class ALAudioSink implements AudioSink {
private final int querySampleRate() {
final int sampleRate;
final int[] value = new int[1];
- alc.alcGetIntegerv(device, ALC.ALC_FREQUENCY, 1, value, 0);
+ alc.alcGetIntegerv(device, ALCConstants.ALC_FREQUENCY, 1, value, 0);
final int alcErr = alc.alcGetError(device);
final int alErr = al.alGetError();
- if ( ALC.ALC_NO_ERROR == alcErr && AL.AL_NO_ERROR == alErr && 0 != value[0] ) {
+ if ( ALCConstants.ALC_NO_ERROR == alcErr && ALConstants.AL_NO_ERROR == alErr && 0 != value[0] ) {
sampleRate = value[0];
} else {
sampleRate = DefaultFormat.sampleRate;
@@ -256,7 +259,7 @@ public class ALAudioSink implements AudioSink {
alc.alcMakeContextCurrent(context);
}
final int alcErr = alc.alcGetError(null);
- if( ALC.ALC_NO_ERROR != alcErr ) {
+ if( ALCConstants.ALC_NO_ERROR != alcErr ) {
final String err = getThreadName()+": ALCError "+toHexString(alcErr)+" while makeCurrent. "+this;
System.err.println(err);
Thread.dumpStack();
@@ -264,7 +267,7 @@ public class ALAudioSink implements AudioSink {
throw new RuntimeException(err);
}
final int alErr = al.alGetError();
- if( ALC.ALC_NO_ERROR != alErr ) {
+ if( ALCConstants.ALC_NO_ERROR != alErr ) {
if( DEBUG ) {
System.err.println(getThreadName()+": Prev - ALError "+toHexString(alErr)+" @ makeCurrent. "+this);
Thread.dumpStack();
@@ -285,7 +288,7 @@ public class ALAudioSink implements AudioSink {
if( null != context ) {
try {
alc.alcDestroyContext(context);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if( DEBUG ) {
System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage());
t.printStackTrace();
@@ -346,7 +349,7 @@ public class ALAudioSink implements AudioSink {
}
@Override
- public final boolean isSupported(AudioFormat format) {
+ public final boolean isSupported(final AudioFormat format) {
if( !staticAvailable ) {
return false;
}
@@ -355,13 +358,13 @@ public class ALAudioSink implements AudioSink {
return false;
}
final int alChannelLayout = ALHelpers.getDefaultALChannelLayout(format.channelCount);
- if( AL.AL_NONE != alChannelLayout ) {
+ if( ALConstants.AL_NONE != alChannelLayout ) {
final int alSampleType = ALHelpers.getALSampleType(format.sampleSize, format.signed, format.fixedP);
- if( AL.AL_NONE != alSampleType ) {
+ if( ALConstants.AL_NONE != alSampleType ) {
lockContext();
try {
final int alFormat = ALHelpers.getALFormat(alChannelLayout, alSampleType, hasSOFTBufferSamples, al, alExt);
- return AL.AL_NONE != alFormat;
+ return ALConstants.AL_NONE != alFormat;
} finally {
unlockContext();
}
@@ -371,7 +374,7 @@ public class ALAudioSink implements AudioSink {
}
@Override
- public final boolean init(AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
+ public final boolean init(final AudioFormat requestedFormat, final float frameDuration, final int initialQueueSize, final int queueGrowAmount, final int queueLimit) {
if( !staticAvailable ) {
return false;
}
@@ -379,12 +382,12 @@ public class ALAudioSink implements AudioSink {
alSampleType = ALHelpers.getALSampleType(requestedFormat.sampleSize, requestedFormat.signed, requestedFormat.fixedP);
lockContext();
try {
- if( AL.AL_NONE != alChannelLayout && AL.AL_NONE != alSampleType ) {
+ if( ALConstants.AL_NONE != alChannelLayout && ALConstants.AL_NONE != alSampleType ) {
alFormat = ALHelpers.getALFormat(alChannelLayout, alSampleType, hasSOFTBufferSamples, al, alExt);
} else {
- alFormat = AL.AL_NONE;
+ alFormat = ALConstants.AL_NONE;
}
- if( AL.AL_NONE == alFormat ) {
+ if( ALConstants.AL_NONE == alFormat ) {
// not supported
return false;
}
@@ -398,7 +401,7 @@ public class ALAudioSink implements AudioSink {
alBufferNames = new int[initialFrameCount];
al.alGenBuffers(initialFrameCount, alBufferNames, 0);
final int err = al.alGetError();
- if( AL.AL_NO_ERROR != err ) {
+ if( ALConstants.AL_NO_ERROR != err ) {
alBufferNames = null;
throw new RuntimeException(getThreadName()+": ALAudioSink: Error generating Buffers: 0x"+Integer.toHexString(err));
}
@@ -431,7 +434,7 @@ public class ALAudioSink implements AudioSink {
return chosenFormat;
}
- private static int[] concat(int[] first, int[] second) {
+ private static int[] concat(final int[] first, final int[] second) {
final int[] result = Arrays.copyOf(first, first.length + second.length);
System.arraycopy(second, 0, result, first.length, second.length);
return result;
@@ -457,7 +460,7 @@ public class ALAudioSink implements AudioSink {
final int[] newALBufferNames = new int[frameGrowAmount];
al.alGenBuffers(frameGrowAmount, newALBufferNames, 0);
final int err = al.alGetError();
- if( AL.AL_NO_ERROR != err ) {
+ if( ALConstants.AL_NO_ERROR != err ) {
if( DEBUG ) {
System.err.println(getThreadName()+": ALAudioSink.growBuffers: Error generating "+frameGrowAmount+" new Buffers: 0x"+Integer.toHexString(err));
}
@@ -493,7 +496,7 @@ public class ALAudioSink implements AudioSink {
if( null != alBufferNames ) {
try {
al.alDeleteBuffers(alBufferNames.length, alBufferNames, 0);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if( DEBUG ) {
System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage());
t.printStackTrace();
@@ -523,7 +526,7 @@ public class ALAudioSink implements AudioSink {
if( null != alSource ) {
try {
al.alDeleteSources(1, alSource, 0);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if( DEBUG ) {
System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage());
t.printStackTrace();
@@ -539,7 +542,7 @@ public class ALAudioSink implements AudioSink {
if( null != device ) {
try {
alc.alcCloseDevice(device);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if( DEBUG ) {
System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage());
t.printStackTrace();
@@ -556,16 +559,16 @@ public class ALAudioSink implements AudioSink {
}
private final int dequeueBuffer(final boolean wait, final boolean ignoreBufferInconsistency) {
- int alErr = AL.AL_NO_ERROR;
+ int alErr = ALConstants.AL_NO_ERROR;
final int releaseBufferCount;
if( alBufferBytesQueued > 0 ) {
final int releaseBufferLimes = Math.max(1, alFramesPlaying.size() / 4 );
final int[] val=new int[1];
int i=0;
do {
- al.alGetSourcei(alSource[0], AL.AL_BUFFERS_PROCESSED, val, 0);
+ al.alGetSourcei(alSource[0], ALConstants.AL_BUFFERS_PROCESSED, val, 0);
alErr = al.alGetError();
- if( AL.AL_NO_ERROR != alErr ) {
+ if( ALConstants.AL_NO_ERROR != alErr ) {
throw new RuntimeException(getThreadName()+": ALError "+toHexString(alErr)+" while quering processed buffers at source. "+this);
}
if( wait && val[0] < releaseBufferLimes ) {
@@ -574,12 +577,12 @@ public class ALAudioSink implements AudioSink {
final int avgBufferDura = chosenFormat.getBytesDuration( alBufferBytesQueued / alFramesPlaying.size() );
final int sleep = Math.max(2, Math.min(100, releaseBufferLimes * avgBufferDura));
if( DEBUG ) {
- System.err.println(getThreadName()+": ALAudioSink: Dequeue.wait["+i+"]: avgBufferDura "+avgBufferDura+", releaseBufferLimes "+releaseBufferLimes+", sleep "+sleep+" ms, playImpl "+(AL.AL_PLAYING == getSourceState(false))+", processed "+val[0]+", "+this);
+ System.err.println(getThreadName()+": ALAudioSink: Dequeue.wait["+i+"]: avgBufferDura "+avgBufferDura+", releaseBufferLimes "+releaseBufferLimes+", sleep "+sleep+" ms, playImpl "+(ALConstants.AL_PLAYING == getSourceState(false))+", processed "+val[0]+", "+this);
}
unlockContext();
try {
Thread.sleep( sleep - 1 );
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
} finally {
lockContext();
}
@@ -594,7 +597,7 @@ public class ALAudioSink implements AudioSink {
final int[] buffers = new int[releaseBufferCount];
al.alSourceUnqueueBuffers(alSource[0], releaseBufferCount, buffers, 0);
alErr = al.alGetError();
- if( AL.AL_NO_ERROR != alErr ) {
+ if( ALConstants.AL_NO_ERROR != alErr ) {
throw new RuntimeException(getThreadName()+": ALError "+toHexString(alErr)+" while dequeueing "+releaseBufferCount+" buffers. "+this);
}
for ( int i=0; i<releaseBufferCount; i++ ) {
@@ -631,9 +634,9 @@ public class ALAudioSink implements AudioSink {
System.err.println("< _FLUSH_ <- "+shortString()+" @ "+getThreadName());
}
final int[] val=new int[1];
- al.alSourcei(alSource[0], AL.AL_BUFFER, 0); // explicit force zero buffer!
+ al.alSourcei(alSource[0], ALConstants.AL_BUFFER, 0); // explicit force zero buffer!
if(DEBUG_TRACE) {
- al.alGetSourcei(alSource[0], AL.AL_BUFFERS_PROCESSED, val, 0);
+ al.alGetSourcei(alSource[0], ALConstants.AL_BUFFERS_PROCESSED, val, 0);
}
final int alErr = al.alGetError();
while ( !alFramesPlaying.isEmpty() ) {
@@ -653,7 +656,7 @@ public class ALAudioSink implements AudioSink {
}
}
- private final int dequeueBuffer(boolean wait, int inPTS, int inDuration) {
+ private final int dequeueBuffer(final boolean wait, final int inPTS, final int inDuration) {
final int dequeuedBufferCount = dequeueBuffer( wait, false /* ignoreBufferInconsistency */ );
final ALAudioFrame currentBuffer = alFramesPlaying.peek();
if( null != currentBuffer ) {
@@ -670,12 +673,12 @@ public class ALAudioSink implements AudioSink {
}
@Override
- public final AudioFrame enqueueData(AudioDataFrame audioDataFrame) {
+ public final AudioFrame enqueueData(final AudioDataFrame audioDataFrame) {
return enqueueData(audioDataFrame.getPTS(), audioDataFrame.getData(), audioDataFrame.getByteSize());
}
@Override
- public final AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) {
+ public final AudioFrame enqueueData(final int pts, final ByteBuffer bytes, final int byteCount) {
if( !initialized || null == chosenFormat ) {
return null;
}
@@ -730,7 +733,7 @@ public class ALAudioSink implements AudioSink {
al.alSourceQueueBuffers(alSource[0], 1, alBufferNames, 0);
final int alErr = al.alGetError();
- if( AL.AL_NO_ERROR != alErr ) {
+ if( ALConstants.AL_NO_ERROR != alErr ) {
throw new RuntimeException(getThreadName()+": ALError "+toHexString(alErr)+" while queueing buffer "+toHexString(alBufferNames[0])+". "+this);
}
alBufferBytesQueued += byteCount;
@@ -765,16 +768,16 @@ public class ALAudioSink implements AudioSink {
}
private final boolean isPlayingImpl0() {
if( playRequested ) {
- return AL.AL_PLAYING == getSourceState(false);
+ return ALConstants.AL_PLAYING == getSourceState(false);
} else {
return false;
}
}
- private final int getSourceState(boolean ignoreError) {
+ private final int getSourceState(final boolean ignoreError) {
final int[] val = new int[1];
- al.alGetSourcei(alSource[0], AL.AL_SOURCE_STATE, val, 0);
+ al.alGetSourcei(alSource[0], ALConstants.AL_SOURCE_STATE, val, 0);
final int alErr = al.alGetError();
- if( AL.AL_NO_ERROR != alErr ) {
+ if( ALConstants.AL_NO_ERROR != alErr ) {
final String msg = getThreadName()+": ALError "+toHexString(alErr)+" while querying SOURCE_STATE. "+this;
if( ignoreError ) {
if( DEBUG ) {
@@ -797,17 +800,17 @@ public class ALAudioSink implements AudioSink {
try {
playImpl();
if( DEBUG ) {
- System.err.println(getThreadName()+": ALAudioSink: PLAY playImpl "+(AL.AL_PLAYING == getSourceState(false))+", "+this);
+ System.err.println(getThreadName()+": ALAudioSink: PLAY playImpl "+(ALConstants.AL_PLAYING == getSourceState(false))+", "+this);
}
} finally {
unlockContext();
}
}
private final void playImpl() {
- if( playRequested && AL.AL_PLAYING != getSourceState(false) ) {
+ if( playRequested && ALConstants.AL_PLAYING != getSourceState(false) ) {
al.alSourcePlay(alSource[0]);
final int alErr = al.alGetError();
- if( AL.AL_NO_ERROR != alErr ) {
+ if( ALConstants.AL_NO_ERROR != alErr ) {
throw new RuntimeException(getThreadName()+": ALError "+toHexString(alErr)+" while start playing. "+this);
}
}
@@ -823,7 +826,7 @@ public class ALAudioSink implements AudioSink {
try {
pauseImpl();
if( DEBUG ) {
- System.err.println(getThreadName()+": ALAudioSink: PAUSE playImpl "+(AL.AL_PLAYING == getSourceState(false))+", "+this);
+ System.err.println(getThreadName()+": ALAudioSink: PAUSE playImpl "+(ALConstants.AL_PLAYING == getSourceState(false))+", "+this);
}
} finally {
unlockContext();
@@ -835,17 +838,17 @@ public class ALAudioSink implements AudioSink {
playRequested = false;
al.alSourcePause(alSource[0]);
final int alErr = al.alGetError();
- if( AL.AL_NO_ERROR != alErr ) {
+ if( ALConstants.AL_NO_ERROR != alErr ) {
throw new RuntimeException(getThreadName()+": ALError "+toHexString(alErr)+" while pausing. "+this);
}
}
}
- private final void stopImpl(boolean ignoreError) {
- if( AL.AL_STOPPED != getSourceState(ignoreError) ) {
+ private final void stopImpl(final boolean ignoreError) {
+ if( ALConstants.AL_STOPPED != getSourceState(ignoreError) ) {
playRequested = false;
al.alSourceStop(alSource[0]);
final int alErr = al.alGetError();
- if( AL.AL_NO_ERROR != alErr ) {
+ if( ALConstants.AL_NO_ERROR != alErr ) {
final String msg = "ALError "+toHexString(alErr)+" while stopping. "+this;
if( ignoreError ) {
if( DEBUG ) {
@@ -873,7 +876,7 @@ public class ALAudioSink implements AudioSink {
}
if( 0.5f <= rate && rate <= 2.0f ) { // OpenAL limits
playSpeed = rate;
- al.alSourcef(alSource[0], AL.AL_PITCH, playSpeed);
+ al.alSourcef(alSource[0], ALConstants.AL_PITCH, playSpeed);
return true;
}
} finally {
@@ -901,7 +904,7 @@ public class ALAudioSink implements AudioSink {
}
if( 0.0f <= v && v <= 1.0f ) { // OpenAL limits
volume = v;
- al.alSourcef(alSource[0], AL.AL_GAIN, v);
+ al.alSourcef(alSource[0], ALConstants.AL_GAIN, v);
return true;
}
} finally {
@@ -925,7 +928,7 @@ public class ALAudioSink implements AudioSink {
throw new InternalError("XXX: "+this);
}
if( DEBUG ) {
- System.err.println(getThreadName()+": ALAudioSink: FLUSH playImpl "+(AL.AL_PLAYING == getSourceState(false))+", "+this);
+ System.err.println(getThreadName()+": ALAudioSink: FLUSH playImpl "+(ALConstants.AL_PLAYING == getSourceState(false))+", "+this);
}
} finally {
unlockContext();
@@ -977,6 +980,6 @@ public class ALAudioSink implements AudioSink {
@Override
public final int getPTS() { return playingPTS; }
- private static final String toHexString(int v) { return "0x"+Integer.toHexString(v); }
+ private static final String toHexString(final int v) { return "0x"+Integer.toHexString(v); }
private static final String getThreadName() { return Thread.currentThread().getName(); }
}
diff --git a/src/jogl/classes/jogamp/opengl/openal/av/ALDummyUsage.java b/src/jogl/classes/jogamp/opengl/openal/av/ALDummyUsage.java
index 2c1dfa237..4f585937d 100644
--- a/src/jogl/classes/jogamp/opengl/openal/av/ALDummyUsage.java
+++ b/src/jogl/classes/jogamp/opengl/openal/av/ALDummyUsage.java
@@ -3,13 +3,13 @@ package jogamp.opengl.openal.av;
import com.jogamp.openal.AL;
import com.jogamp.openal.JoalVersion;
-/**
+/**
* Demo JOAL usage w/ av dependency, i.e. FFMPEGMediaPlayer ..
*/
public class ALDummyUsage {
static AL al;
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
System.err.println("JOGL> Hello JOAL");
System.err.println("JOAL: "+JoalVersion.getInstance().toString());
}
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
index 89e01edd8..3119b96ca 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
@@ -42,30 +42,30 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
public class GLArrayHandlerInterleaved extends GLVBOArrayHandler {
private final List<GLArrayHandlerFlat> subArrays = new ArrayList<GLArrayHandlerFlat>();
- public GLArrayHandlerInterleaved(GLArrayDataEditable ad) {
+ public GLArrayHandlerInterleaved(final GLArrayDataEditable ad) {
super(ad);
}
@Override
- public final void setSubArrayVBOName(int vboName) {
+ public final void setSubArrayVBOName(final int vboName) {
for(int i=0; i<subArrays.size(); i++) {
subArrays.get(i).getData().setVBOName(vboName);
}
}
@Override
- public final void addSubHandler(GLArrayHandlerFlat handler) {
+ public final void addSubHandler(final GLArrayHandlerFlat handler) {
subArrays.add(handler);
}
- private final void syncSubData(GL gl, Object ext) {
+ private final void syncSubData(final GL gl, final Object ext) {
for(int i=0; i<subArrays.size(); i++) {
subArrays.get(i).syncData(gl, ext);
}
}
@Override
- public final void enableState(GL gl, boolean enable, Object ext) {
+ public final void enableState(final GL gl, final boolean enable, final Object ext) {
if(enable) {
final boolean vboBound = bindBuffer(gl, true);
syncSubData(gl, ext);
diff --git a/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
index 8a587980d..66be98215 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
@@ -40,22 +40,22 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
*/
public class GLDataArrayHandler extends GLVBOArrayHandler {
- public GLDataArrayHandler(GLArrayDataEditable ad) {
+ public GLDataArrayHandler(final GLArrayDataEditable ad) {
super(ad);
}
@Override
- public final void setSubArrayVBOName(int vboName) {
+ public final void setSubArrayVBOName(final int vboName) {
throw new UnsupportedOperationException();
}
@Override
- public final void addSubHandler(GLArrayHandlerFlat handler) {
+ public final void addSubHandler(final GLArrayHandlerFlat handler) {
throw new UnsupportedOperationException();
}
@Override
- public final void enableState(GL gl, boolean enable, Object ext) {
+ public final void enableState(final GL gl, final boolean enable, final Object ext) {
if(enable) {
if(!ad.isVBO()) {
// makes no sense otherwise
diff --git a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
index 7f7a99a2d..f5869c6ba 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
@@ -39,22 +39,22 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
* represents this array only.
*/
public class GLFixedArrayHandler extends GLVBOArrayHandler {
- public GLFixedArrayHandler(GLArrayDataEditable ad) {
+ public GLFixedArrayHandler(final GLArrayDataEditable ad) {
super(ad);
}
@Override
- public final void setSubArrayVBOName(int vboName) {
+ public final void setSubArrayVBOName(final int vboName) {
throw new UnsupportedOperationException();
}
@Override
- public final void addSubHandler(GLArrayHandlerFlat handler) {
+ public final void addSubHandler(final GLArrayHandlerFlat handler) {
throw new UnsupportedOperationException();
}
@Override
- public final void enableState(GL gl, boolean enable, Object ext) {
+ public final void enableState(final GL gl, final boolean enable, final Object ext) {
final GLPointerFunc glp = gl.getGL2ES1();
if(enable) {
final boolean vboBound = bindBuffer(gl, true);
diff --git a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
index acec0510f..b5fa2f0e5 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
@@ -39,9 +39,9 @@ import com.jogamp.opengl.util.GLArrayDataWrapper;
* separately and interleaves many arrays.
*/
public class GLFixedArrayHandlerFlat implements GLArrayHandlerFlat {
- private GLArrayDataWrapper ad;
+ private final GLArrayDataWrapper ad;
- public GLFixedArrayHandlerFlat(GLArrayDataWrapper ad) {
+ public GLFixedArrayHandlerFlat(final GLArrayDataWrapper ad) {
this.ad = ad;
}
@@ -51,7 +51,7 @@ public class GLFixedArrayHandlerFlat implements GLArrayHandlerFlat {
}
@Override
- public final void syncData(GL gl, Object ext) {
+ public final void syncData(final GL gl, final Object ext) {
final GLPointerFunc glp = gl.getGL2ES1();
switch(ad.getIndex()) {
case GLPointerFunc.GL_VERTEX_ARRAY:
@@ -72,7 +72,7 @@ public class GLFixedArrayHandlerFlat implements GLArrayHandlerFlat {
}
@Override
- public final void enableState(GL gl, boolean enable, Object ext) {
+ public final void enableState(final GL gl, final boolean enable, final Object ext) {
final GLPointerFunc glp = gl.getGL2ES1();
if(enable) {
glp.glEnableClientState(ad.getIndex());
diff --git a/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
index 5198cacfa..7bc1ef1ef 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
@@ -41,12 +41,12 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
public abstract class GLVBOArrayHandler implements GLArrayHandler {
protected GLArrayDataEditable ad;
- public GLVBOArrayHandler(GLArrayDataEditable ad) {
+ public GLVBOArrayHandler(final GLArrayDataEditable ad) {
this.ad = ad;
}
@Override
- public final boolean bindBuffer(GL gl, boolean bind) {
+ public final boolean bindBuffer(final GL gl, final boolean bind) {
if( !ad.isVBO() ) {
return false;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/AudioSampleFormat.java b/src/jogl/classes/jogamp/opengl/util/av/AudioSampleFormat.java
index fdbcc9864..4c48b90e8 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/AudioSampleFormat.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/AudioSampleFormat.java
@@ -54,7 +54,7 @@ public enum AudioSampleFormat {
* </pre>
* @throws IllegalArgumentException if the given ordinal is out of range, i.e. not within [ 0 .. SampleFormat.values().length-1 ]
*/
- public static AudioSampleFormat valueOf(int ordinal) throws IllegalArgumentException {
+ public static AudioSampleFormat valueOf(final int ordinal) throws IllegalArgumentException {
final AudioSampleFormat[] all = AudioSampleFormat.values();
if( 0 <= ordinal && ordinal < all.length ) {
return all[ordinal];
diff --git a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
index 25686a170..f9df9153f 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
@@ -50,14 +50,14 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
public final int id;
- TextureType(int id){
+ TextureType(final int id){
this.id = id;
}
}
public static class EGLTextureFrame extends TextureSequence.TextureFrame {
- public EGLTextureFrame(Buffer clientBuffer, Texture t, long khrImage, long khrSync) {
+ public EGLTextureFrame(final Buffer clientBuffer, final Texture t, final long khrImage, final long khrSync) {
super(t);
this.clientBuffer = clientBuffer;
this.image = khrImage;
@@ -78,14 +78,14 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
}
- protected EGLMediaPlayerImpl(TextureType texType, boolean useKHRSync) {
+ protected EGLMediaPlayerImpl(final TextureType texType, final boolean useKHRSync) {
super();
this.texType = texType;
this.useKHRSync = useKHRSync;
}
@Override
- protected TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
+ protected TextureSequence.TextureFrame createTexImage(final GL gl, final int texName) {
final Texture texture = super.createTexImageImpl(gl, texName, getWidth(), getHeight());
final Buffer clientBuffer;
final long image;
@@ -106,7 +106,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
}
if(TextureType.KHRImage == texType) {
- IntBuffer nioTmp = Buffers.newDirectIntBuffer(1);
+ final IntBuffer nioTmp = Buffers.newDirectIntBuffer(1);
// create EGLImage from texture
clientBuffer = null; // FIXME
nioTmp.put(0, EGL.EGL_NONE);
@@ -122,7 +122,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
}
if(useKHRSync) {
- IntBuffer tmp = Buffers.newDirectIntBuffer(1);
+ final IntBuffer tmp = Buffers.newDirectIntBuffer(1);
// Create sync object so that we can be sure that gl has finished
// rendering the EGLImage texture before we tell OpenMAX to fill
// it with a new frame.
@@ -138,7 +138,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
}
@Override
- protected void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) {
+ protected void destroyTexFrame(final GL gl, final TextureSequence.TextureFrame frame) {
final boolean eglUsage = TextureType.KHRImage == texType || useKHRSync ;
final EGLContext eglCtx;
final EGLExt eglExt;
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 73b14b3d1..9cfa94a60 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -37,6 +37,7 @@ import java.util.Map;
import javax.media.nativewindow.AbstractGraphicsDevice;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
+import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLContext;
import javax.media.opengl.GLDrawable;
import javax.media.opengl.GLDrawableFactory;
@@ -201,7 +202,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
@Override
- public final void setTextureUnit(int u) { texUnit = u; }
+ public final void setTextureUnit(final int u) { texUnit = u; }
@Override
public final int getTextureUnit() { return texUnit; }
@@ -216,20 +217,20 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
@Override
public final int getTextureCount() { return textureCount; }
- protected final void setTextureTarget(int target) { textureTarget=target; }
- protected final void setTextureFormat(int internalFormat, int format) {
+ protected final void setTextureTarget(final int target) { textureTarget=target; }
+ protected final void setTextureFormat(final int internalFormat, final int format) {
textureInternalFormat=internalFormat;
textureFormat=format;
}
- protected final void setTextureType(int t) { textureType=t; }
+ protected final void setTextureType(final int t) { textureType=t; }
@Override
- public final void setTextureMinMagFilter(int[] minMagFilter) { texMinMagFilter[0] = minMagFilter[0]; texMinMagFilter[1] = minMagFilter[1];}
+ public final void setTextureMinMagFilter(final int[] minMagFilter) { texMinMagFilter[0] = minMagFilter[0]; texMinMagFilter[1] = minMagFilter[1];}
@Override
public final int[] getTextureMinMagFilter() { return texMinMagFilter; }
@Override
- public final void setTextureWrapST(int[] wrapST) { texWrapST[0] = wrapST[0]; texWrapST[1] = wrapST[1];}
+ public final void setTextureWrapST(final int[] wrapST) { texWrapST[0] = wrapST[0]; texWrapST[1] = wrapST[1];}
@Override
public final int[] getTextureWrapST() { return texWrapST; }
@@ -253,7 +254,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
checkGLInit();
switch(textureTarget) {
case GL.GL_TEXTURE_2D:
- case GL2.GL_TEXTURE_RECTANGLE:
+ case GL2GL3.GL_TEXTURE_RECTANGLE:
return TextureSequence.sampler2D;
case GLES2.GL_TEXTURE_EXTERNAL_OES:
return TextureSequence.samplerExternalOES;
@@ -269,7 +270,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
* if not overridden by specialization.
*/
@Override
- public String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException {
+ public String getTextureLookupFunctionName(final String desiredFuncName) throws IllegalStateException {
checkGLInit();
return "texture2D";
}
@@ -355,10 +356,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
protected abstract boolean playImpl();
@Override
- public final State pause(boolean flush) {
+ public final State pause(final boolean flush) {
return pauseImpl(flush, 0);
}
- private final State pauseImpl(boolean flush, int event_mask) {
+ private final State pauseImpl(final boolean flush, int event_mask) {
synchronized( stateLock ) {
final State preState = state;
if( State.Playing == state ) {
@@ -384,10 +385,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
protected abstract boolean pauseImpl();
@Override
- public final State destroy(GL gl) {
+ public final State destroy(final GL gl) {
return destroyImpl(gl, 0);
}
- private final State destroyImpl(GL gl, int event_mask) {
+ private final State destroyImpl(final GL gl, final int event_mask) {
synchronized( stateLock ) {
if( null != streamWorker ) {
streamWorker.doStop();
@@ -475,7 +476,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
* at {@link AudioSink#enqueueData(com.jogamp.opengl.util.av.AudioSink.AudioFrame)}.
* </p>
*/
- protected boolean setPlaySpeedImpl(float rate) {
+ protected boolean setPlaySpeedImpl(final float rate) {
if( null != audioSink ) {
audioSinkPlaySpeedSet = audioSink.setPlaySpeed(rate);
}
@@ -521,7 +522,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
/**
* Override if not using AudioSink, or AudioSink's {@link AudioSink#setVolume(float)} is not sufficient!
*/
- protected boolean setAudioVolumeImpl(float v) {
+ protected boolean setAudioVolumeImpl(final float v) {
if( null != audioSink ) {
return audioSink.setVolume(v);
}
@@ -530,7 +531,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
@Override
- public final void initStream(URI streamLoc, final int vid, final int aid, int reqTextureCount) throws IllegalStateException, IllegalArgumentException {
+ public final void initStream(final URI streamLoc, final int vid, final int aid, final int reqTextureCount) throws IllegalStateException, IllegalArgumentException {
synchronized( stateLock ) {
if(State.Uninitialized != state) {
throw new IllegalStateException("Instance not in state unintialized: "+this);
@@ -577,7 +578,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
try {
// StreamWorker may be used, see API-doc of StreamWorker
initStreamImpl(vid, aid);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
streamErr = new StreamException(t.getClass().getSimpleName()+" while initializing: "+GLMediaPlayerImpl.this.toString(), t);
changeState(GLMediaEventListener.EVENT_CHANGE_ERR, GLMediaPlayer.State.Uninitialized);
} // also initializes width, height, .. etc
@@ -612,7 +613,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
@Override
- public final void initGL(GL gl) throws IllegalStateException, StreamException, GLException {
+ public final void initGL(final GL gl) throws IllegalStateException, StreamException, GLException {
synchronized( stateLock ) {
if(State.Initialized != state ) {
throw new IllegalStateException("Stream not in state initialized: "+this);
@@ -656,7 +657,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
lastFrame = null;
}
changeState(0, State.Paused);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
destroyImpl(gl, GLMediaEventListener.EVENT_CHANGE_ERR); // -> GLMediaPlayer.State.Uninitialized
throw new GLException("Error initializing GL resources", t);
}
@@ -683,11 +684,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
* Implementation must at least return a texture count of {@link #TEXTURE_COUNT_MIN}, <i>two</i>, the last texture and the decoding texture.
* </p>
*/
- protected int validateTextureCount(int desiredTextureCount) {
+ protected int validateTextureCount(final int desiredTextureCount) {
return desiredTextureCount < TEXTURE_COUNT_MIN ? TEXTURE_COUNT_MIN : desiredTextureCount;
}
- protected TextureFrame[] createTexFrames(GL gl, final int count) {
+ protected TextureFrame[] createTexFrames(final GL gl, final int count) {
final int[] texNames = new int[count];
gl.glGenTextures(count, texNames, 0);
final int err = gl.glGetError();
@@ -702,7 +703,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
protected abstract TextureFrame createTexImage(GL gl, int texName);
- protected final Texture createTexImageImpl(GL gl, int texName, int tWidth, int tHeight) {
+ protected final Texture createTexImageImpl(final GL gl, final int texName, final int tWidth, final int tHeight) {
if( 0 > texName ) {
throw new RuntimeException("TextureName "+toHexString(texName)+" invalid.");
}
@@ -749,7 +750,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
tWidth, tHeight, width, height, !isInGLOrientation);
}
- protected void destroyTexFrame(GL gl, TextureFrame frame) {
+ protected void destroyTexFrame(final GL gl, final TextureFrame frame) {
frame.getTexture().destroy(gl);
}
@@ -766,7 +767,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
return lastFrame;
}
- private final void removeAllTextureFrames(GL gl) {
+ private final void removeAllTextureFrames(final GL gl) {
final TextureFrame[] texFrames = videoFramesOrig;
videoFramesOrig = null;
videoFramesFree = null;
@@ -794,7 +795,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
private final boolean[] stGotVFrame = { false };
@Override
- public final TextureFrame getNextTexture(GL gl) throws IllegalStateException {
+ public final TextureFrame getNextTexture(final GL gl) throws IllegalStateException {
synchronized( stateLock ) {
if( State.Paused != state && State.Playing != state ) {
throw new IllegalStateException("Instance not paused or playing: "+this);
@@ -940,7 +941,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
lastTimeMillis = currentTimeMillis;
} while( dropFrame );
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -948,8 +949,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
return lastFrame;
}
}
- protected void preNextTextureImpl(GL gl) {}
- protected void postNextTextureImpl(GL gl) {}
+ protected void preNextTextureImpl(final GL gl) {}
+ protected void postNextTextureImpl(final GL gl) {}
/**
* Process stream until the next video frame, i.e. {@link TextureFrame}, has been reached.
* Audio frames, i.e. {@link AudioSink.AudioFrame}, shall be handled in the process.
@@ -973,7 +974,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
*/
protected abstract int getNextTextureImpl(GL gl, TextureFrame nextFrame);
- protected final int getNextSingleThreaded(final GL gl, final TextureFrame nextFrame, boolean[] gotVFrame) throws InterruptedException {
+ protected final int getNextSingleThreaded(final GL gl, final TextureFrame nextFrame, final boolean[] gotVFrame) throws InterruptedException {
final int pts;
if( STREAM_ID_NONE != vid ) {
preNextTextureImpl(gl);
@@ -1013,7 +1014,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
* w/ current pts value in milliseconds.
* @param audio_scr_t0
*/
- protected void setFirstAudioPTS2SCR(int pts) {
+ protected void setFirstAudioPTS2SCR(final int pts) {
if( audioSCR_reset ) {
audio_scr_t0 = Platform.currentTimeMillis() - pts;
audioSCR_reset = false;
@@ -1049,13 +1050,13 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
return (int) ( video_dpts_cum * (1.0f - VIDEO_DPTS_COEFF) + 0.5f );
}
- private final void newFrameAvailable(TextureFrame frame, long currentTimeMillis) {
+ private final void newFrameAvailable(final TextureFrame frame, final long currentTimeMillis) {
decodedFrameCount++;
if( 0 == frame.getDuration() ) { // patch frame duration if not set already
frame.setDuration( (int) frame_duration );
}
synchronized(eventListenersLock) {
- for(Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
+ for(final Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
i.next().newFrameAvailable(this, frame, currentTimeMillis);
}
}
@@ -1092,14 +1093,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
this.notifyAll(); // wake-up startup-block
try {
this.wait(); // wait until started
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
}
}
- private void makeCurrent(GLContext ctx) {
+ private void makeCurrent(final GLContext ctx) {
if( GLContext.CONTEXT_NOT_CURRENT >= ctx.makeCurrent() ) {
throw new GLException("Couldn't make ctx current: "+ctx);
}
@@ -1112,7 +1113,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
// so we can continue with the destruction.
try {
sharedGLCtx.destroy();
- } catch (GLException gle) {
+ } catch (final GLException gle) {
gle.printStackTrace();
}
}
@@ -1126,7 +1127,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
- public final synchronized void initGL(GL gl) {
+ public final synchronized void initGL(final GL gl) {
final GLContext glCtx = gl.getContext();
final boolean glCtxCurrent = glCtx.isCurrent();
final GLProfile glp = gl.getGLProfile();
@@ -1152,7 +1153,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
while( isActive && isRunning ) {
try {
this.wait(); // wait until paused
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -1167,7 +1168,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
this.notifyAll(); // wake-up pause-block
try {
this.wait(); // wait until resumed
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -1185,7 +1186,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
this.notifyAll(); // wake-up pause-block (opt)
try {
this.wait(); // wait until stopped
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -1217,7 +1218,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
this.notifyAll(); // wake-up doPause()
try {
this.wait(); // wait until resumed
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
if( !shallPause ) {
e.printStackTrace();
}
@@ -1296,12 +1297,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_EOS);
}
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
isBlocked = false;
if( !shallStop && !shallPause ) {
streamErr = new StreamException("InterruptedException while decoding: "+GLMediaPlayerImpl.this.toString(), e);
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
streamErr = new StreamException(t.getClass().getSimpleName()+" while decoding: "+GLMediaPlayerImpl.this.toString(), t);
} finally {
if( null != nextFrame ) { // put back
@@ -1339,7 +1340,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
private volatile StreamWorker streamWorker = null;
private volatile StreamException streamErr = null;
- protected final int addStateEventMask(int event_mask, State newState) {
+ protected final int addStateEventMask(int event_mask, final State newState) {
if( state != newState ) {
switch( newState ) {
case Uninitialized:
@@ -1359,18 +1360,18 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
return event_mask;
}
- protected final void attributesUpdated(int event_mask) {
+ protected final void attributesUpdated(final int event_mask) {
if( 0 != event_mask ) {
final long now = Platform.currentTimeMillis();
synchronized(eventListenersLock) {
- for(Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
+ for(final Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
i.next().attributesChanged(this, event_mask, now);
}
}
}
}
- protected final void changeState(int event_mask, State newState) {
+ protected final void changeState(int event_mask, final State newState) {
event_mask = addStateEventMask(event_mask, newState);
if( 0 != event_mask ) {
setState( newState );
@@ -1381,9 +1382,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
- protected final void updateAttributes(int vid, int aid, int width, int height, int bps_stream,
- int bps_video, int bps_audio, float fps,
- int videoFrames, int audioFrames, int duration, String vcodec, String acodec) {
+ protected final void updateAttributes(int vid, final int aid, final int width, final int height, final int bps_stream,
+ final int bps_video, final int bps_audio, final float fps,
+ final int videoFrames, final int audioFrames, final int duration, final String vcodec, final String acodec) {
int event_mask = 0;
final boolean wasUninitialized = state == State.Uninitialized;
@@ -1458,7 +1459,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
attributesUpdated(event_mask);
}
- protected void setIsGLOriented(boolean isGLOriented) {
+ protected void setIsGLOriented(final boolean isGLOriented) {
if( isInGLOrientation != isGLOriented ) {
if( DEBUG ) {
System.err.println("XXX gl-orient "+isInGLOrientation+" -> "+isGLOriented);
@@ -1569,7 +1570,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
@Override
- public final void addEventListener(GLMediaEventListener l) {
+ public final void addEventListener(final GLMediaEventListener l) {
if(l == null) {
return;
}
@@ -1579,7 +1580,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
@Override
- public final void removeEventListener(GLMediaEventListener l) {
+ public final void removeEventListener(final GLMediaEventListener l) {
if (l == null) {
return;
}
@@ -1598,33 +1599,33 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
private final Object eventListenersLock = new Object();
@Override
- public final Object getAttachedObject(String name) {
+ public final Object getAttachedObject(final String name) {
return attachedObjects.get(name);
}
@Override
- public final Object attachObject(String name, Object obj) {
+ public final Object attachObject(final String name, final Object obj) {
return attachedObjects.put(name, obj);
}
@Override
- public final Object detachObject(String name) {
+ public final Object detachObject(final String name) {
return attachedObjects.remove(name);
}
private final HashMap<String, Object> attachedObjects = new HashMap<String, Object>();
- protected static final String toHexString(long v) {
+ protected static final String toHexString(final long v) {
return "0x"+Long.toHexString(v);
}
- protected static final String toHexString(int v) {
+ protected static final String toHexString(final int v) {
return "0x"+Integer.toHexString(v);
}
- protected static final int getPropIntVal(Map<String, String> props, String key) {
+ protected static final int getPropIntVal(final Map<String, String> props, final String key) {
final String val = props.get(key);
try {
return Integer.valueOf(val).intValue();
- } catch (NumberFormatException nfe) {
+ } catch (final NumberFormatException nfe) {
if(DEBUG) {
System.err.println("Not a valid integer for <"+key+">: <"+val+">");
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
index f5b2dd8ea..a24e77b7d 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
@@ -43,7 +43,7 @@ public class JavaSoundAudioSink implements AudioSink {
try {
AudioSystem.getAudioFileTypes();
ok = true;
- } catch (Throwable t) {
+ } catch (final Throwable t) {
}
staticAvailable=ok;
@@ -59,7 +59,7 @@ public class JavaSoundAudioSink implements AudioSink {
public final float getPlaySpeed() { return 1.0f; } // FIXME
@Override
- public final boolean setPlaySpeed(float rate) {
+ public final boolean setPlaySpeed(final float rate) {
return false; // FIXME
}
@@ -70,7 +70,7 @@ public class JavaSoundAudioSink implements AudioSink {
}
@Override
- public final boolean setVolume(float v) {
+ public final boolean setVolume(final float v) {
// FIXME
volume = v;
return true;
@@ -87,12 +87,12 @@ public class JavaSoundAudioSink implements AudioSink {
}
@Override
- public final boolean isSupported(AudioSink.AudioFormat format) {
+ public final boolean isSupported(final AudioSink.AudioFormat format) {
return true;
}
@Override
- public boolean init(AudioSink.AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
+ public boolean init(final AudioSink.AudioFormat requestedFormat, final float frameDuration, final int initialQueueSize, final int queueGrowAmount, final int queueLimit) {
if( !staticAvailable ) {
return false;
}
@@ -112,7 +112,7 @@ public class JavaSoundAudioSink implements AudioSink {
System.out.println("JavaSound audio sink");
initialized=true;
chosenFormat = requestedFormat;
- } catch (Exception e) {
+ } catch (final Exception e) {
initialized=false;
}
return true;
@@ -186,7 +186,7 @@ public class JavaSoundAudioSink implements AudioSink {
}
@Override
- public AudioFrame enqueueData(AudioDataFrame audioDataFrame) {
+ public AudioFrame enqueueData(final AudioDataFrame audioDataFrame) {
int byteSize = audioDataFrame.getByteSize();
final ByteBuffer byteBuffer = audioDataFrame.getData();
final byte[] bytes = new byte[byteSize];
@@ -206,7 +206,7 @@ public class JavaSoundAudioSink implements AudioSink {
}
@Override
- public AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) {
+ public AudioFrame enqueueData(final int pts, final ByteBuffer bytes, final int byteCount) {
return enqueueData(new AudioDataFrame(pts, chosenFormat.getBytesDuration(byteCount), bytes, byteCount));
}
@@ -224,7 +224,7 @@ public class JavaSoundAudioSink implements AudioSink {
public int getQueuedTime() {
return getQueuedTimeImpl( getQueuedByteCount() );
}
- private final int getQueuedTimeImpl(int byteCount) {
+ private final int getQueuedTimeImpl(final int byteCount) {
final int bytesPerSample = chosenFormat.sampleSize >>> 3; // /8
return byteCount / ( chosenFormat.channelCount * bytesPerSample * ( chosenFormat.sampleRate / 1000 ) );
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
index 4ab90322d..3aa9d7ab6 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
@@ -70,7 +70,7 @@ public class NullAudioSink implements AudioSink {
}
@Override
- public final boolean setVolume(float v) {
+ public final boolean setVolume(final float v) {
// FIXME
volume = v;
return true;
@@ -87,7 +87,7 @@ public class NullAudioSink implements AudioSink {
}
@Override
- public final boolean isSupported(AudioFormat format) {
+ public final boolean isSupported(final AudioFormat format) {
/**
* If we like to emulate constraints ..
*
@@ -102,7 +102,7 @@ public class NullAudioSink implements AudioSink {
}
@Override
- public boolean init(AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
+ public boolean init(final AudioFormat requestedFormat, final float frameDuration, final int initialQueueSize, final int queueGrowAmount, final int queueLimit) {
chosenFormat = requestedFormat;
return true;
}
@@ -171,12 +171,12 @@ public class NullAudioSink implements AudioSink {
}
@Override
- public AudioFrame enqueueData(AudioDataFrame audioDataFrame) {
+ public AudioFrame enqueueData(final AudioDataFrame audioDataFrame) {
return enqueueData(audioDataFrame.getPTS(), audioDataFrame.getData(), audioDataFrame.getByteSize());
}
@Override
- public AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) {
+ public AudioFrame enqueueData(final int pts, final ByteBuffer bytes, final int byteCount) {
if( !initialized || null == chosenFormat ) {
return null;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
index 2b4a386d4..4a15c7422 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
@@ -61,7 +61,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
}
@Override
- protected final boolean setPlaySpeedImpl(float rate) {
+ protected final boolean setPlaySpeedImpl(final float rate) {
return false;
}
@@ -77,14 +77,14 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
}
@Override
- protected final int seekImpl(int msec) {
+ protected final int seekImpl(final int msec) {
pos_ms = msec;
validatePos();
return pos_ms;
}
@Override
- protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
+ protected final int getNextTextureImpl(final GL gl, final TextureFrame nextFrame) {
final int pts = getAudioPTSImpl();
nextFrame.setPTS( pts );
return pts;
@@ -98,7 +98,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
}
@Override
- protected final void destroyImpl(GL gl) {
+ protected final void destroyImpl(final GL gl) {
if(null != texData) {
texData.destroy();
texData = null;
@@ -108,17 +108,17 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
public final static TextureData createTestTextureData() {
TextureData res = null;
try {
- URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-28x16.png", NullGLMediaPlayer.class.getClassLoader());
+ final URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-28x16.png", NullGLMediaPlayer.class.getClassLoader());
if(null != urlConn) {
res = TextureIO.newTextureData(GLProfile.getGL2ES2(), urlConn.getInputStream(), false, TextureIO.PNG);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
if(null == res) {
final int w = 160;
final int h = 90;
- ByteBuffer buffer = Buffers.newDirectByteBuffer(w*h*4);
+ final ByteBuffer buffer = Buffers.newDirectByteBuffer(w*h*4);
while(buffer.hasRemaining()) {
buffer.put((byte) 0xEA); buffer.put((byte) 0xEA); buffer.put((byte) 0xEA); buffer.put((byte) 0xEA);
}
@@ -132,7 +132,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
}
@Override
- protected final void initStreamImpl(int vid, int aid) throws IOException {
+ protected final void initStreamImpl(final int vid, final int aid) throws IOException {
texData = createTestTextureData();
final float _fps = 24f;
final int _duration = 10*60*1000; // msec
@@ -143,7 +143,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
_totalFrames, 0, _duration, "png-static", null);
}
@Override
- protected final void initGLImpl(GL gl) throws IOException, GLException {
+ protected final void initGLImpl(final GL gl) throws IOException, GLException {
setIsGLOriented(true);
}
@@ -154,12 +154,12 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
* </p>
*/
@Override
- protected int validateTextureCount(int desiredTextureCount) {
+ protected int validateTextureCount(final int desiredTextureCount) {
return TEXTURE_COUNT_MIN;
}
@Override
- protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
+ protected final TextureSequence.TextureFrame createTexImage(final GL gl, final int texName) {
final Texture texture = super.createTexImageImpl(gl, texName, getWidth(), getHeight());
if(null != texData) {
texture.updateImage(gl, texData);
@@ -168,7 +168,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
}
@Override
- protected final void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) {
+ protected final void destroyTexFrame(final GL gl, final TextureSequence.TextureFrame frame) {
super.destroyTexFrame(gl, frame);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/VideoPixelFormat.java b/src/jogl/classes/jogamp/opengl/util/av/VideoPixelFormat.java
index 380ff9ea8..44d83e78d 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/VideoPixelFormat.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/VideoPixelFormat.java
@@ -181,7 +181,7 @@ public enum VideoPixelFormat {
* </pre>
* @throws IllegalArgumentException if the given ordinal is out of range, i.e. not within [ 0 .. PixelFormat.values().length-1 ]
*/
- public static VideoPixelFormat valueOf(int ordinal) throws IllegalArgumentException {
+ public static VideoPixelFormat valueOf(final int ordinal) throws IllegalArgumentException {
final VideoPixelFormat[] all = VideoPixelFormat.values();
if( 0 <= ordinal && ordinal < all.length ) {
return all[ordinal];
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
index e7a425a54..42a908f93 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -188,12 +188,12 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
GLProfile.initSingleton();
boolean _ready = false;
/** util, format, codec, device, avresample, swresample */
- boolean[] _loaded= new boolean[6];
+ final boolean[] _loaded= new boolean[6];
/** util, format, codec, avresample, swresample */
- VersionNumber[] _versions = new VersionNumber[5];
+ final VersionNumber[] _versions = new VersionNumber[5];
try {
_ready = initSymbols(_loaded, _versions);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
}
libsUFCLoaded = _loaded[LIB_IDX_UTI] && _loaded[LIB_IDX_FMT] && _loaded[LIB_IDX_COD];
@@ -250,7 +250,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
* @param versions 5: util, format, codec, avresample, swresample
* @return
*/
- private static final boolean initSymbols(boolean[] loaded, VersionNumber[] versions) {
+ private static final boolean initSymbols(final boolean[] loaded, final VersionNumber[] versions) {
for(int i=0; i<6; i++) {
loaded[i] = false;
}
@@ -331,7 +331,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
@Override
public final List<List<String>> getToolLibNames() {
- List<List<String>> libsList = new ArrayList<List<String>>();
+ final List<List<String>> libsList = new ArrayList<List<String>>();
// 6: util, format, codec, device, avresample, swresample
@@ -424,12 +424,12 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
}
@Override
- public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+ public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
return 0;
}
@Override
- public final boolean useToolGetProcAdressFirst(String funcName) {
+ public final boolean useToolGetProcAdressFirst(final String funcName) {
return false;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
index 9cfd3d80e..8ac1232b5 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -49,6 +49,7 @@ import com.jogamp.opengl.util.av.AudioSinkFactory;
import com.jogamp.opengl.util.av.GLMediaPlayer;
import com.jogamp.opengl.util.texture.Texture;
+import jogamp.common.os.PlatformPropsImpl;
import jogamp.opengl.GLContextImpl;
import jogamp.opengl.util.av.AudioSampleFormat;
import jogamp.opengl.util.av.GLMediaPlayerImpl;
@@ -265,7 +266,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
@Override
- protected final void destroyImpl(GL gl) {
+ protected final void destroyImpl(final GL gl) {
if (moviePtr != 0) {
natives.destroyInstance0(moviePtr);
moviePtr = 0;
@@ -283,7 +284,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
public static final String dev_video_linux = "/dev/video";
@Override
- protected final void initStreamImpl(int vid, int aid) throws IOException {
+ protected final void initStreamImpl(final int vid, final int aid) throws IOException {
if(0==moviePtr) {
throw new GLException("FFMPEG native instance null");
}
@@ -309,7 +310,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
int rw=-1, rh=-1, rr=-1;
String sizes = null;
if( isCameraInput ) {
- switch(Platform.OS_TYPE) {
+ switch(PlatformPropsImpl.OS_TYPE) {
case ANDROID:
// ??
case FREEBSD:
@@ -351,7 +352,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
@Override
- protected final void initGLImpl(GL gl) throws IOException, GLException {
+ protected final void initGLImpl(final GL gl) throws IOException, GLException {
if(0==moviePtr) {
throw new GLException("FFMPEG native instance null");
}
@@ -406,7 +407,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
if( null != gl && STREAM_ID_NONE != getVID() ) {
int tf, tif=GL.GL_RGBA; // texture format and internal format
- int tt = GL.GL_UNSIGNED_BYTE;
+ final int tt = GL.GL_UNSIGNED_BYTE;
switch(vBytesPerPixelPerPlane) {
case 1:
if( gl.isGL3ES3() ) {
@@ -414,22 +415,22 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
tf = GL2ES2.GL_RED; tif=GL2ES2.GL_RED; singleTexComp = "r";
} else {
// ALPHA is supported on ES2 and GL2, i.e. <= GL3 [core] or compatibility
- tf = GL2ES2.GL_ALPHA; tif=GL2ES2.GL_ALPHA; singleTexComp = "a";
+ tf = GL.GL_ALPHA; tif=GL.GL_ALPHA; singleTexComp = "a";
}
break;
case 2: if( vPixelFmt == VideoPixelFormat.YUYV422 ) {
// YUYV422: // < packed YUV 4:2:2, 2x 16bpp, Y0 Cb Y1 Cr
// Stuffed into RGBA half width texture
- tf = GL2ES2.GL_RGBA; tif=GL2ES2.GL_RGBA; break;
+ tf = GL.GL_RGBA; tif=GL.GL_RGBA; break;
} else {
tf = GL2ES2.GL_RG; tif=GL2ES2.GL_RG; break;
}
- case 3: tf = GL2ES2.GL_RGB; tif=GL.GL_RGB; break;
+ case 3: tf = GL.GL_RGB; tif=GL.GL_RGB; break;
case 4: if( vPixelFmt == VideoPixelFormat.BGRA ) {
- tf = GL2ES2.GL_BGRA; tif=GL.GL_RGBA; break;
+ tf = GL.GL_BGRA; tif=GL.GL_RGBA; break;
} else {
- tf = GL2ES2.GL_RGBA; tif=GL.GL_RGBA; break;
+ tf = GL.GL_RGBA; tif=GL.GL_RGBA; break;
}
default: throw new RuntimeException("Unsupported bytes-per-pixel / plane "+vBytesPerPixelPerPlane);
}
@@ -442,7 +443,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
}
@Override
- protected final TextureFrame createTexImage(GL gl, int texName) {
+ protected final TextureFrame createTexImage(final GL gl, final int texName) {
return new TextureFrame( createTexImageImpl(gl, texName, texWidth, texHeight) );
}
@@ -464,7 +465,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
* @param audioSampleRate sample rate in Hz (1/s)
* @param audioChannels number of channels
*/
- final boolean isAudioFormatSupported(int audioSampleFmt, int audioSampleRate, int audioChannels) {
+ final boolean isAudioFormatSupported(final int audioSampleFmt, final int audioSampleRate, final int audioChannels) {
final AudioSampleFormat avFmt = AudioSampleFormat.valueOf(audioSampleFmt);
final AudioFormat audioFormat = avAudioFormat2Local(avFmt, audioSampleRate, audioChannels);
final boolean res = audioSink.isSupported(audioFormat);
@@ -480,7 +481,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
* @param audioSampleRate sample rate in Hz (1/s)
* @param audioChannels number of channels
*/
- private final AudioFormat avAudioFormat2Local(AudioSampleFormat audioSampleFmt, int audioSampleRate, int audioChannels) {
+ private final AudioFormat avAudioFormat2Local(final AudioSampleFormat audioSampleFmt, final int audioSampleRate, final int audioChannels) {
final int sampleSize;
boolean planar = true;
boolean fixedP = true;
@@ -540,10 +541,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
* @param audioChannels
* @param audioSamplesPerFrameAndChannel in audio samples per frame and channel
*/
- void setupFFAttributes(int vid, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
- int tWd0, int tWd1, int tWd2, int vW, int vH,
- int aid, int audioSampleFmt, int audioSampleRate,
- int audioChannels, int audioSamplesPerFrameAndChannel) {
+ void setupFFAttributes(final int vid, final int pixFmt, final int planes, final int bitsPerPixel, final int bytesPerPixelPerPlane,
+ final int tWd0, final int tWd1, final int tWd2, final int vW, final int vH,
+ final int aid, final int audioSampleFmt, final int audioSampleRate,
+ final int audioChannels, final int audioSamplesPerFrameAndChannel) {
// defaults ..
vPixelFmt = null;
vPlanes = 0;
@@ -641,8 +642,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
* @param tWd1
* @param tWd2
*/
- void updateVidAttributes(boolean isInGLOrientation, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
- int tWd0, int tWd1, int tWd2, int vW, int vH) {
+ void updateVidAttributes(final boolean isInGLOrientation, final int pixFmt, final int planes, final int bitsPerPixel, final int bytesPerPixelPerPlane,
+ final int tWd0, final int tWd1, final int tWd2, final int vW, final int vH) {
}
/**
@@ -653,7 +654,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
* Otherwise the call is delegated to it's super class.
*/
@Override
- public final String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException {
+ public final String getTextureLookupFunctionName(final String desiredFuncName) throws IllegalStateException {
if( State.Uninitialized == getState() ) {
throw new IllegalStateException("Instance not initialized: "+this);
}
@@ -785,7 +786,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
@Override
- protected final synchronized int seekImpl(int msec) {
+ protected final synchronized int seekImpl(final int msec) {
if(0==moviePtr) {
throw new GLException("FFMPEG native instance null");
}
@@ -793,18 +794,18 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
@Override
- protected void preNextTextureImpl(GL gl) {
+ protected void preNextTextureImpl(final GL gl) {
psm.setUnpackAlignment(gl, 1); // RGBA ? 4 : 1
gl.glActiveTexture(GL.GL_TEXTURE0+getTextureUnit());
}
@Override
- protected void postNextTextureImpl(GL gl) {
+ protected void postNextTextureImpl(final GL gl) {
psm.restore(gl);
}
@Override
- protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
+ protected final int getNextTextureImpl(final GL gl, final TextureFrame nextFrame) {
if(0==moviePtr) {
throw new GLException("FFMPEG native instance null");
}
@@ -825,7 +826,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
return vPTS;
}
- final void pushSound(ByteBuffer sampleData, int data_size, int audio_pts) {
+ final void pushSound(final ByteBuffer sampleData, final int data_size, final int audio_pts) {
setFirstAudioPTS2SCR( audio_pts );
if( 1.0f == getPlaySpeed() || audioSinkPlaySpeedSet ) {
audioSink.enqueueData( audio_pts, sampleData, data_size);
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
index 99e5a805b..8fd439082 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
@@ -33,7 +33,7 @@ import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
private static final Object mutex_avcodec_openclose_jni = new Object();
- final boolean initSymbols0(long[] symbols, int count) {
+ final boolean initSymbols0(final long[] symbols, final int count) {
return initSymbols0(mutex_avcodec_openclose_jni, symbols, count);
}
abstract boolean initSymbols0(Object mutex_avcodec_openclose, long[] symbols, int count);
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
index 22a045825..65a7e3618 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
@@ -30,7 +30,7 @@ package jogamp.opengl.util.av.impl;
import com.jogamp.common.util.VersionNumber;
class FFMPEGStaticNatives {
- static VersionNumber getAVVersion(int vers) {
+ static VersionNumber getAVVersion(final int vers) {
return new VersionNumber( ( vers >> 16 ) & 0xFF,
( vers >> 8 ) & 0xFF,
( vers >> 0 ) & 0xFF );
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
index ecf91124e..0eeb54bf6 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
@@ -74,19 +74,19 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
}
@Override
- protected TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
+ protected TextureSequence.TextureFrame createTexImage(final GL gl, final int texName) {
final EGLTextureFrame eglTex = (EGLTextureFrame) super.createTexImage(gl, texName);
_setStreamEGLImageTexture2D(moviePtr, texName, eglTex.getImage(), eglTex.getSync());
return eglTex;
}
@Override
- protected void destroyTexFrame(GL gl, TextureSequence.TextureFrame imgTex) {
+ protected void destroyTexFrame(final GL gl, final TextureSequence.TextureFrame imgTex) {
super.destroyTexFrame(gl, imgTex);
}
@Override
- protected void destroyImpl(GL gl) {
+ protected void destroyImpl(final GL gl) {
if (moviePtr != 0) {
_stop(moviePtr);
_detachVideoRenderer(moviePtr);
@@ -96,7 +96,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
}
@Override
- protected void initStreamImpl(int vid, int aid) throws IOException {
+ protected void initStreamImpl(final int vid, final int aid) throws IOException {
if(0==moviePtr) {
throw new GLException("OMX native instance null");
}
@@ -117,7 +117,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
}
}
@Override
- protected final void initGLImpl(GL gl) throws IOException, GLException {
+ protected final void initGLImpl(final GL gl) throws IOException, GLException {
// NOP
setIsGLOriented(true);
}
@@ -128,7 +128,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
}
@Override
- protected boolean setPlaySpeedImpl(float rate) {
+ protected boolean setPlaySpeedImpl(final float rate) {
if(0==moviePtr) {
throw new GLException("OMX native instance null");
}
@@ -157,7 +157,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
/** @return time position after issuing the command */
@Override
- protected int seekImpl(int msec) {
+ protected int seekImpl(final int msec) {
if(0==moviePtr) {
throw new GLException("OMX native instance null");
}
@@ -165,7 +165,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
}
@Override
- protected int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
+ protected int getNextTextureImpl(final GL gl, final TextureFrame nextFrame) {
if(0==moviePtr) {
throw new GLException("OMX native instance null");
}
@@ -182,8 +182,8 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
return 0; // FIXME: return pts
}
- private String replaceAll(String orig, String search, String repl) {
- StringBuilder dest = new StringBuilder();
+ private String replaceAll(final String orig, final String search, final String repl) {
+ final StringBuilder dest = new StringBuilder();
// In case replaceAll / java.util.regex.* is not supported (-> CVM)
int i=0,j;
while((j=orig.indexOf(search, i))>=0) {
@@ -194,7 +194,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
return dest.append(orig.substring(i, orig.length())).toString();
}
- private void errorCheckEGL(String s) {
+ private void errorCheckEGL(final String s) {
int e;
if( (e=EGL.eglGetError()) != EGL.EGL_SUCCESS ) {
System.out.println("EGL Error: ("+s+"): 0x"+Integer.toHexString(e));
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
index e9fb91086..5a78f514d 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
@@ -45,22 +45,22 @@ import com.jogamp.opengl.util.glsl.ShaderState;
*/
public class GLSLArrayHandler extends GLVBOArrayHandler {
- public GLSLArrayHandler(GLArrayDataEditable ad) {
+ public GLSLArrayHandler(final GLArrayDataEditable ad) {
super(ad);
}
@Override
- public final void setSubArrayVBOName(int vboName) {
+ public final void setSubArrayVBOName(final int vboName) {
throw new UnsupportedOperationException();
}
@Override
- public final void addSubHandler(GLArrayHandlerFlat handler) {
+ public final void addSubHandler(final GLArrayHandlerFlat handler) {
throw new UnsupportedOperationException();
}
@Override
- public final void enableState(GL gl, boolean enable, Object ext) {
+ public final void enableState(final GL gl, final boolean enable, final Object ext) {
final GL2ES2 glsl = gl.getGL2ES2();
if( null != ext ) {
enableShaderState(glsl, enable, (ShaderState)ext);
@@ -71,7 +71,7 @@ public class GLSLArrayHandler extends GLVBOArrayHandler {
private final int[] tempI = new int[1];
- private final void enableShaderState(GL2ES2 glsl, boolean enable, ShaderState st) {
+ private final void enableShaderState(final GL2ES2 glsl, final boolean enable, final ShaderState st) {
if(enable) {
/*
* This would be the non optimized code path:
@@ -118,7 +118,7 @@ public class GLSLArrayHandler extends GLVBOArrayHandler {
}
}
- private final void enableSimple(GL2ES2 glsl, boolean enable) {
+ private final void enableSimple(final GL2ES2 glsl, final boolean enable) {
final int location = ad.getLocation();
if( 0 > location ) {
return;
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
index 34a381d7d..85fcabdd9 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
@@ -41,9 +41,9 @@ import com.jogamp.opengl.util.glsl.ShaderState;
* separately and interleaves many arrays.
*/
public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
- private GLArrayDataWrapper ad;
+ private final GLArrayDataWrapper ad;
- public GLSLArrayHandlerFlat(GLArrayDataWrapper ad) {
+ public GLSLArrayHandlerFlat(final GLArrayDataWrapper ad) {
this.ad = ad;
}
@@ -53,7 +53,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
}
@Override
- public final void syncData(GL gl, Object ext) {
+ public final void syncData(final GL gl, final Object ext) {
final GL2ES2 glsl = gl.getGL2ES2();
if( null != ext ) {
((ShaderState)ext).vertexAttribPointer(glsl, ad);
@@ -80,7 +80,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
}
@Override
- public final void enableState(GL gl, boolean enable, Object ext) {
+ public final void enableState(final GL gl, final boolean enable, final Object ext) {
final GL2ES2 glsl = gl.getGL2ES2();
if( null != ext ) {
final ShaderState st = (ShaderState)ext;
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
index e153082e0..0169b0747 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
@@ -45,30 +45,30 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler {
private final List<GLArrayHandlerFlat> subArrays = new ArrayList<GLArrayHandlerFlat>();
- public GLSLArrayHandlerInterleaved(GLArrayDataEditable ad) {
+ public GLSLArrayHandlerInterleaved(final GLArrayDataEditable ad) {
super(ad);
}
@Override
- public final void setSubArrayVBOName(int vboName) {
+ public final void setSubArrayVBOName(final int vboName) {
for(int i=0; i<subArrays.size(); i++) {
subArrays.get(i).getData().setVBOName(vboName);
}
}
@Override
- public final void addSubHandler(GLArrayHandlerFlat handler) {
+ public final void addSubHandler(final GLArrayHandlerFlat handler) {
subArrays.add(handler);
}
- private final void syncSubData(GL gl, Object ext) {
+ private final void syncSubData(final GL gl, final Object ext) {
for(int i=0; i<subArrays.size(); i++) {
subArrays.get(i).syncData(gl, ext);
}
}
@Override
- public final void enableState(GL gl, boolean enable, Object ext) {
+ public final void enableState(final GL gl, final boolean enable, final Object ext) {
if(enable) {
if(!ad.isVBO()) {
throw new InternalError("Interleaved handle is not VBO: "+ad);
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java
index 09da8c9ee..d5d0020c5 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java
@@ -52,7 +52,7 @@ public class GLSLTextureRaster {
private GLUniformData activeTexUniform;
private GLArrayDataServer interleavedVBO;
- public GLSLTextureRaster(int textureUnit, boolean textureVertFlipped) {
+ public GLSLTextureRaster(final int textureUnit, final boolean textureVertFlipped) {
this.textureVertFlipped = textureVertFlipped;
this.textureUnit = textureUnit;
}
@@ -63,7 +63,7 @@ public class GLSLTextureRaster {
static final String shaderSrcPath = "../../shader";
static final String shaderBinPath = "../../shader/bin";
- public void init(GL2ES2 gl) {
+ public void init(final GL2ES2 gl) {
// Create & Compile the shader objects
final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
shaderSrcPath, shaderBinPath, shaderBasename, true);
@@ -83,9 +83,9 @@ public class GLSLTextureRaster {
// setup mgl_PMVMatrix
pmvMatrix = new PMVMatrix();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
if( pmvMatrixUniform.setLocation(gl, sp.program()) < 0 ) {
@@ -128,7 +128,7 @@ public class GLSLTextureRaster {
sp.useProgram(gl, false);
}
- public void reshape(GL2ES2 gl, int x, int y, int width, int height) {
+ public void reshape(final GL2ES2 gl, final int x, final int y, final int width, final int height) {
if(null != sp) {
pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
@@ -143,7 +143,7 @@ public class GLSLTextureRaster {
}
}
- public void dispose(GL2ES2 gl) {
+ public void dispose(final GL2ES2 gl) {
if(null != pmvMatrixUniform) {
pmvMatrixUniform = null;
}
@@ -158,7 +158,7 @@ public class GLSLTextureRaster {
}
}
- public void display(GL2ES2 gl) {
+ public void display(final GL2ES2 gl) {
if(null != sp) {
sp.useProgram(gl, true);
interleavedVBO.enableBuffer(gl, true);
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
index ff8006cf8..a9848f899 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
@@ -60,7 +60,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
* @param mode TODO
* @param pmvMatrix optional pass through PMVMatrix for the {@link FixedFuncHook} and {@link FixedFuncPipeline}
*/
- public FixedFuncHook (GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) {
+ public FixedFuncHook (final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) {
this.gl = gl;
if(null != pmvMatrix) {
this.ownsPMVMatrix = false;
@@ -77,10 +77,10 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
* @param mode TODO
* @param pmvMatrix optional pass through PMVMatrix for the {@link FixedFuncHook} and {@link FixedFuncPipeline}
*/
- public FixedFuncHook(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix,
- Class<?> shaderRootClass, String shaderSrcRoot, String shaderBinRoot,
- String vertexColorFile, String vertexColorLightFile,
- String fragmentColorFile, String fragmentColorTextureFile) {
+ public FixedFuncHook(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix,
+ final Class<?> shaderRootClass, final String shaderSrcRoot, final String shaderBinRoot,
+ final String vertexColorFile, final String vertexColorLightFile,
+ final String fragmentColorFile, final String fragmentColorTextureFile) {
this.gl = gl;
if(null != pmvMatrix) {
this.ownsPMVMatrix = false;
@@ -96,7 +96,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
public boolean verbose() { return fixedFunction.verbose(); }
- public void setVerbose(boolean v) { fixedFunction.setVerbose(v); }
+ public void setVerbose(final boolean v) { fixedFunction.setVerbose(v); }
public void destroy() {
fixedFunction.destroy(gl);
@@ -110,32 +110,32 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
//
// FixedFuncHookIf - hooks
//
- public void glDrawArrays(int mode, int first, int count) {
+ public void glDrawArrays(final int mode, final int first, final int count) {
fixedFunction.glDrawArrays(gl, mode, first, count);
}
- public void glDrawElements(int mode, int count, int type, java.nio.Buffer indices) {
+ public void glDrawElements(final int mode, final int count, final int type, final java.nio.Buffer indices) {
fixedFunction.glDrawElements(gl, mode, count, type, indices);
}
- public void glDrawElements(int mode, int count, int type, long indices_buffer_offset) {
+ public void glDrawElements(final int mode, final int count, final int type, final long indices_buffer_offset) {
fixedFunction.glDrawElements(gl, mode, count, type, indices_buffer_offset);
}
- public void glActiveTexture(int texture) {
+ public void glActiveTexture(final int texture) {
fixedFunction.glActiveTexture(texture);
gl.glActiveTexture(texture);
}
- public void glEnable(int cap) {
+ public void glEnable(final int cap) {
if(fixedFunction.glEnable(cap, true)) {
gl.glEnable(cap);
}
}
- public void glDisable(int cap) {
+ public void glDisable(final int cap) {
if(fixedFunction.glEnable(cap, false)) {
gl.glDisable(cap);
}
}
@Override
- public void glGetFloatv(int pname, java.nio.FloatBuffer params) {
+ public void glGetFloatv(final int pname, final java.nio.FloatBuffer params) {
if(PMVMatrix.isMatrixGetName(pname)) {
pmvMatrix.glGetFloatv(pname, params);
return;
@@ -143,7 +143,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
gl.glGetFloatv(pname, params);
}
@Override
- public void glGetFloatv(int pname, float[] params, int params_offset) {
+ public void glGetFloatv(final int pname, final float[] params, final int params_offset) {
if(PMVMatrix.isMatrixGetName(pname)) {
pmvMatrix.glGetFloatv(pname, params, params_offset);
return;
@@ -151,7 +151,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
gl.glGetFloatv(pname, params, params_offset);
}
@Override
- public void glGetIntegerv(int pname, IntBuffer params) {
+ public void glGetIntegerv(final int pname, final IntBuffer params) {
if(PMVMatrix.isMatrixGetName(pname)) {
pmvMatrix.glGetIntegerv(pname, params);
return;
@@ -159,7 +159,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
gl.glGetIntegerv(pname, params);
}
@Override
- public void glGetIntegerv(int pname, int[] params, int params_offset) {
+ public void glGetIntegerv(final int pname, final int[] params, final int params_offset) {
if(PMVMatrix.isMatrixGetName(pname)) {
pmvMatrix.glGetIntegerv(pname, params, params_offset);
return;
@@ -167,21 +167,21 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
gl.glGetIntegerv(pname, params, params_offset);
}
- public void glTexEnvi(int target, int pname, int value) {
+ public void glTexEnvi(final int target, final int pname, final int value) {
fixedFunction.glTexEnvi(target, pname, value);
}
- public void glGetTexEnviv(int target, int pname, IntBuffer params) {
+ public void glGetTexEnviv(final int target, final int pname, final IntBuffer params) {
fixedFunction.glGetTexEnviv(target, pname, params);
}
- public void glGetTexEnviv(int target, int pname, int[] params, int params_offset) {
+ public void glGetTexEnviv(final int target, final int pname, final int[] params, final int params_offset) {
fixedFunction.glGetTexEnviv(target, pname, params, params_offset);
}
- public void glBindTexture(int target, int texture) {
+ public void glBindTexture(final int target, final int texture) {
fixedFunction.glBindTexture(target, texture);
gl.glBindTexture(target, texture);
}
- public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border,
- int format, int type, Buffer pixels) {
+ public void glTexImage2D(final int target, final int level, int internalformat, final int width, final int height, final int border,
+ final int format, final int type, final Buffer pixels) {
// align internalformat w/ format, an ES2 requirement
switch(internalformat) {
case 3: internalformat= ( GL.GL_RGBA == format ) ? GL.GL_RGBA : GL.GL_RGB; break;
@@ -190,8 +190,8 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
fixedFunction.glTexImage2D(target, /* level, */ internalformat, /*width, height, border, */ format /*, type, pixels*/);
gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
}
- public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border,
- int format, int type, long pixels_buffer_offset) {
+ public void glTexImage2D(final int target, final int level, int internalformat, final int width, final int height, final int border,
+ final int format, final int type, final long pixels_buffer_offset) {
// align internalformat w/ format, an ES2 requirement
switch(internalformat) {
case 3: internalformat= ( GL.GL_RGBA == format ) ? GL.GL_RGBA : GL.GL_RGB; break;
@@ -201,16 +201,16 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels_buffer_offset);
}
- public void glPointSize(float size) {
+ public void glPointSize(final float size) {
fixedFunction.glPointSize(size);
}
- public void glPointParameterf(int pname, float param) {
+ public void glPointParameterf(final int pname, final float param) {
fixedFunction.glPointParameterf(pname, param);
}
- public void glPointParameterfv(int pname, float[] params, int params_offset) {
+ public void glPointParameterfv(final int pname, final float[] params, final int params_offset) {
fixedFunction.glPointParameterfv(pname, params, params_offset);
}
- public void glPointParameterfv(int pname, java.nio.FloatBuffer params) {
+ public void glPointParameterfv(final int pname, final java.nio.FloatBuffer params) {
fixedFunction.glPointParameterfv(pname, params);
}
@@ -221,16 +221,16 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
return pmvMatrix.glGetMatrixMode();
}
@Override
- public void glMatrixMode(int mode) {
+ public void glMatrixMode(final int mode) {
pmvMatrix.glMatrixMode(mode);
}
@Override
- public void glLoadMatrixf(java.nio.FloatBuffer m) {
+ public void glLoadMatrixf(final java.nio.FloatBuffer m) {
pmvMatrix.glLoadMatrixf(m);
}
@Override
- public void glLoadMatrixf(float[] m, int m_offset) {
- glLoadMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset));
+ public void glLoadMatrixf(final float[] m, final int m_offset) {
+ glLoadMatrixf(Buffers.newDirectFloatBuffer(m, m_offset));
}
@Override
public void glPopMatrix() {
@@ -245,37 +245,37 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
pmvMatrix.glLoadIdentity();
}
@Override
- public void glMultMatrixf(java.nio.FloatBuffer m) {
+ public void glMultMatrixf(final java.nio.FloatBuffer m) {
pmvMatrix.glMultMatrixf(m);
}
@Override
- public void glMultMatrixf(float[] m, int m_offset) {
- glMultMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset));
+ public void glMultMatrixf(final float[] m, final int m_offset) {
+ glMultMatrixf(Buffers.newDirectFloatBuffer(m, m_offset));
}
@Override
- public void glTranslatef(float x, float y, float z) {
+ public void glTranslatef(final float x, final float y, final float z) {
pmvMatrix.glTranslatef(x, y, z);
}
@Override
- public void glRotatef(float angdeg, float x, float y, float z) {
+ public void glRotatef(final float angdeg, final float x, final float y, final float z) {
pmvMatrix.glRotatef(angdeg, x, y, z);
}
@Override
- public void glScalef(float x, float y, float z) {
+ public void glScalef(final float x, final float y, final float z) {
pmvMatrix.glScalef(x, y, z);
}
- public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val) {
+ public void glOrtho(final double left, final double right, final double bottom, final double top, final double near_val, final double far_val) {
glOrthof((float) left, (float) right, (float) bottom, (float) top, (float) near_val, (float) far_val);
}
@Override
- public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) {
+ public void glOrthof(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
pmvMatrix.glOrthof(left, right, bottom, top, zNear, zFar);
}
- public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) {
+ public void glFrustum(final double left, final double right, final double bottom, final double top, final double zNear, final double zFar) {
glFrustumf((float) left, (float) right, (float) bottom, (float) top, (float) zNear, (float) zFar);
}
@Override
- public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) {
+ public void glFrustumf(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
pmvMatrix.glFrustumf(left, right, bottom, top, zNear, zFar);
}
@@ -283,45 +283,45 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
// LightingIf
//
@Override
- public void glColor4f(float red, float green, float blue, float alpha) {
+ public void glColor4f(final float red, final float green, final float blue, final float alpha) {
fixedFunction.glColor4f(gl, red, green, blue, alpha);
}
- public void glColor4ub(byte red, byte green, byte blue, byte alpha) {
+ public void glColor4ub(final byte red, final byte green, final byte blue, final byte alpha) {
glColor4f(ValueConv.byte_to_float(red, false),
ValueConv.byte_to_float(green, false),
ValueConv.byte_to_float(blue, false),
ValueConv.byte_to_float(alpha, false) );
}
@Override
- public void glLightfv(int light, int pname, java.nio.FloatBuffer params) {
+ public void glLightfv(final int light, final int pname, final java.nio.FloatBuffer params) {
fixedFunction.glLightfv(gl, light, pname, params);
}
@Override
- public void glLightfv(int light, int pname, float[] params, int params_offset) {
- glLightfv(light, pname, GLBuffers.newDirectFloatBuffer(params, params_offset));
+ public void glLightfv(final int light, final int pname, final float[] params, final int params_offset) {
+ glLightfv(light, pname, Buffers.newDirectFloatBuffer(params, params_offset));
}
@Override
- public void glMaterialfv(int face, int pname, java.nio.FloatBuffer params) {
+ public void glMaterialfv(final int face, final int pname, final java.nio.FloatBuffer params) {
fixedFunction.glMaterialfv(gl, face, pname, params);
}
@Override
- public void glMaterialfv(int face, int pname, float[] params, int params_offset) {
- glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(params, params_offset));
+ public void glMaterialfv(final int face, final int pname, final float[] params, final int params_offset) {
+ glMaterialfv(face, pname, Buffers.newDirectFloatBuffer(params, params_offset));
}
@Override
- public void glMaterialf(int face, int pname, float param) {
- glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(new float[] { param }));
+ public void glMaterialf(final int face, final int pname, final float param) {
+ glMaterialfv(face, pname, Buffers.newDirectFloatBuffer(new float[] { param }));
}
//
// Misc Simple States
//
@Override
- public void glShadeModel(int mode) {
+ public void glShadeModel(final int mode) {
fixedFunction.glShadeModel(gl, mode);
}
- public void glAlphaFunc(int func, float ref) {
+ public void glAlphaFunc(final int func, final float ref) {
fixedFunction.glAlphaFunc(func, ref);
}
@@ -334,20 +334,20 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
//
// PointerIf
//
- public void glClientActiveTexture(int textureUnit) {
+ public void glClientActiveTexture(final int textureUnit) {
fixedFunction.glClientActiveTexture(textureUnit);
}
@Override
- public void glEnableClientState(int glArrayIndex) {
+ public void glEnableClientState(final int glArrayIndex) {
fixedFunction.glEnableClientState(gl, glArrayIndex);
}
@Override
- public void glDisableClientState(int glArrayIndex) {
+ public void glDisableClientState(final int glArrayIndex) {
fixedFunction.glDisableClientState(gl, glArrayIndex);
}
@Override
- public void glVertexPointer(GLArrayData array) {
+ public void glVertexPointer(final GLArrayData array) {
if(array.isVBO()) {
if(!gl.isVBOArrayBound()) {
throw new GLException("VBO array is not enabled: "+array);
@@ -364,13 +364,13 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
}
@Override
- public void glVertexPointer(int size, int type, int stride, java.nio.Buffer pointer) {
+ public void glVertexPointer(final int size, final int type, final int stride, final java.nio.Buffer pointer) {
glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
}
@Override
- public void glVertexPointer(int size, int type, int stride, long pointer_buffer_offset) {
- int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
+ public void glVertexPointer(final int size, final int type, final int stride, final long pointer_buffer_offset) {
+ final int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
if(vboName==0) {
throw new GLException("no GL_ARRAY_BUFFER VBO bound");
}
@@ -379,7 +379,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
}
@Override
- public void glColorPointer(GLArrayData array) {
+ public void glColorPointer(final GLArrayData array) {
if(array.isVBO()) {
if(!gl.isVBOArrayBound()) {
throw new GLException("VBO array is not enabled: "+array);
@@ -395,13 +395,13 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
fixedFunction.glColorPointer(gl, array);
}
@Override
- public void glColorPointer(int size, int type, int stride, java.nio.Buffer pointer) {
+ public void glColorPointer(final int size, final int type, final int stride, final java.nio.Buffer pointer) {
glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
}
@Override
- public void glColorPointer(int size, int type, int stride, long pointer_buffer_offset) {
- int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
+ public void glColorPointer(final int size, final int type, final int stride, final long pointer_buffer_offset) {
+ final int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
if(vboName==0) {
throw new GLException("no GL_ARRAY_BUFFER VBO bound");
}
@@ -410,7 +410,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
}
@Override
- public void glNormalPointer(GLArrayData array) {
+ public void glNormalPointer(final GLArrayData array) {
if(array.getComponentCount()!=3) {
throw new GLException("Only 3 components per normal allowed");
}
@@ -429,13 +429,13 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
fixedFunction.glNormalPointer(gl, array);
}
@Override
- public void glNormalPointer(int type, int stride, java.nio.Buffer pointer) {
+ public void glNormalPointer(final int type, final int stride, final java.nio.Buffer pointer) {
glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride,
pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
}
@Override
- public void glNormalPointer(int type, int stride, long pointer_buffer_offset) {
- int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
+ public void glNormalPointer(final int type, final int stride, final long pointer_buffer_offset) {
+ final int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
if(vboName==0) {
throw new GLException("no GL_ARRAY_BUFFER VBO bound");
}
@@ -444,7 +444,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
}
@Override
- public void glTexCoordPointer(GLArrayData array) {
+ public void glTexCoordPointer(final GLArrayData array) {
if(array.isVBO()) {
if(!gl.isVBOArrayBound()) {
throw new GLException("VBO array is not enabled: "+array);
@@ -460,14 +460,14 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
fixedFunction.glTexCoordPointer(gl, array);
}
@Override
- public void glTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer) {
+ public void glTexCoordPointer(final int size, final int type, final int stride, final java.nio.Buffer pointer) {
glTexCoordPointer(
GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
}
@Override
- public void glTexCoordPointer(int size, int type, int stride, long pointer_buffer_offset) {
- int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
+ public void glTexCoordPointer(final int size, final int type, final int stride, final long pointer_buffer_offset) {
+ final int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
if(vboName==0) {
throw new GLException("no GL_ARRAY_BUFFER VBO bound");
}
@@ -478,7 +478,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
@Override
public final String toString() {
- StringBuilder buf = new StringBuilder();
+ final StringBuilder buf = new StringBuilder();
buf.append(getClass().getName()+" (");
if(null!=pmvMatrix) {
buf.append(", matrixDirty: "+ (0 != pmvMatrix.getModifiedBits(false)));
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
index 42269588d..c65ed084d 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
@@ -52,6 +52,7 @@ import jogamp.opengl.Debug;
import com.jogamp.common.nio.Buffers;
import com.jogamp.common.util.IntIntHashMap;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.opengl.util.PMVMatrix;
import com.jogamp.opengl.util.glsl.ShaderCode;
import com.jogamp.opengl.util.glsl.ShaderProgram;
@@ -71,14 +72,14 @@ public class FixedFuncPipeline {
static {
Debug.initSingleton();
- DEBUG = Debug.isPropertyDefined("jogl.debug.FixedFuncPipeline", true);
+ DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.FixedFuncPipeline", true);
}
/** The maximum texture units which could be used, depending on {@link ShaderSelectionMode}. */
public static final int MAX_TEXTURE_UNITS = 8;
public static final int MAX_LIGHTS = 8;
- public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) {
+ public FixedFuncPipeline(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) {
shaderRootClass = FixedFuncPipeline.class;
shaderSrcRoot = shaderSrcRootDef;
shaderBinRoot = shaderBinRootDef;
@@ -88,11 +89,11 @@ public class FixedFuncPipeline {
fragmentColorTextureFile = fragmentColorTextureFileDef;
init(gl, mode, pmvMatrix);
}
- public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix,
- Class<?> shaderRootClass, String shaderSrcRoot,
- String shaderBinRoot,
- String vertexColorFile, String vertexColorLightFile,
- String fragmentColorFile, String fragmentColorTextureFile) {
+ public FixedFuncPipeline(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix,
+ final Class<?> shaderRootClass, final String shaderSrcRoot,
+ final String shaderBinRoot,
+ final String vertexColorFile, final String vertexColorLightFile,
+ final String fragmentColorFile, final String fragmentColorTextureFile) {
this.shaderRootClass = shaderRootClass;
this.shaderSrcRoot = shaderSrcRoot;
this.shaderBinRoot = shaderBinRoot;
@@ -104,12 +105,12 @@ public class FixedFuncPipeline {
}
public ShaderSelectionMode getShaderSelectionMode() { return requestedShaderSelectionMode; }
- public void setShaderSelectionMode(ShaderSelectionMode mode) { requestedShaderSelectionMode=mode; }
+ public void setShaderSelectionMode(final ShaderSelectionMode mode) { requestedShaderSelectionMode=mode; }
public ShaderSelectionMode getCurrentShaderSelectionMode() { return currentShaderSelectionMode; }
public boolean verbose() { return verbose; }
- public void setVerbose(boolean v) { verbose = DEBUG || v; }
+ public void setVerbose(final boolean v) { verbose = DEBUG || v; }
public boolean isValid() {
return shaderState.linked();
@@ -123,7 +124,7 @@ public class FixedFuncPipeline {
return activeTextureUnit;
}
- public void destroy(GL2ES2 gl) {
+ public void destroy(final GL2ES2 gl) {
if(null != shaderProgramColor) {
shaderProgramColor.release(gl, true);
}
@@ -148,7 +149,7 @@ public class FixedFuncPipeline {
//
// Simple Globals
//
- public void glColor4f(GL2ES2 gl, float red, float green, float blue, float alpha) {
+ public void glColor4f(final GL2ES2 gl, final float red, final float green, final float blue, final float alpha) {
colorStatic.put(0, red);
colorStatic.put(1, green);
colorStatic.put(2, blue);
@@ -168,15 +169,15 @@ public class FixedFuncPipeline {
// Arrays / States
//
- public void glEnableClientState(GL2ES2 gl, int glArrayIndex) {
+ public void glEnableClientState(final GL2ES2 gl, final int glArrayIndex) {
glToggleClientState(gl, glArrayIndex, true);
}
- public void glDisableClientState(GL2ES2 gl, int glArrayIndex) {
+ public void glDisableClientState(final GL2ES2 gl, final int glArrayIndex) {
glToggleClientState(gl, glArrayIndex, false);
}
- private void glToggleClientState(GL2ES2 gl, int glArrayIndex, boolean enable) {
+ private void glToggleClientState(final GL2ES2 gl, final int glArrayIndex, final boolean enable) {
final String arrayName = GLPointerFuncUtil.getPredefinedArrayIndexName(glArrayIndex, clientActiveTextureUnit);
if(null == arrayName) {
throw new GLException("arrayIndex "+toHexString(glArrayIndex)+" unknown");
@@ -203,17 +204,17 @@ public class FixedFuncPipeline {
}
}
- public void glVertexPointer(GL2ES2 gl, GLArrayData data) {
+ public void glVertexPointer(final GL2ES2 gl, final GLArrayData data) {
shaderState.useProgram(gl, true);
shaderState.vertexAttribPointer(gl, data);
}
- public void glColorPointer(GL2ES2 gl, GLArrayData data) {
+ public void glColorPointer(final GL2ES2 gl, final GLArrayData data) {
shaderState.useProgram(gl, true);
shaderState.vertexAttribPointer(gl, data);
}
- public void glNormalPointer(GL2ES2 gl, GLArrayData data) {
+ public void glNormalPointer(final GL2ES2 gl, final GLArrayData data) {
shaderState.useProgram(gl, true);
shaderState.vertexAttribPointer(gl, data);
}
@@ -223,7 +224,7 @@ public class FixedFuncPipeline {
//
/** Enables/Disables the named texture unit (if changed), returns previous state */
- private boolean glEnableTexture(boolean enable, int unit) {
+ private boolean glEnableTexture(final boolean enable, final int unit) {
final boolean isEnabled = 0 != ( textureEnabledBits & ( 1 << activeTextureUnit ) );
if( isEnabled != enable ) {
if(enable) {
@@ -256,7 +257,7 @@ public class FixedFuncPipeline {
}
}
- public void glTexCoordPointer(GL2ES2 gl, GLArrayData data) {
+ public void glTexCoordPointer(final GL2ES2 gl, final GLArrayData data) {
if( GLPointerFunc.GL_TEXTURE_COORD_ARRAY != data.getIndex() ) {
throw new GLException("Invalid GLArrayData Index "+toHexString(data.getIndex())+", "+data);
}
@@ -265,7 +266,7 @@ public class FixedFuncPipeline {
shaderState.vertexAttribPointer(gl, data);
}
- public void glBindTexture(int target, int texture) {
+ public void glBindTexture(final int target, final int texture) {
if(GL.GL_TEXTURE_2D == target) {
if( texture != boundTextureObject[activeTextureUnit] ) {
boundTextureObject[activeTextureUnit] = texture;
@@ -276,8 +277,8 @@ public class FixedFuncPipeline {
}
}
- public void glTexImage2D(int target, /* int level, */ int internalformat, /*, int width, int height, int border, */
- int format /*, int type, Buffer pixels */) {
+ public void glTexImage2D(final int target, /* int level, */ final int internalformat, /*, int width, int height, int border, */
+ final int format /*, int type, Buffer pixels */) {
final int ifmt;
if(GL.GL_TEXTURE_2D == target) {
switch(internalformat) {
@@ -316,7 +317,7 @@ public class FixedFuncPipeline {
textureFormatDirty = true;
}*/
- public void glTexEnvi(int target, int pname, int value) {
+ public void glTexEnvi(final int target, final int pname, final int value) {
if(GL2ES1.GL_TEXTURE_ENV == target && GL2ES1.GL_TEXTURE_ENV_MODE == pname) {
final int mode;
switch( value ) {
@@ -329,10 +330,10 @@ public class FixedFuncPipeline {
case GL2ES1.GL_DECAL:
mode = 3;
break;
- case GL2ES1.GL_BLEND:
+ case GL.GL_BLEND:
mode = 4;
break;
- case GL2ES1.GL_REPLACE:
+ case GL.GL_REPLACE:
mode = 5;
break;
case GL2ES1.GL_COMBINE:
@@ -347,27 +348,27 @@ public class FixedFuncPipeline {
System.err.println("FixedFuncPipeline: Unimplemented TexEnv: target "+toHexString(target)+", pname "+toHexString(pname)+", mode: "+toHexString(value));
}
}
- private void setTextureEnvMode(int value) {
+ private void setTextureEnvMode(final int value) {
if( value != textureEnvMode.get(activeTextureUnit) ) {
textureEnvMode.put(activeTextureUnit, value);
textureEnvModeDirty = true;
}
}
- public void glGetTexEnviv(int target, int pname, IntBuffer params) { // FIXME
+ public void glGetTexEnviv(final int target, final int pname, final IntBuffer params) { // FIXME
System.err.println("FixedFuncPipeline: Unimplemented glGetTexEnviv: target "+toHexString(target)+", pname "+toHexString(pname));
}
- public void glGetTexEnviv(int target, int pname, int[] params, int params_offset) { // FIXME
+ public void glGetTexEnviv(final int target, final int pname, final int[] params, final int params_offset) { // FIXME
System.err.println("FixedFuncPipeline: Unimplemented glGetTexEnviv: target "+toHexString(target)+", pname "+toHexString(pname));
}
//
// Point Sprites
//
- public void glPointSize(float size) {
+ public void glPointSize(final float size) {
pointParams.put(0, size);
pointParamsDirty = true;
}
- public void glPointParameterf(int pname, float param) {
+ public void glPointParameterf(final int pname, final float param) {
switch(pname) {
case GL2ES1.GL_POINT_SIZE_MIN:
pointParams.put(2, param);
@@ -375,13 +376,13 @@ public class FixedFuncPipeline {
case GL2ES1.GL_POINT_SIZE_MAX:
pointParams.put(3, param);
break;
- case GL2ES2.GL_POINT_FADE_THRESHOLD_SIZE:
+ case GL.GL_POINT_FADE_THRESHOLD_SIZE:
pointParams.put(4+3, param);
break;
}
pointParamsDirty = true;
}
- public void glPointParameterfv(int pname, float[] params, int params_offset) {
+ public void glPointParameterfv(final int pname, final float[] params, final int params_offset) {
switch(pname) {
case GL2ES1.GL_POINT_DISTANCE_ATTENUATION:
pointParams.put(4+0, params[params_offset + 0]);
@@ -391,7 +392,7 @@ public class FixedFuncPipeline {
}
pointParamsDirty = true;
}
- public void glPointParameterfv(int pname, java.nio.FloatBuffer params) {
+ public void glPointParameterfv(final int pname, final java.nio.FloatBuffer params) {
final int o = params.position();
switch(pname) {
case GL2ES1.GL_POINT_DISTANCE_ATTENUATION:
@@ -405,7 +406,7 @@ public class FixedFuncPipeline {
// private int[] pointTexObj = new int[] { 0 };
- private void glDrawPoints(GL2ES2 gl, GLRunnable2<Object,Object> glDrawAction, Object args) {
+ private void glDrawPoints(final GL2ES2 gl, final GLRunnable2<Object,Object> glDrawAction, final Object args) {
if(gl.isGL2GL3()) {
gl.glEnable(GL2GL3.GL_VERTEX_PROGRAM_POINT_SIZE);
}
@@ -428,13 +429,13 @@ public class FixedFuncPipeline {
}
private static final GLRunnable2<Object, Object> glDrawArraysAction = new GLRunnable2<Object,Object>() {
@Override
- public Object run(GL gl, Object args) {
- int[] _args = (int[])args;
+ public Object run(final GL gl, final Object args) {
+ final int[] _args = (int[])args;
gl.glDrawArrays(GL.GL_POINTS, _args[0], _args[1]);
return null;
}
};
- private final void glDrawPointArrays(GL2ES2 gl, int first, int count) {
+ private final void glDrawPointArrays(final GL2ES2 gl, final int first, final int count) {
glDrawPoints(gl, glDrawArraysAction, new int[] { first, count });
}
@@ -442,7 +443,7 @@ public class FixedFuncPipeline {
// Lighting
//
- public void glLightfv(GL2ES2 gl, int light, int pname, java.nio.FloatBuffer params) {
+ public void glLightfv(final GL2ES2 gl, int light, final int pname, final java.nio.FloatBuffer params) {
shaderState.useProgram(gl, true);
light -=GLLightingFunc.GL_LIGHT0;
if(0 <= light && light < MAX_LIGHTS) {
@@ -490,7 +491,7 @@ public class FixedFuncPipeline {
}
}
- public void glMaterialfv(GL2ES2 gl, int face, int pname, java.nio.FloatBuffer params) {
+ public void glMaterialfv(final GL2ES2 gl, final int face, final int pname, final java.nio.FloatBuffer params) {
shaderState.useProgram(gl, true);
switch (face) {
@@ -544,9 +545,9 @@ public class FixedFuncPipeline {
// Misc States
//
- public void glShadeModel(GL2ES2 gl, int mode) {
+ public void glShadeModel(final GL2ES2 gl, final int mode) {
shaderState.useProgram(gl, true);
- GLUniformData ud = shaderState.getUniform(mgl_ShadeModel);
+ final GLUniformData ud = shaderState.getUniform(mgl_ShadeModel);
if(null!=ud) {
ud.setData(mode);
shaderState.uniform(gl, ud);
@@ -580,7 +581,7 @@ public class FixedFuncPipeline {
}
} */
- public void glAlphaFunc(int func, float ref) {
+ public void glAlphaFunc(final int func, final float ref) {
int _func;
switch(func) {
case GL.GL_NEVER:
@@ -627,7 +628,7 @@ public class FixedFuncPipeline {
* eg this call must not be passed to an underlying ES2 implementation.
* true if this call shall be passed to an underlying GL2ES2/ES2 implementation as well.
*/
- public boolean glEnable(int cap, boolean enable) {
+ public boolean glEnable(final int cap, final boolean enable) {
switch(cap) {
case GL.GL_BLEND:
case GL.GL_DEPTH_TEST:
@@ -684,7 +685,7 @@ public class FixedFuncPipeline {
return false;
}
- int light = cap - GLLightingFunc.GL_LIGHT0;
+ final int light = cap - GLLightingFunc.GL_LIGHT0;
if(0 <= light && light < MAX_LIGHTS) {
if ( (lightsEnabled.get(light)==1) != enable ) {
lightsEnabled.put(light, enable?1:0);
@@ -700,7 +701,7 @@ public class FixedFuncPipeline {
// Draw
//
- public void glDrawArrays(GL2ES2 gl, int mode, int first, int count) {
+ public void glDrawArrays(final GL2ES2 gl, int mode, final int first, final int count) {
switch(mode) {
case GL2.GL_QUAD_STRIP:
mode=GL.GL_TRIANGLE_STRIP;
@@ -708,12 +709,12 @@ public class FixedFuncPipeline {
case GL2.GL_POLYGON:
mode=GL.GL_TRIANGLE_FAN;
break;
- case GL2ES1.GL_POINTS:
+ case GL.GL_POINTS:
glDrawPointArrays(gl, first, count);
return;
}
validate(gl, true);
- if ( GL2.GL_QUADS == mode && !gl.isGL2() ) {
+ if ( GL2GL3.GL_QUADS == mode && !gl.isGL2() ) {
for (int j = first; j < count - 3; j += 4) {
gl.glDrawArrays(GL.GL_TRIANGLE_FAN, j, 4);
}
@@ -721,25 +722,25 @@ public class FixedFuncPipeline {
gl.glDrawArrays(mode, first, count);
}
}
- public void glDrawElements(GL2ES2 gl, int mode, int count, int type, java.nio.Buffer indices) {
+ public void glDrawElements(final GL2ES2 gl, final int mode, final int count, final int type, final java.nio.Buffer indices) {
validate(gl, true);
- if ( GL2.GL_QUADS == mode && !gl.isGL2() ) {
+ if ( GL2GL3.GL_QUADS == mode && !gl.isGL2() ) {
final int idx0 = indices.position();
if( GL.GL_UNSIGNED_BYTE == type ) {
final ByteBuffer b = (ByteBuffer) indices;
for (int j = 0; j < count; j++) {
- gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x000000ff & b.get(idx0+j)), 4);
+ gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0x000000ff & b.get(idx0+j), 4);
}
} else if( GL.GL_UNSIGNED_SHORT == type ){
final ShortBuffer b = (ShortBuffer) indices;
for (int j = 0; j < count; j++) {
- gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x0000ffff & b.get(idx0+j)), 4);
+ gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0x0000ffff & b.get(idx0+j), 4);
}
} else {
final IntBuffer b = (IntBuffer) indices;
for (int j = 0; j < count; j++) {
- gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0xffffffff & b.get(idx0+j)), 4);
+ gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0xffffffff & b.get(idx0+j), 4);
}
}
} else {
@@ -747,7 +748,7 @@ public class FixedFuncPipeline {
if( !gl.getContext().isCPUDataSourcingAvail() ) {
throw new GLException("CPU data sourcing n/a w/ "+gl.getContext());
}
- if( GL2ES1.GL_POINTS != mode ) {
+ if( GL.GL_POINTS != mode ) {
((GLES2)gl).glDrawElements(mode, count, type, indices);
} else {
// FIXME GL_POINTS !
@@ -755,11 +756,11 @@ public class FixedFuncPipeline {
}
}
}
- public void glDrawElements(GL2ES2 gl, int mode, int count, int type, long indices_buffer_offset) {
+ public void glDrawElements(final GL2ES2 gl, final int mode, final int count, final int type, final long indices_buffer_offset) {
validate(gl, true);
- if ( GL2.GL_QUADS == mode && !gl.isGL2() ) {
+ if ( GL2GL3.GL_QUADS == mode && !gl.isGL2() ) {
throw new GLException("Cannot handle indexed QUADS on !GL2 w/ VBO due to lack of CPU index access");
- } else if( GL2ES1.GL_POINTS != mode ) {
+ } else if( GL.GL_POINTS != mode ) {
// FIXME GL_POINTS !
gl.glDrawElements(mode, count, type, indices_buffer_offset);
} else {
@@ -777,7 +778,7 @@ public class FixedFuncPipeline {
return n;
}
- public void validate(GL2ES2 gl, boolean selectShader) {
+ public void validate(final GL2ES2 gl, final boolean selectShader) {
if( selectShader ) {
if( ShaderSelectionMode.AUTO == requestedShaderSelectionMode) {
final ShaderSelectionMode newMode;
@@ -832,7 +833,7 @@ public class FixedFuncPipeline {
if(colorVAEnabledDirty) {
ud = shaderState.getUniform(mgl_ColorEnabled);
if(null!=ud) {
- int ca = true == shaderState.isVertexAttribArrayEnabled(GLPointerFuncUtil.mgl_Color) ? 1 : 0 ;
+ final int ca = true == shaderState.isVertexAttribArrayEnabled(GLPointerFuncUtil.mgl_Color) ? 1 : 0 ;
if(ca!=ud.intValue()) {
ud.setData(ca);
shaderState.uniform(gl, ud);
@@ -926,7 +927,7 @@ public class FixedFuncPipeline {
}
}
- public StringBuilder toString(StringBuilder sb, boolean alsoUnlocated) {
+ public StringBuilder toString(StringBuilder sb, final boolean alsoUnlocated) {
if(null == sb) {
sb = new StringBuilder();
}
@@ -956,14 +957,14 @@ public class FixedFuncPipeline {
private static final String constMaxTextures4 = "#define MAX_TEXTURE_UNITS 4\n";
private static final String constMaxTextures8 = "#define MAX_TEXTURE_UNITS 8\n";
- private final void customizeShader(GL2ES2 gl, ShaderCode vp, ShaderCode fp, String maxTextureDefine) {
- int rsVpPos = vp.defaultShaderCustomization(gl, true, true);
- int rsFpPos = fp.defaultShaderCustomization(gl, true, true);
+ private final void customizeShader(final GL2ES2 gl, final ShaderCode vp, final ShaderCode fp, final String maxTextureDefine) {
+ final int rsVpPos = vp.defaultShaderCustomization(gl, true, true);
+ final int rsFpPos = fp.defaultShaderCustomization(gl, true, true);
vp.insertShaderSource(0, rsVpPos, maxTextureDefine);
fp.insertShaderSource(0, rsFpPos, maxTextureDefine);
}
- private final void loadShaderPoints(GL2ES2 gl) {
+ private final void loadShaderPoints(final GL2ES2 gl) {
if( null != shaderProgramPoints ) {
return;
}
@@ -981,7 +982,7 @@ public class FixedFuncPipeline {
}
}
- private final void loadShader(GL2ES2 gl, ShaderSelectionMode mode) {
+ private final void loadShader(final GL2ES2 gl, final ShaderSelectionMode mode) {
final boolean loadColor = ShaderSelectionMode.COLOR == mode;
final boolean loadColorTexture2 = ShaderSelectionMode.COLOR_TEXTURE2 == mode;
final boolean loadColorTexture4 = ShaderSelectionMode.COLOR_TEXTURE4 == mode;
@@ -1068,7 +1069,7 @@ public class FixedFuncPipeline {
}
}
- private ShaderProgram selectShaderProgram(GL2ES2 gl, ShaderSelectionMode newMode) {
+ private ShaderProgram selectShaderProgram(final GL2ES2 gl, ShaderSelectionMode newMode) {
if(ShaderSelectionMode.AUTO == newMode) {
newMode = ShaderSelectionMode.COLOR;
}
@@ -1098,7 +1099,7 @@ public class FixedFuncPipeline {
return sp;
}
- private void init(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) {
+ private void init(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) {
if(null==pmvMatrix) {
throw new GLException("PMVMatrix is null");
}
@@ -1157,7 +1158,7 @@ public class FixedFuncPipeline {
}
}
- private String toHexString(int i) {
+ private String toHexString(final int i) {
return "0x"+Integer.toHexString(i);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java b/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java
index 078965301..f73de75c5 100644
--- a/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java
+++ b/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java
@@ -200,14 +200,14 @@ public class JPEGDecoder {
@SuppressWarnings("serial")
public static class CodecException extends RuntimeException {
- CodecException(String message) {
+ CodecException(final String message) {
super(message);
}
}
@SuppressWarnings("serial")
public static class MarkerException extends CodecException {
final int marker;
- MarkerException(int marker, String message) {
+ MarkerException(final int marker, final String message) {
super(message+" - Marker "+toHexString(marker));
this.marker = marker;
}
@@ -312,7 +312,7 @@ public class JPEGDecoder {
int mcusPerLine;
int mcusPerColumn;
- Frame(boolean progressive, int precision, int scanLines, int samplesPerLine, int componentsCount, int[][] qtt) {
+ Frame(final boolean progressive, final int precision, final int scanLines, final int samplesPerLine, final int componentsCount, final int[][] qtt) {
this.progressive = progressive;
this.precision = precision;
this.scanLines = scanLines;
@@ -323,7 +323,7 @@ public class JPEGDecoder {
this.qtt = qtt;
}
- private final void checkBounds(int idx) {
+ private final void checkBounds(final int idx) {
if( 0 > idx || idx >= compCount ) {
throw new CodecException("Idx out of bounds "+idx+", "+this);
}
@@ -343,7 +343,7 @@ public class JPEGDecoder {
public final int getCompCount() { return compCount; }
public final int getMaxCompID() { return maxCompID; }
- public final void putOrdered(int compID, ComponentIn component) {
+ public final void putOrdered(final int compID, final ComponentIn component) {
if( maxCompID < compID ) {
maxCompID = compID;
}
@@ -352,17 +352,17 @@ public class JPEGDecoder {
compIDs.add(compID);
comps[idx] = component;
}
- public final ComponentIn getCompByIndex(int i) {
+ public final ComponentIn getCompByIndex(final int i) {
checkBounds(i);
return comps[i];
}
- public final ComponentIn getCompByID(int componentID) {
+ public final ComponentIn getCompByID(final int componentID) {
return getCompByIndex( compIDs.indexOf(componentID) );
}
- public final int getCompID(int idx) {
+ public final int getCompID(final int idx) {
return compIDs.get(idx);
}
- public final boolean hasCompID(int componentID) {
+ public final boolean hasCompID(final int componentID) {
return compIDs.contains(componentID);
}
@Override
@@ -387,20 +387,20 @@ public class JPEGDecoder {
BinObj huffmanTableAC;
BinObj huffmanTableDC;
- ComponentIn(int h, int v, int qttIdx) {
+ ComponentIn(final int h, final int v, final int qttIdx) {
this.h = h;
this.v = v;
this.qttIdx = qttIdx;
}
- public final void allocateBlocks(int blocksPerColumn, int blocksPerColumnForMcu, int blocksPerLine, int blocksPerLineForMcu) {
+ public final void allocateBlocks(final int blocksPerColumn, final int blocksPerColumnForMcu, final int blocksPerLine, final int blocksPerLineForMcu) {
this.blocksPerColumn = blocksPerColumn;
this.blocksPerColumnForMcu = blocksPerColumnForMcu;
this.blocksPerLine = blocksPerLine;
this.blocksPerLineForMcu = blocksPerLineForMcu;
this.blocks = new int[blocksPerColumnForMcu][blocksPerLineForMcu][64];
}
- public final int[] getBlock(int row, int col) {
+ public final int[] getBlock(final int row, final int col) {
if( row >= blocksPerColumnForMcu || col >= blocksPerLineForMcu ) {
throw new CodecException("Out of bounds given ["+row+"]["+col+"] - "+this);
}
@@ -419,14 +419,14 @@ public class JPEGDecoder {
final float scaleX;
final float scaleY;
- ComponentOut(ArrayList<byte[]> lines, float scaleX, float scaleY) {
+ ComponentOut(final ArrayList<byte[]> lines, final float scaleX, final float scaleY) {
this.lines = lines;
this.scaleX = scaleX;
this.scaleY = scaleY;
}
/** Safely returning a line, if index exceeds number of lines, last line is returned. */
- public final byte[] getLine(int i) {
+ public final byte[] getLine(final int i) {
final int sz = lines.size();
return lines.get( i < sz ? i : sz - 1);
}
@@ -461,10 +461,10 @@ public class JPEGDecoder {
public final int getWidth() { return width; }
public final int getHeight() { return height; }
- private final void setStream(InputStream is) {
+ private final void setStream(final InputStream is) {
try {
bstream.setStream(is, false /* outputMode */);
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException(e); // should not happen, no flush()
}
}
@@ -488,14 +488,14 @@ public class JPEGDecoder {
private final byte[] readDataBlock() throws IOException {
int count=0, i=0;
final int len=readUInt16(); count+=2;
- byte[] data = new byte[len-2];
+ final byte[] data = new byte[len-2];
while(count<len){
data[i++] = (byte)readUInt8(); count++;
}
if(DEBUG_IN) { System.err.println("JPEG.readDataBlock: net-len "+(len-2)+", "+this); dumpData(data, 0, len-2); }
return data;
}
- static final void dumpData(byte[] data, int offset, int len) {
+ static final void dumpData(final byte[] data, final int offset, final int len) {
for(int i=0; i<len; ) {
System.err.print(i%8+": ");
for(int j=0; j<8 && i<len; j++, i++) {
@@ -505,7 +505,7 @@ public class JPEGDecoder {
}
}
- public synchronized void clear(InputStream inputStream) {
+ public synchronized void clear(final InputStream inputStream) {
setStream(inputStream);
width = 0;
height = 0;
@@ -673,7 +673,7 @@ public class JPEGDecoder {
int count = 0;
final int sosLen = readUInt16(); count+=2;
final int selectorsCount = readUInt8(); count++;
- ArrayList<ComponentIn> components = new ArrayList<ComponentIn>();
+ final ArrayList<ComponentIn> components = new ArrayList<ComponentIn>();
if(DEBUG) { System.err.println("JPG.parse.SOS: selectorCount [0.."+(selectorsCount-1)+"]: "+frame); }
for (int i = 0; i < selectorsCount; i++) {
final int compID = readUInt8(); count++;
@@ -734,7 +734,7 @@ public class JPEGDecoder {
return this;
}
- private void prepareComponents(Frame frame) {
+ private void prepareComponents(final Frame frame) {
int maxH = 0, maxV = 0;
// for (componentId in frame.components) {
final int compCount = frame.getCompCount();
@@ -743,8 +743,8 @@ public class JPEGDecoder {
if (maxH < component.h) maxH = component.h;
if (maxV < component.v) maxV = component.v;
}
- int mcusPerLine = (int) Math.ceil(frame.samplesPerLine / 8f / maxH);
- int mcusPerColumn = (int) Math.ceil(frame.scanLines / 8f / maxV);
+ final int mcusPerLine = (int) Math.ceil(frame.samplesPerLine / 8f / maxH);
+ final int mcusPerColumn = (int) Math.ceil(frame.scanLines / 8f / maxV);
// for (componentId in frame.components) {
for (int i=0; i<compCount; i++) {
final ComponentIn component = frame.getCompByIndex(i);
@@ -773,7 +773,7 @@ public class JPEGDecoder {
final BinObj[] tree;
final byte b;
- BinObj(byte b) {
+ BinObj(final byte b) {
this.isValue= true;
this.b = b;
this.tree = null;
@@ -784,12 +784,12 @@ public class JPEGDecoder {
this.tree = new BinObj[2];
}
final byte getValue() { return b; }
- final BinObj get(int i) { return tree[i]; }
- final void set(byte i, byte v) { tree[i] = new BinObj(v); }
- final void set(byte i, BinObj v) { tree[i] = v; }
+ final BinObj get(final int i) { return tree[i]; }
+ final void set(final byte i, final byte v) { tree[i] = new BinObj(v); }
+ final void set(final byte i, final BinObj v) { tree[i] = v; }
}
- private BinObj buildHuffmanTable(int[] codeLengths, byte[] values) {
+ private BinObj buildHuffmanTable(final int[] codeLengths, final byte[] values) {
int k = 0;
int length = 16;
final ArrayList<BinObjIdxed> code = new ArrayList<BinObjIdxed>();
@@ -832,8 +832,8 @@ public class JPEGDecoder {
private int blocksPerColumn;
private int samplesPerLine;
- private ArrayList<byte[]> buildComponentData(Frame frame, ComponentIn component) {
- ArrayList<byte[]> lines = new ArrayList<byte[]>();
+ private ArrayList<byte[]> buildComponentData(final Frame frame, final ComponentIn component) {
+ final ArrayList<byte[]> lines = new ArrayList<byte[]>();
blocksPerLine = component.blocksPerLine;
blocksPerColumn = component.blocksPerColumn;
samplesPerLine = blocksPerLine << 3;
@@ -867,9 +867,9 @@ public class JPEGDecoder {
// "Practical Fast 1-D DCT Algorithms with 11 Multiplications",
// IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989,
// 988-991.
- private void quantizeAndInverse(int[] zz, byte[] dataOut, int[] dataIn, int[] qt) {
+ private void quantizeAndInverse(final int[] zz, final byte[] dataOut, final int[] dataIn, final int[] qt) {
int v0, v1, v2, v3, v4, v5, v6, v7, t;
- int[] p = dataIn;
+ final int[] p = dataIn;
int i;
// dequant
@@ -879,7 +879,7 @@ public class JPEGDecoder {
// inverse DCT on rows
for (i = 0; i < 8; ++i) {
- int row = 8 * i;
+ final int row = 8 * i;
// check for all-zero AC coefficients
if (p[1 + row] == 0 && p[2 + row] == 0 && p[3 + row] == 0 &&
@@ -948,7 +948,7 @@ public class JPEGDecoder {
// inverse DCT on columns
for (i = 0; i < 8; ++i) {
- int col = i;
+ final int col = i;
// check for all-zero AC coefficients
if (p[1*8 + col] == 0 && p[2*8 + col] == 0 && p[3*8 + col] == 0 &&
@@ -1017,7 +1017,7 @@ public class JPEGDecoder {
// convert to 8-bit integers
for (i = 0; i < 64; ++i) {
- int sample = 128 + ((p[i] + 8) >> 4);
+ final int sample = 128 + ((p[i] + 8) >> 4);
dataOut[i] = (byte) ( sample < 0 ? 0 : sample > 0xFF ? 0xFF : sample );
}
}
@@ -1039,8 +1039,8 @@ public class JPEGDecoder {
private int eobrun;
private int successiveACState, successiveACNextValue;
- private int decodeScan(Frame frame, ArrayList<ComponentIn> components, int resetInterval,
- int spectralStart, int spectralEnd, int successivePrev, int successive) throws IOException {
+ private int decodeScan(final Frame frame, final ArrayList<ComponentIn> components, int resetInterval,
+ final int spectralStart, final int spectralEnd, final int successivePrev, final int successive) throws IOException {
// this.precision = frame.precision;
// this.samplesPerLine = frame.samplesPerLine;
// this.scanLines = frame.scanLines;
@@ -1110,10 +1110,10 @@ public class JPEGDecoder {
mcu++;
}
}
- } catch (MarkerException markerException) {
+ } catch (final MarkerException markerException) {
if(DEBUG) { System.err.println("JPEG.decodeScan: Marker exception: "+markerException.getMessage()); markerException.printStackTrace(); }
return markerException.getMarker();
- } catch (CodecException codecException) {
+ } catch (final CodecException codecException) {
if(DEBUG) { System.err.println("JPEG.decodeScan: Codec exception: "+codecException.getMessage()); codecException.printStackTrace(); }
bstream.skip( bstream.getBitCount() ); // align to next byte
return M_EOI; // force end !
@@ -1159,7 +1159,7 @@ public class JPEGDecoder {
return bit;
}
- private int decodeHuffman(BinObj tree) throws IOException {
+ private int decodeHuffman(final BinObj tree) throws IOException {
BinObj node = tree;
int bit;
while ( ( bit = readBit() ) != -1 ) {
@@ -1182,7 +1182,7 @@ public class JPEGDecoder {
}
return n;
}
- private int receiveAndExtend(int length) throws IOException {
+ private int receiveAndExtend(final int length) throws IOException {
final int n = receive(length);
if (n >= 1 << (length - 1)) {
return n;
@@ -1198,7 +1198,7 @@ public class JPEGDecoder {
class BaselineDecoder implements DecoderFunction {
@Override
- public void decode(ComponentIn component, int[] zz) throws IOException {
+ public void decode(final ComponentIn component, final int[] zz) throws IOException {
final int t = decodeHuffman(component.huffmanTableDC);
final int diff = ( t == 0 ) ? 0 : receiveAndExtend(t);
zz[0] = ( component.pred += diff );
@@ -1222,7 +1222,7 @@ public class JPEGDecoder {
}
class DCFirstDecoder implements DecoderFunction {
@Override
- public void decode(ComponentIn component, int[] zz) throws IOException {
+ public void decode(final ComponentIn component, final int[] zz) throws IOException {
final int t = decodeHuffman(component.huffmanTableDC);
final int diff = ( t == 0 ) ? 0 : (receiveAndExtend(t) << successive);
zz[0] = ( component.pred += diff );
@@ -1230,19 +1230,20 @@ public class JPEGDecoder {
}
class DCSuccessiveDecoder implements DecoderFunction {
@Override
- public void decode(ComponentIn component, int[] zz) throws IOException {
+ public void decode(final ComponentIn component, final int[] zz) throws IOException {
zz[0] |= readBit() << successive;
}
}
class ACFirstDecoder implements DecoderFunction {
@Override
- public void decode(ComponentIn component, int[] zz) throws IOException {
+ public void decode(final ComponentIn component, final int[] zz) throws IOException {
if (eobrun > 0) {
eobrun--;
return;
}
- int k = spectralStart, e = spectralEnd;
+ int k = spectralStart;
+ final int e = spectralEnd;
while (k <= e) {
final int rs = decodeHuffman(component.huffmanTableAC);
final int s = rs & 15, r = rs >> 4;
@@ -1263,8 +1264,10 @@ public class JPEGDecoder {
}
class ACSuccessiveDecoder implements DecoderFunction {
@Override
- public void decode(ComponentIn component, int[] zz) throws IOException {
- int k = spectralStart, e = spectralEnd, r = 0;
+ public void decode(final ComponentIn component, final int[] zz) throws IOException {
+ int k = spectralStart;
+ final int e = spectralEnd;
+ int r = 0;
while (k <= e) {
final int z = dctZigZag[k];
switch (successiveACState) {
@@ -1324,14 +1327,14 @@ public class JPEGDecoder {
}
}
}
- void decodeMcu(ComponentIn component, DecoderFunction decoder, int mcu, int row, int col) throws IOException {
+ void decodeMcu(final ComponentIn component, final DecoderFunction decoder, final int mcu, final int row, final int col) throws IOException {
final int mcuRow = (mcu / mcusPerLine) | 0;
final int mcuCol = mcu % mcusPerLine;
final int blockRow = mcuRow * component.v + row;
final int blockCol = mcuCol * component.h + col;
decoder.decode(component, component.getBlock(blockRow, blockCol));
}
- void decodeBlock(ComponentIn component, DecoderFunction decoder, int mcu) throws IOException {
+ void decodeBlock(final ComponentIn component, final DecoderFunction decoder, final int mcu) throws IOException {
final int blockRow = (mcu / component.blocksPerLine) | 0;
final int blockCol = mcu % component.blocksPerLine;
decoder.decode(component, component.getBlock(blockRow, blockCol));
@@ -1359,7 +1362,7 @@ public class JPEGDecoder {
pixelStorage.storeRGB(x, y, (byte)R, (byte)G, (byte)B);
} */
- public synchronized void getPixel(JPEGDecoder.ColorSink pixelStorage, int width, int height) {
+ public synchronized void getPixel(final JPEGDecoder.ColorSink pixelStorage, final int width, final int height) {
final int scaleX = this.width / width, scaleY = this.height / height;
final int componentCount = this.components.length;
@@ -1507,11 +1510,11 @@ public class JPEGDecoder {
}
}
- private static byte clampTo8bit(float a) {
+ private static byte clampTo8bit(final float a) {
return (byte) ( a < 0f ? 0 : a > 255f ? 255 : a );
}
- private static String toHexString(int v) {
+ private static String toHexString(final int v) {
return "0x"+Integer.toHexString(v);
}
} \ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/FilterType.java b/src/jogl/classes/jogamp/opengl/util/pngj/FilterType.java
index 5e177b8c3..c577c4fd5 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/FilterType.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/FilterType.java
@@ -53,7 +53,7 @@ public enum FilterType {
FILTER_UNKNOWN(-100), ;
public final int val;
- private FilterType(int val) {
+ private FilterType(final int val) {
this.val = val;
}
@@ -61,12 +61,12 @@ public enum FilterType {
static {
byVal = new HashMap<Integer, FilterType>();
- for (FilterType ft : values()) {
+ for (final FilterType ft : values()) {
byVal.put(ft.val, ft);
}
}
- public static FilterType getByVal(int i) {
+ public static FilterType getByVal(final int i) {
return byVal.get(i);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/FilterWriteStrategy.java b/src/jogl/classes/jogamp/opengl/util/pngj/FilterWriteStrategy.java
index 79eed8f85..63f456347 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/FilterWriteStrategy.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/FilterWriteStrategy.java
@@ -11,15 +11,15 @@ class FilterWriteStrategy {
private FilterType currentType; // 0-4
private int lastRowTested = -1000000;
// performance of each filter (less is better) (can be negative)
- private double[] lastSums = new double[5];
+ private final double[] lastSums = new double[5];
// performance of each filter (less is better) (can be negative)
- private double[] lastEntropies = new double[5];
+ private final double[] lastEntropies = new double[5];
// a priori preference (NONE SUB UP AVERAGE PAETH)
private double[] preference = new double[] { 1.1, 1.1, 1.1, 1.1, 1.2 };
private int discoverEachLines = -1;
- private double[] histogram1 = new double[256];
+ private final double[] histogram1 = new double[256];
- FilterWriteStrategy(ImageInfo imgInfo, FilterType configuredType) {
+ FilterWriteStrategy(final ImageInfo imgInfo, final FilterType configuredType) {
this.imgInfo = imgInfo;
this.configuredType = configuredType;
if (configuredType.val < 0) { // first guess
@@ -36,7 +36,7 @@ class FilterWriteStrategy {
discoverEachLines = 1;
}
- boolean shouldTestAll(int rown) {
+ boolean shouldTestAll(final int rown) {
if (discoverEachLines > 0 && lastRowTested + discoverEachLines <= rown) {
currentType = null;
return true;
@@ -44,7 +44,7 @@ class FilterWriteStrategy {
return false;
}
- public void setPreference(double none, double sub, double up, double ave, double paeth) {
+ public void setPreference(final double none, final double sub, final double up, final double ave, final double paeth) {
preference = new double[] { none, sub, up, ave, paeth };
}
@@ -52,7 +52,7 @@ class FilterWriteStrategy {
return (discoverEachLines > 0);
}
- void fillResultsForFilter(int rown, FilterType type, double sum, int[] histo, boolean tentative) {
+ void fillResultsForFilter(final int rown, final FilterType type, final double sum, final int[] histo, final boolean tentative) {
lastRowTested = rown;
lastSums[type.val] = sum;
if (histo != null) {
@@ -72,7 +72,7 @@ class FilterWriteStrategy {
}
}
- FilterType gimmeFilterType(int rown, boolean useEntropy) {
+ FilterType gimmeFilterType(final int rown, final boolean useEntropy) {
if (currentType == null) { // get better
if (rown == 0)
currentType = FilterType.FILTER_SUB;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageInfo.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageInfo.java
index ac7b858e1..cdd17a291 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageInfo.java
@@ -92,7 +92,7 @@ public class ImageInfo {
/**
* Short constructor: assumes truecolor (RGB/RGBA)
*/
- public ImageInfo(int cols, int rows, int bitdepth, boolean alpha) {
+ public ImageInfo(final int cols, final int rows, final int bitdepth, final boolean alpha) {
this(cols, rows, bitdepth, alpha, false, false);
}
@@ -113,7 +113,7 @@ public class ImageInfo {
* @param indexed
* Flag: has palette
*/
- public ImageInfo(int cols, int rows, int bitdepth, boolean alpha, boolean grayscale, boolean indexed) {
+ public ImageInfo(final int cols, final int rows, final int bitdepth, final boolean alpha, final boolean grayscale, final boolean indexed) {
this.cols = cols;
this.rows = rows;
this.alpha = alpha;
@@ -176,14 +176,14 @@ public class ImageInfo {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
- ImageInfo other = (ImageInfo) obj;
+ final ImageInfo other = (ImageInfo) obj;
if (alpha != other.alpha)
return false;
if (bitDepth != other.bitDepth)
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
index e6afd8694..5ad2e4409 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
@@ -69,7 +69,7 @@ public class ImageLine {
/**
* default mode: INT packed
*/
- public ImageLine(ImageInfo imgInfo) {
+ public ImageLine(final ImageInfo imgInfo) {
this(imgInfo, SampleType.INT, false);
}
@@ -86,14 +86,14 @@ public class ImageLine {
* images
*
*/
- public ImageLine(ImageInfo imgInfo, SampleType stype, boolean unpackedMode) {
+ public ImageLine(final ImageInfo imgInfo, final SampleType stype, final boolean unpackedMode) {
this(imgInfo, stype, unpackedMode, null, null);
}
/**
* If a preallocated array is passed, the copy is shallow
*/
- ImageLine(ImageInfo imgInfo, SampleType stype, boolean unpackedMode, int[] sci, byte[] scb) {
+ ImageLine(final ImageInfo imgInfo, final SampleType stype, final boolean unpackedMode, final int[] sci, final byte[] scb) {
this.imgInfo = imgInfo;
channels = imgInfo.channels;
bitDepth = imgInfo.bitDepth;
@@ -118,7 +118,7 @@ public class ImageLine {
}
/** Sets row number (0 : Rows-1) */
- public void setRown(int n) {
+ public void setRown(final int n) {
this.rown = n;
}
@@ -274,7 +274,7 @@ public class ImageLine {
* The caller must be sure that the original was really packed
*/
public ImageLine unpackToNewImageLine() {
- ImageLine newline = new ImageLine(imgInfo, sampleType, true);
+ final ImageLine newline = new ImageLine(imgInfo, sampleType, true);
if (sampleType == SampleType.INT)
unpackInplaceInt(imgInfo, scanline, newline.scanline, false);
else
@@ -288,7 +288,7 @@ public class ImageLine {
* The caller must be sure that the original was really unpacked
*/
public ImageLine packToNewImageLine() {
- ImageLine newline = new ImageLine(imgInfo, sampleType, false);
+ final ImageLine newline = new ImageLine(imgInfo, sampleType, false);
if (sampleType == SampleType.INT)
packInplaceInt(imgInfo, scanline, newline.scanline, false);
else
@@ -300,7 +300,7 @@ public class ImageLine {
return filterUsed;
}
- public void setFilterUsed(FilterType ft) {
+ public void setFilterUsed(final FilterType ft) {
filterUsed = ft;
}
@@ -323,9 +323,9 @@ public class ImageLine {
/**
* Prints some statistics - just for debugging
*/
- public static void showLineInfo(ImageLine line) {
+ public static void showLineInfo(final ImageLine line) {
System.out.println(line);
- ImageLineStats stats = new ImageLineHelper.ImageLineStats(line);
+ final ImageLineStats stats = new ImageLineHelper.ImageLineStats(line);
System.out.println(stats);
System.out.println(ImageLineHelper.infoFirstLastPixels(line));
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
index 4636c3955..616ccd560 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
@@ -33,28 +33,28 @@ public class ImageLineHelper {
* @return R G B (A), one sample 0-255 per array element. Ready for
* pngw.writeRowInt()
*/
- public static int[] palette2rgb(ImageLine line, PngChunkPLTE pal, PngChunkTRNS trns, int[] buf) {
- boolean isalpha = trns != null;
- int channels = isalpha ? 4 : 3;
- int nsamples = line.imgInfo.cols * channels;
+ public static int[] palette2rgb(ImageLine line, final PngChunkPLTE pal, final PngChunkTRNS trns, int[] buf) {
+ final boolean isalpha = trns != null;
+ final int channels = isalpha ? 4 : 3;
+ final int nsamples = line.imgInfo.cols * channels;
if (buf == null || buf.length < nsamples)
buf = new int[nsamples];
if (!line.samplesUnpacked)
line = line.unpackToNewImageLine();
- boolean isbyte = line.sampleType == SampleType.BYTE;
- int nindexesWithAlpha = trns != null ? trns.getPalletteAlpha().length : 0;
+ final boolean isbyte = line.sampleType == SampleType.BYTE;
+ final int nindexesWithAlpha = trns != null ? trns.getPalletteAlpha().length : 0;
for (int c = 0; c < line.imgInfo.cols; c++) {
- int index = isbyte ? (line.scanlineb[c] & 0xFF) : line.scanline[c];
+ final int index = isbyte ? (line.scanlineb[c] & 0xFF) : line.scanline[c];
pal.getEntryRgb(index, buf, c * channels);
if (isalpha) {
- int alpha = index < nindexesWithAlpha ? trns.getPalletteAlpha()[index] : 255;
+ final int alpha = index < nindexesWithAlpha ? trns.getPalletteAlpha()[index] : 255;
buf[c * channels + 3] = alpha;
}
}
return buf;
}
- public static int[] palette2rgb(ImageLine line, PngChunkPLTE pal, int[] buf) {
+ public static int[] palette2rgb(final ImageLine line, final PngChunkPLTE pal, final int[] buf) {
return palette2rgb(line, pal, null, buf);
}
@@ -65,7 +65,7 @@ public class ImageLineHelper {
* Just for basic info or debugging. Shows values for first and last pixel.
* Does not include alpha
*/
- public static String infoFirstLastPixels(ImageLine line) {
+ public static String infoFirstLastPixels(final ImageLine line) {
return line.imgInfo.channels == 1 ? String.format("first=(%d) last=(%d)", line.scanline[0],
line.scanline[line.scanline.length - 1]) : String.format("first=(%d %d %d) last=(%d %d %d)",
line.scanline[0], line.scanline[1], line.scanline[2], line.scanline[line.scanline.length
@@ -73,8 +73,8 @@ public class ImageLineHelper {
line.scanline[line.scanline.length - line.imgInfo.channels + 2]);
}
- public static String infoFull(ImageLine line) {
- ImageLineStats stats = new ImageLineStats(line);
+ public static String infoFull(final ImageLine line) {
+ final ImageLineStats stats = new ImageLineStats(line);
return "row=" + line.getRown() + " " + stats.toString() + "\n " + infoFirstLastPixels(line);
}
@@ -104,7 +104,7 @@ public class ImageLineHelper {
+ String.format(" maxdif=(%.1f %.1f %.1f %.1f)", maxdif[0], maxdif[1], maxdif[2], maxdif[3]);
}
- public ImageLineStats(ImageLine line) {
+ public ImageLineStats(final ImageLine line) {
this.channels = line.channels;
if (line.channels < 3)
throw new PngjException("ImageLineStats only works for RGB - RGBA");
@@ -146,18 +146,18 @@ public class ImageLineHelper {
* integer packed R G B only for bitdepth=8! (does not check!)
*
**/
- public static int getPixelRGB8(ImageLine line, int column) {
- int offset = column * line.channels;
+ public static int getPixelRGB8(final ImageLine line, final int column) {
+ final int offset = column * line.channels;
return (line.scanline[offset] << 16) + (line.scanline[offset + 1] << 8) + (line.scanline[offset + 2]);
}
- public static int getPixelARGB8(ImageLine line, int column) {
- int offset = column * line.channels;
+ public static int getPixelARGB8(final ImageLine line, final int column) {
+ final int offset = column * line.channels;
return (line.scanline[offset + 3] << 24) + (line.scanline[offset] << 16) + (line.scanline[offset + 1] << 8)
+ (line.scanline[offset + 2]);
}
- public static void setPixelsRGB8(ImageLine line, int[] rgb) {
+ public static void setPixelsRGB8(final ImageLine line, final int[] rgb) {
for (int i = 0, j = 0; i < line.imgInfo.cols; i++) {
line.scanline[j++] = ((rgb[i] >> 16) & 0xFF);
line.scanline[j++] = ((rgb[i] >> 8) & 0xFF);
@@ -165,18 +165,18 @@ public class ImageLineHelper {
}
}
- public static void setPixelRGB8(ImageLine line, int col, int r, int g, int b) {
+ public static void setPixelRGB8(final ImageLine line, int col, final int r, final int g, final int b) {
col *= line.channels;
line.scanline[col++] = r;
line.scanline[col++] = g;
line.scanline[col] = b;
}
- public static void setPixelRGB8(ImageLine line, int col, int rgb) {
+ public static void setPixelRGB8(final ImageLine line, final int col, final int rgb) {
setPixelRGB8(line, col, (rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, rgb & 0xFF);
}
- public static void setPixelsRGBA8(ImageLine line, int[] rgb) {
+ public static void setPixelsRGBA8(final ImageLine line, final int[] rgb) {
for (int i = 0, j = 0; i < line.imgInfo.cols; i++) {
line.scanline[j++] = ((rgb[i] >> 16) & 0xFF);
line.scanline[j++] = ((rgb[i] >> 8) & 0xFF);
@@ -185,7 +185,7 @@ public class ImageLineHelper {
}
}
- public static void setPixelRGBA8(ImageLine line, int col, int r, int g, int b, int a) {
+ public static void setPixelRGBA8(final ImageLine line, int col, final int r, final int g, final int b, final int a) {
col *= line.channels;
line.scanline[col++] = r;
line.scanline[col++] = g;
@@ -193,53 +193,53 @@ public class ImageLineHelper {
line.scanline[col] = a;
}
- public static void setPixelRGBA8(ImageLine line, int col, int rgb) {
+ public static void setPixelRGBA8(final ImageLine line, final int col, final int rgb) {
setPixelRGBA8(line, col, (rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, rgb & 0xFF, (rgb >> 24) & 0xFF);
}
- public static void setValD(ImageLine line, int i, double d) {
+ public static void setValD(final ImageLine line, final int i, final double d) {
line.scanline[i] = double2int(line, d);
}
- public static int interpol(int a, int b, int c, int d, double dx, double dy) {
+ public static int interpol(final int a, final int b, final int c, final int d, final double dx, final double dy) {
// a b -> x (0-1)
// c d
//
- double e = a * (1.0 - dx) + b * dx;
- double f = c * (1.0 - dx) + d * dx;
+ final double e = a * (1.0 - dx) + b * dx;
+ final double f = c * (1.0 - dx) + d * dx;
return (int) (e * (1 - dy) + f * dy + 0.5);
}
- public static double int2double(ImageLine line, int p) {
+ public static double int2double(final ImageLine line, final int p) {
return line.bitDepth == 16 ? p / 65535.0 : p / 255.0;
// TODO: replace my multiplication? check for other bitdepths
}
- public static double int2doubleClamped(ImageLine line, int p) {
+ public static double int2doubleClamped(final ImageLine line, final int p) {
// TODO: replace my multiplication?
- double d = line.bitDepth == 16 ? p / 65535.0 : p / 255.0;
+ final double d = line.bitDepth == 16 ? p / 65535.0 : p / 255.0;
return d <= 0.0 ? 0 : (d >= 1.0 ? 1.0 : d);
}
- public static int double2int(ImageLine line, double d) {
+ public static int double2int(final ImageLine line, double d) {
d = d <= 0.0 ? 0 : (d >= 1.0 ? 1.0 : d);
return line.bitDepth == 16 ? (int) (d * 65535.0 + 0.5) : (int) (d * 255.0 + 0.5); //
}
- public static int double2intClamped(ImageLine line, double d) {
+ public static int double2intClamped(final ImageLine line, double d) {
d = d <= 0.0 ? 0 : (d >= 1.0 ? 1.0 : d);
return line.bitDepth == 16 ? (int) (d * 65535.0 + 0.5) : (int) (d * 255.0 + 0.5); //
}
- public static int clampTo_0_255(int i) {
+ public static int clampTo_0_255(final int i) {
return i > 255 ? 255 : (i < 0 ? 0 : i);
}
- public static int clampTo_0_65535(int i) {
+ public static int clampTo_0_65535(final int i) {
return i > 65535 ? 65535 : (i < 0 ? 0 : i);
}
- public static int clampTo_128_127(int x) {
+ public static int clampTo_128_127(final int x) {
return x > 127 ? 127 : (x < -128 ? -128 : x);
}
@@ -255,9 +255,9 @@ public class ImageLineHelper {
* You probably should use {@link ImageLine#unpackToNewImageLine()}
*
*/
- public static int[] unpack(ImageInfo imgInfo, int[] src, int[] dst, boolean scale) {
- int len1 = imgInfo.samplesPerRow;
- int len0 = imgInfo.samplesPerRowPacked;
+ public static int[] unpack(final ImageInfo imgInfo, final int[] src, int[] dst, final boolean scale) {
+ final int len1 = imgInfo.samplesPerRow;
+ final int len0 = imgInfo.samplesPerRowPacked;
if (dst == null || dst.length < len1)
dst = new int[len1];
if (imgInfo.packed)
@@ -267,9 +267,9 @@ public class ImageLineHelper {
return dst;
}
- public static byte[] unpack(ImageInfo imgInfo, byte[] src, byte[] dst, boolean scale) {
- int len1 = imgInfo.samplesPerRow;
- int len0 = imgInfo.samplesPerRowPacked;
+ public static byte[] unpack(final ImageInfo imgInfo, final byte[] src, byte[] dst, final boolean scale) {
+ final int len1 = imgInfo.samplesPerRow;
+ final int len0 = imgInfo.samplesPerRowPacked;
if (dst == null || dst.length < len1)
dst = new byte[len1];
if (imgInfo.packed)
@@ -286,8 +286,8 @@ public class ImageLineHelper {
*
* You probably should use {@link ImageLine#packToNewImageLine()}
*/
- public static int[] pack(ImageInfo imgInfo, int[] src, int[] dst, boolean scale) {
- int len0 = imgInfo.samplesPerRowPacked;
+ public static int[] pack(final ImageInfo imgInfo, final int[] src, int[] dst, final boolean scale) {
+ final int len0 = imgInfo.samplesPerRowPacked;
if (dst == null || dst.length < len0)
dst = new int[len0];
if (imgInfo.packed)
@@ -297,8 +297,8 @@ public class ImageLineHelper {
return dst;
}
- public static byte[] pack(ImageInfo imgInfo, byte[] src, byte[] dst, boolean scale) {
- int len0 = imgInfo.samplesPerRowPacked;
+ public static byte[] pack(final ImageInfo imgInfo, final byte[] src, byte[] dst, final boolean scale) {
+ final int len0 = imgInfo.samplesPerRowPacked;
if (dst == null || dst.length < len0)
dst = new byte[len0];
if (imgInfo.packed)
@@ -308,7 +308,7 @@ public class ImageLineHelper {
return dst;
}
- static int getMaskForPackedFormats(int bitDepth) { // Utility function for pack/unpack
+ static int getMaskForPackedFormats(final int bitDepth) { // Utility function for pack/unpack
if (bitDepth == 4)
return 0xf0;
else if (bitDepth == 2)
@@ -317,7 +317,7 @@ public class ImageLineHelper {
return 0x80; // bitDepth == 1
}
- static int getMaskForPackedFormatsLs(int bitDepth) { // Utility function for pack/unpack
+ static int getMaskForPackedFormatsLs(final int bitDepth) { // Utility function for pack/unpack
if (bitDepth == 4)
return 0x0f;
else if (bitDepth == 2)
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLines.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLines.java
index fb2cf5910..8f6216ab2 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLines.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLines.java
@@ -36,7 +36,7 @@ public class ImageLines {
* @param nRows
* @param rowStep
*/
- public ImageLines(ImageInfo imgInfo, SampleType stype, boolean unpackedMode, int rowOffset, int nRows, int rowStep) {
+ public ImageLines(final ImageInfo imgInfo, final SampleType stype, final boolean unpackedMode, final int rowOffset, final int nRows, final int rowStep) {
this.imgInfo = imgInfo;
channels = imgInfo.channels;
bitDepth = imgInfo.bitDepth;
@@ -61,8 +61,8 @@ public class ImageLines {
* and rounding down) Eg: rowOffset=4,rowStep=2 imageRowToMatrixRow(17)
* returns 6 , imageRowToMatrixRow(1) returns 0
*/
- public int imageRowToMatrixRow(int imrow) {
- int r = (imrow - rowOffset) / rowStep;
+ public int imageRowToMatrixRow(final int imrow) {
+ final int r = (imrow - rowOffset) / rowStep;
return r < 0 ? 0 : (r < nRows ? r : nRows - 1);
}
@@ -71,7 +71,7 @@ public class ImageLines {
*/
public int imageRowToMatrixRowStrict(int imrow) {
imrow -= rowOffset;
- int mrow = imrow >= 0 && imrow % rowStep == 0 ? imrow / rowStep : -1;
+ final int mrow = imrow >= 0 && imrow % rowStep == 0 ? imrow / rowStep : -1;
return mrow < nRows ? mrow : -1;
}
@@ -82,7 +82,7 @@ public class ImageLines {
* Matrix row number
* @return Image row number. Invalid only if mrow is invalid
*/
- public int matrixRowToImageRow(int mrow) {
+ public int matrixRowToImageRow(final int mrow) {
return mrow * rowStep + rowOffset;
}
@@ -96,10 +96,10 @@ public class ImageLines {
* @return A new ImageLine, backed by the matrix, with the correct ('real')
* rownumber
*/
- public ImageLine getImageLineAtMatrixRow(int mrow) {
+ public ImageLine getImageLineAtMatrixRow(final int mrow) {
if (mrow < 0 || mrow > nRows)
throw new PngjException("Bad row " + mrow + ". Should be positive and less than " + nRows);
- ImageLine imline = sampleType == SampleType.INT ? new ImageLine(imgInfo, sampleType, samplesUnpacked,
+ final ImageLine imline = sampleType == SampleType.INT ? new ImageLine(imgInfo, sampleType, samplesUnpacked,
scanlines[mrow], null) : new ImageLine(imgInfo, sampleType, samplesUnpacked, null, scanlinesb[mrow]);
imline.setRown(matrixRowToImageRow(mrow));
return imline;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngDeinterlacer.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngDeinterlacer.java
index e099c4f6a..436821cf7 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngDeinterlacer.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngDeinterlacer.java
@@ -20,7 +20,7 @@ class PngDeinterlacer {
private short[][] imageShort;
private byte[][] imageByte;
- PngDeinterlacer(ImageInfo iminfo) {
+ PngDeinterlacer(final ImageInfo iminfo) {
this.imi = iminfo;
pass = 0;
if (imi.packed) {
@@ -40,14 +40,14 @@ class PngDeinterlacer {
}
/** this refers to the row currRowSubimg */
- void setRow(int n) {
+ void setRow(final int n) {
currRowSubimg = n;
currRowReal = n * dY + oY;
if (currRowReal < 0 || currRowReal >= imi.rows)
throw new PngjExceptionInternal("bad row - this should not happen");
}
- void setPass(int p) {
+ void setPass(final int p) {
if (this.pass == p)
return;
pass = p;
@@ -105,7 +105,7 @@ class PngDeinterlacer {
}
// notice that this is a "partial" deinterlace, it will be called several times for the same row!
- void deinterlaceInt(int[] src, int[] dst, boolean readInPackedFormat) {
+ void deinterlaceInt(final int[] src, final int[] dst, final boolean readInPackedFormat) {
if (!(imi.packed && readInPackedFormat))
for (int i = 0, j = oXsamples; i < cols * imi.channels; i += imi.channels, j += dXsamples)
for (int k = 0; k < imi.channels; k++)
@@ -115,7 +115,7 @@ class PngDeinterlacer {
}
// interlaced+packed = monster; this is very clumsy!
- private void deinterlaceIntPacked(int[] src, int[] dst) {
+ private void deinterlaceIntPacked(final int[] src, final int[] dst) {
int spos, smod, smask; // source byte position, bits to shift to left (01,2,3,4
int tpos, tmod, p, d;
spos = 0;
@@ -143,7 +143,7 @@ class PngDeinterlacer {
}
// yes, duplication of code is evil, normally
- void deinterlaceByte(byte[] src, byte[] dst, boolean readInPackedFormat) {
+ void deinterlaceByte(final byte[] src, final byte[] dst, final boolean readInPackedFormat) {
if (!(imi.packed && readInPackedFormat))
for (int i = 0, j = oXsamples; i < cols * imi.channels; i += imi.channels, j += dXsamples)
for (int k = 0; k < imi.channels; k++)
@@ -152,7 +152,7 @@ class PngDeinterlacer {
deinterlacePackedByte(src, dst);
}
- private void deinterlacePackedByte(byte[] src, byte[] dst) {
+ private void deinterlacePackedByte(final byte[] src, final byte[] dst) {
int spos, smod, smask; // source byte position, bits to shift to left (01,2,3,4
int tpos, tmod, p, d;
// what the heck are you reading here? I told you would not enjoy this. Try Dostoyevsky or Simone Weil instead
@@ -230,7 +230,7 @@ class PngDeinterlacer {
return imageInt;
}
- void setImageInt(int[][] imageInt) {
+ void setImageInt(final int[][] imageInt) {
this.imageInt = imageInt;
}
@@ -238,7 +238,7 @@ class PngDeinterlacer {
return imageShort;
}
- void setImageShort(short[][] imageShort) {
+ void setImageShort(final short[][] imageShort) {
this.imageShort = imageShort;
}
@@ -246,20 +246,20 @@ class PngDeinterlacer {
return imageByte;
}
- void setImageByte(byte[][] imageByte) {
+ void setImageByte(final byte[][] imageByte) {
this.imageByte = imageByte;
}
static void test() {
- Random rand = new Random();
- PngDeinterlacer ih = new PngDeinterlacer(new ImageInfo(rand.nextInt(35) + 1, rand.nextInt(52) + 1, 8, true));
+ final Random rand = new Random();
+ final PngDeinterlacer ih = new PngDeinterlacer(new ImageInfo(rand.nextInt(35) + 1, rand.nextInt(52) + 1, 8, true));
int np = ih.imi.cols * ih.imi.rows;
System.out.println(ih.imi);
for (int p = 1; p <= 7; p++) {
ih.setPass(p);
for (int row = 0; row < ih.getRows(); row++) {
ih.setRow(row);
- int b = ih.getCols();
+ final int b = ih.getCols();
np -= b;
System.out.printf("Read %d pixels. Pass:%d Realline:%d cols=%d dX=%d oX=%d last:%b\n", b, ih.pass,
ih.currRowReal, ih.cols, ih.dX, ih.oX, ih.isAtLastRow());
@@ -270,7 +270,7 @@ class PngDeinterlacer {
throw new PngjExceptionInternal("wtf??" + ih.imi);
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
test();
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
index 9e64c3eb1..f1bee1957 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
@@ -31,18 +31,18 @@ public class PngHelperInternal {
return new byte[] { -119, 80, 78, 71, 13, 10, 26, 10 };
}
- public static int doubleToInt100000(double d) {
+ public static int doubleToInt100000(final double d) {
return (int) (d * 100000.0 + 0.5);
}
- public static double intToDouble100000(int i) {
+ public static double intToDouble100000(final int i) {
return i / 100000.0;
}
- public static int readByte(InputStream is) {
+ public static int readByte(final InputStream is) {
try {
return is.read();
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjInputException("error reading byte", e);
}
}
@@ -52,14 +52,14 @@ public class PngHelperInternal {
*
* PNG uses "network byte order"
*/
- public static int readInt2(InputStream is) {
+ public static int readInt2(final InputStream is) {
try {
- int b1 = is.read();
- int b2 = is.read();
+ final int b1 = is.read();
+ final int b2 = is.read();
if (b1 == -1 || b2 == -1)
return -1;
return (b1 << 8) + b2;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjInputException("error reading readInt2", e);
}
}
@@ -67,58 +67,58 @@ public class PngHelperInternal {
/**
* -1 if eof
*/
- public static int readInt4(InputStream is) {
+ public static int readInt4(final InputStream is) {
try {
- int b1 = is.read();
- int b2 = is.read();
- int b3 = is.read();
- int b4 = is.read();
+ final int b1 = is.read();
+ final int b2 = is.read();
+ final int b3 = is.read();
+ final int b4 = is.read();
if (b1 == -1 || b2 == -1 || b3 == -1 || b4 == -1)
return -1;
return (b1 << 24) + (b2 << 16) + (b3 << 8) + b4;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjInputException("error reading readInt4", e);
}
}
- public static int readInt1fromByte(byte[] b, int offset) {
+ public static int readInt1fromByte(final byte[] b, final int offset) {
return (b[offset] & 0xff);
}
- public static int readInt2fromBytes(byte[] b, int offset) {
+ public static int readInt2fromBytes(final byte[] b, final int offset) {
return ((b[offset] & 0xff) << 16) | ((b[offset + 1] & 0xff));
}
- public static int readInt4fromBytes(byte[] b, int offset) {
+ public static int readInt4fromBytes(final byte[] b, final int offset) {
return ((b[offset] & 0xff) << 24) | ((b[offset + 1] & 0xff) << 16) | ((b[offset + 2] & 0xff) << 8)
| (b[offset + 3] & 0xff);
}
- public static void writeByte(OutputStream os, byte b) {
+ public static void writeByte(final OutputStream os, final byte b) {
try {
os.write(b);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjOutputException(e);
}
}
- public static void writeInt2(OutputStream os, int n) {
- byte[] temp = { (byte) ((n >> 8) & 0xff), (byte) (n & 0xff) };
+ public static void writeInt2(final OutputStream os, final int n) {
+ final byte[] temp = { (byte) ((n >> 8) & 0xff), (byte) (n & 0xff) };
writeBytes(os, temp);
}
- public static void writeInt4(OutputStream os, int n) {
- byte[] temp = new byte[4];
+ public static void writeInt4(final OutputStream os, final int n) {
+ final byte[] temp = new byte[4];
writeInt4tobytes(n, temp, 0);
writeBytes(os, temp);
}
- public static void writeInt2tobytes(int n, byte[] b, int offset) {
+ public static void writeInt2tobytes(final int n, final byte[] b, final int offset) {
b[offset] = (byte) ((n >> 8) & 0xff);
b[offset + 1] = (byte) (n & 0xff);
}
- public static void writeInt4tobytes(int n, byte[] b, int offset) {
+ public static void writeInt4tobytes(final int n, final byte[] b, final int offset) {
b[offset] = (byte) ((n >> 24) & 0xff);
b[offset + 1] = (byte) ((n >> 16) & 0xff);
b[offset + 2] = (byte) ((n >> 8) & 0xff);
@@ -128,26 +128,26 @@ public class PngHelperInternal {
/**
* guaranteed to read exactly len bytes. throws error if it can't
*/
- public static void readBytes(InputStream is, byte[] b, int offset, int len) {
+ public static void readBytes(final InputStream is, final byte[] b, final int offset, final int len) {
if (len == 0)
return;
try {
int read = 0;
while (read < len) {
- int n = is.read(b, offset + read, len - read);
+ final int n = is.read(b, offset + read, len - read);
if (n < 1)
throw new PngjInputException("error reading bytes, " + n + " !=" + len);
read += n;
}
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjInputException("error reading", e);
}
}
- public static void skipBytes(InputStream is, long len) {
+ public static void skipBytes(final InputStream is, long len) {
try {
while (len > 0) {
- long n1 = is.skip(len);
+ final long n1 = is.skip(len);
if (n1 > 0) {
len -= n1;
} else if (n1 == 0) { // should we retry? lets read one byte
@@ -159,28 +159,28 @@ public class PngHelperInternal {
// negative? this should never happen but...
throw new IOException("skip() returned a negative value ???");
}
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjInputException(e);
}
}
- public static void writeBytes(OutputStream os, byte[] b) {
+ public static void writeBytes(final OutputStream os, final byte[] b) {
try {
os.write(b);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjOutputException(e);
}
}
- public static void writeBytes(OutputStream os, byte[] b, int offset, int n) {
+ public static void writeBytes(final OutputStream os, final byte[] b, final int offset, final int n) {
try {
os.write(b, offset, n);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjOutputException(e);
}
}
- public static void logdebug(String msg) {
+ public static void logdebug(final String msg) {
if (DEBUG)
System.out.println(msg);
}
@@ -198,43 +198,43 @@ public class PngHelperInternal {
}
// / filters
- public static int filterRowNone(int r) {
- return (int) (r & 0xFF);
+ public static int filterRowNone(final int r) {
+ return r & 0xFF;
}
- public static int filterRowSub(int r, int left) {
- return ((int) (r - left) & 0xFF);
+ public static int filterRowSub(final int r, final int left) {
+ return (r - left & 0xFF);
}
- public static int filterRowUp(int r, int up) {
- return ((int) (r - up) & 0xFF);
+ public static int filterRowUp(final int r, final int up) {
+ return (r - up & 0xFF);
}
- public static int filterRowAverage(int r, int left, int up) {
+ public static int filterRowAverage(final int r, final int left, final int up) {
return (r - (left + up) / 2) & 0xFF;
}
- public static int filterRowPaeth(int r, int left, int up, int upleft) { // a = left, b = above, c = upper left
+ public static int filterRowPaeth(final int r, final int left, final int up, final int upleft) { // a = left, b = above, c = upper left
return (r - filterPaethPredictor(left, up, upleft)) & 0xFF;
}
- public static int unfilterRowNone(int r) {
- return (int) (r & 0xFF);
+ public static int unfilterRowNone(final int r) {
+ return r & 0xFF;
}
- public static int unfilterRowSub(int r, int left) {
- return ((int) (r + left) & 0xFF);
+ public static int unfilterRowSub(final int r, final int left) {
+ return (r + left & 0xFF);
}
- public static int unfilterRowUp(int r, int up) {
- return ((int) (r + up) & 0xFF);
+ public static int unfilterRowUp(final int r, final int up) {
+ return (r + up & 0xFF);
}
- public static int unfilterRowAverage(int r, int left, int up) {
+ public static int unfilterRowAverage(final int r, final int left, final int up) {
return (r + (left + up) / 2) & 0xFF;
}
- public static int unfilterRowPaeth(int r, int left, int up, int upleft) { // a = left, b = above, c = upper left
+ public static int unfilterRowPaeth(final int r, final int left, final int up, final int upleft) { // a = left, b = above, c = upper left
return (r + filterPaethPredictor(left, up, upleft)) & 0xFF;
}
@@ -259,11 +259,11 @@ public class PngHelperInternal {
/*
* we put this methods here so as to not pollute the public interface of PngReader
*/
- public final static void initCrcForTests(PngReader pngr) {
+ public final static void initCrcForTests(final PngReader pngr) {
pngr.initCrctest();
}
- public final static long getCrctestVal(PngReader pngr) {
+ public final static long getCrctestVal(final PngReader pngr) {
return pngr.getCrctestVal();
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkInputStream.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkInputStream.java
index cdad09809..cde4b517e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkInputStream.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkInputStream.java
@@ -18,7 +18,7 @@ class PngIDatChunkInputStream extends InputStream {
private final CRC32 crcEngine;
private boolean checkCrc = true;
private int lenLastChunk;
- private byte[] idLastChunk = new byte[4];
+ private final byte[] idLastChunk = new byte[4];
private int toReadThisChunk = 0;
private boolean ended = false;
private long offset; // offset inside whole inputstream (counting bytes before IDAT)
@@ -28,7 +28,7 @@ class PngIDatChunkInputStream extends InputStream {
public final int len;
public final long offset;
- private IdatChunkInfo(int len, long offset) {
+ private IdatChunkInfo(final int len, final long offset) {
this.len = len;
this.offset = offset;
}
@@ -40,7 +40,7 @@ class PngIDatChunkInputStream extends InputStream {
* Constructor must be called just after reading length and id of first IDAT
* chunk
**/
- PngIDatChunkInputStream(InputStream iStream, int lenFirstChunk, long offset) {
+ PngIDatChunkInputStream(final InputStream iStream, final int lenFirstChunk, final long offset) {
this.offset = offset;
inputStream = iStream;
this.lenLastChunk = lenFirstChunk;
@@ -70,10 +70,10 @@ class PngIDatChunkInputStream extends InputStream {
// Those values are left in idLastChunk / lenLastChunk
// Skips empty IDATS
do {
- int crc = PngHelperInternal.readInt4(inputStream); //
+ final int crc = PngHelperInternal.readInt4(inputStream); //
offset += 4;
if (checkCrc) {
- int crccalc = (int) crcEngine.getValue();
+ final int crccalc = (int) crcEngine.getValue();
if (lenLastChunk > 0 && crc != crccalc)
throw new PngjBadCrcException("error reading idat; offset: " + offset);
crcEngine.reset();
@@ -101,7 +101,7 @@ class PngIDatChunkInputStream extends InputStream {
*/
void forceChunkEnd() {
if (!ended) {
- byte[] dummy = new byte[toReadThisChunk];
+ final byte[] dummy = new byte[toReadThisChunk];
PngHelperInternal.readBytes(inputStream, dummy, 0, toReadThisChunk);
if (checkCrc)
crcEngine.update(dummy, 0, toReadThisChunk);
@@ -114,12 +114,12 @@ class PngIDatChunkInputStream extends InputStream {
* ended prematurely. That is our error.
*/
@Override
- public int read(byte[] b, int off, int len) throws IOException {
+ public int read(final byte[] b, final int off, final int len) throws IOException {
if (ended)
return -1; // can happen only when raw reading, see Pngreader.readAndSkipsAllRows()
if (toReadThisChunk == 0)
throw new PngjExceptionInternal("this should not happen");
- int n = inputStream.read(b, off, len >= toReadThisChunk ? toReadThisChunk : len);
+ final int n = inputStream.read(b, off, len >= toReadThisChunk ? toReadThisChunk : len);
if (n > 0) {
if (checkCrc)
crcEngine.update(b, off, n);
@@ -133,7 +133,7 @@ class PngIDatChunkInputStream extends InputStream {
}
@Override
- public int read(byte[] b) throws IOException {
+ public int read(final byte[] b) throws IOException {
return this.read(b, 0, b.length);
}
@@ -141,8 +141,8 @@ class PngIDatChunkInputStream extends InputStream {
public int read() throws IOException {
// PngHelper.logdebug("read() should go here");
// inneficient - but this should be used rarely
- byte[] b1 = new byte[1];
- int r = this.read(b1, 0, 1);
+ final byte[] b1 = new byte[1];
+ final int r = this.read(b1, 0, 1);
return r < 0 ? -1 : (int) b1[0];
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkOutputStream.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkOutputStream.java
index 411d18819..38b500cd3 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkOutputStream.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkOutputStream.java
@@ -13,18 +13,18 @@ class PngIDatChunkOutputStream extends ProgressiveOutputStream {
private static final int SIZE_DEFAULT = 32768; // 32k
private final OutputStream outputStream;
- PngIDatChunkOutputStream(OutputStream outputStream) {
+ PngIDatChunkOutputStream(final OutputStream outputStream) {
this(outputStream, 0);
}
- PngIDatChunkOutputStream(OutputStream outputStream, int size) {
+ PngIDatChunkOutputStream(final OutputStream outputStream, final int size) {
super(size > 0 ? size : SIZE_DEFAULT);
this.outputStream = outputStream;
}
@Override
- protected final void flushBuffer(byte[] b, int len) {
- ChunkRaw c = new ChunkRaw(len, ChunkHelper.b_IDAT, false);
+ protected final void flushBuffer(final byte[] b, final int len) {
+ final ChunkRaw c = new ChunkRaw(len, ChunkHelper.b_IDAT, false);
c.data = b;
c.writeChunk(outputStream);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
index 0412beb8c..f77d4f4e0 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
@@ -100,32 +100,32 @@ public class PngReader {
* error/debug messages
*
*/
- public PngReader(InputStream inputStream, String filenameOrDescription) {
+ public PngReader(final InputStream inputStream, final String filenameOrDescription) {
this.filename = filenameOrDescription == null ? "" : filenameOrDescription;
this.inputStream = inputStream;
this.chunksList = new ChunksList(null);
this.metadata = new PngMetadata(chunksList);
// starts reading: signature
- byte[] pngid = new byte[8];
+ final byte[] pngid = new byte[8];
PngHelperInternal.readBytes(inputStream, pngid, 0, pngid.length);
offset += pngid.length;
if (!Arrays.equals(pngid, PngHelperInternal.getPngIdSignature()))
throw new PngjInputException("Bad PNG signature");
// reads first chunk
currentChunkGroup = ChunksList.CHUNK_GROUP_0_IDHR;
- int clen = PngHelperInternal.readInt4(inputStream);
+ final int clen = PngHelperInternal.readInt4(inputStream);
offset += 4;
if (clen != 13)
throw new PngjInputException("IDHR chunk len != 13 ?? " + clen);
- byte[] chunkid = new byte[4];
+ final byte[] chunkid = new byte[4];
PngHelperInternal.readBytes(inputStream, chunkid, 0, 4);
if (!Arrays.equals(chunkid, ChunkHelper.b_IHDR))
throw new PngjInputException("IHDR not found as first chunk??? [" + ChunkHelper.toString(chunkid) + "]");
offset += 4;
- PngChunkIHDR ihdr = (PngChunkIHDR) readChunk(chunkid, clen, false);
- boolean alpha = (ihdr.getColormodel() & 0x04) != 0;
- boolean palette = (ihdr.getColormodel() & 0x01) != 0;
- boolean grayscale = (ihdr.getColormodel() == 0 || ihdr.getColormodel() == 4);
+ final PngChunkIHDR ihdr = (PngChunkIHDR) readChunk(chunkid, clen, false);
+ final boolean alpha = (ihdr.getColormodel() & 0x04) != 0;
+ final boolean palette = (ihdr.getColormodel() & 0x01) != 0;
+ final boolean grayscale = (ihdr.getColormodel() == 0 || ihdr.getColormodel() == 4);
// creates ImgInfo and imgLine, and allocates buffers
imgInfo = new ImageInfo(ihdr.getCols(), ihdr.getRows(), ihdr.getBitspc(), alpha, grayscale, palette);
interlaced = ihdr.getInterlaced() == 1;
@@ -163,7 +163,7 @@ public class PngReader {
if (currentChunkGroup < ChunksList.CHUNK_GROUP_5_AFTERIDAT) {
try {
idatIstream.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
}
readLastChunks();
}
@@ -174,23 +174,23 @@ public class PngReader {
if (currentChunkGroup < ChunksList.CHUNK_GROUP_6_END) { // this could only happen if forced close
try {
idatIstream.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
}
currentChunkGroup = ChunksList.CHUNK_GROUP_6_END;
}
if (shouldCloseStream) {
try {
inputStream.close();
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new PngjInputException("error closing input stream!", e);
}
}
}
// nbytes: NOT including the filter byte. leaves result in rowb
- private void unfilterRow(int nbytes) {
- int ftn = rowbfilter[0];
- FilterType ft = FilterType.getByVal(ftn);
+ private void unfilterRow(final int nbytes) {
+ final int ftn = rowbfilter[0];
+ final FilterType ft = FilterType.getByVal(ftn);
if (ft == null)
throw new PngjInputException("Filter type " + ftn + " invalid");
switch (ft) {
@@ -226,7 +226,7 @@ public class PngReader {
private void unfilterRowNone(final int nbytes) {
for (int i = 1; i <= nbytes; i++) {
- rowb[i] = (byte) (rowbfilter[i]);
+ rowb[i] = (rowbfilter[i]);
}
}
@@ -242,7 +242,7 @@ public class PngReader {
private void unfilterRowSub(final int nbytes) {
int i, j;
for (i = 1; i <= imgInfo.bytesPixel; i++) {
- rowb[i] = (byte) (rowbfilter[i]);
+ rowb[i] = (rowbfilter[i]);
}
for (j = 1, i = imgInfo.bytesPixel + 1; i <= nbytes; i++, j++) {
rowb[i] = (byte) (rowbfilter[i] + rowb[j]);
@@ -276,7 +276,7 @@ public class PngReader {
return;
int clen = 0;
boolean found = false;
- byte[] chunkid = new byte[4]; // it's important to reallocate in each iteration
+ final byte[] chunkid = new byte[4]; // it's important to reallocate in each iteration
currentChunkGroup = ChunksList.CHUNK_GROUP_1_AFTERIDHR;
while (!found) {
clen = PngHelperInternal.readInt4(inputStream);
@@ -300,7 +300,7 @@ public class PngReader {
if (Arrays.equals(chunkid, ChunkHelper.b_PLTE))
currentChunkGroup = ChunksList.CHUNK_GROUP_3_AFTERPLTE;
}
- int idatLen = found ? clen : -1;
+ final int idatLen = found ? clen : -1;
if (idatLen < 0)
throw new PngjInputException("first idat chunk not found!");
iIdatCstream = new PngIDatChunkInputStream(inputStream, idatLen, offset);
@@ -323,7 +323,7 @@ public class PngReader {
if (!iIdatCstream.isEnded())
iIdatCstream.forceChunkEnd();
int clen = iIdatCstream.getLenLastChunk();
- byte[] chunkid = iIdatCstream.getIdLastChunk();
+ final byte[] chunkid = iIdatCstream.getIdLastChunk();
boolean endfound = false;
boolean first = true;
boolean skip = false;
@@ -355,14 +355,14 @@ public class PngReader {
* Reads chunkd from input stream, adds to ChunksList, and returns it. If
* it's skipped, a PngChunkSkipped object is created
*/
- private PngChunk readChunk(byte[] chunkid, int clen, boolean skipforced) {
+ private PngChunk readChunk(final byte[] chunkid, final int clen, final boolean skipforced) {
if (clen < 0)
throw new PngjInputException("invalid chunk lenght: " + clen);
// skipChunksByIdSet is created lazyly, if fist IHDR has already been read
if (skipChunkIdsSet == null && currentChunkGroup > ChunksList.CHUNK_GROUP_0_IDHR)
skipChunkIdsSet = new HashSet<String>(Arrays.asList(skipChunkIds));
- String chunkidstr = ChunkHelper.toString(chunkid);
- boolean critical = ChunkHelper.isCritical(chunkidstr);
+ final String chunkidstr = ChunkHelper.toString(chunkid);
+ final boolean critical = ChunkHelper.isCritical(chunkidstr);
PngChunk pngChunk = null;
boolean skip = skipforced;
if (maxTotalBytesRead > 0 && clen + offset > maxTotalBytesRead)
@@ -379,7 +379,7 @@ public class PngReader {
// clen + 4) for risk of overflow
pngChunk = new PngChunkSkipped(chunkidstr, imgInfo, clen);
} else {
- ChunkRaw chunk = new ChunkRaw(clen, chunkid, true);
+ final ChunkRaw chunk = new ChunkRaw(clen, chunkid, true);
chunk.readChunkData(inputStream, crcEnabled || critical);
pngChunk = PngChunk.factory(chunk, imgInfo);
if (!pngChunk.crit)
@@ -398,7 +398,7 @@ public class PngReader {
* <p>
* This happens rarely - most errors are fatal.
*/
- protected void logWarn(String warn) {
+ protected void logWarn(final String warn) {
System.err.println(warn);
}
@@ -415,7 +415,7 @@ public class PngReader {
* @param chunkLoadBehaviour
* {@link ChunkLoadBehaviour}
*/
- public void setChunkLoadBehaviour(ChunkLoadBehaviour chunkLoadBehaviour) {
+ public void setChunkLoadBehaviour(final ChunkLoadBehaviour chunkLoadBehaviour) {
this.chunkLoadBehaviour = chunkLoadBehaviour;
}
@@ -459,7 +459,7 @@ public class PngReader {
*
* @see #readRowInt(int) {@link #readRowByte(int)}
*/
- public ImageLine readRow(int nrow) {
+ public ImageLine readRow(final int nrow) {
if (imgLine == null)
imgLine = new ImageLine(imgInfo, SampleType.INT, unpackedMode);
return imgLine.sampleType != SampleType.BYTE ? readRowInt(nrow) : readRowByte(nrow);
@@ -476,7 +476,7 @@ public class PngReader {
* @return ImageLine object, also available as field. Data is in
* {@link ImageLine#scanline} (int) field.
*/
- public ImageLine readRowInt(int nrow) {
+ public ImageLine readRowInt(final int nrow) {
if (imgLine == null)
imgLine = new ImageLine(imgInfo, SampleType.INT, unpackedMode);
if (imgLine.getRown() == nrow) // already read
@@ -499,7 +499,7 @@ public class PngReader {
* @return ImageLine object, also available as field. Data is in
* {@link ImageLine#scanlineb} (byte) field.
*/
- public ImageLine readRowByte(int nrow) {
+ public ImageLine readRowByte(final int nrow) {
if (imgLine == null)
imgLine = new ImageLine(imgInfo, SampleType.BYTE, unpackedMode);
if (imgLine.getRown() == nrow) // already read
@@ -513,7 +513,7 @@ public class PngReader {
/**
* @see #readRowInt(int[], int)
*/
- public final int[] readRow(int[] buffer, final int nrow) {
+ public final int[] readRow(final int[] buffer, final int nrow) {
return readRowInt(buffer, nrow);
}
@@ -596,11 +596,11 @@ public class PngReader {
* @deprecated Now {@link #readRow(int)} implements the same funcion. This
* method will be removed in future releases
*/
- public ImageLine getRow(int nrow) {
+ public ImageLine getRow(final int nrow) {
return readRow(nrow);
}
- private void decodeLastReadRowToInt(int[] buffer, int bytesRead) {
+ private void decodeLastReadRowToInt(final int[] buffer, final int bytesRead) {
if (imgInfo.bitDepth <= 8)
for (int i = 0, j = 1; i < bytesRead; i++)
buffer[i] = (rowb[j++] & 0xFF); // http://www.libpng.org/pub/png/spec/1.2/PNG-DataRep.html
@@ -611,7 +611,7 @@ public class PngReader {
ImageLine.unpackInplaceInt(imgInfo, buffer, buffer, false);
}
- private void decodeLastReadRowToByte(byte[] buffer, int bytesRead) {
+ private void decodeLastReadRowToByte(final byte[] buffer, final int bytesRead) {
if (imgInfo.bitDepth <= 8)
System.arraycopy(rowb, 1, buffer, 0, bytesRead);
else
@@ -644,27 +644,27 @@ public class PngReader {
* even/odd lines, etc
* @return Set of lines as a ImageLines, which wraps a matrix
*/
- public ImageLines readRowsInt(int rowOffset, int nRows, int rowStep) {
+ public ImageLines readRowsInt(final int rowOffset, int nRows, final int rowStep) {
if (nRows < 0)
nRows = (imgInfo.rows - rowOffset) / rowStep;
if (rowStep < 1 || rowOffset < 0 || nRows * rowStep + rowOffset > imgInfo.rows)
throw new PngjInputException("bad args");
- ImageLines imlines = new ImageLines(imgInfo, SampleType.INT, unpackedMode, rowOffset, nRows, rowStep);
+ final ImageLines imlines = new ImageLines(imgInfo, SampleType.INT, unpackedMode, rowOffset, nRows, rowStep);
if (!interlaced) {
for (int j = 0; j < imgInfo.rows; j++) {
- int bytesread = readRowRaw(j); // read and perhaps discards
- int mrow = imlines.imageRowToMatrixRowStrict(j);
+ final int bytesread = readRowRaw(j); // read and perhaps discards
+ final int mrow = imlines.imageRowToMatrixRowStrict(j);
if (mrow >= 0)
decodeLastReadRowToInt(imlines.scanlines[mrow], bytesread);
}
} else { // and now, for something completely different (interlaced)
- int[] buf = new int[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
+ final int[] buf = new int[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
for (int p = 1; p <= 7; p++) {
deinterlacer.setPass(p);
for (int i = 0; i < deinterlacer.getRows(); i++) {
- int bytesread = readRowRaw(i);
- int j = deinterlacer.getCurrRowReal();
- int mrow = imlines.imageRowToMatrixRowStrict(j);
+ final int bytesread = readRowRaw(i);
+ final int j = deinterlacer.getCurrRowReal();
+ final int mrow = imlines.imageRowToMatrixRowStrict(j);
if (mrow >= 0) {
decodeLastReadRowToInt(buf, bytesread);
deinterlacer.deinterlaceInt(buf, imlines.scanlines[mrow], !unpackedMode);
@@ -709,27 +709,27 @@ public class PngReader {
* even/odd lines, etc
* @return Set of lines as a matrix
*/
- public ImageLines readRowsByte(int rowOffset, int nRows, int rowStep) {
+ public ImageLines readRowsByte(final int rowOffset, int nRows, final int rowStep) {
if (nRows < 0)
nRows = (imgInfo.rows - rowOffset) / rowStep;
if (rowStep < 1 || rowOffset < 0 || nRows * rowStep + rowOffset > imgInfo.rows)
throw new PngjInputException("bad args");
- ImageLines imlines = new ImageLines(imgInfo, SampleType.BYTE, unpackedMode, rowOffset, nRows, rowStep);
+ final ImageLines imlines = new ImageLines(imgInfo, SampleType.BYTE, unpackedMode, rowOffset, nRows, rowStep);
if (!interlaced) {
for (int j = 0; j < imgInfo.rows; j++) {
- int bytesread = readRowRaw(j); // read and perhaps discards
- int mrow = imlines.imageRowToMatrixRowStrict(j);
+ final int bytesread = readRowRaw(j); // read and perhaps discards
+ final int mrow = imlines.imageRowToMatrixRowStrict(j);
if (mrow >= 0)
decodeLastReadRowToByte(imlines.scanlinesb[mrow], bytesread);
}
} else { // and now, for something completely different (interlaced)
- byte[] buf = new byte[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
+ final byte[] buf = new byte[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
for (int p = 1; p <= 7; p++) {
deinterlacer.setPass(p);
for (int i = 0; i < deinterlacer.getRows(); i++) {
- int bytesread = readRowRaw(i);
- int j = deinterlacer.getCurrRowReal();
- int mrow = imlines.imageRowToMatrixRowStrict(j);
+ final int bytesread = readRowRaw(i);
+ final int j = deinterlacer.getCurrRowReal();
+ final int mrow = imlines.imageRowToMatrixRowStrict(j);
if (mrow >= 0) {
decodeLastReadRowToByte(buf, bytesread);
deinterlacer.deinterlaceByte(buf, imlines.scanlinesb[mrow], !unpackedMode);
@@ -784,7 +784,7 @@ public class PngReader {
}
rowNum = nrow;
// swap buffers
- byte[] tmp = rowb;
+ final byte[] tmp = rowb;
rowb = rowbprev;
rowbprev = tmp;
// loads in rowbfilter "raw" bytes, with filter
@@ -821,7 +821,7 @@ public class PngReader {
do {
r = iIdatCstream.read(rowbfilter, 0, buffersLen);
} while (r >= 0);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjInputException("error in raw read of IDAT", e);
}
offset = iIdatCstream.getOffset();
@@ -838,7 +838,7 @@ public class PngReader {
* These are the bytes read (not loaded) in the input stream. If exceeded,
* an exception will be thrown.
*/
- public void setMaxTotalBytesRead(long maxTotalBytesToRead) {
+ public void setMaxTotalBytesRead(final long maxTotalBytesToRead) {
this.maxTotalBytesRead = maxTotalBytesToRead;
}
@@ -854,7 +854,7 @@ public class PngReader {
* default: 5Mb).<br>
* If exceeded, some chunks will be skipped
*/
- public void setMaxBytesMetadata(int maxBytesChunksToLoad) {
+ public void setMaxBytesMetadata(final int maxBytesChunksToLoad) {
this.maxBytesMetadata = maxBytesChunksToLoad;
}
@@ -872,7 +872,7 @@ public class PngReader {
* checked) and the chunk will be saved as a PngChunkSkipped object. See
* also setSkipChunkIds
*/
- public void setSkipChunkMaxSize(int skipChunksBySize) {
+ public void setSkipChunkMaxSize(final int skipChunksBySize) {
this.skipChunkMaxSize = skipChunksBySize;
}
@@ -888,7 +888,7 @@ public class PngReader {
* These chunks will be skipped (the CRC will not be checked) and the chunk
* will be saved as a PngChunkSkipped object. See also setSkipChunkMaxSize
*/
- public void setSkipChunkIds(String[] skipChunksById) {
+ public void setSkipChunkIds(final String[] skipChunksById) {
this.skipChunkIds = skipChunksById == null ? new String[] {} : skipChunksById;
}
@@ -904,7 +904,7 @@ public class PngReader {
* <p>
* default=true
*/
- public void setShouldCloseStream(boolean shouldCloseStream) {
+ public void setShouldCloseStream(final boolean shouldCloseStream) {
this.shouldCloseStream = shouldCloseStream;
}
@@ -936,7 +936,7 @@ public class PngReader {
*
* @param unPackedMode
*/
- public void setUnpackedMode(boolean unPackedMode) {
+ public void setUnpackedMode(final boolean unPackedMode) {
this.unpackedMode = unPackedMode;
}
@@ -954,7 +954,7 @@ public class PngReader {
*
* @param other A PngReader that has already finished reading pixels. Can be null.
*/
- public void reuseBuffersFrom(PngReader other) {
+ public void reuseBuffersFrom(final PngReader other) {
if(other==null) return;
if (other.currentChunkGroup < ChunksList.CHUNK_GROUP_5_AFTERIDAT)
throw new PngjInputException("PngReader to be reused have not yet ended reading pixels");
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
index 2f475aab1..ed5dd7d69 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
@@ -64,7 +64,7 @@ public class PngWriter {
*/
private int deflaterStrategy = Deflater.FILTERED;
- private int[] histox = new int[256]; // auxiliar buffer, only used by reportResultsForFilter
+ private final int[] histox = new int[256]; // auxiliar buffer, only used by reportResultsForFilter
private int idatMaxSize = 0; // 0=use default (PngIDatChunkOutputStream 32768)
@@ -78,7 +78,7 @@ public class PngWriter {
// this only influences the 1-2-4 bitdepth format - and if we pass a ImageLine to writeRow, this is ignored
private boolean unpackedMode = false;
- public PngWriter(OutputStream outputStream, ImageInfo imgInfo) {
+ public PngWriter(final OutputStream outputStream, final ImageInfo imgInfo) {
this(outputStream, imgInfo, "[NO FILENAME AVAILABLE]");
}
@@ -96,7 +96,7 @@ public class PngWriter {
* @param filenameOrDescription
* Optional, just for error/debug messages
*/
- public PngWriter(OutputStream outputStream, ImageInfo imgInfo, String filenameOrDescription) {
+ public PngWriter(final OutputStream outputStream, final ImageInfo imgInfo, final String filenameOrDescription) {
this.filename = filenameOrDescription == null ? "" : filenameOrDescription;
this.os = outputStream;
this.imgInfo = imgInfo;
@@ -111,29 +111,29 @@ public class PngWriter {
private void init() {
datStream = new PngIDatChunkOutputStream(this.os, idatMaxSize);
- Deflater def = new Deflater(compLevel);
+ final Deflater def = new Deflater(compLevel);
def.setStrategy(deflaterStrategy);
datStreamDeflated = new DeflaterOutputStream(datStream, def);
writeSignatureAndIHDR();
writeFirstChunks();
}
- private void reportResultsForFilter(int rown, FilterType type, boolean tentative) {
+ private void reportResultsForFilter(final int rown, final FilterType type, final boolean tentative) {
Arrays.fill(histox, 0);
int s = 0, v;
for (int i = 1; i <= imgInfo.bytesPerRow; i++) {
v = rowbfilter[i];
if (v < 0)
- s -= (int) v;
+ s -= v;
else
- s += (int) v;
+ s += v;
histox[v & 0xFF]++;
}
filterStrat.fillResultsForFilter(rown, type, s, histox, tentative);
}
private void writeEndChunk() {
- PngChunkIEND c = new PngChunkIEND(imgInfo);
+ final PngChunkIEND c = new PngChunkIEND(imgInfo);
c.createRawChunk().writeChunk(os);
}
@@ -156,7 +156,7 @@ public class PngWriter {
currentChunkGroup = ChunksList.CHUNK_GROUP_5_AFTERIDAT;
chunksList.writeChunks(os, currentChunkGroup);
// should not be unwriten chunks
- List<PngChunk> pending = chunksList.getQueuedChunks();
+ final List<PngChunk> pending = chunksList.getQueuedChunks();
if (!pending.isEmpty())
throw new PngjOutputException(pending.size() + " chunks were not written! Eg: " + pending.get(0).toString());
currentChunkGroup = ChunksList.CHUNK_GROUP_6_END;
@@ -169,7 +169,7 @@ public class PngWriter {
currentChunkGroup = ChunksList.CHUNK_GROUP_0_IDHR;
PngHelperInternal.writeBytes(os, PngHelperInternal.getPngIdSignature()); // signature
- PngChunkIHDR ihdr = new PngChunkIHDR(imgInfo);
+ final PngChunkIHDR ihdr = new PngChunkIHDR(imgInfo);
// http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html
ihdr.setCols(imgInfo.cols);
ihdr.setRows(imgInfo.rows);
@@ -189,16 +189,16 @@ public class PngWriter {
}
- protected void encodeRowFromByte(byte[] row) {
+ protected void encodeRowFromByte(final byte[] row) {
if (row.length == imgInfo.samplesPerRowPacked) {
// some duplication of code - because this case is typical and it works faster this way
int j = 1;
if (imgInfo.bitDepth <= 8) {
- for (byte x : row) { // optimized
+ for (final byte x : row) { // optimized
rowb[j++] = x;
}
} else { // 16 bitspc
- for (byte x : row) { // optimized
+ for (final byte x : row) { // optimized
rowb[j] = x;
j += 2;
}
@@ -221,17 +221,17 @@ public class PngWriter {
}
}
- protected void encodeRowFromInt(int[] row) {
+ protected void encodeRowFromInt(final int[] row) {
// http://www.libpng.org/pub/png/spec/1.2/PNG-DataRep.html
if (row.length == imgInfo.samplesPerRowPacked) {
// some duplication of code - because this case is typical and it works faster this way
int j = 1;
if (imgInfo.bitDepth <= 8) {
- for (int x : row) { // optimized
+ for (final int x : row) { // optimized
rowb[j++] = (byte) x;
}
} else { // 16 bitspc
- for (int x : row) { // optimized
+ for (final int x : row) { // optimized
rowb[j++] = (byte) (x >> 8);
rowb[j++] = (byte) (x);
}
@@ -253,7 +253,7 @@ public class PngWriter {
}
}
- private void filterRow(int rown) {
+ private void filterRow(final int rown) {
// warning: filters operation rely on: "previos row" (rowbprev) is
// initialized to 0 the first time
if (filterStrat.shouldTestAll(rown)) {
@@ -268,7 +268,7 @@ public class PngWriter {
filterRowPaeth();
reportResultsForFilter(rown, FilterType.FILTER_PAETH, true);
}
- FilterType filterType = filterStrat.gimmeFilterType(rown, true);
+ final FilterType filterType = filterStrat.gimmeFilterType(rown, true);
rowbfilter[0] = (byte) filterType.val;
switch (filterType) {
case FILTER_NONE:
@@ -292,23 +292,23 @@ public class PngWriter {
reportResultsForFilter(rown, filterType, false);
}
- private void prepareEncodeRow(int rown) {
+ private void prepareEncodeRow(final int rown) {
if (datStream == null)
init();
rowNum++;
if (rown >= 0 && rowNum != rown)
throw new PngjOutputException("rows must be written in order: expected:" + rowNum + " passed:" + rown);
// swap
- byte[] tmp = rowb;
+ final byte[] tmp = rowb;
rowb = rowbprev;
rowbprev = tmp;
}
- private void filterAndSend(int rown) {
+ private void filterAndSend(final int rown) {
filterRow(rown);
try {
datStreamDeflated.write(rowbfilter, 0, imgInfo.bytesPerRow + 1);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjOutputException(e);
}
}
@@ -323,7 +323,7 @@ public class PngWriter {
protected void filterRowNone() {
for (int i = 1; i <= imgInfo.bytesPerRow; i++) {
- rowbfilter[i] = (byte) rowb[i];
+ rowbfilter[i] = rowb[i];
}
}
@@ -341,7 +341,7 @@ public class PngWriter {
protected void filterRowSub() {
int i, j;
for (i = 1; i <= imgInfo.bytesPixel; i++)
- rowbfilter[i] = (byte) rowb[i];
+ rowbfilter[i] = rowb[i];
for (j = 1, i = imgInfo.bytesPixel + 1; i <= imgInfo.bytesPerRow; i++, j++) {
// !!! rowbfilter[i] = (byte) (rowb[i] - rowb[j]);
rowbfilter[i] = (byte) PngHelperInternal.filterRowSub(rowb[i], rowb[j]);
@@ -359,9 +359,9 @@ public class PngWriter {
int s = 0;
for (int i = 1; i <= imgInfo.bytesPerRow; i++)
if (rowbfilter[i] < 0)
- s -= (int) rowbfilter[i];
+ s -= rowbfilter[i];
else
- s += (int) rowbfilter[i];
+ s += rowbfilter[i];
return s;
}
@@ -372,12 +372,12 @@ public class PngWriter {
* <p>
* TODO: this should be more customizable
*/
- private void copyChunks(PngReader reader, int copy_mask, boolean onlyAfterIdat) {
- boolean idatDone = currentChunkGroup >= ChunksList.CHUNK_GROUP_4_IDAT;
+ private void copyChunks(final PngReader reader, final int copy_mask, final boolean onlyAfterIdat) {
+ final boolean idatDone = currentChunkGroup >= ChunksList.CHUNK_GROUP_4_IDAT;
if (onlyAfterIdat && reader.getCurrentChunkGroup() < ChunksList.CHUNK_GROUP_6_END)
throw new PngjExceptionInternal("tried to copy last chunks but reader has not ended");
- for (PngChunk chunk : reader.getChunksList().getChunks()) {
- int group = chunk.getChunkGroup();
+ for (final PngChunk chunk : reader.getChunksList().getChunks()) {
+ final int group = chunk.getChunkGroup();
if (group < ChunksList.CHUNK_GROUP_4_IDAT && idatDone)
continue;
boolean copy = false;
@@ -389,8 +389,8 @@ public class PngWriter {
copy = true;
}
} else { // ancillary
- boolean text = (chunk instanceof PngChunkTextVar);
- boolean safe = chunk.safe;
+ final boolean text = (chunk instanceof PngChunkTextVar);
+ final boolean safe = chunk.safe;
// notice that these if are not exclusive
if (ChunkHelper.maskMatch(copy_mask, ChunkCopyBehaviour.COPY_ALL))
copy = true;
@@ -429,7 +429,7 @@ public class PngWriter {
* : Mask bit (OR), see <code>ChunksToWrite.COPY_XXX</code>
* constants
*/
- public void copyChunksFirst(PngReader reader, int copy_mask) {
+ public void copyChunksFirst(final PngReader reader, final int copy_mask) {
copyChunks(reader, copy_mask, false);
}
@@ -446,7 +446,7 @@ public class PngWriter {
* : Mask bit (OR), see <code>ChunksToWrite.COPY_XXX</code>
* constants
*/
- public void copyChunksLast(PngReader reader, int copy_mask) {
+ public void copyChunksLast(final PngReader reader, final int copy_mask) {
copyChunks(reader, copy_mask, true);
}
@@ -461,8 +461,8 @@ public class PngWriter {
public double computeCompressionRatio() {
if (currentChunkGroup < ChunksList.CHUNK_GROUP_6_END)
throw new PngjOutputException("must be called after end()");
- double compressed = (double) datStream.getCountFlushed();
- double raw = (imgInfo.bytesPerRow + 1) * imgInfo.rows;
+ final double compressed = datStream.getCountFlushed();
+ final double raw = (imgInfo.bytesPerRow + 1) * imgInfo.rows;
return compressed / raw;
}
@@ -480,7 +480,7 @@ public class PngWriter {
writeEndChunk();
if (shouldCloseStream)
os.close();
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjOutputException(e);
}
}
@@ -516,7 +516,7 @@ public class PngWriter {
* @param compLevel
* between 0 and 9 (default:6 , recommended: 6 or more)
*/
- public void setCompLevel(int compLevel) {
+ public void setCompLevel(final int compLevel) {
if (compLevel < 0 || compLevel > 9)
throw new PngjOutputException("Compression level invalid (" + compLevel + ") Must be 0..9");
this.compLevel = compLevel;
@@ -534,7 +534,7 @@ public class PngWriter {
* <code>PngFilterType</code>) Recommended values: DEFAULT
* (default) or AGGRESIVE
*/
- public void setFilterType(FilterType filterType) {
+ public void setFilterType(final FilterType filterType) {
filterStrat = new FilterWriteStrategy(imgInfo, filterType);
}
@@ -546,7 +546,7 @@ public class PngWriter {
* @param idatMaxSize
* default=0 : use defaultSize (32K)
*/
- public void setIdatMaxSize(int idatMaxSize) {
+ public void setIdatMaxSize(final int idatMaxSize) {
this.idatMaxSize = idatMaxSize;
}
@@ -555,7 +555,7 @@ public class PngWriter {
* <p>
* default=true
*/
- public void setShouldCloseStream(boolean shouldCloseStream) {
+ public void setShouldCloseStream(final boolean shouldCloseStream) {
this.shouldCloseStream = shouldCloseStream;
}
@@ -565,7 +565,7 @@ public class PngWriter {
* <p>
* Default: Deflater.FILTERED . This should be changed very rarely.
*/
- public void setDeflaterStrategy(int deflaterStrategy) {
+ public void setDeflaterStrategy(final int deflaterStrategy) {
this.deflaterStrategy = deflaterStrategy;
}
@@ -575,7 +575,7 @@ public class PngWriter {
*
* @deprecated Better use writeRow(ImageLine imgline, int rownumber)
*/
- public void writeRow(ImageLine imgline) {
+ public void writeRow(final ImageLine imgline) {
writeRow(imgline.scanline, imgline.getRown());
}
@@ -586,7 +586,7 @@ public class PngWriter {
*
* @see #writeRowInt(int[], int)
*/
- public void writeRow(ImageLine imgline, int rownumber) {
+ public void writeRow(final ImageLine imgline, final int rownumber) {
unpackedMode = imgline.samplesUnpacked;
if (imgline.sampleType == SampleType.INT)
writeRowInt(imgline.scanline, rownumber);
@@ -599,7 +599,7 @@ public class PngWriter {
*
* @param newrow
*/
- public void writeRow(int[] newrow) {
+ public void writeRow(final int[] newrow) {
writeRow(newrow, -1);
}
@@ -608,7 +608,7 @@ public class PngWriter {
*
* @see #writeRowInt(int[], int)
*/
- public void writeRow(int[] newrow, int rown) {
+ public void writeRow(final int[] newrow, final int rown) {
writeRowInt(newrow, rown);
}
@@ -632,7 +632,7 @@ public class PngWriter {
* Row number, from 0 (top) to rows-1 (bottom). This is just used
* as a check. Pass -1 if you want to autocompute it
*/
- public void writeRowInt(int[] newrow, int rown) {
+ public void writeRowInt(final int[] newrow, final int rown) {
prepareEncodeRow(rown);
encodeRowFromInt(newrow);
filterAndSend(rown);
@@ -645,7 +645,7 @@ public class PngWriter {
*
* @see PngWriter#writeRowInt(int[], int)
*/
- public void writeRowByte(byte[] newrow, int rown) {
+ public void writeRowByte(final byte[] newrow, final int rown) {
prepareEncodeRow(rown);
encodeRowFromByte(newrow);
filterAndSend(rown);
@@ -654,7 +654,7 @@ public class PngWriter {
/**
* Writes all the pixels, calling writeRowInt() for each image row
*/
- public void writeRowsInt(int[][] image) {
+ public void writeRowsInt(final int[][] image) {
for (int i = 0; i < imgInfo.rows; i++)
writeRowInt(image[i], i);
}
@@ -662,7 +662,7 @@ public class PngWriter {
/**
* Writes all the pixels, calling writeRowByte() for each image row
*/
- public void writeRowsByte(byte[][] image) {
+ public void writeRowsByte(final byte[][] image) {
for (int i = 0; i < imgInfo.rows; i++)
writeRowByte(image[i], i);
}
@@ -682,7 +682,7 @@ public class PngWriter {
* <tt>packed</tt> flag of the ImageLine object overrides (and overwrites!)
* this field.
*/
- public void setUseUnPackedMode(boolean useUnpackedMode) {
+ public void setUseUnPackedMode(final boolean useUnpackedMode) {
this.unpackedMode = useUnpackedMode;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java
index 3b74f862f..032b2ed3a 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java
@@ -6,15 +6,15 @@ package jogamp.opengl.util.pngj;
public class PngjBadCrcException extends PngjInputException {
private static final long serialVersionUID = 1L;
- public PngjBadCrcException(String message, Throwable cause) {
+ public PngjBadCrcException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjBadCrcException(String message) {
+ public PngjBadCrcException(final String message) {
super(message);
}
- public PngjBadCrcException(Throwable cause) {
+ public PngjBadCrcException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
index 97e24fc73..3d05589b1 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
@@ -9,15 +9,15 @@ package jogamp.opengl.util.pngj;
public class PngjException extends RuntimeException {
private static final long serialVersionUID = 1L;
- public PngjException(String message, Throwable cause) {
+ public PngjException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjException(String message) {
+ public PngjException(final String message) {
super(message);
}
- public PngjException(Throwable cause) {
+ public PngjException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
index 5da70de7b..9484abf5e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
@@ -10,15 +10,15 @@ package jogamp.opengl.util.pngj;
public class PngjExceptionInternal extends RuntimeException {
private static final long serialVersionUID = 1L;
- public PngjExceptionInternal(String message, Throwable cause) {
+ public PngjExceptionInternal(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjExceptionInternal(String message) {
+ public PngjExceptionInternal(final String message) {
super(message);
}
- public PngjExceptionInternal(Throwable cause) {
+ public PngjExceptionInternal(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java
index 5cc36b99a..c92d80b2c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java
@@ -6,15 +6,15 @@ package jogamp.opengl.util.pngj;
public class PngjInputException extends PngjException {
private static final long serialVersionUID = 1L;
- public PngjInputException(String message, Throwable cause) {
+ public PngjInputException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjInputException(String message) {
+ public PngjInputException(final String message) {
super(message);
}
- public PngjInputException(Throwable cause) {
+ public PngjInputException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java
index c8cd36acb..4e9cdc950 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java
@@ -6,15 +6,15 @@ package jogamp.opengl.util.pngj;
public class PngjOutputException extends PngjException {
private static final long serialVersionUID = 1L;
- public PngjOutputException(String message, Throwable cause) {
+ public PngjOutputException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjOutputException(String message) {
+ public PngjOutputException(final String message) {
super(message);
}
- public PngjOutputException(Throwable cause) {
+ public PngjOutputException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java
index f68458d19..e68b153ac 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java
@@ -11,15 +11,15 @@ public class PngjUnsupportedException extends RuntimeException {
super();
}
- public PngjUnsupportedException(String message, Throwable cause) {
+ public PngjUnsupportedException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjUnsupportedException(String message) {
+ public PngjUnsupportedException(final String message) {
super(message);
}
- public PngjUnsupportedException(Throwable cause) {
+ public PngjUnsupportedException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java b/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java
index 4516a0886..248472298 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java
@@ -11,7 +11,7 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
private final int size;
private long countFlushed = 0;
- public ProgressiveOutputStream(int size) {
+ public ProgressiveOutputStream(final int size) {
this.size = size;
}
@@ -28,19 +28,19 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
}
@Override
- public final void write(byte[] b, int off, int len) {
+ public final void write(final byte[] b, final int off, final int len) {
super.write(b, off, len);
checkFlushBuffer(false);
}
@Override
- public final void write(byte[] b) throws IOException {
+ public final void write(final byte[] b) throws IOException {
super.write(b);
checkFlushBuffer(false);
}
@Override
- public final void write(int arg0) {
+ public final void write(final int arg0) {
super.write(arg0);
checkFlushBuffer(false);
}
@@ -54,7 +54,7 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
* if it's time to flush data (or if forced==true) calls abstract method
* flushBuffer() and cleans those bytes from own buffer
*/
- private final void checkFlushBuffer(boolean forced) {
+ private final void checkFlushBuffer(final boolean forced) {
while (forced || count >= size) {
int nb = size;
if (nb > count)
@@ -63,7 +63,7 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
return;
flushBuffer(buf, nb);
countFlushed += nb;
- int bytesleft = count - nb;
+ final int bytesleft = count - nb;
count = bytesleft;
if (bytesleft > 0)
System.arraycopy(buf, nb, buf, 0, bytesleft);
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
index 4e8bf5635..b8cfd8691 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
@@ -68,63 +68,63 @@ public class ChunkHelper {
/**
* Converts to bytes using Latin1 (ISO-8859-1)
*/
- public static byte[] toBytes(String x) {
+ public static byte[] toBytes(final String x) {
return x.getBytes(PngHelperInternal.charsetLatin1);
}
/**
* Converts to String using Latin1 (ISO-8859-1)
*/
- public static String toString(byte[] x) {
+ public static String toString(final byte[] x) {
return new String(x, PngHelperInternal.charsetLatin1);
}
/**
* Converts to String using Latin1 (ISO-8859-1)
*/
- public static String toString(byte[] x, int offset, int len) {
+ public static String toString(final byte[] x, final int offset, final int len) {
return new String(x, offset, len, PngHelperInternal.charsetLatin1);
}
/**
* Converts to bytes using UTF-8
*/
- public static byte[] toBytesUTF8(String x) {
+ public static byte[] toBytesUTF8(final String x) {
return x.getBytes(PngHelperInternal.charsetUTF8);
}
/**
* Converts to string using UTF-8
*/
- public static String toStringUTF8(byte[] x) {
+ public static String toStringUTF8(final byte[] x) {
return new String(x, PngHelperInternal.charsetUTF8);
}
/**
* Converts to string using UTF-8
*/
- public static String toStringUTF8(byte[] x, int offset, int len) {
+ public static String toStringUTF8(final byte[] x, final int offset, final int len) {
return new String(x, offset, len, PngHelperInternal.charsetUTF8);
}
/**
* critical chunk : first letter is uppercase
*/
- public static boolean isCritical(String id) {
+ public static boolean isCritical(final String id) {
return (Character.isUpperCase(id.charAt(0)));
}
/**
* public chunk: second letter is uppercase
*/
- public static boolean isPublic(String id) { //
+ public static boolean isPublic(final String id) { //
return (Character.isUpperCase(id.charAt(1)));
}
/**
* Safe to copy chunk: fourth letter is lower case
*/
- public static boolean isSafeToCopy(String id) {
+ public static boolean isSafeToCopy(final String id) {
return (!Character.isUpperCase(id.charAt(3)));
}
@@ -132,7 +132,7 @@ public class ChunkHelper {
* "Unknown" just means that our chunk factory (even when it has been
* augmented by client code) did not recognize its id
*/
- public static boolean isUnknown(PngChunk c) {
+ public static boolean isUnknown(final PngChunk c) {
return c instanceof PngChunkUNKNOWN;
}
@@ -142,7 +142,7 @@ public class ChunkHelper {
* @param b
* @return -1 if not found
*/
- public static int posNullByte(byte[] b) {
+ public static int posNullByte(final byte[] b) {
for (int i = 0; i < b.length; i++)
if (b[i] == 0)
return i;
@@ -156,10 +156,10 @@ public class ChunkHelper {
* @param behav
* @return true/false
*/
- public static boolean shouldLoad(String id, ChunkLoadBehaviour behav) {
+ public static boolean shouldLoad(final String id, final ChunkLoadBehaviour behav) {
if (isCritical(id))
return true;
- boolean kwown = PngChunk.isKnown(id);
+ final boolean kwown = PngChunk.isKnown(id);
switch (behav) {
case LOAD_CHUNK_ALWAYS:
return true;
@@ -173,21 +173,21 @@ public class ChunkHelper {
return false; // should not reach here
}
- public final static byte[] compressBytes(byte[] ori, boolean compress) {
+ public final static byte[] compressBytes(final byte[] ori, final boolean compress) {
return compressBytes(ori, 0, ori.length, compress);
}
- public static byte[] compressBytes(byte[] ori, int offset, int len, boolean compress) {
+ public static byte[] compressBytes(final byte[] ori, final int offset, final int len, final boolean compress) {
try {
- ByteArrayInputStream inb = new ByteArrayInputStream(ori, offset, len);
- InputStream in = compress ? inb : new InflaterInputStream(inb, getInflater());
- ByteArrayOutputStream outb = new ByteArrayOutputStream();
- OutputStream out = compress ? new DeflaterOutputStream(outb) : outb;
+ final ByteArrayInputStream inb = new ByteArrayInputStream(ori, offset, len);
+ final InputStream in = compress ? inb : new InflaterInputStream(inb, getInflater());
+ final ByteArrayOutputStream outb = new ByteArrayOutputStream();
+ final OutputStream out = compress ? new DeflaterOutputStream(outb) : outb;
shovelInToOut(in, out);
in.close();
out.close();
return outb.toByteArray();
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new PngjException(e);
}
}
@@ -195,7 +195,7 @@ public class ChunkHelper {
/**
* Shovels all data from an input stream to an output stream.
*/
- private static void shovelInToOut(InputStream in, OutputStream out) throws IOException {
+ private static void shovelInToOut(final InputStream in, final OutputStream out) throws IOException {
synchronized (tmpbuffer) {
int len;
while ((len = in.read(tmpbuffer)) > 0) {
@@ -204,7 +204,7 @@ public class ChunkHelper {
}
}
- public static boolean maskMatch(int v, int mask) {
+ public static boolean maskMatch(final int v, final int mask) {
return (v & mask) != 0;
}
@@ -213,9 +213,9 @@ public class ChunkHelper {
*
* See also trimList()
*/
- public static List<PngChunk> filterList(List<PngChunk> target, ChunkPredicate predicateKeep) {
- List<PngChunk> result = new ArrayList<PngChunk>();
- for (PngChunk element : target) {
+ public static List<PngChunk> filterList(final List<PngChunk> target, final ChunkPredicate predicateKeep) {
+ final List<PngChunk> result = new ArrayList<PngChunk>();
+ for (final PngChunk element : target) {
if (predicateKeep.match(element)) {
result.add(element);
}
@@ -228,11 +228,11 @@ public class ChunkHelper {
*
* See also filterList
*/
- public static int trimList(List<PngChunk> target, ChunkPredicate predicateRemove) {
- Iterator<PngChunk> it = target.iterator();
+ public static int trimList(final List<PngChunk> target, final ChunkPredicate predicateRemove) {
+ final Iterator<PngChunk> it = target.iterator();
int cont = 0;
while (it.hasNext()) {
- PngChunk c = it.next();
+ final PngChunk c = it.next();
if (predicateRemove.match(c)) {
it.remove();
cont++;
@@ -252,7 +252,7 @@ public class ChunkHelper {
*
* @return true if "equivalent"
*/
- public static final boolean equivalent(PngChunk c1, PngChunk c2) {
+ public static final boolean equivalent(final PngChunk c1, final PngChunk c2) {
if (c1 == c2)
return true;
if (c1 == null || c2 == null || !c1.id.equals(c2.id))
@@ -272,7 +272,7 @@ public class ChunkHelper {
return false;
}
- public static boolean isText(PngChunk c) {
+ public static boolean isText(final PngChunk c) {
return c instanceof PngChunkTextVar;
}
@@ -281,7 +281,7 @@ public class ChunkHelper {
* individual chunks compression
*/
public static Inflater getInflater() {
- Inflater inflater = inflaterProvider.get();
+ final Inflater inflater = inflaterProvider.get();
inflater.reset();
return inflater;
}
@@ -291,7 +291,7 @@ public class ChunkHelper {
* individual chunks decompression
*/
public static Deflater getDeflater() {
- Deflater deflater = deflaterProvider.get();
+ final Deflater deflater = deflaterProvider.get();
deflater.reset();
return deflater;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
index dcb1958df..0ac2dc6a0 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
@@ -50,7 +50,7 @@ public class ChunkRaw {
* @param alloc
* : it true, the data array will be allocced
*/
- public ChunkRaw(int len, byte[] idbytes, boolean alloc) {
+ public ChunkRaw(final int len, final byte[] idbytes, final boolean alloc) {
this.len = len;
System.arraycopy(idbytes, 0, this.idbytes, 0, 4);
if (alloc)
@@ -66,7 +66,7 @@ public class ChunkRaw {
* this is called after setting data, before writing to os
*/
private int computeCrc() {
- CRC32 crcengine = PngHelperInternal.getCRC();
+ final CRC32 crcengine = PngHelperInternal.getCRC();
crcengine.reset();
crcengine.update(idbytes, 0, 4);
if (len > 0)
@@ -78,7 +78,7 @@ public class ChunkRaw {
* Computes the CRC and writes to the stream. If error, a
* PngjOutputException is thrown
*/
- public void writeChunk(OutputStream os) {
+ public void writeChunk(final OutputStream os) {
if (idbytes.length != 4)
throw new PngjOutputException("bad chunkid [" + ChunkHelper.toString(idbytes) + "]");
crcval = computeCrc();
@@ -93,11 +93,11 @@ public class ChunkRaw {
* position before: just after chunk id. positon after: after crc Data
* should be already allocated. Checks CRC Return number of byte read.
*/
- public int readChunkData(InputStream is, boolean checkCrc) {
+ public int readChunkData(final InputStream is, final boolean checkCrc) {
PngHelperInternal.readBytes(is, data, 0, len);
crcval = PngHelperInternal.readInt4(is);
if (checkCrc) {
- int crc = computeCrc();
+ final int crc = computeCrc();
if (crc != crcval)
throw new PngjBadCrcException("chunk: " + this + " crc calc=" + crc + " read=" + crcval);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
index 75107d761..f5a920e73 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
@@ -31,7 +31,7 @@ public class ChunksList {
final ImageInfo imageInfo; // only required for writing
- public ChunksList(ImageInfo imfinfo) {
+ public ChunksList(final ImageInfo imfinfo) {
this.imageInfo = imfinfo;
}
@@ -41,8 +41,8 @@ public class ChunksList {
* @return key:chunk id, val: number of occurrences
*/
public HashMap<String, Integer> getChunksKeys() {
- HashMap<String, Integer> ck = new HashMap<String, Integer>();
- for (PngChunk c : chunks) {
+ final HashMap<String, Integer> ck = new HashMap<String, Integer>();
+ for (final PngChunk c : chunks) {
ck.put(c.id, ck.containsKey(c.id) ? ck.get(c.id) + 1 : 1);
}
return ck;
@@ -60,14 +60,14 @@ public class ChunksList {
if (innerid == null)
return ChunkHelper.filterList(list, new ChunkPredicate() {
@Override
- public boolean match(PngChunk c) {
+ public boolean match(final PngChunk c) {
return c.id.equals(id);
}
});
else
return ChunkHelper.filterList(list, new ChunkPredicate() {
@Override
- public boolean match(PngChunk c) {
+ public boolean match(final PngChunk c) {
if (!c.id.equals(id))
return false;
if (c instanceof PngChunkTextVar && !((PngChunkTextVar) c).getKey().equals(innerid))
@@ -82,7 +82,7 @@ public class ChunksList {
/**
* Adds chunk in next position. This is used onyl by the pngReader
*/
- public void appendReadChunk(PngChunk chunk, int chunkGroup) {
+ public void appendReadChunk(final PngChunk chunk, final int chunkGroup) {
chunk.setChunkGroup(chunkGroup);
chunks.add(chunk);
}
@@ -138,7 +138,7 @@ public class ChunksList {
* one is returned (failifMultiple=false)
**/
public PngChunk getById1(final String id, final String innerid, final boolean failIfMultiple) {
- List<? extends PngChunk> list = getById(id, innerid);
+ final List<? extends PngChunk> list = getById(id, innerid);
if (list.isEmpty())
return null;
if (list.size() > 1 && (failIfMultiple || !list.get(0).allowsMultiple()))
@@ -155,7 +155,7 @@ public class ChunksList {
public List<PngChunk> getEquivalent(final PngChunk c2) {
return ChunkHelper.filterList(chunks, new ChunkPredicate() {
@Override
- public boolean match(PngChunk c) {
+ public boolean match(final PngChunk c) {
return ChunkHelper.equivalent(c, c2);
}
});
@@ -170,9 +170,9 @@ public class ChunksList {
* for debugging
*/
public String toStringFull() {
- StringBuilder sb = new StringBuilder(toString());
+ final StringBuilder sb = new StringBuilder(toString());
sb.append("\n Read:\n");
- for (PngChunk chunk : chunks) {
+ for (final PngChunk chunk : chunks) {
sb.append(chunk).append(" G=" + chunk.getChunkGroup() + "\n");
}
return sb.toString();
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
index c502e9071..6ad61f8e2 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
@@ -19,9 +19,9 @@ public class ChunksListForWrite extends ChunksList {
private final List<PngChunk> queuedChunks = new ArrayList<PngChunk>();
// redundant, just for eficciency
- private HashMap<String, Integer> alreadyWrittenKeys = new HashMap<String, Integer>();
+ private final HashMap<String, Integer> alreadyWrittenKeys = new HashMap<String, Integer>();
- public ChunksListForWrite(ImageInfo imfinfo) {
+ public ChunksListForWrite(final ImageInfo imfinfo) {
super(imfinfo);
}
@@ -43,7 +43,7 @@ public class ChunksListForWrite extends ChunksList {
* Same as getById1(), but looking in the queued chunks
**/
public PngChunk getQueuedById1(final String id, final String innerid, final boolean failIfMultiple) {
- List<? extends PngChunk> list = getQueuedById(id, innerid);
+ final List<? extends PngChunk> list = getQueuedById(id, innerid);
if (list.isEmpty())
return null;
if (list.size() > 1 && (failIfMultiple || !list.get(0).allowsMultiple()))
@@ -72,7 +72,7 @@ public class ChunksListForWrite extends ChunksList {
* straightforward for SingleChunks. For MultipleChunks, it will normally
* check for reference equality!
*/
- public boolean removeChunk(PngChunk c) {
+ public boolean removeChunk(final PngChunk c) {
return queuedChunks.remove(c);
}
@@ -83,7 +83,7 @@ public class ChunksListForWrite extends ChunksList {
*
* @param c
*/
- public boolean queue(PngChunk c) {
+ public boolean queue(final PngChunk c) {
queuedChunks.add(c);
return true;
}
@@ -92,7 +92,7 @@ public class ChunksListForWrite extends ChunksList {
* this should be called only for ancillary chunks and PLTE (groups 1 - 3 -
* 5)
**/
- private static boolean shouldWrite(PngChunk c, int currentGroup) {
+ private static boolean shouldWrite(final PngChunk c, final int currentGroup) {
if (currentGroup == CHUNK_GROUP_2_PLTE)
return c.id.equals(ChunkHelper.PLTE);
if (currentGroup % 2 == 0)
@@ -121,11 +121,11 @@ public class ChunksListForWrite extends ChunksList {
return false;
}
- public int writeChunks(OutputStream os, int currentGroup) {
+ public int writeChunks(final OutputStream os, final int currentGroup) {
int cont = 0;
- Iterator<PngChunk> it = queuedChunks.iterator();
+ final Iterator<PngChunk> it = queuedChunks.iterator();
while (it.hasNext()) {
- PngChunk c = it.next();
+ final PngChunk c = it.next();
if (!shouldWrite(c, currentGroup))
continue;
if (ChunkHelper.isCritical(c.id) && !c.id.equals(ChunkHelper.PLTE))
@@ -159,14 +159,14 @@ public class ChunksListForWrite extends ChunksList {
*/
@Override
public String toStringFull() {
- StringBuilder sb = new StringBuilder(toString());
+ final StringBuilder sb = new StringBuilder(toString());
sb.append("\n Written:\n");
- for (PngChunk chunk : chunks) {
+ for (final PngChunk chunk : chunks) {
sb.append(chunk).append(" G=" + chunk.getChunkGroup() + "\n");
}
if (!queuedChunks.isEmpty()) {
sb.append(" Queued:\n");
- for (PngChunk chunk : queuedChunks) {
+ for (final PngChunk chunk : queuedChunks) {
sb.append(chunk).append("\n");
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
index 6cd86eb98..eba218fe3 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
@@ -122,7 +122,7 @@ public abstract class PngChunk {
* (not implmemented in this library) to the factory, so that the PngReader
* knows about it.
*/
- public static void factoryRegister(String chunkId, Class<? extends PngChunk> chunkClass) {
+ public static void factoryRegister(final String chunkId, final Class<? extends PngChunk> chunkClass) {
factoryMap.put(chunkId, chunkClass);
}
@@ -137,11 +137,11 @@ public abstract class PngChunk {
* <p>
* Unknown chunks will be parsed as instances of {@link PngChunkUNKNOWN}
*/
- public static boolean isKnown(String id) {
+ public static boolean isKnown(final String id) {
return factoryMap.containsKey(id);
}
- protected PngChunk(String id, ImageInfo imgInfo) {
+ protected PngChunk(final String id, final ImageInfo imgInfo) {
this.id = id;
this.imgInfo = imgInfo;
this.crit = ChunkHelper.isCritical(id);
@@ -153,8 +153,8 @@ public abstract class PngChunk {
* This factory creates the corresponding chunk and parses the raw chunk.
* This is used when reading.
*/
- public static PngChunk factory(ChunkRaw chunk, ImageInfo info) {
- PngChunk c = factoryFromId(ChunkHelper.toString(chunk.idbytes), info);
+ public static PngChunk factory(final ChunkRaw chunk, final ImageInfo info) {
+ final PngChunk c = factoryFromId(ChunkHelper.toString(chunk.idbytes), info);
c.length = chunk.len;
c.parseFromRaw(chunk);
return c;
@@ -164,15 +164,15 @@ public abstract class PngChunk {
* Creates one new blank chunk of the corresponding type, according to
* factoryMap (PngChunkUNKNOWN if not known)
*/
- public static PngChunk factoryFromId(String cid, ImageInfo info) {
+ public static PngChunk factoryFromId(final String cid, final ImageInfo info) {
PngChunk chunk = null;
try {
- Class<? extends PngChunk> cla = factoryMap.get(cid);
+ final Class<? extends PngChunk> cla = factoryMap.get(cid);
if (cla != null) {
- Constructor<? extends PngChunk> constr = cla.getConstructor(ImageInfo.class);
+ final Constructor<? extends PngChunk> constr = cla.getConstructor(ImageInfo.class);
chunk = constr.newInstance(info);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
// this can happen for unkown chunks
}
if (chunk == null)
@@ -180,8 +180,8 @@ public abstract class PngChunk {
return chunk;
}
- protected final ChunkRaw createEmptyChunk(int len, boolean alloc) {
- ChunkRaw c = new ChunkRaw(len, ChunkHelper.toBytes(id), alloc);
+ protected final ChunkRaw createEmptyChunk(final int len, final boolean alloc) {
+ final ChunkRaw c = new ChunkRaw(len, ChunkHelper.toBytes(id), alloc);
return c;
}
@@ -189,8 +189,8 @@ public abstract class PngChunk {
* Makes a clone (deep copy) calling {@link #cloneDataFromRead(PngChunk)}
*/
@SuppressWarnings("unchecked")
- public static <T extends PngChunk> T cloneChunk(T chunk, ImageInfo info) {
- PngChunk cn = factoryFromId(chunk.id, info);
+ public static <T extends PngChunk> T cloneChunk(final T chunk, final ImageInfo info) {
+ final PngChunk cn = factoryFromId(chunk.id, info);
if (cn.getClass() != chunk.getClass())
throw new PngjExceptionInternal("bad class cloning chunk: " + cn.getClass() + " " + chunk.getClass());
cn.cloneDataFromRead(chunk);
@@ -210,7 +210,7 @@ public abstract class PngChunk {
/**
* @see #getChunkGroup()
*/
- final public void setChunkGroup(int chunkGroup) {
+ final public void setChunkGroup(final int chunkGroup) {
this.chunkGroup = chunkGroup;
}
@@ -218,12 +218,12 @@ public abstract class PngChunk {
return priority;
}
- public void setPriority(boolean priority) {
+ public void setPriority(final boolean priority) {
this.priority = priority;
}
- final void write(OutputStream os) {
- ChunkRaw c = createRawChunk();
+ final void write(final OutputStream os) {
+ final ChunkRaw c = createRawChunk();
if (c == null)
throw new PngjExceptionInternal("null chunk ! creation failed for " + this);
c.writeChunk(os);
@@ -241,7 +241,7 @@ public abstract class PngChunk {
return offset;
}
- public void setOffset(long offset) {
+ public void setOffset(final long offset) {
this.offset = offset;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
index ea6235432..191278dbc 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
@@ -18,7 +18,7 @@ public class PngChunkBKGD extends PngChunkSingle {
private int red, green, blue;
private int paletteIndex;
- public PngChunkBKGD(ImageInfo info) {
+ public PngChunkBKGD(final ImageInfo info) {
super(ChunkHelper.bKGD, info);
}
@@ -46,11 +46,11 @@ public class PngChunkBKGD extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (imgInfo.greyscale) {
gray = PngHelperInternal.readInt2fromBytes(c.data, 0);
} else if (imgInfo.indexed) {
- paletteIndex = (int) (c.data[0] & 0xff);
+ paletteIndex = c.data[0] & 0xff;
} else {
red = PngHelperInternal.readInt2fromBytes(c.data, 0);
green = PngHelperInternal.readInt2fromBytes(c.data, 2);
@@ -59,8 +59,8 @@ public class PngChunkBKGD extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkBKGD otherx = (PngChunkBKGD) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkBKGD otherx = (PngChunkBKGD) other;
gray = otherx.gray;
red = otherx.red;
green = otherx.red;
@@ -73,7 +73,7 @@ public class PngChunkBKGD extends PngChunkSingle {
*
* @param gray
*/
- public void setGray(int gray) {
+ public void setGray(final int gray) {
if (!imgInfo.greyscale)
throw new PngjException("only gray images support this");
this.gray = gray;
@@ -89,7 +89,7 @@ public class PngChunkBKGD extends PngChunkSingle {
* Set pallette index
*
*/
- public void setPaletteIndex(int i) {
+ public void setPaletteIndex(final int i) {
if (!imgInfo.indexed)
throw new PngjException("only indexed (pallete) images support this");
this.paletteIndex = i;
@@ -105,7 +105,7 @@ public class PngChunkBKGD extends PngChunkSingle {
* Set rgb values
*
*/
- public void setRGB(int r, int g, int b) {
+ public void setRGB(final int r, final int g, final int b) {
if (imgInfo.greyscale || imgInfo.indexed)
throw new PngjException("only rgb or rgba images support this");
red = r;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java
index 25a4bf2d6..8bdd7b4c0 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java
@@ -18,7 +18,7 @@ public class PngChunkCHRM extends PngChunkSingle {
private double greenx, greeny;
private double bluex, bluey;
- public PngChunkCHRM(ImageInfo info) {
+ public PngChunkCHRM(final ImageInfo info) {
super(ID, info);
}
@@ -43,7 +43,7 @@ public class PngChunkCHRM extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (c.len != 32)
throw new PngjException("bad chunk " + c);
whitex = PngHelperInternal.intToDouble100000(PngHelperInternal.readInt4fromBytes(c.data, 0));
@@ -57,8 +57,8 @@ public class PngChunkCHRM extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkCHRM otherx = (PngChunkCHRM) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkCHRM otherx = (PngChunkCHRM) other;
whitex = otherx.whitex;
whitey = otherx.whitex;
redx = otherx.redx;
@@ -69,8 +69,8 @@ public class PngChunkCHRM extends PngChunkSingle {
bluey = otherx.bluey;
}
- public void setChromaticities(double whitex, double whitey, double redx, double redy, double greenx, double greeny,
- double bluex, double bluey) {
+ public void setChromaticities(final double whitex, final double whitey, final double redx, final double redy, final double greenx, final double greeny,
+ final double bluex, final double bluey) {
this.whitex = whitex;
this.redx = redx;
this.greenx = greenx;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java
index 74640746e..6b627326c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java
@@ -15,7 +15,7 @@ public class PngChunkGAMA extends PngChunkSingle {
// http://www.w3.org/TR/PNG/#11gAMA
private double gamma;
- public PngChunkGAMA(ImageInfo info) {
+ public PngChunkGAMA(final ImageInfo info) {
super(ID, info);
}
@@ -26,22 +26,22 @@ public class PngChunkGAMA extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(4, true);
- int g = (int) (gamma * 100000 + 0.5);
+ final ChunkRaw c = createEmptyChunk(4, true);
+ final int g = (int) (gamma * 100000 + 0.5);
PngHelperInternal.writeInt4tobytes(g, c.data, 0);
return c;
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 4)
throw new PngjException("bad chunk " + chunk);
- int g = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
- gamma = ((double) g) / 100000.0;
+ final int g = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
+ gamma = (g) / 100000.0;
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
gamma = ((PngChunkGAMA) other).gamma;
}
@@ -49,7 +49,7 @@ public class PngChunkGAMA extends PngChunkSingle {
return gamma;
}
- public void setGamma(double gamma) {
+ public void setGamma(final double gamma) {
this.gamma = gamma;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java
index 6dc3fd9ec..4a4832d3b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java
@@ -15,7 +15,7 @@ public class PngChunkHIST extends PngChunkSingle {
private int[] hist = new int[0]; // should have same lenght as palette
- public PngChunkHIST(ImageInfo info) {
+ public PngChunkHIST(final ImageInfo info) {
super(ID, info);
}
@@ -25,10 +25,10 @@ public class PngChunkHIST extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (!imgInfo.indexed)
throw new PngjException("only indexed images accept a HIST chunk");
- int nentries = c.data.length / 2;
+ final int nentries = c.data.length / 2;
hist = new int[nentries];
for (int i = 0; i < hist.length; i++) {
hist[i] = PngHelperInternal.readInt2fromBytes(c.data, i * 2);
@@ -48,8 +48,8 @@ public class PngChunkHIST extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkHIST otherx = (PngChunkHIST) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkHIST otherx = (PngChunkHIST) other;
hist = new int[otherx.hist.length];
System.arraycopy(otherx.hist, 0, hist, 0, otherx.hist.length);
}
@@ -58,7 +58,7 @@ public class PngChunkHIST extends PngChunkSingle {
return hist;
}
- public void setHist(int[] hist) {
+ public void setHist(final int[] hist) {
this.hist = hist;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java
index 399577d72..17f69861c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java
@@ -16,7 +16,7 @@ public class PngChunkICCP extends PngChunkSingle {
private String profileName;
private byte[] compressedProfile; // copmression/decopmresion is done in getter/setter
- public PngChunkICCP(ImageInfo info) {
+ public PngChunkICCP(final ImageInfo info) {
super(ID, info);
}
@@ -27,7 +27,7 @@ public class PngChunkICCP extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(profileName.length() + compressedProfile.length + 2, true);
+ final ChunkRaw c = createEmptyChunk(profileName.length() + compressedProfile.length + 2, true);
System.arraycopy(ChunkHelper.toBytes(profileName), 0, c.data, 0, profileName.length());
c.data[profileName.length()] = 0;
c.data[profileName.length() + 1] = 0;
@@ -36,20 +36,20 @@ public class PngChunkICCP extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
- int pos0 = ChunkHelper.posNullByte(chunk.data);
+ public void parseFromRaw(final ChunkRaw chunk) {
+ final int pos0 = ChunkHelper.posNullByte(chunk.data);
profileName = new String(chunk.data, 0, pos0, PngHelperInternal.charsetLatin1);
- int comp = (chunk.data[pos0 + 1] & 0xff);
+ final int comp = (chunk.data[pos0 + 1] & 0xff);
if (comp != 0)
throw new PngjException("bad compression for ChunkTypeICCP");
- int compdatasize = chunk.data.length - (pos0 + 2);
+ final int compdatasize = chunk.data.length - (pos0 + 2);
compressedProfile = new byte[compdatasize];
System.arraycopy(chunk.data, pos0 + 2, compressedProfile, 0, compdatasize);
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkICCP otherx = (PngChunkICCP) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkICCP otherx = (PngChunkICCP) other;
profileName = otherx.profileName;
compressedProfile = new byte[otherx.compressedProfile.length];
System.arraycopy(otherx.compressedProfile, 0, compressedProfile, 0, otherx.compressedProfile.length); // deep
@@ -59,12 +59,12 @@ public class PngChunkICCP extends PngChunkSingle {
/**
* The profile should be uncompressed bytes
*/
- public void setProfileNameAndContent(String name, byte[] profile) {
+ public void setProfileNameAndContent(final String name, final byte[] profile) {
profileName = name;
compressedProfile = ChunkHelper.compressBytes(profile, true);
}
- public void setProfileNameAndContent(String name, String profile) {
+ public void setProfileNameAndContent(final String name, final String profile) {
setProfileNameAndContent(name, profile.getBytes(PngHelperInternal.charsetLatin1));
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java
index 911513c0d..f7bee4b11 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java
@@ -14,7 +14,7 @@ public class PngChunkIDAT extends PngChunkMultiple {
public final static String ID = ChunkHelper.IDAT;
// http://www.w3.org/TR/PNG/#11IDAT
- public PngChunkIDAT(ImageInfo i, int len, long offset) {
+ public PngChunkIDAT(final ImageInfo i, final int len, final long offset) {
super(ID, i);
this.length = len;
this.offset = offset;
@@ -31,10 +31,10 @@ public class PngChunkIDAT extends PngChunkMultiple {
}
@Override
- public void parseFromRaw(ChunkRaw c) { // does nothing
+ public void parseFromRaw(final ChunkRaw c) { // does nothing
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java
index fbec564d8..3f6e47b09 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java
@@ -12,7 +12,7 @@ public class PngChunkIEND extends PngChunkSingle {
// http://www.w3.org/TR/PNG/#11IEND
// this is a dummy placeholder
- public PngChunkIEND(ImageInfo info) {
+ public PngChunkIEND(final ImageInfo info) {
super(ID, info);
}
@@ -23,16 +23,16 @@ public class PngChunkIEND extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = new ChunkRaw(0, ChunkHelper.b_IEND, false);
+ final ChunkRaw c = new ChunkRaw(0, ChunkHelper.b_IEND, false);
return c;
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
// this is not used
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java
index 94bfedd38..71e0ec90e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java
@@ -27,7 +27,7 @@ public class PngChunkIHDR extends PngChunkSingle {
// http://www.w3.org/TR/PNG/#11IHDR
//
- public PngChunkIHDR(ImageInfo info) {
+ public PngChunkIHDR(final ImageInfo info) {
super(ID, info);
}
@@ -38,7 +38,7 @@ public class PngChunkIHDR extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = new ChunkRaw(13, ChunkHelper.b_IHDR, true);
+ final ChunkRaw c = new ChunkRaw(13, ChunkHelper.b_IHDR, true);
int offset = 0;
PngHelperInternal.writeInt4tobytes(cols, c.data, offset);
offset += 4;
@@ -53,10 +53,10 @@ public class PngChunkIHDR extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (c.len != 13)
throw new PngjException("Bad IDHR len " + c.len);
- ByteArrayInputStream st = c.getAsByteStream();
+ final ByteArrayInputStream st = c.getAsByteStream();
cols = PngHelperInternal.readInt4(st);
rows = PngHelperInternal.readInt4(st);
// bit depth: number of bits per channel
@@ -68,8 +68,8 @@ public class PngChunkIHDR extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkIHDR otherx = (PngChunkIHDR) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkIHDR otherx = (PngChunkIHDR) other;
cols = otherx.cols;
rows = otherx.rows;
bitspc = otherx.bitspc;
@@ -83,7 +83,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return cols;
}
- public void setCols(int cols) {
+ public void setCols(final int cols) {
this.cols = cols;
}
@@ -91,7 +91,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return rows;
}
- public void setRows(int rows) {
+ public void setRows(final int rows) {
this.rows = rows;
}
@@ -99,7 +99,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return bitspc;
}
- public void setBitspc(int bitspc) {
+ public void setBitspc(final int bitspc) {
this.bitspc = bitspc;
}
@@ -107,7 +107,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return colormodel;
}
- public void setColormodel(int colormodel) {
+ public void setColormodel(final int colormodel) {
this.colormodel = colormodel;
}
@@ -115,7 +115,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return compmeth;
}
- public void setCompmeth(int compmeth) {
+ public void setCompmeth(final int compmeth) {
this.compmeth = compmeth;
}
@@ -123,7 +123,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return filmeth;
}
- public void setFilmeth(int filmeth) {
+ public void setFilmeth(final int filmeth) {
this.filmeth = filmeth;
}
@@ -131,7 +131,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return interlaced;
}
- public void setInterlaced(int interlaced) {
+ public void setInterlaced(final int interlaced) {
this.interlaced = interlaced;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java
index ab52d7c90..738f92471 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java
@@ -21,7 +21,7 @@ public class PngChunkITXT extends PngChunkTextVar {
private String translatedTag = "";
// http://www.w3.org/TR/PNG/#11iTXt
- public PngChunkITXT(ImageInfo info) {
+ public PngChunkITXT(final ImageInfo info) {
super(ID, info);
}
@@ -30,7 +30,7 @@ public class PngChunkITXT extends PngChunkTextVar {
if (key.isEmpty())
throw new PngjException("Text chunk key must be non empty");
try {
- ByteArrayOutputStream ba = new ByteArrayOutputStream();
+ final ByteArrayOutputStream ba = new ByteArrayOutputStream();
ba.write(ChunkHelper.toBytes(key));
ba.write(0); // separator
ba.write(compressed ? 1 : 0);
@@ -44,19 +44,19 @@ public class PngChunkITXT extends PngChunkTextVar {
textbytes = ChunkHelper.compressBytes(textbytes, true);
}
ba.write(textbytes);
- byte[] b = ba.toByteArray();
- ChunkRaw chunk = createEmptyChunk(b.length, false);
+ final byte[] b = ba.toByteArray();
+ final ChunkRaw chunk = createEmptyChunk(b.length, false);
chunk.data = b;
return chunk;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjException(e);
}
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
int nullsFound = 0;
- int[] nullsIdx = new int[3];
+ final int[] nullsIdx = new int[3];
for (int i = 0; i < c.data.length; i++) {
if (c.data[i] != 0)
continue;
@@ -80,7 +80,7 @@ public class PngChunkITXT extends PngChunkTextVar {
PngHelperInternal.charsetUTF8);
i = nullsIdx[2] + 1;
if (compressed) {
- byte[] bytes = ChunkHelper.compressBytes(c.data, i, c.data.length - i, false);
+ final byte[] bytes = ChunkHelper.compressBytes(c.data, i, c.data.length - i, false);
val = ChunkHelper.toStringUTF8(bytes);
} else {
val = ChunkHelper.toStringUTF8(c.data, i, c.data.length - i);
@@ -88,8 +88,8 @@ public class PngChunkITXT extends PngChunkTextVar {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkITXT otherx = (PngChunkITXT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkITXT otherx = (PngChunkITXT) other;
key = otherx.key;
val = otherx.val;
compressed = otherx.compressed;
@@ -101,7 +101,7 @@ public class PngChunkITXT extends PngChunkTextVar {
return compressed;
}
- public void setCompressed(boolean compressed) {
+ public void setCompressed(final boolean compressed) {
this.compressed = compressed;
}
@@ -109,7 +109,7 @@ public class PngChunkITXT extends PngChunkTextVar {
return langTag;
}
- public void setLangtag(String langtag) {
+ public void setLangtag(final String langtag) {
this.langTag = langtag;
}
@@ -117,7 +117,7 @@ public class PngChunkITXT extends PngChunkTextVar {
return translatedTag;
}
- public void setTranslatedTag(String translatedTag) {
+ public void setTranslatedTag(final String translatedTag) {
this.translatedTag = translatedTag;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
index 057f6c25e..5a7bee98c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
@@ -7,7 +7,7 @@ import jogamp.opengl.util.pngj.ImageInfo;
*/
public abstract class PngChunkMultiple extends PngChunk {
- protected PngChunkMultiple(String id, ImageInfo imgInfo) {
+ protected PngChunkMultiple(final String id, final ImageInfo imgInfo) {
super(id, imgInfo);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java
index a3bab4995..2217a59b4 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java
@@ -17,7 +17,7 @@ public class PngChunkOFFS extends PngChunkSingle {
private long posY;
private int units; // 0: pixel 1:micrometer
- public PngChunkOFFS(ImageInfo info) {
+ public PngChunkOFFS(final ImageInfo info) {
super(ID, info);
}
@@ -28,7 +28,7 @@ public class PngChunkOFFS extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(9, true);
+ final ChunkRaw c = createEmptyChunk(9, true);
PngHelperInternal.writeInt4tobytes((int) posX, c.data, 0);
PngHelperInternal.writeInt4tobytes((int) posY, c.data, 4);
c.data[8] = (byte) units;
@@ -36,7 +36,7 @@ public class PngChunkOFFS extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 9)
throw new PngjException("bad chunk length " + chunk);
posX = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
@@ -49,8 +49,8 @@ public class PngChunkOFFS extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkOFFS otherx = (PngChunkOFFS) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkOFFS otherx = (PngChunkOFFS) other;
this.posX = otherx.posX;
this.posY = otherx.posY;
this.units = otherx.units;
@@ -66,7 +66,7 @@ public class PngChunkOFFS extends PngChunkSingle {
/**
* 0: pixel, 1:micrometer
*/
- public void setUnits(int units) {
+ public void setUnits(final int units) {
this.units = units;
}
@@ -74,7 +74,7 @@ public class PngChunkOFFS extends PngChunkSingle {
return posX;
}
- public void setPosX(long posX) {
+ public void setPosX(final long posX) {
this.posX = posX;
}
@@ -82,7 +82,7 @@ public class PngChunkOFFS extends PngChunkSingle {
return posY;
}
- public void setPosY(long posY) {
+ public void setPosY(final long posY) {
this.posY = posY;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java
index b0a1bb898..fc647273e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java
@@ -16,7 +16,7 @@ public class PngChunkPHYS extends PngChunkSingle {
private long pixelsxUnitY;
private int units; // 0: unknown 1:metre
- public PngChunkPHYS(ImageInfo info) {
+ public PngChunkPHYS(final ImageInfo info) {
super(ID, info);
}
@@ -27,7 +27,7 @@ public class PngChunkPHYS extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(9, true);
+ final ChunkRaw c = createEmptyChunk(9, true);
PngHelperInternal.writeInt4tobytes((int) pixelsxUnitX, c.data, 0);
PngHelperInternal.writeInt4tobytes((int) pixelsxUnitY, c.data, 4);
c.data[8] = (byte) units;
@@ -35,7 +35,7 @@ public class PngChunkPHYS extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 9)
throw new PngjException("bad chunk length " + chunk);
pixelsxUnitX = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
@@ -48,8 +48,8 @@ public class PngChunkPHYS extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkPHYS otherx = (PngChunkPHYS) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkPHYS otherx = (PngChunkPHYS) other;
this.pixelsxUnitX = otherx.pixelsxUnitX;
this.pixelsxUnitY = otherx.pixelsxUnitY;
this.units = otherx.units;
@@ -59,7 +59,7 @@ public class PngChunkPHYS extends PngChunkSingle {
return pixelsxUnitX;
}
- public void setPixelsxUnitX(long pixelsxUnitX) {
+ public void setPixelsxUnitX(final long pixelsxUnitX) {
this.pixelsxUnitX = pixelsxUnitX;
}
@@ -67,7 +67,7 @@ public class PngChunkPHYS extends PngChunkSingle {
return pixelsxUnitY;
}
- public void setPixelsxUnitY(long pixelsxUnitY) {
+ public void setPixelsxUnitY(final long pixelsxUnitY) {
this.pixelsxUnitY = pixelsxUnitY;
}
@@ -75,7 +75,7 @@ public class PngChunkPHYS extends PngChunkSingle {
return units;
}
- public void setUnits(int units) {
+ public void setUnits(final int units) {
this.units = units;
}
@@ -87,7 +87,7 @@ public class PngChunkPHYS extends PngChunkSingle {
public double getAsDpi() {
if (units != 1 || pixelsxUnitX != pixelsxUnitY)
return -1;
- return ((double) pixelsxUnitX) * 0.0254;
+ return (pixelsxUnitX) * 0.0254;
}
/**
@@ -96,16 +96,16 @@ public class PngChunkPHYS extends PngChunkSingle {
public double[] getAsDpi2() {
if (units != 1)
return new double[] { -1, -1 };
- return new double[] { ((double) pixelsxUnitX) * 0.0254, ((double) pixelsxUnitY) * 0.0254 };
+ return new double[] { (pixelsxUnitX) * 0.0254, (pixelsxUnitY) * 0.0254 };
}
- public void setAsDpi(double dpi) {
+ public void setAsDpi(final double dpi) {
units = 1;
pixelsxUnitX = (long) (dpi / 0.0254 + 0.5);
pixelsxUnitY = pixelsxUnitX;
}
- public void setAsDpi2(double dpix, double dpiy) {
+ public void setAsDpi2(final double dpix, final double dpiy) {
units = 1;
pixelsxUnitX = (long) (dpix / 0.0254 + 0.5);
pixelsxUnitY = (long) (dpiy / 0.0254 + 0.5);
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java
index dbf5e53c0..0f135d1ed 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java
@@ -20,7 +20,7 @@ public class PngChunkPLTE extends PngChunkSingle {
*/
private int[] entries;
- public PngChunkPLTE(ImageInfo info) {
+ public PngChunkPLTE(final ImageInfo info) {
super(ID, info);
}
@@ -31,9 +31,9 @@ public class PngChunkPLTE extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- int len = 3 * nentries;
- int[] rgb = new int[3];
- ChunkRaw c = createEmptyChunk(len, true);
+ final int len = 3 * nentries;
+ final int[] rgb = new int[3];
+ final ChunkRaw c = createEmptyChunk(len, true);
for (int n = 0, i = 0; n < nentries; n++) {
getEntryRgb(n, rgb);
c.data[i++] = (byte) rgb[0];
@@ -44,21 +44,21 @@ public class PngChunkPLTE extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
setNentries(chunk.len / 3);
for (int n = 0, i = 0; n < nentries; n++) {
- setEntry(n, (int) (chunk.data[i++] & 0xff), (int) (chunk.data[i++] & 0xff), (int) (chunk.data[i++] & 0xff));
+ setEntry(n, chunk.data[i++] & 0xff, chunk.data[i++] & 0xff, chunk.data[i++] & 0xff);
}
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkPLTE otherx = (PngChunkPLTE) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkPLTE otherx = (PngChunkPLTE) other;
this.setNentries(otherx.getNentries());
System.arraycopy(otherx.entries, 0, entries, 0, nentries);
}
- public void setNentries(int n) {
+ public void setNentries(final int n) {
nentries = n;
if (nentries < 1 || nentries > 256)
throw new PngjException("invalid pallette - nentries=" + nentries);
@@ -71,20 +71,20 @@ public class PngChunkPLTE extends PngChunkSingle {
return nentries;
}
- public void setEntry(int n, int r, int g, int b) {
+ public void setEntry(final int n, final int r, final int g, final int b) {
entries[n] = ((r << 16) | (g << 8) | b);
}
- public int getEntry(int n) {
+ public int getEntry(final int n) {
return entries[n];
}
- public void getEntryRgb(int n, int[] rgb) {
+ public void getEntryRgb(final int n, final int[] rgb) {
getEntryRgb(n, rgb, 0);
}
- public void getEntryRgb(int n, int[] rgb, int offset) {
- int v = entries[n];
+ public void getEntryRgb(final int n, final int[] rgb, final int offset) {
+ final int v = entries[n];
rgb[offset + 0] = ((v & 0xff0000) >> 16);
rgb[offset + 1] = ((v & 0xff00) >> 8);
rgb[offset + 2] = (v & 0xff);
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
index 3a490654a..53858da83 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
@@ -19,7 +19,7 @@ public class PngChunkSBIT extends PngChunkSingle {
private int graysb, alphasb;
private int redsb, greensb, bluesb;
- public PngChunkSBIT(ImageInfo info) {
+ public PngChunkSBIT(final ImageInfo info) {
super(ID, info);
}
@@ -36,7 +36,7 @@ public class PngChunkSBIT extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (c.len != getLen())
throw new PngjException("bad chunk length " + c);
if (imgInfo.greyscale) {
@@ -71,8 +71,8 @@ public class PngChunkSBIT extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkSBIT otherx = (PngChunkSBIT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkSBIT otherx = (PngChunkSBIT) other;
graysb = otherx.graysb;
redsb = otherx.redsb;
greensb = otherx.greensb;
@@ -80,7 +80,7 @@ public class PngChunkSBIT extends PngChunkSingle {
alphasb = otherx.alphasb;
}
- public void setGraysb(int gray) {
+ public void setGraysb(final int gray) {
if (!imgInfo.greyscale)
throw new PngjException("only greyscale images support this");
graysb = gray;
@@ -92,7 +92,7 @@ public class PngChunkSBIT extends PngChunkSingle {
return graysb;
}
- public void setAlphasb(int a) {
+ public void setAlphasb(final int a) {
if (!imgInfo.alpha)
throw new PngjException("only images with alpha support this");
alphasb = a;
@@ -108,7 +108,7 @@ public class PngChunkSBIT extends PngChunkSingle {
* Set rgb values
*
*/
- public void setRGB(int r, int g, int b) {
+ public void setRGB(final int r, final int g, final int b) {
if (imgInfo.greyscale || imgInfo.indexed)
throw new PngjException("only rgb or rgba images support this");
redsb = r;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java
index 2ff65834d..44ff249ac 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java
@@ -21,7 +21,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
private int sampledepth; // 8/16
private int[] palette; // 5 elements per entry
- public PngChunkSPLT(ImageInfo info) {
+ public PngChunkSPLT(final ImageInfo info) {
super(ID, info);
}
@@ -33,11 +33,11 @@ public class PngChunkSPLT extends PngChunkMultiple {
@Override
public ChunkRaw createRawChunk() {
try {
- ByteArrayOutputStream ba = new ByteArrayOutputStream();
+ final ByteArrayOutputStream ba = new ByteArrayOutputStream();
ba.write(palName.getBytes(PngHelperInternal.charsetLatin1));
ba.write(0); // separator
ba.write((byte) sampledepth);
- int nentries = getNentries();
+ final int nentries = getNentries();
for (int n = 0; n < nentries; n++) {
for (int i = 0; i < 4; i++) {
if (sampledepth == 8)
@@ -47,17 +47,17 @@ public class PngChunkSPLT extends PngChunkMultiple {
}
PngHelperInternal.writeInt2(ba, palette[n * 5 + 4]);
}
- byte[] b = ba.toByteArray();
- ChunkRaw chunk = createEmptyChunk(b.length, false);
+ final byte[] b = ba.toByteArray();
+ final ChunkRaw chunk = createEmptyChunk(b.length, false);
chunk.data = b;
return chunk;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjException(e);
}
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
int t = -1;
for (int i = 0; i < c.data.length; i++) { // look for first zero
if (c.data[i] == 0) {
@@ -70,7 +70,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
palName = new String(c.data, 0, t, PngHelperInternal.charsetLatin1);
sampledepth = PngHelperInternal.readInt1fromByte(c.data, t + 1);
t += 2;
- int nentries = (c.data.length - t) / (sampledepth == 8 ? 6 : 10);
+ final int nentries = (c.data.length - t) / (sampledepth == 8 ? 6 : 10);
palette = new int[nentries * 5];
int r, g, b, a, f, ne;
ne = 0;
@@ -101,8 +101,8 @@ public class PngChunkSPLT extends PngChunkMultiple {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkSPLT otherx = (PngChunkSPLT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkSPLT otherx = (PngChunkSPLT) other;
palName = otherx.palName;
sampledepth = otherx.sampledepth;
palette = new int[otherx.palette.length];
@@ -117,7 +117,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
return palName;
}
- public void setPalName(String palName) {
+ public void setPalName(final String palName) {
this.palName = palName;
}
@@ -125,7 +125,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
return sampledepth;
}
- public void setSampledepth(int sampledepth) {
+ public void setSampledepth(final int sampledepth) {
this.sampledepth = sampledepth;
}
@@ -133,7 +133,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
return palette;
}
- public void setPalette(int[] palette) {
+ public void setPalette(final int[] palette) {
this.palette = palette;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java
index e4d77d40a..19504b917 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java
@@ -21,7 +21,7 @@ public class PngChunkSRGB extends PngChunkSingle {
private int intent;
- public PngChunkSRGB(ImageInfo info) {
+ public PngChunkSRGB(final ImageInfo info) {
super(ID, info);
}
@@ -31,7 +31,7 @@ public class PngChunkSRGB extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (c.len != 1)
throw new PngjException("bad chunk length " + c);
intent = PngHelperInternal.readInt1fromByte(c.data, 0);
@@ -46,8 +46,8 @@ public class PngChunkSRGB extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkSRGB otherx = (PngChunkSRGB) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkSRGB otherx = (PngChunkSRGB) other;
intent = otherx.intent;
}
@@ -55,7 +55,7 @@ public class PngChunkSRGB extends PngChunkSingle {
return intent;
}
- public void setIntent(int intent) {
+ public void setIntent(final int intent) {
this.intent = intent;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java
index 4dc5edec5..52037b396 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java
@@ -14,7 +14,7 @@ public class PngChunkSTER extends PngChunkSingle {
// http://www.libpng.org/pub/png/spec/register/pngext-1.3.0-pdg.html#C.sTER
private byte mode; // 0: cross-fuse layout 1: diverging-fuse layout
- public PngChunkSTER(ImageInfo info) {
+ public PngChunkSTER(final ImageInfo info) {
super(ID, info);
}
@@ -25,21 +25,21 @@ public class PngChunkSTER extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(1, true);
- c.data[0] = (byte) mode;
+ final ChunkRaw c = createEmptyChunk(1, true);
+ c.data[0] = mode;
return c;
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 1)
throw new PngjException("bad chunk length " + chunk);
mode = chunk.data[0];
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkSTER otherx = (PngChunkSTER) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkSTER otherx = (PngChunkSTER) other;
this.mode = otherx.mode;
}
@@ -53,7 +53,7 @@ public class PngChunkSTER extends PngChunkSingle {
/**
* 0: cross-fuse layout 1: diverging-fuse layout
*/
- public void setMode(byte mode) {
+ public void setMode(final byte mode) {
this.mode = mode;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
index 7df5ba021..c5e9407b1 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
@@ -8,7 +8,7 @@ import jogamp.opengl.util.pngj.ImageInfo;
*/
public abstract class PngChunkSingle extends PngChunk {
- protected PngChunkSingle(String id, ImageInfo imgInfo) {
+ protected PngChunkSingle(final String id, final ImageInfo imgInfo) {
super(id, imgInfo);
}
@@ -26,14 +26,14 @@ public abstract class PngChunkSingle extends PngChunk {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
- PngChunkSingle other = (PngChunkSingle) obj;
+ final PngChunkSingle other = (PngChunkSingle) obj;
if (id == null) {
if (other.id != null)
return false;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java
index f4c77b4e1..02a18816b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java
@@ -8,7 +8,7 @@ import jogamp.opengl.util.pngj.PngjException;
*/
public class PngChunkSkipped extends PngChunk {
- public PngChunkSkipped(String id, ImageInfo info, int clen) {
+ public PngChunkSkipped(final String id, final ImageInfo info, final int clen) {
super(id, info);
this.length = clen;
}
@@ -24,12 +24,12 @@ public class PngChunkSkipped extends PngChunk {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
throw new PngjException("Non supported for a skipped chunk");
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
throw new PngjException("Non supported for a skipped chunk");
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java
index d97cd63c5..634d0cd12 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java
@@ -12,7 +12,7 @@ import jogamp.opengl.util.pngj.PngjException;
public class PngChunkTEXT extends PngChunkTextVar {
public final static String ID = ChunkHelper.tEXt;
- public PngChunkTEXT(ImageInfo info) {
+ public PngChunkTEXT(final ImageInfo info) {
super(ID, info);
}
@@ -20,14 +20,14 @@ public class PngChunkTEXT extends PngChunkTextVar {
public ChunkRaw createRawChunk() {
if (key.isEmpty())
throw new PngjException("Text chunk key must be non empty");
- byte[] b = (key + "\0" + val).getBytes(PngHelperInternal.charsetLatin1);
- ChunkRaw chunk = createEmptyChunk(b.length, false);
+ final byte[] b = (key + "\0" + val).getBytes(PngHelperInternal.charsetLatin1);
+ final ChunkRaw chunk = createEmptyChunk(b.length, false);
chunk.data = b;
return chunk;
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
int i;
for (i = 0; i < c.data.length; i++)
if (c.data[i] == 0)
@@ -38,8 +38,8 @@ public class PngChunkTEXT extends PngChunkTextVar {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkTEXT otherx = (PngChunkTEXT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkTEXT otherx = (PngChunkTEXT) other;
key = otherx.key;
val = otherx.val;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java
index 8f34c78fe..850fb649f 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java
@@ -17,7 +17,7 @@ public class PngChunkTIME extends PngChunkSingle {
// http://www.w3.org/TR/PNG/#11tIME
private int year, mon, day, hour, min, sec;
- public PngChunkTIME(ImageInfo info) {
+ public PngChunkTIME(final ImageInfo info) {
super(ID, info);
}
@@ -28,7 +28,7 @@ public class PngChunkTIME extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(7, true);
+ final ChunkRaw c = createEmptyChunk(7, true);
PngHelperInternal.writeInt2tobytes(year, c.data, 0);
c.data[2] = (byte) mon;
c.data[3] = (byte) day;
@@ -39,7 +39,7 @@ public class PngChunkTIME extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 7)
throw new PngjException("bad chunk " + chunk);
year = PngHelperInternal.readInt2fromBytes(chunk.data, 0);
@@ -51,8 +51,8 @@ public class PngChunkTIME extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkTIME x = (PngChunkTIME) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkTIME x = (PngChunkTIME) other;
year = x.year;
mon = x.mon;
day = x.day;
@@ -61,8 +61,8 @@ public class PngChunkTIME extends PngChunkSingle {
sec = x.sec;
}
- public void setNow(int secsAgo) {
- Calendar d = Calendar.getInstance();
+ public void setNow(final int secsAgo) {
+ final Calendar d = Calendar.getInstance();
d.setTimeInMillis(System.currentTimeMillis() - 1000 * (long) secsAgo);
year = d.get(Calendar.YEAR);
mon = d.get(Calendar.MONTH) + 1;
@@ -72,7 +72,7 @@ public class PngChunkTIME extends PngChunkSingle {
sec = d.get(Calendar.SECOND);
}
- public void setYMDHMS(int yearx, int monx, int dayx, int hourx, int minx, int secx) {
+ public void setYMDHMS(final int yearx, final int monx, final int dayx, final int hourx, final int minx, final int secx) {
year = yearx;
mon = monx;
day = dayx;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
index 867e34861..5e10c041b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
@@ -21,7 +21,7 @@ public class PngChunkTRNS extends PngChunkSingle {
private int red, green, blue;
private int[] paletteAlpha = new int[] {};
- public PngChunkTRNS(ImageInfo info) {
+ public PngChunkTRNS(final ImageInfo info) {
super(ID, info);
}
@@ -51,14 +51,14 @@ public class PngChunkTRNS extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (imgInfo.greyscale) {
gray = PngHelperInternal.readInt2fromBytes(c.data, 0);
} else if (imgInfo.indexed) {
- int nentries = c.data.length;
+ final int nentries = c.data.length;
paletteAlpha = new int[nentries];
for (int n = 0; n < nentries; n++) {
- paletteAlpha[n] = (int) (c.data[n] & 0xff);
+ paletteAlpha[n] = c.data[n] & 0xff;
}
} else {
red = PngHelperInternal.readInt2fromBytes(c.data, 0);
@@ -68,8 +68,8 @@ public class PngChunkTRNS extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkTRNS otherx = (PngChunkTRNS) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkTRNS otherx = (PngChunkTRNS) other;
gray = otherx.gray;
red = otherx.red;
green = otherx.green;
@@ -84,7 +84,7 @@ public class PngChunkTRNS extends PngChunkSingle {
* Set rgb values
*
*/
- public void setRGB(int r, int g, int b) {
+ public void setRGB(final int r, final int g, final int b) {
if (imgInfo.greyscale || imgInfo.indexed)
throw new PngjException("only rgb or rgba images support this");
red = r;
@@ -98,7 +98,7 @@ public class PngChunkTRNS extends PngChunkSingle {
return new int[] { red, green, blue };
}
- public void setGray(int g) {
+ public void setGray(final int g) {
if (!imgInfo.greyscale)
throw new PngjException("only grayscale images support this");
gray = g;
@@ -113,7 +113,7 @@ public class PngChunkTRNS extends PngChunkSingle {
/**
* WARNING: non deep copy
*/
- public void setPalletteAlpha(int[] palAlpha) {
+ public void setPalletteAlpha(final int[] palAlpha) {
if (!imgInfo.indexed)
throw new PngjException("only indexed images support this");
paletteAlpha = palAlpha;
@@ -122,7 +122,7 @@ public class PngChunkTRNS extends PngChunkSingle {
/**
* to use when only one pallete index is set as totally transparent
*/
- public void setIndexEntryAsTransparent(int palAlphaIndex) {
+ public void setIndexEntryAsTransparent(final int palAlphaIndex) {
if (!imgInfo.indexed)
throw new PngjException("only indexed images support this");
paletteAlpha = new int[] { palAlphaIndex + 1 };
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java
index ba3ffc30c..d00c29971 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java
@@ -21,7 +21,7 @@ public abstract class PngChunkTextVar extends PngChunkMultiple {
public final static String KEY_Source = "Source"; // Device used to create the image
public final static String KEY_Comment = "Comment"; // Miscellaneous comment
- protected PngChunkTextVar(String id, ImageInfo info) {
+ protected PngChunkTextVar(final String id, final ImageInfo info) {
super(id, info);
}
@@ -51,7 +51,7 @@ public abstract class PngChunkTextVar extends PngChunkMultiple {
return val;
}
- public void setKeyVal(String key, String val) {
+ public void setKeyVal(final String key, final String val) {
this.key = key;
this.val = val;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java
index 3803428e6..693729e9b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java
@@ -11,11 +11,11 @@ public class PngChunkUNKNOWN extends PngChunkMultiple { // unkown, custom or not
private byte[] data;
- public PngChunkUNKNOWN(String id, ImageInfo info) {
+ public PngChunkUNKNOWN(final String id, final ImageInfo info) {
super(id, info);
}
- private PngChunkUNKNOWN(PngChunkUNKNOWN c, ImageInfo info) {
+ private PngChunkUNKNOWN(final PngChunkUNKNOWN c, final ImageInfo info) {
super(c.id, info);
System.arraycopy(c.data, 0, data, 0, c.data.length);
}
@@ -27,13 +27,13 @@ public class PngChunkUNKNOWN extends PngChunkMultiple { // unkown, custom or not
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw p = createEmptyChunk(data.length, false);
+ final ChunkRaw p = createEmptyChunk(data.length, false);
p.data = this.data;
return p;
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
data = c.data;
}
@@ -43,14 +43,14 @@ public class PngChunkUNKNOWN extends PngChunkMultiple { // unkown, custom or not
}
/* does not copy! */
- public void setData(byte[] data) {
+ public void setData(final byte[] data) {
this.data = data;
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
// THIS SHOULD NOT BE CALLED IF ALREADY CLONED WITH COPY CONSTRUCTOR
- PngChunkUNKNOWN c = (PngChunkUNKNOWN) other;
+ final PngChunkUNKNOWN c = (PngChunkUNKNOWN) other;
data = c.data; // not deep copy
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java
index 64593eae4..c1dfdeb33 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java
@@ -16,7 +16,7 @@ public class PngChunkZTXT extends PngChunkTextVar {
public final static String ID = ChunkHelper.zTXt;
// http://www.w3.org/TR/PNG/#11zTXt
- public PngChunkZTXT(ImageInfo info) {
+ public PngChunkZTXT(final ImageInfo info) {
super(ID, info);
}
@@ -25,23 +25,23 @@ public class PngChunkZTXT extends PngChunkTextVar {
if (key.isEmpty())
throw new PngjException("Text chunk key must be non empty");
try {
- ByteArrayOutputStream ba = new ByteArrayOutputStream();
+ final ByteArrayOutputStream ba = new ByteArrayOutputStream();
ba.write(key.getBytes(PngHelperInternal.charsetLatin1));
ba.write(0); // separator
ba.write(0); // compression method: 0
- byte[] textbytes = ChunkHelper.compressBytes(val.getBytes(PngHelperInternal.charsetLatin1), true);
+ final byte[] textbytes = ChunkHelper.compressBytes(val.getBytes(PngHelperInternal.charsetLatin1), true);
ba.write(textbytes);
- byte[] b = ba.toByteArray();
- ChunkRaw chunk = createEmptyChunk(b.length, false);
+ final byte[] b = ba.toByteArray();
+ final ChunkRaw chunk = createEmptyChunk(b.length, false);
chunk.data = b;
return chunk;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjException(e);
}
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
int nullsep = -1;
for (int i = 0; i < c.data.length; i++) { // look for first zero
if (c.data[i] != 0)
@@ -52,16 +52,16 @@ public class PngChunkZTXT extends PngChunkTextVar {
if (nullsep < 0 || nullsep > c.data.length - 2)
throw new PngjException("bad zTXt chunk: no separator found");
key = new String(c.data, 0, nullsep, PngHelperInternal.charsetLatin1);
- int compmet = (int) c.data[nullsep + 1];
+ final int compmet = c.data[nullsep + 1];
if (compmet != 0)
throw new PngjException("bad zTXt chunk: unknown compression method");
- byte[] uncomp = ChunkHelper.compressBytes(c.data, nullsep + 2, c.data.length - nullsep - 2, false); // uncompress
+ final byte[] uncomp = ChunkHelper.compressBytes(c.data, nullsep + 2, c.data.length - nullsep - 2, false); // uncompress
val = new String(uncomp, PngHelperInternal.charsetLatin1);
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkZTXT otherx = (PngChunkZTXT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkZTXT otherx = (PngChunkZTXT) other;
key = otherx.key;
val = otherx.val;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
index 139603448..bba2b3e7c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
@@ -19,7 +19,7 @@ public class PngMetadata {
private final ChunksList chunkList;
private final boolean readonly;
- public PngMetadata(ChunksList chunks) {
+ public PngMetadata(final ChunksList chunks) {
this.chunkList = chunks;
if (chunks instanceof ChunksListForWrite) {
this.readonly = false;
@@ -35,14 +35,14 @@ public class PngMetadata {
* and if so, overwrites it. However if that not check for already written
* chunks.
*/
- public void queueChunk(final PngChunk c, boolean lazyOverwrite) {
- ChunksListForWrite cl = getChunkListW();
+ public void queueChunk(final PngChunk c, final boolean lazyOverwrite) {
+ final ChunksListForWrite cl = getChunkListW();
if (readonly)
throw new PngjException("cannot set chunk : readonly metadata");
if (lazyOverwrite) {
ChunkHelper.trimList(cl.getQueuedChunks(), new ChunkPredicate() {
@Override
- public boolean match(PngChunk c2) {
+ public boolean match(final PngChunk c2) {
return ChunkHelper.equivalent(c, c2);
}
});
@@ -66,19 +66,19 @@ public class PngMetadata {
* returns -1 if not found or dimension unknown
*/
public double[] getDpi() {
- PngChunk c = chunkList.getById1(ChunkHelper.pHYs, true);
+ final PngChunk c = chunkList.getById1(ChunkHelper.pHYs, true);
if (c == null)
return new double[] { -1, -1 };
else
return ((PngChunkPHYS) c).getAsDpi2();
}
- public void setDpi(double x) {
+ public void setDpi(final double x) {
setDpi(x, x);
}
- public void setDpi(double x, double y) {
- PngChunkPHYS c = new PngChunkPHYS(chunkList.imageInfo);
+ public void setDpi(final double x, final double y) {
+ final PngChunkPHYS c = new PngChunkPHYS(chunkList.imageInfo);
c.setAsDpi2(x, y);
queueChunk(c);
}
@@ -92,8 +92,8 @@ public class PngMetadata {
* @return Returns the created-queued chunk, just in case you want to
* examine or modify it
*/
- public PngChunkTIME setTimeNow(int secsAgo) {
- PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
+ public PngChunkTIME setTimeNow(final int secsAgo) {
+ final PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
c.setNow(secsAgo);
queueChunk(c);
return c;
@@ -110,8 +110,8 @@ public class PngMetadata {
* @return Returns the created-queued chunk, just in case you want to
* examine or modify it
*/
- public PngChunkTIME setTimeYMDHMS(int yearx, int monx, int dayx, int hourx, int minx, int secx) {
- PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
+ public PngChunkTIME setTimeYMDHMS(final int yearx, final int monx, final int dayx, final int hourx, final int minx, final int secx) {
+ final PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
c.setYMDHMS(yearx, monx, dayx, hourx, minx, secx);
queueChunk(c, true);
return c;
@@ -125,7 +125,7 @@ public class PngMetadata {
}
public String getTimeAsString() {
- PngChunkTIME c = getTime();
+ final PngChunkTIME c = getTime();
return c == null ? "" : c.getAsString();
}
@@ -144,7 +144,7 @@ public class PngMetadata {
* @return Returns the created-queued chunks, just in case you want to
* examine, touch it
*/
- public PngChunkTextVar setText(String k, String val, boolean useLatin1, boolean compress) {
+ public PngChunkTextVar setText(final String k, final String val, final boolean useLatin1, final boolean compress) {
if (compress && !useLatin1)
throw new PngjException("cannot compress non latin text");
PngChunkTextVar c;
@@ -163,7 +163,7 @@ public class PngMetadata {
return c;
}
- public PngChunkTextVar setText(String k, String val) {
+ public PngChunkTextVar setText(final String k, final String val) {
return setText(k, val, false, false);
}
@@ -175,8 +175,9 @@ public class PngMetadata {
* Warning: this does not check the "lang" key of iTxt
*/
@SuppressWarnings("unchecked")
- public List<? extends PngChunkTextVar> getTxtsForKey(String k) {
+ public List<? extends PngChunkTextVar> getTxtsForKey(final String k) {
@SuppressWarnings("rawtypes")
+ final
List c = new ArrayList();
c.addAll(chunkList.getById(ChunkHelper.tEXt, k));
c.addAll(chunkList.getById(ChunkHelper.zTXt, k));
@@ -190,12 +191,12 @@ public class PngMetadata {
* <p>
* Use getTxtsForKey() if you don't want this behaviour
*/
- public String getTxtForKey(String k) {
- List<? extends PngChunkTextVar> li = getTxtsForKey(k);
+ public String getTxtForKey(final String k) {
+ final List<? extends PngChunkTextVar> li = getTxtsForKey(k);
if (li.isEmpty())
return "";
- StringBuilder t = new StringBuilder();
- for (PngChunkTextVar c : li)
+ final StringBuilder t = new StringBuilder();
+ for (final PngChunkTextVar c : li)
t.append(c.getVal()).append("\n");
return t.toString().trim();
}
@@ -214,7 +215,7 @@ public class PngMetadata {
* the caller, who should fill its entries
*/
public PngChunkPLTE createPLTEChunk() {
- PngChunkPLTE plte = new PngChunkPLTE(chunkList.imageInfo);
+ final PngChunkPLTE plte = new PngChunkPLTE(chunkList.imageInfo);
queueChunk(plte);
return plte;
}
@@ -233,7 +234,7 @@ public class PngMetadata {
* caller, who should fill its entries
*/
public PngChunkTRNS createTRNSChunk() {
- PngChunkTRNS trns = new PngChunkTRNS(chunkList.imageInfo);
+ final PngChunkTRNS trns = new PngChunkTRNS(chunkList.imageInfo);
queueChunk(trns);
return trns;
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
index feacdb951..25b73a2a6 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
@@ -44,7 +44,7 @@ public class WGLGLCapabilities extends GLCapabilities {
final private int pfdID;
private int arb_pixelformat; // -1 PFD, 0 NOP, 1 ARB
- public WGLGLCapabilities(PIXELFORMATDESCRIPTOR pfd, int pfdID, GLProfile glp) {
+ public WGLGLCapabilities(final PIXELFORMATDESCRIPTOR pfd, final int pfdID, final GLProfile glp) {
super(glp);
this.pfd = pfd;
this.pfdID = pfdID;
@@ -78,9 +78,9 @@ public class WGLGLCapabilities extends GLCapabilities {
return true;
}
- public static final String PFD2String(PIXELFORMATDESCRIPTOR pfd, int pfdID) {
+ public static final String PFD2String(final PIXELFORMATDESCRIPTOR pfd, final int pfdID) {
final int dwFlags = pfd.getDwFlags();
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
boolean sep = false;
if( 0 != (GDI.PFD_DRAW_TO_WINDOW & dwFlags ) ) {
@@ -224,7 +224,7 @@ public class WGLGLCapabilities extends GLCapabilities {
public Object clone() {
try {
return super.clone();
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
throw new GLException(e);
}
}
@@ -237,7 +237,7 @@ public class WGLGLCapabilities extends GLCapabilities {
final public boolean isSet() { return 0 != arb_pixelformat; }
@Override
- final public int getVisualID(VIDType type) throws NativeWindowException {
+ final public int getVisualID(final VIDType type) throws NativeWindowException {
switch(type) {
case INTRINSIC:
case NATIVE:
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java
index 6454a34b5..08ff0e05b 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java
@@ -27,6 +27,8 @@
*/
package jogamp.opengl.windows.wgl;
+import com.jogamp.common.util.PropertyAccess;
+
import jogamp.nativewindow.windows.GDI;
import jogamp.nativewindow.windows.PIXELFORMATDESCRIPTOR;
import jogamp.opengl.Debug;
@@ -52,41 +54,41 @@ public class WGLUtil {
static {
Debug.initSingleton();
- USE_WGLVersion_Of_5WGLGDIFuncSet = Debug.isPropertyDefined("jogl.windows.useWGLVersionOf5WGLGDIFuncSet", true);
+ USE_WGLVersion_Of_5WGLGDIFuncSet = PropertyAccess.isPropertyDefined("jogl.windows.useWGLVersionOf5WGLGDIFuncSet", true);
if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
System.err.println("Use WGL version of 5 WGL/GDI functions.");
}
}
- public static int ChoosePixelFormat(long hdc, PIXELFORMATDESCRIPTOR pfd) {
+ public static int ChoosePixelFormat(final long hdc, final PIXELFORMATDESCRIPTOR pfd) {
if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
return WGL.wglChoosePixelFormat(hdc, pfd);
} else {
return GDI.ChoosePixelFormat(hdc, pfd);
}
}
- public static int DescribePixelFormat(long hdc, int pfdid, int pfdSize, PIXELFORMATDESCRIPTOR pfd) {
+ public static int DescribePixelFormat(final long hdc, final int pfdid, final int pfdSize, final PIXELFORMATDESCRIPTOR pfd) {
if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
return WGL.wglDescribePixelFormat(hdc, pfdid, pfdSize, pfd);
} else {
return GDI.DescribePixelFormat(hdc, pfdid, pfdSize, pfd);
}
}
- public static int GetPixelFormat(long hdc) {
+ public static int GetPixelFormat(final long hdc) {
if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
return WGL.wglGetPixelFormat(hdc);
} else {
return GDI.GetPixelFormat(hdc);
}
}
- public static boolean SetPixelFormat(long hdc, int pfdid, PIXELFORMATDESCRIPTOR pfd) {
+ public static boolean SetPixelFormat(final long hdc, final int pfdid, final PIXELFORMATDESCRIPTOR pfd) {
if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
return WGL.wglSetPixelFormat(hdc, pfdid, pfd);
} else {
return GDI.SetPixelFormat(hdc, pfdid, pfd);
}
}
- public static boolean SwapBuffers(long hdc) {
+ public static boolean SwapBuffers(final long hdc) {
if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
return WGL.wglSwapBuffers(hdc);
} else {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
index 1ad3fed8d..0878f186c 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
@@ -60,11 +60,11 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
private long origbitmap;
private long hbitmap;
- private WindowsBitmapWGLDrawable(GLDrawableFactory factory, NativeSurface comp) {
+ private WindowsBitmapWGLDrawable(final GLDrawableFactory factory, final NativeSurface comp) {
super(factory, comp, false);
}
- protected static WindowsBitmapWGLDrawable create(GLDrawableFactory factory, NativeSurface comp) {
+ protected static WindowsBitmapWGLDrawable create(final GLDrawableFactory factory, final NativeSurface comp) {
final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)comp.getGraphicsConfiguration();
final AbstractGraphicsDevice aDevice = config.getScreen().getDevice();
if( !GLProfile.isAvailable(aDevice, GLProfile.GL2) ) {
@@ -94,7 +94,7 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new WindowsWGLContext(this, shareWith);
}
@@ -146,7 +146,7 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
hbitmap = GDI.CreateDIBSection(0, info, GDI.DIB_RGB_COLORS, pb, 0, 0);
werr = GDI.GetLastError();
if(DEBUG) {
- long p = ( pb.capacity() > 0 ) ? pb.get(0) : 0;
+ final long p = ( pb.capacity() > 0 ) ? pb.get(0) : 0;
System.err.println("WindowsBitmapWGLDrawable: pb sz/ptr "+pb.capacity() + ", "+toHexString(p));
System.err.println("WindowsBitmapWGLDrawable: " + width+"x"+height +
", bpp " + bitsPerPixelIn + " -> " + bitsPerPixel +
@@ -187,7 +187,7 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
}
protected void destroyBitmap() {
- NativeSurface ns = getNativeSurface();
+ final NativeSurface ns = getNativeSurface();
if (ns.getSurfaceHandle() != 0) {
// Must destroy bitmap and device context
GDI.SelectObject(ns.getSurfaceHandle(), origbitmap);
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
index 2047a91b5..4cebc6357 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
@@ -56,7 +56,7 @@ import jogamp.opengl.GLContextShareSet;
public class WindowsExternalWGLContext extends WindowsWGLContext {
- private WindowsExternalWGLContext(Drawable drawable, long ctx, WindowsWGLGraphicsConfiguration cfg) {
+ private WindowsExternalWGLContext(final Drawable drawable, final long ctx, final WindowsWGLGraphicsConfiguration cfg) {
super(drawable, null);
this.contextHandle = ctx;
if (DEBUG) {
@@ -69,7 +69,7 @@ public class WindowsExternalWGLContext extends WindowsWGLContext {
getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
}
- protected static WindowsExternalWGLContext create(GLDrawableFactory factory, GLProfile glp) {
+ protected static WindowsExternalWGLContext create(final GLDrawableFactory factory, final GLProfile glp) {
if(DEBUG) {
System.err.println("WindowsExternalWGLContext 0: werr: " + GDI.GetLastError());
}
@@ -83,7 +83,7 @@ public class WindowsExternalWGLContext extends WindowsWGLContext {
if (0 == hdc) {
throw new GLException("Error: attempted to make an external GLDrawable without a drawable current, werr " + GDI.GetLastError());
}
- AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
+ final AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
WindowsWGLGraphicsConfiguration cfg;
final int pfdID = WGLUtil.GetPixelFormat(hdc);
if (0 == pfdID) {
@@ -119,12 +119,12 @@ public class WindowsExternalWGLContext extends WindowsWGLContext {
// Need to provide the display connection to extension querying APIs
static class Drawable extends WindowsWGLDrawable {
- Drawable(GLDrawableFactory factory, NativeSurface comp) {
+ Drawable(final GLDrawableFactory factory, final NativeSurface comp) {
super(factory, comp, true);
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
throw new GLException("Should not call this");
}
@@ -138,7 +138,7 @@ public class WindowsExternalWGLContext extends WindowsWGLContext {
throw new GLException("Should not call this");
}
- public void setSize(int width, int height) {
+ public void setSize(final int width, final int height) {
throw new GLException("Should not call this");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java
index 11e0202fd..1378bcf3e 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java
@@ -55,16 +55,16 @@ import jogamp.nativewindow.windows.GDI;
public class WindowsExternalWGLDrawable extends WindowsWGLDrawable {
- private WindowsExternalWGLDrawable(GLDrawableFactory factory, NativeSurface component) {
+ private WindowsExternalWGLDrawable(final GLDrawableFactory factory, final NativeSurface component) {
super(factory, component, true);
}
- protected static WindowsExternalWGLDrawable create(GLDrawableFactory factory, GLProfile glp) {
- long hdc = WGL.wglGetCurrentDC();
+ protected static WindowsExternalWGLDrawable create(final GLDrawableFactory factory, final GLProfile glp) {
+ final long hdc = WGL.wglGetCurrentDC();
if (0==hdc) {
throw new GLException("Error: attempted to make an external GLDrawable without a drawable current, werr " + GDI.GetLastError());
}
- int pfdID = WGLUtil.GetPixelFormat(hdc);
+ final int pfdID = WGLUtil.GetPixelFormat(hdc);
if (pfdID == 0) {
throw new GLException("Error: attempted to make an external GLContext without a valid pixelformat, werr " + GDI.GetLastError());
}
@@ -76,11 +76,11 @@ public class WindowsExternalWGLDrawable extends WindowsWGLDrawable {
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new WindowsWGLContext(this, shareWith);
}
- public void setSize(int newWidth, int newHeight) {
+ public void setSize(final int newWidth, final int newHeight) {
throw new GLException("Should not call this");
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java
index 61fb787c6..0d0681df9 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java
@@ -45,12 +45,12 @@ import javax.media.opengl.GLContext;
import javax.media.opengl.GLDrawableFactory;
public class WindowsOnscreenWGLDrawable extends WindowsWGLDrawable {
- protected WindowsOnscreenWGLDrawable(GLDrawableFactory factory, NativeSurface component) {
+ protected WindowsOnscreenWGLDrawable(final GLDrawableFactory factory, final NativeSurface component) {
super(factory, component, false);
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new WindowsWGLContext(this, shareWith);
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
index e0bf1f50b..597f51178 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
@@ -65,7 +65,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
// needed to destroy pbuffer
private long buffer; // pbuffer handle
- protected WindowsPbufferWGLDrawable(GLDrawableFactory factory, NativeSurface target) {
+ protected WindowsPbufferWGLDrawable(final GLDrawableFactory factory, final NativeSurface target) {
super(factory, target, false);
}
@@ -79,14 +79,14 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new WindowsWGLContext(this, shareWith);
}
protected void destroyPbuffer() {
- NativeSurface ns = getNativeSurface();
+ final NativeSurface ns = getNativeSurface();
if(0!=buffer) {
- WGLExt wglExt = cachedWGLExt;
+ final WGLExt wglExt = cachedWGLExt;
if (ns.getSurfaceHandle() != 0) {
// Must release DC and pbuffer
// NOTE that since the context is not current, glGetError() can
@@ -112,15 +112,15 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
}
private void createPbuffer() {
- WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) getNativeSurface().getGraphicsConfiguration();
- SharedResource sharedResource = ((WindowsWGLDrawableFactory)factory).getOrCreateSharedResourceImpl(config.getScreen().getDevice());
- NativeSurface sharedSurface = sharedResource.getDrawable().getNativeSurface();
+ final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) getNativeSurface().getGraphicsConfiguration();
+ final SharedResource sharedResource = ((WindowsWGLDrawableFactory)factory).getOrCreateSharedResourceImpl(config.getScreen().getDevice());
+ final NativeSurface sharedSurface = sharedResource.getDrawable().getNativeSurface();
if (NativeSurface.LOCK_SURFACE_NOT_READY >= sharedSurface.lockSurface()) {
throw new NativeWindowException("Could not lock (sharedSurface): "+this);
}
try {
- long sharedHdc = sharedSurface.getSurfaceHandle();
- WGLExt wglExt = ((WindowsWGLContext)sharedResource.getContext()).getWGLExt();
+ final long sharedHdc = sharedSurface.getSurfaceHandle();
+ final WGLExt wglExt = ((WindowsWGLContext)sharedResource.getContext()).getWGLExt();
if (DEBUG) {
System.out.println(getThreadName()+": Pbuffer config: " + config);
@@ -130,7 +130,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
final IntBuffer iattributes = Buffers.newDirectIntBuffer(2*WindowsWGLGraphicsConfiguration.MAX_ATTRIBS);
final FloatBuffer fattributes = Buffers.newDirectFloatBuffer(1);
- int[] floatModeTmp = new int[1];
+ final int[] floatModeTmp = new int[1];
int niattribs = 0;
final GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable)config.getChosenCapabilities();
@@ -162,7 +162,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
if (DEBUG) {
System.err.println("" + nformats + " suitable pixel formats found");
for (int i = 0; i < nformats; i++) {
- WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
+ final WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
sharedHdc, pformats.get(i), winattrPbuffer);
System.err.println("pixel format " + pformats.get(i) + " (index " + i + "): " + dbgCaps);
}
@@ -174,7 +174,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
int whichFormat;
// Loop is a workaround for bugs in NVidia's recent drivers
for (whichFormat = 0; whichFormat < nformats; whichFormat++) {
- int format = pformats.get(whichFormat);
+ final int format = pformats.get(whichFormat);
// Create the p-buffer.
niattribs = 0;
@@ -196,12 +196,12 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
}
// Get the device context.
- long tmpHdc = wglExt.wglGetPbufferDCARB(tmpBuffer);
+ final long tmpHdc = wglExt.wglGetPbufferDCARB(tmpBuffer);
if (tmpHdc == 0) {
throw new GLException("pbuffer creation error: wglGetPbufferDC() failed");
}
- NativeSurface ns = getNativeSurface();
+ final NativeSurface ns = getNativeSurface();
// Set up instance variables
buffer = tmpBuffer;
((MutableSurface)ns).setSurfaceHandle(tmpHdc);
@@ -209,7 +209,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
// Re-query chosen pixel format
{
- WGLGLCapabilities newCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
+ final WGLGLCapabilities newCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
sharedHdc, pfdid, winattrPbuffer);
if(null == newCaps) {
throw new GLException("pbuffer creation error: unable to re-query chosen PFD ID: " + pfdid + ", hdc " + GLDrawableImpl.toHexString(tmpHdc));
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
index 0df986f77..9c5a5b272 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
@@ -87,13 +87,13 @@ public class WindowsWGLContext extends GLContextImpl {
}
// FIXME: figure out how to hook back in the Java 2D / JOGL bridge
- WindowsWGLContext(GLDrawableImpl drawable,
- GLContext shareWith) {
+ WindowsWGLContext(final GLDrawableImpl drawable,
+ final GLContext shareWith) {
super(drawable, shareWith);
}
@Override
- protected void resetStates(boolean isInit) {
+ protected void resetStates(final boolean isInit) {
wglGetExtensionsStringEXTInitialized=false;
wglGetExtensionsStringEXTAvailable=false;
wglGLReadDrawableAvailableSet=false;
@@ -123,9 +123,9 @@ public class WindowsWGLContext extends GLContextImpl {
@Override
public final boolean isGLReadDrawableAvailable() {
if(!wglGLReadDrawableAvailableSet && null != getWGLExtProcAddressTable()) {
- WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory)drawable.getFactoryImpl();
- AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration();
- AbstractGraphicsDevice device = config.getScreen().getDevice();
+ final WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory)drawable.getFactoryImpl();
+ final AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration();
+ final AbstractGraphicsDevice device = config.getScreen().getDevice();
switch( factory.isReadDrawableAvailable(device) ) {
case 1:
wglGLReadDrawableAvailable = true;
@@ -140,7 +140,7 @@ public class WindowsWGLContext extends GLContextImpl {
return wglGLReadDrawableAvailable;
}
- private final boolean wglMakeContextCurrent(long hDrawDC, long hReadDC, long ctx) {
+ private final boolean wglMakeContextCurrent(final long hDrawDC, final long hReadDC, final long ctx) {
boolean ok = false;
if(wglGLReadDrawableAvailable) {
// needs initilized WGL ProcAddress table
@@ -151,9 +151,9 @@ public class WindowsWGLContext extends GLContextImpl {
// should not happen due to 'isGLReadDrawableAvailable()' query in GLContextImpl
throw new InternalError("Given readDrawable but no driver support");
}
- int werr = ( !ok ) ? GDI.GetLastError() : GDI.ERROR_SUCCESS;
+ final int werr = ( !ok ) ? GDI.GetLastError() : GDI.ERROR_SUCCESS;
if(DEBUG && !ok) {
- Throwable t = new Throwable ("Info: wglMakeContextCurrent draw "+
+ final Throwable t = new Throwable ("Info: wglMakeContextCurrent draw "+
GLContext.toHexString(hDrawDC) + ", read " + GLContext.toHexString(hReadDC) +
", ctx " + GLContext.toHexString(ctx) + ", werr " + werr);
t.printStackTrace();
@@ -182,26 +182,26 @@ public class WindowsWGLContext extends GLContextImpl {
protected Map<String, String> getExtensionNameMap() { return extensionNameMap; }
@Override
- protected void destroyContextARBImpl(long context) {
+ protected void destroyContextARBImpl(final long context) {
WGL.wglMakeCurrent(0, 0);
WGL.wglDeleteContext(context);
}
@Override
- protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+ protected long createContextARBImpl(final long share, final boolean direct, final int ctp, final int major, final int minor) {
if( null == getWGLExtProcAddressTable()) {
updateGLXProcAddressTable();
}
- WGLExt _wglExt = getWGLExt();
+ final WGLExt _wglExt = getWGLExt();
if(DEBUG) {
System.err.println(getThreadName()+" - WindowWGLContext.createContextARBImpl: "+getGLVersion(major, minor, ctp, "@creation") +
", handle "+toHexString(drawable.getHandle()) + ", share "+toHexString(share)+", direct "+direct+
", wglCreateContextAttribsARB: "+toHexString(wglExtProcAddressTable._addressof_wglCreateContextAttribsARB));
}
- boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
- boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
- boolean ctDebug = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
+ final boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
+ final boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
+ final boolean ctDebug = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
long ctx=0;
@@ -210,7 +210,7 @@ public class WindowsWGLContext extends GLContextImpl {
/* WGLExt.WGL_CONTEXT_LAYER_PLANE_ARB, WGLExt.WGL_CONTEXT_LAYER_PLANE_ARB, */
- int attribs[] = {
+ final int attribs[] = {
/* 0 */ WGLExt.WGL_CONTEXT_MAJOR_VERSION_ARB, major,
/* 2 */ WGLExt.WGL_CONTEXT_MINOR_VERSION_ARB, minor,
/* 4 */ WGLExt.WGL_CONTEXT_FLAGS_ARB, 0,
@@ -239,9 +239,9 @@ public class WindowsWGLContext extends GLContextImpl {
try {
final IntBuffer attribsNIO = Buffers.newDirectIntBuffer(attribs);
ctx = _wglExt.wglCreateContextAttribsARB(drawable.getHandle(), share, attribsNIO);
- } catch (RuntimeException re) {
+ } catch (final RuntimeException re) {
if(DEBUG) {
- Throwable t = new Throwable("Info: WindowWGLContext.createContextARBImpl wglCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
+ final Throwable t = new Throwable("Info: WindowWGLContext.createContextARBImpl wglCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
t.printStackTrace();
}
}
@@ -422,7 +422,7 @@ public class WindowsWGLContext extends GLContextImpl {
}
@Override
- protected void copyImpl(GLContext source, int mask) throws GLException {
+ protected void copyImpl(final GLContext source, final int mask) throws GLException {
if (!WGL.wglCopyContext(source.getHandle(), getHandle(), mask)) {
throw new GLException("wglCopyContext failed");
}
@@ -464,7 +464,7 @@ public class WindowsWGLContext extends GLContextImpl {
@Override
protected final StringBuilder getPlatformExtensionsStringImpl() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
if (!wglGetExtensionsStringEXTInitialized) {
wglGetExtensionsStringEXTAvailable = (WGL.wglGetProcAddress("wglGetExtensionsStringEXT") != 0);
@@ -477,26 +477,26 @@ public class WindowsWGLContext extends GLContextImpl {
}
@Override
- protected boolean setSwapIntervalImpl(int interval) {
- WGLExt wglExt = getWGLExt();
+ protected boolean setSwapIntervalImpl(final int interval) {
+ final WGLExt wglExt = getWGLExt();
if(0==hasSwapIntervalSGI) {
try {
hasSwapIntervalSGI = wglExt.isExtensionAvailable("WGL_EXT_swap_control")?1:-1;
- } catch (Throwable t) { hasSwapIntervalSGI=1; }
+ } catch (final Throwable t) { hasSwapIntervalSGI=1; }
}
if (hasSwapIntervalSGI>0) {
try {
return wglExt.wglSwapIntervalEXT(interval);
- } catch (Throwable t) { hasSwapIntervalSGI=-1; }
+ } catch (final Throwable t) { hasSwapIntervalSGI=-1; }
}
return false;
}
- private final int initSwapGroupImpl(WGLExt wglExt) {
+ private final int initSwapGroupImpl(final WGLExt wglExt) {
if(0==hasSwapGroupNV) {
try {
hasSwapGroupNV = wglExt.isExtensionAvailable("WGL_NV_swap_group")?1:-1;
- } catch (Throwable t) { hasSwapGroupNV=1; }
+ } catch (final Throwable t) { hasSwapGroupNV=1; }
if(DEBUG) {
System.err.println("initSwapGroupImpl: hasSwapGroupNV: "+hasSwapGroupNV);
}
@@ -505,10 +505,10 @@ public class WindowsWGLContext extends GLContextImpl {
}
@Override
- protected final boolean queryMaxSwapGroupsImpl(int[] maxGroups, int maxGroups_offset,
- int[] maxBarriers, int maxBarriers_offset) {
+ protected final boolean queryMaxSwapGroupsImpl(final int[] maxGroups, final int maxGroups_offset,
+ final int[] maxBarriers, final int maxBarriers_offset) {
boolean res = false;
- WGLExt wglExt = getWGLExt();
+ final WGLExt wglExt = getWGLExt();
if (initSwapGroupImpl(wglExt)>0) {
final NativeSurface ns = drawable.getNativeSurface();
try {
@@ -520,47 +520,47 @@ public class WindowsWGLContext extends GLContextImpl {
maxBarriersNIO.get(maxGroups, maxGroups_offset, maxBarriersNIO.remaining());
res = true;
}
- } catch (Throwable t) { hasSwapGroupNV=-1; }
+ } catch (final Throwable t) { hasSwapGroupNV=-1; }
}
return res;
}
@Override
- protected final boolean joinSwapGroupImpl(int group) {
+ protected final boolean joinSwapGroupImpl(final int group) {
boolean res = false;
- WGLExt wglExt = getWGLExt();
+ final WGLExt wglExt = getWGLExt();
if (initSwapGroupImpl(wglExt)>0) {
try {
if( wglExt.wglJoinSwapGroupNV(drawable.getHandle(), group) ) {
currentSwapGroup = group;
res = true;
}
- } catch (Throwable t) { hasSwapGroupNV=-1; }
+ } catch (final Throwable t) { hasSwapGroupNV=-1; }
}
return res;
}
@Override
- protected final boolean bindSwapBarrierImpl(int group, int barrier) {
+ protected final boolean bindSwapBarrierImpl(final int group, final int barrier) {
boolean res = false;
- WGLExt wglExt = getWGLExt();
+ final WGLExt wglExt = getWGLExt();
if (initSwapGroupImpl(wglExt)>0) {
try {
if( wglExt.wglBindSwapBarrierNV(group, barrier) ) {
res = true;
}
- } catch (Throwable t) { hasSwapGroupNV=-1; }
+ } catch (final Throwable t) { hasSwapGroupNV=-1; }
}
return res;
}
@Override
- public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
+ public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) {
return getWGLExt().wglAllocateMemoryNV(size, readFrequency, writeFrequency, priority);
}
@Override
- public final void glFreeMemoryNV(ByteBuffer pointer) {
+ public final void glFreeMemoryNV(final ByteBuffer pointer) {
getWGLExt().wglFreeMemoryNV(pointer);
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
index 66071cbe1..00b048e38 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
@@ -44,6 +44,8 @@ import javax.media.nativewindow.NativeSurface;
import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.GLException;
+import com.jogamp.common.util.PropertyAccess;
+
import jogamp.nativewindow.windows.GDI;
import jogamp.opengl.Debug;
import jogamp.opengl.GLDrawableImpl;
@@ -55,22 +57,22 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
static {
Debug.initSingleton();
- PROFILING = Debug.isPropertyDefined("jogl.debug.GLDrawable.profiling", true);
+ PROFILING = PropertyAccess.isPropertyDefined("jogl.debug.GLDrawable.profiling", true);
}
private static final int PROFILING_TICKS = 200;
private int profilingSwapBuffersTicks;
private long profilingSwapBuffersTime;
- public WindowsWGLDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
+ public WindowsWGLDrawable(final GLDrawableFactory factory, final NativeSurface comp, final boolean realized) {
super(factory, comp, realized);
}
@Override
protected void setRealizedImpl() {
if(realized) {
- NativeSurface ns = getNativeSurface();
- WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration();
+ final NativeSurface ns = getNativeSurface();
+ final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration();
config.updateGraphicsConfiguration(getFactory(), ns, null);
if (DEBUG) {
System.err.println(getThreadName()+": WindowsWGLDrawable.setRealized(true): "+config);
@@ -79,7 +81,7 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
}
@Override
- protected final void swapBuffersImpl(boolean doubleBuffered) {
+ protected final void swapBuffersImpl(final boolean doubleBuffered) {
if(doubleBuffered) {
final long t0;
if (PROFILING) {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
index 7fa8775cf..4d8c85137 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -99,7 +99,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
if(null!=tmp && tmp.isLibComplete()) {
WGL.getWGLProcAddressTable().reset(tmp);
}
- } catch (Exception ex) {
+ } catch (final Exception ex) {
tmp = null;
if(DEBUG) {
ex.printStackTrace();
@@ -121,7 +121,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
try {
ReflectionUtil.callStaticMethod("jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory",
"registerFactory", null, null, getClass().getClassLoader());
- } catch (Exception jre) { /* n/a .. */ }
+ } catch (final Exception jre) { /* n/a .. */ }
}
sharedMap = new HashMap<String, SharedResourceRunner.Resource>();
@@ -164,7 +164,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
+ public GLDynamicLookupHelper getGLDynamicLookupHelper(final int profile) {
return windowsWGLDynamicLookupHelper;
}
@@ -180,7 +180,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
protected void enterThreadCriticalZone() {
synchronized (sysMask) {
if( 0 == processAffinityChanges) {
- long pid = GDI.GetCurrentProcess();
+ final long pid = GDI.GetCurrentProcess();
if ( GDI.GetProcessAffinityMask(pid, procMask, sysMask) ) {
if(DEBUG) {
System.err.println("WindowsWGLDrawableFactory.enterThreadCriticalZone() - 0x" + Long.toHexString(pid) + " - " + getThreadName());
@@ -197,7 +197,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
protected void leaveThreadCriticalZone() {
synchronized (sysMask) {
if( 0 != processAffinityChanges) {
- long pid = GDI.GetCurrentProcess();
+ final long pid = GDI.GetCurrentProcess();
if( pid != processAffinityChanges) {
throw new GLException("PID doesn't match: set PID 0x" + Long.toHexString(processAffinityChanges) +
" this PID 0x" + Long.toHexString(pid) );
@@ -220,8 +220,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
private GLDrawableImpl drawable;
private GLContextImpl context;
- SharedResource(WindowsGraphicsDevice dev, AbstractGraphicsScreen scrn, GLDrawableImpl draw, GLContextImpl ctx,
- boolean arbPixelFormat, boolean arbMultisample, boolean arbPBuffer, boolean arbReadDrawable) {
+ SharedResource(final WindowsGraphicsDevice dev, final AbstractGraphicsScreen scrn, final GLDrawableImpl draw, final GLContextImpl ctx,
+ final boolean arbPixelFormat, final boolean arbMultisample, final boolean arbPBuffer, final boolean arbReadDrawable) {
device = dev;
screen = scrn;
drawable = draw;
@@ -261,11 +261,11 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
sharedMap.clear();
}
@Override
- public SharedResourceRunner.Resource mapPut(String connection, SharedResourceRunner.Resource resource) {
+ public SharedResourceRunner.Resource mapPut(final String connection, final SharedResourceRunner.Resource resource) {
return sharedMap.put(connection, resource);
}
@Override
- public SharedResourceRunner.Resource mapGet(String connection) {
+ public SharedResourceRunner.Resource mapGet(final String connection) {
return sharedMap.get(connection);
}
@Override
@@ -276,12 +276,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public boolean isDeviceSupported(String connection) {
+ public boolean isDeviceSupported(final String connection) {
return true;
}
@Override
- public SharedResourceRunner.Resource createSharedResource(String connection) {
+ public SharedResourceRunner.Resource createSharedResource(final String connection) {
final WindowsGraphicsDevice sharedDevice = new WindowsGraphicsDevice(connection, AbstractGraphicsDevice.DEFAULT_UNIT);
sharedDevice.lock();
try {
@@ -324,7 +324,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
return new SharedResource(sharedDevice, absScreen, sharedDrawable, sharedContext,
hasARBPixelFormat, hasARBMultisample,
hasARBPBuffer, hasARBReadDrawableAvailable);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new GLException("WindowsWGLDrawableFactory - Could not initialize shared resources for "+connection, t);
} finally {
sharedDevice.unlock();
@@ -332,8 +332,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public void releaseSharedResource(SharedResourceRunner.Resource shared) {
- SharedResource sr = (SharedResource) shared;
+ public void releaseSharedResource(final SharedResourceRunner.Resource shared) {
+ final SharedResource sr = (SharedResource) shared;
if (DEBUG) {
System.err.println("Shutdown Shared:");
System.err.println("Device : " + sr.device);
@@ -369,7 +369,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+ public final boolean getIsDeviceCompatible(final AbstractGraphicsDevice device) {
if(null!=windowsWGLDynamicLookupHelper && device instanceof WindowsGraphicsDevice) {
return true;
}
@@ -389,12 +389,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice device) {
+ protected final SharedResource getOrCreateSharedResourceImpl(final AbstractGraphicsDevice device) {
return (SharedResource) sharedResourceRunner.getOrCreateShared(device);
}
- protected final WindowsWGLDrawable getOrCreateSharedDrawable(AbstractGraphicsDevice device) {
- SharedResourceRunner.Resource sr = getOrCreateSharedResourceImpl(device);
+ protected final WindowsWGLDrawable getOrCreateSharedDrawable(final AbstractGraphicsDevice device) {
+ final SharedResourceRunner.Resource sr = getOrCreateSharedResourceImpl(device);
if(null!=sr) {
return (WindowsWGLDrawable) sr.getDrawable();
}
@@ -402,12 +402,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+ protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(final AbstractGraphicsDevice device) {
return WindowsWGLGraphicsConfigurationFactory.getAvailableCapabilities(this, device);
}
@Override
- protected final GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+ protected final GLDrawableImpl createOnscreenDrawableImpl(final NativeSurface target) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
@@ -419,8 +419,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
- AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
- GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+ final AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
+ final GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
if(!chosenCaps.isPBuffer()) {
return WindowsBitmapWGLDrawable.create(this, target);
}
@@ -435,7 +435,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
*/
final SharedResource sr = getOrCreateSharedResourceImpl(device);
if(null!=sr) {
- GLContext lastContext = GLContext.getCurrent();
+ final GLContext lastContext = GLContext.getCurrent();
if (lastContext != null) {
lastContext.release();
}
@@ -458,8 +458,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
* @return 1 if read drawable extension is available, 0 if not
* and -1 if undefined yet, ie no shared device exist at this point.
*/
- public final int isReadDrawableAvailable(AbstractGraphicsDevice device) {
- SharedResource sr = getOrCreateSharedResourceImpl( ( null != device ) ? device : defaultDevice );
+ public final int isReadDrawableAvailable(final AbstractGraphicsDevice device) {
+ final SharedResource sr = getOrCreateSharedResourceImpl( ( null != device ) ? device : defaultDevice );
if(null!=sr) {
return sr.hasReadDrawable() ? 1 : 0 ;
}
@@ -467,8 +467,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) {
- SharedResource sr = getOrCreateSharedResourceImpl( ( null != device ) ? device : defaultDevice );
+ public final boolean canCreateGLPbuffer(final AbstractGraphicsDevice device, final GLProfile glp) {
+ final SharedResource sr = getOrCreateSharedResourceImpl( ( null != device ) ? device : defaultDevice );
if(null!=sr) {
return sr.hasARBPBuffer();
}
@@ -476,9 +476,9 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
+ protected final ProxySurface createMutableSurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+ final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstreamHook) {
final WindowsGraphicsDevice device;
if(createNewDevice || !(deviceReq instanceof WindowsGraphicsDevice)) {
device = new WindowsGraphicsDevice(deviceReq.getConnection(), deviceReq.getUnitID());
@@ -494,8 +494,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
+ public final ProxySurface createDummySurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+ GLCapabilitiesImmutable chosenCaps, final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser chooser, final int width, final int height) {
final WindowsGraphicsDevice device;
if( createNewDevice || !(deviceReq instanceof WindowsGraphicsDevice) ) {
device = new WindowsGraphicsDevice(deviceReq.getConnection(), deviceReq.getUnitID());
@@ -512,7 +512,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
+ protected final ProxySurface createProxySurfaceImpl(final AbstractGraphicsDevice deviceReq, final int screenIdx, final long windowHandle, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstream) {
final WindowsGraphicsDevice device = new WindowsGraphicsDevice(deviceReq.getConnection(), deviceReq.getUnitID());
final AbstractGraphicsScreen screen = new DefaultGraphicsScreen(device, screenIdx);
final WindowsWGLGraphicsConfiguration cfg = WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen);
@@ -525,7 +525,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+ public final boolean canCreateExternalGLDrawable(final AbstractGraphicsDevice device) {
return true;
}
@@ -535,7 +535,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
static String wglGetLastError() {
- long err = GDI.GetLastError();
+ final long err = GDI.GetLastError();
String detail = null;
switch ((int) err) {
case GDI.ERROR_SUCCESS: detail = "ERROR_SUCCESS"; break;
@@ -561,26 +561,26 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final boolean setGammaRamp(float[] ramp) {
- short[] rampData = new short[3 * GAMMA_RAMP_LENGTH];
+ protected final boolean setGammaRamp(final float[] ramp) {
+ final short[] rampData = new short[3 * GAMMA_RAMP_LENGTH];
for (int i = 0; i < GAMMA_RAMP_LENGTH; i++) {
- short scaledValue = (short) (ramp[i] * 65535);
+ final short scaledValue = (short) (ramp[i] * 65535);
rampData[i] = scaledValue;
rampData[i + GAMMA_RAMP_LENGTH] = scaledValue;
rampData[i + 2 * GAMMA_RAMP_LENGTH] = scaledValue;
}
- long screenDC = GDI.GetDC(0);
- boolean res = GDI.SetDeviceGammaRamp(screenDC, ShortBuffer.wrap(rampData));
+ final long screenDC = GDI.GetDC(0);
+ final boolean res = GDI.SetDeviceGammaRamp(screenDC, ShortBuffer.wrap(rampData));
GDI.ReleaseDC(0, screenDC);
return res;
}
@Override
protected final Buffer getGammaRamp() {
- ShortBuffer rampData = ShortBuffer.wrap(new short[3 * GAMMA_RAMP_LENGTH]);
- long screenDC = GDI.GetDC(0);
- boolean res = GDI.GetDeviceGammaRamp(screenDC, rampData);
+ final ShortBuffer rampData = ShortBuffer.wrap(new short[3 * GAMMA_RAMP_LENGTH]);
+ final long screenDC = GDI.GetDC(0);
+ final boolean res = GDI.GetDeviceGammaRamp(screenDC, rampData);
GDI.ReleaseDC(0, screenDC);
if (!res) {
return null;
@@ -589,12 +589,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final void resetGammaRamp(Buffer originalGammaRamp) {
+ protected final void resetGammaRamp(final Buffer originalGammaRamp) {
if (originalGammaRamp == null) {
// getGammaRamp failed earlier
return;
}
- long screenDC = GDI.GetDC(0);
+ final long screenDC = GDI.GetDC(0);
GDI.SetDeviceGammaRamp(screenDC, originalGammaRamp);
GDI.ReleaseDC(0, screenDC);
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
index 6098cde7f..2285ae996 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
@@ -47,13 +47,13 @@ public final class WindowsWGLDynamicLibraryBundleInfo extends DesktopGLDynamicLi
@Override
public final List<String> getToolGetProcAddressFuncNameList() {
- List<String> res = new ArrayList<String>();
+ final List<String> res = new ArrayList<String>();
res.add("wglGetProcAddress");
return res;
}
@Override
- public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+ public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
return WGL.wglGetProcAddress(toolGetProcAddressHandle, funcName);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
index 5dd9f88b2..465b5f560 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
@@ -66,24 +66,24 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
private boolean isDetermined = false;
private boolean isExternal = false;
- WindowsWGLGraphicsConfiguration(AbstractGraphicsScreen screen,
- GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser) {
+ WindowsWGLGraphicsConfiguration(final AbstractGraphicsScreen screen,
+ final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser) {
super(screen, capsChosen, capsRequested);
this.chooser=chooser;
this.isDetermined = false;
}
- WindowsWGLGraphicsConfiguration(AbstractGraphicsScreen screen,
- WGLGLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested) {
+ WindowsWGLGraphicsConfiguration(final AbstractGraphicsScreen screen,
+ final WGLGLCapabilities capsChosen, final GLCapabilitiesImmutable capsRequested) {
super(screen, capsChosen, capsRequested);
setCapsPFD(capsChosen);
this.chooser=null;
}
- static WindowsWGLGraphicsConfiguration createFromExternal(GLDrawableFactory _factory, long hdc, int pfdID,
- GLProfile glp, AbstractGraphicsScreen screen, boolean onscreen)
+ static WindowsWGLGraphicsConfiguration createFromExternal(final GLDrawableFactory _factory, final long hdc, final int pfdID,
+ GLProfile glp, final AbstractGraphicsScreen screen, final boolean onscreen)
{
if(_factory==null) {
throw new GLException("Null factory");
@@ -97,10 +97,10 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
if(null==glp) {
glp = GLProfile.getDefault(screen.getDevice());
}
- WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
- AbstractGraphicsDevice device = screen.getDevice();
- WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
- boolean hasARB = null != sharedResource && sharedResource.hasARBPixelFormat();
+ final WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
+ final AbstractGraphicsDevice device = screen.getDevice();
+ final WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
+ final boolean hasARB = null != sharedResource && sharedResource.hasARBPixelFormat();
WGLGLCapabilities caps = null;
@@ -114,7 +114,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
", pfdID "+pfdID+", onscreen "+onscreen+", hasARB "+hasARB);
}
- WindowsWGLGraphicsConfiguration cfg = new WindowsWGLGraphicsConfiguration(screen, caps, caps);
+ final WindowsWGLGraphicsConfiguration cfg = new WindowsWGLGraphicsConfiguration(screen, caps, caps);
cfg.markExternal();
return cfg;
}
@@ -136,7 +136,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
* @see #isDetermined()
* @see #isExternal()
*/
- public final void updateGraphicsConfiguration(GLDrawableFactory factory, NativeSurface ns, int[] pfIDs) {
+ public final void updateGraphicsConfiguration(final GLDrawableFactory factory, final NativeSurface ns, final int[] pfIDs) {
WindowsWGLGraphicsConfigurationFactory.updateGraphicsConfiguration(chooser, factory, ns, pfIDs);
}
@@ -150,15 +150,15 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
*
* @see #isDetermined()
*/
- public final void preselectGraphicsConfiguration(GLDrawableFactory factory, int[] pfdIDs) {
- AbstractGraphicsDevice device = getScreen().getDevice();
+ public final void preselectGraphicsConfiguration(final GLDrawableFactory factory, final int[] pfdIDs) {
+ final AbstractGraphicsDevice device = getScreen().getDevice();
WindowsWGLGraphicsConfigurationFactory.preselectGraphicsConfiguration(chooser, factory, device, this, pfdIDs);
}
/**
* Sets the hdc's PixelFormat, this configuration's capabilities and marks it as determined.
*/
- final void setPixelFormat(long hdc, WGLGLCapabilities caps) {
+ final void setPixelFormat(final long hdc, final WGLGLCapabilities caps) {
if (0 == hdc) {
throw new GLException("Error: HDC is null");
}
@@ -170,12 +170,12 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
}
if( !caps.isBackgroundOpaque() ) {
final long hwnd = GDI.WindowFromDC(hdc);
- DWM_BLURBEHIND bb = DWM_BLURBEHIND.create();
+ final DWM_BLURBEHIND bb = DWM_BLURBEHIND.create();
bb.setDwFlags(GDI.DWM_BB_ENABLE| GDI.DWM_BB_TRANSITIONONMAXIMIZED);
bb.setFEnable( 1 );
boolean ok = GDI.DwmEnableBlurBehindWindow(hwnd, bb);
if( ok ) {
- MARGINS m = MARGINS.create();
+ final MARGINS m = MARGINS.create();
m.setCxLeftWidth(-1);
m.setCxRightWidth(-1);
m.setCyBottomHeight(-1);
@@ -198,7 +198,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
* Only sets this configuration's capabilities and marks it as determined,
* the actual pixelformat is not set.
*/
- final void setCapsPFD(WGLGLCapabilities caps) {
+ final void setCapsPFD(final WGLGLCapabilities caps) {
setChosenCapabilities(caps);
this.isDetermined = true;
if (DEBUG) {
@@ -228,7 +228,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
public final int getPixelFormatID() { return isDetermined ? ((WGLGLCapabilities)capabilitiesChosen).getPFDID() : 0; }
public final boolean isChoosenByARB() { return isDetermined ? ((WGLGLCapabilities)capabilitiesChosen).isSetByARB() : false; }
- static int fillAttribsForGeneralWGLARBQuery(WindowsWGLDrawableFactory.SharedResource sharedResource, IntBuffer iattributes) {
+ static int fillAttribsForGeneralWGLARBQuery(final WindowsWGLDrawableFactory.SharedResource sharedResource, final IntBuffer iattributes) {
int niattribs = 0;
iattributes.put(niattribs++, WGLExt.WGL_DRAW_TO_WINDOW_ARB);
if(sharedResource.hasARBPBuffer()) {
@@ -257,7 +257,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return niattribs;
}
- static boolean wglARBPFIDValid(WindowsWGLContext sharedCtx, long hdc, int pfdID) {
+ static boolean wglARBPFIDValid(final WindowsWGLContext sharedCtx, final long hdc, final int pfdID) {
final IntBuffer out = Buffers.newDirectIntBuffer(1);
final IntBuffer in = Buffers.newDirectIntBuffer(1);
in.put(0, WGLExt.WGL_COLOR_BITS_ARB);
@@ -268,12 +268,12 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return true;
}
- static int wglARBPFDIDCount(WindowsWGLContext sharedCtx, long hdc) {
+ static int wglARBPFDIDCount(final WindowsWGLContext sharedCtx, final long hdc) {
final IntBuffer iresults = Buffers.newDirectIntBuffer(1);
final IntBuffer iattributes = Buffers.newDirectIntBuffer(1);
iattributes.put(0, WGLExt.WGL_NUMBER_PIXEL_FORMATS_ARB);
- WGLExt wglExt = sharedCtx.getWGLExt();
+ final WGLExt wglExt = sharedCtx.getWGLExt();
// pfdID shall be ignored here (spec), however, pass a valid pdf index '1' below (possible driver bug)
if (!wglExt.wglGetPixelFormatAttribivARB(hdc, 1 /* pfdID */, 0, 1, iattributes, iresults)) {
if(DEBUG) {
@@ -295,17 +295,17 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return pfdIDCount;
}
- static int[] wglAllARBPFDIDs(int pfdIDCount) {
- int[] pfdIDs = new int[pfdIDCount];
+ static int[] wglAllARBPFDIDs(final int pfdIDCount) {
+ final int[] pfdIDs = new int[pfdIDCount];
for (int i = 0; i < pfdIDCount; i++) {
pfdIDs[i] = 1 + i;
}
return pfdIDs;
}
- static WGLGLCapabilities wglARBPFID2GLCapabilities(WindowsWGLDrawableFactory.SharedResource sharedResource,
- AbstractGraphicsDevice device, GLProfile glp,
- long hdc, int pfdID, int winattrbits) {
+ static WGLGLCapabilities wglARBPFID2GLCapabilities(final WindowsWGLDrawableFactory.SharedResource sharedResource,
+ final AbstractGraphicsDevice device, final GLProfile glp,
+ final long hdc, final int pfdID, final int winattrbits) {
if (!sharedResource.hasARBPixelFormat()) {
return null;
}
@@ -321,9 +321,9 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return AttribList2GLCapabilities(device, glp, hdc, pfdID, iattributes, niattribs, iresults, winattrbits);
}
- static int[] wglChoosePixelFormatARB(WindowsWGLDrawableFactory.SharedResource sharedResource, AbstractGraphicsDevice device,
- GLCapabilitiesImmutable capabilities,
- long hdc, IntBuffer iattributes, int accelerationMode, FloatBuffer fattributes)
+ static int[] wglChoosePixelFormatARB(final WindowsWGLDrawableFactory.SharedResource sharedResource, final AbstractGraphicsDevice device,
+ final GLCapabilitiesImmutable capabilities,
+ final long hdc, final IntBuffer iattributes, final int accelerationMode, final FloatBuffer fattributes)
{
if ( !WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList(capabilities,
@@ -361,7 +361,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
System.err.println("wglChoosePixelFormatARB: NumFormats (wglChoosePixelFormatARB) accelMode 0x"
+ Integer.toHexString(accelerationMode) + ": " + numFormats);
for (int i = 0; i < numFormats; i++) {
- WGLGLCapabilities dbgCaps0 = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(
+ final WGLGLCapabilities dbgCaps0 = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(
sharedResource, device, capabilities.getGLProfile(), hdc, pformats[i], GLGraphicsConfigurationUtil.ALL_BITS);
System.err.println("pixel format " + pformats[i] + " (index " + i + "): " + dbgCaps0);
}
@@ -369,8 +369,8 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return pformats;
}
- static List <GLCapabilitiesImmutable> wglARBPFIDs2GLCapabilities(WindowsWGLDrawableFactory.SharedResource sharedResource,
- AbstractGraphicsDevice device, GLProfile glp, long hdc, int[] pfdIDs, int winattrbits, boolean onlyFirstValid) {
+ static List <GLCapabilitiesImmutable> wglARBPFIDs2GLCapabilities(final WindowsWGLDrawableFactory.SharedResource sharedResource,
+ final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int[] pfdIDs, final int winattrbits, final boolean onlyFirstValid) {
if (!sharedResource.hasARBPixelFormat()) {
return null;
}
@@ -380,7 +380,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
final IntBuffer iresults = Buffers.newDirectIntBuffer(2*MAX_ATTRIBS);
final int niattribs = fillAttribsForGeneralWGLARBQuery(sharedResource, iattributes);
- ArrayList<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>();
+ final ArrayList<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>();
for(int i = 0; i<numFormats; i++) {
if ( pfdIDs[i] >= 1 &&
@@ -396,7 +396,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
break;
}
} else if(DEBUG) {
- GLCapabilitiesImmutable skipped = AttribList2GLCapabilities(device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, GLGraphicsConfigurationUtil.ALL_BITS);
+ final GLCapabilitiesImmutable skipped = AttribList2GLCapabilities(device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, GLGraphicsConfigurationUtil.ALL_BITS);
System.err.println("wglARBPFIDs2GLCapabilities: bucket["+i+" -> skip]: pfdID "+pfdIDs[i]+", "+skipped+", winattr "+GLGraphicsConfigurationUtil.winAttributeBits2String(null, winattrbits).toString());
}
} else if (DEBUG) {
@@ -411,11 +411,11 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return bucket;
}
- static boolean GLCapabilities2AttribList(GLCapabilitiesImmutable caps,
- IntBuffer iattributes,
- WindowsWGLDrawableFactory.SharedResource sharedResource,
- int accelerationValue,
- int[] floatMode) throws GLException {
+ static boolean GLCapabilities2AttribList(final GLCapabilitiesImmutable caps,
+ final IntBuffer iattributes,
+ final WindowsWGLDrawableFactory.SharedResource sharedResource,
+ final int accelerationValue,
+ final int[] floatMode) throws GLException {
if (!sharedResource.hasARBPixelFormat()) {
return false;
}
@@ -539,14 +539,14 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
static WGLGLCapabilities AttribList2GLCapabilities(final AbstractGraphicsDevice device,
final GLProfile glp, final long hdc, final int pfdID,
- final IntBuffer iattribs, final int niattribs, IntBuffer iresults, final int winattrmask) {
+ final IntBuffer iattribs, final int niattribs, final IntBuffer iresults, final int winattrmask) {
final int allDrawableTypeBits = AttribList2DrawableTypeBits(iattribs, niattribs, iresults);
int drawableTypeBits = winattrmask & allDrawableTypeBits;
if( 0 == drawableTypeBits ) {
return null;
}
- PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor();
+ final PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor();
if (WGLUtil.DescribePixelFormat(hdc, pfdID, PIXELFORMATDESCRIPTOR.size(), pfd) == 0) {
// remove displayable bits, since pfdID is non displayable
@@ -565,23 +565,23 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
// GDI PIXELFORMAT
//
- static int[] wglAllGDIPFIDs(long hdc) {
- int numFormats = WGLUtil.DescribePixelFormat(hdc, 1, 0, null);
+ static int[] wglAllGDIPFIDs(final long hdc) {
+ final int numFormats = WGLUtil.DescribePixelFormat(hdc, 1, 0, null);
if (numFormats == 0) {
throw new GLException("DescribePixelFormat: No formats - HDC 0x" + Long.toHexString(hdc) +
", LastError: " + GDI.GetLastError());
}
- int[] pfdIDs = new int[numFormats];
+ final int[] pfdIDs = new int[numFormats];
for (int i = 0; i < numFormats; i++) {
pfdIDs[i] = 1 + i;
}
return pfdIDs;
}
- static int PFD2DrawableTypeBits(PIXELFORMATDESCRIPTOR pfd) {
+ static int PFD2DrawableTypeBits(final PIXELFORMATDESCRIPTOR pfd) {
int val = 0;
- int dwFlags = pfd.getDwFlags();
+ final int dwFlags = pfd.getDwFlags();
if( 0 != (GDI.PFD_DRAW_TO_WINDOW & dwFlags ) ) {
val |= GLGraphicsConfigurationUtil.WINDOW_BIT |
@@ -593,8 +593,8 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return val;
}
- static WGLGLCapabilities PFD2GLCapabilities(AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID, final int winattrmask) {
- PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
+ static WGLGLCapabilities PFD2GLCapabilities(final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID, final int winattrmask) {
+ final PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
if(null == pfd) {
return null;
}
@@ -626,12 +626,12 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
}
- static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID) {
- PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
+ static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID) {
+ final PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
return PFD2GLCapabilitiesNoCheck(device, glp, pfd, pfdID);
}
- static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(AbstractGraphicsDevice device, GLProfile glp, PIXELFORMATDESCRIPTOR pfd, int pfdID) {
+ static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(final AbstractGraphicsDevice device, final GLProfile glp, final PIXELFORMATDESCRIPTOR pfd, final int pfdID) {
if(null == pfd) {
return null;
}
@@ -641,8 +641,8 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, PFD2DrawableTypeBits(pfd), res);
}
- static PIXELFORMATDESCRIPTOR GLCapabilities2PFD(GLCapabilitiesImmutable caps, PIXELFORMATDESCRIPTOR pfd) {
- int colorDepth = (caps.getRedBits() +
+ static PIXELFORMATDESCRIPTOR GLCapabilities2PFD(final GLCapabilitiesImmutable caps, final PIXELFORMATDESCRIPTOR pfd) {
+ final int colorDepth = (caps.getRedBits() +
caps.getGreenBits() +
caps.getBlueBits());
if (colorDepth < 15) {
@@ -680,7 +680,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
pfd.setCGreenBits((byte) caps.getGreenBits());
pfd.setCBlueBits ((byte) caps.getBlueBits());
pfd.setCAlphaBits((byte) caps.getAlphaBits());
- int accumDepth = (caps.getAccumRedBits() +
+ final int accumDepth = (caps.getAccumRedBits() +
caps.getAccumGreenBits() +
caps.getAccumBlueBits());
pfd.setCAccumBits ((byte) accumDepth);
@@ -699,8 +699,8 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return pfd;
}
- static PIXELFORMATDESCRIPTOR createPixelFormatDescriptor(long hdc, int pfdID) {
- PIXELFORMATDESCRIPTOR pfd = PIXELFORMATDESCRIPTOR.create();
+ static PIXELFORMATDESCRIPTOR createPixelFormatDescriptor(final long hdc, final int pfdID) {
+ final PIXELFORMATDESCRIPTOR pfd = PIXELFORMATDESCRIPTOR.create();
pfd.setNSize((short) PIXELFORMATDESCRIPTOR.size());
pfd.setNVersion((short) 1);
if(0 != hdc && 1 <= pfdID) {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
index 969e45ed8..ea92b38fd 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -81,7 +81,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested, final CapabilitiesChooser chooser, final AbstractGraphicsScreen absScreen, final int nativeVisualID) {
if (! (capsChosen instanceof GLCapabilitiesImmutable) ) {
throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - chosen");
@@ -98,14 +98,14 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested, (GLCapabilitiesChooser)chooser, absScreen);
}
- static WindowsWGLGraphicsConfiguration createDefaultGraphicsConfiguration(GLCapabilitiesImmutable caps,
- AbstractGraphicsScreen absScreen) {
+ static WindowsWGLGraphicsConfiguration createDefaultGraphicsConfiguration(final GLCapabilitiesImmutable caps,
+ final AbstractGraphicsScreen absScreen) {
return chooseGraphicsConfigurationStatic(caps, caps, null, absScreen);
}
static WindowsWGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
- GLCapabilitiesImmutable capsReq,
- GLCapabilitiesChooser chooser,
+ final GLCapabilitiesImmutable capsReq,
+ final GLCapabilitiesChooser chooser,
AbstractGraphicsScreen absScreen) {
if(null==absScreen) {
absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
@@ -115,7 +115,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
return new WindowsWGLGraphicsConfiguration( absScreen, capsChosen, capsReq, chooser );
}
- protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(WindowsWGLDrawableFactory factory, AbstractGraphicsDevice device) {
+ protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(final WindowsWGLDrawableFactory factory, final AbstractGraphicsDevice device) {
final WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
if(null == sharedResource) {
throw new GLException("Shared resource for device n/a: "+device);
@@ -136,7 +136,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
sharedDrawable.lockSurface();
}
try {
- long hdc = sharedDrawable.getHandle();
+ final long hdc = sharedDrawable.getHandle();
if (0 == hdc) {
throw new GLException("Error: HDC is null");
}
@@ -164,17 +164,17 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
return availableCaps;
}
- private static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesARB(WindowsWGLDrawableFactory.SharedResource sharedResource, AbstractGraphicsDevice device, GLProfile glProfile, long hdc) {
+ private static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesARB(final WindowsWGLDrawableFactory.SharedResource sharedResource, final AbstractGraphicsDevice device, final GLProfile glProfile, final long hdc) {
final int pfdIDCount = WindowsWGLGraphicsConfiguration.wglARBPFDIDCount((WindowsWGLContext)sharedResource.getContext(), hdc);
final int[] pformats = WindowsWGLGraphicsConfiguration.wglAllARBPFDIDs(pfdIDCount);
return WindowsWGLGraphicsConfiguration.wglARBPFIDs2GLCapabilities(sharedResource, device, glProfile, hdc, pformats,
GLGraphicsConfigurationUtil.ALL_BITS & ~GLGraphicsConfigurationUtil.BITMAP_BIT, false); // w/o BITMAP
}
- private static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesGDI(AbstractGraphicsDevice device, GLProfile glProfile, long hdc, boolean bitmapOnly) {
- int[] pformats = WindowsWGLGraphicsConfiguration.wglAllGDIPFIDs(hdc);
- int numFormats = pformats.length;
- List<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>(numFormats);
+ private static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesGDI(final AbstractGraphicsDevice device, final GLProfile glProfile, final long hdc, final boolean bitmapOnly) {
+ final int[] pformats = WindowsWGLGraphicsConfiguration.wglAllGDIPFIDs(hdc);
+ final int numFormats = pformats.length;
+ final List<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>(numFormats);
for (int i = 0; i < numFormats; i++) {
final GLCapabilitiesImmutable caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(device, glProfile, hdc, pformats[i],
bitmapOnly ? GLGraphicsConfigurationUtil.BITMAP_BIT : GLGraphicsConfigurationUtil.ALL_BITS );
@@ -192,8 +192,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
* @param ns
* @param pfIDs optional pool of preselected PixelFormat IDs, maybe null for unrestricted selection
*/
- static void updateGraphicsConfiguration(CapabilitiesChooser chooser,
- GLDrawableFactory factory, NativeSurface ns, int[] pfdIDs) {
+ static void updateGraphicsConfiguration(final CapabilitiesChooser chooser,
+ final GLDrawableFactory factory, final NativeSurface ns, final int[] pfdIDs) {
if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
}
@@ -208,11 +208,11 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
throw new GLException("Surface not ready (lockSurface)");
}
try {
- long hdc = ns.getSurfaceHandle();
+ final long hdc = ns.getSurfaceHandle();
if (0 == hdc) {
throw new GLException("Error: HDC is null");
}
- WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) ns.getGraphicsConfiguration();
+ final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) ns.getGraphicsConfiguration();
if( !config.isExternal() ) {
if( !config.isDetermined() ) {
@@ -239,9 +239,9 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
}
}
- static void preselectGraphicsConfiguration(CapabilitiesChooser chooser,
- GLDrawableFactory _factory, AbstractGraphicsDevice device,
- WindowsWGLGraphicsConfiguration config, int[] pfdIDs) {
+ static void preselectGraphicsConfiguration(final CapabilitiesChooser chooser,
+ final GLDrawableFactory _factory, final AbstractGraphicsDevice device,
+ final WindowsWGLGraphicsConfiguration config, final int[] pfdIDs) {
if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
}
@@ -254,8 +254,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
if ( !(_factory instanceof WindowsWGLDrawableFactory) ) {
throw new GLException("GLDrawableFactory is not a WindowsWGLDrawableFactory, but: "+_factory.getClass().getSimpleName());
}
- WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
- WindowsWGLDrawable sharedDrawable = factory.getOrCreateSharedDrawable(device);
+ final WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
+ final WindowsWGLDrawable sharedDrawable = factory.getOrCreateSharedDrawable(device);
if(null == sharedDrawable) {
throw new IllegalArgumentException("Shared Drawable is null");
}
@@ -264,7 +264,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
throw new GLException("Shared Surface not ready (lockSurface): "+device+" -> "+sharedDrawable);
}
try {
- long hdc = sharedDrawable.getHandle();
+ final long hdc = sharedDrawable.getHandle();
if (0 == hdc) {
throw new GLException("Error: HDC is null");
}
@@ -274,8 +274,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
}
}
- private static void updateGraphicsConfiguration(WindowsWGLGraphicsConfiguration config, CapabilitiesChooser chooser,
- GLDrawableFactory factory, long hdc, boolean extHDC, int[] pfdIDs) {
+ private static void updateGraphicsConfiguration(final WindowsWGLGraphicsConfiguration config, final CapabilitiesChooser chooser,
+ final GLDrawableFactory factory, final long hdc, final boolean extHDC, final int[] pfdIDs) {
if (DEBUG) {
if(extHDC) {
System.err.println("updateGraphicsConfiguration(using shared): hdc "+toHexString(hdc));
@@ -284,8 +284,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
}
System.err.println("user chosen caps " + config.getChosenCapabilities());
}
- AbstractGraphicsDevice device = config.getScreen().getDevice();
- WindowsWGLDrawableFactory.SharedResource sharedResource = ((WindowsWGLDrawableFactory)factory).getOrCreateSharedResourceImpl(device);
+ final AbstractGraphicsDevice device = config.getScreen().getDevice();
+ final WindowsWGLDrawableFactory.SharedResource sharedResource = ((WindowsWGLDrawableFactory)factory).getOrCreateSharedResourceImpl(device);
final GLContext sharedContext;
if ( factory.hasRendererQuirk(device, GLRendererQuirks.NeedCurrCtx4ARBPixFmtQueries) ) {
sharedContext = sharedResource.getContext();
@@ -311,8 +311,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
}
}
- private static boolean updateGraphicsConfigurationARB(WindowsWGLDrawableFactory factory, WindowsWGLGraphicsConfiguration config, CapabilitiesChooser chooser,
- long hdc, boolean extHDC, int[] pformats) {
+ private static boolean updateGraphicsConfigurationARB(final WindowsWGLDrawableFactory factory, final WindowsWGLGraphicsConfiguration config, final CapabilitiesChooser chooser,
+ final long hdc, final boolean extHDC, int[] pformats) {
final AbstractGraphicsDevice device = config.getScreen().getDevice();
final WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
@@ -462,8 +462,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
return true;
}
- private static boolean updateGraphicsConfigurationGDI(WindowsWGLGraphicsConfiguration config, CapabilitiesChooser chooser, long hdc,
- boolean extHDC, int[] pformats) {
+ private static boolean updateGraphicsConfigurationGDI(final WindowsWGLGraphicsConfiguration config, final CapabilitiesChooser chooser, final long hdc,
+ final boolean extHDC, int[] pformats) {
final GLCapabilitiesImmutable capsChosen = (GLCapabilitiesImmutable) config.getChosenCapabilities();
if( !capsChosen.isOnscreen() && capsChosen.isPBuffer() ) {
if (DEBUG) {
@@ -557,7 +557,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
System.err.println("updateGraphicsConfigurationGDI: availableCaps["+i+" -> "+j+"]: "+caps);
}
} else if(DEBUG) {
- GLCapabilitiesImmutable skipped = WindowsWGLGraphicsConfiguration.PFD2GLCapabilitiesNoCheck(device, glProfile, hdc, pformats[i]);
+ final GLCapabilitiesImmutable skipped = WindowsWGLGraphicsConfiguration.PFD2GLCapabilitiesNoCheck(device, glProfile, hdc, pformats[i]);
System.err.println("updateGraphicsConfigurationGDI: availableCaps["+i+" -> skip]: pfdID "+pformats[i]+", "+skipped);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
index 96bd0bdd0..66d3018fc 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
@@ -70,8 +70,8 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
- CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+ final CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, final int nativeVisualID) {
GraphicsDevice device = null;
if (absScreen != null &&
!(absScreen instanceof AWTGraphicsScreen)) {
@@ -84,7 +84,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: creating default device: "+absScreen);
}
}
- AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
+ final AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
if ( !(capsChosen instanceof GLCapabilitiesImmutable) ) {
@@ -104,10 +104,10 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: got "+absScreen);
}
- WindowsGraphicsDevice winDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
- DefaultGraphicsScreen winScreen = new DefaultGraphicsScreen(winDevice, awtScreen.getIndex());
- GraphicsConfigurationFactory configFactory = GraphicsConfigurationFactory.getFactory(winDevice, capsChosen);
- WindowsWGLGraphicsConfiguration winConfig = (WindowsWGLGraphicsConfiguration)
+ final WindowsGraphicsDevice winDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
+ final DefaultGraphicsScreen winScreen = new DefaultGraphicsScreen(winDevice, awtScreen.getIndex());
+ final GraphicsConfigurationFactory configFactory = GraphicsConfigurationFactory.getFactory(winDevice, capsChosen);
+ final WindowsWGLGraphicsConfiguration winConfig = (WindowsWGLGraphicsConfiguration)
configFactory.chooseGraphicsConfiguration(capsChosen,
capsRequested,
chooser, winScreen, nativeVisualID);
@@ -115,7 +115,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
throw new GLException("Unable to choose a GraphicsConfiguration: "+capsChosen+",\n\t"+chooser+"\n\t"+winScreen);
}
- GLDrawableFactory drawableFactory = GLDrawableFactory.getFactory(((GLCapabilitiesImmutable)capsChosen).getGLProfile());
+ final GLDrawableFactory drawableFactory = GLDrawableFactory.getFactory(((GLCapabilitiesImmutable)capsChosen).getGLProfile());
GraphicsConfiguration chosenGC = null;
if ( drawableFactory instanceof WindowsWGLDrawableFactory ) {
@@ -133,7 +133,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: Found new AWT PFD ID "+winConfig.getPixelFormatID()+" -> "+winConfig);
}
}
- } catch (GLException gle0) {
+ } catch (final GLException gle0) {
if(DEBUG) {
gle0.printStackTrace();
}
@@ -150,11 +150,11 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
//
// collect all available PFD IDs
- GraphicsConfiguration[] configs = device.getConfigurations();
- int[] pfdIDs = new int[configs.length];
- ArrayHashSet<Integer> pfdIDOSet = new ArrayHashSet<Integer>();
+ final GraphicsConfiguration[] configs = device.getConfigurations();
+ final int[] pfdIDs = new int[configs.length];
+ final ArrayHashSet<Integer> pfdIDOSet = new ArrayHashSet<Integer>();
for (int i = 0; i < configs.length; i++) {
- GraphicsConfiguration gc = configs[i];
+ final GraphicsConfiguration gc = configs[i];
pfdIDs[i] = Win32SunJDKReflection.graphicsConfigurationGetPixelFormatID(gc);
pfdIDOSet.add(new Integer(pfdIDs[i]));
if(DEBUG) {
@@ -165,7 +165,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: PFD IDs: "+pfdIDs.length+", unique: "+pfdIDOSet.size());
}
winConfig.preselectGraphicsConfiguration(drawableFactory, pfdIDs);
- int gcIdx = pfdIDOSet.indexOf(new Integer(winConfig.getPixelFormatID()));
+ final int gcIdx = pfdIDOSet.indexOf(new Integer(winConfig.getPixelFormatID()));
if( 0 > gcIdx ) {
chosenGC = configs[gcIdx];
if(DEBUG) {
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java b/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
index 12e3db3bd..e32177b3d 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
@@ -46,7 +46,7 @@ import com.jogamp.nativewindow.x11.X11GraphicsDevice;
public class GLXUtil {
public static final boolean DEBUG = Debug.debug("GLXUtil");
- public static synchronized boolean isGLXAvailableOnServer(X11GraphicsDevice x11Device) {
+ public static synchronized boolean isGLXAvailableOnServer(final X11GraphicsDevice x11Device) {
if(null == x11Device) {
throw new IllegalArgumentException("null X11GraphicsDevice");
}
@@ -57,14 +57,14 @@ public class GLXUtil {
x11Device.lock();
try {
glXAvailable = GLX.glXQueryExtension(x11Device.getHandle(), null, null);
- } catch (Throwable t) { /* n/a */
+ } catch (final Throwable t) { /* n/a */
} finally {
x11Device.unlock();
}
return glXAvailable;
}
- public static String getGLXClientString(X11GraphicsDevice x11Device, int name) {
+ public static String getGLXClientString(final X11GraphicsDevice x11Device, final int name) {
x11Device.lock();
try {
return GLX.glXGetClientString(x11Device.getHandle(), name);
@@ -72,7 +72,7 @@ public class GLXUtil {
x11Device.unlock();
}
}
- public static String queryGLXServerString(X11GraphicsDevice x11Device, int screen_idx, int name) {
+ public static String queryGLXServerString(final X11GraphicsDevice x11Device, final int screen_idx, final int name) {
x11Device.lock();
try {
return GLX.glXQueryServerString(x11Device.getHandle(), screen_idx, name);
@@ -80,7 +80,7 @@ public class GLXUtil {
x11Device.unlock();
}
}
- public static String queryGLXExtensionsString(X11GraphicsDevice x11Device, int screen_idx) {
+ public static String queryGLXExtensionsString(final X11GraphicsDevice x11Device, final int screen_idx) {
x11Device.lock();
try {
return GLX.glXQueryExtensionsString(x11Device.getHandle(), screen_idx);
@@ -89,7 +89,7 @@ public class GLXUtil {
}
}
- public static VersionNumber getGLXServerVersionNumber(X11GraphicsDevice x11Device) {
+ public static VersionNumber getGLXServerVersionNumber(final X11GraphicsDevice x11Device) {
final IntBuffer major = Buffers.newDirectIntBuffer(1);
final IntBuffer minor = Buffers.newDirectIntBuffer(1);
@@ -102,12 +102,12 @@ public class GLXUtil {
// Work around bugs in ATI's Linux drivers where they report they
// only implement GLX version 1.2 on the server side
if (major.get(0) == 1 && minor.get(0) == 2) {
- String str = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VERSION);
+ final String str = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VERSION);
try {
// e.g. "1.3"
major.put(0, Integer.valueOf(str.substring(0, 1)).intValue());
minor.put(0, Integer.valueOf(str.substring(2, 3)).intValue());
- } catch (Exception e) {
+ } catch (final Exception e) {
major.put(0, 1);
minor.put(0, 2);
}
@@ -118,18 +118,18 @@ public class GLXUtil {
return new VersionNumber(major.get(0), minor.get(0), 0);
}
- public static boolean isMultisampleAvailable(String extensions) {
+ public static boolean isMultisampleAvailable(final String extensions) {
if (extensions != null) {
return (extensions.indexOf("GLX_ARB_multisample") >= 0);
}
return false;
}
- public static boolean isVendorNVIDIA(String vendor) {
+ public static boolean isVendorNVIDIA(final String vendor) {
return vendor != null && vendor.startsWith("NVIDIA") ;
}
- public static boolean isVendorATI(String vendor) {
+ public static boolean isVendorATI(final String vendor) {
return vendor != null && vendor.startsWith("ATI") ;
}
@@ -143,7 +143,7 @@ public class GLXUtil {
return clientVersionNumber;
}
- public static synchronized void initGLXClientDataSingleton(X11GraphicsDevice x11Device) {
+ public static synchronized void initGLXClientDataSingleton(final X11GraphicsDevice x11Device) {
if(null != clientVendorName) {
return; // already initialized
}
@@ -156,14 +156,14 @@ public class GLXUtil {
clientMultisampleAvailable = isMultisampleAvailable(GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_EXTENSIONS));
clientVendorName = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VENDOR);
- int[] major = new int[1];
- int[] minor = new int[1];
+ final int[] major = new int[1];
+ final int[] minor = new int[1];
final String str = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VERSION);
try {
// e.g. "1.3"
major[0] = Integer.valueOf(str.substring(0, 1)).intValue();
minor[0] = Integer.valueOf(str.substring(2, 3)).intValue();
- } catch (Exception e) {
+ } catch (final Exception e) {
major[0] = 1;
minor[0] = 2;
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
index 45c666230..7040621be 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
@@ -58,7 +58,7 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
public class X11ExternalGLXContext extends X11GLXContext {
- private X11ExternalGLXContext(Drawable drawable, long ctx) {
+ private X11ExternalGLXContext(final Drawable drawable, final long ctx) {
super(drawable, null);
this.contextHandle = ctx;
GLContextShareSet.contextCreated(this);
@@ -68,20 +68,20 @@ public class X11ExternalGLXContext extends X11GLXContext {
getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
}
- protected static X11ExternalGLXContext create(GLDrawableFactory factory, GLProfile glp) {
- long ctx = GLX.glXGetCurrentContext();
+ protected static X11ExternalGLXContext create(final GLDrawableFactory factory, final GLProfile glp) {
+ final long ctx = GLX.glXGetCurrentContext();
if (ctx == 0) {
throw new GLException("Error: current context null");
}
- long display = GLX.glXGetCurrentDisplay();
+ final long display = GLX.glXGetCurrentDisplay();
if (display == 0) {
throw new GLException("Error: current display null");
}
- long drawable = GLX.glXGetCurrentDrawable();
+ final long drawable = GLX.glXGetCurrentDrawable();
if (drawable == 0) {
throw new GLException("Error: attempted to make an external GLDrawable without a drawable/context current");
}
- IntBuffer val = Buffers.newDirectIntBuffer(1);
+ final IntBuffer val = Buffers.newDirectIntBuffer(1);
int w, h;
GLX.glXQueryDrawable(display, drawable, GLX.GLX_WIDTH, val);
@@ -90,7 +90,7 @@ public class X11ExternalGLXContext extends X11GLXContext {
h=val.get(0);
GLX.glXQueryContext(display, ctx, GLX.GLX_SCREEN, val);
- X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
+ final X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
GLX.glXQueryContext(display, ctx, GLX.GLX_FBCONFIG_ID, val);
X11GLXGraphicsConfiguration cfg = null;
@@ -99,7 +99,7 @@ public class X11ExternalGLXContext extends X11GLXContext {
// create and use a default config (this has been observed when running on CentOS 5.5 inside
// of VMWare Server 2.0 with the Mesa 6.5.1 drivers)
if( VisualIDHolder.VID_UNDEFINED == val.get(0) || !X11GLXGraphicsConfiguration.GLXFBConfigIDValid(display, x11Screen.getIndex(), val.get(0)) ) {
- GLCapabilities glcapsDefault = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities glcapsDefault = new GLCapabilities(GLProfile.getDefault());
cfg = X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(glcapsDefault, glcapsDefault, null, x11Screen, VisualIDHolder.VID_UNDEFINED);
if(DEBUG) {
System.err.println("X11ExternalGLXContext invalid FBCONFIG_ID "+val.get(0)+", using default cfg: " + cfg);
@@ -131,12 +131,12 @@ public class X11ExternalGLXContext extends X11GLXContext {
// Need to provide the display connection to extension querying APIs
static class Drawable extends X11GLXDrawable {
- Drawable(GLDrawableFactory factory, NativeSurface comp) {
+ Drawable(final GLDrawableFactory factory, final NativeSurface comp) {
super(factory, comp, true);
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
throw new GLException("Should not call this");
}
@@ -150,7 +150,7 @@ public class X11ExternalGLXContext extends X11GLXContext {
throw new GLException("Should not call this");
}
- public void setSize(int width, int height) {
+ public void setSize(final int width, final int height) {
throw new GLException("Should not call this");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
index 650fd31d3..2076ce454 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
@@ -55,30 +55,30 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
public class X11ExternalGLXDrawable extends X11GLXDrawable {
- private X11ExternalGLXDrawable(GLDrawableFactory factory, NativeSurface surface) {
+ private X11ExternalGLXDrawable(final GLDrawableFactory factory, final NativeSurface surface) {
super(factory, surface, true);
}
- protected static X11ExternalGLXDrawable create(GLDrawableFactory factory, GLProfile glp) {
- long context = GLX.glXGetCurrentContext();
+ protected static X11ExternalGLXDrawable create(final GLDrawableFactory factory, final GLProfile glp) {
+ final long context = GLX.glXGetCurrentContext();
if (context == 0) {
throw new GLException("Error: current context null");
}
- long display = GLX.glXGetCurrentDisplay();
+ final long display = GLX.glXGetCurrentDisplay();
if (display == 0) {
throw new GLException("Error: current display null");
}
- long drawable = GLX.glXGetCurrentDrawable();
+ final long drawable = GLX.glXGetCurrentDrawable();
if (drawable == 0) {
throw new GLException("Error: attempted to make an external GLDrawable without a drawable current");
}
- IntBuffer val = Buffers.newDirectIntBuffer(1);
+ final IntBuffer val = Buffers.newDirectIntBuffer(1);
GLX.glXQueryContext(display, context, GLX.GLX_SCREEN, val);
- X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
+ final X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
GLX.glXQueryContext(display, context, GLX.GLX_FBCONFIG_ID, val);
- X11GLXGraphicsConfiguration cfg = X11GLXGraphicsConfiguration.create(glp, x11Screen, val.get(0));
+ final X11GLXGraphicsConfiguration cfg = X11GLXGraphicsConfiguration.create(glp, x11Screen, val.get(0));
int w, h;
GLX.glXQueryDrawable(display, drawable, GLX.GLX_WIDTH, val);
@@ -96,16 +96,16 @@ public class X11ExternalGLXDrawable extends X11GLXDrawable {
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new Context(this, shareWith);
}
- public void setSize(int newWidth, int newHeight) {
+ public void setSize(final int newWidth, final int newHeight) {
throw new GLException("Should not call this");
}
class Context extends X11GLXContext {
- Context(X11GLXDrawable drawable, GLContext shareWith) {
+ Context(final X11GLXDrawable drawable, final GLContext shareWith) {
super(drawable, shareWith);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java
index e0b69ffd4..36e791641 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java
@@ -41,14 +41,14 @@ public class X11GLCapabilities extends GLCapabilities {
final private long fbcfg;
final private int fbcfgid;
- public X11GLCapabilities(XVisualInfo xVisualInfo, long fbcfg, int fbcfgid, GLProfile glp) {
+ public X11GLCapabilities(final XVisualInfo xVisualInfo, final long fbcfg, final int fbcfgid, final GLProfile glp) {
super(glp);
this.xVisualInfo = xVisualInfo;
this.fbcfg = fbcfg;
this.fbcfgid = fbcfgid;
}
- public X11GLCapabilities(XVisualInfo xVisualInfo, GLProfile glp) {
+ public X11GLCapabilities(final XVisualInfo xVisualInfo, final GLProfile glp) {
super(glp);
this.xVisualInfo = xVisualInfo;
this.fbcfg = 0;
@@ -64,7 +64,7 @@ public class X11GLCapabilities extends GLCapabilities {
public Object clone() {
try {
return super.clone();
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
throw new GLException(e);
}
}
@@ -78,7 +78,7 @@ public class X11GLCapabilities extends GLCapabilities {
final public boolean hasFBConfig() { return 0!=fbcfg && fbcfgid!=VisualIDHolder.VID_UNDEFINED; }
@Override
- final public int getVisualID(VIDType type) throws NativeWindowException {
+ final public int getVisualID(final VIDType type) throws NativeWindowException {
switch(type) {
case INTRINSIC:
case NATIVE:
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
index 57d39d533..d4c3abc49 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
@@ -94,13 +94,13 @@ public class X11GLXContext extends GLContextImpl {
extensionNameMap.put(GLExtensions.ARB_pixel_format, X11GLXDrawableFactory.GLX_SGIX_pbuffer); // good enough
}
- X11GLXContext(GLDrawableImpl drawable,
- GLContext shareWith) {
+ X11GLXContext(final GLDrawableImpl drawable,
+ final GLContext shareWith) {
super(drawable, shareWith);
}
@Override
- protected void resetStates(boolean isInit) {
+ protected void resetStates(final boolean isInit) {
// no inner state _glXExt=null;
glXExtProcAddressTable = null;
hasSwapInterval = 0;
@@ -159,7 +159,7 @@ public class X11GLXContext extends GLContextImpl {
return isGLXVersionGreaterEqualOneThree();
}
- private final boolean glXMakeContextCurrent(long dpy, long writeDrawable, long readDrawable, long ctx) {
+ private final boolean glXMakeContextCurrent(final long dpy, final long writeDrawable, final long readDrawable, final long ctx) {
boolean res = false;
try {
@@ -173,7 +173,7 @@ public class X11GLXContext extends GLContextImpl {
// should not happen due to 'isGLReadDrawableAvailable()' query in GLContextImpl
throw new InternalError("Given readDrawable but no driver support");
}
- } catch (RuntimeException re) {
+ } catch (final RuntimeException re) {
if( DEBUG_TRACE_SWITCH ) {
System.err.println(getThreadName()+": Warning: X11GLXContext.glXMakeContextCurrent failed: "+re+", with "+
"dpy "+toHexString(dpy)+
@@ -187,7 +187,7 @@ public class X11GLXContext extends GLContextImpl {
}
@Override
- protected void destroyContextARBImpl(long ctx) {
+ protected void destroyContextARBImpl(final long ctx) {
final long display = drawable.getNativeSurface().getDisplayHandle();
glXMakeContextCurrent(display, 0, 0, 0);
@@ -207,22 +207,22 @@ public class X11GLXContext extends GLContextImpl {
};
@Override
- protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+ protected long createContextARBImpl(final long share, final boolean direct, final int ctp, final int major, final int minor) {
updateGLXProcAddressTable();
- GLXExt _glXExt = getGLXExt();
+ final GLXExt _glXExt = getGLXExt();
if(DEBUG) {
System.err.println(getThreadName()+": X11GLXContext.createContextARBImpl: "+getGLVersion(major, minor, ctp, "@creation") +
", handle "+toHexString(drawable.getHandle()) + ", share "+toHexString(share)+", direct "+direct+
", glXCreateContextAttribsARB: "+toHexString(glXExtProcAddressTable._addressof_glXCreateContextAttribsARB));
}
- boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
- boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
- boolean ctDebug = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
+ final boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
+ final boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
+ final boolean ctDebug = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
long ctx=0;
- IntBuffer attribs = Buffers.newDirectIntBuffer(ctx_arb_attribs_rom);
+ final IntBuffer attribs = Buffers.newDirectIntBuffer(ctx_arb_attribs_rom);
attribs.put(ctx_arb_attribs_idx_major + 1, major);
attribs.put(ctx_arb_attribs_idx_minor + 1, minor);
@@ -246,8 +246,8 @@ public class X11GLXContext extends GLContextImpl {
attribs.put(ctx_arb_attribs_idx_flags + 1, flags);
}
- X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration();
- AbstractGraphicsDevice device = config.getScreen().getDevice();
+ final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration();
+ final AbstractGraphicsDevice device = config.getScreen().getDevice();
final long display = device.getHandle();
try {
@@ -256,9 +256,9 @@ public class X11GLXContext extends GLContextImpl {
X11Util.setX11ErrorHandler(true, DEBUG ? false : true); // make sure X11 error handler is set
X11Lib.XSync(display, false);
ctx = _glXExt.glXCreateContextAttribsARB(display, config.getFBConfig(), share, direct, attribs);
- } catch (RuntimeException re) {
+ } catch (final RuntimeException re) {
if(DEBUG) {
- Throwable t = new Throwable(getThreadName()+": Info: X11GLXContext.createContextARBImpl glXCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
+ final Throwable t = new Throwable(getThreadName()+": Info: X11GLXContext.createContextARBImpl glXCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
t.printStackTrace();
}
}
@@ -291,7 +291,7 @@ public class X11GLXContext extends GLContextImpl {
final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration();
final AbstractGraphicsDevice device = config.getScreen().getDevice();
final X11GLXContext sharedContext = (X11GLXContext) factory.getOrCreateSharedContext(device);
- long display = device.getHandle();
+ final long display = device.getHandle();
if ( 0 != shareWithHandle ) {
direct = GLX.glXIsDirect(display, shareWithHandle);
@@ -410,7 +410,7 @@ public class X11GLXContext extends GLContextImpl {
@Override
protected void makeCurrentImpl() throws GLException {
- long dpy = drawable.getNativeSurface().getDisplayHandle();
+ final long dpy = drawable.getNativeSurface().getDisplayHandle();
if (GLX.glXGetCurrentContext() != contextHandle) {
if (!glXMakeContextCurrent(dpy, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
@@ -426,7 +426,7 @@ public class X11GLXContext extends GLContextImpl {
@Override
protected void releaseImpl() throws GLException {
- long display = drawable.getNativeSurface().getDisplayHandle();
+ final long display = drawable.getNativeSurface().getDisplayHandle();
if (!glXMakeContextCurrent(display, 0, 0, 0)) {
throw new GLException(getThreadName()+": Error freeing OpenGL context");
}
@@ -438,10 +438,10 @@ public class X11GLXContext extends GLContextImpl {
}
@Override
- protected void copyImpl(GLContext source, int mask) throws GLException {
- long dst = getHandle();
- long src = source.getHandle();
- long display = drawable.getNativeSurface().getDisplayHandle();
+ protected void copyImpl(final GLContext source, final int mask) throws GLException {
+ final long dst = getHandle();
+ final long src = source.getHandle();
+ final long display = drawable.getNativeSurface().getDisplayHandle();
if (0 == display) {
throw new GLException(getThreadName()+": Connection to X display not yet set up");
}
@@ -482,7 +482,7 @@ public class X11GLXContext extends GLContextImpl {
protected final StringBuilder getPlatformExtensionsStringImpl() {
final NativeSurface ns = drawable.getNativeSurface();
final X11GraphicsDevice x11Device = (X11GraphicsDevice) ns.getGraphicsConfiguration().getScreen().getDevice();
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
x11Device.lock();
try{
if (DEBUG) {
@@ -519,7 +519,7 @@ public class X11GLXContext extends GLContextImpl {
}
@Override
- protected boolean setSwapIntervalImpl(int interval) {
+ protected boolean setSwapIntervalImpl(final int interval) {
if( !drawable.getChosenGLCapabilities().isOnscreen() ) { return false; }
final GLXExt glXExt = getGLXExt();
@@ -536,7 +536,7 @@ public class X11GLXContext extends GLContextImpl {
} else {
hasSwapInterval = -1;
}
- } catch (Throwable t) { hasSwapInterval=-1; }
+ } catch (final Throwable t) { hasSwapInterval=-1; }
}
/* try {
switch( hasSwapInterval ) {
@@ -549,16 +549,16 @@ public class X11GLXContext extends GLContextImpl {
if (2 == hasSwapInterval) {
try {
return 0 == glXExt.glXSwapIntervalSGI(interval);
- } catch (Throwable t) { hasSwapInterval=-1; }
+ } catch (final Throwable t) { hasSwapInterval=-1; }
}
return false;
}
- private final int initSwapGroupImpl(GLXExt glXExt) {
+ private final int initSwapGroupImpl(final GLXExt glXExt) {
if(0==hasSwapGroupNV) {
try {
hasSwapGroupNV = glXExt.isExtensionAvailable(GLXExtensions.GLX_NV_swap_group)?1:-1;
- } catch (Throwable t) { hasSwapGroupNV=1; }
+ } catch (final Throwable t) { hasSwapGroupNV=1; }
if(DEBUG) {
System.err.println("initSwapGroupImpl: "+GLXExtensions.GLX_NV_swap_group+": "+hasSwapGroupNV);
}
@@ -567,10 +567,10 @@ public class X11GLXContext extends GLContextImpl {
}
@Override
- protected final boolean queryMaxSwapGroupsImpl(int[] maxGroups, int maxGroups_offset,
- int[] maxBarriers, int maxBarriers_offset) {
+ protected final boolean queryMaxSwapGroupsImpl(final int[] maxGroups, final int maxGroups_offset,
+ final int[] maxBarriers, final int maxBarriers_offset) {
boolean res = false;
- GLXExt glXExt = getGLXExt();
+ final GLXExt glXExt = getGLXExt();
if (initSwapGroupImpl(glXExt)>0) {
final NativeSurface ns = drawable.getNativeSurface();
try {
@@ -583,53 +583,53 @@ public class X11GLXContext extends GLContextImpl {
maxBarriersNIO.get(maxGroups, maxGroups_offset, maxBarriersNIO.remaining());
res = true;
}
- } catch (Throwable t) { hasSwapGroupNV=-1; }
+ } catch (final Throwable t) { hasSwapGroupNV=-1; }
}
return res;
}
@Override
- protected final boolean joinSwapGroupImpl(int group) {
+ protected final boolean joinSwapGroupImpl(final int group) {
boolean res = false;
- GLXExt glXExt = getGLXExt();
+ final GLXExt glXExt = getGLXExt();
if (initSwapGroupImpl(glXExt)>0) {
try {
if( glXExt.glXJoinSwapGroupNV(drawable.getNativeSurface().getDisplayHandle(), drawable.getHandle(), group) ) {
currentSwapGroup = group;
res = true;
}
- } catch (Throwable t) { hasSwapGroupNV=-1; }
+ } catch (final Throwable t) { hasSwapGroupNV=-1; }
}
return res;
}
@Override
- protected final boolean bindSwapBarrierImpl(int group, int barrier) {
+ protected final boolean bindSwapBarrierImpl(final int group, final int barrier) {
boolean res = false;
- GLXExt glXExt = getGLXExt();
+ final GLXExt glXExt = getGLXExt();
if (initSwapGroupImpl(glXExt)>0) {
try {
if( glXExt.glXBindSwapBarrierNV(drawable.getNativeSurface().getDisplayHandle(), group, barrier) ) {
res = true;
}
- } catch (Throwable t) { hasSwapGroupNV=-1; }
+ } catch (final Throwable t) { hasSwapGroupNV=-1; }
}
return res;
}
@Override
- public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
+ public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) {
return getGLXExt().glXAllocateMemoryNV(size, readFrequency, writeFrequency, priority);
}
@Override
- public final void glFreeMemoryNV(ByteBuffer pointer) {
+ public final void glFreeMemoryNV(final ByteBuffer pointer) {
getGLXExt().glXFreeMemoryNV(pointer);
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
super.append(sb);
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java
index 155c00c4c..c29bc3bc3 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java
@@ -47,7 +47,7 @@ import jogamp.opengl.GLDrawableImpl;
import jogamp.opengl.GLDynamicLookupHelper;
public abstract class X11GLXDrawable extends GLDrawableImpl {
- protected X11GLXDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
+ protected X11GLXDrawable(final GLDrawableFactory factory, final NativeSurface comp, final boolean realized) {
super(factory, comp, realized);
}
@@ -59,7 +59,7 @@ public abstract class X11GLXDrawable extends GLDrawableImpl {
@Override
protected void setRealizedImpl() {
if(realized) {
- X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
+ final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
config.updateGraphicsConfiguration();
if (DEBUG) {
@@ -69,7 +69,7 @@ public abstract class X11GLXDrawable extends GLDrawableImpl {
}
@Override
- protected final void swapBuffersImpl(boolean doubleBuffered) {
+ protected final void swapBuffersImpl(final boolean doubleBuffered) {
if(doubleBuffered) {
GLX.glXSwapBuffers(getNativeSurface().getDisplayHandle(), getHandle());
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
index f7938f463..fbab32963 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
@@ -103,7 +103,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
if(null!=tmp && tmp.isLibComplete()) {
GLX.getGLXProcAddressTable().reset(tmp);
}
- } catch (Exception ex) {
+ } catch (final Exception ex) {
tmp = null;
if(DEBUG) {
ex.printStackTrace();
@@ -159,7 +159,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
+ public final GLDynamicLookupHelper getGLDynamicLookupHelper(final int profile) {
return x11GLXDynamicLookupHelper;
}
@@ -180,9 +180,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
GLDrawableImpl drawable;
GLContextImpl context;
- SharedResource(X11GraphicsDevice dev, X11GraphicsScreen scrn,
- GLDrawableImpl draw, GLContextImpl ctx,
- VersionNumber glXServerVer, String glXServerVendor, boolean glXServerMultisampleAvail) {
+ SharedResource(final X11GraphicsDevice dev, final X11GraphicsScreen scrn,
+ final GLDrawableImpl draw, final GLContextImpl ctx,
+ final VersionNumber glXServerVer, final String glXServerVendor, final boolean glXServerMultisampleAvail) {
device = dev;
screen = scrn;
drawable = draw;
@@ -227,11 +227,11 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
sharedMap.clear();
}
@Override
- public SharedResourceRunner.Resource mapPut(String connection, SharedResourceRunner.Resource resource) {
+ public SharedResourceRunner.Resource mapPut(final String connection, final SharedResourceRunner.Resource resource) {
return sharedMap.put(connection, resource);
}
@Override
- public SharedResourceRunner.Resource mapGet(String connection) {
+ public SharedResourceRunner.Resource mapGet(final String connection) {
return sharedMap.get(connection);
}
@Override
@@ -240,7 +240,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public boolean isDeviceSupported(String connection) {
+ public boolean isDeviceSupported(final String connection) {
final boolean res;
final X11GraphicsDevice x11Device = new X11GraphicsDevice(X11Util.openDisplay(connection), AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
x11Device.lock();
@@ -257,7 +257,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public SharedResourceRunner.Resource createSharedResource(String connection) {
+ public SharedResourceRunner.Resource createSharedResource(final String connection) {
final X11GraphicsDevice sharedDevice = new X11GraphicsDevice(X11Util.openDisplay(connection), AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
sharedDevice.lock();
try {
@@ -312,7 +312,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return new SharedResource(sharedDevice, sharedScreen, sharedDrawable, sharedContext,
glXServerVersion, glXServerVendorName,
glXServerMultisampleAvailable && GLXUtil.isClientMultisampleAvailable());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new GLException("X11GLXDrawableFactory - Could not initialize shared resources for "+connection, t);
} finally {
sharedDevice.unlock();
@@ -320,8 +320,8 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public void releaseSharedResource(SharedResourceRunner.Resource shared) {
- SharedResource sr = (SharedResource) shared;
+ public void releaseSharedResource(final SharedResourceRunner.Resource shared) {
+ final SharedResource sr = (SharedResource) shared;
if (DEBUG) {
System.err.println("Shutdown Shared:");
System.err.println("Device : " + sr.device);
@@ -361,7 +361,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+ public final boolean getIsDeviceCompatible(final AbstractGraphicsDevice device) {
if(null != x11GLXDynamicLookupHelper && device instanceof X11GraphicsDevice) {
return true;
}
@@ -374,11 +374,11 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice device) {
+ protected final SharedResource getOrCreateSharedResourceImpl(final AbstractGraphicsDevice device) {
return (SharedResource) sharedResourceRunner.getOrCreateShared(device);
}
- protected final long getOrCreateSharedDpy(AbstractGraphicsDevice device) {
+ protected final long getOrCreateSharedDpy(final AbstractGraphicsDevice device) {
final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
if(null!=sr) {
return sr.getDevice().getHandle();
@@ -387,12 +387,12 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+ protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(final AbstractGraphicsDevice device) {
return X11GLXGraphicsConfigurationFactory.getAvailableCapabilities(this, device);
}
@Override
- protected final GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+ protected final GLDrawableImpl createOnscreenDrawableImpl(final NativeSurface target) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
@@ -400,19 +400,19 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
+ protected final GLDrawableImpl createOffscreenDrawableImpl(final NativeSurface target) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
- AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
- GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+ final AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
+ final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
if(!caps.isPBuffer()) {
return new X11PixmapGLXDrawable(this, target);
}
// PBuffer GLDrawable Creation
GLDrawableImpl pbufferDrawable;
- AbstractGraphicsDevice device = config.getScreen().getDevice();
+ final AbstractGraphicsDevice device = config.getScreen().getDevice();
/**
* Due to the ATI Bug https://bugzilla.mozilla.org/show_bug.cgi?id=486277,
@@ -420,7 +420,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
* The dummy context shall also use the same Display,
* since switching Display in this regard is another ATI bug.
*/
- SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+ final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
if( null!=sr && sr.isGLXVendorATI() && null == GLContext.getCurrent() ) {
sr.getContext().makeCurrent();
try {
@@ -434,9 +434,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return pbufferDrawable;
}
- public final boolean isGLXMultisampleAvailable(AbstractGraphicsDevice device) {
+ public final boolean isGLXMultisampleAvailable(final AbstractGraphicsDevice device) {
if(null != device) {
- SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+ final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
if(null!=sr) {
return sr.isGLXMultisampleAvailable();
}
@@ -444,9 +444,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return false;
}
- public final VersionNumber getGLXVersionNumber(AbstractGraphicsDevice device) {
+ public final VersionNumber getGLXVersionNumber(final AbstractGraphicsDevice device) {
if(null != device) {
- SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+ final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
if(null!=sr) {
return sr.getGLXVersion();
}
@@ -457,9 +457,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return null;
}
- public final boolean isGLXVersionGreaterEqualOneOne(AbstractGraphicsDevice device) {
+ public final boolean isGLXVersionGreaterEqualOneOne(final AbstractGraphicsDevice device) {
if(null != device) {
- SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+ final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
if(null!=sr) {
return sr.isGLXVersionGreaterEqualOneOne();
}
@@ -471,9 +471,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return false;
}
- public final boolean isGLXVersionGreaterEqualOneThree(AbstractGraphicsDevice device) {
+ public final boolean isGLXVersionGreaterEqualOneThree(final AbstractGraphicsDevice device) {
if(null != device) {
- SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+ final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
if(null!=sr) {
return sr.isGLXVersionGreaterEqualOneThree();
}
@@ -486,9 +486,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) {
+ public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device, final GLProfile glp) {
if(null == device) {
- SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(defaultDevice);
+ final SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(defaultDevice);
if(null!=sr) {
device = sr.getDevice();
}
@@ -497,10 +497,10 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable capsChosen,
- GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
+ protected final ProxySurface createMutableSurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+ final GLCapabilitiesImmutable capsChosen,
+ final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstreamHook) {
final X11GraphicsDevice device;
if( createNewDevice || !(deviceReq instanceof X11GraphicsDevice) ) {
device = new X11GraphicsDevice(X11Util.openDisplay(deviceReq.getConnection()), deviceReq.getUnitID(), true /* owner */);
@@ -516,14 +516,14 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
+ public final ProxySurface createDummySurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+ GLCapabilitiesImmutable chosenCaps, final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser chooser, final int width, final int height) {
chosenCaps = GLGraphicsConfigurationUtil.fixOnscreenGLCapabilities(chosenCaps);
return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser, new X11DummyUpstreamSurfaceHook(width, height));
}
@Override
- protected final ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
+ protected final ProxySurface createProxySurfaceImpl(final AbstractGraphicsDevice deviceReq, final int screenIdx, final long windowHandle, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstream) {
final X11GraphicsDevice device = new X11GraphicsDevice(X11Util.openDisplay(deviceReq.getConnection()), deviceReq.getUnitID(), true /* owner */);
final X11GraphicsScreen screen = new X11GraphicsScreen(device, screenIdx);
final int xvisualID = X11Lib.GetVisualIDFromWindow(device.getHandle(), windowHandle);
@@ -546,7 +546,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+ public final boolean canCreateExternalGLDrawable(final AbstractGraphicsDevice device) {
return canCreateGLPbuffer(device, null /* GLProfile not used for query on X11 */);
}
@@ -567,13 +567,13 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return gammaRampLength;
}
- long display = getOrCreateSharedDpy(defaultDevice);
+ final long display = getOrCreateSharedDpy(defaultDevice);
if(0 == display) {
return 0;
}
- int[] size = new int[1];
- boolean res = X11Lib.XF86VidModeGetGammaRampSize(display,
+ final int[] size = new int[1];
+ final boolean res = X11Lib.XF86VidModeGetGammaRampSize(display,
X11Lib.DefaultScreen(display),
size, 0);
if (!res) {
@@ -585,19 +585,19 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final boolean setGammaRamp(float[] ramp) {
- long display = getOrCreateSharedDpy(defaultDevice);
+ protected final boolean setGammaRamp(final float[] ramp) {
+ final long display = getOrCreateSharedDpy(defaultDevice);
if(0 == display) {
return false;
}
- int len = ramp.length;
- short[] rampData = new short[len];
+ final int len = ramp.length;
+ final short[] rampData = new short[len];
for (int i = 0; i < len; i++) {
rampData[i] = (short) (ramp[i] * 65535);
}
- boolean res = X11Lib.XF86VidModeSetGammaRamp(display,
+ final boolean res = X11Lib.XF86VidModeSetGammaRamp(display,
X11Lib.DefaultScreen(display),
rampData.length,
rampData, 0,
@@ -608,24 +608,24 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
@Override
protected final Buffer getGammaRamp() {
- long display = getOrCreateSharedDpy(defaultDevice);
+ final long display = getOrCreateSharedDpy(defaultDevice);
if(0 == display) {
return null;
}
- int size = getGammaRampLength();
- ShortBuffer rampData = ShortBuffer.wrap(new short[3 * size]);
+ final int size = getGammaRampLength();
+ final ShortBuffer rampData = ShortBuffer.wrap(new short[3 * size]);
rampData.position(0);
rampData.limit(size);
- ShortBuffer redRampData = rampData.slice();
+ final ShortBuffer redRampData = rampData.slice();
rampData.position(size);
rampData.limit(2 * size);
- ShortBuffer greenRampData = rampData.slice();
+ final ShortBuffer greenRampData = rampData.slice();
rampData.position(2 * size);
rampData.limit(3 * size);
- ShortBuffer blueRampData = rampData.slice();
+ final ShortBuffer blueRampData = rampData.slice();
- boolean res = X11Lib.XF86VidModeGetGammaRamp(display,
+ final boolean res = X11Lib.XF86VidModeGetGammaRamp(display,
X11Lib.DefaultScreen(display),
size,
redRampData,
@@ -638,30 +638,30 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final void resetGammaRamp(Buffer originalGammaRamp) {
+ protected final void resetGammaRamp(final Buffer originalGammaRamp) {
if (originalGammaRamp == null) {
return; // getGammaRamp failed originally
}
- long display = getOrCreateSharedDpy(defaultDevice);
+ final long display = getOrCreateSharedDpy(defaultDevice);
if(0 == display) {
return;
}
- ShortBuffer rampData = (ShortBuffer) originalGammaRamp;
- int capacity = rampData.capacity();
+ final ShortBuffer rampData = (ShortBuffer) originalGammaRamp;
+ final int capacity = rampData.capacity();
if ((capacity % 3) != 0) {
throw new IllegalArgumentException("Must not be the original gamma ramp");
}
- int size = capacity / 3;
+ final int size = capacity / 3;
rampData.position(0);
rampData.limit(size);
- ShortBuffer redRampData = rampData.slice();
+ final ShortBuffer redRampData = rampData.slice();
rampData.position(size);
rampData.limit(2 * size);
- ShortBuffer greenRampData = rampData.slice();
+ final ShortBuffer greenRampData = rampData.slice();
rampData.position(2 * size);
rampData.limit(3 * size);
- ShortBuffer blueRampData = rampData.slice();
+ final ShortBuffer blueRampData = rampData.slice();
X11Lib.XF86VidModeSetGammaRamp(display,
X11Lib.DefaultScreen(display),
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
index 951174f71..0e91a6a65 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
@@ -62,14 +62,14 @@ public final class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibrar
@Override
public final List<String> getToolGetProcAddressFuncNameList() {
- List<String> res = new ArrayList<String>();
+ final List<String> res = new ArrayList<String>();
res.add("glXGetProcAddressARB");
res.add("glXGetProcAddress");
return res;
}
@Override
- public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+ public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
return GLX.glXGetProcAddress(toolGetProcAddressHandle, funcName);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
index c0a3b46df..5f6a6b344 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
@@ -65,8 +65,8 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
public static final int MAX_ATTRIBS = 128;
private final GLCapabilitiesChooser chooser;
- X11GLXGraphicsConfiguration(X11GraphicsScreen screen,
- X11GLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+ X11GLXGraphicsConfiguration(final X11GraphicsScreen screen,
+ final X11GLCapabilities capsChosen, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser) {
super(screen, capsChosen, capsRequested, capsChosen.getXVisualInfo());
this.chooser=chooser;
}
@@ -109,7 +109,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
}
}
- static X11GLXGraphicsConfiguration create(GLProfile glp, X11GraphicsScreen x11Screen, int fbcfgID) {
+ static X11GLXGraphicsConfiguration create(GLProfile glp, final X11GraphicsScreen x11Screen, final int fbcfgID) {
final X11GraphicsDevice device = (X11GraphicsDevice) x11Screen.getDevice();
final long display = device.getHandle();
if(0==display) {
@@ -131,11 +131,11 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return new X11GLXGraphicsConfiguration(x11Screen, caps, caps, new DefaultGLCapabilitiesChooser());
}
- static IntBuffer GLCapabilities2AttribList(GLCapabilitiesImmutable caps,
- boolean forFBAttr, boolean isMultisampleAvailable,
- long display, int screen)
+ static IntBuffer GLCapabilities2AttribList(final GLCapabilitiesImmutable caps,
+ final boolean forFBAttr, final boolean isMultisampleAvailable,
+ final long display, final int screen)
{
- int colorDepth = (caps.getRedBits() +
+ final int colorDepth = (caps.getRedBits() +
caps.getGreenBits() +
caps.getBlueBits());
if (colorDepth < 15) {
@@ -237,12 +237,12 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
// FBConfig
- static boolean GLXFBConfigIDValid(long display, int screen, int fbcfgid) {
- long fbcfg = X11GLXGraphicsConfiguration.glXFBConfigID2FBConfig(display, screen, fbcfgid);
+ static boolean GLXFBConfigIDValid(final long display, final int screen, final int fbcfgid) {
+ final long fbcfg = X11GLXGraphicsConfiguration.glXFBConfigID2FBConfig(display, screen, fbcfgid);
return (0 != fbcfg) ? X11GLXGraphicsConfiguration.GLXFBConfigValid( display, fbcfg ) : false ;
}
- static boolean GLXFBConfigValid(long display, long fbcfg) {
+ static boolean GLXFBConfigValid(final long display, final long fbcfg) {
final IntBuffer tmp = Buffers.newDirectIntBuffer(1);
if(GLX.GLX_BAD_ATTRIBUTE == GLX.glXGetFBConfigAttrib(display, fbcfg, GLX.GLX_RENDER_TYPE, tmp)) {
return false;
@@ -275,14 +275,14 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return val;
}
- static XRenderDirectFormat XVisual2XRenderMask(long dpy, long visual) {
- XRenderPictFormat renderPictFmt = X11Lib.XRenderFindVisualFormat(dpy, visual);
+ static XRenderDirectFormat XVisual2XRenderMask(final long dpy, final long visual) {
+ final XRenderPictFormat renderPictFmt = X11Lib.XRenderFindVisualFormat(dpy, visual);
if(null == renderPictFmt) {
return null;
}
return renderPictFmt.getDirect();
}
- static XRenderDirectFormat XVisual2XRenderMask(long dpy, long visual, XRenderPictFormat dest) {
+ static XRenderDirectFormat XVisual2XRenderMask(final long dpy, final long visual, final XRenderPictFormat dest) {
if( !X11Lib.XRenderFindVisualFormat(dpy, visual, dest) ) {
return null;
} else {
@@ -298,7 +298,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
}
static List<GLCapabilitiesImmutable> GLXFBConfig2GLCapabilities(final X11GraphicsDevice device, final GLProfile glp, final PointerBuffer fbcfgsL,
- final int winattrmask, final boolean isMultisampleAvailable, boolean onlyFirstValid) {
+ final int winattrmask, final boolean isMultisampleAvailable, final boolean onlyFirstValid) {
final IntBuffer tmp = Buffers.newDirectIntBuffer(1);
final XRenderPictFormat xRenderPictFormat= XRenderPictFormat.create();
final List<GLCapabilitiesImmutable> result = new ArrayList<GLCapabilitiesImmutable>();
@@ -424,7 +424,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return (X11GLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, caps);
}
- private static String glXGetFBConfigErrorCode(int err) {
+ private static String glXGetFBConfigErrorCode(final int err) {
switch (err) {
case GLX.GLX_NO_EXTENSION: return "GLX_NO_EXTENSION";
case GLX.GLX_BAD_ATTRIBUTE: return "GLX_BAD_ATTRIBUTE";
@@ -432,7 +432,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
}
}
- static boolean glXGetFBConfig(long display, long cfg, int attrib, IntBuffer tmp) {
+ static boolean glXGetFBConfig(final long display, final long cfg, final int attrib, final IntBuffer tmp) {
if (display == 0) {
throw new GLException("No display connection");
}
@@ -445,7 +445,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return res;
}
- static int glXFBConfig2FBConfigID(long display, long cfg) {
+ static int glXFBConfig2FBConfigID(final long display, final long cfg) {
final IntBuffer tmpID = Buffers.newDirectIntBuffer(1);
if( glXGetFBConfig(display, cfg, GLX.GLX_FBCONFIG_ID, tmpID) ) {
return tmpID.get(0);
@@ -454,11 +454,11 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
}
}
- static long glXFBConfigID2FBConfig(long display, int screen, int id) {
+ static long glXFBConfigID2FBConfig(final long display, final int screen, final int id) {
final IntBuffer attribs = Buffers.newDirectIntBuffer(new int[] { GLX.GLX_FBCONFIG_ID, id, 0 });
final IntBuffer count = Buffers.newDirectIntBuffer(1);
count.put(0, -1);
- PointerBuffer fbcfgsL = GLX.glXChooseFBConfig(display, screen, attribs, count);
+ final PointerBuffer fbcfgsL = GLX.glXChooseFBConfig(display, screen, attribs, count);
if (fbcfgsL == null || fbcfgsL.limit()<1) {
return 0;
}
@@ -467,15 +467,15 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
// Visual Info
- static XVisualInfo XVisualID2XVisualInfo(long display, long visualID) {
- int[] count = new int[1];
- XVisualInfo template = XVisualInfo.create();
+ static XVisualInfo XVisualID2XVisualInfo(final long display, final long visualID) {
+ final int[] count = new int[1];
+ final XVisualInfo template = XVisualInfo.create();
template.setVisualid(visualID);
- XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask, template, count, 0);
+ final XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask, template, count, 0);
if (infos == null || infos.length == 0) {
return null;
}
- XVisualInfo res = XVisualInfo.create(infos[0]);
+ final XVisualInfo res = XVisualInfo.create(infos[0]);
if (DEBUG) {
System.err.println("Fetched XVisualInfo for visual ID " + toHexString(visualID));
System.err.println("Resulting XVisualInfo: visualid = " + toHexString(res.getVisualid()));
@@ -483,8 +483,8 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return res;
}
- static X11GLCapabilities XVisualInfo2GLCapabilities(final X11GraphicsDevice device, GLProfile glp, XVisualInfo info,
- final int winattrmask, boolean isMultisampleEnabled) {
+ static X11GLCapabilities XVisualInfo2GLCapabilities(final X11GraphicsDevice device, final GLProfile glp, final XVisualInfo info,
+ final int winattrmask, final boolean isMultisampleEnabled) {
final int allDrawableTypeBits = GLGraphicsConfigurationUtil.WINDOW_BIT |
GLGraphicsConfigurationUtil.BITMAP_BIT |
GLGraphicsConfigurationUtil.FBO_BIT ;
@@ -512,7 +512,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return null;
}
- GLCapabilities res = new X11GLCapabilities(info, glp);
+ final GLCapabilities res = new X11GLCapabilities(info, glp);
res.setDoubleBuffered(glXGetConfig(display, info, GLX.GLX_DOUBLEBUFFER, tmp) != 0);
res.setStereo (glXGetConfig(display, info, GLX.GLX_STEREO, tmp) != 0);
@@ -551,7 +551,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return (X11GLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
}
- private static String glXGetConfigErrorCode(int err) {
+ private static String glXGetConfigErrorCode(final int err) {
switch (err) {
case GLX.GLX_NO_EXTENSION: return "GLX_NO_EXTENSION";
case GLX.GLX_BAD_SCREEN: return "GLX_BAD_SCREEN";
@@ -561,11 +561,11 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
}
}
- static int glXGetConfig(long display, XVisualInfo info, int attrib, IntBuffer tmp) {
+ static int glXGetConfig(final long display, final XVisualInfo info, final int attrib, final IntBuffer tmp) {
if (display == 0) {
throw new GLException("No display connection");
}
- int res = GLX.glXGetConfig(display, info, attrib, tmp);
+ final int res = GLX.glXGetConfig(display, info, attrib, tmp);
if (res != 0) {
throw new GLException("glXGetConfig("+toHexString(attrib)+") failed: error code " + glXGetConfigErrorCode(res));
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
index 75771f884..44479acc0 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
@@ -94,7 +94,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested, final CapabilitiesChooser chooser, final AbstractGraphicsScreen absScreen, final int nativeVisualID) {
if (!(absScreen instanceof X11GraphicsScreen)) {
throw new IllegalArgumentException("Only X11GraphicsScreen are allowed here");
}
@@ -124,8 +124,8 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
(GLCapabilitiesChooser)chooser, (X11GraphicsScreen)absScreen, nativeVisualID);
}
- protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(X11GLXDrawableFactory factory, AbstractGraphicsDevice device) {
- X11GLXDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
+ protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(final X11GLXDrawableFactory factory, final AbstractGraphicsDevice device) {
+ final X11GLXDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
if(null == sharedResource) {
throw new GLException("Shared resource for device n/a: "+device);
}
@@ -153,7 +153,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
return availableCaps;
}
- static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesFBConfig(X11GraphicsScreen x11Screen, GLProfile glProfile, boolean isMultisampleAvailable) {
+ static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesFBConfig(final X11GraphicsScreen x11Screen, final GLProfile glProfile, final boolean isMultisampleAvailable) {
PointerBuffer fbcfgsL = null;
// Utilizing FBConfig
@@ -184,20 +184,20 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
return availableCaps;
}
- static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesXVisual(X11GraphicsScreen x11Screen, GLProfile glProfile, boolean isMultisampleAvailable) {
+ static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesXVisual(final X11GraphicsScreen x11Screen, final GLProfile glProfile, final boolean isMultisampleAvailable) {
final X11GraphicsDevice absDevice = (X11GraphicsDevice) x11Screen.getDevice();
final long display = absDevice.getHandle();
- int screen = x11Screen.getIndex();
+ final int screen = x11Screen.getIndex();
- int[] count = new int[1];
- XVisualInfo template = XVisualInfo.create();
+ final int[] count = new int[1];
+ final XVisualInfo template = XVisualInfo.create();
template.setScreen(screen);
- XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
+ final XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
if (infos == null || infos.length<1) {
throw new GLException("Error while enumerating available XVisualInfos");
}
- ArrayList<GLCapabilitiesImmutable> availableCaps = new ArrayList<GLCapabilitiesImmutable>();
+ final ArrayList<GLCapabilitiesImmutable> availableCaps = new ArrayList<GLCapabilitiesImmutable>();
for (int i = 0; i < infos.length; i++) {
final GLCapabilitiesImmutable caps = X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(absDevice, glProfile, infos[i], GLGraphicsConfigurationUtil.ALL_BITS, isMultisampleAvailable);
if(null != caps) {
@@ -211,17 +211,17 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
static X11GLXGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
- GLCapabilitiesImmutable capsReq,
- GLCapabilitiesChooser chooser,
- X11GraphicsScreen x11Screen, int xvisualID) {
+ final GLCapabilitiesImmutable capsReq,
+ final GLCapabilitiesChooser chooser,
+ final X11GraphicsScreen x11Screen, final int xvisualID) {
if (x11Screen == null) {
throw new IllegalArgumentException("AbstractGraphicsScreen is null");
}
if (capsChosen == null) {
capsChosen = new GLCapabilities(null);
}
- X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
- X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
+ final X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
+ final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
capsChosen = GLGraphicsConfigurationUtil.fixGLCapabilities( capsChosen, factory, x11Device);
final boolean usePBuffer = !capsChosen.isOnscreen() && capsChosen.isPBuffer();
@@ -250,7 +250,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
return res;
}
- static X11GLXGraphicsConfiguration fetchGraphicsConfigurationFBConfig(X11GraphicsScreen x11Screen, int fbID, GLProfile glp) {
+ static X11GLXGraphicsConfiguration fetchGraphicsConfigurationFBConfig(final X11GraphicsScreen x11Screen, final int fbID, final GLProfile glp) {
final X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
final long display = x11Device.getHandle();
final int screen = x11Screen.getIndex();
@@ -274,19 +274,19 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
return new X11GLXGraphicsConfiguration(x11Screen, caps, caps, new DefaultGLCapabilitiesChooser());
}
- private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationFBConfig(GLCapabilitiesImmutable capsChosen,
- GLCapabilitiesImmutable capsReq,
- GLCapabilitiesChooser chooser,
- X11GraphicsScreen x11Screen, int xvisualID) {
+ private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationFBConfig(final GLCapabilitiesImmutable capsChosen,
+ final GLCapabilitiesImmutable capsReq,
+ final GLCapabilitiesChooser chooser,
+ final X11GraphicsScreen x11Screen, final int xvisualID) {
int recommendedIndex = -1;
PointerBuffer fbcfgsL = null;
- GLProfile glProfile = capsChosen.getGLProfile();
+ final GLProfile glProfile = capsChosen.getGLProfile();
// Utilizing FBConfig
//
- X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
- long display = x11Device.getHandle();
- int screen = x11Screen.getIndex();
+ final X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
+ final long display = x11Device.getHandle();
+ final int screen = x11Screen.getIndex();
final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
final boolean isMultisampleAvailable = factory.isGLXMultisampleAvailable(x11Device);
@@ -379,27 +379,27 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
}
return null;
}
- X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
+ final X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
return new X11GLXGraphicsConfiguration(x11Screen, chosenCaps, capsReq, chooser);
}
- private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationXVisual(GLCapabilitiesImmutable capsChosen,
- GLCapabilitiesImmutable capsReq,
+ private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationXVisual(final GLCapabilitiesImmutable capsChosen,
+ final GLCapabilitiesImmutable capsReq,
GLCapabilitiesChooser chooser,
- X11GraphicsScreen x11Screen, int xvisualID) {
+ final X11GraphicsScreen x11Screen, final int xvisualID) {
if (chooser == null) {
chooser = new DefaultGLCapabilitiesChooser();
}
- GLProfile glProfile = capsChosen.getGLProfile();
+ final GLProfile glProfile = capsChosen.getGLProfile();
final int winattrmask = GLGraphicsConfigurationUtil.getExclusiveWinAttributeBits(capsChosen.isOnscreen(), capsChosen.isFBO(), false /* pbuffer */, capsChosen.isBitmap());
- List<GLCapabilitiesImmutable> availableCaps = new ArrayList<GLCapabilitiesImmutable>();
+ final List<GLCapabilitiesImmutable> availableCaps = new ArrayList<GLCapabilitiesImmutable>();
int recommendedIndex = -1;
- X11GraphicsDevice absDevice = (X11GraphicsDevice) x11Screen.getDevice();
- long display = absDevice.getHandle();
- int screen = x11Screen.getIndex();
+ final X11GraphicsDevice absDevice = (X11GraphicsDevice) x11Screen.getDevice();
+ final long display = absDevice.getHandle();
+ final int screen = x11Screen.getIndex();
final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
final boolean isMultisampleAvailable = factory.isGLXMultisampleAvailable(absDevice);
@@ -421,10 +421,10 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
}
// 2nd choice: get all GLCapabilities available, preferred recommendedIndex might be available if 1st choice was successful
- int[] count = new int[1];
- XVisualInfo template = XVisualInfo.create();
+ final int[] count = new int[1];
+ final XVisualInfo template = XVisualInfo.create();
template.setScreen(screen);
- XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
+ final XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
if (infos == null || infos.length<1) {
throw new GLException("Error while enumerating available XVisualInfos");
}
@@ -451,7 +451,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
if( VisualIDHolder.VID_UNDEFINED != xvisualID ) {
for(int i=0; i<availableCaps.size(); ) {
- VisualIDHolder vidh = availableCaps.get(i);
+ final VisualIDHolder vidh = availableCaps.get(i);
if(vidh.getVisualID(VIDType.X11_XVISUAL) != xvisualID ) {
availableCaps.remove(i);
} else {
@@ -468,7 +468,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
}
}
- int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex);
+ final int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex);
if ( 0 > chosenIndex ) {
if (DEBUG) {
System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationXVisual: failed, return null");
@@ -476,7 +476,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
}
return null;
}
- X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
+ final X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
return new X11GLXGraphicsConfiguration(x11Screen, chosenCaps, capsReq, chooser);
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java
index 9da189290..866662950 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java
@@ -51,7 +51,7 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable {
long glXWindow; // GLXWindow, a GLXDrawable representation
boolean useGLXWindow;
- protected X11OnscreenGLXDrawable(GLDrawableFactory factory, NativeSurface component, boolean realized) {
+ protected X11OnscreenGLXDrawable(final GLDrawableFactory factory, final NativeSurface component, final boolean realized) {
super(factory, component, realized);
glXWindow=0;
useGLXWindow=false;
@@ -84,10 +84,10 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable {
@Override
protected final void createHandle() {
if(USE_GLXWINDOW) {
- X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
+ final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
if(config.getFBConfig()>=0) {
useGLXWindow=true;
- long dpy = getNativeSurface().getDisplayHandle();
+ final long dpy = getNativeSurface().getDisplayHandle();
if(0!=glXWindow) {
GLX.glXDestroyWindow(dpy, glXWindow);
}
@@ -103,7 +103,7 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable {
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new X11GLXContext(this, shareWith);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
index ae2982269..21ad06020 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
@@ -53,7 +53,7 @@ import javax.media.opengl.GLException;
import com.jogamp.common.nio.Buffers;
public class X11PbufferGLXDrawable extends X11GLXDrawable {
- protected X11PbufferGLXDrawable(GLDrawableFactory factory, NativeSurface target) {
+ protected X11PbufferGLXDrawable(final GLDrawableFactory factory, final NativeSurface target) {
/* GLCapabilities caps,
GLCapabilitiesChooser chooser,
int width, int height */
@@ -70,12 +70,12 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new X11GLXContext(this, shareWith);
}
protected void destroyPbuffer() {
- NativeSurface ns = getNativeSurface();
+ final NativeSurface ns = getNativeSurface();
if (ns.getSurfaceHandle() != 0) {
GLX.glXDestroyPbuffer(ns.getDisplayHandle(), ns.getSurfaceHandle());
}
@@ -102,7 +102,7 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
// Create the p-buffer.
int niattribs = 0;
- IntBuffer iattributes = Buffers.newDirectIntBuffer(7);
+ final IntBuffer iattributes = Buffers.newDirectIntBuffer(7);
iattributes.put(niattribs++, GLX.GLX_PBUFFER_WIDTH);
iattributes.put(niattribs++, ms.getSurfaceWidth());
@@ -112,7 +112,7 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
iattributes.put(niattribs++, 0);
iattributes.put(niattribs++, 0);
- long pbuffer = GLX.glXCreatePbuffer(display, config.getFBConfig(), iattributes);
+ final long pbuffer = GLX.glXCreatePbuffer(display, config.getFBConfig(), iattributes);
if (pbuffer == 0) {
// FIXME: query X error code for detail error message
throw new GLException("pbuffer creation error: glXCreatePbuffer() failed");
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
index 42d76097c..e217e1c2a 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
@@ -54,7 +54,7 @@ import jogamp.nativewindow.x11.XVisualInfo;
public class X11PixmapGLXDrawable extends X11GLXDrawable {
private long pixmap;
- protected X11PixmapGLXDrawable(GLDrawableFactory factory, NativeSurface target) {
+ protected X11PixmapGLXDrawable(final GLDrawableFactory factory, final NativeSurface target) {
super(factory, target, false);
}
@@ -68,26 +68,26 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable {
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new X11GLXContext(this, shareWith);
}
private void createPixmap() {
- NativeSurface ns = getNativeSurface();
- X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) ns.getGraphicsConfiguration();
- XVisualInfo vis = config.getXVisualInfo();
- int bitsPerPixel = vis.getDepth();
- AbstractGraphicsScreen aScreen = config.getScreen();
- AbstractGraphicsDevice aDevice = aScreen.getDevice();
- long dpy = aDevice.getHandle();
- int screen = aScreen.getIndex();
+ final NativeSurface ns = getNativeSurface();
+ final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) ns.getGraphicsConfiguration();
+ final XVisualInfo vis = config.getXVisualInfo();
+ final int bitsPerPixel = vis.getDepth();
+ final AbstractGraphicsScreen aScreen = config.getScreen();
+ final AbstractGraphicsDevice aDevice = aScreen.getDevice();
+ final long dpy = aDevice.getHandle();
+ final int screen = aScreen.getIndex();
pixmap = X11Lib.XCreatePixmap(dpy, X11Lib.RootWindow(dpy, screen),
surface.getSurfaceWidth(), surface.getSurfaceHeight(), bitsPerPixel);
if (pixmap == 0) {
throw new GLException("XCreatePixmap failed");
}
- long drawable = GLX.glXCreateGLXPixmap(dpy, vis, pixmap);
+ final long drawable = GLX.glXCreateGLXPixmap(dpy, vis, pixmap);
if (drawable == 0) {
X11Lib.XFreePixmap(dpy, pixmap);
pixmap = 0;
@@ -104,7 +104,7 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable {
protected void destroyPixmap() {
if (pixmap == 0) return;
- NativeSurface ns = getNativeSurface();
+ final NativeSurface ns = getNativeSurface();
long display = ns.getDisplayHandle();
long drawable = ns.getSurfaceHandle();
@@ -117,7 +117,7 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable {
// Must destroy pixmap and GLXPixmap
if (DEBUG) {
- long cur = GLX.glXGetCurrentContext();
+ final long cur = GLX.glXGetCurrentContext();
if (cur != 0) {
System.err.println("WARNING: found context " + toHexString(cur) + " current during pixmap destruction");
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookMutableSize.java b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookMutableSize.java
index 7ae614158..e785af788 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookMutableSize.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookMutableSize.java
@@ -11,20 +11,20 @@ public class DelegatedUpstreamSurfaceHookMutableSize extends UpstreamSurfaceHook
* @param width initial width
* @param height initial height
*/
- public DelegatedUpstreamSurfaceHookMutableSize(UpstreamSurfaceHook upstream, int width, int height) {
+ public DelegatedUpstreamSurfaceHookMutableSize(final UpstreamSurfaceHook upstream, final int width, final int height) {
super(width, height);
this.upstream = upstream;
}
@Override
- public final void create(ProxySurface s) {
+ public final void create(final ProxySurface s) {
if(null != upstream) {
upstream.create(s);
}
}
@Override
- public final void destroy(ProxySurface s) {
+ public final void destroy(final ProxySurface s) {
if(null != upstream) {
upstream.destroy(s);
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java
index 568ac20fa..abcc166cb 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java
@@ -12,7 +12,7 @@ public class DelegatedUpstreamSurfaceHookWithSurfaceSize implements UpstreamSurf
* @param upstream optional upstream UpstreamSurfaceHook used for {@link #create(ProxySurface)} and {@link #destroy(ProxySurface)}.
* @param surface mandatory {@link NativeSurface} used for {@link #getSurfaceWidth(ProxySurface)} and {@link #getSurfaceHeight(ProxySurface)}, not used for {@link #getUpstreamSurface()}.
*/
- public DelegatedUpstreamSurfaceHookWithSurfaceSize(UpstreamSurfaceHook upstream, NativeSurface surface) {
+ public DelegatedUpstreamSurfaceHookWithSurfaceSize(final UpstreamSurfaceHook upstream, final NativeSurface surface) {
this.upstream = upstream;
this.surface = surface;
if(null == surface) {
@@ -32,26 +32,26 @@ public class DelegatedUpstreamSurfaceHookWithSurfaceSize implements UpstreamSurf
}
@Override
- public final void create(ProxySurface s) {
+ public final void create(final ProxySurface s) {
if(null != upstream) {
upstream.create(s);
}
}
@Override
- public final void destroy(ProxySurface s) {
+ public final void destroy(final ProxySurface s) {
if(null != upstream) {
upstream.destroy(s);
}
}
@Override
- public final int getSurfaceWidth(ProxySurface s) {
+ public final int getSurfaceWidth(final ProxySurface s) {
return surface.getSurfaceWidth();
}
@Override
- public final int getSurfaceHeight(ProxySurface s) {
+ public final int getSurfaceHeight(final ProxySurface s) {
return surface.getSurfaceHeight();
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/MutableGraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/MutableGraphicsConfiguration.java
index 8b8ccb191..a137d46c3 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/MutableGraphicsConfiguration.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/MutableGraphicsConfiguration.java
@@ -32,18 +32,18 @@ import javax.media.nativewindow.CapabilitiesImmutable;
import javax.media.nativewindow.DefaultGraphicsConfiguration;
public class MutableGraphicsConfiguration extends DefaultGraphicsConfiguration {
- public MutableGraphicsConfiguration(AbstractGraphicsScreen screen,
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) {
+ public MutableGraphicsConfiguration(final AbstractGraphicsScreen screen,
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested) {
super(screen, capsChosen, capsRequested);
}
@Override
- public void setChosenCapabilities(CapabilitiesImmutable caps) {
+ public void setChosenCapabilities(final CapabilitiesImmutable caps) {
super.setChosenCapabilities(caps);
}
@Override
- public void setScreen(AbstractGraphicsScreen screen) {
+ public void setScreen(final AbstractGraphicsScreen screen) {
super.setScreen(screen);
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
index a8dd9165c..7c1a88e6a 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
@@ -38,7 +38,7 @@ public class NativeWindowVersion extends JogampVersion {
protected static volatile NativeWindowVersion jogampCommonVersionInfo;
- protected NativeWindowVersion(String packageName, Manifest mf) {
+ protected NativeWindowVersion(final String packageName, final Manifest mf) {
super(packageName, mf);
}
@@ -56,7 +56,7 @@ public class NativeWindowVersion extends JogampVersion {
return jogampCommonVersionInfo;
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
System.err.println(VersionUtil.getPlatformInfo());
System.err.println(GlueGenVersion.getInstance());
System.err.println(NativeWindowVersion.getInstance());
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java
index eca64db37..45d12be5e 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java
@@ -11,31 +11,31 @@ public class UpstreamSurfaceHookMutableSize implements UpstreamSurfaceHook.Mutab
* @param width initial width
* @param height initial height
*/
- public UpstreamSurfaceHookMutableSize(int width, int height) {
+ public UpstreamSurfaceHookMutableSize(final int width, final int height) {
this.pixWidth = width;
this.pixHeight = height;
}
@Override
- public final void setSurfaceSize(int width, int height) {
+ public final void setSurfaceSize(final int width, final int height) {
this.pixWidth = width;
this.pixHeight = height;
}
@Override
- public final int getSurfaceWidth(ProxySurface s) {
+ public final int getSurfaceWidth(final ProxySurface s) {
return pixWidth;
}
@Override
- public final int getSurfaceHeight(ProxySurface s) {
+ public final int getSurfaceHeight(final ProxySurface s) {
return pixHeight;
}
@Override
- public void create(ProxySurface s) { /* nop */ }
+ public void create(final ProxySurface s) { /* nop */ }
@Override
- public void destroy(ProxySurface s) { /* nop */ }
+ public void destroy(final ProxySurface s) { /* nop */ }
@Override
public String toString() {
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java
index 5f9720a0e..b509f118a 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java
@@ -11,7 +11,7 @@ public class UpstreamWindowHookMutableSizePos extends UpstreamSurfaceHookMutable
* @param pixWidth initial surface pixel width, FIXME: pixel-dim == window-dim 'for now' ?
* @param pixHeight initial surface pixel height, FIXME: pixel-dim == window-dim 'for now' ?
*/
- public UpstreamWindowHookMutableSizePos(int winX, int winY, int winWidth, int winHeight, int pixWidth, int pixHeight) {
+ public UpstreamWindowHookMutableSizePos(final int winX, final int winY, final int winWidth, final int winHeight, final int pixWidth, final int pixHeight) {
super(pixWidth, pixHeight);
this.winX= winX;
this.winY= winY;
@@ -20,12 +20,12 @@ public class UpstreamWindowHookMutableSizePos extends UpstreamSurfaceHookMutable
}
// @Override
- public final void setWinPos(int winX, int winY) {
+ public final void setWinPos(final int winX, final int winY) {
this.winX= winX;
this.winY= winY;
}
// @Override
- public final void setWinSize(int winWidth, int winHeight) {
+ public final void setWinSize(final int winWidth, final int winHeight) {
this.winWidth= winWidth;
this.winHeight= winHeight;
// FIXME HiDPI: Use pixelScale ?!
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
index aa9b876dd..3a62825a2 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
@@ -54,19 +54,19 @@ import jogamp.nativewindow.Debug;
handled in a toolkit-independent manner. */
public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable {
- private GraphicsConfiguration config;
+ private final GraphicsConfiguration config;
AbstractGraphicsConfiguration encapsulated;
- public AWTGraphicsConfiguration(AWTGraphicsScreen screen,
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
- GraphicsConfiguration config, AbstractGraphicsConfiguration encapsulated) {
+ public AWTGraphicsConfiguration(final AWTGraphicsScreen screen,
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+ final GraphicsConfiguration config, final AbstractGraphicsConfiguration encapsulated) {
super(screen, capsChosen, capsRequested);
this.config = config;
this.encapsulated=encapsulated;
}
- private AWTGraphicsConfiguration(AWTGraphicsScreen screen, CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
- GraphicsConfiguration config) {
+ private AWTGraphicsConfiguration(final AWTGraphicsScreen screen, final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+ final GraphicsConfiguration config) {
super(screen, capsChosen, capsRequested);
this.config = config;
this.encapsulated=null;
@@ -78,7 +78,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
* Otherwise the <code>capsChosen</code> is used.
* @param capsRequested if null, default {@link Capabilities} are used, otherwise the given values.
*/
- public static AWTGraphicsConfiguration create(Component awtComp, CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) {
+ public static AWTGraphicsConfiguration create(final Component awtComp, CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) {
final GraphicsConfiguration awtGfxConfig = awtComp.getGraphicsConfiguration();
if(null==awtGfxConfig) {
throw new NativeWindowException("AWTGraphicsConfiguration.create: Null AWT GraphicsConfiguration @ "+awtComp);
@@ -96,7 +96,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
capsRequested = new Capabilities();
}
if(null==capsChosen) {
- GraphicsConfiguration gc = awtGraphicsDevice.getDefaultConfiguration();
+ final GraphicsConfiguration gc = awtGraphicsDevice.getDefaultConfiguration();
capsChosen = AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capsRequested, gc);
}
final GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(awtDevice, capsChosen);
@@ -110,7 +110,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
// open access to superclass method
@Override
- public void setChosenCapabilities(CapabilitiesImmutable capsChosen) {
+ public void setChosenCapabilities(final CapabilitiesImmutable capsChosen) {
super.setChosenCapabilities(capsChosen);
}
@@ -136,16 +136,16 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
* @param gc the GraphicsConfiguration from which to derive the RGBA bit depths
* @return the passed Capabilities
*/
- public static CapabilitiesImmutable setupCapabilitiesRGBABits(CapabilitiesImmutable capabilitiesIn, GraphicsConfiguration gc) {
- Capabilities capabilities = (Capabilities) capabilitiesIn.cloneMutable();
+ public static CapabilitiesImmutable setupCapabilitiesRGBABits(final CapabilitiesImmutable capabilitiesIn, final GraphicsConfiguration gc) {
+ final Capabilities capabilities = (Capabilities) capabilitiesIn.cloneMutable();
- ColorModel cm = gc.getColorModel();
+ final ColorModel cm = gc.getColorModel();
if(null==cm) {
throw new NativeWindowException("Could not determine AWT ColorModel");
}
- int cmBitsPerPixel = cm.getPixelSize();
+ final int cmBitsPerPixel = cm.getPixelSize();
int bitsPerPixel = 0;
- int[] bitesPerComponent = cm.getComponentSize();
+ final int[] bitesPerComponent = cm.getComponentSize();
if(bitesPerComponent.length>=3) {
capabilities.setRedBits(bitesPerComponent[0]);
bitsPerPixel += bitesPerComponent[0];
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsDevice.java
index d72eabb02..219f4bb92 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsDevice.java
@@ -56,7 +56,7 @@ public class AWTGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
}
public static AWTGraphicsDevice createDefault() {
- GraphicsDevice awtDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
+ final GraphicsDevice awtDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
return new AWTGraphicsDevice(awtDevice, AbstractGraphicsDevice.DEFAULT_UNIT);
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
index 83d6efa75..6fc35f719 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
@@ -51,35 +51,35 @@ import javax.media.nativewindow.*;
public class AWTGraphicsScreen extends DefaultGraphicsScreen implements Cloneable {
- public AWTGraphicsScreen(AWTGraphicsDevice device) {
+ public AWTGraphicsScreen(final AWTGraphicsDevice device) {
super(device, findScreenIndex(device.getGraphicsDevice()));
}
- public static GraphicsDevice getScreenDevice(int index) {
+ public static GraphicsDevice getScreenDevice(final int index) {
if(index<0) return null;
- GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice[] gs = ge.getScreenDevices();
+ final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ final GraphicsDevice[] gs = ge.getScreenDevices();
if(index<gs.length) {
return gs[index];
}
return null;
}
- public static int findScreenIndex(GraphicsDevice awtDevice) {
+ public static int findScreenIndex(final GraphicsDevice awtDevice) {
if(null==awtDevice) return -1;
- GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice[] gs = ge.getScreenDevices();
+ final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ final GraphicsDevice[] gs = ge.getScreenDevices();
for (int j = 0; j < gs.length; j++) {
if(gs[j] == awtDevice) return j;
}
return -1;
}
- public static AbstractGraphicsScreen createScreenDevice(GraphicsDevice awtDevice, int unitID) {
+ public static AbstractGraphicsScreen createScreenDevice(final GraphicsDevice awtDevice, final int unitID) {
return new AWTGraphicsScreen(new AWTGraphicsDevice(awtDevice, unitID));
}
- public static AbstractGraphicsScreen createScreenDevice(int index, int unitID) {
+ public static AbstractGraphicsScreen createScreenDevice(final int index, final int unitID) {
return createScreenDevice(getScreenDevice(index), unitID);
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java
index 44163fc73..b0a7fbc76 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java
@@ -120,7 +120,7 @@ public interface AWTPrintLifecycle {
* @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
* @return the context
*/
- public static Context setupPrint(Container c, double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
+ public static Context setupPrint(final Container c, final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight) {
final Context t = new Context(c, scaleMatX, scaleMatY, numSamples, tileWidth, tileHeight);
t.setupPrint(c);
return t;
@@ -150,16 +150,16 @@ public interface AWTPrintLifecycle {
private final AWTMisc.ComponentAction setupAction = new AWTMisc.ComponentAction() {
@Override
- public void run(Component c) {
+ public void run(final Component c) {
((AWTPrintLifecycle)c).setupPrint(scaleMatX, scaleMatY, numSamples, tileWidth, tileHeight);
} };
private final AWTMisc.ComponentAction releaseAction = new AWTMisc.ComponentAction() {
@Override
- public void run(Component c) {
+ public void run(final Component c) {
((AWTPrintLifecycle)c).releasePrint();
} };
- private Context(Container c, double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
+ private Context(final Container c, final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight) {
this.cont = c;
this.scaleMatX = scaleMatX;
this.scaleMatY = scaleMatY;
@@ -168,7 +168,7 @@ public interface AWTPrintLifecycle {
this.tileHeight = tileHeight;
this.count = 0;
}
- private void setupPrint(Container c) {
+ private void setupPrint(final Container c) {
count = AWTMisc.performAction(c, AWTPrintLifecycle.class, setupAction);
}
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
index aadecb455..496e6e07b 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
@@ -53,7 +53,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
* @param closingOperationClose mandatory closing operation, triggered if windowClosing and {@link WindowClosingMode#DISPOSE_ON_CLOSE}
* @param closingOperationNOP optional closing operation, triggered if windowClosing and {@link WindowClosingMode#DO_NOTHING_ON_CLOSE}
*/
- public AWTWindowClosingProtocol(Component comp, Runnable closingOperationClose, Runnable closingOperationNOP) {
+ public AWTWindowClosingProtocol(final Component comp, final Runnable closingOperationClose, final Runnable closingOperationNOP) {
this.comp = comp;
this.listenTo = null;
this.closingOperationClose = closingOperationClose;
@@ -62,7 +62,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
class WindowClosingAdapter extends WindowAdapter {
@Override
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
final WindowClosingMode op = AWTWindowClosingProtocol.this.getDefaultCloseOperation();
if( WindowClosingMode.DISPOSE_ON_CLOSE == op ) {
@@ -128,7 +128,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
}
@Override
- public final WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+ public final WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
synchronized(closingListenerLock) {
final WindowClosingMode _op = defaultCloseOperation;
defaultCloseOperation = op;
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java
index c4f16e046..c637ec59e 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java
@@ -32,7 +32,7 @@ public class AppContextInfo {
try {
final Class<?> appContextClass = Class.forName("sun.awt.AppContext");
_getAppContextMethod[0] = appContextClass.getMethod("getAppContext");
- } catch(Throwable ex) {
+ } catch(final Throwable ex) {
System.err.println("Bug 1004: Caught @ static: "+ex.getMessage());
ex.printStackTrace();
}
@@ -185,7 +185,7 @@ public class AppContextInfo {
private static Object fetchAppContext() {
try {
return getAppContextMethod.invoke(null);
- } catch(Exception ex) {
+ } catch(final Exception ex) {
System.err.println("Bug 1004: Caught: "+ex.getMessage());
ex.printStackTrace();
return null;
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
index eeec66376..c7055099f 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
@@ -47,14 +47,14 @@ import com.jogamp.common.nio.Buffers;
public final class DirectDataBufferInt extends DataBuffer {
public static class DirectWritableRaster extends WritableRaster {
- protected DirectWritableRaster(SampleModel sampleModel, DirectDataBufferInt dataBuffer, Point origin) {
+ protected DirectWritableRaster(final SampleModel sampleModel, final DirectDataBufferInt dataBuffer, final Point origin) {
super(sampleModel, dataBuffer, origin);
}
}
public static class BufferedImageInt extends BufferedImage {
final int customImageType;
- public BufferedImageInt (int customImageType, ColorModel cm, WritableRaster raster, Hashtable<?,?> properties) {
+ public BufferedImageInt (final int customImageType, final ColorModel cm, final WritableRaster raster, final Hashtable<?,?> properties) {
super(cm, raster, false /* isRasterPremultiplied */, properties);
this.customImageType = customImageType;
}
@@ -97,7 +97,7 @@ public final class DirectDataBufferInt extends DataBuffer {
* <code>String</code>/<code>Object</code> pairs. Used for {@link BufferedImage#getProperty(String)} etc.
* @return
*/
- public static BufferedImageInt createBufferedImage(int width, int height, int imageType, Point location, Hashtable<?,?> properties) {
+ public static BufferedImageInt createBufferedImage(final int width, final int height, final int imageType, Point location, final Hashtable<?,?> properties) {
final ColorSpace colorSpace = ColorSpace.getInstance(ColorSpace.CS_sRGB);
final int transferType = DataBuffer.TYPE_INT;
final int bpp, rmask, gmask, bmask, amask;
@@ -167,10 +167,10 @@ public final class DirectDataBufferInt extends DataBuffer {
}
/** Default data bank. */
- private IntBuffer data;
+ private final IntBuffer data;
/** All data banks */
- private IntBuffer bankdata[];
+ private final IntBuffer bankdata[];
/**
* Constructs an nio integer-based {@link DataBuffer} with a single bank
@@ -178,7 +178,7 @@ public final class DirectDataBufferInt extends DataBuffer {
*
* @param size The size of the {@link DataBuffer}.
*/
- public DirectDataBufferInt(int size) {
+ public DirectDataBufferInt(final int size) {
super(TYPE_INT, size);
data = Buffers.newDirectIntBuffer(size);
bankdata = new IntBuffer[1];
@@ -192,7 +192,7 @@ public final class DirectDataBufferInt extends DataBuffer {
* @param size The size of the banks in the {@link DataBuffer}.
* @param numBanks The number of banks in the a{@link DataBuffer}.
*/
- public DirectDataBufferInt(int size, int numBanks) {
+ public DirectDataBufferInt(final int size, final int numBanks) {
super(TYPE_INT,size,numBanks);
bankdata = new IntBuffer[numBanks];
for (int i= 0; i < numBanks; i++) {
@@ -213,7 +213,7 @@ public final class DirectDataBufferInt extends DataBuffer {
* @param dataArray The integer array for the {@link DataBuffer}.
* @param size The size of the {@link DataBuffer} bank.
*/
- public DirectDataBufferInt(IntBuffer dataArray, int size) {
+ public DirectDataBufferInt(final IntBuffer dataArray, final int size) {
super(TYPE_INT,size);
data = dataArray;
bankdata = new IntBuffer[1];
@@ -235,7 +235,7 @@ public final class DirectDataBufferInt extends DataBuffer {
* @param bank The bank whose data array you want to get.
* @return The data array for the specified bank.
*/
- public IntBuffer getData(int bank) {
+ public IntBuffer getData(final int bank) {
return bankdata[bank];
}
@@ -248,7 +248,7 @@ public final class DirectDataBufferInt extends DataBuffer {
* @see #setElem(int, int, int)
*/
@Override
- public int getElem(int i) {
+ public int getElem(final int i) {
return data.get(i+offset);
}
@@ -262,7 +262,7 @@ public final class DirectDataBufferInt extends DataBuffer {
* @see #setElem(int, int, int)
*/
@Override
- public int getElem(int bank, int i) {
+ public int getElem(final int bank, final int i) {
return bankdata[bank].get(i+offsets[bank]);
}
@@ -276,7 +276,7 @@ public final class DirectDataBufferInt extends DataBuffer {
* @see #getElem(int, int)
*/
@Override
- public void setElem(int i, int val) {
+ public void setElem(final int i, final int val) {
data.put(i+offset, val);
}
@@ -290,7 +290,7 @@ public final class DirectDataBufferInt extends DataBuffer {
* @see #getElem(int, int)
*/
@Override
- public void setElem(int bank, int i, int val) {
+ public void setElem(final int bank, final int i, final int val) {
bankdata[bank].put(i+offsets[bank], val);
}
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
index 62710830f..6498ebd1e 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
@@ -71,6 +71,7 @@ import javax.media.nativewindow.util.PointImmutable;
import javax.media.nativewindow.util.Rectangle;
import javax.media.nativewindow.util.RectangleImmutable;
+import jogamp.common.os.PlatformPropsImpl;
import jogamp.nativewindow.SurfaceScaleUtils;
import jogamp.nativewindow.SurfaceUpdatedHelper;
import jogamp.nativewindow.awt.AWTMisc;
@@ -114,7 +115,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
* @param comp
* @param config
*/
- protected JAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+ protected JAWTWindow(final Object comp, final AbstractGraphicsConfiguration config) {
if (config == null) {
throw new NativeWindowException("Error: AbstractGraphicsConfiguration is null");
}
@@ -129,7 +130,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
this.isApplet = false;
this.offscreenSurfaceLayer = 0;
}
- private static String id(Object obj) { return ( null!=obj ? toHexString(obj.hashCode()) : "nil" ); }
+ private static String id(final Object obj) { return ( null!=obj ? toHexString(obj.hashCode()) : "nil" ); }
private String jawtStr() { return "JAWTWindow["+id(JAWTWindow.this)+"]"; }
private class JAWTComponentListener implements ComponentListener, HierarchyListener {
@@ -195,7 +196,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
}
@Override
- public final void componentResized(ComponentEvent e) {
+ public final void componentResized(final ComponentEvent e) {
if(DEBUG) {
System.err.println(jawtStr()+".componentResized: "+s(e));
}
@@ -203,7 +204,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
}
@Override
- public final void componentMoved(ComponentEvent e) {
+ public final void componentMoved(final ComponentEvent e) {
if(DEBUG) {
System.err.println(jawtStr()+".componentMoved: "+s(e));
}
@@ -211,7 +212,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
}
@Override
- public final void componentShown(ComponentEvent e) {
+ public final void componentShown(final ComponentEvent e) {
if(DEBUG) {
System.err.println(jawtStr()+".componentShown: "+s(e));
}
@@ -219,7 +220,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
}
@Override
- public final void componentHidden(ComponentEvent e) {
+ public final void componentHidden(final ComponentEvent e) {
if(DEBUG) {
System.err.println(jawtStr()+".componentHidden: "+s(e));
}
@@ -227,7 +228,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
}
@Override
- public final void hierarchyChanged(HierarchyEvent e) {
+ public final void hierarchyChanged(final HierarchyEvent e) {
final boolean wasShowing = isShowing;
isShowing = component.isShowing();
int action = 0;
@@ -306,7 +307,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
* Updates bounds and pixelScale
* @return true if bounds or pixelScale has changed, otherwise false
*/
- protected final boolean updateLockedData(JAWT_Rectangle jawtBounds) {
+ protected final boolean updateLockedData(final JAWT_Rectangle jawtBounds) {
final Rectangle jb = new Rectangle(jawtBounds.getX(), jawtBounds.getY(), jawtBounds.getWidth(), jawtBounds.getHeight());
final boolean changedBounds = !bounds.equals(jb);
@@ -372,7 +373,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
//
@Override
- public void setShallUseOffscreenLayer(boolean v) {
+ public void setShallUseOffscreenLayer(final boolean v) {
shallUseOffscreenLayer = v;
}
@@ -428,9 +429,9 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
* @see #isOffscreenLayerSurfaceEnabled()
* @throws NativeWindowException if {@link #isOffscreenLayerSurfaceEnabled()} == false
*/
- protected void layoutSurfaceLayerImpl(long layerHandle, boolean visible) {}
+ protected void layoutSurfaceLayerImpl(final long layerHandle, final boolean visible) {}
- private final void layoutSurfaceLayerIfEnabled(boolean visible) throws NativeWindowException {
+ private final void layoutSurfaceLayerIfEnabled(final boolean visible) throws NativeWindowException {
if( isOffscreenLayerSurfaceEnabled() && 0 != offscreenSurfaceLayer ) {
layoutSurfaceLayerImpl(offscreenSurfaceLayer, visible);
}
@@ -473,7 +474,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
}
@Override
- public final void setChosenCapabilities(CapabilitiesImmutable caps) {
+ public final void setChosenCapabilities(final CapabilitiesImmutable caps) {
((MutableGraphicsConfiguration)getGraphicsConfiguration()).setChosenCapabilities(caps);
config.setChosenCapabilities(caps);
}
@@ -494,7 +495,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
final java.awt.Point awtHotspot = new java.awt.Point(hotSpot.getX(), hotSpot.getY());
try {
c = AWTMisc.getCursor(pixelrect, awtHotspot);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -628,22 +629,22 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
}
@Override
- public void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
surfaceUpdatedHelper.addSurfaceUpdatedListener(l);
}
@Override
- public void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
+ public void addSurfaceUpdatedListener(final int index, final SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
surfaceUpdatedHelper.addSurfaceUpdatedListener(index, l);
}
@Override
- public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public void removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
surfaceUpdatedHelper.removeSurfaceUpdatedListener(l);
}
@Override
- public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+ public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
surfaceUpdatedHelper.surfaceUpdated(updater, ns, when);
}
@@ -772,7 +773,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
getLocationOnScreenNonBlocking(storage, component);
return storage;
}
- java.awt.Point awtLOS = component.getLocationOnScreen();
+ final java.awt.Point awtLOS = component.getLocationOnScreen();
if(null!=storage) {
los = storage.translate(awtLOS.x, awtLOS.y);
} else {
@@ -782,8 +783,8 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
return los;
}
- protected Point getLocationOnScreenNative(Point storage) {
- int lockRes = lockSurface();
+ protected Point getLocationOnScreenNative(final Point storage) {
+ final int lockRes = lockSurface();
if(LOCK_SURFACE_NOT_READY == lockRes) {
if(DEBUG) {
System.err.println("Warning: JAWT Lock couldn't be acquired: "+this);
@@ -792,7 +793,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
return null;
}
try {
- Point d = getLocationOnScreenNativeImpl(0, 0);
+ final Point d = getLocationOnScreenNativeImpl(0, 0);
if(null!=d) {
if(null!=storage) {
storage.translate(d.getX(),d.getY());
@@ -806,7 +807,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
}
protected abstract Point getLocationOnScreenNativeImpl(int x, int y);
- protected static Component getLocationOnScreenNonBlocking(Point storage, Component comp) {
+ protected static Component getLocationOnScreenNonBlocking(final Point storage, Component comp) {
final java.awt.Insets insets = new java.awt.Insets(0, 0, 0, 0); // DEBUG
Component last = null;
while(null != comp) {
@@ -844,9 +845,9 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
if( null == sb ) {
sb = new StringBuilder();
}
- sb.append("JVM version: ").append(Platform.JAVA_VERSION).append(" (").
- append(Platform.JAVA_VERSION_NUMBER).
- append(" update ").append(Platform.JAVA_VERSION_UPDATE).append(")").append(Platform.getNewline());
+ sb.append("JVM version: ").append(PlatformPropsImpl.JAVA_VERSION).append(" (").
+ append(PlatformPropsImpl.JAVA_VERSION_NUMBER).
+ append(" update ").append(PlatformPropsImpl.JAVA_VERSION_UPDATE).append(")").append(Platform.getNewline());
if(null != jawt) {
sb.append("JAWT version: ").append(toHexString(jawt.getCachedVersion())).
append(", CA_LAYER: ").append(JAWTUtil.isJAWTUsingOffscreenLayer(jawt)).
@@ -861,7 +862,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(jawtStr()+"[");
jawt2String(sb);
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java
index ffcbb8626..d21994ea5 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java
@@ -137,7 +137,7 @@ public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
return eglLifecycleCallback;
}
@Override
- protected Object setHandleOwnership(Object newOwnership) {
+ protected Object setHandleOwnership(final Object newOwnership) {
final EGLDisplayLifecycleCallback oldOwnership = eglLifecycleCallback;
eglLifecycleCallback = (EGLDisplayLifecycleCallback) newOwnership;
return oldOwnership;
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
index 02cec5bbf..6c63fc08d 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
@@ -112,7 +112,7 @@ public class SWTAccessor {
private static final VersionNumber GTK_VERSION_2_24_0 = new VersionNumber(2, 24, 0);
private static final VersionNumber GTK_VERSION_3_0_0 = new VersionNumber(3, 0, 0);
- private static VersionNumber GTK_VERSION(int version) {
+ private static VersionNumber GTK_VERSION(final int version) {
// return (major << 16) + (minor << 8) + micro;
final int micro = ( version ) & 0x0f;
final int minor = ( version >> 8 ) & 0x0f;
@@ -137,7 +137,7 @@ public class SWTAccessor {
if( !isOSX ) {
try {
f = Control.class.getField(str_handle);
- } catch (Exception ex) {
+ } catch (final Exception ex) {
throw new NativeWindowException(ex);
}
}
@@ -156,7 +156,7 @@ public class SWTAccessor {
Method m=null;
try {
m = ReflectionUtil.getMethod(Control.class, str_internal_new_GC, new Class[] { GCData.class });
- } catch (Exception ex) {
+ } catch (final Exception ex) {
throw new NativeWindowException(ex);
}
swt_control_internal_new_GC = m;
@@ -167,7 +167,7 @@ public class SWTAccessor {
} else {
m = Control.class.getDeclaredMethod(str_internal_dispose_GC, new Class[] { int.class, GCData.class });
}
- } catch (NoSuchMethodException ex) {
+ } catch (final NoSuchMethodException ex) {
throw new NativeWindowException(ex);
}
swt_control_internal_dispose_GC = m;
@@ -180,7 +180,7 @@ public class SWTAccessor {
// mandatory
try {
c = ReflectionUtil.getClass(str_OS_gtk_class, false, SWTAccessor.class.getClassLoader());
- Field field_OS_gtk_version = c.getField(str_OS_gtk_version);
+ final Field field_OS_gtk_version = c.getField(str_OS_gtk_version);
_gtk_version = GTK_VERSION(field_OS_gtk_version.getInt(null));
m1 = c.getDeclaredMethod(str_gtk_widget_realize, handleType);
if (_gtk_version.compareTo(GTK_VERSION_2_14_0) >= 0) {
@@ -200,11 +200,11 @@ public class SWTAccessor {
m8 = c.getDeclaredMethod(str_gdk_x11_drawable_get_xid, handleType);
}
ma = c.getDeclaredMethod(str_gdk_window_set_back_pixmap, handleType, handleType, boolean.class);
- } catch (Exception ex) { throw new NativeWindowException(ex); }
+ } catch (final Exception ex) { throw new NativeWindowException(ex); }
// optional
try {
m2 = c.getDeclaredMethod(str_gtk_widget_unrealize, handleType);
- } catch (Exception ex) { }
+ } catch (final Exception ex) { }
}
OS_gtk_class = c;
OS_gtk_version = _gtk_version;
@@ -226,23 +226,23 @@ public class SWTAccessor {
}
}
- private static Number getIntOrLong(long arg) {
+ private static Number getIntOrLong(final long arg) {
if(swt_uses_long_handles) {
return new Long(arg);
}
return new Integer((int) arg);
}
- private static void callStaticMethodL2V(Method m, long arg) {
+ private static void callStaticMethodL2V(final Method m, final long arg) {
ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg) });
}
- private static void callStaticMethodLLZ2V(Method m, long arg0, long arg1, boolean arg3) {
+ private static void callStaticMethodLLZ2V(final Method m, final long arg0, final long arg1, final boolean arg3) {
ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg0), getIntOrLong(arg1), Boolean.valueOf(arg3) });
}
- private static long callStaticMethodL2L(Method m, long arg) {
- Object o = ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg) });
+ private static long callStaticMethodL2L(final Method m, final long arg) {
+ final Object o = ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg) });
if(o instanceof Number) {
return ((Number)o).longValue();
} else {
@@ -265,7 +265,7 @@ public class SWTAccessor {
// Common GTK
//
- public static long gdk_widget_get_window(long handle) {
+ public static long gdk_widget_get_window(final long handle) {
final long window;
if (OS_gtk_version.compareTo(GTK_VERSION_2_14_0) >= 0) {
window = callStaticMethodL2L(OS_gtk_widget_get_window, handle);
@@ -278,7 +278,7 @@ public class SWTAccessor {
return window;
}
- public static long gdk_window_get_xdisplay(long window) {
+ public static long gdk_window_get_xdisplay(final long window) {
final long xdisplay;
if (OS_gtk_version.compareTo(GTK_VERSION_2_24_0) >= 0) {
final long display = callStaticMethodL2L(OS_gdk_window_get_display, window);
@@ -295,7 +295,7 @@ public class SWTAccessor {
return xdisplay;
}
- public static long gdk_window_get_xwindow(long window) {
+ public static long gdk_window_get_xwindow(final long window) {
final long xWindow;
if (OS_gtk_version.compareTo(GTK_VERSION_3_0_0) >= 0) {
xWindow = callStaticMethodL2L(OS_gdk_x11_window_get_xid, window);
@@ -308,7 +308,7 @@ public class SWTAccessor {
return xWindow;
}
- public static void gdk_window_set_back_pixmap(long window, long pixmap, boolean parent_relative) {
+ public static void gdk_window_set_back_pixmap(final long window, final long pixmap, final boolean parent_relative) {
callStaticMethodLLZ2V(OS_gdk_window_set_back_pixmap, window, pixmap, parent_relative);
}
@@ -321,27 +321,27 @@ public class SWTAccessor {
* @return the native widget-handle
* @throws NativeWindowException if the widget handle is null
*/
- public static long getHandle(Control swtControl) throws NativeWindowException {
+ public static long getHandle(final Control swtControl) throws NativeWindowException {
long h = 0;
if( isOSX ) {
synchronized(swt_osx_init) {
try {
if(null == swt_osx_view_id) {
swt_osx_control_view = Control.class.getField(str_osx_view);
- Object view = swt_osx_control_view.get(swtControl);
+ final Object view = swt_osx_control_view.get(swtControl);
swt_osx_view_id = view.getClass().getField(str_osx_id);
h = swt_osx_view_id.getLong(view);
} else {
h = swt_osx_view_id.getLong( swt_osx_control_view.get(swtControl) );
}
- } catch (Exception ex) {
+ } catch (final Exception ex) {
throw new NativeWindowException(ex);
}
}
} else {
try {
h = swt_control_handle.getLong(swtControl);
- } catch (Exception ex) {
+ } catch (final Exception ex) {
throw new NativeWindowException(ex);
}
}
@@ -379,7 +379,7 @@ public class SWTAccessor {
* @throws NativeWindowException if the widget handle is null
* @throws UnsupportedOperationException if the windowing system is not supported
*/
- public static AbstractGraphicsDevice getDevice(Control swtControl) throws NativeWindowException, UnsupportedOperationException {
+ public static AbstractGraphicsDevice getDevice(final Control swtControl) throws NativeWindowException, UnsupportedOperationException {
final long handle = getHandle(swtControl);
if( isX11GTK ) {
final long xdisplay0 = gdk_window_get_xdisplay( gdk_widget_get_window( handle ) );
@@ -399,11 +399,11 @@ public class SWTAccessor {
* @param screen -1 is default screen of the given device, e.g. maybe 0 or determined by native API. >= 0 is specific screen
* @return
*/
- public static AbstractGraphicsScreen getScreen(AbstractGraphicsDevice device, int screen) {
+ public static AbstractGraphicsScreen getScreen(final AbstractGraphicsDevice device, final int screen) {
return NativeWindowFactory.createScreen(device, screen);
}
- public static int getNativeVisualID(AbstractGraphicsDevice device, long windowHandle) {
+ public static int getNativeVisualID(final AbstractGraphicsDevice device, final long windowHandle) {
if( isX11 ) {
return X11Lib.GetVisualIDFromWindow(device.getHandle(), windowHandle);
}
@@ -419,7 +419,7 @@ public class SWTAccessor {
* @throws NativeWindowException if the widget handle is null
* @throws UnsupportedOperationException if the windowing system is not supported
*/
- public static long getWindowHandle(Control swtControl) throws NativeWindowException, UnsupportedOperationException {
+ public static long getWindowHandle(final Control swtControl) throws NativeWindowException, UnsupportedOperationException {
final long handle = getHandle(swtControl);
if(0 == handle) {
throw new NativeWindowException("Null SWT handle of SWT control "+swtControl);
@@ -477,7 +477,7 @@ public class SWTAccessor {
* @see Platform#AWT_AVAILABLE
* @see Platform#getOSType()
*/
- public static void invoke(boolean wait, Runnable runnable) {
+ public static void invoke(final boolean wait, final Runnable runnable) {
if( isOSX ) {
// Use SWT main thread! Only reliable config w/ -XStartOnMainThread !?
OSXUtil.RunOnMainThread(wait, false, runnable);
@@ -493,7 +493,7 @@ public class SWTAccessor {
* {@link #invoke(boolean, Runnable)} is being used.
* @see #invoke(boolean, Runnable)
*/
- public static void invoke(org.eclipse.swt.widgets.Display display, boolean wait, Runnable runnable) {
+ public static void invoke(final org.eclipse.swt.widgets.Display display, final boolean wait, final Runnable runnable) {
if( display.isDisposed() || Thread.currentThread() == display.getThread() ) {
invoke(wait, runnable);
} else if( wait ) {
@@ -507,7 +507,7 @@ public class SWTAccessor {
// Specific X11 GTK ChildWindow - Using plain X11 native parenting (works well)
//
- public static long createCompatibleX11ChildWindow(AbstractGraphicsScreen screen, Control swtControl, int visualID, int width, int height) {
+ public static long createCompatibleX11ChildWindow(final AbstractGraphicsScreen screen, final Control swtControl, final int visualID, final int width, final int height) {
final long handle = getHandle(swtControl);
final long parentWindow = gdk_widget_get_window( handle );
gdk_window_set_back_pixmap (parentWindow, 0, false);
@@ -518,10 +518,10 @@ public class SWTAccessor {
return x11WindowHandle;
}
- public static void resizeX11Window(AbstractGraphicsDevice device, Rectangle clientArea, long x11Window) {
+ public static void resizeX11Window(final AbstractGraphicsDevice device, final Rectangle clientArea, final long x11Window) {
X11Lib.SetWindowPosSize(device.getHandle(), x11Window, clientArea.x, clientArea.y, clientArea.width, clientArea.height);
}
- public static void destroyX11Window(AbstractGraphicsDevice device, long x11Window) {
+ public static void destroyX11Window(final AbstractGraphicsDevice device, final long x11Window) {
X11Lib.DestroyWindow(device.getHandle(), x11Window);
}
@@ -534,7 +534,7 @@ public class SWTAccessor {
// public static final int GDK_WA_TYPE_HINT = 1 << 9;
// public static final int GDK_WA_VISUAL = 1 << 6;
- public static long createCompatibleGDKChildWindow(Control swtControl, int visualID, int width, int height) {
+ public static long createCompatibleGDKChildWindow(final Control swtControl, final int visualID, final int width, final int height) {
return 0;
/**
final long handle = SWTAccessor.getHandle(swtControl);
@@ -564,24 +564,24 @@ public class SWTAccessor {
return childWindow; */
}
- public static void showGDKWindow(long gdkWindow) {
+ public static void showGDKWindow(final long gdkWindow) {
/* OS.gdk_window_show (gdkWindow);
OS.gdk_flush(); */
}
- public static void focusGDKWindow(long gdkWindow) {
+ public static void focusGDKWindow(final long gdkWindow) {
/*
OS.gdk_window_show (gdkWindow);
OS.gdk_window_focus(gdkWindow, 0);
OS.gdk_flush(); */
}
- public static void resizeGDKWindow(Rectangle clientArea, long gdkWindow) {
+ public static void resizeGDKWindow(final Rectangle clientArea, final long gdkWindow) {
/**
OS.gdk_window_move (gdkWindow, clientArea.x, clientArea.y);
OS.gdk_window_resize (gdkWindow, clientArea.width, clientArea.height);
OS.gdk_flush(); */
}
- public static void destroyGDKWindow(long gdkWindow) {
+ public static void destroyGDKWindow(final long gdkWindow) {
// OS.gdk_window_destroy (gdkWindow);
}
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsConfiguration.java
index 120c86584..223cb5194 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsConfiguration.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsConfiguration.java
@@ -48,9 +48,9 @@ import jogamp.nativewindow.x11.XVisualInfo;
public class X11GraphicsConfiguration extends MutableGraphicsConfiguration implements Cloneable {
private XVisualInfo info;
- public X11GraphicsConfiguration(X11GraphicsScreen screen,
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
- XVisualInfo info) {
+ public X11GraphicsConfiguration(final X11GraphicsScreen screen,
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+ final XVisualInfo info) {
super(screen, capsChosen, capsRequested);
this.info = info;
}
@@ -64,7 +64,7 @@ public class X11GraphicsConfiguration extends MutableGraphicsConfiguration imple
return info;
}
- final protected void setXVisualInfo(XVisualInfo info) {
+ final protected void setXVisualInfo(final XVisualInfo info) {
this.info = info;
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
index 633b9eaf0..fea4e7019 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
@@ -98,7 +98,7 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
isXineramaEnabled = X11Util.XineramaIsEnabled(this);
}
- private static int getDefaultScreenImpl(long dpy) {
+ private static int getDefaultScreenImpl(final long dpy) {
return X11Lib.DefaultScreen(dpy);
}
@@ -176,7 +176,7 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
return Boolean.valueOf(handleOwner);
}
@Override
- protected Object setHandleOwnership(Object newOwnership) {
+ protected Object setHandleOwnership(final Object newOwnership) {
final Boolean oldOwnership = Boolean.valueOf(handleOwner);
handleOwner = ((Boolean) newOwnership).booleanValue();
return oldOwnership;
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
index 700937829..8ebf3c379 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
@@ -49,11 +49,11 @@ import jogamp.nativewindow.x11.X11Lib;
public class X11GraphicsScreen extends DefaultGraphicsScreen implements Cloneable {
/** Constructs a new X11GraphicsScreen corresponding to the given native screen index. */
- public X11GraphicsScreen(X11GraphicsDevice device, int screen) {
+ public X11GraphicsScreen(final X11GraphicsDevice device, final int screen) {
super(device, device.isXineramaEnabled() ? 0 : screen);
}
- public static AbstractGraphicsScreen createScreenDevice(long display, int screenIdx, boolean owner) {
+ public static AbstractGraphicsScreen createScreenDevice(final long display, final int screenIdx, final boolean owner) {
if(0==display) throw new NativeWindowException("display is null");
return new X11GraphicsScreen(new X11GraphicsDevice(display, AbstractGraphicsDevice.DEFAULT_UNIT, owner), screenIdx);
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
index 9eed887b5..bf8952565 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
@@ -79,7 +79,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
public Object clone() {
try {
return super.clone();
- } catch (CloneNotSupportedException e) {
+ } catch (final CloneNotSupportedException e) {
throw new NativeWindowException(e);
}
}
@@ -89,7 +89,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
* from <code>source</code> into this instance.
* @return this instance
*/
- public Capabilities copyFrom(CapabilitiesImmutable other) {
+ public Capabilities copyFrom(final CapabilitiesImmutable other) {
redBits = other.getRedBits();
greenBits = other.getGreenBits();
blueBits = other.getBlueBits();
@@ -122,12 +122,12 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if(this == obj) { return true; }
if(!(obj instanceof CapabilitiesImmutable)) {
return false;
}
- CapabilitiesImmutable other = (CapabilitiesImmutable)obj;
+ final CapabilitiesImmutable other = (CapabilitiesImmutable)obj;
boolean res = other.getRedBits()==redBits &&
other.getGreenBits()==greenBits &&
other.getBlueBits()==blueBits &&
@@ -171,7 +171,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
}
@Override
- public int getVisualID(VIDType type) throws NativeWindowException {
+ public int getVisualID(final VIDType type) throws NativeWindowException {
switch(type) {
case INTRINSIC:
case NATIVE:
@@ -189,7 +189,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
/** Sets the number of bits requested for the color buffer's red
component. On some systems only the color depth, which is the
sum of the red, green, and blue bits, is considered. */
- public void setRedBits(int redBits) {
+ public void setRedBits(final int redBits) {
this.redBits = redBits;
}
@@ -201,7 +201,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
/** Sets the number of bits requested for the color buffer's green
component. On some systems only the color depth, which is the
sum of the red, green, and blue bits, is considered. */
- public void setGreenBits(int greenBits) {
+ public void setGreenBits(final int greenBits) {
this.greenBits = greenBits;
}
@@ -213,7 +213,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
/** Sets the number of bits requested for the color buffer's blue
component. On some systems only the color depth, which is the
sum of the red, green, and blue bits, is considered. */
- public void setBlueBits(int blueBits) {
+ public void setBlueBits(final int blueBits) {
this.blueBits = blueBits;
}
@@ -234,7 +234,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
* not to <i>reflect</i> a current state. Nevertheless if this is the case - call it at last.
* </p>
*/
- public void setAlphaBits(int alphaBits) {
+ public void setAlphaBits(final int alphaBits) {
this.alphaBits = alphaBits;
}
@@ -253,7 +253,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
* due to the composite work required by the window manager.
* </p>
*/
- public void setBackgroundOpaque(boolean opaque) {
+ public void setBackgroundOpaque(final boolean opaque) {
backgroundOpaque = opaque;
if(!opaque && getAlphaBits()==0) {
setAlphaBits(1);
@@ -277,7 +277,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
* </p>
* @param onscreen
*/
- public void setOnscreen(boolean onscreen) {
+ public void setOnscreen(final boolean onscreen) {
this.onscreen=onscreen;
}
@@ -298,7 +298,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
* Requesting offscreen bitmap mode disables the offscreen auto selection.
* </p>
*/
- public void setBitmap(boolean enable) {
+ public void setBitmap(final boolean enable) {
if(enable) {
setOnscreen(false);
}
@@ -327,31 +327,31 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
This value is ignored if {@link #isBackgroundOpaque()} equals true.<br>
It defaults to half of the frambuffer value for red. <br>
A value of -1 is interpreted as any value. */
- public void setTransparentRedValue(int transValueRed) { transparentValueRed=transValueRed; }
+ public void setTransparentRedValue(final int transValueRed) { transparentValueRed=transValueRed; }
/** Sets the transparent green value for the frame buffer configuration,
ranging from 0 to the maximum frame buffer value for green.
This value is ignored if {@link #isBackgroundOpaque()} equals true.<br>
It defaults to half of the frambuffer value for green.<br>
A value of -1 is interpreted as any value. */
- public void setTransparentGreenValue(int transValueGreen) { transparentValueGreen=transValueGreen; }
+ public void setTransparentGreenValue(final int transValueGreen) { transparentValueGreen=transValueGreen; }
/** Sets the transparent blue value for the frame buffer configuration,
ranging from 0 to the maximum frame buffer value for blue.
This value is ignored if {@link #isBackgroundOpaque()} equals true.<br>
It defaults to half of the frambuffer value for blue.<br>
A value of -1 is interpreted as any value. */
- public void setTransparentBlueValue(int transValueBlue) { transparentValueBlue=transValueBlue; }
+ public void setTransparentBlueValue(final int transValueBlue) { transparentValueBlue=transValueBlue; }
/** Sets the transparent alpha value for the frame buffer configuration,
ranging from 0 to the maximum frame buffer value for alpha.
This value is ignored if {@link #isBackgroundOpaque()} equals true.<br>
It defaults to half of the frambuffer value for alpha.<br>
A value of -1 is interpreted as any value. */
- public void setTransparentAlphaValue(int transValueAlpha) { transparentValueAlpha=transValueAlpha; }
+ public void setTransparentAlphaValue(final int transValueAlpha) { transparentValueAlpha=transValueAlpha; }
@Override
- public StringBuilder toString(StringBuilder sink) {
+ public StringBuilder toString(final StringBuilder sink) {
return toString(sink, true);
}
@@ -359,7 +359,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
object. */
@Override
public String toString() {
- StringBuilder msg = new StringBuilder();
+ final StringBuilder msg = new StringBuilder();
msg.append("Caps[");
toString(msg);
msg.append("]");
@@ -393,7 +393,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
/** Component separator */
protected static final String CSEP = ", ";
- protected StringBuilder toString(StringBuilder sink, boolean withOnOffScreen) {
+ protected StringBuilder toString(StringBuilder sink, final boolean withOnOffScreen) {
if(null == sink) {
sink = new StringBuilder();
}
@@ -410,5 +410,5 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
return sink;
}
- protected final String toHexString(int val) { return Integer.toHexString(val); }
+ protected final String toHexString(final int val) { return Integer.toHexString(val); }
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
index 77cbe2995..d0c1a9b85 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
@@ -42,6 +42,8 @@ package javax.media.nativewindow;
import java.util.List;
+import com.jogamp.common.util.PropertyAccess;
+
import jogamp.nativewindow.Debug;
/** <P> The default implementation of the {@link
@@ -70,7 +72,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
static {
Debug.initSingleton();
- DEBUG = Debug.isPropertyDefined("nativewindow.debug.CapabilitiesChooser", true);
+ DEBUG = PropertyAccess.isPropertyDefined("nativewindow.debug.CapabilitiesChooser", true);
}
private final static int NO_SCORE = -9999999;
@@ -100,7 +102,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
}
// Create score array
- int[] scores = new int[availnum];
+ final int[] scores = new int[availnum];
for (int i = 0; i < availnum; i++) {
scores[i] = NO_SCORE;
}
@@ -137,7 +139,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
int scoreClosestToZero = NO_SCORE;
int chosenIndex = -1;
for (int i = 0; i < availnum; i++) {
- int score = scores[i];
+ final int score = scores[i];
if (score == NO_SCORE) {
continue;
}
@@ -161,7 +163,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
return chosenIndex;
}
- private static int sign(int score) {
+ private static int sign(final int score) {
if (score < 0) {
return -1;
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
index 42d7f3a23..7912832c1 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
@@ -41,8 +41,8 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
protected CapabilitiesImmutable capabilitiesChosen;
protected CapabilitiesImmutable capabilitiesRequested;
- public DefaultGraphicsConfiguration(AbstractGraphicsScreen screen,
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) {
+ public DefaultGraphicsConfiguration(final AbstractGraphicsScreen screen,
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested) {
if(null == screen) {
throw new IllegalArgumentException("Null screen");
}
@@ -64,7 +64,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
public Object clone() {
try {
return super.clone();
- } catch (CloneNotSupportedException e) {
+ } catch (final CloneNotSupportedException e) {
throw new NativeWindowException(e);
}
}
@@ -90,7 +90,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
}
@Override
- final public int getVisualID(VIDType type) throws NativeWindowException {
+ final public int getVisualID(final VIDType type) throws NativeWindowException {
return capabilitiesChosen.getVisualID(type);
}
@@ -103,7 +103,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
* </p>
* @see javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
*/
- protected void setChosenCapabilities(CapabilitiesImmutable capsChosen) {
+ protected void setChosenCapabilities(final CapabilitiesImmutable capsChosen) {
this.capabilitiesChosen = capsChosen;
}
@@ -115,7 +115,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
* a change of the graphics device in a multi-screen environment.
* </p>
*/
- protected void setScreen(AbstractGraphicsScreen screen) {
+ protected void setScreen(final AbstractGraphicsScreen screen) {
this.screen = screen;
}
@@ -127,11 +127,11 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
"]";
}
- public static String toHexString(int val) {
+ public static String toHexString(final int val) {
return "0x"+Integer.toHexString(val);
}
- public static String toHexString(long val) {
+ public static String toHexString(final long val) {
return "0x"+Long.toHexString(val);
}
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
index f733f91de..ab9286b3f 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
@@ -82,7 +82,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
public Object clone() {
try {
return super.clone();
- } catch (CloneNotSupportedException e) {
+ } catch (final CloneNotSupportedException e) {
throw new NativeWindowException(e);
}
}
@@ -178,7 +178,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
* Set the native handle of the underlying native device
* and return the previous one.
*/
- protected final long setHandle(long newHandle) {
+ protected final long setHandle(final long newHandle) {
final long oldHandle = handle;
handle = newHandle;
return oldHandle;
@@ -187,7 +187,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
protected Object getHandleOwnership() {
return null;
}
- protected Object setHandleOwnership(Object newOwnership) {
+ protected Object setHandleOwnership(final Object newOwnership) {
return null;
}
@@ -222,7 +222,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
* @param locker the ToolkitLock, if null, {@link jogamp.nativewindow.NullToolkitLock} is being used
* @return the previous ToolkitLock instance
*/
- protected ToolkitLock setToolkitLock(ToolkitLock locker) {
+ protected ToolkitLock setToolkitLock(final ToolkitLock locker) {
final ToolkitLock _toolkitLock = toolkitLock;
_toolkitLock.lock();
try {
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
index 4bd548916..3ee775904 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
@@ -36,12 +36,12 @@ public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen
private final AbstractGraphicsDevice device;
private final int idx;
- public DefaultGraphicsScreen(AbstractGraphicsDevice device, int idx) {
+ public DefaultGraphicsScreen(final AbstractGraphicsDevice device, final int idx) {
this.device = device;
this.idx = idx;
}
- public static AbstractGraphicsScreen createDefault(String type) {
+ public static AbstractGraphicsScreen createDefault(final String type) {
return new DefaultGraphicsScreen(new DefaultGraphicsDevice(type, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT), 0);
}
@@ -49,7 +49,7 @@ public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen
public Object clone() {
try {
return super.clone();
- } catch (CloneNotSupportedException e) {
+ } catch (final CloneNotSupportedException e) {
throw new NativeWindowException(e);
}
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
index c09e6eaa4..3f8113baa 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
@@ -70,7 +70,7 @@ public abstract class GraphicsConfigurationFactory {
public final Class<?> capsType;
private final int hash32;
- public DeviceCapsType(Class<?> deviceType, Class<?> capsType) {
+ public DeviceCapsType(final Class<?> deviceType, final Class<?> capsType) {
this.deviceType = deviceType;
this.capsType = capsType;
@@ -86,10 +86,10 @@ public abstract class GraphicsConfigurationFactory {
}
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if(this == obj) { return true; }
if (obj instanceof DeviceCapsType) {
- DeviceCapsType dct = (DeviceCapsType)obj;
+ final DeviceCapsType dct = (DeviceCapsType)obj;
return deviceType == dct.deviceType && capsType == dct.capsType;
}
return false;
@@ -135,14 +135,14 @@ public abstract class GraphicsConfigurationFactory {
try {
ReflectionUtil.callStaticMethod("jogamp.nativewindow.x11.X11GraphicsConfigurationFactory",
"registerFactory", null, null, GraphicsConfigurationFactory.class.getClassLoader());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException(e);
}
if(NativeWindowFactory.isAWTAvailable()) {
try {
ReflectionUtil.callStaticMethod("jogamp.nativewindow.x11.awt.X11AWTGraphicsConfigurationFactory",
"registerFactory", null, null, GraphicsConfigurationFactory.class.getClassLoader());
- } catch (Exception e) { /* n/a */ }
+ } catch (final Exception e) { /* n/a */ }
}
}
}
@@ -162,11 +162,11 @@ public abstract class GraphicsConfigurationFactory {
return Thread.currentThread().getName();
}
- protected static String toHexString(int val) {
+ protected static String toHexString(final int val) {
return "0x" + Integer.toHexString(val);
}
- protected static String toHexString(long val) {
+ protected static String toHexString(final long val) {
return "0x" + Long.toHexString(val);
}
@@ -181,7 +181,7 @@ public abstract class GraphicsConfigurationFactory {
*
* @see #getFactory(Class, Class)
*/
- public static GraphicsConfigurationFactory getFactory(AbstractGraphicsDevice device, CapabilitiesImmutable caps) {
+ public static GraphicsConfigurationFactory getFactory(final AbstractGraphicsDevice device, final CapabilitiesImmutable caps) {
if (device == null) {
throw new IllegalArgumentException("null device");
}
@@ -216,7 +216,7 @@ public abstract class GraphicsConfigurationFactory {
* @throws IllegalArgumentException if the deviceType does not implement {@link AbstractGraphicsDevice} or
* capabilitiesType does not implement {@link CapabilitiesImmutable}
*/
- public static GraphicsConfigurationFactory getFactory(Class<?> deviceType, Class<?> capabilitiesType)
+ public static GraphicsConfigurationFactory getFactory(final Class<?> deviceType, final Class<?> capabilitiesType)
throws IllegalArgumentException, NativeWindowException
{
if (!(defaultDeviceCapsType.deviceType.isAssignableFrom(deviceType))) {
@@ -242,7 +242,7 @@ public abstract class GraphicsConfigurationFactory {
for(int j=0; j<deviceTypes.size(); j++) {
final Class<?> interfaceDevice = deviceTypes.get(j);
for(int i=0; i<capabilitiesTypes.size(); i++) {
- Class<?> interfaceCaps = capabilitiesTypes.get(i);
+ final Class<?> interfaceCaps = capabilitiesTypes.get(i);
final DeviceCapsType dct = new DeviceCapsType(interfaceDevice, interfaceCaps);
final GraphicsConfigurationFactory factory = registeredFactories.get(dct);
if (factory != null) {
@@ -260,7 +260,7 @@ public abstract class GraphicsConfigurationFactory {
}
return factory;
}
- private static ArrayList<Class<?>> getAllAssignableClassesFrom(Class<?> superClassOrInterface, Class<?> fromClass, boolean interfacesOnly) {
+ private static ArrayList<Class<?>> getAllAssignableClassesFrom(final Class<?> superClassOrInterface, final Class<?> fromClass, final boolean interfacesOnly) {
// Using a todo list avoiding a recursive loop!
final ArrayList<Class<?>> inspectClasses = new ArrayList<Class<?>>();
final ArrayList<Class<?>> resolvedInterfaces = new ArrayList<Class<?>>();
@@ -271,7 +271,7 @@ public abstract class GraphicsConfigurationFactory {
}
return resolvedInterfaces;
}
- private static void getAllAssignableClassesFrom(Class<?> superClassOrInterface, Class<?> fromClass, boolean interfacesOnly, List<Class<?>> resolvedInterfaces, List<Class<?>> inspectClasses) {
+ private static void getAllAssignableClassesFrom(final Class<?> superClassOrInterface, final Class<?> fromClass, final boolean interfacesOnly, final List<Class<?>> resolvedInterfaces, final List<Class<?>> inspectClasses) {
final ArrayList<Class<?>> types = new ArrayList<Class<?>>();
if( superClassOrInterface.isAssignableFrom(fromClass) && !resolvedInterfaces.contains(fromClass)) {
if( !interfacesOnly || fromClass.isInterface() ) {
@@ -295,10 +295,10 @@ public abstract class GraphicsConfigurationFactory {
}
}
private static void dumpFactories() {
- Set<DeviceCapsType> dcts = registeredFactories.keySet();
+ final Set<DeviceCapsType> dcts = registeredFactories.keySet();
int i=0;
- for(Iterator<DeviceCapsType> iter = dcts.iterator(); iter.hasNext(); ) {
- DeviceCapsType dct = iter.next();
+ for(final Iterator<DeviceCapsType> iter = dcts.iterator(); iter.hasNext(); ) {
+ final DeviceCapsType dct = iter.next();
System.err.println("Factory #"+i+": "+dct+" -> "+registeredFactories.get(dct));
i++;
}
@@ -323,7 +323,7 @@ public abstract class GraphicsConfigurationFactory {
* @return the previous registered factory, or null if none
* @throws IllegalArgumentException if the given class does not implement AbstractGraphicsDevice
*/
- protected static GraphicsConfigurationFactory registerFactory(Class<?> abstractGraphicsDeviceImplementor, Class<?> capabilitiesType, GraphicsConfigurationFactory factory)
+ protected static GraphicsConfigurationFactory registerFactory(final Class<?> abstractGraphicsDeviceImplementor, final Class<?> capabilitiesType, final GraphicsConfigurationFactory factory)
throws IllegalArgumentException
{
if (!(defaultDeviceCapsType.deviceType.isAssignableFrom(abstractGraphicsDeviceImplementor))) {
@@ -400,9 +400,9 @@ public abstract class GraphicsConfigurationFactory {
* @see javax.media.nativewindow.DefaultGraphicsConfiguration#setChosenCapabilities(Capabilities caps)
*/
public final AbstractGraphicsConfiguration
- chooseGraphicsConfiguration(CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
- CapabilitiesChooser chooser,
- AbstractGraphicsScreen screen, int nativeVisualID)
+ chooseGraphicsConfiguration(final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+ final CapabilitiesChooser chooser,
+ final AbstractGraphicsScreen screen, final int nativeVisualID)
throws IllegalArgumentException, NativeWindowException {
if(null==capsChosen) {
throw new NativeWindowException("Chosen Capabilities are null");
@@ -413,7 +413,7 @@ public abstract class GraphicsConfigurationFactory {
if(null==screen) {
throw new NativeWindowException("Screen is null");
}
- AbstractGraphicsDevice device = screen.getDevice();
+ final AbstractGraphicsDevice device = screen.getDevice();
if(null==device) {
throw new NativeWindowException("Screen's Device is null");
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java
index 0943c8c09..16355032f 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java
@@ -50,19 +50,19 @@ public class NativeWindowException extends RuntimeException {
/** Constructs a NativeWindowException object with the specified detail
message. */
- public NativeWindowException(String message) {
+ public NativeWindowException(final String message) {
super(message);
}
/** Constructs a NativeWindowException object with the specified detail
message and root cause. */
- public NativeWindowException(String message, Throwable cause) {
+ public NativeWindowException(final String message, final Throwable cause) {
super(message, cause);
}
/** Constructs a NativeWindowException object with the specified root
cause. */
- public NativeWindowException(Throwable cause) {
+ public NativeWindowException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
index edaed3a39..b2889fdcf 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
@@ -45,6 +45,7 @@ import java.util.Map;
import javax.media.nativewindow.util.PointImmutable;
+import jogamp.common.os.PlatformPropsImpl;
import jogamp.nativewindow.Debug;
import jogamp.nativewindow.NativeWindowFactoryImpl;
import jogamp.nativewindow.ToolkitProperties;
@@ -55,6 +56,7 @@ import jogamp.nativewindow.windows.GDIUtil;
import jogamp.nativewindow.x11.X11Lib;
import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.ReflectionUtil;
import com.jogamp.nativewindow.UpstreamWindowHookMutableSizePos;
import com.jogamp.nativewindow.awt.AWTGraphicsDevice;
@@ -143,7 +145,7 @@ public abstract class NativeWindowFactory {
}
private static String _getNativeWindowingType() {
- switch(Platform.OS_TYPE) {
+ switch(PlatformPropsImpl.OS_TYPE) {
case ANDROID:
return TYPE_ANDROID;
case MACOS:
@@ -174,7 +176,7 @@ public abstract class NativeWindowFactory {
public Object run() {
Platform.initSingleton(); // last resort ..
_DEBUG[0] = Debug.debug("NativeWindow");
- _tmp[0] = Debug.getProperty("nativewindow.ws.name", true);
+ _tmp[0] = PropertyAccess.getProperty("nativewindow.ws.name", true);
Runtime.getRuntime().addShutdownHook(
new Thread(new Runnable() {
@Override
@@ -234,7 +236,7 @@ public abstract class NativeWindowFactory {
* @param head if true add runnable at the start, otherwise at the end
* @param runnable runnable to be added.
*/
- public static void addCustomShutdownHook(boolean head, Runnable runnable) {
+ public static void addCustomShutdownHook(final boolean head, final Runnable runnable) {
synchronized( customShutdownHooks ) {
if( !customShutdownHooks.contains( runnable ) ) {
if( head ) {
@@ -249,7 +251,7 @@ public abstract class NativeWindowFactory {
/**
* Cleanup resources at JVM shutdown
*/
- public static synchronized void shutdown(boolean _isJVMShuttingDown) {
+ public static synchronized void shutdown(final boolean _isJVMShuttingDown) {
isJVMShuttingDown = _isJVMShuttingDown;
if(DEBUG) {
System.err.println("NativeWindowFactory.shutdown() START: JVM Shutdown "+isJVMShuttingDown+", on thread "+Thread.currentThread().getName());
@@ -262,7 +264,7 @@ public abstract class NativeWindowFactory {
System.err.println("NativeWindowFactory.shutdown - customShutdownHook #"+(i+1)+"/"+cshCount);
}
customShutdownHooks.get(i).run();
- } catch(Throwable t) {
+ } catch(final Throwable t) {
System.err.println("NativeWindowFactory.shutdown: Caught "+t.getClass().getName()+" during customShutdownHook #"+(i+1)+"/"+cshCount);
if( DEBUG ) {
t.printStackTrace();
@@ -329,19 +331,19 @@ public abstract class NativeWindowFactory {
if( Platform.AWT_AVAILABLE &&
ReflectionUtil.isClassAvailable("com.jogamp.nativewindow.awt.AWTGraphicsDevice", cl) ) {
- Method[] jawtUtilMethods = AccessController.doPrivileged(new PrivilegedAction<Method[]>() {
+ final Method[] jawtUtilMethods = AccessController.doPrivileged(new PrivilegedAction<Method[]>() {
@Override
public Method[] run() {
try {
- Class<?> _jawtUtilClass = Class.forName(JAWTUtilClassName, true, NativeWindowFactory.class.getClassLoader());
- Method jawtUtilIsHeadlessMethod = _jawtUtilClass.getDeclaredMethod("isHeadlessMode", (Class[])null);
+ final Class<?> _jawtUtilClass = Class.forName(JAWTUtilClassName, true, NativeWindowFactory.class.getClassLoader());
+ final Method jawtUtilIsHeadlessMethod = _jawtUtilClass.getDeclaredMethod("isHeadlessMode", (Class[])null);
jawtUtilIsHeadlessMethod.setAccessible(true);
- Method jawtUtilInitMethod = _jawtUtilClass.getDeclaredMethod("initSingleton", (Class[])null);
+ final Method jawtUtilInitMethod = _jawtUtilClass.getDeclaredMethod("initSingleton", (Class[])null);
jawtUtilInitMethod.setAccessible(true);
- Method jawtUtilGetJAWTToolkitLockMethod = _jawtUtilClass.getDeclaredMethod("getJAWTToolkitLock", new Class[]{});
+ final Method jawtUtilGetJAWTToolkitLockMethod = _jawtUtilClass.getDeclaredMethod("getJAWTToolkitLock", new Class[]{});
jawtUtilGetJAWTToolkitLockMethod.setAccessible(true);
return new Method[] { jawtUtilInitMethod, jawtUtilIsHeadlessMethod, jawtUtilGetJAWTToolkitLockMethod };
- } catch (Exception e) {
+ } catch (final Exception e) {
if(DEBUG) {
e.printStackTrace();
}
@@ -382,7 +384,7 @@ public abstract class NativeWindowFactory {
registeredFactories = Collections.synchronizedMap(new HashMap<Class<?>, NativeWindowFactory>());
// register our default factory -> NativeWindow
- NativeWindowFactory factory = new NativeWindowFactoryImpl();
+ final NativeWindowFactory factory = new NativeWindowFactoryImpl();
nativeWindowClass = javax.media.nativewindow.NativeWindow.class;
registerFactory(nativeWindowClass, factory);
defaultFactory = factory;
@@ -414,7 +416,7 @@ public abstract class NativeWindowFactory {
* @return the native window type, e.g. {@link #TYPE_X11}, which is canonical via {@link String#intern()}.
* Hence {@link String#equals(Object)} and <code>==</code> produce the same result.
*/
- public static String getNativeWindowType(boolean useCustom) {
+ public static String getNativeWindowType(final boolean useCustom) {
return useCustom?nativeWindowingTypeCustom:nativeWindowingTypePure;
}
@@ -431,7 +433,7 @@ public abstract class NativeWindowFactory {
} */
/** Sets the default NativeWindowFactory. */
- public static void setDefaultFactory(NativeWindowFactory factory) {
+ public static void setDefaultFactory(final NativeWindowFactory factory) {
defaultFactory = factory;
}
@@ -472,7 +474,7 @@ public abstract class NativeWindowFactory {
* <li> {@link jogamp.nativewindow.NullToolkitLock} </li>
* </ul>
*/
- public static ToolkitLock getDefaultToolkitLock(String type) {
+ public static ToolkitLock getDefaultToolkitLock(final String type) {
if( requiresToolkitLock ) {
if( TYPE_AWT == type && isAWTAvailable() ) {
return getAWTToolkitLock();
@@ -490,7 +492,7 @@ public abstract class NativeWindowFactory {
* <li> {@link jogamp.nativewindow.NullToolkitLock} </li>
* </ul>
*/
- public static ToolkitLock getDefaultToolkitLock(String type, long deviceHandle) {
+ public static ToolkitLock getDefaultToolkitLock(final String type, final long deviceHandle) {
if( requiresToolkitLock ) {
if( TYPE_AWT == type && isAWTAvailable() ) {
return getAWTToolkitLock();
@@ -505,7 +507,7 @@ public abstract class NativeWindowFactory {
* @param screen -1 is default screen of the given device, e.g. maybe 0 or determined by native API. >= 0 is specific screen
* @return newly created AbstractGraphicsScreen matching device's native type
*/
- public static AbstractGraphicsScreen createScreen(AbstractGraphicsDevice device, int screen) {
+ public static AbstractGraphicsScreen createScreen(final AbstractGraphicsDevice device, int screen) {
final String type = device.getType();
if( TYPE_X11 == type ) {
final X11GraphicsDevice x11Device = (X11GraphicsDevice)device;
@@ -530,13 +532,13 @@ public abstract class NativeWindowFactory {
already assumed the responsibility of creating a compatible
NativeWindow implementation, or it might be that of a toolkit
class like {@link java.awt.Component Component}. */
- public static NativeWindowFactory getFactory(Class<?> windowClass) throws IllegalArgumentException {
+ public static NativeWindowFactory getFactory(final Class<?> windowClass) throws IllegalArgumentException {
if (nativeWindowClass.isAssignableFrom(windowClass)) {
return registeredFactories.get(nativeWindowClass);
}
Class<?> clazz = windowClass;
while (clazz != null) {
- NativeWindowFactory factory = registeredFactories.get(clazz);
+ final NativeWindowFactory factory = registeredFactories.get(clazz);
if (factory != null) {
return factory;
}
@@ -548,7 +550,7 @@ public abstract class NativeWindowFactory {
/** Registers a NativeWindowFactory handling window objects of the
given class. This does not need to be called by end users,
only implementors of new NativeWindowFactory subclasses. */
- protected static void registerFactory(Class<?> windowClass, NativeWindowFactory factory) {
+ protected static void registerFactory(final Class<?> windowClass, final NativeWindowFactory factory) {
if(DEBUG) {
System.err.println("NativeWindowFactory.registerFactory() "+windowClass+" -> "+factory);
}
@@ -574,7 +576,7 @@ public abstract class NativeWindowFactory {
@see javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
*/
- public static NativeWindow getNativeWindow(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException, NativeWindowException {
+ public static NativeWindow getNativeWindow(final Object winObj, final AbstractGraphicsConfiguration config) throws IllegalArgumentException, NativeWindowException {
if (winObj == null) {
throw new IllegalArgumentException("Null window object");
}
@@ -600,7 +602,7 @@ public abstract class NativeWindowFactory {
* @param ifEnabled If true, only return the enabled {@link OffscreenLayerSurface}, see {@link OffscreenLayerOption#isOffscreenLayerSurfaceEnabled()}.
* @return
*/
- public static OffscreenLayerSurface getOffscreenLayerSurface(NativeSurface surface, boolean ifEnabled) {
+ public static OffscreenLayerSurface getOffscreenLayerSurface(final NativeSurface surface, final boolean ifEnabled) {
if(surface instanceof OffscreenLayerSurface &&
( !ifEnabled || surface instanceof OffscreenLayerOption ) ) {
final OffscreenLayerSurface ols = (OffscreenLayerSurface) surface;
@@ -631,7 +633,7 @@ public abstract class NativeWindowFactory {
* at creation time (see above), it is not valid for further processing.
* </p>
*/
- public static boolean isNativeVisualIDValidForProcessing(int visualID) {
+ public static boolean isNativeVisualIDValidForProcessing(final int visualID) {
return NativeWindowFactory.TYPE_X11 != NativeWindowFactory.getNativeWindowType(false) ||
VisualIDHolder.VID_UNDEFINED != visualID ;
}
@@ -642,7 +644,7 @@ public abstract class NativeWindowFactory {
* The device will be opened if <code>own</code> is true, otherwise no native handle will ever be acquired.
* </p>
*/
- public static AbstractGraphicsDevice createDevice(String displayConnection, boolean own) {
+ public static AbstractGraphicsDevice createDevice(final String displayConnection, final boolean own) {
final String nwt = NativeWindowFactory.getNativeWindowType(true);
if( NativeWindowFactory.TYPE_X11 == nwt ) {
if( own ) {
@@ -679,8 +681,8 @@ public abstract class NativeWindowFactory {
* or a simple <i>dummy</i> instance, see {@link #createDevice(String, boolean)}.
* </p>
*/
- public static NativeWindow createWrappedWindow(AbstractGraphicsScreen aScreen, long surfaceHandle, long windowHandle,
- UpstreamWindowHookMutableSizePos hook) {
+ public static NativeWindow createWrappedWindow(final AbstractGraphicsScreen aScreen, final long surfaceHandle, final long windowHandle,
+ final UpstreamWindowHookMutableSizePos hook) {
final CapabilitiesImmutable caps = new Capabilities();
final AbstractGraphicsConfiguration config = new DefaultGraphicsConfiguration(aScreen, caps, caps);
return new WrappedWindow(config, surfaceHandle, hook, true, windowHandle);
@@ -690,7 +692,7 @@ public abstract class NativeWindowFactory {
* @param nw
* @return top-left client-area position in window units
*/
- public static PointImmutable getLocationOnScreen(NativeWindow nw) {
+ public static PointImmutable getLocationOnScreen(final NativeWindow nw) {
final String nwt = NativeWindowFactory.getNativeWindowType(true);
if( NativeWindowFactory.TYPE_X11 == nwt ) {
return X11Lib.GetRelativeLocation(nw.getDisplayHandle(), nw.getScreenIndex(), nw.getWindowHandle(), 0, 0, 0);
diff --git a/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java b/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
index 4ed79b1dc..e337166d4 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
@@ -51,7 +51,7 @@ public interface VisualIDHolder {
public final int id;
- VIDType(int id){
+ VIDType(final int id){
this.id = id;
}
}
@@ -114,14 +114,14 @@ public interface VisualIDHolder {
/** Comparing {@link VIDType#NATIVE} */
public static class VIDComparator implements Comparator<VisualIDHolder> {
- private VIDType type;
+ private final VIDType type;
- public VIDComparator(VIDType type) {
+ public VIDComparator(final VIDType type) {
this.type = type;
}
@Override
- public int compare(VisualIDHolder vid1, VisualIDHolder vid2) {
+ public int compare(final VisualIDHolder vid1, final VisualIDHolder vid2) {
final int id1 = vid1.getVisualID(type);
final int id2 = vid2.getVisualID(type);
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
index 5c9dc279d..4c9672c26 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
@@ -58,7 +58,7 @@ public class Dimension implements Cloneable, DimensionImmutable {
public Object clone() {
try {
return super.clone();
- } catch (CloneNotSupportedException ex) {
+ } catch (final CloneNotSupportedException ex) {
throw new InternalError();
}
}
@@ -68,22 +68,22 @@ public class Dimension implements Cloneable, DimensionImmutable {
@Override
public final int getHeight() { return height; }
- public final void set(int width, int height) {
+ public final void set(final int width, final int height) {
this.width = width;
this.height = height;
}
- public final void setWidth(int width) {
+ public final void setWidth(final int width) {
this.width = width;
}
- public final void setHeight(int height) {
+ public final void setHeight(final int height) {
this.height = height;
}
- public final Dimension scale(int s) {
+ public final Dimension scale(final int s) {
width *= s;
height *= s;
return this;
}
- public final Dimension add(Dimension pd) {
+ public final Dimension add(final Dimension pd) {
width += pd.width ;
height += pd.height ;
return this;
@@ -108,10 +108,10 @@ public class Dimension implements Cloneable, DimensionImmutable {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if(this == obj) { return true; }
if (obj instanceof Dimension) {
- Dimension p = (Dimension)obj;
+ final Dimension p = (Dimension)obj;
return height == p.height &&
width == p.width ;
}
@@ -121,7 +121,7 @@ public class Dimension implements Cloneable, DimensionImmutable {
@Override
public int hashCode() {
// 31 * x == (x << 5) - x
- int hash = 31 + width;
+ final int hash = 31 + width;
return ((hash << 5) - hash) + height;
}
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java b/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
index dfe78b06f..5ec4c758f 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
@@ -42,7 +42,7 @@ public class Insets implements Cloneable, InsetsImmutable {
this(0, 0, 0, 0);
}
- public Insets(int left, int right, int top, int bottom) {
+ public Insets(final int left, final int right, final int top, final int bottom) {
this.l=left;
this.r=right;
this.t=top;
@@ -58,7 +58,7 @@ public class Insets implements Cloneable, InsetsImmutable {
protected Object clone() {
try {
return super.clone();
- } catch (CloneNotSupportedException ex) {
+ } catch (final CloneNotSupportedException ex) {
throw new InternalError();
}
}
@@ -83,35 +83,35 @@ public class Insets implements Cloneable, InsetsImmutable {
* @param top top inset width in window units.
* @param bottom bottom inset width in window units.
*/
- public final void set(int left, int right, int top, int bottom) {
+ public final void set(final int left, final int right, final int top, final int bottom) {
l = left; r = right; t = top; b = bottom;
}
/**
* Set the left inset value of this instance in window units.
* @param left left inset width in window units.
*/
- public final void setLeftWidth(int left) { l = left; }
+ public final void setLeftWidth(final int left) { l = left; }
/**
* Set the right inset value of this instance in window units.
* @param right right inset width in window units.
*/
- public final void setRightWidth(int right) { r = right; }
+ public final void setRightWidth(final int right) { r = right; }
/**
* Set the top inset value of this instance in window units.
* @param top top inset width in window units.
*/
- public final void setTopHeight(int top) { t = top; }
+ public final void setTopHeight(final int top) { t = top; }
/**
* Set the bottom inset value of this instance in window units.
* @param bottom bottom inset width in window units.
*/
- public final void setBottomHeight(int bottom) { b = bottom; }
+ public final void setBottomHeight(final int bottom) { b = bottom; }
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if(this == obj) { return true; }
if (obj instanceof Insets) {
- Insets insets = (Insets)obj;
+ final Insets insets = (Insets)obj;
return (r == insets.r) && (l == insets.l) &&
(b == insets.b) && (t == insets.t);
}
@@ -120,11 +120,11 @@ public class Insets implements Cloneable, InsetsImmutable {
@Override
public int hashCode() {
- int sum1 = l + b;
- int sum2 = t + r;
- int val1 = sum1 * (sum1 + 1)/2 + l;
- int val2 = sum2 * (sum2 + 1)/2 + r;
- int sum3 = val1 + val2;
+ final int sum1 = l + b;
+ final int sum2 = t + r;
+ final int val1 = sum1 * (sum1 + 1)/2 + l;
+ final int val2 = sum2 * (sum2 + 1)/2 + r;
+ final int sum3 = val1 + val2;
return sum3 * (sum3 + 1)/2 + val2;
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormat.java b/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormat.java
index 823496a92..fd3c31f7f 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormat.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormat.java
@@ -189,7 +189,7 @@ public enum PixelFormat {
/** Number of bytes per pixel, e.g. 4 for RGBA. */
public final int bytesPerPixel() { return (7+bitsPerPixel)/8; }
- private PixelFormat(int componentCount, int bpp) {
+ private PixelFormat(final int componentCount, final int bpp) {
this.componentCount = componentCount;
this.bitsPerPixel = bpp;
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormatUtil.java b/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormatUtil.java
index 87a9ca4fc..21bfa8a54 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormatUtil.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormatUtil.java
@@ -85,7 +85,7 @@ public class PixelFormatUtil {
* Returns the {@link PixelFormat} with reversed components of <code>fmt</code>.
* If no reversed {@link PixelFormat} is available, returns <code>fmt</code>.
*/
- public static PixelFormat getReversed(PixelFormat fmt) {
+ public static PixelFormat getReversed(final PixelFormat fmt) {
switch(fmt) {
case LUMINANCE:
return PixelFormat.LUMINANCE;
@@ -106,7 +106,7 @@ public class PixelFormatUtil {
}
}
- public static int getValue32(PixelFormat src_fmt, ByteBuffer src, int srcOff) {
+ public static int getValue32(final PixelFormat src_fmt, final ByteBuffer src, int srcOff) {
switch(src_fmt) {
case LUMINANCE: {
final byte c1 = src.get(srcOff++);
@@ -134,7 +134,7 @@ public class PixelFormatUtil {
}
}
- public static int convertToInt32(PixelFormat dest_fmt, final byte r, final byte g, final byte b, final byte a) {
+ public static int convertToInt32(final PixelFormat dest_fmt, final byte r, final byte g, final byte b, final byte a) {
switch(dest_fmt) {
case LUMINANCE: {
final byte l = ( byte) ( ( ( ( 0xff & r ) + ( 0xff & g ) + ( 0xff & b ) ) / 3 ) );
@@ -157,7 +157,7 @@ public class PixelFormatUtil {
}
}
- public static int convertToInt32(PixelFormat dest_fmt, PixelFormat src_fmt, ByteBuffer src, int srcOff) {
+ public static int convertToInt32(final PixelFormat dest_fmt, final PixelFormat src_fmt, final ByteBuffer src, int srcOff) {
final byte r, g, b, a;
switch(src_fmt) {
case LUMINANCE:
@@ -208,7 +208,7 @@ public class PixelFormatUtil {
return convertToInt32(dest_fmt, r, g, b, a);
}
- public static int convertToInt32(PixelFormat dest_fmt, PixelFormat src_fmt, final int src_pixel) {
+ public static int convertToInt32(final PixelFormat dest_fmt, final PixelFormat src_fmt, final int src_pixel) {
final byte r, g, b, a;
switch(src_fmt) {
case LUMINANCE:
@@ -260,7 +260,7 @@ public class PixelFormatUtil {
}
public static PixelRectangle convert32(final PixelRectangle src,
- final PixelFormat destFmt, int ddestStride, final boolean isGLOriented,
+ final PixelFormat destFmt, final int ddestStride, final boolean isGLOriented,
final boolean destIsDirect) {
final int width = src.getSize().getWidth();
final int height = src.getSize().getHeight();
@@ -281,7 +281,7 @@ public class PixelFormatUtil {
// System.err.println("XXX: DEST fmt "+destFmt+", stride "+destStride+" ("+ddestStride+"), isGL "+isGLOriented+", "+width+"x"+height+", capacity "+capacity+", "+bb);
final PixelFormatUtil.PixelSink32 imgSink = new PixelFormatUtil.PixelSink32() {
- public void store(int x, int y, int pixel) {
+ public void store(final int x, final int y, final int pixel) {
int o = destStride*y+x*bpp;
bb.put(o++, (byte) ( pixel )); // 1
if( 3 <= bpp ) {
@@ -309,7 +309,7 @@ public class PixelFormatUtil {
return new PixelRectangle.GenericPixelRect(destFmt, src.getSize(), destStride, isGLOriented, bb);
}
- public static void convert32(PixelSink32 destInt32, final PixelRectangle src) {
+ public static void convert32(final PixelSink32 destInt32, final PixelRectangle src) {
convert32(destInt32,
src.getPixels(), src.getPixelformat(),
src.isGLOriented(),
@@ -333,7 +333,7 @@ public class PixelFormatUtil {
* Must be >= {@link PixelFormat#bytesPerPixel() src_fmt.bytesPerPixel()} * width.
* @throws IllegalArgumentException if <code>strideInBytes</code> is invalid
*/
- public static void convert32(PixelSink32 dest32,
+ public static void convert32(final PixelSink32 dest32,
final ByteBuffer src_bb, final PixelFormat src_fmt, final boolean src_glOriented, final int width, final int height, int stride_bytes) {
final int src_bpp = src_fmt.bytesPerPixel();
if( 0 != stride_bytes ) {
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
index e544118d0..3576a7dd0 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
@@ -33,7 +33,7 @@ public class Point implements Cloneable, PointImmutable {
int x;
int y;
- public Point(int x, int y) {
+ public Point(final int x, final int y) {
this.x=x;
this.y=y;
}
@@ -51,7 +51,7 @@ public class Point implements Cloneable, PointImmutable {
public Object clone() {
try {
return super.clone();
- } catch (CloneNotSupportedException ex) {
+ } catch (final CloneNotSupportedException ex) {
throw new InternalError();
}
}
@@ -70,10 +70,10 @@ public class Point implements Cloneable, PointImmutable {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if(this == obj) { return true; }
if (obj instanceof Point) {
- Point p = (Point)obj;
+ final Point p = (Point)obj;
return y == p.y && x == p.x;
}
return false;
@@ -102,9 +102,9 @@ public class Point implements Cloneable, PointImmutable {
return x + " / " + y;
}
- public final void set(int x, int y) { this.x = x; this.y = y; }
- public final void setX(int x) { this.x = x; }
- public final void setY(int y) { this.y = y; }
+ public final void set(final int x, final int y) { this.x = x; this.y = y; }
+ public final void setX(final int x) { this.x = x; }
+ public final void setY(final int y) { this.y = y; }
/**
* Translate this instance's x- and y-components,
@@ -112,7 +112,7 @@ public class Point implements Cloneable, PointImmutable {
* @param pd delta point
* @return this instance for scaling
*/
- public final Point translate(Point pd) {
+ public final Point translate(final Point pd) {
x += pd.x ;
y += pd.y ;
return this;
@@ -125,7 +125,7 @@ public class Point implements Cloneable, PointImmutable {
* @param dy delta for y
* @return this instance for scaling
*/
- public final Point translate(int dx, int dy) {
+ public final Point translate(final int dx, final int dy) {
x += dx ;
y += dy ;
return this;
@@ -138,7 +138,7 @@ public class Point implements Cloneable, PointImmutable {
* @param sy scale factor for y
* @return this instance for scaling
*/
- public final Point scale(int sx, int sy) {
+ public final Point scale(final int sx, final int sy) {
x *= sx ;
y *= sy ;
return this;
@@ -151,7 +151,7 @@ public class Point implements Cloneable, PointImmutable {
* @param sy inverse scale factor for y
* @return this instance for scaling
*/
- public final Point scaleInv(int sx, int sy) {
+ public final Point scaleInv(final int sx, final int sy) {
x /= sx ;
y /= sy ;
return this;
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
index 57535c26e..acc7b722d 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
@@ -56,7 +56,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
protected Object clone() {
try {
return super.clone();
- } catch (CloneNotSupportedException ex) {
+ } catch (final CloneNotSupportedException ex) {
throw new InternalError();
}
}
@@ -154,7 +154,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
* @param sy scale factor for y
* @return this instance for scaling
*/
- public final Rectangle scale(int sx, int sy) {
+ public final Rectangle scale(final int sx, final int sy) {
x *= sx ;
y *= sy ;
width *= sx ;
@@ -169,7 +169,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
* @param sy inverse scale factor for y
* @return this instance for scaling
*/
- public final Rectangle scaleInv(int sx, int sy) {
+ public final Rectangle scaleInv(final int sx, final int sy) {
x /= sx ;
y /= sy ;
width /= sx ;
@@ -203,10 +203,10 @@ public class Rectangle implements Cloneable, RectangleImmutable {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if(this == obj) { return true; }
if (obj instanceof Rectangle) {
- Rectangle rect = (Rectangle)obj;
+ final Rectangle rect = (Rectangle)obj;
return (y == rect.y) && (x == rect.x) &&
(height == rect.height) && (width == rect.width);
}
@@ -215,11 +215,11 @@ public class Rectangle implements Cloneable, RectangleImmutable {
@Override
public int hashCode() {
- int sum1 = x + height;
- int sum2 = width + y;
- int val1 = sum1 * (sum1 + 1)/2 + x;
- int val2 = sum2 * (sum2 + 1)/2 + y;
- int sum3 = val1 + val2;
+ final int sum1 = x + height;
+ final int sum2 = width + y;
+ final int val1 = sum1 * (sum1 + 1)/2 + x;
+ final int val2 = sum2 * (sum2 + 1)/2 + y;
+ final int sum3 = val1 + val2;
return sum3 * (sum3 + 1)/2 + val2;
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
index 6b4d2f19c..601e6dd71 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
@@ -40,7 +40,7 @@ public class SurfaceSize implements Comparable<SurfaceSize> {
final DimensionImmutable resolution;
final int bitsPerPixel;
- public SurfaceSize(DimensionImmutable resolution, int bitsPerPixel) {
+ public SurfaceSize(final DimensionImmutable resolution, final int bitsPerPixel) {
if(null==resolution || bitsPerPixel<=0) {
throw new IllegalArgumentException("resolution must be set and bitsPerPixel greater 0");
}
@@ -92,10 +92,10 @@ public class SurfaceSize implements Comparable<SurfaceSize> {
* otherwise <code>false</code>.
*/
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if(this == obj) { return true; }
if (obj instanceof SurfaceSize) {
- SurfaceSize p = (SurfaceSize)obj;
+ final SurfaceSize p = (SurfaceSize)obj;
return getResolution().equals(p.getResolution()) &&
getBitsPerPixel() == p.getBitsPerPixel();
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/Debug.java b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
index b7197dbca..1c4874fba 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/Debug.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
@@ -63,7 +63,7 @@ public class Debug extends PropertyAccess {
verbose = isPropertyDefined("nativewindow.verbose", true);
debugAll = isPropertyDefined("nativewindow.debug", true);
if (verbose) {
- Package p = Package.getPackage("javax.media.nativewindow");
+ final Package p = Package.getPackage("javax.media.nativewindow");
System.err.println("NativeWindow specification version " + p.getSpecificationVersion());
System.err.println("NativeWindow implementation version " + p.getImplementationVersion());
System.err.println("NativeWindow implementation vendor " + p.getImplementationVendor());
@@ -81,7 +81,7 @@ public class Debug extends PropertyAccess {
return debugAll;
}
- public static final boolean debug(String subcomponent) {
+ public static final boolean debug(final String subcomponent) {
return debugAll() || isPropertyDefined("nativewindow.debug." + subcomponent, true);
}
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
index 8fb819251..6061c4e79 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
@@ -38,7 +38,7 @@ import javax.media.nativewindow.*;
public class DefaultGraphicsConfigurationFactoryImpl extends GraphicsConfigurationFactory {
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen, int nativeVisualID) {
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested, final CapabilitiesChooser chooser, final AbstractGraphicsScreen screen, final int nativeVisualID) {
return new DefaultGraphicsConfiguration(screen, capsChosen, capsRequested);
}
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
index e6b68f87b..40fca0f7b 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
@@ -52,7 +52,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
// This subclass of NativeWindowFactory handles the case of
// NativeWindows being passed in
@Override
- protected NativeWindow getNativeWindowImpl(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException {
+ protected NativeWindow getNativeWindowImpl(final Object winObj, final AbstractGraphicsConfiguration config) throws IllegalArgumentException {
if (winObj instanceof NativeWindow) {
// Use the NativeWindow directly
return (NativeWindow) winObj;
@@ -73,7 +73,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
private Constructor<?> nativeWindowConstructor = null;
- private NativeWindow getAWTNativeWindow(Object winObj, AbstractGraphicsConfiguration config) {
+ private NativeWindow getAWTNativeWindow(final Object winObj, final AbstractGraphicsConfiguration config) {
if (nativeWindowConstructor == null) {
try {
final String windowingType = getNativeWindowType(true);
@@ -96,14 +96,14 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
nativeWindowConstructor = ReflectionUtil.getConstructor(
windowClassName, new Class[] { Object.class, AbstractGraphicsConfiguration.class },
true, getClass().getClassLoader());
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new IllegalArgumentException(e);
}
}
try {
return (NativeWindow) nativeWindowConstructor.newInstance(new Object[] { winObj, config });
- } catch (Exception ie) {
+ } catch (final Exception ie) {
throw new IllegalArgumentException(ie);
}
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
index 53daa2acd..deb685b51 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
@@ -55,7 +55,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
* owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
* otherwise <code>false</code>. Owning the device implies closing it at {@link #destroyNotify()}.
*/
- protected ProxySurfaceImpl(AbstractGraphicsConfiguration cfg, UpstreamSurfaceHook upstream, boolean ownsDevice) {
+ protected ProxySurfaceImpl(final AbstractGraphicsConfiguration cfg, final UpstreamSurfaceHook upstream, final boolean ownsDevice) {
if(null == cfg) {
throw new IllegalArgumentException("null AbstractGraphicsConfiguration");
}
@@ -81,7 +81,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
public final UpstreamSurfaceHook getUpstreamSurfaceHook() { return upstream; }
@Override
- public void setUpstreamSurfaceHook(UpstreamSurfaceHook hook) {
+ public void setUpstreamSurfaceHook(final UpstreamSurfaceHook hook) {
if(null == hook) {
throw new IllegalArgumentException("null UpstreamSurfaceHook");
}
@@ -89,7 +89,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
}
@Override
- public final void enableUpstreamSurfaceHookLifecycle(boolean enable) {
+ public final void enableUpstreamSurfaceHookLifecycle(final boolean enable) {
upstreamSurfaceHookLifecycleEnabled = enable;
}
@@ -134,7 +134,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
}
@Override
- public final void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg) {
+ public final void setGraphicsConfiguration(final AbstractGraphicsConfiguration cfg) {
config = cfg;
}
@@ -165,22 +165,22 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
}
@Override
- public void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
surfaceUpdatedHelper.addSurfaceUpdatedListener(l);
}
@Override
- public void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
+ public void addSurfaceUpdatedListener(final int index, final SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
surfaceUpdatedHelper.addSurfaceUpdatedListener(index, l);
}
@Override
- public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public void removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
surfaceUpdatedHelper.removeSurfaceUpdatedListener(l);
}
@Override
- public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+ public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
surfaceUpdatedHelper.surfaceUpdated(updater, ns, when);
}
@@ -287,15 +287,15 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
public final int getUpstreamOptionBits() { return implBitfield; }
@Override
- public final boolean containsUpstreamOptionBits(int v) {
+ public final boolean containsUpstreamOptionBits(final int v) {
return v == ( implBitfield & v ) ;
}
@Override
- public final void addUpstreamOptionBits(int v) { implBitfield |= v; }
+ public final void addUpstreamOptionBits(final int v) { implBitfield |= v; }
@Override
- public final void clearUpstreamOptionBits(int v) { implBitfield &= ~v; }
+ public final void clearUpstreamOptionBits(final int v) { implBitfield &= ~v; }
@Override
public StringBuilder toString(StringBuilder sink) {
@@ -316,7 +316,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
@Override
public String toString() {
- StringBuilder msg = new StringBuilder();
+ final StringBuilder msg = new StringBuilder();
msg.append(getClass().getSimpleName()).append("[ ");
toString(msg);
msg.append(" ]");
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
index 7b74e1f1f..d0174b2f5 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
@@ -58,7 +58,7 @@ public class SharedResourceToolkitLock implements ToolkitLock {
/**
* @return number of unclosed EGL Displays.<br>
*/
- public static int shutdown(boolean verbose) {
+ public static int shutdown(final boolean verbose) {
if(DEBUG || verbose || handle2Lock.size() > 0 ) {
System.err.println("SharedResourceToolkitLock: Shutdown (open: "+handle2Lock.size()+")");
if(DEBUG) {
@@ -74,13 +74,13 @@ public class SharedResourceToolkitLock implements ToolkitLock {
public static void dumpOpenDisplayConnections() {
System.err.println("SharedResourceToolkitLock: Open ResourceToolkitLock's: "+handle2Lock.size());
int i=0;
- for(Iterator<LongObjectHashMap.Entry> iter = handle2Lock.iterator(); iter.hasNext(); i++) {
+ for(final Iterator<LongObjectHashMap.Entry> iter = handle2Lock.iterator(); iter.hasNext(); i++) {
final LongObjectHashMap.Entry e = iter.next();
System.err.println("SharedResourceToolkitLock: Open["+i+"]: "+e.value);
}
}
- public static final SharedResourceToolkitLock get(long handle) {
+ public static final SharedResourceToolkitLock get(final long handle) {
SharedResourceToolkitLock res;
synchronized(handle2Lock) {
res = (SharedResourceToolkitLock) handle2Lock.get(handle);
@@ -101,7 +101,7 @@ public class SharedResourceToolkitLock implements ToolkitLock {
private final long handle;
private volatile int refCount;
- private SharedResourceToolkitLock(long handle) {
+ private SharedResourceToolkitLock(final long handle) {
this.lock = LockFactory.createRecursiveLock();
this.handle = handle;
this.refCount = 0;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java b/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java
index 3aea58852..73413cf59 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java
@@ -62,7 +62,7 @@ public class SurfaceScaleUtils {
* @param DEBUG_PREFIX if set, dumps debug info on stderr using this prefix
* @return true if pixelScale has changed, otherwise false
*/
- public static boolean computePixelScale(int[] result, final int[] prePixelScale, final int[] reqPixelScale, final int[] newPixelScaleRaw, final String DEBUG_PREFIX) {
+ public static boolean computePixelScale(final int[] result, final int[] prePixelScale, final int[] reqPixelScale, final int[] newPixelScaleRaw, final String DEBUG_PREFIX) {
final int newPixelScaleSafeX = 0 < newPixelScaleRaw[0] ? newPixelScaleRaw[0] : ScalableSurface.IDENTITY_PIXELSCALE;
final int newPixelScaleSafeY = 0 < newPixelScaleRaw[1] ? newPixelScaleRaw[1] : ScalableSurface.IDENTITY_PIXELSCALE;
final boolean useHiDPI = ScalableSurface.IDENTITY_PIXELSCALE != reqPixelScale[0] || ScalableSurface.IDENTITY_PIXELSCALE != reqPixelScale[1];
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java b/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
index 0b033955e..a7e136f76 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
@@ -42,17 +42,17 @@ public class SurfaceUpdatedHelper implements SurfaceUpdatedListener {
// Management Utils
//
public final int size() { return surfaceUpdatedListeners.size(); }
- public final SurfaceUpdatedListener get(int i) { return surfaceUpdatedListeners.get(i); }
+ public final SurfaceUpdatedListener get(final int i) { return surfaceUpdatedListeners.get(i); }
//
// Implementation of NativeSurface SurfaceUpdatedListener methods
//
- public final void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public final void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
addSurfaceUpdatedListener(-1, l);
}
- public final void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l)
+ public final void addSurfaceUpdatedListener(int index, final SurfaceUpdatedListener l)
throws IndexOutOfBoundsException
{
if(l == null) {
@@ -67,7 +67,7 @@ public class SurfaceUpdatedHelper implements SurfaceUpdatedListener {
}
}
- public final boolean removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public final boolean removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
if (l == null) {
return false;
}
@@ -79,7 +79,7 @@ public class SurfaceUpdatedHelper implements SurfaceUpdatedListener {
}
@Override
- public final void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+ public final void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
if( isEmpty ) {
return;
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
index 752057a49..d3439b53f 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
@@ -57,7 +57,7 @@ public class WrappedSurface extends ProxySurfaceImpl implements ScalableSurface
* owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
* otherwise <code>false</code>. Owning the device implies closing it at {@link #destroyNotify()}.
*/
- public WrappedSurface(AbstractGraphicsConfiguration cfg, long handle, int initialWidth, int initialHeight, boolean ownsDevice) {
+ public WrappedSurface(final AbstractGraphicsConfiguration cfg, final long handle, final int initialWidth, final int initialHeight, final boolean ownsDevice) {
super(cfg, new UpstreamSurfaceHookMutableSize(initialWidth, initialHeight), ownsDevice);
surfaceHandle=handle;
}
@@ -70,7 +70,7 @@ public class WrappedSurface extends ProxySurfaceImpl implements ScalableSurface
* owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
* otherwise <code>false</code>.
*/
- public WrappedSurface(AbstractGraphicsConfiguration cfg, long handle, UpstreamSurfaceHook upstream, boolean ownsDevice) {
+ public WrappedSurface(final AbstractGraphicsConfiguration cfg, final long handle, final UpstreamSurfaceHook upstream, final boolean ownsDevice) {
super(cfg, upstream, ownsDevice);
surfaceHandle=handle;
}
@@ -88,7 +88,7 @@ public class WrappedSurface extends ProxySurfaceImpl implements ScalableSurface
}
@Override
- public final void setSurfaceHandle(long surfaceHandle) {
+ public final void setSurfaceHandle(final long surfaceHandle) {
this.surfaceHandle=surfaceHandle;
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java
index 949243b0d..fd39a3b4a 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java
@@ -32,10 +32,10 @@ public class WrappedWindow extends WrappedSurface implements NativeWindow {
* owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
* otherwise <code>false</code>. Owning the device implies closing it at {@link #destroyNotify()}.
*/
- public WrappedWindow(AbstractGraphicsConfiguration cfg, long surfaceHandle,
- int initialWinX, int initialWinY, int initialWinWidth, int initialWinHeight,
- int initialPixelWidth, int initialPixelHeight,
- boolean ownsDevice, long windowHandle) {
+ public WrappedWindow(final AbstractGraphicsConfiguration cfg, final long surfaceHandle,
+ final int initialWinX, final int initialWinY, final int initialWinWidth, final int initialWinHeight,
+ final int initialPixelWidth, final int initialPixelHeight,
+ final boolean ownsDevice, final long windowHandle) {
this(cfg, surfaceHandle,
new UpstreamWindowHookMutableSizePos(initialWinX, initialWinY, initialWinWidth, initialWinHeight,
initialPixelWidth, initialPixelHeight),
@@ -50,7 +50,7 @@ public class WrappedWindow extends WrappedSurface implements NativeWindow {
* owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
* otherwise <code>false</code>.
*/
- public WrappedWindow(AbstractGraphicsConfiguration cfg, long surfaceHandle, UpstreamWindowHookMutableSizePos upstream, boolean ownsDevice, long windowHandle) {
+ public WrappedWindow(final AbstractGraphicsConfiguration cfg, final long surfaceHandle, final UpstreamWindowHookMutableSizePos upstream, final boolean ownsDevice, final long windowHandle) {
super(cfg, surfaceHandle, upstream, ownsDevice);
this.windowHandle = windowHandle;
}
@@ -105,7 +105,7 @@ public class WrappedWindow extends WrappedSurface implements NativeWindow {
}
@Override
- public Point getLocationOnScreen(Point point) {
+ public Point getLocationOnScreen(final Point point) {
if(null!=point) {
return point;
} else {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
index b2067c143..b0eda63b6 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
@@ -95,7 +95,7 @@ public class AWTMisc {
* @param topLevelOnly if true only returns insets of top-level components, i.e. Window and JRootPanel,
* otherwise for JComponent as well.
*/
- public static Insets getInsets(Component c, boolean topLevelOnly) {
+ public static Insets getInsets(final Component c, final boolean topLevelOnly) {
if( c instanceof Window ) {
return ((Window)c).getInsets();
}
@@ -119,7 +119,7 @@ public class AWTMisc {
public void run(Component c);
}
- public static int performAction(Container c, Class<?> cType, ComponentAction action) {
+ public static int performAction(final Container c, final Class<?> cType, final ComponentAction action) {
int count = 0;
final int cc = c.getComponentCount();
for(int i=0; i<cc; i++) {
@@ -147,7 +147,7 @@ public class AWTMisc {
* @param forward if true, returns the next focus component, otherwise the previous one.
* @return
*/
- public static Component getNextFocus(Component comp, boolean forward) {
+ public static Component getNextFocus(Component comp, final boolean forward) {
Container focusContainer = comp.getFocusCycleRootAncestor();
while ( focusContainer != null &&
( !focusContainer.isShowing() || !focusContainer.isFocusable() || !focusContainer.isEnabled() ) )
@@ -182,7 +182,7 @@ public class AWTMisc {
final Toolkit toolkit = Toolkit.getDefaultToolkit();
final BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_4BYTE_ABGR);
_nulCursor = toolkit.createCustomCursor(img, new Point(0,0), "nullCursor");
- } catch (Exception he) {
+ } catch (final Exception he) {
if( JAWTUtil.DEBUG ) {
System.err.println("Caught exception: "+he.getMessage());
he.printStackTrace();
@@ -194,7 +194,7 @@ public class AWTMisc {
public static synchronized Cursor getNullCursor() { return nulCursor; }
- public static synchronized Cursor getCursor(PixelRectangle pixelrect, Point hotSpot) {
+ public static synchronized Cursor getCursor(final PixelRectangle pixelrect, final Point hotSpot) {
// 31 * x == (x << 5) - x
int hash = 31 + pixelrect.hashCode();
hash = ((hash << 5) - hash) + hotSpot.hashCode();
@@ -207,12 +207,12 @@ public class AWTMisc {
}
return cursor;
}
- private static synchronized Cursor createCursor(PixelRectangle pixelrect, Point hotSpot) {
+ private static synchronized Cursor createCursor(final PixelRectangle pixelrect, final Point hotSpot) {
final int width = pixelrect.getSize().getWidth();
final int height = pixelrect.getSize().getHeight();
final BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); // PixelFormat.BGRA8888
final PixelFormatUtil.PixelSink32 imgSink = new PixelFormatUtil.PixelSink32() {
- public void store(int x, int y, int pixel) {
+ public void store(final int x, final int y, final int pixel) {
img.setRGB(x, y, pixel);
}
@Override
@@ -233,7 +233,7 @@ public class AWTMisc {
return toolkit.createCustomCursor(img, hotSpot, pixelrect.toString());
}
- public static WindowClosingProtocol.WindowClosingMode AWT2NWClosingOperation(int awtClosingOperation) {
+ public static WindowClosingProtocol.WindowClosingMode AWT2NWClosingOperation(final int awtClosingOperation) {
switch (awtClosingOperation) {
case WindowConstants.DISPOSE_ON_CLOSE:
case WindowConstants.EXIT_ON_CLOSE:
@@ -246,7 +246,7 @@ public class AWTMisc {
}
}
- public static WindowClosingProtocol.WindowClosingMode getNWClosingOperation(Component c) {
+ public static WindowClosingProtocol.WindowClosingMode getNWClosingOperation(final Component c) {
final JFrame jf = getJFrame(c);
final int op = (null != jf) ? jf.getDefaultCloseOperation() : WindowConstants.DO_NOTHING_ON_CLOSE ;
return AWT2NWClosingOperation(op);
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
index a5da41424..8aaffbd84 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
@@ -64,7 +64,7 @@ public class JAWTJNILibLoader extends NWJNILibLoader {
if ( NativeWindowFactory.TYPE_MACOSX != NativeWindowFactory.getNativeWindowType(false) ) {
try {
loadLibrary("jawt", null, true, JAWTJNILibLoader.class.getClassLoader());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
// It might be ok .. if it's already loaded
if(DEBUG) {
t.printStackTrace();
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
index 49b941698..231a89c26 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
@@ -53,9 +53,12 @@ import javax.media.nativewindow.NativeWindowException;
import javax.media.nativewindow.NativeWindowFactory;
import javax.media.nativewindow.ToolkitLock;
+import jogamp.common.os.PlatformPropsImpl;
import jogamp.nativewindow.Debug;
+import jogamp.nativewindow.NWJNILibLoader;
import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.VersionNumber;
import com.jogamp.common.util.locks.LockFactory;
import com.jogamp.common.util.locks.RecursiveLock;
@@ -105,16 +108,16 @@ public class JAWTUtil {
* Returns true if this platform's JAWT implementation supports offscreen layer.
*/
public static boolean isOffscreenLayerSupported() {
- return Platform.OS_TYPE == Platform.OSType.MACOS &&
- Platform.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0;
+ return PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS &&
+ PlatformPropsImpl.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0;
}
/**
* Returns true if this platform's JAWT implementation requires using offscreen layer.
*/
public static boolean isOffscreenLayerRequired() {
- return Platform.OS_TYPE == Platform.OSType.MACOS &&
- Platform.JAVA_VERSION_NUMBER.compareTo(JAWT_MacOSXCALayerRequiredForJavaVersion)>=0;
+ return PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS &&
+ PlatformPropsImpl.JAVA_VERSION_NUMBER.compareTo(JAWT_MacOSXCALayerRequiredForJavaVersion)>=0;
}
/**
@@ -218,14 +221,14 @@ public class JAWTUtil {
*/
public static int getOSXCALayerQuirks() {
int res = 0;
- if( Platform.OS_TYPE == Platform.OSType.MACOS &&
- Platform.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0 ) {
+ if( PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS &&
+ PlatformPropsImpl.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0 ) {
/** Knowing impl. all expose the SIZE bug */
res |= JAWT_OSX_CALAYER_QUIRK_SIZE;
- final int c = Platform.JAVA_VERSION_NUMBER.compareTo(Platform.Version17);
- if( c < 0 || c == 0 && Platform.JAVA_VERSION_UPDATE < 40 ) {
+ final int c = PlatformPropsImpl.JAVA_VERSION_NUMBER.compareTo(PlatformPropsImpl.Version17);
+ if( c < 0 || c == 0 && PlatformPropsImpl.JAVA_VERSION_UPDATE < 40 ) {
res |= JAWT_OSX_CALAYER_QUIRK_POSITION;
} else {
res |= JAWT_OSX_CALAYER_QUIRK_LAYOUT;
@@ -238,9 +241,9 @@ public class JAWTUtil {
* @param useOffscreenLayerIfAvailable
* @return
*/
- public static JAWT getJAWT(boolean useOffscreenLayerIfAvailable) {
+ public static JAWT getJAWT(final boolean useOffscreenLayerIfAvailable) {
final int jawt_version_flags = JAWTFactory.JAWT_VERSION_1_4;
- JAWT jawt = JAWT.create();
+ final JAWT jawt = JAWT.create();
// default queries
boolean tryOffscreenLayer;
@@ -248,24 +251,24 @@ public class JAWTUtil {
int jawt_version_flags_offscreen = jawt_version_flags;
if(isOffscreenLayerRequired()) {
- if(Platform.OS_TYPE == Platform.OSType.MACOS) {
- if(Platform.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0) {
+ if(PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS) {
+ if(PlatformPropsImpl.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0) {
jawt_version_flags_offscreen |= JAWTUtil.JAWT_MACOSX_USE_CALAYER;
tryOffscreenLayer = true;
tryOnscreen = false;
} else {
- throw new RuntimeException("OSX: Invalid version of Java ("+Platform.JAVA_VERSION_NUMBER+") / OS X ("+Platform.OS_VERSION_NUMBER+")");
+ throw new RuntimeException("OSX: Invalid version of Java ("+PlatformPropsImpl.JAVA_VERSION_NUMBER+") / OS X ("+PlatformPropsImpl.OS_VERSION_NUMBER+")");
}
} else {
- throw new InternalError("offscreen required, but n/a for: "+Platform.OS_TYPE);
+ throw new InternalError("offscreen required, but n/a for: "+PlatformPropsImpl.OS_TYPE);
}
} else if(useOffscreenLayerIfAvailable && isOffscreenLayerSupported()) {
- if(Platform.OS_TYPE == Platform.OSType.MACOS) {
+ if(PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS) {
jawt_version_flags_offscreen |= JAWTUtil.JAWT_MACOSX_USE_CALAYER;
tryOffscreenLayer = true;
tryOnscreen = true;
} else {
- throw new InternalError("offscreen requested and supported, but n/a for: "+Platform.OS_TYPE);
+ throw new InternalError("offscreen requested and supported, but n/a for: "+PlatformPropsImpl.OS_TYPE);
}
} else {
tryOffscreenLayer = false;
@@ -275,7 +278,7 @@ public class JAWTUtil {
System.err.println("JAWTUtil.getJAWT(tryOffscreenLayer "+tryOffscreenLayer+", tryOnscreen "+tryOnscreen+")");
}
- StringBuilder errsb = new StringBuilder();
+ final StringBuilder errsb = new StringBuilder();
if(tryOffscreenLayer) {
errsb.append("Offscreen 0x").append(Integer.toHexString(jawt_version_flags_offscreen));
if( JAWT.getJAWT(jawt, jawt_version_flags_offscreen) ) {
@@ -294,12 +297,12 @@ public class JAWTUtil {
throw new RuntimeException("Unable to initialize JAWT, trials: "+errsb.toString());
}
- public static boolean isJAWTUsingOffscreenLayer(JAWT jawt) {
+ public static boolean isJAWTUsingOffscreenLayer(final JAWT jawt) {
return 0 != ( jawt.getCachedVersion() & JAWTUtil.JAWT_MACOSX_USE_CALAYER );
}
static {
- SKIP_AWT_HIDPI = Debug.isPropertyDefined("nativewindow.awt.nohidpi", true);
+ SKIP_AWT_HIDPI = PropertyAccess.isPropertyDefined("nativewindow.awt.nohidpi", true);
if(DEBUG) {
System.err.println("JAWTUtil initialization (JAWT/JNI/...); SKIP_AWT_HIDPI "+SKIP_AWT_HIDPI);
@@ -321,7 +324,7 @@ public class JAWTUtil {
} else {
// Non-headless case
JAWTJNILibLoader.initSingleton(); // load libjawt.so
- if(!JAWTJNILibLoader.loadNativeWindow("awt")) { // load libnativewindow_awt.so
+ if(!NWJNILibLoader.loadNativeWindow("awt")) { // load libnativewindow_awt.so
throw new NativeWindowException("NativeWindow AWT native library load error.");
}
jawtLockObject = getJAWT(false); // don't care for offscreen layer here
@@ -333,15 +336,15 @@ public class JAWTUtil {
java2DClass = Class.forName("jogamp.opengl.awt.Java2D");
isQueueFlusherThreadTmp = java2DClass.getMethod("isQueueFlusherThread", (Class[])null);
j2dExistTmp = true;
- } catch (Exception e) {
+ } catch (final Exception e) {
}
isQueueFlusherThread = isQueueFlusherThreadTmp;
j2dExist = j2dExistTmp;
- PrivilegedDataBlob1 pdb1 = (PrivilegedDataBlob1) AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ final PrivilegedDataBlob1 pdb1 = (PrivilegedDataBlob1) AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override
public Object run() {
- PrivilegedDataBlob1 d = new PrivilegedDataBlob1();
+ final PrivilegedDataBlob1 d = new PrivilegedDataBlob1();
try {
final Class<?> sunToolkitClass = Class.forName("sun.awt.SunToolkit");
d.sunToolkitAWTLockMethod = sunToolkitClass.getDeclaredMethod("awtLock", new Class[]{});
@@ -349,14 +352,14 @@ public class JAWTUtil {
d.sunToolkitAWTUnlockMethod = sunToolkitClass.getDeclaredMethod("awtUnlock", new Class[]{});
d.sunToolkitAWTUnlockMethod.setAccessible(true);
d.ok=true;
- } catch (Exception e) {
+ } catch (final Exception e) {
// Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5
}
try {
- GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
+ final GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
d.getScaleFactorMethod = gd.getClass().getDeclaredMethod("getScaleFactor");
d.getScaleFactorMethod.setAccessible(true);
- } catch (Throwable t) {}
+ } catch (final Throwable t) {}
return d;
}
});
@@ -370,7 +373,7 @@ public class JAWTUtil {
sunToolkitAWTLockMethod.invoke(null, (Object[])null);
sunToolkitAWTUnlockMethod.invoke(null, (Object[])null);
_hasSunToolkitAWTLock = true;
- } catch (Exception e) {
+ } catch (final Exception e) {
}
}
hasSunToolkitAWTLock = _hasSunToolkitAWTLock;
@@ -412,7 +415,7 @@ public class JAWTUtil {
EventQueue.invokeAndWait(new Runnable() {
@Override
public void run() {
- Map<?,?> _desktophints = (Map<?,?>)(Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints"));
+ final Map<?,?> _desktophints = (Map<?,?>)(Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints"));
if(null!=_desktophints) {
desktophintsBucket.add(_desktophints);
}
@@ -420,9 +423,9 @@ public class JAWTUtil {
});
desktophints = ( desktophintsBucket.size() > 0 ) ? desktophintsBucket.get(0) : null ;
}
- } catch (InterruptedException ex) {
+ } catch (final InterruptedException ex) {
ex.printStackTrace();
- } catch (InvocationTargetException ex) {
+ } catch (final InvocationTargetException ex) {
ex.printStackTrace();
}
@@ -430,7 +433,7 @@ public class JAWTUtil {
System.err.println("JAWTUtil: Has sun.awt.SunToolkit.awtLock/awtUnlock " + hasSunToolkitAWTLock);
System.err.println("JAWTUtil: Has Java2D " + j2dExist);
System.err.println("JAWTUtil: Is headless " + headlessMode);
- int hints = ( null != desktophints ) ? desktophints.size() : 0 ;
+ final int hints = ( null != desktophints ) ? desktophints.size() : 0 ;
System.err.println("JAWTUtil: AWT Desktop hints " + hints);
System.err.println("JAWTUtil: OffscreenLayer Supported: "+isOffscreenLayerSupported()+" - Required "+isOffscreenLayerRequired());
}
@@ -458,7 +461,7 @@ public class JAWTUtil {
if(j2dExist) {
try {
b = ((Boolean)isQueueFlusherThread.invoke(null, (Object[])null)).booleanValue();
- } catch (Exception e) {}
+ } catch (final Exception e) {}
}
return b;
}
@@ -484,7 +487,7 @@ public class JAWTUtil {
if(hasSunToolkitAWTLock) {
try {
sunToolkitAWTLockMethod.invoke(null, (Object[])null);
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new NativeWindowException("SunToolkit.awtLock failed", e);
}
} else {
@@ -513,7 +516,7 @@ public class JAWTUtil {
if(hasSunToolkitAWTLock) {
try {
sunToolkitAWTUnlockMethod.invoke(null, (Object[])null);
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new NativeWindowException("SunToolkit.awtUnlock failed", e);
}
} else {
@@ -552,7 +555,7 @@ public class JAWTUtil {
if (res instanceof Integer) {
return ((Integer)res).intValue();
}
- } catch (Throwable t) {}
+ } catch (final Throwable t) {}
}
}
return 1;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
index e64525fbe..fae8db52a 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
@@ -47,11 +47,13 @@ import java.security.PrivilegedAction;
import javax.media.nativewindow.AbstractGraphicsConfiguration;
import javax.media.nativewindow.Capabilities;
+import javax.media.nativewindow.NativeSurface;
import javax.media.nativewindow.NativeWindow;
import javax.media.nativewindow.NativeWindowException;
import javax.media.nativewindow.MutableSurface;
import javax.media.nativewindow.util.Point;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.nativewindow.awt.JAWTWindow;
import jogamp.nativewindow.Debug;
@@ -70,10 +72,10 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
static {
Debug.initSingleton();
- DEBUG_CALAYER_POS_CRITICAL = Debug.isPropertyDefined("nativewindow.debug.JAWT.OSXCALayerPos", true /* jnlpAlias */);
+ DEBUG_CALAYER_POS_CRITICAL = PropertyAccess.isPropertyDefined("nativewindow.debug.JAWT.OSXCALayerPos", true /* jnlpAlias */);
}
- public MacOSXJAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+ public MacOSXJAWTWindow(final Object comp, final AbstractGraphicsConfiguration config) {
super(comp, config);
if(DEBUG) {
dumpInfo();
@@ -170,7 +172,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
}
@Override
- protected void layoutSurfaceLayerImpl(long layerHandle, boolean visible) {
+ protected void layoutSurfaceLayerImpl(final long layerHandle, final boolean visible) {
final int caLayerQuirks = JAWTUtil.getOSXCALayerQuirks();
// AWT position is top-left w/ insets, where CALayer position is bottom/left from root CALayer w/o insets.
// Determine p0: components location on screen w/o insets.
@@ -223,7 +225,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
}
@Override
- public void setSurfaceHandle(long surfaceHandle) {
+ public void setSurfaceHandle(final long surfaceHandle) {
if( !isOffscreenLayerSurfaceEnabled() ) {
throw new java.lang.UnsupportedOperationException("Not using CALAYER");
}
@@ -242,14 +244,14 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
@Override
protected int lockSurfaceImpl() throws NativeWindowException {
- int ret = NativeWindow.LOCK_SURFACE_NOT_READY;
+ int ret = NativeSurface.LOCK_SURFACE_NOT_READY;
ds = getJAWT().GetDrawingSurface(component);
if (ds == null) {
// Widget not yet realized
unlockSurfaceImpl();
- return NativeWindow.LOCK_SURFACE_NOT_READY;
+ return NativeSurface.LOCK_SURFACE_NOT_READY;
}
- int res = ds.Lock();
+ final int res = ds.Lock();
dsLocked = ( 0 == ( res & JAWTFactory.JAWT_LOCK_ERROR ) ) ;
if (!dsLocked) {
unlockSurfaceImpl();
@@ -261,7 +263,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
// conditions can cause this code to be triggered -- should test
// more)
if ((res & JAWTFactory.JAWT_LOCK_SURFACE_CHANGED) != 0) {
- ret = NativeWindow.LOCK_SURFACE_CHANGED;
+ ret = NativeSurface.LOCK_SURFACE_CHANGED;
}
if (firstLock) {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
@@ -276,7 +278,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
}
if (dsi == null) {
unlockSurfaceImpl();
- return NativeWindow.LOCK_SURFACE_NOT_READY;
+ return NativeSurface.LOCK_SURFACE_NOT_READY;
}
updateLockedData(dsi.getBounds());
if (DEBUG && firstLock ) {
@@ -287,16 +289,16 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
macosxdsi = (JAWT_MacOSXDrawingSurfaceInfo) dsi.platformInfo(getJAWT());
if (macosxdsi == null) {
unlockSurfaceImpl();
- return NativeWindow.LOCK_SURFACE_NOT_READY;
+ return NativeSurface.LOCK_SURFACE_NOT_READY;
}
drawable = macosxdsi.getCocoaViewRef();
if (drawable == 0) {
unlockSurfaceImpl();
- return NativeWindow.LOCK_SURFACE_NOT_READY;
+ return NativeSurface.LOCK_SURFACE_NOT_READY;
} else {
windowHandle = OSXUtil.GetNSWindow(drawable);
- ret = NativeWindow.LOCK_SUCCESS;
+ ret = NativeSurface.LOCK_SUCCESS;
}
} else {
/**
@@ -337,7 +339,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
} else {
try {
SetJAWTRootSurfaceLayer0(jawtSurfaceLayersHandle, rootSurfaceLayer);
- } catch(Exception e) {
+ } catch(final Exception e) {
errMsg = "Could not set JAWT rootSurfaceLayerHandle "+toHexString(rootSurfaceLayer)+", cause: "+e.getMessage();
}
}
@@ -360,7 +362,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
unlockSurfaceImpl();
throw new NativeWindowException(errMsg+": "+this);
}
- ret = NativeWindow.LOCK_SUCCESS;
+ ret = NativeSurface.LOCK_SUCCESS;
}
return ret;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
index 8b9dfabfd..ce39db79c 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
@@ -75,7 +75,7 @@ public class Win32SunJDKReflection {
win32GraphicsConfigGetVisualMethod = win32GraphicsConfigClass.getDeclaredMethod("getVisual", new Class[] {});
win32GraphicsConfigGetVisualMethod.setAccessible(true);
initted = true;
- } catch (Exception e) {
+ } catch (final Exception e) {
// Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5
}
return null;
@@ -83,37 +83,37 @@ public class Win32SunJDKReflection {
});
}
- public static GraphicsConfiguration graphicsConfigurationGet(GraphicsDevice device, int pfdID) {
+ public static GraphicsConfiguration graphicsConfigurationGet(final GraphicsDevice device, final int pfdID) {
if (!initted) {
return null;
}
try {
return (GraphicsConfiguration) win32GraphicsConfigGetConfigMethod.invoke(null, new Object[] { device, new Integer(pfdID) });
- } catch (Exception e) {
+ } catch (final Exception e) {
return null;
}
}
- public static int graphicsConfigurationGetPixelFormatID(AbstractGraphicsConfiguration config) {
+ public static int graphicsConfigurationGetPixelFormatID(final AbstractGraphicsConfiguration config) {
try {
if (config instanceof AWTGraphicsConfiguration) {
return graphicsConfigurationGetPixelFormatID(((AWTGraphicsConfiguration) config).getAWTGraphicsConfiguration());
}
return 0;
- } catch (Exception e) {
+ } catch (final Exception e) {
return 0;
}
}
- public static int graphicsConfigurationGetPixelFormatID(GraphicsConfiguration config) {
+ public static int graphicsConfigurationGetPixelFormatID(final GraphicsConfiguration config) {
if (!initted) {
return 0;
}
try {
return ((Integer) win32GraphicsConfigGetVisualMethod.invoke(config, (Object[])null)).intValue();
- } catch (Exception e) {
+ } catch (final Exception e) {
return 0;
}
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
index 90688258d..7ad914e0a 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
@@ -41,6 +41,7 @@
package jogamp.nativewindow.jawt.windows;
import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.NativeSurface;
import javax.media.nativewindow.NativeWindow;
import javax.media.nativewindow.NativeWindowException;
import javax.media.nativewindow.util.Point;
@@ -56,7 +57,7 @@ import jogamp.nativewindow.windows.GDIUtil;
public class WindowsJAWTWindow extends JAWTWindow {
- public WindowsJAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+ public WindowsJAWTWindow(final Object comp, final AbstractGraphicsConfiguration config) {
super(comp, config);
}
@@ -72,14 +73,14 @@ public class WindowsJAWTWindow extends JAWTWindow {
@Override
protected int lockSurfaceImpl() throws NativeWindowException {
- int ret = NativeWindow.LOCK_SUCCESS;
+ int ret = NativeSurface.LOCK_SUCCESS;
ds = getJAWT().GetDrawingSurface(component);
if (ds == null) {
// Widget not yet realized
unlockSurfaceImpl();
return LOCK_SURFACE_NOT_READY;
}
- int res = ds.Lock();
+ final int res = ds.Lock();
dsLocked = ( 0 == ( res & JAWTFactory.JAWT_LOCK_ERROR ) ) ;
if (!dsLocked) {
unlockSurfaceImpl();
@@ -136,7 +137,7 @@ public class WindowsJAWTWindow extends JAWTWindow {
}
@Override
- protected Point getLocationOnScreenNativeImpl(int x, int y) {
+ protected Point getLocationOnScreenNativeImpl(final int x, final int y) {
return GDIUtil.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y);
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
index b5a519fcc..9abaed731 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
@@ -38,6 +38,7 @@
package jogamp.nativewindow.jawt.x11;
import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.NativeSurface;
import javax.media.nativewindow.NativeWindow;
import javax.media.nativewindow.NativeWindowException;
import javax.media.nativewindow.util.Point;
@@ -53,7 +54,7 @@ import jogamp.nativewindow.x11.X11Lib;
public class X11JAWTWindow extends JAWTWindow {
- public X11JAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+ public X11JAWTWindow(final Object comp, final AbstractGraphicsConfiguration config) {
super(comp, config);
}
@@ -67,14 +68,14 @@ public class X11JAWTWindow extends JAWTWindow {
@Override
protected int lockSurfaceImpl() throws NativeWindowException {
- int ret = NativeWindow.LOCK_SUCCESS;
+ int ret = NativeSurface.LOCK_SUCCESS;
ds = getJAWT().GetDrawingSurface(component);
if (ds == null) {
// Widget not yet realized
unlockSurfaceImpl();
return LOCK_SURFACE_NOT_READY;
}
- int res = ds.Lock();
+ final int res = ds.Lock();
dsLocked = ( 0 == ( res & JAWTFactory.JAWT_LOCK_ERROR ) ) ;
if (!dsLocked) {
unlockSurfaceImpl();
@@ -124,7 +125,7 @@ public class X11JAWTWindow extends JAWTWindow {
}
@Override
- protected Point getLocationOnScreenNativeImpl(int x, int y) {
+ protected Point getLocationOnScreenNativeImpl(final int x, final int y) {
// surface is locked and hence the device
return X11Lib.GetRelativeLocation(getDisplayHandle(), getScreenIndex(), getWindowHandle(), 0 /*root win*/, x, y);
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
index b2c3a931b..fea1be11a 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
@@ -76,7 +76,7 @@ public class X11SunJDKReflection {
x11GraphicsConfigGetVisualMethod = x11GraphicsConfigClass.getDeclaredMethod("getVisual", new Class[] {});
x11GraphicsConfigGetVisualMethod.setAccessible(true);
initialized = true;
- } catch (Exception e) {
+ } catch (final Exception e) {
// Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5
}
return null;
@@ -84,37 +84,37 @@ public class X11SunJDKReflection {
});
}
- public static long graphicsDeviceGetDisplay(GraphicsDevice device) {
+ public static long graphicsDeviceGetDisplay(final GraphicsDevice device) {
if (!initialized) {
return 0;
}
try {
return ((Long) x11GraphicsDeviceGetDisplayMethod.invoke(device, (Object[])null)).longValue();
- } catch (Exception e) {
+ } catch (final Exception e) {
return 0;
}
}
- public static int graphicsConfigurationGetVisualID(AbstractGraphicsConfiguration config) {
+ public static int graphicsConfigurationGetVisualID(final AbstractGraphicsConfiguration config) {
try {
if (config instanceof AWTGraphicsConfiguration) {
return graphicsConfigurationGetVisualID(((AWTGraphicsConfiguration) config).getAWTGraphicsConfiguration());
}
return 0;
- } catch (Exception e) {
+ } catch (final Exception e) {
return 0;
}
}
- public static int graphicsConfigurationGetVisualID(GraphicsConfiguration config) {
+ public static int graphicsConfigurationGetVisualID(final GraphicsConfiguration config) {
if (!initialized) {
return 0;
}
try {
return ((Integer) x11GraphicsConfigGetVisualMethod.invoke(config, (Object[])null)).intValue();
- } catch (Exception e) {
+ } catch (final Exception e) {
return 0;
}
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java
index 98ea68f4f..6b54c32ea 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java
@@ -18,19 +18,19 @@ public class OSXDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
* not the actual dummy surface height,
* The latter is platform specific and small
*/
- public OSXDummyUpstreamSurfaceHook(int width, int height) {
+ public OSXDummyUpstreamSurfaceHook(final int width, final int height) {
super(width, height);
nsWindow = 0;
}
@Override
- public final void create(ProxySurface s) {
+ public final void create(final ProxySurface s) {
if(0 == nsWindow && 0 == s.getSurfaceHandle()) {
nsWindow = OSXUtil.CreateNSWindow(0, 0, 64, 64);
if(0 == nsWindow) {
throw new NativeWindowException("Error NS window 0");
}
- long nsView = OSXUtil.GetNSView(nsWindow);
+ final long nsView = OSXUtil.GetNSView(nsWindow);
if(0 == nsView) {
throw new NativeWindowException("Error NS view 0");
}
@@ -41,7 +41,7 @@ public class OSXDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
}
@Override
- public final void destroy(ProxySurface s) {
+ public final void destroy(final ProxySurface s) {
if( s.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
if( 0 == nsWindow || 0 == s.getSurfaceHandle() ) {
throw new InternalError("Owns upstream surface, but no OSX view/window: "+s+", nsWindow 0x"+Long.toHexString(nsWindow));
diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
index 22ac9c355..cf163bd82 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
@@ -85,11 +85,11 @@ public class OSXUtil implements ToolkitProperties {
*/
public static final boolean hasThreadingIssues() { return false; }
- public static boolean isNSView(long object) {
+ public static boolean isNSView(final long object) {
return 0 != object ? isNSView0(object) : false;
}
- public static boolean isNSWindow(long object) {
+ public static boolean isNSWindow(final long object) {
return 0 != object ? isNSWindow0(object) : false;
}
@@ -99,32 +99,32 @@ public class OSXUtil implements ToolkitProperties {
* @param src_y
* @return top-left client-area position in window units
*/
- public static Point GetLocationOnScreen(long windowOrView, int src_x, int src_y) {
+ public static Point GetLocationOnScreen(final long windowOrView, final int src_x, final int src_y) {
return (Point) GetLocationOnScreen0(windowOrView, src_x, src_y);
}
- public static Insets GetInsets(long windowOrView) {
+ public static Insets GetInsets(final long windowOrView) {
return (Insets) GetInsets0(windowOrView);
}
- public static double GetPixelScale(int screenIndex) {
+ public static double GetPixelScale(final int screenIndex) {
return GetPixelScale0(screenIndex);
}
- public static double GetPixelScale(long windowOrView) {
+ public static double GetPixelScale(final long windowOrView) {
return GetPixelScale1(windowOrView);
}
- public static long CreateNSWindow(int x, int y, int width, int height) {
+ public static long CreateNSWindow(final int x, final int y, final int width, final int height) {
return CreateNSWindow0(x, y, width, height);
}
- public static void DestroyNSWindow(long nsWindow) {
+ public static void DestroyNSWindow(final long nsWindow) {
DestroyNSWindow0(nsWindow);
}
- public static long GetNSView(long nsWindow) {
+ public static long GetNSView(final long nsWindow) {
return GetNSView0(nsWindow);
}
- public static long GetNSWindow(long nsView) {
+ public static long GetNSWindow(final long nsView) {
return GetNSWindow0(nsView);
}
@@ -268,7 +268,7 @@ public class OSXUtil implements ToolkitProperties {
if( waitUntilDone ) {
try {
sync.wait();
- } catch (InterruptedException ie) {
+ } catch (final InterruptedException ie) {
throwable = ie;
}
if(null==throwable) {
@@ -288,7 +288,7 @@ public class OSXUtil implements ToolkitProperties {
* @param runnable
* @param delay delay to run the runnable in milliseconds
*/
- public static void RunLater(boolean onMain, Runnable runnable, int delay) {
+ public static void RunLater(final boolean onMain, final Runnable runnable, final int delay) {
RunLater0(onMain, false /* kickNSApp */, new RunnableTask( runnable, null, true, System.err ), delay);
}
@@ -343,7 +343,7 @@ public class OSXUtil implements ToolkitProperties {
if( waitUntilDone ) {
try {
sync.wait();
- } catch (InterruptedException ie) {
+ } catch (final InterruptedException ie) {
throwable = ie;
}
if(null==throwable) {
@@ -363,7 +363,7 @@ public class OSXUtil implements ToolkitProperties {
}
/** Returns the screen refresh rate in Hz. If unavailable, returns 60Hz. */
- public static int GetScreenRefreshRate(int scrn_idx) {
+ public static int GetScreenRefreshRate(final int scrn_idx) {
return GetScreenRefreshRate0(scrn_idx);
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java
index bf59a6639..a08cf9b51 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java
@@ -16,12 +16,12 @@ public class GDIDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
* not the actual dummy surface height,
* The latter is platform specific and small
*/
- public GDIDummyUpstreamSurfaceHook(int width, int height) {
+ public GDIDummyUpstreamSurfaceHook(final int width, final int height) {
super(width, height);
}
@Override
- public final void create(ProxySurface s) {
+ public final void create(final ProxySurface s) {
final GDISurface ms = (GDISurface)s;
if(0 == ms.getWindowHandle()) {
final long windowHandle = GDIUtil.CreateDummyWindow(0, 0, 64, 64);
@@ -35,7 +35,7 @@ public class GDIDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
}
@Override
- public final void destroy(ProxySurface s) {
+ public final void destroy(final ProxySurface s) {
final GDISurface ms = (GDISurface)s;
if( ms.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
if( 0 == ms.getWindowHandle() ) {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
index 4369158cf..2f335c428 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
@@ -58,7 +58,7 @@ public class GDISurface extends ProxySurfaceImpl {
* owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
* otherwise <code>false</code>. Owning the device implies closing it at {@link #destroyNotify()}.
*/
- public GDISurface(AbstractGraphicsConfiguration cfg, long windowHandle, UpstreamSurfaceHook upstream, boolean ownsDevice) {
+ public GDISurface(final AbstractGraphicsConfiguration cfg, final long windowHandle, final UpstreamSurfaceHook upstream, final boolean ownsDevice) {
super(cfg, upstream, ownsDevice);
this.windowHandle=windowHandle;
this.surfaceHandle=0;
@@ -81,14 +81,14 @@ public class GDISurface extends ProxySurfaceImpl {
* </p>
*/
@Override
- public final void setSurfaceHandle(long surfaceHandle) {
+ public final void setSurfaceHandle(final long surfaceHandle) {
this.windowHandle = surfaceHandle;
}
/**
* Sets the window handle (HWND).
*/
- public final void setWindowHandle(long windowHandle) {
+ public final void setWindowHandle(final long windowHandle) {
this.windowHandle = windowHandle;
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
index 720ff9bdb..8203a804b 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
@@ -93,7 +93,7 @@ public class GDIUtil implements ToolkitProperties {
private static RegisteredClass dummyWindowClass = null;
private static Object dummyWindowSync = new Object();
- public static long CreateDummyWindow(int x, int y, int width, int height) {
+ public static long CreateDummyWindow(final int x, final int y, final int width, final int height) {
synchronized(dummyWindowSync) {
dummyWindowClass = dummyWindowClassFactory.getSharedClass();
if(DEBUG) {
@@ -104,7 +104,7 @@ public class GDIUtil implements ToolkitProperties {
}
}
- public static boolean DestroyDummyWindow(long hwnd) {
+ public static boolean DestroyDummyWindow(final long hwnd) {
boolean res;
synchronized(dummyWindowSync) {
if( null == dummyWindowClass ) {
@@ -116,15 +116,15 @@ public class GDIUtil implements ToolkitProperties {
return res;
}
- public static Point GetRelativeLocation(long src_win, long dest_win, int src_x, int src_y) {
+ public static Point GetRelativeLocation(final long src_win, final long dest_win, final int src_x, final int src_y) {
return (Point) GetRelativeLocation0(src_win, dest_win, src_x, src_y);
}
- public static boolean IsUndecorated(long win) {
+ public static boolean IsUndecorated(final long win) {
return IsUndecorated0(win);
}
- public static boolean IsChild(long win) {
+ public static boolean IsChild(final long win) {
return IsChild0(win);
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
index 1f6cb7c05..3c7b1adfb 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
@@ -33,7 +33,7 @@ public class RegisteredClass {
private final String className;
private final long hDDTCtx;
- RegisteredClass(long hInst, String name, long hDispatchThreadCtx) {
+ RegisteredClass(final long hInst, final String name, final long hDispatchThreadCtx) {
this.hInstance = hInst;
this.className = name;
this.hDDTCtx = hDispatchThreadCtx;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
index c4b4d145c..e3ea49314 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
@@ -57,7 +57,7 @@ public class RegisteredClassFactory {
private int sharedRefCount = 0;
private final Object sync = new Object();
- private String toHexString(long l) { return "0x"+Long.toHexString(l); }
+ private String toHexString(final long l) { return "0x"+Long.toHexString(l); }
@Override
public final String toString() { return "RegisteredClassFactory[moduleHandle "+toHexString(hInstance)+", "+classBaseName+
@@ -93,7 +93,7 @@ public class RegisteredClassFactory {
/** Application handle. */
public static long getHInstance() { return hInstance; }
- public RegisteredClassFactory(String classBaseName, long wndProc, boolean useDummyDispatchThread, long iconSmallHandle, long iconBigHandle) {
+ public RegisteredClassFactory(final String classBaseName, final long wndProc, final boolean useDummyDispatchThread, final long iconSmallHandle, final long iconBigHandle) {
this.classBaseName = classBaseName;
this.wndProc = wndProc;
this.useDummyDispatchThread = useDummyDispatchThread;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java
index 4f8cff8c5..0ac3d4a2e 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java
@@ -35,7 +35,7 @@ import javax.media.nativewindow.VisualIDHolder;
public class X11Capabilities extends Capabilities {
final private XVisualInfo xVisualInfo; // maybe null if !onscreen
- public X11Capabilities(XVisualInfo xVisualInfo) {
+ public X11Capabilities(final XVisualInfo xVisualInfo) {
super();
this.xVisualInfo = xVisualInfo;
}
@@ -49,7 +49,7 @@ public class X11Capabilities extends Capabilities {
public Object clone() {
try {
return super.clone();
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
throw new NativeWindowException(e);
}
}
@@ -59,7 +59,7 @@ public class X11Capabilities extends Capabilities {
final public boolean hasXVisualInfo() { return null!=xVisualInfo; }
@Override
- final public int getVisualID(VIDType type) throws NativeWindowException {
+ final public int getVisualID(final VIDType type) throws NativeWindowException {
switch(type) {
case INTRINSIC:
case NATIVE:
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
index 53b303071..7e61ba6d0 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
@@ -21,12 +21,12 @@ public class X11DummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
* not the actual dummy surface height,
* The latter is platform specific and small
*/
- public X11DummyUpstreamSurfaceHook(int width, int height) {
+ public X11DummyUpstreamSurfaceHook(final int width, final int height) {
super(width, height);
}
@Override
- public final void create(ProxySurface s) {
+ public final void create(final ProxySurface s) {
final X11GraphicsConfiguration cfg = (X11GraphicsConfiguration) s.getGraphicsConfiguration();
final X11GraphicsScreen screen = (X11GraphicsScreen) cfg.getScreen();
final X11GraphicsDevice device = (X11GraphicsDevice) screen.getDevice();
@@ -51,7 +51,7 @@ public class X11DummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
}
@Override
- public final void destroy(ProxySurface s) {
+ public final void destroy(final ProxySurface s) {
if( s.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
final X11GraphicsDevice device = (X11GraphicsDevice) s.getGraphicsConfiguration().getScreen().getDevice();
if( 0 == s.getSurfaceHandle() ) {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
index 6258632cd..e12c3fd13 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
@@ -53,7 +53,7 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen, int nativeVisualID)
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested, final CapabilitiesChooser chooser, final AbstractGraphicsScreen screen, final int nativeVisualID)
throws IllegalArgumentException, NativeWindowException {
if(!(screen instanceof X11GraphicsScreen)) {
@@ -72,15 +72,15 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor
return res;
}
- public static XVisualInfo getXVisualInfo(AbstractGraphicsScreen screen, int visualID)
+ public static XVisualInfo getXVisualInfo(final AbstractGraphicsScreen screen, final int visualID)
{
- XVisualInfo xvi_temp = XVisualInfo.create();
+ final XVisualInfo xvi_temp = XVisualInfo.create();
xvi_temp.setVisualid(visualID);
xvi_temp.setScreen(screen.getIndex());
- int num[] = { -1 };
- long display = screen.getDevice().getHandle();
+ final int num[] = { -1 };
+ final long display = screen.getDevice().getHandle();
- XVisualInfo[] xvis = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask|X11Lib.VisualScreenMask, xvi_temp, num, 0);
+ final XVisualInfo[] xvis = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask|X11Lib.VisualScreenMask, xvi_temp, num, 0);
if(xvis==null || num[0]<1) {
return null;
@@ -89,26 +89,26 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor
return XVisualInfo.create(xvis[0]);
}
- public static XVisualInfo getXVisualInfo(AbstractGraphicsScreen screen, CapabilitiesImmutable capabilities)
+ public static XVisualInfo getXVisualInfo(final AbstractGraphicsScreen screen, final CapabilitiesImmutable capabilities)
{
- XVisualInfo xv = getXVisualInfoImpl(screen, capabilities, 4 /* TrueColor */);
+ final XVisualInfo xv = getXVisualInfoImpl(screen, capabilities, 4 /* TrueColor */);
if(null!=xv) return xv;
return getXVisualInfoImpl(screen, capabilities, 5 /* DirectColor */);
}
- private static XVisualInfo getXVisualInfoImpl(AbstractGraphicsScreen screen, CapabilitiesImmutable capabilities, int c_class)
+ private static XVisualInfo getXVisualInfoImpl(final AbstractGraphicsScreen screen, final CapabilitiesImmutable capabilities, final int c_class)
{
XVisualInfo ret = null;
- int[] num = { -1 };
+ final int[] num = { -1 };
- XVisualInfo vinfo_template = XVisualInfo.create();
+ final XVisualInfo vinfo_template = XVisualInfo.create();
vinfo_template.setScreen(screen.getIndex());
vinfo_template.setC_class(c_class);
- long display = screen.getDevice().getHandle();
+ final long display = screen.getDevice().getHandle();
- XVisualInfo[] vinfos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, vinfo_template, num, 0);
+ final XVisualInfo[] vinfos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, vinfo_template, num, 0);
XVisualInfo best=null;
- int rdepth = capabilities.getRedBits() + capabilities.getGreenBits() + capabilities.getBlueBits() + capabilities.getAlphaBits();
+ final int rdepth = capabilities.getRedBits() + capabilities.getGreenBits() + capabilities.getBlueBits() + capabilities.getAlphaBits();
for (int i = 0; vinfos!=null && i < num[0]; i++) {
if ( best == null ||
best.getDepth() < vinfos[i].getDepth() )
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
index 2f825e8d4..2414248b4 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
@@ -243,7 +243,7 @@ public class X11Util implements ToolkitProperties {
return hasThreadingIssues; // JOGL impl. may utilize special locking "somewhere"
}
- public static void setX11ErrorHandler(boolean onoff, boolean quiet) {
+ public static void setX11ErrorHandler(final boolean onoff, final boolean quiet) {
synchronized(setX11ErrorHandlerLock) {
setX11ErrorHandler0(onoff, quiet);
}
@@ -282,7 +282,7 @@ public class X11Util implements ToolkitProperties {
boolean unCloseable;
Throwable creationStack;
- protected NamedDisplay(String name, long handle) {
+ protected NamedDisplay(final String name, final long handle) {
this.name=name;
this.handle=handle;
this.refCount=0;
@@ -306,7 +306,7 @@ public class X11Util implements ToolkitProperties {
}
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if(this == obj) { return true; }
if(obj instanceof NamedDisplay) {
return handle == ((NamedDisplay) obj).handle;
@@ -321,7 +321,7 @@ public class X11Util implements ToolkitProperties {
public final long getHandle() { return handle; }
public final int getRefCount() { return refCount; }
- public final void setUncloseable(boolean v) { unCloseable = v; }
+ public final void setUncloseable(final boolean v) { unCloseable = v; }
public final boolean isUncloseable() { return unCloseable; }
public final Throwable getCreationStack() { return creationStack; }
@@ -341,7 +341,7 @@ public class X11Util implements ToolkitProperties {
synchronized(globalLock) {
if( getMarkAllDisplaysUnclosable() ) {
for(int i=0; i<pendingDisplayList.size(); i++) {
- final NamedDisplay ndpy = (NamedDisplay) pendingDisplayList.get(i);
+ final NamedDisplay ndpy = pendingDisplayList.get(i);
if(DEBUG) {
final boolean closeAttempted = !openDisplayMap.containsKey(ndpy.getHandle());
System.err.println("X11Util.closePendingDisplayConnections(): Closing ["+i+"]: "+ndpy+" - closeAttempted "+closeAttempted);
@@ -367,10 +367,10 @@ public class X11Util implements ToolkitProperties {
synchronized(globalLock) {
System.err.println("X11Util: Open X11 Display Connections: "+openDisplayList.size());
for(int i=0; i<openDisplayList.size(); i++) {
- NamedDisplay ndpy = openDisplayList.get(i);
+ final NamedDisplay ndpy = openDisplayList.get(i);
System.err.println("X11Util: Open["+i+"]: "+ndpy);
if(null!=ndpy) {
- Throwable t = ndpy.getCreationStack();
+ final Throwable t = ndpy.getCreationStack();
if(null!=t) {
t.printStackTrace();
}
@@ -395,10 +395,10 @@ public class X11Util implements ToolkitProperties {
synchronized(globalLock) {
System.err.println("X11Util: Reusable X11 Display Connections: "+reusableDisplayList.size());
for(int i=0; i<reusableDisplayList.size(); i++) {
- NamedDisplay ndpy = (NamedDisplay) reusableDisplayList.get(i);
+ final NamedDisplay ndpy = reusableDisplayList.get(i);
System.err.println("X11Util: Reusable["+i+"]: "+ndpy);
if(null!=ndpy) {
- Throwable t = ndpy.getCreationStack();
+ final Throwable t = ndpy.getCreationStack();
if(null!=t) {
t.printStackTrace();
}
@@ -406,10 +406,10 @@ public class X11Util implements ToolkitProperties {
}
System.err.println("X11Util: Pending X11 Display Connections (creation order): "+pendingDisplayList.size());
for(int i=0; i<pendingDisplayList.size(); i++) {
- NamedDisplay ndpy = (NamedDisplay) pendingDisplayList.get(i);
+ final NamedDisplay ndpy = pendingDisplayList.get(i);
System.err.println("X11Util: Pending["+i+"]: "+ndpy);
if(null!=ndpy) {
- Throwable t = ndpy.getCreationStack();
+ final Throwable t = ndpy.getCreationStack();
if(null!=t) {
t.printStackTrace();
}
@@ -418,7 +418,7 @@ public class X11Util implements ToolkitProperties {
}
}
- public static boolean markDisplayUncloseable(long handle) {
+ public static boolean markDisplayUncloseable(final long handle) {
NamedDisplay ndpy;
synchronized(globalLock) {
ndpy = (NamedDisplay) openDisplayMap.get(handle);
@@ -470,7 +470,7 @@ public class X11Util implements ToolkitProperties {
return namedDpy.getHandle();
}
- public static void closeDisplay(long handle) {
+ public static void closeDisplay(final long handle) {
synchronized(globalLock) {
final NamedDisplay namedDpy = (NamedDisplay) openDisplayMap.remove(handle);
if(null==namedDpy) {
@@ -504,7 +504,7 @@ public class X11Util implements ToolkitProperties {
}
}
- public static NamedDisplay getNamedDisplay(long handle) {
+ public static NamedDisplay getNamedDisplay(final long handle) {
synchronized(globalLock) {
return (NamedDisplay) openDisplayMap.get(handle);
}
@@ -513,11 +513,11 @@ public class X11Util implements ToolkitProperties {
/**
* @return If name is null, it returns the previous queried NULL display name,
* otherwise the name. */
- public static String validateDisplayName(String name) {
+ public static String validateDisplayName(final String name) {
return ( null == name || AbstractGraphicsDevice.DEFAULT_CONNECTION.equals(name) ) ? getNullDisplayName() : name ;
}
- public static String validateDisplayName(String name, long handle) {
+ public static String validateDisplayName(String name, final long handle) {
if( ( null==name || AbstractGraphicsDevice.DEFAULT_CONNECTION.equals(name) ) && 0!=handle) {
name = X11Lib.XDisplayString(handle);
}
@@ -530,8 +530,8 @@ public class X11Util implements ToolkitProperties {
**
*******************************/
- public static long XOpenDisplay(String arg0) {
- long handle = X11Lib.XOpenDisplay(arg0);
+ public static long XOpenDisplay(final String arg0) {
+ final long handle = X11Lib.XOpenDisplay(arg0);
if(XSYNC_ENABLED && 0 != handle) {
X11Lib.XSynchronize(handle, true);
}
@@ -542,7 +542,7 @@ public class X11Util implements ToolkitProperties {
return handle;
}
- public static int XCloseDisplay(long display) {
+ public static int XCloseDisplay(final long display) {
if(TRACE_DISPLAY_LIFECYCLE) {
System.err.println(Thread.currentThread()+" - X11Util.XCloseDisplay() 0x"+Long.toHexString(display));
// Thread.dumpStack();
@@ -550,7 +550,7 @@ public class X11Util implements ToolkitProperties {
int res = -1;
try {
res = X11Lib.XCloseDisplay(display);
- } catch (Exception ex) {
+ } catch (final Exception ex) {
System.err.println("X11Util: Caught exception:");
ex.printStackTrace();
}
@@ -561,7 +561,7 @@ public class X11Util implements ToolkitProperties {
static long XineramaLibHandle = 0;
static long XineramaQueryFunc = 0;
- public static boolean XineramaIsEnabled(X11GraphicsDevice device) {
+ public static boolean XineramaIsEnabled(final X11GraphicsDevice device) {
if(null == device) {
throw new IllegalArgumentException("X11 Display device is NULL");
}
@@ -573,7 +573,7 @@ public class X11Util implements ToolkitProperties {
}
}
- public static boolean XineramaIsEnabled(long displayHandle) {
+ public static boolean XineramaIsEnabled(final long displayHandle) {
if( 0 == displayHandle ) {
throw new IllegalArgumentException("X11 Display handle is NULL");
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java b/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java
index 062040232..6b606df97 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java
@@ -68,8 +68,8 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
- CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+ final CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, final int nativeVisualID) {
if (absScreen != null &&
!(absScreen instanceof AWTGraphicsScreen)) {
throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only AWTGraphicsScreen objects");
@@ -82,8 +82,8 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac
}
public static AWTGraphicsConfiguration chooseGraphicsConfigurationStatic(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
- CapabilitiesChooser chooser, AWTGraphicsScreen awtScreen, int nativeVisualID) {
+ CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+ final CapabilitiesChooser chooser, final AWTGraphicsScreen awtScreen, final int nativeVisualID) {
if(DEBUG) {
System.err.println("X11AWTGraphicsConfigurationFactory: got "+awtScreen);
}
@@ -143,7 +143,7 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac
int visualID = aConfig.getVisualID(VIDType.NATIVE);
if(VisualIDHolder.VID_UNDEFINED != visualID) {
for (int i = 0; i < configs.length; i++) {
- GraphicsConfiguration gc = configs[i];
+ final GraphicsConfiguration gc = configs[i];
if (gc != null) {
if (X11SunJDKReflection.graphicsConfigurationGetVisualID(gc) == visualID) {
if(DEBUG) {
diff --git a/src/newt/classes/com/jogamp/newt/Display.java b/src/newt/classes/com/jogamp/newt/Display.java
index 847c9698a..7091060b3 100644
--- a/src/newt/classes/com/jogamp/newt/Display.java
+++ b/src/newt/classes/com/jogamp/newt/Display.java
@@ -55,10 +55,10 @@ public abstract class Display {
/** return true if obj is of type Display and both FQN {@link #getFQName()} equals */
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj) { return true; }
if (obj instanceof Display) {
- Display d = (Display)obj;
+ final Display d = (Display)obj;
return d.getFQName().equals(getFQName());
}
return false;
@@ -353,7 +353,7 @@ public abstract class Display {
protected static final ArrayList<WeakReference<Display>> displayList = new ArrayList<WeakReference<Display>>();
protected static int displaysActive = 0;
- public static void dumpDisplayList(String prefix) {
+ public static void dumpDisplayList(final String prefix) {
synchronized(displayList) {
System.err.println(prefix+" DisplayList[] entries: "+displayList.size()+" - "+getThreadName());
final Iterator<WeakReference<Display>> ri = displayList.iterator();
@@ -372,7 +372,7 @@ public abstract class Display {
* @paran shared if true, only shared instances are found, otherwise also exclusive
* @return
*/
- public static Display getFirstDisplayOf(String type, String name, int fromIndex, boolean shared) {
+ public static Display getFirstDisplayOf(final String type, final String name, final int fromIndex, final boolean shared) {
return getDisplayOfImpl(type, name, fromIndex, 1, shared);
}
@@ -384,11 +384,11 @@ public abstract class Display {
* @paran shared if true, only shared instances are found, otherwise also exclusive
* @return
*/
- public static Display getLastDisplayOf(String type, String name, int fromIndex, boolean shared) {
+ public static Display getLastDisplayOf(final String type, final String name, final int fromIndex, final boolean shared) {
return getDisplayOfImpl(type, name, fromIndex, -1, shared);
}
- private static Display getDisplayOfImpl(String type, String name, final int fromIndex, final int incr, boolean shared) {
+ private static Display getDisplayOfImpl(final String type, final String name, final int fromIndex, final int incr, final boolean shared) {
synchronized(displayList) {
int i = fromIndex >= 0 ? fromIndex : displayList.size() - 1 ;
while( ( incr > 0 ) ? i < displayList.size() : i >= 0 ) {
@@ -414,7 +414,7 @@ public abstract class Display {
return null;
}
- protected static void addDisplay2List(Display display) {
+ protected static void addDisplay2List(final Display display) {
synchronized(displayList) {
// GC before add
int i=0;
@@ -458,15 +458,15 @@ public abstract class Display {
return Thread.currentThread().getName();
}
- public static String toHexString(int hex) {
+ public static String toHexString(final int hex) {
return "0x" + Integer.toHexString(hex);
}
- public static String toHexString(long hex) {
+ public static String toHexString(final long hex) {
return "0x" + Long.toHexString(hex);
}
- public static int hashCodeNullSafe(Object o) {
+ public static int hashCodeNullSafe(final Object o) {
return ( null != o ) ? o.hashCode() : 0;
}
}
diff --git a/src/newt/classes/com/jogamp/newt/MonitorDevice.java b/src/newt/classes/com/jogamp/newt/MonitorDevice.java
index a65675204..126162006 100644
--- a/src/newt/classes/com/jogamp/newt/MonitorDevice.java
+++ b/src/newt/classes/com/jogamp/newt/MonitorDevice.java
@@ -68,7 +68,7 @@ public abstract class MonitorDevice {
protected Rectangle viewportPU; // in pixel units
protected Rectangle viewportWU; // in window units
- protected MonitorDevice(Screen screen, int nativeId, DimensionImmutable sizeMM, Rectangle viewportPU, Rectangle viewportWU, MonitorMode currentMode, ArrayHashSet<MonitorMode> supportedModes) {
+ protected MonitorDevice(final Screen screen, final int nativeId, final DimensionImmutable sizeMM, final Rectangle viewportPU, final Rectangle viewportWU, final MonitorMode currentMode, final ArrayHashSet<MonitorMode> supportedModes) {
this.screen = screen;
this.nativeId = nativeId;
this.sizeMM = sizeMM;
@@ -94,10 +94,10 @@ public abstract class MonitorDevice {
* <br>
*/
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if (this == obj) { return true; }
if (obj instanceof MonitorDevice) {
- MonitorDevice md = (MonitorDevice)obj;
+ final MonitorDevice md = (MonitorDevice)obj;
return md.nativeId == nativeId;
}
return false;
diff --git a/src/newt/classes/com/jogamp/newt/MonitorMode.java b/src/newt/classes/com/jogamp/newt/MonitorMode.java
index ba21df22a..09bc06ebd 100644
--- a/src/newt/classes/com/jogamp/newt/MonitorMode.java
+++ b/src/newt/classes/com/jogamp/newt/MonitorMode.java
@@ -115,14 +115,14 @@ public class MonitorMode implements Comparable<MonitorMode> {
/** Comparator for 2 {@link MonitorMode}s, following comparison order as described in {@link MonitorMode#compareTo(MonitorMode)}, returning the ascending order. */
public static final Comparator<MonitorMode> monitorModeComparator = new Comparator<MonitorMode>() {
@Override
- public int compare(MonitorMode mm1, MonitorMode mm2) {
+ public int compare(final MonitorMode mm1, final MonitorMode mm2) {
return mm1.compareTo(mm2);
} };
/** Comparator for 2 {@link MonitorMode}s, following comparison order as described in {@link MonitorMode#compareTo(MonitorMode)}, returning the descending order. */
public static final Comparator<MonitorMode> monitorModeComparatorInv = new Comparator<MonitorMode>() {
@Override
- public int compare(MonitorMode mm1, MonitorMode mm2) {
+ public int compare(final MonitorMode mm1, final MonitorMode mm2) {
return mm2.compareTo(mm1);
} };
@@ -144,7 +144,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
public final float refreshRate;
public final int hashCode;
- public SizeAndRRate(SurfaceSize surfaceSize, float refreshRate, int flags) {
+ public SizeAndRRate(final SurfaceSize surfaceSize, final float refreshRate, final int flags) {
if(null==surfaceSize) {
throw new IllegalArgumentException("surfaceSize must be set ("+surfaceSize+")");
}
@@ -158,7 +158,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
private final static String STR_DOUBLESCAN = "DoubleScan";
private final static String STR_SEP = ", ";
- public static final StringBuilder flags2String(int flags) {
+ public static final StringBuilder flags2String(final int flags) {
final StringBuilder sb = new StringBuilder();
boolean sp = false;
if( 0 != ( flags & FLAG_INTERLACE ) ) {
@@ -232,7 +232,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
* </ul>
*/
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if (this == obj) { return true; }
if (obj instanceof SizeAndRRate) {
final SizeAndRRate p = (SizeAndRRate)obj;
@@ -288,7 +288,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
private final int rotation;
private final int hashCode;
- public static boolean isRotationValid(int rotation) {
+ public static boolean isRotationValid(final int rotation) {
return rotation == MonitorMode.ROTATE_0 || rotation == MonitorMode.ROTATE_90 ||
rotation == MonitorMode.ROTATE_180 || rotation == MonitorMode.ROTATE_270 ;
}
@@ -297,7 +297,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
* @param sizeAndRRate the surface size and refresh rate mode
* @param rotation the screen rotation, measured counter clockwise (CCW)
*/
- public MonitorMode(int nativeId, SizeAndRRate sizeAndRRate, int rotation) {
+ public MonitorMode(final int nativeId, final SizeAndRRate sizeAndRRate, final int rotation) {
if ( !isRotationValid(rotation) ) {
throw new RuntimeException("invalid rotation: "+rotation);
}
@@ -317,7 +317,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
* @param flags
* @param rotation
*/
- public MonitorMode(SurfaceSize surfaceSize, float refreshRate, int flags, int rotation) {
+ public MonitorMode(final SurfaceSize surfaceSize, final float refreshRate, final int flags, final int rotation) {
this(0, new SizeAndRRate(surfaceSize, refreshRate, flags), rotation);
}
@@ -416,10 +416,10 @@ public class MonitorMode implements Comparable<MonitorMode> {
* </ul>
*/
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if (this == obj) { return true; }
if (obj instanceof MonitorMode) {
- MonitorMode sm = (MonitorMode)obj;
+ final MonitorMode sm = (MonitorMode)obj;
return sm.nativeId == this.nativeId &&
sm.sizeAndRRate.equals(sizeAndRRate) &&
sm.rotation == this.rotation ;
@@ -447,7 +447,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
return hash;
}
- private final int getRotatedWH(boolean width) {
+ private final int getRotatedWH(final boolean width) {
final DimensionImmutable d = sizeAndRRate.surfaceSize.getResolution();
final boolean swap = MonitorMode.ROTATE_90 == rotation || MonitorMode.ROTATE_270 == rotation ;
if ( ( width && swap ) || ( !width && !swap ) ) {
diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java
index 9685200eb..9606fae08 100644
--- a/src/newt/classes/com/jogamp/newt/NewtFactory.java
+++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java
@@ -46,6 +46,7 @@ import javax.media.nativewindow.NativeWindow;
import javax.media.nativewindow.NativeWindowFactory;
import com.jogamp.common.util.IOUtil;
+import com.jogamp.common.util.PropertyAccess;
import jogamp.newt.Debug;
import jogamp.newt.DisplayImpl;
@@ -66,7 +67,7 @@ public class NewtFactory {
NativeWindowFactory.initSingleton(); // last resort ..
{
/** See API Doc in {@link Window} ! */
- final String[] paths = Debug.getProperty("newt.window.icons", true, "newt/data/jogamp-16x16.png newt/data/jogamp-32x32.png").split("\\s");
+ final String[] paths = PropertyAccess.getProperty("newt.window.icons", true, "newt/data/jogamp-16x16.png newt/data/jogamp-32x32.png").split("\\s");
if( paths.length < 2 ) {
throw new IllegalArgumentException("Property 'newt.window.icons' did not specify at least two PNG icons, but "+Arrays.toString(paths));
}
@@ -95,9 +96,9 @@ public class NewtFactory {
* Shall reference at least two PNG icons, from lower (16x16) to higher (>= 32x32) resolution.
* </p>
*/
- public static void setWindowIcons(IOUtil.ClassResources cres) { defaultWindowIcons = cres; }
+ public static void setWindowIcons(final IOUtil.ClassResources cres) { defaultWindowIcons = cres; }
- public static Class<?> getCustomClass(String packageName, String classBaseName) {
+ public static Class<?> getCustomClass(final String packageName, final String classBaseName) {
Class<?> clazz = null;
if(packageName!=null && classBaseName!=null) {
final String clazzName;
@@ -108,7 +109,7 @@ public class NewtFactory {
}
try {
clazz = Class.forName(clazzName);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Warning: Failed to find class <"+clazzName+">: "+t.getMessage());
t.printStackTrace();
@@ -125,7 +126,7 @@ public class NewtFactory {
* The default is enabled.<br>
* The EventDispatchThread is thread local to the Display instance.<br>
*/
- public static synchronized void setUseEDT(boolean onoff) {
+ public static synchronized void setUseEDT(final boolean onoff) {
useEDT = onoff;
}
@@ -144,7 +145,7 @@ public class NewtFactory {
* see {@link AbstractGraphicsDevice#getConnection()}. Use <code>null</code> for default.
* @return the new or reused Display instance
*/
- public static Display createDisplay(String name) {
+ public static Display createDisplay(final String name) {
return createDisplay(name, true);
}
@@ -162,7 +163,7 @@ public class NewtFactory {
* @param reuse attempt to reuse an existing Display with same <code>name</code> if set true, otherwise create a new instance.
* @return the new or reused Display instance
*/
- public static Display createDisplay(String name, boolean reuse) {
+ public static Display createDisplay(final String name, final boolean reuse) {
return DisplayImpl.create(NativeWindowFactory.getNativeWindowType(true), name, 0, reuse);
}
@@ -179,7 +180,7 @@ public class NewtFactory {
* see {@link AbstractGraphicsDevice#getConnection()}. Use <code>null</code> for default.
* @return the new or reused Display instance
*/
- public static Display createDisplay(String type, String name) {
+ public static Display createDisplay(final String type, final String name) {
return createDisplay(type, name, true);
}
@@ -198,7 +199,7 @@ public class NewtFactory {
* @param reuse attempt to reuse an existing Display with same <code>name</code> if set true, otherwise create a new instance.
* @return the new or reused Display instance
*/
- public static Display createDisplay(String type, String name, boolean reuse) {
+ public static Display createDisplay(final String type, final String name, final boolean reuse) {
return DisplayImpl.create(type, name, 0, reuse);
}
@@ -212,7 +213,7 @@ public class NewtFactory {
* and {@link Display#removeReference()}.
* </p>
*/
- public static Screen createScreen(Display display, int index) {
+ public static Screen createScreen(final Display display, final int index) {
return ScreenImpl.create(display, index);
}
@@ -229,7 +230,7 @@ public class NewtFactory {
* and {@link Screen#removeReference()}.
* </p>
*/
- public static Window createWindow(CapabilitiesImmutable caps) {
+ public static Window createWindow(final CapabilitiesImmutable caps) {
return createWindowImpl(NativeWindowFactory.getNativeWindowType(true), caps);
}
@@ -243,7 +244,7 @@ public class NewtFactory {
* and {@link Screen#removeReference()}.
* </p>
*/
- public static Window createWindow(Screen screen, CapabilitiesImmutable caps) {
+ public static Window createWindow(final Screen screen, final CapabilitiesImmutable caps) {
return WindowImpl.create(null, 0, screen, caps);
}
@@ -269,7 +270,7 @@ public class NewtFactory {
*
* @param parentWindowObject either a NativeWindow instance
*/
- public static Window createWindow(NativeWindow parentWindow, CapabilitiesImmutable caps) {
+ public static Window createWindow(final NativeWindow parentWindow, final CapabilitiesImmutable caps) {
final String type = NativeWindowFactory.getNativeWindowType(true);
if( null == parentWindow ) {
return createWindowImpl(type, caps);
@@ -283,14 +284,14 @@ public class NewtFactory {
screen = newtParentWindow.getScreen();
} else {
// create a Display/Screen compatible to the NativeWindow
- AbstractGraphicsConfiguration parentConfig = parentWindow.getGraphicsConfiguration();
+ final AbstractGraphicsConfiguration parentConfig = parentWindow.getGraphicsConfiguration();
if(null!=parentConfig) {
- AbstractGraphicsScreen parentScreen = parentConfig.getScreen();
- AbstractGraphicsDevice parentDevice = parentScreen.getDevice();
- Display display = NewtFactory.createDisplay(type, parentDevice.getHandle(), true);
+ final AbstractGraphicsScreen parentScreen = parentConfig.getScreen();
+ final AbstractGraphicsDevice parentDevice = parentScreen.getDevice();
+ final Display display = NewtFactory.createDisplay(type, parentDevice.getHandle(), true);
screen = NewtFactory.createScreen(display, parentScreen.getIndex());
} else {
- Display display = NewtFactory.createDisplay(type, null, true); // local display
+ final Display display = NewtFactory.createDisplay(type, null, true); // local display
screen = NewtFactory.createScreen(display, 0); // screen 0
}
}
@@ -304,9 +305,9 @@ public class NewtFactory {
return win;
}
- private static Window createWindowImpl(String type, CapabilitiesImmutable caps) {
- Display display = NewtFactory.createDisplay(type, null, true); // local display
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ private static Window createWindowImpl(final String type, final CapabilitiesImmutable caps) {
+ final Display display = NewtFactory.createDisplay(type, null, true); // local display
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
return WindowImpl.create(null, 0, screen, caps);
}
@@ -319,10 +320,10 @@ public class NewtFactory {
* @param caps the desired capabilities
* @return
*/
- public static Window createWindow(String displayConnection, int screenIdx, long parentWindowHandle, CapabilitiesImmutable caps) {
+ public static Window createWindow(final String displayConnection, final int screenIdx, final long parentWindowHandle, final CapabilitiesImmutable caps) {
final String type = NativeWindowFactory.getNativeWindowType(true);
- Display display = NewtFactory.createDisplay(type, displayConnection, true);
- Screen screen = NewtFactory.createScreen(display, screenIdx);
+ final Display display = NewtFactory.createDisplay(type, displayConnection, true);
+ final Screen screen = NewtFactory.createScreen(display, screenIdx);
return WindowImpl.create(null, parentWindowHandle, screen, caps);
}
@@ -333,26 +334,26 @@ public class NewtFactory {
*
* @param undecorated only impacts if the window is in top-level state, while attached to a parent window it's rendered undecorated always
*/
- public static Window createWindow(Object[] cstrArguments, Screen screen, CapabilitiesImmutable caps) {
+ public static Window createWindow(final Object[] cstrArguments, final Screen screen, final CapabilitiesImmutable caps) {
return WindowImpl.create(cstrArguments, screen, caps);
}
/**
* Instantiate a Display entity using the native handle.
*/
- public static Display createDisplay(String type, long handle, boolean reuse) {
+ public static Display createDisplay(final String type, final long handle, final boolean reuse) {
return DisplayImpl.create(type, null, handle, reuse);
}
- public static boolean isScreenCompatible(NativeWindow parent, Screen childScreen) {
+ public static boolean isScreenCompatible(final NativeWindow parent, final Screen childScreen) {
// Get parent's NativeWindow details
- AbstractGraphicsConfiguration parentConfig = parent.getGraphicsConfiguration();
- AbstractGraphicsScreen parentScreen = parentConfig.getScreen();
- AbstractGraphicsDevice parentDevice = parentScreen.getDevice();
+ final AbstractGraphicsConfiguration parentConfig = parent.getGraphicsConfiguration();
+ final AbstractGraphicsScreen parentScreen = parentConfig.getScreen();
+ final AbstractGraphicsDevice parentDevice = parentScreen.getDevice();
- DisplayImpl childDisplay = (DisplayImpl) childScreen.getDisplay();
- String parentDisplayName = childDisplay.validateDisplayName(null, parentDevice.getHandle());
- String childDisplayName = childDisplay.getName();
+ final DisplayImpl childDisplay = (DisplayImpl) childScreen.getDisplay();
+ final String parentDisplayName = childDisplay.validateDisplayName(null, parentDevice.getHandle());
+ final String childDisplayName = childDisplay.getName();
if( ! parentDisplayName.equals( childDisplayName ) ) {
return false;
}
@@ -363,23 +364,23 @@ public class NewtFactory {
return true;
}
- public static Screen createCompatibleScreen(NativeWindow parent) {
+ public static Screen createCompatibleScreen(final NativeWindow parent) {
return createCompatibleScreen(parent, null);
}
- public static Screen createCompatibleScreen(NativeWindow parent, Screen childScreen) {
+ public static Screen createCompatibleScreen(final NativeWindow parent, final Screen childScreen) {
// Get parent's NativeWindow details
- AbstractGraphicsConfiguration parentConfig = parent.getGraphicsConfiguration();
- AbstractGraphicsScreen parentScreen = parentConfig.getScreen();
- AbstractGraphicsDevice parentDevice = parentScreen.getDevice();
+ final AbstractGraphicsConfiguration parentConfig = parent.getGraphicsConfiguration();
+ final AbstractGraphicsScreen parentScreen = parentConfig.getScreen();
+ final AbstractGraphicsDevice parentDevice = parentScreen.getDevice();
if(null != childScreen) {
// check if child Display/Screen is compatible already
- DisplayImpl childDisplay = (DisplayImpl) childScreen.getDisplay();
- String parentDisplayName = childDisplay.validateDisplayName(null, parentDevice.getHandle());
- String childDisplayName = childDisplay.getName();
- boolean displayEqual = parentDisplayName.equals( childDisplayName );
- boolean screenEqual = parentScreen.getIndex() == childScreen.getIndex();
+ final DisplayImpl childDisplay = (DisplayImpl) childScreen.getDisplay();
+ final String parentDisplayName = childDisplay.validateDisplayName(null, parentDevice.getHandle());
+ final String childDisplayName = childDisplay.getName();
+ final boolean displayEqual = parentDisplayName.equals( childDisplayName );
+ final boolean screenEqual = parentScreen.getIndex() == childScreen.getIndex();
if(DEBUG_IMPLEMENTATION) {
System.err.println("NewtFactory.createCompatibleScreen: Display: "+
parentDisplayName+" =? "+childDisplayName+" : "+displayEqual+"; Screen: "+
@@ -393,7 +394,7 @@ public class NewtFactory {
// Prep NEWT's Display and Screen according to the parent
final String type = NativeWindowFactory.getNativeWindowType(true);
- Display display = NewtFactory.createDisplay(type, parentDevice.getHandle(), true);
+ final Display display = NewtFactory.createDisplay(type, parentDevice.getHandle(), true);
return NewtFactory.createScreen(display, parentScreen.getIndex());
}
}
diff --git a/src/newt/classes/com/jogamp/newt/NewtVersion.java b/src/newt/classes/com/jogamp/newt/NewtVersion.java
index e70d63f88..f4cdee487 100644
--- a/src/newt/classes/com/jogamp/newt/NewtVersion.java
+++ b/src/newt/classes/com/jogamp/newt/NewtVersion.java
@@ -38,7 +38,7 @@ public class NewtVersion extends JogampVersion {
protected static volatile NewtVersion jogampCommonVersionInfo;
- protected NewtVersion(String packageName, Manifest mf) {
+ protected NewtVersion(final String packageName, final Manifest mf) {
super(packageName, mf);
}
@@ -56,7 +56,7 @@ public class NewtVersion extends JogampVersion {
return jogampCommonVersionInfo;
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
System.err.println(VersionUtil.getPlatformInfo());
System.err.println(GlueGenVersion.getInstance());
System.err.println(NativeWindowVersion.getInstance());
diff --git a/src/newt/classes/com/jogamp/newt/Screen.java b/src/newt/classes/com/jogamp/newt/Screen.java
index cef254634..0ba557972 100644
--- a/src/newt/classes/com/jogamp/newt/Screen.java
+++ b/src/newt/classes/com/jogamp/newt/Screen.java
@@ -71,10 +71,10 @@ public abstract class Screen {
/** return true if obj is of type Display and both FQN {@link #getFQName()} equals */
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj) { return true; }
if (obj instanceof Screen) {
- Screen s = (Screen)obj;
+ final Screen s = (Screen)obj;
return s.getFQName().equals(getFQName());
}
return false;
@@ -268,7 +268,7 @@ public abstract class Screen {
* @param fromIndex start index, then increasing until found or end of list *
* @return
*/
- public static Screen getFirstScreenOf(Display display, int idx, int fromIndex) {
+ public static Screen getFirstScreenOf(final Display display, final int idx, final int fromIndex) {
return getScreenOfImpl(display, idx, fromIndex, 1);
}
@@ -279,11 +279,11 @@ public abstract class Screen {
* @param fromIndex start index, then decreasing until found or end of list. -1 is interpreted as size - 1.
* @return
*/
- public static Screen getLastScreenOf(Display display, int idx, int fromIndex) {
+ public static Screen getLastScreenOf(final Display display, final int idx, final int fromIndex) {
return getScreenOfImpl(display, idx, fromIndex, -1);
}
- private static Screen getScreenOfImpl(Display display, int idx, int fromIndex, int incr) {
+ private static Screen getScreenOfImpl(final Display display, final int idx, final int fromIndex, final int incr) {
synchronized(screenList) {
int i = fromIndex >= 0 ? fromIndex : screenList.size() - 1 ;
while( ( incr > 0 ) ? i < screenList.size() : i >= 0 ) {
@@ -307,7 +307,7 @@ public abstract class Screen {
return null;
}
- protected static void addScreen2List(Screen screen) {
+ protected static void addScreen2List(final Screen screen) {
synchronized(screenList) {
// GC before add
int i=0;
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
index 4efd60765..c44584d78 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
@@ -147,7 +147,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
/**
* Instantiates a NewtCanvas without a NEWT child.<br>
*/
- public NewtCanvasAWT(GraphicsConfiguration gc) {
+ public NewtCanvasAWT(final GraphicsConfiguration gc) {
super(gc);
awtMouseAdapter = new AWTMouseAdapter().addTo(this);
awtKeyAdapter = new AWTKeyAdapter().addTo(this);
@@ -158,7 +158,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
/**
* Instantiates a NewtCanvas with a NEWT child.
*/
- public NewtCanvasAWT(Window child) {
+ public NewtCanvasAWT(final Window child) {
super();
awtMouseAdapter = new AWTMouseAdapter().addTo(this);
awtKeyAdapter = new AWTKeyAdapter().addTo(this);
@@ -170,7 +170,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
/**
* Instantiates a NewtCanvas with a NEWT child.
*/
- public NewtCanvasAWT(GraphicsConfiguration gc, Window child) {
+ public NewtCanvasAWT(final GraphicsConfiguration gc, final Window child) {
super(gc);
awtMouseAdapter = new AWTMouseAdapter().addTo(this);
awtKeyAdapter = new AWTKeyAdapter().addTo(this);
@@ -180,7 +180,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
}
@Override
- public void setShallUseOffscreenLayer(boolean v) {
+ public void setShallUseOffscreenLayer(final boolean v) {
shallUseOffscreenLayer = v;
}
@@ -253,11 +253,11 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
};
private final WindowListener clearAWTMenusOnNewtFocus = new WindowAdapter() {
@Override
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
updateLayoutSize();
}
@Override
- public void windowGainedFocus(WindowEvent arg0) {
+ public void windowGainedFocus(final WindowEvent arg0) {
if( isParent() && !isFullscreen() ) {
AWTEDTExecutor.singleton.invoke(false, awtClearSelectedMenuPath);
}
@@ -266,19 +266,19 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
class FocusTraversalKeyListener implements KeyListener {
@Override
- public void keyPressed(KeyEvent e) {
+ public void keyPressed(final KeyEvent e) {
if( isParent() && !isFullscreen() ) {
handleKey(e, false);
}
}
@Override
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( isParent() && !isFullscreen() ) {
handleKey(e, true);
}
}
- void handleKey(KeyEvent evt, boolean onRelease) {
+ void handleKey(final KeyEvent evt, final boolean onRelease) {
if(null == keyboardFocusManager) {
throw new InternalError("XXX");
}
@@ -317,7 +317,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
class FocusPropertyChangeListener implements PropertyChangeListener {
@Override
- public void propertyChange(PropertyChangeEvent evt) {
+ public void propertyChange(final PropertyChangeEvent evt) {
final Object oldF = evt.getOldValue();
final Object newF = evt.getNewValue();
final boolean isParent = isParent();
@@ -374,7 +374,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
* </p>
* @return the previous attached newt child.
*/
- public Window setNEWTChild(Window newChild) {
+ public Window setNEWTChild(final Window newChild) {
synchronized(sync) {
final Window prevChild = newtChild;
if(DEBUG) {
@@ -400,7 +400,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
final Window w = newtChild;
if( null != w ) {
// use NEWT child's size for min/pref size!
- java.awt.Dimension minSize = new java.awt.Dimension(w.getWidth(), w.getHeight());
+ final java.awt.Dimension minSize = new java.awt.Dimension(w.getWidth(), w.getHeight());
setMinimumSize(minSize);
setPreferredSize(minSize);
}
@@ -421,7 +421,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
}
@Override
- public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+ public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
return awtWindowClosingProtocol.setDefaultCloseOperation(op);
}
@@ -435,7 +435,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
* which finally will perform the pending JAWT destruction.
* </p>
*/
- public final void setSkipJAWTDestroy(boolean v) { skipJAWTDestroy = v; }
+ public final void setSkipJAWTDestroy(final boolean v) { skipJAWTDestroy = v; }
/** See {@link #setSkipJAWTDestroy(boolean)}. */
public final boolean getSkipJAWTDestroy() { return skipJAWTDestroy; }
@@ -524,7 +524,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
} } );
}
- private final void destroyImpl(boolean removeNotify, boolean windowClosing) {
+ private final void destroyImpl(final boolean removeNotify, final boolean windowClosing) {
synchronized(sync) {
final java.awt.Container cont = AWTMisc.getContainer(this);
if(DEBUG) {
@@ -562,7 +562,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
}
@Override
- public void paint(Graphics g) {
+ public void paint(final Graphics g) {
synchronized(sync) {
if( validateComponent(true) && !printActive ) {
newtChild.windowRepaint(0, 0, getWidth(), getHeight());
@@ -570,13 +570,13 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
}
}
@Override
- public void update(Graphics g) {
+ public void update(final Graphics g) {
paint(g);
}
@SuppressWarnings("deprecation")
@Override
- public void reshape(int x, int y, int width, int height) {
+ public void reshape(final int x, final int y, final int width, final int height) {
synchronized (getTreeLock()) { // super.reshape(..) claims tree lock, so we do extend it's lock over reshape
synchronized(sync) {
super.reshape(x, y, width, height);
@@ -603,7 +603,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
}
@Override
- public void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
+ public void setupPrint(final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight) {
printActive = true;
final int componentCount = isOpaque() ? 3 : 4;
final TileRenderer printRenderer = new TileRenderer();
@@ -720,7 +720,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
};
@Override
- public void print(Graphics graphics) {
+ public void print(final Graphics graphics) {
synchronized(sync) {
if( !printActive || null == printGLAD ) {
throw new IllegalStateException("setupPrint() not called");
@@ -750,7 +750,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
printAWTTiles.resetGraphics2D();
}
}
- } catch (NoninvertibleTransformException nte) {
+ } catch (final NoninvertibleTransformException nte) {
System.err.println("Caught: Inversion failed of: "+g2d.getTransform());
nte.printStackTrace();
}
@@ -760,7 +760,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
}
}
- private final boolean validateComponent(boolean attachNewtChild) {
+ private final boolean validateComponent(final boolean attachNewtChild) {
if( Beans.isDesignTime() || !isDisplayable() ) {
return false;
}
@@ -778,7 +778,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
return true;
}
- private final void configureNewtChild(boolean attach) {
+ private final void configureNewtChild(final boolean attach) {
awtWinAdapter.clear();
awtKeyAdapter.clear();
awtMouseAdapter.clear();
@@ -904,7 +904,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
}
} };
- private final void detachNewtChild(java.awt.Container cont) {
+ private final void detachNewtChild(final java.awt.Container cont) {
if( null == newtChild || null == jawtWindow || !newtChildAttached ) {
return; // nop
}
@@ -951,16 +951,16 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
clazz.getDeclaredMethod("disableBackgroundErase",
new Class[] { Canvas.class });
disableBackgroundEraseMethod.setAccessible(true);
- } catch (Exception e) {
+ } catch (final Exception e) {
clazz = clazz.getSuperclass();
}
}
- } catch (Exception e) {
+ } catch (final Exception e) {
}
return null;
}
});
- } catch (Exception e) {
+ } catch (final Exception e) {
}
disableBackgroundEraseInitialized = true;
if(DEBUG) {
@@ -972,7 +972,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
Throwable t=null;
try {
disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this });
- } catch (Exception e) {
+ } catch (final Exception e) {
t = e;
}
if(DEBUG) {
@@ -983,10 +983,10 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
protected static String currentThreadName() { return "["+Thread.currentThread().getName()+", isAWT-EDT "+EventQueue.isDispatchThread()+"]"; }
- static String newtWinHandleToHexString(Window w) {
+ static String newtWinHandleToHexString(final Window w) {
return null != w ? toHexString(w.getWindowHandle()) : "nil";
}
- static String toHexString(long l) {
+ static String toHexString(final long l) {
return "0x"+Long.toHexString(l);
}
}
diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
index 9cecca9c5..496bd93eb 100644
--- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
+++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
@@ -146,7 +146,7 @@ public class JOGLNewtApplet1Run extends Applet {
glHeight = JOGLNewtAppletBase.str2Int(getParameter("gl_height"), glHeight);
glNoDefaultKeyListener = JOGLNewtAppletBase.str2Bool(getParameter("gl_nodefaultkeyListener"), glNoDefaultKeyListener);
appletDebugTestBorder = JOGLNewtAppletBase.str2Bool(getParameter("appletDebugTestBorder"), appletDebugTestBorder);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
if(null==glEventListenerClazzName) {
@@ -181,7 +181,7 @@ public class JOGLNewtApplet1Run extends Applet {
glTrace);
try {
- GLCapabilities caps = new GLCapabilities(GLProfile.get(glProfileName));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(glProfileName));
caps.setAlphaBits(glAlphaBits);
if(0<glNumMultisampleBuffer) {
caps.setSampleBuffers(true);
@@ -205,7 +205,7 @@ public class JOGLNewtApplet1Run extends Applet {
}
base.init(glWindow);
if(base.isValid()) {
- GLEventListener glEventListener = base.getGLEventListener();
+ final GLEventListener glEventListener = base.getGLEventListener();
if(glEventListener instanceof MouseListener) {
addMouseListener((MouseListener)glEventListener);
@@ -226,7 +226,7 @@ public class JOGLNewtApplet1Run extends Applet {
container.validate();
} } );
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
if(DEBUG) {
diff --git a/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java b/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
index edb2429bb..7fec29259 100644
--- a/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
+++ b/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
@@ -27,6 +27,8 @@
*/
package com.jogamp.newt.event;
+import com.jogamp.common.util.PropertyAccess;
+
import jogamp.newt.Debug;
/**
@@ -83,10 +85,10 @@ public class DoubleTapScrollGesture implements GestureHandler {
static {
Debug.initSingleton();
- SCROLL_SLOP_PIXEL = Debug.getIntProperty("newt.event.scroll_slop_pixel", true, 16);
- DOUBLE_TAP_SLOP_PIXEL = Debug.getIntProperty("newt.event.double_tap_slop_pixel", true, 104);
- SCROLL_SLOP_MM = Debug.getIntProperty("newt.event.scroll_slop_mm", true, 3);
- DOUBLE_TAP_SLOP_MM = Debug.getIntProperty("newt.event.double_tap_slop_mm", true, 20);
+ SCROLL_SLOP_PIXEL = PropertyAccess.getIntProperty("newt.event.scroll_slop_pixel", true, 16);
+ DOUBLE_TAP_SLOP_PIXEL = PropertyAccess.getIntProperty("newt.event.double_tap_slop_pixel", true, 104);
+ SCROLL_SLOP_MM = PropertyAccess.getIntProperty("newt.event.scroll_slop_mm", true, 3);
+ DOUBLE_TAP_SLOP_MM = PropertyAccess.getIntProperty("newt.event.double_tap_slop_mm", true, 20);
}
private static final int ST_NONE = 0;
@@ -97,7 +99,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
private final int scrollSlop, scrollSlopSquare, doubleTapSlop, doubleTapSlopSquare;
private final float[] scrollDistance = new float[] { 0f, 0f };
- private int[] pIds = new int[] { -1, -1 };
+ private final int[] pIds = new int[] { -1, -1 };
/** See class docu */
private int gestureState;
private int sqStartDist;
@@ -105,7 +107,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
private int pointerDownCount;
private MouseEvent hitGestureEvent;
- private static final int getSquareDistance(float x1, float y1, float x2, float y2) {
+ private static final int getSquareDistance(final float x1, final float y1, final float x2, final float y2) {
final int deltaX = (int) x1 - (int) x2;
final int deltaY = (int) y1 - (int) y2;
return deltaX * deltaX + deltaY * deltaY;
@@ -129,7 +131,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
* @param scaledScrollSlop Distance a pointer can wander before we think the user is scrolling in <i>pixels</i>.
* @param scaledDoubleTapSlop Distance in <i>pixels</i> between the first touch and second touch to still be considered a double tap.
*/
- public DoubleTapScrollGesture(int scaledScrollSlop, int scaledDoubleTapSlop) {
+ public DoubleTapScrollGesture(final int scaledScrollSlop, final int scaledDoubleTapSlop) {
scrollSlop = scaledScrollSlop;
scrollSlopSquare = scaledScrollSlop * scaledScrollSlop;
doubleTapSlop = scaledDoubleTapSlop;
@@ -148,7 +150,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
}
@Override
- public void clear(boolean clearStarted) {
+ public void clear(final boolean clearStarted) {
scrollDistance[0] = 0f;
scrollDistance[1] = 0f;
hitGestureEvent = null;
diff --git a/src/newt/classes/com/jogamp/newt/event/InputEvent.java b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
index 7889098ea..fbda79d46 100644
--- a/src/newt/classes/com/jogamp/newt/event/InputEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
@@ -176,7 +176,7 @@ public abstract class InputEvent extends NEWTEvent
* @param button the button to test
* @return true if the given button is down
*/
- public final boolean isButtonDown(int button) {
+ public final boolean isButtonDown(final int button) {
return ( modifiers & getButtonMask(button) ) != 0;
}
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
index 5cef734bb..0f147a722 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
@@ -32,10 +32,10 @@ package com.jogamp.newt.event;
public abstract class KeyAdapter implements KeyListener
{
@Override
- public void keyPressed(KeyEvent e) {
+ public void keyPressed(final KeyEvent e) {
}
@Override
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final 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 8cdfb0db3..f29e9eb8c 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
@@ -377,7 +377,7 @@ public class KeyEvent extends InputEvent
public short max;
/** true if valid for keyChar values as well, otherwise only valid for keyCode and keySym due to collision. */
public final boolean inclKeyChar;
- private NonPrintableRange(short min, short max, boolean inclKeyChar) {
+ private NonPrintableRange(final short min, final short max, final boolean inclKeyChar) {
this.min = min;
this.max = max;
this.inclKeyChar = inclKeyChar;
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
index 98252fe14..679155d10 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
@@ -31,28 +31,28 @@ package com.jogamp.newt.event;
public abstract class MouseAdapter implements MouseListener
{
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
}
@Override
- public void mouseEntered(MouseEvent e) {
+ public void mouseEntered(final MouseEvent e) {
}
@Override
- public void mouseExited(MouseEvent e) {
+ public void mouseExited(final MouseEvent e) {
}
@Override
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
}
@Override
- public void mouseReleased(MouseEvent e) {
+ public void mouseReleased(final MouseEvent e) {
}
@Override
- public void mouseMoved(MouseEvent e) {
+ public void mouseMoved(final MouseEvent e) {
}
@Override
- public void mouseDragged(MouseEvent e) {
+ public void mouseDragged(final MouseEvent e) {
}
@Override
- public void mouseWheelMoved(MouseEvent e) {
+ public void mouseWheelMoved(final 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 43cac31bb..982b855a7 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
@@ -124,7 +124,7 @@ public class MouseEvent extends InputEvent
return types;
}
- private PointerType(PointerClass pc) {
+ private PointerType(final PointerClass pc) {
this.pc = pc;
}
PointerClass pc;
diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
index 78bb7420a..a9d9d8bdb 100644
--- a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
@@ -143,7 +143,7 @@ public class NEWTEvent extends java.util.EventObject {
return sb.append("NEWTEvent[source:").append(getSource().getClass().getName()).append(", consumed ").append(isConsumed()).append(", when:").append(getWhen()).append(" d ").append((System.currentTimeMillis()-getWhen())).append("ms]");
}
- public static String toHexString(short hex) {
+ public static String toHexString(final short hex) {
return "0x" + Integer.toHexString( hex & 0x0000FFFF );
}
}
diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java b/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java
index 7dd56ad1e..dd6395354 100644
--- a/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java
+++ b/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java
@@ -32,10 +32,10 @@ import java.util.LinkedList;
public class NEWTEventFiFo
{
- private LinkedList/*<NEWTEvent>*/ events = new LinkedList/*<NEWTEvent>*/();
+ private final LinkedList/*<NEWTEvent>*/ events = new LinkedList/*<NEWTEvent>*/();
/** Add NEWTEvent to tail */
- public synchronized void put(NEWTEvent event) {
+ public synchronized void put(final NEWTEvent event) {
events.addLast(event);
notifyAll();
}
diff --git a/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java b/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
index 1521036d6..9c7a4bcb8 100644
--- a/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
+++ b/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
@@ -98,7 +98,7 @@ public class PinchToZoomGesture implements GestureHandler {
* @param surface the {@link NativeSurface}, which size is used to compute the relative zoom factor
* @param allowMorePointer if false, allow only 2 pressed pointers (safe and recommended), otherwise accept other pointer to be pressed.
*/
- public PinchToZoomGesture(NativeSurface surface, boolean allowMorePointer) {
+ public PinchToZoomGesture(final NativeSurface surface, final boolean allowMorePointer) {
clear(true);
this.surface = surface;
this.allowMorePointer = allowMorePointer;
@@ -124,7 +124,7 @@ public class PinchToZoomGesture implements GestureHandler {
}
@Override
- public void clear(boolean clearStarted) {
+ public void clear(final boolean clearStarted) {
zoomEvent = null;
if( clearStarted ) {
zoomLastEdgeDist = 0;
@@ -155,7 +155,7 @@ public class PinchToZoomGesture implements GestureHandler {
return zoom;
}
/** Set zoom value within [0..2], with 1 as <i>1:1</i>. */
- public final void setZoom(float zoom) {
+ public final void setZoom(final float zoom) {
this.zoom=zoom;
}
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
index bbc170958..50eae9626 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
@@ -36,17 +36,17 @@ public class TraceKeyAdapter implements KeyListener {
this.downstream = null;
}
- public TraceKeyAdapter(KeyListener downstream) {
+ public TraceKeyAdapter(final KeyListener downstream) {
this.downstream = downstream;
}
@Override
- public void keyPressed(KeyEvent e) {
+ public void keyPressed(final KeyEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.keyPressed(e); }
}
@Override
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.keyReleased(e); }
}
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
index db8376034..e54c3730f 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
@@ -36,47 +36,47 @@ public class TraceMouseAdapter implements MouseListener {
this.downstream = null;
}
- public TraceMouseAdapter(MouseListener downstream) {
+ public TraceMouseAdapter(final MouseListener downstream) {
this.downstream = downstream;
}
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseClicked(e); }
}
@Override
- public void mouseEntered(MouseEvent e) {
+ public void mouseEntered(final MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseEntered(e); }
}
@Override
- public void mouseExited(MouseEvent e) {
+ public void mouseExited(final MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseExited(e); }
}
@Override
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mousePressed(e); }
}
@Override
- public void mouseReleased(MouseEvent e) {
+ public void mouseReleased(final MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseReleased(e); }
}
@Override
- public void mouseMoved(MouseEvent e) {
+ public void mouseMoved(final MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseMoved(e); }
}
@Override
- public void mouseDragged(MouseEvent e) {
+ public void mouseDragged(final MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseDragged(e); }
}
@Override
- public void mouseWheelMoved(MouseEvent e) {
+ public void mouseWheelMoved(final MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseWheelMoved(e); }
}
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
index 7b844f059..299a6ff90 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
@@ -36,42 +36,42 @@ public class TraceWindowAdapter implements WindowListener {
this.downstream = null;
}
- public TraceWindowAdapter(WindowListener downstream) {
+ public TraceWindowAdapter(final WindowListener downstream) {
this.downstream = downstream;
}
@Override
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowResized(e); }
}
@Override
- public void windowMoved(WindowEvent e) {
+ public void windowMoved(final WindowEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowMoved(e); }
}
@Override
- public void windowDestroyNotify(WindowEvent e) {
+ public void windowDestroyNotify(final WindowEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowDestroyNotify(e); }
}
@Override
- public void windowDestroyed(WindowEvent e) {
+ public void windowDestroyed(final WindowEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowDestroyed(e); }
}
@Override
- public void windowGainedFocus(WindowEvent e) {
+ public void windowGainedFocus(final WindowEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowGainedFocus(e); }
}
@Override
- public void windowLostFocus(WindowEvent e) {
+ public void windowLostFocus(final WindowEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowLostFocus(e); }
}
@Override
- public void windowRepaint(WindowUpdateEvent e) {
+ public void windowRepaint(final WindowUpdateEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowRepaint(e); }
}
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
index ccc627444..c1bae40ea 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
@@ -31,24 +31,24 @@ package com.jogamp.newt.event;
public abstract class WindowAdapter implements WindowListener
{
@Override
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
}
@Override
- public void windowMoved(WindowEvent e) {
+ public void windowMoved(final WindowEvent e) {
}
@Override
- public void windowDestroyNotify(WindowEvent e) {
+ public void windowDestroyNotify(final WindowEvent e) {
}
@Override
- public void windowDestroyed(WindowEvent e) {
+ public void windowDestroyed(final WindowEvent e) {
}
@Override
- public void windowGainedFocus(WindowEvent e) {
+ public void windowGainedFocus(final WindowEvent e) {
}
@Override
- public void windowLostFocus(WindowEvent e) {
+ public void windowLostFocus(final WindowEvent e) {
}
@Override
- public void windowRepaint(WindowUpdateEvent e) {
+ public void windowRepaint(final WindowUpdateEvent 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 9b1348288..a49c10a1e 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java
@@ -128,7 +128,7 @@ public abstract class AWTAdapter implements java.util.EventListener
* where the given {@link NativeSurfaceHolder} impersonates the event's source.
* The NEWT EventListener will be called when an event happens.<br>
*/
- protected AWTAdapter(com.jogamp.newt.event.NEWTEventListener newtListener, NativeSurfaceHolder nsProxy) {
+ protected AWTAdapter(final com.jogamp.newt.event.NEWTEventListener newtListener, final NativeSurfaceHolder nsProxy) {
if(null==newtListener) {
throw new IllegalArgumentException("Argument newtListener is null");
}
@@ -147,7 +147,7 @@ public abstract class AWTAdapter implements java.util.EventListener
* where the given {@link com.jogamp.newt.Window NEWT Window}, a {@link NativeSurfaceHolder}, impersonates the event's source.
* The NEWT EventListener will be called when an event happens.<br>
*/
- protected AWTAdapter(com.jogamp.newt.event.NEWTEventListener newtListener, com.jogamp.newt.Window newtProxy) {
+ protected AWTAdapter(final com.jogamp.newt.event.NEWTEventListener newtListener, final com.jogamp.newt.Window newtProxy) {
if(null==newtListener) {
throw new IllegalArgumentException("Argument newtListener is null");
}
@@ -167,7 +167,7 @@ public abstract class AWTAdapter implements java.util.EventListener
* This is only supported with EDT enabled!
* @throws IllegalStateException if EDT is not enabled
*/
- protected AWTAdapter(com.jogamp.newt.Window downstream) throws IllegalStateException {
+ protected AWTAdapter(final com.jogamp.newt.Window downstream) throws IllegalStateException {
this();
setDownstream(downstream);
}
@@ -183,7 +183,7 @@ public abstract class AWTAdapter implements java.util.EventListener
* This is only supported with EDT enabled!
* @throws IllegalStateException if EDT is not enabled
*/
- public synchronized AWTAdapter setDownstream(com.jogamp.newt.Window downstream) throws IllegalStateException {
+ public synchronized AWTAdapter setDownstream(final com.jogamp.newt.Window downstream) throws IllegalStateException {
if(null==downstream) {
throw new RuntimeException("Argument downstream is null");
}
@@ -212,7 +212,7 @@ public abstract class AWTAdapter implements java.util.EventListener
return this;
}
- public final synchronized void setConsumeAWTEvent(boolean v) {
+ public final synchronized void setConsumeAWTEvent(final boolean v) {
this.consumeAWTEvent = v;
}
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
index 5ea36bac8..4f11e8772 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
@@ -39,15 +39,15 @@ import jogamp.newt.awt.event.AWTNewtEventFactory;
*/
public class AWTKeyAdapter extends AWTAdapter implements java.awt.event.KeyListener
{
- public AWTKeyAdapter(com.jogamp.newt.event.KeyListener newtListener, NativeSurfaceHolder nsProxy) {
+ public AWTKeyAdapter(final com.jogamp.newt.event.KeyListener newtListener, final NativeSurfaceHolder nsProxy) {
super(newtListener, nsProxy);
}
- public AWTKeyAdapter(com.jogamp.newt.event.KeyListener newtListener, com.jogamp.newt.Window newtProxy) {
+ public AWTKeyAdapter(final com.jogamp.newt.event.KeyListener newtListener, final com.jogamp.newt.Window newtProxy) {
super(newtListener, newtProxy);
}
- public AWTKeyAdapter(com.jogamp.newt.Window downstream) {
+ public AWTKeyAdapter(final com.jogamp.newt.Window downstream) {
super(downstream);
}
@@ -56,19 +56,19 @@ public class AWTKeyAdapter extends AWTAdapter implements java.awt.event.KeyListe
}
@Override
- public synchronized AWTAdapter addTo(java.awt.Component awtComponent) {
+ public synchronized AWTAdapter addTo(final java.awt.Component awtComponent) {
awtComponent.addKeyListener(this);
return this;
}
@Override
- public synchronized AWTAdapter removeFrom(java.awt.Component awtComponent) {
+ public synchronized AWTAdapter removeFrom(final java.awt.Component awtComponent) {
awtComponent.removeKeyListener(this);
return this;
}
@Override
- public synchronized void keyPressed(java.awt.event.KeyEvent e) {
+ public synchronized void keyPressed(final java.awt.event.KeyEvent e) {
if( !isSetup ) { return; }
final com.jogamp.newt.event.KeyEvent event = AWTNewtEventFactory.createKeyEvent(com.jogamp.newt.event.KeyEvent.EVENT_KEY_PRESSED, e, nsHolder);
if( consumeAWTEvent ) {
@@ -80,7 +80,7 @@ public class AWTKeyAdapter extends AWTAdapter implements java.awt.event.KeyListe
}
@Override
- public synchronized void keyReleased(java.awt.event.KeyEvent e) {
+ public synchronized void keyReleased(final java.awt.event.KeyEvent e) {
if( !isSetup ) { return; }
final com.jogamp.newt.event.KeyEvent event = AWTNewtEventFactory.createKeyEvent(com.jogamp.newt.event.KeyEvent.EVENT_KEY_RELEASED, e, nsHolder);
if( consumeAWTEvent ) {
@@ -92,7 +92,7 @@ public class AWTKeyAdapter extends AWTAdapter implements java.awt.event.KeyListe
}
@Override
- public synchronized void keyTyped(java.awt.event.KeyEvent e) {
+ public synchronized void keyTyped(final java.awt.event.KeyEvent e) {
if( !isSetup ) { return; }
if( consumeAWTEvent ) {
e.consume();
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
index 53fe70bf7..d9531cd5f 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
@@ -36,15 +36,15 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
java.awt.event.MouseMotionListener,
java.awt.event.MouseWheelListener
{
- public AWTMouseAdapter(com.jogamp.newt.event.MouseListener newtListener, NativeSurfaceHolder nsProxy) {
+ public AWTMouseAdapter(final com.jogamp.newt.event.MouseListener newtListener, final NativeSurfaceHolder nsProxy) {
super(newtListener, nsProxy);
}
- public AWTMouseAdapter(com.jogamp.newt.event.MouseListener newtListener, com.jogamp.newt.Window newtProxy) {
+ public AWTMouseAdapter(final com.jogamp.newt.event.MouseListener newtListener, final com.jogamp.newt.Window newtProxy) {
super(newtListener, newtProxy);
}
- public AWTMouseAdapter(com.jogamp.newt.Window downstream) {
+ public AWTMouseAdapter(final com.jogamp.newt.Window downstream) {
super(downstream);
}
@@ -53,7 +53,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
@Override
- public synchronized AWTAdapter addTo(java.awt.Component awtComponent) {
+ public synchronized AWTAdapter addTo(final java.awt.Component awtComponent) {
awtComponent.addMouseListener(this);
awtComponent.addMouseMotionListener(this);
awtComponent.addMouseWheelListener(this);
@@ -61,7 +61,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
@Override
- public synchronized AWTAdapter removeFrom(java.awt.Component awtComponent) {
+ public synchronized AWTAdapter removeFrom(final java.awt.Component awtComponent) {
awtComponent.removeMouseListener(this);
awtComponent.removeMouseMotionListener(this);
awtComponent.removeMouseWheelListener(this);
@@ -69,9 +69,9 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
@Override
- public synchronized void mouseClicked(java.awt.event.MouseEvent e) {
+ public synchronized void mouseClicked(final java.awt.event.MouseEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
+ final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
if( consumeAWTEvent ) {
e.consume();
}
@@ -81,9 +81,9 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
@Override
- public synchronized void mouseEntered(java.awt.event.MouseEvent e) {
+ public synchronized void mouseEntered(final java.awt.event.MouseEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
+ final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
if( consumeAWTEvent ) {
e.consume();
}
@@ -93,9 +93,9 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
@Override
- public synchronized void mouseExited(java.awt.event.MouseEvent e) {
+ public synchronized void mouseExited(final java.awt.event.MouseEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
+ final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
if( consumeAWTEvent ) {
e.consume();
}
@@ -105,9 +105,9 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
@Override
- public synchronized void mousePressed(java.awt.event.MouseEvent e) {
+ public synchronized void mousePressed(final java.awt.event.MouseEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
+ final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
if( consumeAWTEvent ) {
e.consume();
}
@@ -117,9 +117,9 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
@Override
- public synchronized void mouseReleased(java.awt.event.MouseEvent e) {
+ public synchronized void mouseReleased(final java.awt.event.MouseEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
+ final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
if( consumeAWTEvent ) {
e.consume();
}
@@ -129,9 +129,9 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
@Override
- public synchronized void mouseDragged(java.awt.event.MouseEvent e) {
+ public synchronized void mouseDragged(final java.awt.event.MouseEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
+ final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
if( consumeAWTEvent ) {
e.consume();
}
@@ -141,9 +141,9 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
@Override
- public synchronized void mouseMoved(java.awt.event.MouseEvent e) {
+ public synchronized void mouseMoved(final java.awt.event.MouseEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
+ final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
if( consumeAWTEvent ) {
e.consume();
}
@@ -153,9 +153,9 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
@Override
- public synchronized void mouseWheelMoved(java.awt.event.MouseWheelEvent e) {
+ public synchronized void mouseWheelMoved(final java.awt.event.MouseWheelEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
+ final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
if( consumeAWTEvent ) {
e.consume();
}
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
index 698fe86f4..65d927157 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
@@ -40,15 +40,15 @@ public class AWTWindowAdapter
{
WindowClosingListener windowClosingListener;
- public AWTWindowAdapter(com.jogamp.newt.event.WindowListener newtListener, NativeSurfaceHolder nsProxy) {
+ public AWTWindowAdapter(final com.jogamp.newt.event.WindowListener newtListener, final NativeSurfaceHolder nsProxy) {
super(newtListener, nsProxy);
}
- public AWTWindowAdapter(com.jogamp.newt.event.WindowListener newtListener, com.jogamp.newt.Window newtProxy) {
+ public AWTWindowAdapter(final com.jogamp.newt.event.WindowListener newtListener, final com.jogamp.newt.Window newtProxy) {
super(newtListener, newtProxy);
}
- public AWTWindowAdapter(com.jogamp.newt.Window downstream) {
+ public AWTWindowAdapter(final com.jogamp.newt.Window downstream) {
super(downstream);
}
@@ -57,8 +57,8 @@ public class AWTWindowAdapter
}
@Override
- public synchronized AWTAdapter addTo(java.awt.Component awtComponent) {
- java.awt.Window win = getWindow(awtComponent);
+ public synchronized AWTAdapter addTo(final java.awt.Component awtComponent) {
+ final java.awt.Window win = getWindow(awtComponent);
awtComponent.addComponentListener(this);
awtComponent.addFocusListener(this);
if( null != win && null == windowClosingListener ) {
@@ -71,8 +71,8 @@ public class AWTWindowAdapter
return this;
}
- public synchronized AWTAdapter removeWindowClosingFrom(java.awt.Component awtComponent) {
- java.awt.Window win = getWindow(awtComponent);
+ public synchronized AWTAdapter removeWindowClosingFrom(final java.awt.Component awtComponent) {
+ final java.awt.Window win = getWindow(awtComponent);
if( null != win && null != windowClosingListener ) {
win.removeWindowListener(windowClosingListener);
}
@@ -80,7 +80,7 @@ public class AWTWindowAdapter
}
@Override
- public synchronized AWTAdapter removeFrom(java.awt.Component awtComponent) {
+ public synchronized AWTAdapter removeFrom(final java.awt.Component awtComponent) {
awtComponent.removeFocusListener(this);
awtComponent.removeComponentListener(this);
removeWindowClosingFrom(awtComponent);
@@ -101,9 +101,9 @@ public class AWTWindowAdapter
}
@Override
- public synchronized void focusGained(java.awt.event.FocusEvent e) {
+ public synchronized void focusGained(final java.awt.event.FocusEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
+ final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
if(DEBUG_IMPLEMENTATION) {
System.err.println("AWT: focusGained: "+e+" -> "+event);
}
@@ -113,9 +113,9 @@ public class AWTWindowAdapter
}
@Override
- public synchronized void focusLost(java.awt.event.FocusEvent e) {
+ public synchronized void focusLost(final java.awt.event.FocusEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
+ final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
if(DEBUG_IMPLEMENTATION) {
System.err.println("AWT: focusLost: "+e+" -> "+event);
}
@@ -125,9 +125,9 @@ public class AWTWindowAdapter
}
@Override
- public synchronized void componentResized(java.awt.event.ComponentEvent e) {
+ public synchronized void componentResized(final java.awt.event.ComponentEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
+ final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
if(DEBUG_IMPLEMENTATION) {
final java.awt.Component c = e.getComponent();
final java.awt.Dimension sz = c.getSize();
@@ -149,9 +149,9 @@ public class AWTWindowAdapter
}
@Override
- public synchronized void componentMoved(java.awt.event.ComponentEvent e) {
+ public synchronized void componentMoved(final java.awt.event.ComponentEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
+ final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
if(DEBUG_IMPLEMENTATION) {
System.err.println("AWT: componentMoved: "+e+" -> "+event);
}
@@ -161,7 +161,7 @@ public class AWTWindowAdapter
}
@Override
- public synchronized void componentShown(java.awt.event.ComponentEvent e) {
+ public synchronized void componentShown(final java.awt.event.ComponentEvent e) {
if( !isSetup ) { return; }
final java.awt.Component comp = e.getComponent();
if(DEBUG_IMPLEMENTATION) {
@@ -180,7 +180,7 @@ public class AWTWindowAdapter
}
@Override
- public synchronized void componentHidden(java.awt.event.ComponentEvent e) {
+ public synchronized void componentHidden(final java.awt.event.ComponentEvent e) {
if( !isSetup ) { return; }
final java.awt.Component comp = e.getComponent();
if(DEBUG_IMPLEMENTATION) {
@@ -199,54 +199,54 @@ public class AWTWindowAdapter
}
@Override
- public synchronized void windowActivated(java.awt.event.WindowEvent e) {
+ public synchronized void windowActivated(final java.awt.event.WindowEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
+ final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
if( EventProcRes.DISPATCH == processEvent(false, event) ) {
((com.jogamp.newt.event.WindowListener)newtListener).windowGainedFocus(event);
}
}
@Override
- public synchronized void windowClosed(java.awt.event.WindowEvent e) { }
+ public synchronized void windowClosed(final java.awt.event.WindowEvent e) { }
@Override
- public synchronized void windowClosing(java.awt.event.WindowEvent e) { }
+ public synchronized void windowClosing(final java.awt.event.WindowEvent e) { }
@Override
- public synchronized void windowDeactivated(java.awt.event.WindowEvent e) {
+ public synchronized void windowDeactivated(final java.awt.event.WindowEvent e) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
+ final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
if( EventProcRes.DISPATCH == processEvent(false, event) ) {
((com.jogamp.newt.event.WindowListener)newtListener).windowLostFocus(event);
}
}
@Override
- public synchronized void windowDeiconified(java.awt.event.WindowEvent e) { }
+ public synchronized void windowDeiconified(final java.awt.event.WindowEvent e) { }
@Override
- public synchronized void windowIconified(java.awt.event.WindowEvent e) { }
+ public synchronized void windowIconified(final java.awt.event.WindowEvent e) { }
@Override
- public synchronized void windowOpened(java.awt.event.WindowEvent e) { }
+ public synchronized void windowOpened(final java.awt.event.WindowEvent e) { }
class WindowClosingListener implements java.awt.event.WindowListener {
@Override
- public void windowClosing(java.awt.event.WindowEvent e) {
+ public void windowClosing(final java.awt.event.WindowEvent e) {
synchronized( AWTWindowAdapter.this ) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
+ final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
if( EventProcRes.DISPATCH == processEvent(true, event) ) {
((com.jogamp.newt.event.WindowListener)newtListener).windowDestroyNotify(event);
}
}
}
@Override
- public void windowClosed(java.awt.event.WindowEvent e) {
+ public void windowClosed(final java.awt.event.WindowEvent e) {
synchronized( AWTWindowAdapter.this ) {
if( !isSetup ) { return; }
- com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
+ final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
if( EventProcRes.DISPATCH == processEvent(true, event) ) {
((com.jogamp.newt.event.WindowListener)newtListener).windowDestroyed(event);
}
@@ -254,15 +254,15 @@ public class AWTWindowAdapter
}
@Override
- public void windowActivated(java.awt.event.WindowEvent e) { }
+ public void windowActivated(final java.awt.event.WindowEvent e) { }
@Override
- public void windowDeactivated(java.awt.event.WindowEvent e) { }
+ public void windowDeactivated(final java.awt.event.WindowEvent e) { }
@Override
- public void windowDeiconified(java.awt.event.WindowEvent e) { }
+ public void windowDeiconified(final java.awt.event.WindowEvent e) { }
@Override
- public void windowIconified(java.awt.event.WindowEvent e) { }
+ public void windowIconified(final java.awt.event.WindowEvent e) { }
@Override
- public void windowOpened(java.awt.event.WindowEvent e) { }
+ public void windowOpened(final java.awt.event.WindowEvent e) { }
}
}
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index 992cc4284..b9c4e35f2 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -115,7 +115,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
/**
* Constructor. Do not call this directly -- use {@link #create()} instead.
*/
- protected GLWindow(Window window) {
+ protected GLWindow(final Window window) {
super(null, null, false /* always handle device lifecycle ourselves */);
this.window = (WindowImpl) window;
this.window.setWindowDestroyNotifyAction( new Runnable() {
@@ -125,12 +125,12 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
} } );
window.addWindowListener(new WindowAdapter() {
@Override
- public void windowRepaint(WindowUpdateEvent e) {
+ public void windowRepaint(final WindowUpdateEvent e) {
defaultWindowRepaintOp();
}
@Override
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
defaultWindowResizedOp(getSurfaceWidth(), getSurfaceHeight());
}
@@ -152,7 +152,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
* </p>
* The default Display will be reused if already instantiated.
*/
- public static GLWindow create(GLCapabilitiesImmutable caps) {
+ public static GLWindow create(final GLCapabilitiesImmutable caps) {
return new GLWindow(NewtFactory.createWindow(caps));
}
@@ -164,7 +164,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
* and {@link Screen#removeReference()}.
* </p>
*/
- public static GLWindow create(Screen screen, GLCapabilitiesImmutable caps) {
+ public static GLWindow create(final Screen screen, final GLCapabilitiesImmutable caps) {
return new GLWindow(NewtFactory.createWindow(screen, caps));
}
@@ -175,7 +175,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
* and {@link Screen#removeReference()}.
* </p>
*/
- public static GLWindow create(Window window) {
+ public static GLWindow create(final Window window) {
return new GLWindow(window);
}
@@ -192,7 +192,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
* and {@link Screen#removeReference()}.
* </p>
*/
- public static GLWindow create(NativeWindow parentNativeWindow, GLCapabilitiesImmutable caps) {
+ public static GLWindow create(final NativeWindow parentNativeWindow, final GLCapabilitiesImmutable caps) {
return new GLWindow(NewtFactory.createWindow(parentNativeWindow, caps));
}
@@ -205,7 +205,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+ public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
return window.setDefaultCloseOperation(op);
}
@@ -214,7 +214,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
//
@Override
- public CapabilitiesChooser setCapabilitiesChooser(CapabilitiesChooser chooser) {
+ public CapabilitiesChooser setCapabilitiesChooser(final CapabilitiesChooser chooser) {
return window.setCapabilitiesChooser(chooser);
}
@@ -250,7 +250,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final void setTitle(String title) {
+ public final void setTitle(final String title) {
window.setTitle(title);
}
@@ -265,7 +265,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final void setPointerVisible(boolean mouseVisible) {
+ public final void setPointerVisible(final boolean mouseVisible) {
window.setPointerVisible(mouseVisible);
}
@@ -285,17 +285,17 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final void confinePointer(boolean grab) {
+ public final void confinePointer(final boolean grab) {
window.confinePointer(grab);
}
@Override
- public final void setUndecorated(boolean value) {
+ public final void setUndecorated(final boolean value) {
window.setUndecorated(value);
}
@Override
- public final void warpPointer(int x, int y) {
+ public final void warpPointer(final int x, final int y) {
window.warpPointer(x, y);
}
@Override
@@ -304,7 +304,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final void setAlwaysOnTop(boolean value) {
+ public final void setAlwaysOnTop(final boolean value) {
window.setAlwaysOnTop(value);
}
@@ -314,12 +314,12 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final void setFocusAction(FocusRunnable focusAction) {
+ public final void setFocusAction(final FocusRunnable focusAction) {
window.setFocusAction(focusAction);
}
@Override
- public void setKeyboardFocusHandler(KeyListener l) {
+ public void setKeyboardFocusHandler(final KeyListener l) {
window.setKeyboardFocusHandler(l);
}
@@ -329,7 +329,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final void requestFocus(boolean wait) {
+ public final void requestFocus(final boolean wait) {
window.requestFocus(wait);
}
@@ -414,21 +414,21 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final void setPosition(int x, int y) {
+ public final void setPosition(final int x, final int y) {
window.setPosition(x, y);
}
@Override
- public void setTopLevelPosition(int x, int y) {
+ public void setTopLevelPosition(final int x, final int y) {
window.setTopLevelPosition(x, y);
}
@Override
- public final boolean setFullscreen(boolean fullscreen) {
+ public final boolean setFullscreen(final boolean fullscreen) {
return window.setFullscreen(fullscreen);
}
@Override
- public boolean setFullscreen(List<MonitorDevice> monitors) {
+ public boolean setFullscreen(final List<MonitorDevice> monitors) {
return window.setFullscreen(monitors);
}
@@ -449,17 +449,17 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, int hints) {
+ public final ReparentOperation reparentWindow(final NativeWindow newParent, final int x, final int y, final int hints) {
return window.reparentWindow(newParent, x, y, hints);
}
@Override
- public final boolean removeChild(NativeWindow win) {
+ public final boolean removeChild(final NativeWindow win) {
return window.removeChild(win);
}
@Override
- public final boolean addChild(NativeWindow win) {
+ public final boolean addChild(final NativeWindow win) {
return window.addChild(win);
}
@@ -473,30 +473,30 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public void setWindowDestroyNotifyAction(Runnable r) {
+ public void setWindowDestroyNotifyAction(final Runnable r) {
window.setWindowDestroyNotifyAction(r);
}
@Override
- public final void setVisible(boolean visible) {
+ public final void setVisible(final boolean visible) {
window.setVisible(visible);
}
@Override
- public void setVisible(boolean wait, boolean visible) {
+ public void setVisible(final boolean wait, final boolean visible) {
window.setVisible(wait, visible);
}
@Override
- public final void setSize(int width, int height) {
+ public final void setSize(final int width, final int height) {
window.setSize(width, height);
}
@Override
- public final void setSurfaceSize(int pixelWidth, int pixelHeight) {
+ public final void setSurfaceSize(final int pixelWidth, final int pixelHeight) {
window.setSurfaceSize(pixelWidth, pixelHeight);
}
@Override
- public void setTopLevelSize(int width, int height) {
+ public void setTopLevelSize(final int width, final int height) {
window.setTopLevelSize(width, height);
}
@@ -506,7 +506,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public Point getLocationOnScreen(Point storage) {
+ public Point getLocationOnScreen(final Point storage) {
return window.getLocationOnScreen(storage);
}
@@ -514,7 +514,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
protected class GLLifecycleHook implements WindowImpl.LifecycleHook {
@Override
- public void preserveGLStateAtDestroy(boolean value) {
+ public void preserveGLStateAtDestroy(final boolean value) {
GLWindow.this.preserveGLStateAtDestroy(value);
}
@@ -526,7 +526,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
@Override
public synchronized void destroyActionInLock() {
if(Window.DEBUG_IMPLEMENTATION) {
- String msg = "GLWindow.destroy() "+WindowImpl.getThreadName()+", start";
+ final String msg = "GLWindow.destroy() "+WindowImpl.getThreadName()+", start";
System.err.println(msg);
//Exception e1 = new Exception(msg);
//e1.printStackTrace();
@@ -552,7 +552,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public synchronized void setVisibleActionPost(boolean visible, boolean nativeWindowCreated) {
+ public synchronized void setVisibleActionPost(final boolean visible, final boolean nativeWindowCreated) {
long t0;
if(Window.DEBUG_IMPLEMENTATION) {
t0 = System.nanoTime();
@@ -624,7 +624,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
if( anim.isAnimating() && null != animThread ) {
try {
animThread.stop();
- } catch(Throwable t) {
+ } catch(final Throwable t) {
if( DEBUG ) {
System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage());
t.printStackTrace();
@@ -705,7 +705,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
// NEWTEventConsumer
//
@Override
- public boolean consumeEvent(NEWTEvent event) {
+ public boolean consumeEvent(final NEWTEvent event) {
return window.consumeEvent(event);
}
@@ -713,27 +713,27 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
// Window completion
//
@Override
- public final void windowRepaint(int x, int y, int width, int height) {
+ public final void windowRepaint(final int x, final int y, final int width, final int height) {
window.windowRepaint(x, y, width, height);
}
@Override
- public final void enqueueEvent(boolean wait, com.jogamp.newt.event.NEWTEvent event) {
+ public final void enqueueEvent(final boolean wait, final com.jogamp.newt.event.NEWTEvent event) {
window.enqueueEvent(wait, event);
}
@Override
- public final void runOnEDTIfAvail(boolean wait, final Runnable task) {
+ public final void runOnEDTIfAvail(final boolean wait, final Runnable task) {
window.runOnEDTIfAvail(wait, task);
}
@Override
- public void sendWindowEvent(int eventType) {
+ public void sendWindowEvent(final int eventType) {
window.sendWindowEvent(eventType);
}
@Override
- public final WindowListener getWindowListener(int index) {
+ public final WindowListener getWindowListener(final int index) {
return window.getWindowListener(index);
}
@@ -743,22 +743,22 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final void removeWindowListener(WindowListener l) {
+ public final void removeWindowListener(final WindowListener l) {
window.removeWindowListener(l);
}
@Override
- public final void addWindowListener(WindowListener l) {
+ public final void addWindowListener(final WindowListener l) {
window.addWindowListener(l);
}
@Override
- public final void addWindowListener(int index, WindowListener l) throws IndexOutOfBoundsException {
+ public final void addWindowListener(final int index, final WindowListener l) throws IndexOutOfBoundsException {
window.addWindowListener(index, l);
}
@Override
- public final void setKeyboardVisible(boolean visible) {
+ public final void setKeyboardVisible(final boolean visible) {
window.setKeyboardVisible(visible);
}
@@ -768,22 +768,22 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final void addKeyListener(KeyListener l) {
+ public final void addKeyListener(final KeyListener l) {
window.addKeyListener(l);
}
@Override
- public final void addKeyListener(int index, KeyListener l) {
+ public final void addKeyListener(final int index, final KeyListener l) {
window.addKeyListener(index, l);
}
@Override
- public final void removeKeyListener(KeyListener l) {
+ public final void removeKeyListener(final KeyListener l) {
window.removeKeyListener(l);
}
@Override
- public final KeyListener getKeyListener(int index) {
+ public final KeyListener getKeyListener(final int index) {
return window.getKeyListener(index);
}
@@ -793,22 +793,22 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final void addMouseListener(MouseListener l) {
+ public final void addMouseListener(final MouseListener l) {
window.addMouseListener(l);
}
@Override
- public final void addMouseListener(int index, MouseListener l) {
+ public final void addMouseListener(final int index, final MouseListener l) {
window.addMouseListener(index, l);
}
@Override
- public final void removeMouseListener(MouseListener l) {
+ public final void removeMouseListener(final MouseListener l) {
window.removeMouseListener(l);
}
@Override
- public final MouseListener getMouseListener(int index) {
+ public final MouseListener getMouseListener(final int index) {
return window.getMouseListener(index);
}
@@ -818,7 +818,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public void setDefaultGesturesEnabled(boolean enable) {
+ public void setDefaultGesturesEnabled(final boolean enable) {
window.setDefaultGesturesEnabled(enable);
}
@Override
@@ -826,27 +826,27 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
return window.areDefaultGesturesEnabled();
}
@Override
- public final void addGestureHandler(GestureHandler gh) {
+ public final void addGestureHandler(final GestureHandler gh) {
window.addGestureHandler(gh);
}
@Override
- public final void addGestureHandler(int index, GestureHandler gh) {
+ public final void addGestureHandler(final int index, final GestureHandler gh) {
window.addGestureHandler(index, gh);
}
@Override
- public final void removeGestureHandler(GestureHandler gh) {
+ public final void removeGestureHandler(final GestureHandler gh) {
window.removeGestureHandler(gh);
}
@Override
- public final void addGestureListener(GestureHandler.GestureListener gl) {
+ public final void addGestureListener(final GestureHandler.GestureListener gl) {
window.addGestureListener(-1, gl);
}
@Override
- public final void addGestureListener(int index, GestureHandler.GestureListener gl) {
+ public final void addGestureListener(final int index, final GestureHandler.GestureListener gl) {
window.addGestureListener(index, gl);
}
@Override
- public final void removeGestureListener(GestureHandler.GestureListener gl) {
+ public final void removeGestureListener(final GestureHandler.GestureListener gl) {
window.removeGestureListener(gl);
}
@@ -881,22 +881,22 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
}
@Override
- public final void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public final void removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
window.removeSurfaceUpdatedListener(l);
}
@Override
- public final void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public final void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
window.addSurfaceUpdatedListener(l);
}
@Override
- public final void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
+ public final void addSurfaceUpdatedListener(final int index, final SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
window.addSurfaceUpdatedListener(index, l);
}
@Override
- public final void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+ public final void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
window.surfaceUpdated(updater, ns, when);
}
@@ -930,7 +930,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
/**
* A most simple JOGL AWT test entry
*/
- public static void main(String args[]) {
+ public static void main(final String args[]) {
final boolean forceES2;
final boolean forceES3;
final boolean forceGL3;
@@ -984,45 +984,45 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
final GLCapabilitiesImmutable caps = new GLCapabilities( glp );
System.err.println("Requesting: "+caps);
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
glWindow.setSize(128, 128);
glWindow.addGLEventListener(new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
+ public void init(final GLAutoDrawable drawable) {
+ final GL gl = drawable.getGL();
System.err.println(JoglVersion.getGLInfo(gl, null));
System.err.println("Requested: "+drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities());
System.err.println("Chosen : "+drawable.getChosenGLCapabilities());
System.err.println("GL impl. class "+gl.getClass().getName());
if( gl.isGL4ES3() ) {
- GL4ES3 _gl = gl.getGL4ES3();
+ final GL4ES3 _gl = gl.getGL4ES3();
System.err.println("GL4ES3 retrieved, impl. class "+_gl.getClass().getName());
}
if( gl.isGL3() ) {
- GL3 _gl = gl.getGL3();
+ final GL3 _gl = gl.getGL3();
System.err.println("GL3 retrieved, impl. class "+_gl.getClass().getName());
}
if( gl.isGLES3() ) {
- GLES3 _gl = gl.getGLES3();
+ final GLES3 _gl = gl.getGLES3();
System.err.println("GLES3 retrieved, impl. class "+_gl.getClass().getName());
}
if( gl.isGLES2() ) {
- GLES2 _gl = gl.getGLES2();
+ final GLES2 _gl = gl.getGLES2();
System.err.println("GLES2 retrieved, impl. class "+_gl.getClass().getName());
}
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
});
diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
index 674d467f9..76af2d0ec 100644
--- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
+++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
@@ -121,7 +121,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
* @param style additional styles to SWT#NO_BACKGROUND
* @param child optional preassigned {@link #Window}, maybe null
*/
- public NewtCanvasSWT(final Composite parent, final int style, Window child) {
+ public NewtCanvasSWT(final Composite parent, final int style, final Window child) {
super(parent, style | SWT.NO_BACKGROUND);
SWTAccessor.setRealized(this, true);
@@ -138,7 +138,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
final Listener listener = new Listener () {
@Override
- public void handleEvent (Event event) {
+ public void handleEvent (final Event event) {
switch (event.type) {
case SWT.Paint:
if( DEBUG ) {
@@ -339,7 +339,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
}
@Override
- public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+ public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
return newtChildCloseOp = op; // TODO: implement ?!
}
@@ -392,11 +392,11 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
}
@Override
- public boolean setParent(Composite parent) {
+ public boolean setParent(final Composite parent) {
return super.setParent(parent);
}
- /* package */ void configureNewtChild(boolean attach) {
+ /* package */ void configureNewtChild(final boolean attach) {
newtChildReady = attach;
if( null != newtChild ) {
newtChild.setKeyboardFocusHandler(null);
@@ -409,7 +409,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
}
}
- void reparentWindow(boolean add) {
+ void reparentWindow(final boolean add) {
if( null == newtChild ) {
return; // nop
}
@@ -469,7 +469,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
private final long nativeWindowHandle;
private final InsetsImmutable insets; // only required to allow proper client position calculation on OSX
- public SWTNativeWindow(AbstractGraphicsConfiguration config, long nativeWindowHandle) {
+ public SWTNativeWindow(final AbstractGraphicsConfiguration config, final long nativeWindowHandle) {
this.config = config;
this.nativeWindowHandle = nativeWindowHandle;
if( SWTAccessor.isOSX ) {
@@ -503,14 +503,14 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
}
@Override
- public void addSurfaceUpdatedListener(SurfaceUpdatedListener l) { }
+ public void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) { }
@Override
- public void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
+ public void addSurfaceUpdatedListener(final int index, final SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
}
@Override
- public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) { }
+ public void removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) { }
@Override
public long getSurfaceHandle() {
@@ -566,7 +566,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
}
@Override
- public void surfaceUpdated(Object updater, NativeSurface ns, long when) { }
+ public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) { }
@Override
public void destroy() { }
@@ -597,7 +597,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
}
@Override
- public Point getLocationOnScreen(Point point) {
+ public Point getLocationOnScreen(final Point point) {
final Point los; // client window location on screen
if( SWTAccessor.isOSX ) {
// let getLOS provide the point where the child window may be placed
@@ -625,10 +625,10 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
}
};
- static String newtWinHandleToHexString(Window w) {
+ static String newtWinHandleToHexString(final Window w) {
return null != w ? toHexString(w.getWindowHandle()) : "nil";
}
- static String toHexString(long l) {
+ static String toHexString(final long l) {
return "0x"+Long.toHexString(l);
}
}
diff --git a/src/newt/classes/com/jogamp/newt/util/MainThread.java b/src/newt/classes/com/jogamp/newt/util/MainThread.java
index 049320b21..80da1ce3b 100644
--- a/src/newt/classes/com/jogamp/newt/util/MainThread.java
+++ b/src/newt/classes/com/jogamp/newt/util/MainThread.java
@@ -45,6 +45,7 @@ import java.util.List;
import javax.media.nativewindow.NativeWindowFactory;
import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.ReflectionUtil;
import jogamp.newt.Debug;
@@ -104,7 +105,7 @@ public class MainThread {
NativeWindowFactory.initSingleton();
NEWTJNILibLoader.loadNEWT();
HINT_USE_MAIN_THREAD = !NativeWindowFactory.isAWTAvailable() ||
- Debug.getBooleanProperty("newt.MainThread.force", true);
+ PropertyAccess.getBooleanProperty("newt.MainThread.force", true);
osType = Platform.getOSType();
isMacOSX = osType == Platform.OSType.MACOS;
rootThreadGroup = getRootThreadGroup();
@@ -125,7 +126,7 @@ public class MainThread {
return rootGroup;
}
- private static final Thread[] getAllThreads(int[] count) {
+ private static final Thread[] getAllThreads(final int[] count) {
int tn;
Thread[] threads = new Thread[ rootThreadGroup.activeCount() ];
while ( ( tn = rootThreadGroup.enumerate( threads, true ) ) == threads.length ) {
@@ -135,9 +136,9 @@ public class MainThread {
return threads;
}
private static final List<Thread> getNonDaemonThreads() {
- List<Thread> res = new ArrayList<Thread>();
- int[] tn = { 0 };
- Thread[] threads = getAllThreads(tn);
+ final List<Thread> res = new ArrayList<Thread>();
+ final int[] tn = { 0 };
+ final Thread[] threads = getAllThreads(tn);
for(int i = tn[0] - 1; i >= 0; i--) {
final Thread thread = threads[i];
try {
@@ -145,16 +146,16 @@ public class MainThread {
res.add(thread);
if(DEBUG) System.err.println("XXX0: "+thread.getName()+", "+thread);
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
}
}
return res;
}
- private static final int getNonDaemonThreadCount(List<Thread> ignoreThreads) {
+ private static final int getNonDaemonThreadCount(final List<Thread> ignoreThreads) {
int res = 0;
- int[] tn = { 0 };
- Thread[] threads = getAllThreads(tn);
+ final int[] tn = { 0 };
+ final Thread[] threads = getAllThreads(tn);
for(int i = tn[0] - 1; i >= 0; i--) {
final Thread thread = threads[i];
@@ -163,7 +164,7 @@ public class MainThread {
res++;
if(DEBUG) System.err.println("MainAction.run(): non daemon thread: "+thread);
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
}
}
@@ -177,7 +178,7 @@ public class MainThread {
private final Method mainClassMain;
private List<Thread> nonDaemonThreadsAtStart;
- public UserApp(String mainClassName, String[] mainClassArgs) throws SecurityException, NoSuchMethodException, ClassNotFoundException {
+ public UserApp(final String mainClassName, final String[] mainClassArgs) throws SecurityException, NoSuchMethodException, ClassNotFoundException {
super();
this.mainClassName=mainClassName;
this.mainClassArgs=mainClassArgs;
@@ -204,10 +205,10 @@ public class MainThread {
try {
if(DEBUG) System.err.println("MainAction.run(): "+Thread.currentThread().getName()+" invoke "+mainClassName);
mainClassMain.invoke(null, new Object[] { mainClassArgs } );
- } catch (InvocationTargetException ite) {
+ } catch (final InvocationTargetException ite) {
ite.getTargetException().printStackTrace();
return;
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
return;
}
@@ -219,7 +220,7 @@ public class MainThread {
if(DEBUG) System.err.println("MainAction.run(): post user app, non daemon threads alive: "+ndtr);
try {
Thread.sleep(1000);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -237,7 +238,7 @@ public class MainThread {
if(DEBUG) {
System.err.println("MainAction.main(): "+Thread.currentThread()+" MainAction fin - stopNSApp.X");
}
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
} else {
@@ -253,7 +254,7 @@ public class MainThread {
* @throws ClassNotFoundException
* @throws NoSuchMethodException
* @throws SecurityException */
- public static void main(String[] args) throws SecurityException, NoSuchMethodException, ClassNotFoundException {
+ public static void main(final String[] args) throws SecurityException, NoSuchMethodException, ClassNotFoundException {
final Thread cur = Thread.currentThread();
useMainThread = HINT_USE_MAIN_THREAD;
@@ -273,8 +274,8 @@ public class MainThread {
return;
}
- String mainClassName=args[0];
- String[] mainClassArgs=new String[args.length-1];
+ final String mainClassName=args[0];
+ final String[] mainClassArgs=new String[args.length-1];
if(args.length>1) {
System.arraycopy(args, 1, mainClassArgs, 0, args.length-1);
}
@@ -289,7 +290,7 @@ public class MainThread {
if ( useMainThread ) {
try {
cur.setName(cur.getName()+"-MainThread");
- } catch (Exception e) {}
+ } catch (final Exception e) {}
// dispatch user's main thread ..
mainAction.start();
@@ -301,7 +302,7 @@ public class MainThread {
}
ReflectionUtil.callStaticMethod(MACOSXDisplayClassName, "runNSApplication",
null, null, MainThread.class.getClassLoader());
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
diff --git a/src/newt/classes/com/jogamp/newt/util/MonitorModeUtil.java b/src/newt/classes/com/jogamp/newt/util/MonitorModeUtil.java
index e019068f5..e5f8ff17c 100644
--- a/src/newt/classes/com/jogamp/newt/util/MonitorModeUtil.java
+++ b/src/newt/classes/com/jogamp/newt/util/MonitorModeUtil.java
@@ -43,11 +43,11 @@ import javax.media.nativewindow.util.SurfaceSize;
*/
public class MonitorModeUtil {
- public static int getIndex(List<MonitorMode> monitorModes, MonitorMode search) {
+ public static int getIndex(final List<MonitorMode> monitorModes, final MonitorMode search) {
return monitorModes.indexOf(search);
}
- public static int getIndexByHashCode(List<MonitorMode> monitorModes, MonitorMode search) {
+ public static int getIndexByHashCode(final List<MonitorMode> monitorModes, final MonitorMode search) {
if( null!=monitorModes && monitorModes.size()>0 ) {
for (int i=0; i<monitorModes.size(); i++) {
if ( search.hashCode() == monitorModes.get(i).hashCode() ) {
@@ -58,7 +58,7 @@ public class MonitorModeUtil {
return -1;
}
- public static MonitorMode getByNativeSizeRateIdAndRotation(List<MonitorMode> monitorModes, MonitorMode.SizeAndRRate sizeAndRate, int modeId, int rotation) {
+ public static MonitorMode getByNativeSizeRateIdAndRotation(final List<MonitorMode> monitorModes, final MonitorMode.SizeAndRRate sizeAndRate, final int modeId, final int rotation) {
if( null!=monitorModes && monitorModes.size()>0 ) {
for (int i=0; i<monitorModes.size(); i++) {
final MonitorMode mode = monitorModes.get(i);
@@ -71,7 +71,7 @@ public class MonitorModeUtil {
}
/** Sort the given {@link MonitorMode} collection w/ {@link MonitorMode#compareTo(MonitorMode)} function. */
- public static void sort(List<MonitorMode> monitorModes, boolean ascendingOrder) {
+ public static void sort(final List<MonitorMode> monitorModes, final boolean ascendingOrder) {
if( ascendingOrder ) {
Collections.sort(monitorModes);
} else {
@@ -85,7 +85,7 @@ public class MonitorModeUtil {
* @param surfaceSize
* @return modes with exact {@link SurfaceSize}. May return zero sized list for non.
*/
- public static List<MonitorMode> filterBySurfaceSize(List<MonitorMode> monitorModes, SurfaceSize surfaceSize) {
+ public static List<MonitorMode> filterBySurfaceSize(final List<MonitorMode> monitorModes, final SurfaceSize surfaceSize) {
final List<MonitorMode> out = new ArrayList<MonitorMode>();
if( null!=monitorModes && monitorModes.size()>0 ) {
for (int i=0; null!=monitorModes && i<monitorModes.size(); i++) {
@@ -104,7 +104,7 @@ public class MonitorModeUtil {
* @param rotation
* @return modes with exact rotation. May return zero sized list for non.
*/
- public static List<MonitorMode> filterByRotation(List<MonitorMode> monitorModes, int rotation) {
+ public static List<MonitorMode> filterByRotation(final List<MonitorMode> monitorModes, final int rotation) {
final List<MonitorMode> out = new ArrayList<MonitorMode>();
if( null!=monitorModes && monitorModes.size()>0 ) {
for (int i=0; null!=monitorModes && i<monitorModes.size(); i++) {
@@ -123,7 +123,7 @@ public class MonitorModeUtil {
* @param bitsPerPixel
* @return modes with exact bpp. May return zero sized list for non.
*/
- public static List<MonitorMode> filterByBpp(List<MonitorMode> monitorModes, int bitsPerPixel) {
+ public static List<MonitorMode> filterByBpp(final List<MonitorMode> monitorModes, final int bitsPerPixel) {
final List<MonitorMode> out = new ArrayList<MonitorMode>();
if( null!=monitorModes && monitorModes.size()>0 ) {
for (int i=0; null!=monitorModes && i<monitorModes.size(); i++) {
@@ -142,7 +142,7 @@ public class MonitorModeUtil {
* @param flags
* @return modes with exact flags. May return zero sized list for non.
*/
- public static List<MonitorMode> filterByFlags(List<MonitorMode> monitorModes, int flags) {
+ public static List<MonitorMode> filterByFlags(final List<MonitorMode> monitorModes, final int flags) {
final List<MonitorMode> out = new ArrayList<MonitorMode>();
if( null!=monitorModes && monitorModes.size()>0 ) {
for (int i=0; null!=monitorModes && i<monitorModes.size(); i++) {
@@ -160,7 +160,7 @@ public class MonitorModeUtil {
* @param resolution in pixel units
* @return modes with nearest resolution, or matching ones. May return zero sized list for non.
*/
- public static List<MonitorMode> filterByResolution(List<MonitorMode> monitorModes, DimensionImmutable resolution) {
+ public static List<MonitorMode> filterByResolution(final List<MonitorMode> monitorModes, final DimensionImmutable resolution) {
final List<MonitorMode> out = new ArrayList<MonitorMode>();
if( null!=monitorModes && monitorModes.size()>0 ) {
final int resolution_sq = resolution.getHeight()*resolution.getWidth();
@@ -192,14 +192,14 @@ public class MonitorModeUtil {
* @param refreshRate
* @return modes with nearest refreshRate, or matching ones. May return zero sized list for non.
*/
- public static List<MonitorMode> filterByRate(List<MonitorMode> monitorModes, float refreshRate) {
+ public static List<MonitorMode> filterByRate(final List<MonitorMode> monitorModes, final float refreshRate) {
final List<MonitorMode> out = new ArrayList<MonitorMode>();
if( null!=monitorModes && monitorModes.size()>0 ) {
float mode_dr = Float.MAX_VALUE;
int mode_dr_idx = -1;
for (int i=0; null!=monitorModes && i<monitorModes.size(); i++) {
final MonitorMode mode = monitorModes.get(i);
- float dr = Math.abs(refreshRate - mode.getRefreshRate());
+ final float dr = Math.abs(refreshRate - mode.getRefreshRate());
if(dr<mode_dr) {
mode_dr = dr;
mode_dr_idx = i;
@@ -220,7 +220,7 @@ public class MonitorModeUtil {
* @param monitorModes
* @return modes with highest available bpp (color depth). May return zero sized list for non.
*/
- public static List<MonitorMode> getHighestAvailableBpp(List<MonitorMode> monitorModes) {
+ public static List<MonitorMode> getHighestAvailableBpp(final List<MonitorMode> monitorModes) {
if( null!=monitorModes && monitorModes.size()>0 ) {
int highest = -1;
for (int i=0; null!=monitorModes && i < monitorModes.size(); i++) {
@@ -240,7 +240,7 @@ public class MonitorModeUtil {
* @param monitorModes
* @return modes with highest available refresh rate. May return zero sized list for non.
*/
- public static List<MonitorMode> getHighestAvailableRate(List<MonitorMode> monitorModes) {
+ public static List<MonitorMode> getHighestAvailableRate(final List<MonitorMode> monitorModes) {
if( null!=monitorModes && monitorModes.size()>0 ) {
float highest = -1;
for (int i=0; null!=monitorModes && i < monitorModes.size(); i++) {
diff --git a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java
index 459db11b2..9a3e79a8f 100644
--- a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java
+++ b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java
@@ -107,7 +107,7 @@ public class JOGLNewtApplet3Run implements Applet3 {
PointImmutable upstreamLocOnScreen;
NativeWindow browserWin;
- final String getParameter(String name) {
+ final String getParameter(final String name) {
return ctx.getParameter(name);
}
@@ -132,7 +132,7 @@ public class JOGLNewtApplet3Run implements Applet3 {
glHeight = JOGLNewtAppletBase.str2Int(getParameter("gl_height"), glHeight);
glUndecorated = JOGLNewtAppletBase.str2Bool(getParameter("gl_undecorated"), glUndecorated);
glAlwaysOnTop = JOGLNewtAppletBase.str2Bool(getParameter("gl_alwaysontop"), glAlwaysOnTop);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
glStandalone = Integer.MAX_VALUE>glXd && Integer.MAX_VALUE>glYd && Integer.MAX_VALUE>glWidth && Integer.MAX_VALUE>glHeight;
@@ -176,14 +176,14 @@ public class JOGLNewtApplet3Run implements Applet3 {
return new NativeWindowDownstream() {
@Override
- public void setVisible(boolean v) {
+ public void setVisible(final boolean v) {
if( null != glWindow ) {
glWindow.setVisible(v);
}
}
@Override
- public void setSize(int width, int height) {
+ public void setSize(final int width, final int height) {
upstreamSizePosHook.setWinSize(width, height);
if( null != glWindow ) {
glWindow.setSize(width, height);
@@ -226,7 +226,7 @@ public class JOGLNewtApplet3Run implements Applet3 {
}
@Override
- public void notifyPositionChanged(NativeWindowUpstream nw) {
+ public void notifyPositionChanged(final NativeWindowUpstream nw) {
upstreamSizePosHook.setWinPos(nw.getX(), nw.getY());
if( null != glWindow ) {
glWindow.setPosition(nw.getX(), nw.getY());
@@ -236,7 +236,7 @@ public class JOGLNewtApplet3Run implements Applet3 {
}
@Override
- public void init(Applet3Context ctx) {
+ public void init(final Applet3Context ctx) {
if(DEBUG) {
System.err.println("JOGLNewtApplet1Run.init() START - "+currentThreadName());
}
@@ -255,7 +255,7 @@ public class JOGLNewtApplet3Run implements Applet3 {
glTrace = JOGLNewtAppletBase.str2Bool(getParameter("gl_trace"), glTrace);
glNoDefaultKeyListener = JOGLNewtAppletBase.str2Bool(getParameter("gl_nodefaultkeyListener"), glNoDefaultKeyListener);
glCloseable = JOGLNewtAppletBase.str2Bool(getParameter("gl_closeable"), glCloseable);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
if(null==glEventListenerClazzName) {
@@ -282,7 +282,7 @@ public class JOGLNewtApplet3Run implements Applet3 {
glWindow.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);
glWindow.setDefaultCloseOperation(glCloseable ? WindowClosingMode.DISPOSE_ON_CLOSE : WindowClosingMode.DO_NOTHING_ON_CLOSE);
base.init(glWindow);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
if(DEBUG) {
diff --git a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java
index eee8ab23e..d40e09d96 100644
--- a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java
+++ b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java
@@ -54,6 +54,7 @@ import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.event.WindowListener;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
/** Shows how to deploy an applet using JOGL. This demo must be
@@ -76,12 +77,12 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
boolean isValid = false;
NativeWindow parentWin;
- public JOGLNewtAppletBase(String glEventListenerClazzName,
- int glSwapInterval,
- boolean noDefaultKeyListener,
- boolean glClosable,
- boolean glDebug,
- boolean glTrace) {
+ public JOGLNewtAppletBase(final String glEventListenerClazzName,
+ final int glSwapInterval,
+ final boolean noDefaultKeyListener,
+ final boolean glClosable,
+ final boolean glDebug,
+ final boolean glTrace) {
this.glEventListenerClazzName=glEventListenerClazzName;
this.glSwapInterval=glSwapInterval;
@@ -96,19 +97,19 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
public Animator getGLAnimator() { return glAnimator; }
public boolean isValid() { return isValid; }
- public static boolean str2Bool(String str, boolean def) {
+ public static boolean str2Bool(final String str, final boolean def) {
if(null==str) return def;
try {
return Boolean.valueOf(str).booleanValue();
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return def;
}
- public static int str2Int(String str, int def) {
+ public static int str2Int(final String str, final int def) {
if(null==str) return def;
try {
return Integer.parseInt(str);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return def;
}
@@ -123,14 +124,14 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
Class<?> clazz = null;
try {
clazz = Class.forName(clazzName, false, cl);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
}
return clazz;
}
});
instance = clazz.newInstance();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
throw new RuntimeException("Error while instantiating demo: "+clazzName);
}
@@ -143,28 +144,28 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
return (GLEventListener) instance;
}
- public static boolean setField(Object instance, String fieldName, Object value) {
+ public static boolean setField(final Object instance, final String fieldName, final Object value) {
try {
- Field f = instance.getClass().getField(fieldName);
+ final Field f = instance.getClass().getField(fieldName);
if(f.getType().isInstance(value)) {
f.set(instance, value);
return true;
} else {
System.out.println(instance.getClass()+" '"+fieldName+"' field not assignable with "+value.getClass()+", it's a: "+f.getType());
}
- } catch (NoSuchFieldException nsfe) {
+ } catch (final NoSuchFieldException nsfe) {
System.out.println(instance.getClass()+" has no '"+fieldName+"' field");
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
}
return false;
}
- public void init(GLWindow glWindow) {
+ public void init(final GLWindow glWindow) {
init(Thread.currentThread().getThreadGroup(), glWindow);
}
- public void init(ThreadGroup tg, final GLWindow glWindow) {
+ public void init(final ThreadGroup tg, final GLWindow glWindow) {
isValid = false;
this.glWindow = glWindow;
glEventListener = createInstance(glEventListenerClazzName);
@@ -200,12 +201,12 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
// glAnimator = new FPSAnimator(canvas, 60);
glAnimator = new Animator();
- glAnimator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD); // No AWT thread involved!
+ glAnimator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD); // No AWT thread involved!
glAnimator.setThreadGroup(tg);
glAnimator.add(glWindow);
glAnimator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, null);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
isValid = true;
@@ -214,7 +215,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
private final WindowListener reparentHomeListener = new WindowAdapter() {
// Closing action: back to parent!
@Override
- public void windowDestroyNotify(WindowEvent e) {
+ public void windowDestroyNotify(final WindowEvent e) {
if( isValid() && WindowClosingMode.DO_NOTHING_ON_CLOSE == glWindow.getDefaultCloseOperation() &&
null == glWindow.getParent() && null != parentWin && 0 != parentWin.getWindowHandle() )
{
@@ -239,7 +240,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
final Display disp = glWindow.getScreen().getDisplay();
try {
pointerIconTest = disp.createPointerIcon(res, 8, 8);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -275,20 +276,20 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
// ***********************************************************************************
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
GL _gl = drawable.getGL();
if(glDebug) {
try {
_gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", null, _gl, null) );
- } catch (Exception e) {e.printStackTrace();}
+ } catch (final Exception e) {e.printStackTrace();}
}
if(glTrace) {
try {
// Trace ..
_gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, _gl, new Object[] { System.err } ) );
- } catch (Exception e) {e.printStackTrace();}
+ } catch (final Exception e) {e.printStackTrace();}
}
if(glSwapInterval>=0) {
@@ -296,13 +297,13 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
}
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
// ***********************************************************************************
@@ -310,7 +311,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
// ***********************************************************************************
@Override
- public void keyPressed(KeyEvent e) {
+ public void keyPressed(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
}
@@ -384,7 +385,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
}
@Override
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
}
}
diff --git a/src/newt/classes/com/jogamp/newt/util/applet/VersionApplet3.java b/src/newt/classes/com/jogamp/newt/util/applet/VersionApplet3.java
index db0e8fc45..1a5c83609 100644
--- a/src/newt/classes/com/jogamp/newt/util/applet/VersionApplet3.java
+++ b/src/newt/classes/com/jogamp/newt/util/applet/VersionApplet3.java
@@ -25,8 +25,8 @@ import com.jogamp.opengl.JoglVersion;
public class VersionApplet3 implements Applet3 {
- public static void main(String[] args) {
- VersionApplet3 va = new VersionApplet3();
+ public static void main(final String[] args) {
+ final VersionApplet3 va = new VersionApplet3();
final NativeWindowDownstream nwc = va.createNativeWindow(null, new NativeWindowUpstream() {
@Override
@@ -50,7 +50,7 @@ public class VersionApplet3 implements Applet3 {
return 0; // default
}
@Override
- public void notifySurfaceUpdated(NativeWindowDownstream swappedWin) {
+ public void notifySurfaceUpdated(final NativeWindowDownstream swappedWin) {
// NOP
}
@Override
@@ -80,14 +80,14 @@ public class VersionApplet3 implements Applet3 {
return new NativeWindowDownstream() {
@Override
- public void setVisible(boolean v) {
+ public void setVisible(final boolean v) {
if( null != canvas ) {
canvas.setVisible(v);
}
}
@Override
- public void setSize(int width, int height) {
+ public void setSize(final int width, final int height) {
if( null != canvas ) {
canvas.setSize(width, height);
}
@@ -129,7 +129,7 @@ public class VersionApplet3 implements Applet3 {
}
@Override
- public void notifyPositionChanged(NativeWindowUpstream nw) {
+ public void notifyPositionChanged(final NativeWindowUpstream nw) {
if( null != canvas ) {
canvas.setPosition(nw.getX(), nw.getY());
}
@@ -138,7 +138,7 @@ public class VersionApplet3 implements Applet3 {
}
@Override
- public void init(Applet3Context ctx) {
+ public void init(final Applet3Context ctx) {
System.err.println("VersionApplet: init() - begin");
canvas.addGLEventListener(new GLInfo());
System.err.println("VersionApplet: init() - end");
@@ -164,8 +164,8 @@ public class VersionApplet3 implements Applet3 {
s = JoglVersion.getInstance().toString();
System.err.println(s);
- GLDrawableFactory factory = GLDrawableFactory.getFactory(canvas.getGLProfile());
- List<GLCapabilitiesImmutable> availCaps = factory.getAvailableCapabilities(null);
+ final GLDrawableFactory factory = GLDrawableFactory.getFactory(canvas.getGLProfile());
+ final List<GLCapabilitiesImmutable> availCaps = factory.getAvailableCapabilities(null);
for(int i=0; i<availCaps.size(); i++) {
s = availCaps.get(i).toString();
System.err.println(s);
@@ -208,19 +208,19 @@ public class VersionApplet3 implements Applet3 {
class GLInfo implements GLEventListener {
@Override
- public void init(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
- String s = JoglVersion.getGLInfo(gl, null).toString();
+ public void init(final GLAutoDrawable drawable) {
+ final GL gl = drawable.getGL();
+ final String s = JoglVersion.getGLInfo(gl, null).toString();
System.err.println(s);
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
}
}
diff --git a/src/newt/classes/jogamp/newt/Debug.java b/src/newt/classes/jogamp/newt/Debug.java
index 7ef2d7ffc..773820c33 100644
--- a/src/newt/classes/jogamp/newt/Debug.java
+++ b/src/newt/classes/jogamp/newt/Debug.java
@@ -63,7 +63,7 @@ public class Debug extends PropertyAccess {
verbose = isPropertyDefined("newt.verbose", true);
debugAll = isPropertyDefined("newt.debug", true);
if (verbose) {
- Package p = Package.getPackage("com.jogamp.newt");
+ final Package p = Package.getPackage("com.jogamp.newt");
System.err.println("NEWT specification version " + p.getSpecificationVersion());
System.err.println("NEWT implementation version " + p.getImplementationVersion());
System.err.println("NEWT implementation vendor " + p.getImplementationVendor());
@@ -81,7 +81,7 @@ public class Debug extends PropertyAccess {
return debugAll;
}
- public static final boolean debug(String subcomponent) {
+ public static final boolean debug(final String subcomponent) {
return debugAll() || isPropertyDefined("newt.debug." + subcomponent, true);
}
}
diff --git a/src/newt/classes/jogamp/newt/DefaultEDTUtil.java b/src/newt/classes/jogamp/newt/DefaultEDTUtil.java
index ae72c8c73..ec5126932 100644
--- a/src/newt/classes/jogamp/newt/DefaultEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/DefaultEDTUtil.java
@@ -63,7 +63,7 @@ public class DefaultEDTUtil implements EDTUtil {
private int start_iter=0;
private static long pollPeriod = EDTUtil.defaultEDTPollPeriod;
- public DefaultEDTUtil(ThreadGroup tg, String name, Runnable dispatchMessages) {
+ public DefaultEDTUtil(final ThreadGroup tg, final String name, final Runnable dispatchMessages) {
this.threadGroup = tg;
this.name=Thread.currentThread().getName()+"-"+name+"-EDT-";
this.dispatchMessages=dispatchMessages;
@@ -77,7 +77,7 @@ public class DefaultEDTUtil implements EDTUtil {
}
@Override
- final public void setPollPeriod(long ms) {
+ final public void setPollPeriod(final long ms) {
pollPeriod = ms;
}
@@ -141,7 +141,7 @@ public class DefaultEDTUtil implements EDTUtil {
}
@Override
- public final boolean invokeStop(boolean wait, Runnable task) {
+ public final boolean invokeStop(final boolean wait, final Runnable task) {
if(DEBUG) {
System.err.println(Thread.currentThread()+": Default-EDT.invokeStop wait "+wait);
Thread.dumpStack();
@@ -149,7 +149,7 @@ public class DefaultEDTUtil implements EDTUtil {
return invokeImpl(wait, task, true /* stop */, false /* provokeError */);
}
- public final boolean invokeAndWaitError(Runnable task) {
+ public final boolean invokeAndWaitError(final Runnable task) {
if(DEBUG) {
System.err.println(Thread.currentThread()+": Default-EDT.invokeAndWaitError");
Thread.dumpStack();
@@ -158,7 +158,7 @@ public class DefaultEDTUtil implements EDTUtil {
}
@Override
- public final boolean invoke(boolean wait, Runnable task) {
+ public final boolean invoke(final boolean wait, final Runnable task) {
return invokeImpl(wait, task, false /* stop */, false /* provokeError */);
}
@@ -167,7 +167,7 @@ public class DefaultEDTUtil implements EDTUtil {
public void run() { }
};
- private final boolean invokeImpl(boolean wait, Runnable task, boolean stop, boolean provokeError) {
+ private final boolean invokeImpl(boolean wait, Runnable task, final boolean stop, final boolean provokeError) {
Throwable throwable = null;
RunnableTask rTask = null;
final Object rTaskLock = new Object();
@@ -235,7 +235,7 @@ public class DefaultEDTUtil implements EDTUtil {
if( wait ) {
try {
rTaskLock.wait(); // free lock, allow execution of rTask
- } catch (InterruptedException ie) {
+ } catch (final InterruptedException ie) {
throwable = ie;
}
if(null==throwable) {
@@ -271,7 +271,7 @@ public class DefaultEDTUtil implements EDTUtil {
try {
_edt.tasks.notifyAll();
_edt.tasks.wait();
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -286,7 +286,7 @@ public class DefaultEDTUtil implements EDTUtil {
while( edt.isRunning ) {
try {
edtLock.wait();
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -302,7 +302,7 @@ public class DefaultEDTUtil implements EDTUtil {
volatile boolean isRunning = false;
final ArrayList<RunnableTask> tasks = new ArrayList<RunnableTask>(); // one shot tasks
- public NEDT(ThreadGroup tg, String name) {
+ public NEDT(final ThreadGroup tg, final String name) {
super(tg, name);
}
@@ -349,7 +349,7 @@ public class DefaultEDTUtil implements EDTUtil {
if(!shouldStop && tasks.size()==0) {
try {
tasks.wait(pollPeriod);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -379,7 +379,7 @@ public class DefaultEDTUtil implements EDTUtil {
}
}
} while(!shouldStop) ;
- } catch (Throwable t) {
+ } catch (final Throwable t) {
// handle errors ..
shouldStop = true;
if(t instanceof RuntimeException) {
diff --git a/src/newt/classes/jogamp/newt/DisplayImpl.java b/src/newt/classes/jogamp/newt/DisplayImpl.java
index 952e611f2..84ce45238 100644
--- a/src/newt/classes/jogamp/newt/DisplayImpl.java
+++ b/src/newt/classes/jogamp/newt/DisplayImpl.java
@@ -142,7 +142,7 @@ public abstract class DisplayImpl extends Display {
System.err.println("createPointerIconPNG.0: "+res[0]);
}
}
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
} } );
@@ -199,7 +199,7 @@ public abstract class DisplayImpl extends Display {
res[0] = new PointerIconImpl(DisplayImpl.this, fpixelrect, new Point(hotX, hotY), handle);
}
}
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
} } );
@@ -222,7 +222,7 @@ public abstract class DisplayImpl extends Display {
* @param hotY the PointerIcon's hot-spot x-coord
* @return if successful a valid handle (not null), otherwise null.
*/
- protected final long createPointerIconImplChecked(PixelFormat pixelformat, int width, int height, final ByteBuffer pixels, final int hotX, final int hotY) {
+ protected final long createPointerIconImplChecked(final PixelFormat pixelformat, final int width, final int height, final ByteBuffer pixels, final int hotX, final int hotY) {
if( getNativePointerIconPixelFormat() != pixelformat ) {
throw new IllegalArgumentException("Pixelformat no "+getNativePointerIconPixelFormat()+", but "+pixelformat);
}
@@ -243,17 +243,17 @@ public abstract class DisplayImpl extends Display {
* @param hotY the PointerIcon's hot-spot x-coord
* @return if successful a valid handle (not null), otherwise null.
*/
- protected long createPointerIconImpl(PixelFormat pixelformat, int width, int height, final ByteBuffer pixels, final int hotX, final int hotY) {
+ protected long createPointerIconImpl(final PixelFormat pixelformat, final int width, final int height, final ByteBuffer pixels, final int hotX, final int hotY) {
return 0;
}
/** Executed from EDT! */
- protected void destroyPointerIconImpl(final long displayHandle, long piHandle) { }
+ protected void destroyPointerIconImpl(final long displayHandle, final long piHandle) { }
/** Ensure static init has been run. */
/* pp */static void initSingleton() { }
- private static Class<?> getDisplayClass(String type)
+ private static Class<?> getDisplayClass(final String type)
throws ClassNotFoundException
{
final Class<?> displayClass = NewtFactory.getCustomClass(type, "DisplayDriver");
@@ -264,7 +264,7 @@ public abstract class DisplayImpl extends Display {
}
/** Make sure to reuse a Display with the same name */
- public static Display create(String type, String name, final long handle, boolean reuse) {
+ public static Display create(final String type, String name, final long handle, final boolean reuse) {
try {
final Class<?> displayClass = getDisplayClass(type);
final DisplayImpl display = (DisplayImpl) displayClass.newInstance();
@@ -294,13 +294,13 @@ public abstract class DisplayImpl extends Display {
System.err.println("Display.create() NEW: "+display+" "+getThreadName());
}
return display;
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException(e);
}
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
@@ -340,7 +340,7 @@ public abstract class DisplayImpl extends Display {
public void run() {
f_dpy.createNativeImpl();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new NativeWindowException(t);
}
if( null == aDevice ) {
@@ -409,7 +409,7 @@ public abstract class DisplayImpl extends Display {
}
}
- public void runOnEDTIfAvail(boolean wait, final Runnable task) {
+ public void runOnEDTIfAvail(final boolean wait, final Runnable task) {
final EDTUtil _edtUtil = edtUtil;
if( !_edtUtil.isRunning() ) { // start EDT if not running yet
synchronized( this ) {
@@ -516,7 +516,7 @@ public abstract class DisplayImpl extends Display {
}
try {
Thread.sleep( coopSleep < 50 ? coopSleep : 50 );
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
} else {
closeNativeTask.run();
}
@@ -527,7 +527,7 @@ public abstract class DisplayImpl extends Display {
@Override
public synchronized final int addReference() {
if(DEBUG) {
- System.err.println("Display.addReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount+1));
+ System.err.println("Display.addReference() ("+Display.getThreadName()+"): "+refCount+" -> "+(refCount+1));
}
if ( 0 == refCount ) {
createNative();
@@ -542,7 +542,7 @@ public abstract class DisplayImpl extends Display {
@Override
public synchronized final int removeReference() {
if(DEBUG) {
- System.err.println("Display.removeReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount-1));
+ System.err.println("Display.removeReference() ("+Display.getThreadName()+"): "+refCount+" -> "+(refCount-1));
}
refCount--; // could become < 0, in case of manual destruction without actual creation/addReference
if(0>=refCount) {
@@ -587,17 +587,17 @@ public abstract class DisplayImpl extends Display {
public static final String nilString = "nil" ;
- public String validateDisplayName(String name, long handle) {
+ public String validateDisplayName(String name, final long handle) {
if(null==name && 0!=handle) {
name="wrapping-"+toHexString(handle);
}
return ( null == name ) ? nilString : name ;
}
- private static String getFQName(String type, String name, int id) {
+ private static String getFQName(String type, String name, final int id) {
if(null==type) type=nilString;
if(null==name) name=nilString;
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(type);
sb.append("_");
sb.append(name);
@@ -668,7 +668,7 @@ public abstract class DisplayImpl extends Display {
} else {
throw new RuntimeException("Event source not NEWT: "+source.getClass().getName()+", "+source);
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
final RuntimeException re;
if(t instanceof RuntimeException) {
re = (RuntimeException) t;
@@ -689,7 +689,7 @@ public abstract class DisplayImpl extends Display {
return;
}
dispatchMessage(event);
- } catch (RuntimeException re) {
+ } catch (final RuntimeException re) {
if( eventTask.isCallerWaiting() ) {
// propagate exception to caller
eventTask.setException(re);
@@ -733,7 +733,7 @@ public abstract class DisplayImpl extends Display {
dispatchMessagesNative();
}
- public void enqueueEvent(boolean wait, NEWTEvent e) {
+ public void enqueueEvent(final boolean wait, final NEWTEvent e) {
final EDTUtil _edtUtil = edtUtil;
if( !_edtUtil.isRunning() ) {
// oops .. we are already dead
@@ -761,7 +761,7 @@ public abstract class DisplayImpl extends Display {
if( wait ) {
try {
lock.wait();
- } catch (InterruptedException ie) {
+ } catch (final InterruptedException ie) {
throw new RuntimeException(ie);
}
if( null != eTask.getException() ) {
@@ -774,7 +774,7 @@ public abstract class DisplayImpl extends Display {
public interface DisplayRunnable<T> {
T run(long dpy);
}
- public static final <T> T runWithLockedDevice(AbstractGraphicsDevice device, DisplayRunnable<T> action) {
+ public static final <T> T runWithLockedDevice(final AbstractGraphicsDevice device, final DisplayRunnable<T> action) {
T res;
device.lock();
try {
@@ -784,7 +784,7 @@ public abstract class DisplayImpl extends Display {
}
return res;
}
- public final <T> T runWithLockedDisplayDevice(DisplayRunnable<T> action) {
+ public final <T> T runWithLockedDisplayDevice(final DisplayRunnable<T> action) {
final AbstractGraphicsDevice device = getGraphicsDevice();
if(null == device) {
throw new RuntimeException("null device - not initialized: "+this);
diff --git a/src/newt/classes/jogamp/newt/MonitorDeviceImpl.java b/src/newt/classes/jogamp/newt/MonitorDeviceImpl.java
index e9e41a0ef..72300740f 100644
--- a/src/newt/classes/jogamp/newt/MonitorDeviceImpl.java
+++ b/src/newt/classes/jogamp/newt/MonitorDeviceImpl.java
@@ -38,7 +38,7 @@ import com.jogamp.newt.Screen;
public class MonitorDeviceImpl extends MonitorDevice {
- public MonitorDeviceImpl(ScreenImpl screen, int nativeId, DimensionImmutable sizeMM, Rectangle viewportPU, Rectangle viewportWU, MonitorMode currentMode, ArrayHashSet<MonitorMode> supportedModes) {
+ public MonitorDeviceImpl(final ScreenImpl screen, final int nativeId, final DimensionImmutable sizeMM, final Rectangle viewportPU, final Rectangle viewportWU, final MonitorMode currentMode, final ArrayHashSet<MonitorMode> supportedModes) {
super(screen, nativeId, sizeMM, viewportPU, viewportWU, currentMode, supportedModes);
}
@@ -73,7 +73,7 @@ public class MonitorDeviceImpl extends MonitorDevice {
}
@Override
- public final boolean setCurrentMode(MonitorMode mode) {
+ public final boolean setCurrentMode(final MonitorMode mode) {
if(Screen.DEBUG) {
System.err.println("Screen.setCurrentMode.0: "+this+" -> "+mode);
}
@@ -132,7 +132,7 @@ public class MonitorDeviceImpl extends MonitorDevice {
}
}
- private final void setCurrentModeValue(MonitorMode currentMode) {
+ private final void setCurrentModeValue(final MonitorMode currentMode) {
this.currentMode = currentMode;
}
diff --git a/src/newt/classes/jogamp/newt/MonitorModeProps.java b/src/newt/classes/jogamp/newt/MonitorModeProps.java
index 74935977c..0fc0da9bc 100644
--- a/src/newt/classes/jogamp/newt/MonitorModeProps.java
+++ b/src/newt/classes/jogamp/newt/MonitorModeProps.java
@@ -157,26 +157,26 @@ public class MonitorModeProps {
}
/** WARNING: must be synchronized with ScreenMode.h, native implementation */
- private static DimensionImmutable streamInResolution(int[] resolutionProperties, int offset) {
- Dimension resolution = new Dimension(resolutionProperties[offset++], resolutionProperties[offset++]);
+ private static DimensionImmutable streamInResolution(final int[] resolutionProperties, int offset) {
+ final Dimension resolution = new Dimension(resolutionProperties[offset++], resolutionProperties[offset++]);
return resolution;
}
/** WARNING: must be synchronized with ScreenMode.h, native implementation */
- private static SurfaceSize streamInSurfaceSize(DimensionImmutable resolution, int[] sizeProperties, int offset) {
- SurfaceSize surfaceSize = new SurfaceSize(resolution, sizeProperties[offset++]);
+ private static SurfaceSize streamInSurfaceSize(final DimensionImmutable resolution, final int[] sizeProperties, int offset) {
+ final SurfaceSize surfaceSize = new SurfaceSize(resolution, sizeProperties[offset++]);
return surfaceSize;
}
/** WARNING: must be synchronized with ScreenMode.h, native implementation */
- private static MonitorMode.SizeAndRRate streamInSizeAndRRate(SurfaceSize surfaceSize, int[] sizeAndRRateProperties, int offset) {
+ private static MonitorMode.SizeAndRRate streamInSizeAndRRate(final SurfaceSize surfaceSize, final int[] sizeAndRRateProperties, int offset) {
final float refreshRate = sizeAndRRateProperties[offset++]/100.0f;
final int flags = sizeAndRRateProperties[offset++];
return new MonitorMode.SizeAndRRate(surfaceSize, refreshRate, flags);
}
/** WARNING: must be synchronized with ScreenMode.h, native implementation */
- private static MonitorMode streamInMonitorMode0(MonitorMode.SizeAndRRate sizeAndRate, int[] modeProperties, int offset) {
+ private static MonitorMode streamInMonitorMode0(final MonitorMode.SizeAndRRate sizeAndRate, final int[] modeProperties, int offset) {
final int id = modeProperties[offset++];
final int rotation = modeProperties[offset++];
return new MonitorMode(id, sizeAndRate, rotation);
@@ -192,8 +192,8 @@ public class MonitorModeProps {
* @return {@link MonitorMode} of the identical (old or new) element in {@link Cache#monitorModes},
* matching the input <code>modeProperties</code>, or null if input could not be processed.
*/
- public static MonitorMode streamInMonitorMode(int[] mode_idx, Cache cache,
- int[] modeProperties, int offset) {
+ public static MonitorMode streamInMonitorMode(final int[] mode_idx, final Cache cache,
+ final int[] modeProperties, int offset) {
final int count = modeProperties[offset];
if(NUM_MONITOR_MODE_PROPERTIES_ALL != count) {
throw new RuntimeException("property count should be "+NUM_MONITOR_MODE_PROPERTIES_ALL+", but is "+count+", len "+(modeProperties.length-offset));
@@ -225,7 +225,7 @@ public class MonitorModeProps {
monitorMode = cache.monitorModes.getOrAdd(monitorMode);
}
if( null != mode_idx && null!=cache) {
- int _modeIdx = cache.monitorModes.indexOf(monitorMode);
+ final int _modeIdx = cache.monitorModes.indexOf(monitorMode);
if( 0 > _modeIdx ) {
throw new InternalError("Invalid index of current unified mode "+monitorMode);
}
@@ -235,8 +235,8 @@ public class MonitorModeProps {
}
/** WARNING: must be synchronized with ScreenMode.h, native implementation */
- public static int[] streamOutMonitorMode (MonitorMode monitorMode) {
- int[] data = new int[NUM_MONITOR_MODE_PROPERTIES_ALL];
+ public static int[] streamOutMonitorMode (final MonitorMode monitorMode) {
+ final int[] data = new int[NUM_MONITOR_MODE_PROPERTIES_ALL];
int idx=0;
data[idx++] = NUM_MONITOR_MODE_PROPERTIES_ALL;
data[idx++] = monitorMode.getSurfaceSize().getResolution().getWidth();
@@ -264,7 +264,7 @@ public class MonitorModeProps {
* @return {@link MonitorDevice} of the identical (old or new) element in {@link Cache#monitorDevices},
* matching the input <code>modeProperties</code>, or null if input could not be processed.
*/
- public static MonitorDevice streamInMonitorDevice(int[] monitor_idx, Cache cache, ScreenImpl screen, int[] monitorProperties, int offset) {
+ public static MonitorDevice streamInMonitorDevice(final int[] monitor_idx, final Cache cache, final ScreenImpl screen, final int[] monitorProperties, int offset) {
// min 11: count, id, ScreenSizeMM[width, height], Viewport[x, y, width, height], currentMonitorModeId, rotation, supportedModeId+
final int count = monitorProperties[offset];
if(MIN_MONITOR_DEVICE_PROPERTIES > count) {
@@ -304,7 +304,7 @@ public class MonitorModeProps {
monitorDevice = cache.monitorDevices.getOrAdd(monitorDevice);
}
if( null != monitor_idx ) {
- int _monitorIdx = cache.monitorDevices.indexOf(monitorDevice);
+ final int _monitorIdx = cache.monitorDevices.indexOf(monitorDevice);
if( 0 > _monitorIdx ) {
throw new InternalError("Invalid index of current unified mode "+monitorDevice);
}
@@ -312,7 +312,7 @@ public class MonitorModeProps {
}
return monitorDevice;
}
- private static MonitorMode getByNativeIdAndRotation(List<MonitorMode> monitorModes, int modeId, int rotation) {
+ private static MonitorMode getByNativeIdAndRotation(final List<MonitorMode> monitorModes, final int modeId, final int rotation) {
if( null!=monitorModes && monitorModes.size()>0 ) {
for (int i=0; i<monitorModes.size(); i++) {
final MonitorMode mode = monitorModes.get(i);
@@ -340,7 +340,7 @@ public class MonitorModeProps {
* @return {@link MonitorDevice} of the identical (old or new) element in {@link Cache#monitorDevices},
* matching the input <code>modeProperties</code>, or null if input could not be processed.
*/
- public static MonitorDevice streamInMonitorDevice(int[] monitor_idx, Cache cache, ScreenImpl screen, ArrayHashSet<MonitorMode> supportedModes, MonitorMode currentMode, int[] monitorProperties, int offset) {
+ public static MonitorDevice streamInMonitorDevice(final int[] monitor_idx, final Cache cache, final ScreenImpl screen, final ArrayHashSet<MonitorMode> supportedModes, final MonitorMode currentMode, final int[] monitorProperties, int offset) {
// min 11: count, id, ScreenSizeMM[width, height], Viewport[x, y, width, height], currentMonitorModeId, rotation, supportedModeId+
final int count = monitorProperties[offset];
if(MIN_MONITOR_DEVICE_PROPERTIES - 1 - NUM_MONITOR_MODE_PROPERTIES != count) {
@@ -362,7 +362,7 @@ public class MonitorModeProps {
monitorDevice = cache.monitorDevices.getOrAdd(monitorDevice);
}
if( null != monitor_idx ) {
- int _monitorIdx = cache.monitorDevices.indexOf(monitorDevice);
+ final int _monitorIdx = cache.monitorDevices.indexOf(monitorDevice);
if( 0 > _monitorIdx ) {
throw new InternalError("Invalid index of current unified mode "+monitorDevice);
}
@@ -372,13 +372,13 @@ public class MonitorModeProps {
}
/** WARNING: must be synchronized with ScreenMode.h, native implementation */
- public static int[] streamOutMonitorDevice (MonitorDevice monitorDevice) {
+ public static int[] streamOutMonitorDevice (final MonitorDevice monitorDevice) {
// min 11: count, id, ScreenSizeMM[width, height], Viewport[x, y, width, height], currentMonitorModeId, rotation, supportedModeId+
- int supportedModeCount = monitorDevice.getSupportedModes().size();
+ final int supportedModeCount = monitorDevice.getSupportedModes().size();
if( 0 == supportedModeCount ) {
throw new RuntimeException("no supported modes: "+monitorDevice);
}
- int[] data = new int[MIN_MONITOR_DEVICE_PROPERTIES + supportedModeCount - 1];
+ final int[] data = new int[MIN_MONITOR_DEVICE_PROPERTIES + supportedModeCount - 1];
int idx=0;
data[idx++] = data.length;
data[idx++] = monitorDevice.getId();
@@ -404,7 +404,7 @@ public class MonitorModeProps {
return data;
}
- public final void swapRotatePair(int rotation, int[] pairs, int offset, int numPairs) {
+ public final void swapRotatePair(final int rotation, final int[] pairs, int offset, final int numPairs) {
if( MonitorMode.ROTATE_0 == rotation || MonitorMode.ROTATE_180 == rotation ) {
// nop
return;
diff --git a/src/newt/classes/jogamp/newt/OffscreenWindow.java b/src/newt/classes/jogamp/newt/OffscreenWindow.java
index 2478b1e5d..749391f1f 100644
--- a/src/newt/classes/jogamp/newt/OffscreenWindow.java
+++ b/src/newt/classes/jogamp/newt/OffscreenWindow.java
@@ -88,7 +88,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
}
@Override
- public void setSurfaceHandle(long handle) {
+ public void setSurfaceHandle(final long handle) {
surfaceHandle = handle ;
}
@@ -98,27 +98,27 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
}
@Override
- protected void requestFocusImpl(boolean reparented) {
+ protected void requestFocusImpl(final boolean reparented) {
}
@Override
- public void setPosition(int x, int y) {
+ public void setPosition(final int x, final int y) {
// nop
}
@Override
- public boolean setFullscreen(boolean fullscreen) {
+ public boolean setFullscreen(final boolean fullscreen) {
return false; // nop
}
@Override
- public boolean setFullscreen(List<MonitorDevice> monitors) {
+ public boolean setFullscreen(final List<MonitorDevice> monitors) {
return false; // nop
}
@Override
- protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+ protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final int flags) {
sizeChanged(false, width, height, false);
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
@@ -135,7 +135,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
}
@Override
- public Point getLocationOnScreen(Point storage) {
+ public Point getLocationOnScreen(final Point storage) {
if(null!=storage) {
storage.set(0, 0);
return storage;
@@ -144,12 +144,12 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
}
@Override
- protected Point getLocationOnScreenImpl(int x, int y) {
+ protected Point getLocationOnScreenImpl(final int x, final int y) {
return new Point(x,y);
}
@Override
- protected void updateInsetsImpl(Insets insets) {
+ protected void updateInsetsImpl(final Insets insets) {
// nop ..
}
}
diff --git a/src/newt/classes/jogamp/newt/PointerIconImpl.java b/src/newt/classes/jogamp/newt/PointerIconImpl.java
index 840799d55..546a463de 100644
--- a/src/newt/classes/jogamp/newt/PointerIconImpl.java
+++ b/src/newt/classes/jogamp/newt/PointerIconImpl.java
@@ -95,7 +95,7 @@ public class PointerIconImpl implements PointerIcon {
try {
handle = display.createPointerIconImpl(pixelformat, size.getWidth(), size.getHeight(), pixels, hotspot.getX(), hotspot.getY());
return handle;
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
return 0;
}
@@ -121,8 +121,8 @@ public class PointerIconImpl implements PointerIcon {
@Override
public synchronized void destroy() {
- if(DisplayImpl.DEBUG) {
- System.err.println("PointerIcon.destroy: "+this+", "+display+", "+DisplayImpl.getThreadName());
+ if(Display.DEBUG) {
+ System.err.println("PointerIcon.destroy: "+this+", "+display+", "+Display.getThreadName());
}
if( 0 != handle ) {
synchronized(display.pointerIconList) {
@@ -143,7 +143,7 @@ public class PointerIconImpl implements PointerIcon {
handle = 0;
try {
display.destroyPointerIconImpl(dpy, h);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
diff --git a/src/newt/classes/jogamp/newt/ScreenImpl.java b/src/newt/classes/jogamp/newt/ScreenImpl.java
index a31a1e421..e73e153ad 100644
--- a/src/newt/classes/jogamp/newt/ScreenImpl.java
+++ b/src/newt/classes/jogamp/newt/ScreenImpl.java
@@ -45,6 +45,7 @@ import javax.media.nativewindow.util.Rectangle;
import javax.media.nativewindow.util.RectangleImmutable;
import com.jogamp.common.util.ArrayHashSet;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.newt.Display;
import com.jogamp.newt.MonitorDevice;
import com.jogamp.newt.MonitorMode;
@@ -59,7 +60,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
static {
Debug.initSingleton();
- DEBUG_TEST_SCREENMODE_DISABLED = Debug.isPropertyDefined("newt.test.Screen.disableScreenMode", true);
+ DEBUG_TEST_SCREENMODE_DISABLED = PropertyAccess.isPropertyDefined("newt.test.Screen.disableScreenMode", true);
}
public static final int default_sm_bpp = 32;
@@ -89,7 +90,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
private long tCreated; // creationTime
- private static Class<?> getScreenClass(String type) throws ClassNotFoundException
+ private static Class<?> getScreenClass(final String type) throws ClassNotFoundException
{
final Class<?> screenClass = NewtFactory.getCustomClass(type, "ScreenDriver");
if(null==screenClass) {
@@ -98,14 +99,14 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
return screenClass;
}
- public static Screen create(Display display, int idx) {
+ public static Screen create(final Display display, int idx) {
try {
if(!usrSizeQueried) {
synchronized (Screen.class) {
if(!usrSizeQueried) {
usrSizeQueried = true;
- final int w = Debug.getIntProperty("newt.ws.swidth", true, 0);
- final int h = Debug.getIntProperty("newt.ws.sheight", true, 0);
+ final int w = PropertyAccess.getIntProperty("newt.ws.swidth", true, 0);
+ final int h = PropertyAccess.getIntProperty("newt.ws.sheight", true, 0);
if(w>0 && h>0) {
usrSize = new Dimension(w, h);
System.err.println("User screen size "+usrSize);
@@ -114,12 +115,12 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
}
}
synchronized(screenList) {
- Class<?> screenClass = getScreenClass(display.getType());
+ final Class<?> screenClass = getScreenClass(display.getType());
ScreenImpl screen = (ScreenImpl) screenClass.newInstance();
screen.display = (DisplayImpl) display;
idx = screen.validateScreenIndex(idx);
{
- Screen screen0 = ScreenImpl.getLastScreenOf(display, idx, -1);
+ final Screen screen0 = Screen.getLastScreenOf(display, idx, -1);
if(null != screen0) {
if(DEBUG) {
System.err.println("Screen.create() REUSE: "+screen0+" "+Display.getThreadName());
@@ -138,7 +139,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
}
return screen;
}
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException(e);
}
}
@@ -152,7 +153,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
@@ -181,7 +182,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
if(null == aScreen) {
if(DEBUG) {
tCreated = System.nanoTime();
- System.err.println("Screen.createNative() START ("+DisplayImpl.getThreadName()+", "+this+")");
+ System.err.println("Screen.createNative() START ("+Display.getThreadName()+", "+this+")");
} else {
tCreated = 0;
}
@@ -196,7 +197,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
synchronized(screenList) {
screensActive++;
if(DEBUG) {
- System.err.println("Screen.createNative() END ("+DisplayImpl.getThreadName()+", "+this+"), active "+screensActive+", total "+ (System.nanoTime()-tCreated)/1e6 +"ms");
+ System.err.println("Screen.createNative() END ("+Display.getThreadName()+", "+this+"), active "+screensActive+", total "+ (System.nanoTime()-tCreated)/1e6 +"ms");
}
}
ScreenMonitorState.getScreenMonitorState(this.getFQName()).addListener(this);
@@ -210,7 +211,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
screensActive--;
}
if(DEBUG) {
- System.err.println("Screen.destroy() ("+DisplayImpl.getThreadName()+"): active "+screensActive);
+ System.err.println("Screen.destroy() ("+Display.getThreadName()+"): active "+screensActive);
// Thread.dumpStack();
}
}
@@ -227,7 +228,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
@Override
public synchronized final int addReference() throws NativeWindowException {
if(DEBUG) {
- System.err.println("Screen.addReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount+1));
+ System.err.println("Screen.addReference() ("+Display.getThreadName()+"): "+refCount+" -> "+(refCount+1));
// Thread.dumpStack();
}
if ( 0 == refCount ) {
@@ -241,7 +242,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
@Override
public synchronized final int removeReference() {
if(DEBUG) {
- System.err.println("Screen.removeReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount-1));
+ System.err.println("Screen.removeReference() ("+Display.getThreadName()+"): "+refCount+" -> "+(refCount-1));
// Thread.dumpStack();
}
refCount--; // could become < 0, in case of manual destruction without actual creation/addReference
@@ -404,7 +405,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
return null != sms ? sms.getMonitorDevices().getData() : null;
}
- final ScreenMonitorState getScreenMonitorStatus(boolean throwException) {
+ final ScreenMonitorState getScreenMonitorStatus(final boolean throwException) {
final String key = this.getFQName();
final ScreenMonitorState res = ScreenMonitorState.getScreenMonitorState(key);
if(null == res & throwException) {
@@ -414,7 +415,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
}
@Override
- public void monitorModeChangeNotify(MonitorEvent me) {
+ public void monitorModeChangeNotify(final MonitorEvent me) {
if(DEBUG) {
System.err.println("monitorModeChangeNotify @ "+Thread.currentThread().getName()+": "+me);
}
@@ -435,7 +436,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
}
@Override
- public void monitorModeChanged(MonitorEvent me, boolean success) {
+ public void monitorModeChanged(final MonitorEvent me, final boolean success) {
if(success) {
updateNativeMonitorDevicesViewport();
updateVirtualScreenOriginAndSize();
@@ -449,12 +450,12 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
}
@Override
- public synchronized final void addMonitorModeListener(MonitorModeListener sml) {
+ public synchronized final void addMonitorModeListener(final MonitorModeListener sml) {
refMonitorModeListener.add(sml);
}
@Override
- public synchronized final void removeMonitorModeListener(MonitorModeListener sml) {
+ public synchronized final void removeMonitorModeListener(final MonitorModeListener sml) {
refMonitorModeListener.remove(sml);
}
@@ -464,7 +465,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
* @param modeId
* @return
*/
- private final MonitorMode getVirtualMonitorMode(MonitorModeProps.Cache cache, int modeId) {
+ private final MonitorMode getVirtualMonitorMode(final MonitorModeProps.Cache cache, final int modeId) {
final int[] props = new int[MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL];
int i = 0;
props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
@@ -488,7 +489,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
* @param currentMode
* @return
*/
- private final MonitorDevice getVirtualMonitorDevice(MonitorModeProps.Cache cache, int monitorId, MonitorMode currentMode) {
+ private final MonitorDevice getVirtualMonitorDevice(final MonitorModeProps.Cache cache, final int monitorId, final MonitorMode currentMode) {
final int[] props = new int[MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES];
int i = 0;
props[i++] = MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES;
@@ -516,7 +517,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
* Utilizes {@link #getCurrentMonitorModeImpl()}, if the latter returns null it uses
* the current screen size and dummy values.
*/
- protected final MonitorMode queryCurrentMonitorModeIntern(MonitorDevice monitor) {
+ protected final MonitorMode queryCurrentMonitorModeIntern(final MonitorDevice monitor) {
MonitorMode res;
if(DEBUG_TEST_SCREENMODE_DISABLED) {
res = null;
@@ -536,7 +537,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
long t0;
if(DEBUG) {
t0 = System.nanoTime();
- System.err.println("Screen.initMonitorState() START ("+DisplayImpl.getThreadName()+", "+this+")");
+ System.err.println("Screen.initMonitorState() START ("+Display.getThreadName()+", "+this+")");
} else {
t0 = 0;
}
@@ -558,20 +559,20 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
}
// Sort MonitorModes (all and per device) in descending order - default!
MonitorModeUtil.sort(cache.monitorModes.getData(), false ); // descending order
- for(Iterator<MonitorDevice> iMonitor=cache.monitorDevices.iterator(); iMonitor.hasNext(); ) {
+ for(final Iterator<MonitorDevice> iMonitor=cache.monitorDevices.iterator(); iMonitor.hasNext(); ) {
MonitorModeUtil.sort(iMonitor.next().getSupportedModes(), false ); // descending order
}
if(DEBUG) {
int i=0;
- for(Iterator<MonitorMode> iMode=cache.monitorModes.iterator(); iMode.hasNext(); i++) {
+ for(final Iterator<MonitorMode> iMode=cache.monitorModes.iterator(); iMode.hasNext(); i++) {
System.err.println("All["+i+"]: "+iMode.next());
}
i=0;
- for(Iterator<MonitorDevice> iMonitor=cache.monitorDevices.iterator(); iMonitor.hasNext(); i++) {
+ for(final Iterator<MonitorDevice> iMonitor=cache.monitorDevices.iterator(); iMonitor.hasNext(); i++) {
final MonitorDevice crt = iMonitor.next();
System.err.println("["+i+"]: "+crt);
int j=0;
- for(Iterator<MonitorMode> iMode=crt.getSupportedModes().iterator(); iMode.hasNext(); j++) {
+ for(final Iterator<MonitorMode> iMode=crt.getSupportedModes().iterator(); iMode.hasNext(); j++) {
System.err.println("["+i+"]["+j+"]: "+iMode.next());
}
}
@@ -598,7 +599,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
* Collects {@link MonitorDevice}s and {@link MonitorMode}s within the given cache.
* </p>
*/
- private final int collectNativeMonitorModes(MonitorModeProps.Cache cache) {
+ private final int collectNativeMonitorModes(final MonitorModeProps.Cache cache) {
if(!DEBUG_TEST_SCREENMODE_DISABLED) {
collectNativeMonitorModesAndDevicesImpl(cache);
}
@@ -646,7 +647,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
System.err.println("Screen.destroy(): Reset "+monitor);
try {
monitor.setCurrentMode(monitor.getOriginalMode());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
// be verbose but continue
t.printStackTrace();
}
@@ -664,7 +665,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
}
private final void shutdown() {
- ScreenMonitorState sms = ScreenMonitorState.getScreenMonitorStateUnlocked(getFQName());
+ final ScreenMonitorState sms = ScreenMonitorState.getScreenMonitorStateUnlocked(getFQName());
if(null != sms) {
final ArrayList<MonitorDevice> monitorDevices = sms.getMonitorDevices().getData();
for(int i=0; i<monitorDevices.size(); i++) {
@@ -673,7 +674,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
System.err.println("Screen.shutdown(): Reset "+monitor);
try {
monitor.setCurrentMode(monitor.getOriginalMode());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
// be quiet .. shutdown
}
}
diff --git a/src/newt/classes/jogamp/newt/ScreenMonitorState.java b/src/newt/classes/jogamp/newt/ScreenMonitorState.java
index 01e6cfee9..ae982414b 100644
--- a/src/newt/classes/jogamp/newt/ScreenMonitorState.java
+++ b/src/newt/classes/jogamp/newt/ScreenMonitorState.java
@@ -46,15 +46,15 @@ public class ScreenMonitorState {
private final RecursiveLock lock = LockFactory.createRecursiveLock();
private final ArrayHashSet<MonitorDevice> allMonitors;
private final ArrayHashSet<MonitorMode> allMonitorModes;
- private ArrayList<MonitorModeListener> listener = new ArrayList<MonitorModeListener>();
+ private final ArrayList<MonitorModeListener> listener = new ArrayList<MonitorModeListener>();
private static HashMap<String, ScreenMonitorState> screenFQN2ScreenMonitorState = new HashMap<String, ScreenMonitorState>();
private static RecursiveLock screen2ScreenMonitorState = LockFactory.createRecursiveLock();
- protected static void mapScreenMonitorState(String screenFQN, ScreenMonitorState sms) {
+ protected static void mapScreenMonitorState(final String screenFQN, final ScreenMonitorState sms) {
screen2ScreenMonitorState.lock();
try {
- ScreenMonitorState _sms = screenFQN2ScreenMonitorState.get(screenFQN);
+ final ScreenMonitorState _sms = screenFQN2ScreenMonitorState.get(screenFQN);
if( null != _sms ) {
throw new RuntimeException("ScreenMonitorState "+_sms+" already mapped to "+screenFQN);
}
@@ -71,7 +71,7 @@ public class ScreenMonitorState {
* @param screen the prev user
* @return true if mapping is empty, ie no more usage of the mapped ScreenMonitorState
*/
- protected static void unmapScreenMonitorState(String screenFQN) {
+ protected static void unmapScreenMonitorState(final String screenFQN) {
screen2ScreenMonitorState.lock();
try {
unmapScreenMonitorStateUnlocked(screenFQN);
@@ -79,14 +79,14 @@ public class ScreenMonitorState {
screen2ScreenMonitorState.unlock();
}
}
- protected static void unmapScreenMonitorStateUnlocked(String screenFQN) {
- ScreenMonitorState sms = screenFQN2ScreenMonitorState.remove(screenFQN);
+ protected static void unmapScreenMonitorStateUnlocked(final String screenFQN) {
+ final ScreenMonitorState sms = screenFQN2ScreenMonitorState.remove(screenFQN);
if(DEBUG) {
System.err.println("ScreenMonitorState.unmap "+screenFQN+" -> "+sms);
}
}
- protected static ScreenMonitorState getScreenMonitorState(String screenFQN) {
+ protected static ScreenMonitorState getScreenMonitorState(final String screenFQN) {
screen2ScreenMonitorState.lock();
try {
return getScreenMonitorStateUnlocked(screenFQN);
@@ -94,7 +94,7 @@ public class ScreenMonitorState {
screen2ScreenMonitorState.unlock();
}
}
- protected static ScreenMonitorState getScreenMonitorStateUnlocked(String screenFQN) {
+ protected static ScreenMonitorState getScreenMonitorStateUnlocked(final String screenFQN) {
return screenFQN2ScreenMonitorState.get(screenFQN);
}
@@ -106,8 +106,8 @@ public class ScreenMonitorState {
screen2ScreenMonitorState.unlock();
}
- public ScreenMonitorState(ArrayHashSet<MonitorDevice> allMonitors,
- ArrayHashSet<MonitorMode> allMonitorModes) {
+ public ScreenMonitorState(final ArrayHashSet<MonitorDevice> allMonitors,
+ final ArrayHashSet<MonitorMode> allMonitorModes) {
this.allMonitors = allMonitors;
this.allMonitorModes = allMonitorModes;
}
@@ -120,7 +120,7 @@ public class ScreenMonitorState {
return allMonitorModes;
}
- protected final int addListener(MonitorModeListener l) {
+ protected final int addListener(final MonitorModeListener l) {
lock();
try {
listener.add(l);
@@ -133,7 +133,7 @@ public class ScreenMonitorState {
}
}
- protected final int removeListener(MonitorModeListener l) {
+ protected final int removeListener(final MonitorModeListener l) {
lock();
try {
if(!listener.remove(l)) {
@@ -148,18 +148,18 @@ public class ScreenMonitorState {
}
}
- protected final MonitorDevice getMonitor(MonitorDevice monitor) {
+ protected final MonitorDevice getMonitor(final MonitorDevice monitor) {
return allMonitors.get(monitor);
}
- protected final void validateMonitor(MonitorDevice monitor) {
+ protected final void validateMonitor(final MonitorDevice monitor) {
final MonitorDevice md = allMonitors.get(monitor);
if( null == md ) {
throw new InternalError("Monitor unknown: "+monitor);
}
}
- protected final void fireMonitorModeChangeNotify(MonitorDevice monitor, MonitorMode desiredMode) {
+ protected final void fireMonitorModeChangeNotify(final MonitorDevice monitor, final MonitorMode desiredMode) {
lock();
try {
validateMonitor(monitor);
@@ -172,7 +172,7 @@ public class ScreenMonitorState {
}
}
- protected void fireMonitorModeChanged(MonitorDevice monitor, MonitorMode currentMode, boolean success) {
+ protected void fireMonitorModeChanged(final MonitorDevice monitor, final MonitorMode currentMode, final boolean success) {
lock();
try {
validateMonitor(monitor);
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 61fa7af6b..29a0b1e21 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -65,6 +65,7 @@ import jogamp.nativewindow.SurfaceUpdatedHelper;
import com.jogamp.common.util.ArrayHashSet;
import com.jogamp.common.util.IntBitfield;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.ReflectionUtil;
import com.jogamp.common.util.locks.LockFactory;
import com.jogamp.common.util.locks.RecursiveLock;
@@ -96,7 +97,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
static {
Debug.initSingleton();
- DEBUG_TEST_REPARENT_INCOMPATIBLE = Debug.isPropertyDefined("newt.test.Window.reparent.incompatible", true);
+ DEBUG_TEST_REPARENT_INCOMPATIBLE = PropertyAccess.isPropertyDefined("newt.test.Window.reparent.incompatible", true);
ScreenImpl.initSingleton();
}
@@ -120,7 +121,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
}
- private static void addWindow2List(WindowImpl window) {
+ private static void addWindow2List(final WindowImpl window) {
synchronized(windowList) {
// GC before add
int i=0, gced=0;
@@ -242,7 +243,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
final Point[] movePositions = new Point[] {
new Point(), new Point(), new Point(), new Point(),
new Point(), new Point(), new Point(), new Point() };
- final Point getMovePosition(int id) {
+ final Point getMovePosition(final int id) {
if( 0 <= id && id < movePositions.length ) {
return movePositions[id];
}
@@ -271,7 +272,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// Construction Methods
//
- private static Class<?> getWindowClass(String type)
+ private static Class<?> getWindowClass(final String type)
throws ClassNotFoundException
{
final Class<?> windowClass = NewtFactory.getCustomClass(type, "WindowDriver");
@@ -281,7 +282,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return windowClass;
}
- public static WindowImpl create(NativeWindow parentWindow, long parentWindowHandle, Screen screen, CapabilitiesImmutable caps) {
+ public static WindowImpl create(final NativeWindow parentWindow, final long parentWindowHandle, final Screen screen, final CapabilitiesImmutable caps) {
try {
Class<?> windowClass;
if(caps.isOnscreen()) {
@@ -289,7 +290,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
} else {
windowClass = OffscreenWindow.class;
}
- WindowImpl window = (WindowImpl) windowClass.newInstance();
+ final WindowImpl window = (WindowImpl) windowClass.newInstance();
window.parentWindow = parentWindow;
window.parentWindowHandle = parentWindowHandle;
window.screen = (ScreenImpl) screen;
@@ -297,30 +298,30 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
window.instantiationFinished();
addWindow2List(window);
return window;
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
throw new NativeWindowException(t);
}
}
- public static WindowImpl create(Object[] cstrArguments, Screen screen, CapabilitiesImmutable caps) {
+ public static WindowImpl create(final Object[] cstrArguments, final Screen screen, final CapabilitiesImmutable caps) {
try {
- Class<?> windowClass = getWindowClass(screen.getDisplay().getType());
- Class<?>[] cstrArgumentTypes = getCustomConstructorArgumentTypes(windowClass);
+ final Class<?> windowClass = getWindowClass(screen.getDisplay().getType());
+ final Class<?>[] cstrArgumentTypes = getCustomConstructorArgumentTypes(windowClass);
if(null==cstrArgumentTypes) {
throw new NativeWindowException("WindowClass "+windowClass+" doesn't support custom arguments in constructor");
}
- int argsChecked = verifyConstructorArgumentTypes(cstrArgumentTypes, cstrArguments);
+ final int argsChecked = verifyConstructorArgumentTypes(cstrArgumentTypes, cstrArguments);
if ( argsChecked < cstrArguments.length ) {
throw new NativeWindowException("WindowClass "+windowClass+" constructor mismatch at argument #"+argsChecked+"; Constructor: "+getTypeStrList(cstrArgumentTypes)+", arguments: "+getArgsStrList(cstrArguments));
}
- WindowImpl window = (WindowImpl) ReflectionUtil.createInstance( windowClass, cstrArgumentTypes, cstrArguments ) ;
+ final WindowImpl window = (WindowImpl) ReflectionUtil.createInstance( windowClass, cstrArgumentTypes, cstrArguments ) ;
window.screen = (ScreenImpl) screen;
window.capsRequested = (CapabilitiesImmutable) caps.cloneMutable();
window.instantiationFinished();
addWindow2List(window);
return window;
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new NativeWindowException(t);
}
}
@@ -339,7 +340,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
parentWindowHandle = 0;
}
- protected final void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg) {
+ protected final void setGraphicsConfiguration(final AbstractGraphicsConfiguration cfg) {
config = cfg;
}
@@ -507,7 +508,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return true;
}
- private static long getNativeWindowHandle(NativeWindow nativeWindow) {
+ private static long getNativeWindowHandle(final NativeWindow nativeWindow) {
long handle = 0;
if(null!=nativeWindow) {
boolean wasLocked = false;
@@ -518,7 +519,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(0==handle) {
throw new NativeWindowException("Parent native window handle is NULL, after succesful locking: "+nativeWindow);
}
- } catch (NativeWindowException nwe) {
+ } catch (final NativeWindowException nwe) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.getNativeWindowHandle: not successful yet: "+nwe);
}
@@ -556,9 +557,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+ public final WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
synchronized (closingListenerLock) {
- WindowClosingMode _op = defaultCloseOperation;
+ final WindowClosingMode _op = defaultCloseOperation;
defaultCloseOperation = op;
return _op;
}
@@ -656,18 +657,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* Default is all but {@link #FLAG_IS_FULLSCREEN_SPAN}
* </p>
*/
- protected boolean isReconfigureFlagSupported(int changeFlags) {
+ protected boolean isReconfigureFlagSupported(final int changeFlags) {
return 0 == ( changeFlags & FLAG_IS_FULLSCREEN_SPAN );
}
- protected int getReconfigureFlags(int changeFlags, boolean visible) {
+ protected int getReconfigureFlags(int changeFlags, final boolean visible) {
return changeFlags |= ( ( 0 != getParentWindowHandle() ) ? FLAG_HAS_PARENT : 0 ) |
( isUndecorated() ? FLAG_IS_UNDECORATED : 0 ) |
( isFullscreen() ? FLAG_IS_FULLSCREEN : 0 ) |
( isAlwaysOnTop() ? FLAG_IS_ALWAYSONTOP : 0 ) |
( visible ? FLAG_IS_VISIBLE : 0 ) ;
}
- protected static String getReconfigureFlagsAsString(StringBuilder sb, int flags) {
+ protected static String getReconfigureFlagsAsString(StringBuilder sb, final int flags) {
if(null == sb) { sb = new StringBuilder(); }
sb.append("[");
@@ -711,7 +712,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return sb.toString();
}
- protected void setTitleImpl(String title) {}
+ protected void setTitleImpl(final String title) {}
/**
* Translates the given window client-area coordinates with top-left origin
@@ -738,9 +739,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
*/
protected abstract void updateInsetsImpl(Insets insets);
- protected boolean setPointerVisibleImpl(boolean pointerVisible) { return false; }
- protected boolean confinePointerImpl(boolean confine) { return false; }
- protected void warpPointerImpl(int x, int y) { }
+ protected boolean setPointerVisibleImpl(final boolean pointerVisible) { return false; }
+ protected boolean confinePointerImpl(final boolean confine) { return false; }
+ protected void warpPointerImpl(final int x, final int y) { }
protected void setPointerIconImpl(final PointerIconImpl pi) { }
//----------------------------------------------------------------------
@@ -819,22 +820,22 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public final void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
surfaceUpdatedHelper.addSurfaceUpdatedListener(l);
}
@Override
- public final void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
+ public final void addSurfaceUpdatedListener(final int index, final SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
surfaceUpdatedHelper.addSurfaceUpdatedListener(index, l);
}
@Override
- public final void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+ public final void removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
surfaceUpdatedHelper.removeSurfaceUpdatedListener(l);
}
@Override
- public final void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+ public final void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
surfaceUpdatedHelper.surfaceUpdated(updater, ns, when);
}
@@ -919,7 +920,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return screen;
}
- protected void setScreen(ScreenImpl newScreen) { // never null !
+ protected void setScreen(final ScreenImpl newScreen) { // never null !
removeScreenReference();
screen = newScreen;
}
@@ -936,10 +937,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* @param width client-area size in window units, or <=0 if unchanged
* @param height client-area size in window units, or <=0 if unchanged
*/
- protected final void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
+ protected final void setVisibleImpl(final boolean visible, final int x, final int y, final int width, final int height) {
reconfigureWindowImpl(x, y, width, height, getReconfigureFlags(FLAG_CHANGE_VISIBILITY, visible));
}
- final void setVisibleActionImpl(boolean visible) {
+ final void setVisibleActionImpl(final boolean visible) {
boolean nativeWindowCreated = false;
boolean madeVisible = false;
@@ -949,7 +950,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(!visible && null!=childWindows && childWindows.size()>0) {
synchronized(childWindowsLock) {
for(int i = 0; i < childWindows.size(); i++ ) {
- NativeWindow nw = childWindows.get(i);
+ final NativeWindow nw = childWindows.get(i);
if(nw instanceof WindowImpl) {
((WindowImpl)nw).setVisible(false);
}
@@ -980,7 +981,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(isNativeValid() && visible && null!=childWindows && childWindows.size()>0) {
synchronized(childWindowsLock) {
for(int i = 0; i < childWindows.size(); i++ ) {
- NativeWindow nw = childWindows.get(i);
+ final NativeWindow nw = childWindows.get(i);
if(nw instanceof WindowImpl) {
((WindowImpl)nw).setVisible(true);
}
@@ -1003,7 +1004,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
private class VisibleAction implements Runnable {
boolean visible;
- private VisibleAction(boolean visible) {
+ private VisibleAction(final boolean visible) {
this.visible = visible;
}
@@ -1014,7 +1015,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void setVisible(boolean wait, boolean visible) {
+ public final void setVisible(final boolean wait, final boolean visible) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window setVisible: START ("+getThreadName()+") "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible: "+this.visible+" -> "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+(null!=parentWindow));
}
@@ -1022,7 +1023,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void setVisible(boolean visible) {
+ public final void setVisible(final boolean visible) {
setVisible(true, visible);
}
@@ -1030,7 +1031,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
int width, height;
boolean force;
- private SetSizeAction(int w, int h, boolean disregardFS) {
+ private SetSizeAction(final int w, final int h, final boolean disregardFS) {
this.width = w;
this.height = h;
this.force = disregardFS;
@@ -1118,9 +1119,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(childWindows.size()>0) {
// avoid ConcurrentModificationException: parent -> child -> parent.removeChild(this)
@SuppressWarnings("unchecked")
+ final
ArrayList<NativeWindow> clonedChildWindows = (ArrayList<NativeWindow>) childWindows.clone();
while( clonedChildWindows.size() > 0 ) {
- NativeWindow nw = clonedChildWindows.remove(0);
+ final NativeWindow nw = clonedChildWindows.remove(0);
if(nw instanceof WindowImpl) {
((WindowImpl)nw).windowDestroyNotify(true);
} else {
@@ -1145,7 +1147,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
setGraphicsConfiguration(null);
}
removeScreenReference();
- Display dpy = screen.getDisplay();
+ final Display dpy = screen.getDisplay();
if(null != dpy) {
dpy.validateEDTStopped();
}
@@ -1200,7 +1202,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
runOnEDTIfAvail(true, destroyAction);
}
- protected void destroy(boolean preserveResources) {
+ protected void destroy(final boolean preserveResources) {
if( null != lifecycleHook ) {
lifecycleHook.preserveGLStateAtDestroy( preserveResources );
}
@@ -1212,7 +1214,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* @param pWin parent window, may be null
* @return true if at least one of both window's configurations is offscreen
*/
- protected static boolean isOffscreenInstance(NativeWindow cWin, NativeWindow pWin) {
+ protected static boolean isOffscreenInstance(final NativeWindow cWin, final NativeWindow pWin) {
boolean ofs = false;
final AbstractGraphicsConfiguration cWinCfg = cWin.getGraphicsConfiguration();
if( null != cWinCfg ) {
@@ -1233,7 +1235,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
final int hints;
ReparentOperation operation;
- private ReparentAction(NativeWindow newParentWindow, int topLevelX, int topLevelY, int hints) {
+ private ReparentAction(final NativeWindow newParentWindow, final int topLevelX, final int topLevelY, int hints) {
this.newParentWindow = newParentWindow;
this.topLevelX = topLevelX;
this.topLevelY = topLevelY;
@@ -1452,7 +1454,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
WindowImpl.this.waitForVisible(false, false);
// FIXME: Some composite WM behave slacky .. give 'em chance to change state -> invisible,
// even though we do exactly that (KDE+Composite)
- try { Thread.sleep(100); } catch (InterruptedException e) { }
+ try { Thread.sleep(100); } catch (final InterruptedException e) { }
display.dispatchMessagesNative(); // status up2date
}
@@ -1587,15 +1589,15 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
} };
@Override
- public final ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, int hints) {
+ public final ReparentOperation reparentWindow(final NativeWindow newParent, final int x, final int y, final int hints) {
final ReparentAction reparentAction = new ReparentAction(newParent, x, y, hints);
runOnEDTIfAvail(true, reparentAction);
return reparentAction.getOp();
}
@Override
- public final CapabilitiesChooser setCapabilitiesChooser(CapabilitiesChooser chooser) {
- CapabilitiesChooser old = this.capabilitiesChooser;
+ public final CapabilitiesChooser setCapabilitiesChooser(final CapabilitiesChooser chooser) {
+ final CapabilitiesChooser old = this.capabilitiesChooser;
this.capabilitiesChooser = chooser;
return old;
}
@@ -1613,7 +1615,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
private class DecorationAction implements Runnable {
boolean undecorated;
- private DecorationAction(boolean undecorated) {
+ private DecorationAction(final boolean undecorated) {
this.undecorated = undecorated;
}
@@ -1633,7 +1635,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
final int width = getWidth();
final int height = getHeight();
- DisplayImpl display = (DisplayImpl) screen.getDisplay();
+ final DisplayImpl display = (DisplayImpl) screen.getDisplay();
display.dispatchMessagesNative(); // status up2date
reconfigureWindowImpl(x, y, width, height, getReconfigureFlags(FLAG_CHANGE_DECORATION, isVisible()));
display.dispatchMessagesNative(); // status up2date
@@ -1647,7 +1649,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void setUndecorated(boolean value) {
+ public final void setUndecorated(final boolean value) {
runOnEDTIfAvail(true, new DecorationAction(value));
}
@@ -1659,7 +1661,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
private class AlwaysOnTopAction implements Runnable {
boolean alwaysOnTop;
- private AlwaysOnTopAction(boolean alwaysOnTop) {
+ private AlwaysOnTopAction(final boolean alwaysOnTop) {
this.alwaysOnTop = alwaysOnTop;
}
@@ -1679,7 +1681,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
final int width = getWidth();
final int height = getHeight();
- DisplayImpl display = (DisplayImpl) screen.getDisplay();
+ final DisplayImpl display = (DisplayImpl) screen.getDisplay();
display.dispatchMessagesNative(); // status up2date
reconfigureWindowImpl(x, y, width, height, getReconfigureFlags(FLAG_CHANGE_ALWAYSONTOP, isVisible()));
display.dispatchMessagesNative(); // status up2date
@@ -1693,7 +1695,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void setAlwaysOnTop(boolean value) {
+ public final void setAlwaysOnTop(final boolean value) {
if( isFullscreen() ) {
nfs_alwaysOnTop = value;
} else {
@@ -1738,7 +1740,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
private boolean setPointerVisibleIntern(final boolean pointerVisible) {
- boolean res = setOffscreenPointerVisible(pointerVisible, pointerIcon);
+ final boolean res = setOffscreenPointerVisible(pointerVisible, pointerIcon);
return setPointerVisibleImpl(pointerVisible) || res; // accept onscreen or offscreen positive result!
}
/**
@@ -1768,7 +1770,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
final OffscreenLayerSurface ols = (OffscreenLayerSurface) parent;
try {
return ols.hideCursor();
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -1824,7 +1826,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
} else {
return ols.setCursor(null, null); // default
}
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -1836,7 +1838,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return pointerConfined;
}
@Override
- public final void confinePointer(boolean confine) {
+ public final void confinePointer(final boolean confine) {
if(this.pointerConfined != confine) {
boolean setVal = 0 == getWindowHandle();
if(!setVal) {
@@ -1850,7 +1852,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// this allows user listener to sync previous position value to the new centered position
try {
Thread.sleep(3 * screen.getDisplay().getEDTUtil().getPollPeriod());
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
}
}
if(setVal) {
@@ -1860,7 +1862,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void warpPointer(int x, int y) {
+ public final void warpPointer(final int x, final int y) {
if(0 != getWindowHandle()) {
warpPointerImpl(x, y);
}
@@ -1976,7 +1978,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
protected final boolean autoPosition() { return autoPosition; }
/** Sets the position fields {@link #x} and {@link #y} in window units to the given values and {@link #autoPosition} to false. */
- protected final void definePosition(int x, int y) {
+ protected final void definePosition(final int x, final int y) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("definePosition: "+this.x+"/"+this.y+" -> "+x+"/"+y);
// Thread.dumpStack();
@@ -1989,7 +1991,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* Sets the size fields {@link #winWidth} and {@link #winHeight} in window units to the given values
* and {@link #pixWidth} and {@link #pixHeight} in pixel units according to {@link #convertToPixelUnits(int[])}.
*/
- protected final void defineSize(int winWidth, int winHeight) {
+ protected final void defineSize(final int winWidth, final int winHeight) {
final int pixWidth = winWidth * getPixelScaleX(); // FIXME HiDPI: Shortcut, may need to adjust if we change scaling methodology
final int pixHeight = winHeight * getPixelScaleY();
if(DEBUG_IMPLEMENTATION) {
@@ -2036,8 +2038,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return lifecycleHook;
}
- public final LifecycleHook setLifecycleHook(LifecycleHook hook) {
- LifecycleHook old = lifecycleHook;
+ public final LifecycleHook setLifecycleHook(final LifecycleHook hook) {
+ final LifecycleHook old = lifecycleHook;
lifecycleHook = hook;
return old;
}
@@ -2051,7 +2053,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void setWindowDestroyNotifyAction(Runnable r) {
+ public final void setWindowDestroyNotifyAction(final Runnable r) {
windowDestroyNotifyAction = r;
}
@@ -2061,7 +2063,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
@Override
public final String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(getClass().getName()+"[Config "+config+
",\n "+screen+
@@ -2100,12 +2102,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return sb.toString();
}
- protected final void setWindowHandle(long handle) {
+ protected final void setWindowHandle(final long handle) {
windowHandle = handle;
}
@Override
- public final void runOnEDTIfAvail(boolean wait, final Runnable task) {
+ public final void runOnEDTIfAvail(final boolean wait, final Runnable task) {
if( windowLock.isOwner( Thread.currentThread() ) ) {
task.run();
} else {
@@ -2143,11 +2145,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void requestFocus(boolean wait) {
+ public final void requestFocus(final boolean wait) {
requestFocus(wait /* wait */, false /* skipFocusAction */, brokenFocusChange /* force */);
}
- private void requestFocus(boolean wait, boolean skipFocusAction, boolean force) {
+ private void requestFocus(final boolean wait, final boolean skipFocusAction, final boolean force) {
if( isNativeValid() &&
( force || !hasFocus() ) &&
( skipFocusAction || !focusAction() ) ) {
@@ -2156,7 +2158,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
/** Internally forcing request focus on current thread */
- private void requestFocusInt(boolean skipFocusAction) {
+ private void requestFocusInt(final boolean skipFocusAction) {
if( skipFocusAction || !focusAction() ) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.RequestFocusInt: forcing - ("+getThreadName()+"): skipFocusAction "+skipFocusAction+", focus "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
@@ -2166,7 +2168,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void setFocusAction(FocusRunnable focusAction) {
+ public final void setFocusAction(final FocusRunnable focusAction) {
this.focusAction = focusAction;
}
@@ -2186,19 +2188,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return res;
}
- protected final void setBrokenFocusChange(boolean v) {
+ protected final void setBrokenFocusChange(final boolean v) {
brokenFocusChange = v;
}
@Override
- public final void setKeyboardFocusHandler(KeyListener l) {
+ public final void setKeyboardFocusHandler(final KeyListener l) {
keyboardFocusHandler = l;
}
private class SetPositionAction implements Runnable {
int x, y;
- private SetPositionAction(int x, int y) {
+ private SetPositionAction(final int x, final int y) {
this.x = x;
this.y = y;
}
@@ -2231,20 +2233,20 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public void setPosition(int x, int y) {
+ public void setPosition(final int x, final int y) {
autoPosition = false;
runOnEDTIfAvail(true, new SetPositionAction(x, y));
}
@Override
- public final void setTopLevelPosition(int x, int y) {
+ public final void setTopLevelPosition(final int x, final int y) {
setPosition(x + getInsets().getLeftWidth(), y + getInsets().getTopHeight());
}
private class FullScreenAction implements Runnable {
boolean _fullscreen;
- private boolean init(boolean fullscreen) {
+ private boolean init(final boolean fullscreen) {
if(isNativeValid()) {
this._fullscreen = fullscreen;
return isFullscreen() != fullscreen;
@@ -2349,7 +2351,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if( tempInvisible ) {
setVisibleImpl(false, oldX, oldY, oldWidth, oldHeight);
WindowImpl.this.waitForVisible(false, false);
- try { Thread.sleep(100); } catch (InterruptedException e) { }
+ try { Thread.sleep(100); } catch (final InterruptedException e) { }
display.dispatchMessagesNative(); // status up2date
}
@@ -2387,7 +2389,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(wasVisible) {
if( NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(true) ) {
// Give sluggy WM's (e.g. Unity) a chance to properly restore window ..
- try { Thread.sleep(100); } catch (InterruptedException e) { }
+ try { Thread.sleep(100); } catch (final InterruptedException e) { }
display.dispatchMessagesNative(); // status up2date
}
setVisibleImpl(true, x, y, w, h);
@@ -2417,16 +2419,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
private final FullScreenAction fullScreenAction = new FullScreenAction();
@Override
- public boolean setFullscreen(boolean fullscreen) {
+ public boolean setFullscreen(final boolean fullscreen) {
return setFullscreenImpl(fullscreen, true, null);
}
@Override
- public boolean setFullscreen(List<MonitorDevice> monitors) {
+ public boolean setFullscreen(final List<MonitorDevice> monitors) {
return setFullscreenImpl(true, false, monitors);
}
- private boolean setFullscreenImpl(boolean fullscreen, boolean useMainMonitor, List<MonitorDevice> monitors) {
+ private boolean setFullscreenImpl(final boolean fullscreen, final boolean useMainMonitor, final List<MonitorDevice> monitors) {
synchronized(fullScreenAction) {
fullscreenMonitors = monitors;
fullscreenUseMainMonitor = useMainMonitor;
@@ -2454,7 +2456,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
/** Notify WindowDriver about the finished monitor mode change. */
- protected void monitorModeChanged(MonitorEvent me, boolean success) {
+ protected void monitorModeChanged(final MonitorEvent me, final boolean success) {
}
private class MonitorModeListenerImpl implements MonitorModeListener {
@@ -2466,7 +2468,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
boolean _fullscreenUseMainMonitor = true;
@Override
- public void monitorModeChangeNotify(MonitorEvent me) {
+ public void monitorModeChangeNotify(final MonitorEvent me) {
hadFocus = hasFocus();
final boolean isOSX = NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(true);
final boolean quirkFSPause = fullscreen && isReconfigureFlagSupported(FLAG_IS_FULLSCREEN_SPAN);
@@ -2496,7 +2498,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public void monitorModeChanged(MonitorEvent me, boolean success) {
+ public void monitorModeChanged(final MonitorEvent me, final boolean success) {
if(!animatorPaused && success && null!=lifecycleHook) {
// Didn't pass above notify method. probably detected screen change after it happened.
animatorPaused = lifecycleHook.pauseRenderingAction();
@@ -2572,14 +2574,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
//
@Override
- public final boolean removeChild(NativeWindow win) {
+ public final boolean removeChild(final NativeWindow win) {
synchronized(childWindowsLock) {
return childWindows.remove(win);
}
}
@Override
- public final boolean addChild(NativeWindow win) {
+ public final boolean addChild(final NativeWindow win) {
if (win == null) {
return false;
}
@@ -2591,7 +2593,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
//----------------------------------------------------------------------
// Generic Event Support
//
- private void doEvent(boolean enqueue, boolean wait, com.jogamp.newt.event.NEWTEvent event) {
+ private void doEvent(final boolean enqueue, boolean wait, final com.jogamp.newt.event.NEWTEvent event) {
boolean done = false;
if(!enqueue) {
@@ -2605,14 +2607,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void enqueueEvent(boolean wait, com.jogamp.newt.event.NEWTEvent event) {
+ public final void enqueueEvent(final boolean wait, final com.jogamp.newt.event.NEWTEvent event) {
if(isNativeValid()) {
((DisplayImpl)screen.getDisplay()).enqueueEvent(wait, event);
}
}
@Override
- public final boolean consumeEvent(NEWTEvent e) {
+ public final boolean consumeEvent(final NEWTEvent e) {
switch(e.getEventType()) {
// special repaint treatment
case WindowEvent.EVENT_WINDOW_REPAINT:
@@ -2744,7 +2746,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
final PointerType[] pTypes, final short eventType, final int modifiers,
final int actionIdx, final boolean normalPNames, final int[] pNames,
final int[] pX, final int[] pY, final float[] pPressure,
- float maxPressure, final float[] rotationXYZ, final float rotationScale) {
+ final float maxPressure, final float[] rotationXYZ, final float rotationScale) {
final int pCount = pNames.length;
final short[] pIDs = new short[pCount];
for(int i=0; i<pCount; i++) {
@@ -3044,7 +3046,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
doEvent(enqueue, wait, e); // actual mouse event
}
- private static int step(int lower, int edge, int value) {
+ private static int step(final int lower, final int edge, final int value) {
return value < edge ? lower : value;
}
@@ -3274,16 +3276,17 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void addMouseListener(MouseListener l) {
+ public final void addMouseListener(final MouseListener l) {
addMouseListener(-1, l);
}
@Override
- public final void addMouseListener(int index, MouseListener l) {
+ public final void addMouseListener(int index, final MouseListener l) {
if(l == null) {
return;
}
@SuppressWarnings("unchecked")
+ final
ArrayList<MouseListener> clonedListeners = (ArrayList<MouseListener>) mouseListeners.clone();
if(0>index) {
index = clonedListeners.size();
@@ -3293,11 +3296,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void removeMouseListener(MouseListener l) {
+ public final void removeMouseListener(final MouseListener l) {
if (l == null) {
return;
}
@SuppressWarnings("unchecked")
+ final
ArrayList<MouseListener> clonedListeners = (ArrayList<MouseListener>) mouseListeners.clone();
clonedListeners.remove(l);
mouseListeners = clonedListeners;
@@ -3306,6 +3310,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
@Override
public final MouseListener getMouseListener(int index) {
@SuppressWarnings("unchecked")
+ final
ArrayList<MouseListener> clonedListeners = (ArrayList<MouseListener>) mouseListeners.clone();
if(0>index) {
index = clonedListeners.size()-1;
@@ -3319,7 +3324,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void setDefaultGesturesEnabled(boolean enable) {
+ public final void setDefaultGesturesEnabled(final boolean enable) {
defaultGestureHandlerEnabled = enable;
}
@Override
@@ -3328,15 +3333,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void addGestureHandler(GestureHandler gh) {
+ public final void addGestureHandler(final GestureHandler gh) {
addGestureHandler(-1, gh);
}
@Override
- public final void addGestureHandler(int index, GestureHandler gh) {
+ public final void addGestureHandler(int index, final GestureHandler gh) {
if(gh == null) {
return;
}
@SuppressWarnings("unchecked")
+ final
ArrayList<GestureHandler> cloned = (ArrayList<GestureHandler>) pointerGestureHandler.clone();
if(0>index) {
index = cloned.size();
@@ -3345,25 +3351,27 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
pointerGestureHandler = cloned;
}
@Override
- public final void removeGestureHandler(GestureHandler gh) {
+ public final void removeGestureHandler(final GestureHandler gh) {
if (gh == null) {
return;
}
@SuppressWarnings("unchecked")
+ final
ArrayList<GestureHandler> cloned = (ArrayList<GestureHandler>) pointerGestureHandler.clone();
cloned.remove(gh);
pointerGestureHandler = cloned;
}
@Override
- public final void addGestureListener(GestureHandler.GestureListener gl) {
+ public final void addGestureListener(final GestureHandler.GestureListener gl) {
addGestureListener(-1, gl);
}
@Override
- public final void addGestureListener(int index, GestureHandler.GestureListener gl) {
+ public final void addGestureListener(int index, final GestureHandler.GestureListener gl) {
if(gl == null) {
return;
}
@SuppressWarnings("unchecked")
+ final
ArrayList<GestureHandler.GestureListener> cloned = (ArrayList<GestureHandler.GestureListener>) gestureListeners.clone();
if(0>index) {
index = cloned.size();
@@ -3372,17 +3380,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
gestureListeners = cloned;
}
@Override
- public final void removeGestureListener(GestureHandler.GestureListener gl) {
+ public final void removeGestureListener(final GestureHandler.GestureListener gl) {
if (gl == null) {
return;
}
@SuppressWarnings("unchecked")
+ final
ArrayList<GestureHandler.GestureListener> cloned = (ArrayList<GestureHandler.GestureListener>) gestureListeners.clone();
cloned.remove(gl);
gestureListeners= cloned;
}
- private final void dispatchMouseEvent(MouseEvent e) {
+ private final void dispatchMouseEvent(final MouseEvent e) {
for(int i = 0; !e.isConsumed() && i < mouseListeners.size(); i++ ) {
final MouseListener l = mouseListeners.get(i);
switch(e.getEventType()) {
@@ -3431,7 +3440,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* @param pressed true if pressed, otherwise false
* @return the previus pressed value
*/
- protected final boolean setKeyPressed(short keyCode, boolean pressed) {
+ protected final boolean setKeyPressed(final short keyCode, final boolean pressed) {
final int v = 0xFFFF & keyCode;
if( v <= keyTrackingRange ) {
return keyPressedState.put(v, pressed);
@@ -3442,7 +3451,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* @param keyCode the keyCode to test pressed state
* @return true if pressed, otherwise false
*/
- protected final boolean isKeyPressed(short keyCode) {
+ protected final boolean isKeyPressed(final short keyCode) {
final int v = 0xFFFF & keyCode;
if( v <= keyTrackingRange ) {
return keyPressedState.get(v);
@@ -3450,18 +3459,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return false;
}
- public void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+ public void sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
// Always add currently pressed mouse buttons to modifier mask
consumeKeyEvent( KeyEvent.create(eventType, this, System.currentTimeMillis(), modifiers | pState1.buttonPressedMask, keyCode, keySym, keyChar) );
}
- public void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+ public void enqueueKeyEvent(final boolean wait, final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
// Always add currently pressed mouse buttons to modifier mask
enqueueEvent(wait, KeyEvent.create(eventType, this, System.currentTimeMillis(), modifiers | pState1.buttonPressedMask, keyCode, keySym, keyChar) );
}
@Override
- public final void setKeyboardVisible(boolean visible) {
+ public final void setKeyboardVisible(final boolean visible) {
if(isNativeValid()) {
// We don't skip the impl. if it seems that there is no state change,
// since we cannot assume the impl. reliably gives us it's current state.
@@ -3485,11 +3494,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* hence even if an invisible operation failed, the keyboard is considered invisible!
* </p>
*/
- protected boolean setKeyboardVisibleImpl(boolean visible) {
+ protected boolean setKeyboardVisibleImpl(final boolean visible) {
return false; // nop
}
/** Triggered by implementation's WM events to update the virtual on-screen keyboard's visibility state. */
- protected void keyboardVisibilityChanged(boolean visible) {
+ protected void keyboardVisibilityChanged(final boolean visible) {
if(keyboardVisible != visible) {
if(DEBUG_IMPLEMENTATION || DEBUG_KEY_EVENT) {
System.err.println("keyboardVisibilityChanged: "+keyboardVisible+" -> "+visible);
@@ -3500,16 +3509,17 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
protected boolean keyboardVisible = false;
@Override
- public final void addKeyListener(KeyListener l) {
+ public final void addKeyListener(final KeyListener l) {
addKeyListener(-1, l);
}
@Override
- public final void addKeyListener(int index, KeyListener l) {
+ public final void addKeyListener(int index, final KeyListener l) {
if(l == null) {
return;
}
@SuppressWarnings("unchecked")
+ final
ArrayList<KeyListener> clonedListeners = (ArrayList<KeyListener>) keyListeners.clone();
if(0>index) {
index = clonedListeners.size();
@@ -3519,11 +3529,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void removeKeyListener(KeyListener l) {
+ public final void removeKeyListener(final KeyListener l) {
if (l == null) {
return;
}
@SuppressWarnings("unchecked")
+ final
ArrayList<KeyListener> clonedListeners = (ArrayList<KeyListener>) keyListeners.clone();
clonedListeners.remove(l);
keyListeners = clonedListeners;
@@ -3532,6 +3543,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
@Override
public final KeyListener getKeyListener(int index) {
@SuppressWarnings("unchecked")
+ final
ArrayList<KeyListener> clonedListeners = (ArrayList<KeyListener>) keyListeners.clone();
if(0>index) {
index = clonedListeners.size()-1;
@@ -3544,7 +3556,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return keyListeners.toArray(new KeyListener[keyListeners.size()]);
}
- private final boolean propagateKeyEvent(KeyEvent e, KeyListener l) {
+ private final boolean propagateKeyEvent(final KeyEvent e, final KeyListener l) {
switch(e.getEventType()) {
case KeyEvent.EVENT_KEY_PRESSED:
l.keyPressed(e);
@@ -3558,7 +3570,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return e.isConsumed();
}
- protected void consumeKeyEvent(KeyEvent e) {
+ protected void consumeKeyEvent(final KeyEvent e) {
boolean consumedE = false;
if( null != keyboardFocusHandler && !e.isAutoRepeat() ) {
consumedE = propagateKeyEvent(e, keyboardFocusHandler);
@@ -3582,27 +3594,28 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// WindowListener/Event Support
//
@Override
- public final void sendWindowEvent(int eventType) {
+ public final void sendWindowEvent(final int eventType) {
consumeWindowEvent( new WindowEvent((short)eventType, this, System.currentTimeMillis()) );
}
- public final void enqueueWindowEvent(boolean wait, int eventType) {
+ public final void enqueueWindowEvent(final boolean wait, final int eventType) {
enqueueEvent( wait, new WindowEvent((short)eventType, this, System.currentTimeMillis()) );
}
@Override
- public final void addWindowListener(WindowListener l) {
+ public final void addWindowListener(final WindowListener l) {
addWindowListener(-1, l);
}
@Override
- public final void addWindowListener(int index, WindowListener l)
+ public final void addWindowListener(int index, final WindowListener l)
throws IndexOutOfBoundsException
{
if(l == null) {
return;
}
@SuppressWarnings("unchecked")
+ final
ArrayList<WindowListener> clonedListeners = (ArrayList<WindowListener>) windowListeners.clone();
if(0>index) {
index = clonedListeners.size();
@@ -3612,11 +3625,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void removeWindowListener(WindowListener l) {
+ public final void removeWindowListener(final WindowListener l) {
if (l == null) {
return;
}
@SuppressWarnings("unchecked")
+ final
ArrayList<WindowListener> clonedListeners = (ArrayList<WindowListener>) windowListeners.clone();
clonedListeners.remove(l);
windowListeners = clonedListeners;
@@ -3625,6 +3639,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
@Override
public final WindowListener getWindowListener(int index) {
@SuppressWarnings("unchecked")
+ final
ArrayList<WindowListener> clonedListeners = (ArrayList<WindowListener>) windowListeners.clone();
if(0>index) {
index = clonedListeners.size()-1;
@@ -3637,13 +3652,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return windowListeners.toArray(new WindowListener[windowListeners.size()]);
}
- protected void consumeWindowEvent(WindowEvent e) {
+ protected void consumeWindowEvent(final WindowEvent e) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("consumeWindowEvent: "+e+", visible "+isVisible()+" "+getX()+"/"+getY()+", win["+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+
"], pixel["+getSurfaceWidth()+"x"+getSurfaceHeight()+"]");
}
for(int i = 0; !e.isConsumed() && i < windowListeners.size(); i++ ) {
- WindowListener l = windowListeners.get(i);
+ final WindowListener l = windowListeners.get(i);
switch(e.getEventType()) {
case WindowEvent.EVENT_WINDOW_RESIZED:
l.windowResized(e);
@@ -3675,7 +3690,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
/** Triggered by implementation's WM events to update the focus state. */
- protected void focusChanged(boolean defer, boolean focusGained) {
+ protected void focusChanged(final boolean defer, final boolean focusGained) {
if(brokenFocusChange || hasFocus != focusGained) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.focusChanged: ("+getThreadName()+"): (defer: "+defer+") "+this.hasFocus+" -> "+focusGained+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
@@ -3691,7 +3706,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
/** Triggered by implementation's WM events to update the visibility state. */
- protected final void visibleChanged(boolean defer, boolean visible) {
+ protected final void visibleChanged(final boolean defer, final boolean visible) {
if(this.visible != visible) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.visibleChanged ("+getThreadName()+"): (defer: "+defer+") "+this.visible+" -> "+visible+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
@@ -3701,17 +3716,17 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
/** Returns -1 if failed, otherwise remaining time until {@link #TIMEOUT_NATIVEWINDOW}, maybe zero. */
- private long waitForVisible(boolean visible, boolean failFast) {
+ private long waitForVisible(final boolean visible, final boolean failFast) {
return waitForVisible(visible, failFast, TIMEOUT_NATIVEWINDOW);
}
/** Returns -1 if failed, otherwise remaining time until <code>timeOut</code>, maybe zero. */
- private long waitForVisible(boolean visible, boolean failFast, long timeOut) {
+ private long waitForVisible(final boolean visible, final boolean failFast, final long timeOut) {
final DisplayImpl display = (DisplayImpl) screen.getDisplay();
display.dispatchMessagesNative(); // status up2date
long remaining;
for(remaining = timeOut; 0<remaining && this.visible != visible; remaining-=10 ) {
- try { Thread.sleep(10); } catch (InterruptedException ie) {}
+ try { Thread.sleep(10); } catch (final InterruptedException ie) {}
display.dispatchMessagesNative(); // status up2date
}
if(this.visible != visible) {
@@ -3731,7 +3746,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
/** Triggered by implementation's WM events to update the client-area size in window units w/o insets/decorations. */
- protected void sizeChanged(boolean defer, int newWidth, int newHeight, boolean force) {
+ protected void sizeChanged(final boolean defer, final int newWidth, final int newHeight, final boolean force) {
if(force || getWidth() != newWidth || getHeight() != newHeight) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.sizeChanged: ("+getThreadName()+"): (defer: "+defer+") force "+force+", "+
@@ -3752,12 +3767,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
- private boolean waitForSize(int w, int h, boolean failFast, long timeOut) {
+ private boolean waitForSize(final int w, final int h, final boolean failFast, final long timeOut) {
final DisplayImpl display = (DisplayImpl) screen.getDisplay();
display.dispatchMessagesNative(); // status up2date
long sleep;
for(sleep = timeOut; 0<sleep && w!=getWidth() && h!=getHeight(); sleep-=10 ) {
- try { Thread.sleep(10); } catch (InterruptedException ie) {}
+ try { Thread.sleep(10); } catch (final InterruptedException ie) {}
display.dispatchMessagesNative(); // status up2date
}
if(0 >= sleep) {
@@ -3775,7 +3790,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
/** Triggered by implementation's WM events to update the position. */
- protected final void positionChanged(boolean defer, int newX, int newY) {
+ protected final void positionChanged(final boolean defer, final int newX, final int newY) {
if ( getX() != newX || getY() != newY ) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.positionChanged: ("+getThreadName()+"): (defer: "+defer+") "+getX()+"/"+getY()+" -> "+newX+"/"+newY+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
@@ -3797,7 +3812,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* Since WM may not obey our positional request exactly, we allow a tolerance of 2 times insets[left/top], or 64 pixels, whatever is greater.
* </p>
*/
- private boolean waitForPosition(boolean useCustomPosition, int x, int y, long timeOut) {
+ private boolean waitForPosition(final boolean useCustomPosition, final int x, final int y, final long timeOut) {
final DisplayImpl display = (DisplayImpl) screen.getDisplay();
final int maxDX, maxDY;
{
@@ -3814,7 +3829,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
ok = !autoPosition;
}
if( !ok ) {
- try { Thread.sleep(10); } catch (InterruptedException ie) {}
+ try { Thread.sleep(10); } catch (final InterruptedException ie) {}
display.dispatchMessagesNative(); // status up2date
remaining-=10;
}
@@ -3838,7 +3853,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* @see #getInsets()
* @see #updateInsetsImpl(Insets)
*/
- protected void insetsChanged(boolean defer, int left, int right, int top, int bottom) {
+ protected void insetsChanged(final boolean defer, final int left, final int right, final int top, final int bottom) {
if ( left >= 0 && right >= 0 && top >= 0 && bottom >= 0 ) {
if( blockInsetsChange || isUndecorated() ) {
if(DEBUG_IMPLEMENTATION) {
@@ -3862,7 +3877,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* and hence force destruction. Otherwise is follows the user settings.
* @return true if this window is no more valid and hence has been destroyed, otherwise false.
*/
- public final boolean windowDestroyNotify(boolean force) {
+ public final boolean windowDestroyNotify(final boolean force) {
final WindowClosingMode defMode = getDefaultCloseOperation();
final WindowClosingMode mode = force ? WindowClosingMode.DISPOSE_ON_CLOSE : defMode;
if(DEBUG_IMPLEMENTATION) {
@@ -3906,7 +3921,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public final void windowRepaint(int x, int y, int width, int height) {
+ public final void windowRepaint(final int x, final int y, final int width, final int height) {
windowRepaint(false, x, y, width, height);
}
@@ -3918,7 +3933,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* @param width dirty-region width in pixel units
* @param height dirty-region height in pixel units
*/
- protected final void windowRepaint(boolean defer, int x, int y, int width, int height) {
+ protected final void windowRepaint(final boolean defer, final int x, final int y, int width, int height) {
width = ( 0 >= width ) ? getSurfaceWidth() : width;
height = ( 0 >= height ) ? getSurfaceHeight() : height;
if(DEBUG_IMPLEMENTATION) {
@@ -3926,7 +3941,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
if(isNativeValid()) {
- NEWTEvent e = new WindowUpdateEvent(WindowEvent.EVENT_WINDOW_REPAINT, this, System.currentTimeMillis(),
+ final NEWTEvent e = new WindowUpdateEvent(WindowEvent.EVENT_WINDOW_REPAINT, this, System.currentTimeMillis(),
new Rectangle(x, y, width, height));
doEvent(defer, false, e);
}
@@ -3936,16 +3951,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// Reflection helper ..
//
- private static Class<?>[] getCustomConstructorArgumentTypes(Class<?> windowClass) {
+ private static Class<?>[] getCustomConstructorArgumentTypes(final Class<?> windowClass) {
Class<?>[] argTypes = null;
try {
- Method m = windowClass.getDeclaredMethod("getCustomConstructorArgumentTypes");
+ final Method m = windowClass.getDeclaredMethod("getCustomConstructorArgumentTypes");
argTypes = (Class[]) m.invoke(null, (Object[])null);
- } catch (Throwable t) {}
+ } catch (final Throwable t) {}
return argTypes;
}
- private static int verifyConstructorArgumentTypes(Class<?>[] types, Object[] args) {
+ private static int verifyConstructorArgumentTypes(final Class<?>[] types, final Object[] args) {
if(types.length != args.length) {
return -1;
}
@@ -3957,8 +3972,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return args.length;
}
- private static String getArgsStrList(Object[] args) {
- StringBuilder sb = new StringBuilder();
+ private static String getArgsStrList(final Object[] args) {
+ final StringBuilder sb = new StringBuilder();
for(int i=0; i<args.length; i++) {
sb.append(args[i].getClass());
if(i<args.length) {
@@ -3968,8 +3983,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return sb.toString();
}
- private static String getTypeStrList(Class<?>[] types) {
- StringBuilder sb = new StringBuilder();
+ private static String getTypeStrList(final Class<?>[] types) {
+ final StringBuilder sb = new StringBuilder();
for(int i=0; i<types.length; i++) {
sb.append(types[i]);
if(i<types.length) {
@@ -3983,11 +3998,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return Display.getThreadName();
}
- public static String toHexString(int hex) {
+ public static String toHexString(final int hex) {
return Display.toHexString(hex);
}
- public static String toHexString(long hex) {
+ public static String toHexString(final long hex) {
return Display.toHexString(hex);
}
}
diff --git a/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java b/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
index 2ba5b3460..682313ef4 100644
--- a/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
+++ b/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
@@ -55,7 +55,7 @@ public class NewtFactoryAWT extends NewtFactory {
*
* @param awtCompObject must be of type java.awt.Component
*/
- public static JAWTWindow getNativeWindow(Object awtCompObject, CapabilitiesImmutable capsRequested) {
+ public static JAWTWindow getNativeWindow(final Object awtCompObject, final CapabilitiesImmutable capsRequested) {
if(null==awtCompObject) {
throw new NativeWindowException("Null AWT Component");
}
@@ -65,9 +65,9 @@ public class NewtFactoryAWT extends NewtFactory {
return getNativeWindow( (java.awt.Component) awtCompObject, capsRequested );
}
- public static JAWTWindow getNativeWindow(java.awt.Component awtComp, CapabilitiesImmutable capsRequested) {
- AWTGraphicsConfiguration config = AWTGraphicsConfiguration.create(awtComp, null, capsRequested);
- NativeWindow nw = NativeWindowFactory.getNativeWindow(awtComp, config); // a JAWTWindow
+ public static JAWTWindow getNativeWindow(final java.awt.Component awtComp, final CapabilitiesImmutable capsRequested) {
+ final AWTGraphicsConfiguration config = AWTGraphicsConfiguration.create(awtComp, null, capsRequested);
+ final NativeWindow nw = NativeWindowFactory.getNativeWindow(awtComp, config); // a JAWTWindow
if(! ( nw instanceof JAWTWindow ) ) {
throw new NativeWindowException("Not an AWT NativeWindow: "+nw);
}
@@ -77,7 +77,7 @@ public class NewtFactoryAWT extends NewtFactory {
return (JAWTWindow)nw;
}
- public static void destroyNativeWindow(JAWTWindow jawtWindow) {
+ public static void destroyNativeWindow(final JAWTWindow jawtWindow) {
final AbstractGraphicsConfiguration config = jawtWindow.getGraphicsConfiguration();
jawtWindow.destroy();
config.getScreen().getDevice().close();
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
index b04fd98f4..31ee92ca4 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
@@ -101,7 +101,7 @@ public class AWTNewtEventFactory {
}
}
- public static final short eventTypeAWT2NEWT(int awtType) {
+ public static final short eventTypeAWT2NEWT(final int awtType) {
switch( awtType ) {
// n/a case java.awt.event.WindowEvent.WINDOW_OPENED: return com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_OPENED;
case java.awt.event.WindowEvent.WINDOW_CLOSING: return com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY;
@@ -136,7 +136,7 @@ public class AWTNewtEventFactory {
return (short)0;
}
- private static int getAWTButtonDownMaskImpl(int button) {
+ private static int getAWTButtonDownMaskImpl(final int button) {
/**
* java.awt.event.InputEvent.getMaskForButton(button);
*
@@ -173,7 +173,7 @@ public class AWTNewtEventFactory {
* @param button
* @return
*/
- public static int getAWTButtonDownMask(int button) {
+ public static int getAWTButtonDownMask(final int button) {
if( 0 < button && button <= awtButtonDownMasks.length ) {
return awtButtonDownMasks[button-1];
} else {
@@ -181,7 +181,7 @@ public class AWTNewtEventFactory {
}
}
- public static final short awtButton2Newt(int awtButton) {
+ public static final short awtButton2Newt(final int awtButton) {
if( 0 < awtButton && awtButton <= com.jogamp.newt.event.MouseEvent.BUTTON_COUNT ) {
return (short)awtButton;
} else {
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
index 770502326..93cdd7e56 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
@@ -46,14 +46,14 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
{
NativeWindow downstreamParent;
- public AWTParentWindowAdapter(NativeWindow downstreamParent, com.jogamp.newt.Window downstream) {
+ public AWTParentWindowAdapter(final NativeWindow downstreamParent, final com.jogamp.newt.Window downstream) {
super(downstream);
this.downstreamParent = downstreamParent;
}
public AWTParentWindowAdapter() {
super();
}
- public AWTParentWindowAdapter setDownstream(NativeWindow downstreamParent, com.jogamp.newt.Window downstream) {
+ public AWTParentWindowAdapter setDownstream(final NativeWindow downstreamParent, final com.jogamp.newt.Window downstream) {
setDownstream(downstream);
this.downstreamParent = downstreamParent;
return this;
@@ -67,19 +67,19 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
}
@Override
- public synchronized AWTAdapter addTo(java.awt.Component awtComponent) {
+ public synchronized AWTAdapter addTo(final java.awt.Component awtComponent) {
awtComponent.addHierarchyListener(this);
return super.addTo(awtComponent);
}
@Override
- public synchronized AWTAdapter removeFrom(java.awt.Component awtComponent) {
+ public synchronized AWTAdapter removeFrom(final java.awt.Component awtComponent) {
awtComponent.removeHierarchyListener(this);
return super.removeFrom(awtComponent);
}
@Override
- public synchronized void focusGained(java.awt.event.FocusEvent e) {
+ public synchronized void focusGained(final java.awt.event.FocusEvent e) {
if( !isSetup ) { return; }
// forward focus to NEWT child
final com.jogamp.newt.Window newtChild = getNewtWindow();
@@ -100,7 +100,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
}
@Override
- public synchronized void focusLost(java.awt.event.FocusEvent e) {
+ public synchronized void focusLost(final java.awt.event.FocusEvent e) {
if( !isSetup ) { return; }
if(DEBUG_IMPLEMENTATION) {
System.err.println("AWT: focusLost: "+ e);
@@ -108,7 +108,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
}
@Override
- public synchronized void componentResized(java.awt.event.ComponentEvent e) {
+ public synchronized void componentResized(final java.awt.event.ComponentEvent e) {
if( !isSetup ) { return; }
// Need to resize the NEWT child window
// the resized event will be send via the native window feedback.
@@ -139,7 +139,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
}
@Override
- public synchronized void componentMoved(java.awt.event.ComponentEvent e) {
+ public synchronized void componentMoved(final java.awt.event.ComponentEvent e) {
if( !isSetup ) { return; }
if(DEBUG_IMPLEMENTATION) {
System.err.println("AWT: componentMoved: "+e);
@@ -151,17 +151,17 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
}
@Override
- public synchronized void windowActivated(java.awt.event.WindowEvent e) {
+ public synchronized void windowActivated(final java.awt.event.WindowEvent e) {
// no propagation to NEWT child window
}
@Override
- public synchronized void windowDeactivated(java.awt.event.WindowEvent e) {
+ public synchronized void windowDeactivated(final java.awt.event.WindowEvent e) {
// no propagation to NEWT child window
}
@Override
- public synchronized void hierarchyChanged(java.awt.event.HierarchyEvent e) {
+ public synchronized void hierarchyChanged(final java.awt.event.HierarchyEvent e) {
if( !isSetup ) { return; }
final Window newtChild = getNewtWindow();
if( null != newtChild && null == getNewtEventListener() ) {
diff --git a/src/newt/classes/jogamp/newt/driver/PNGIcon.java b/src/newt/classes/jogamp/newt/driver/PNGIcon.java
index 967acd413..43cfa9b25 100644
--- a/src/newt/classes/jogamp/newt/driver/PNGIcon.java
+++ b/src/newt/classes/jogamp/newt/driver/PNGIcon.java
@@ -71,7 +71,7 @@ public class PNGIcon {
* @throws IOException
* @throws MalformedURLException
*/
- public static ByteBuffer arrayToX11BGRAImages(IOUtil.ClassResources resources, int[] data_size, int[] elem_bytesize) throws UnsupportedOperationException, InterruptedException, IOException, MalformedURLException {
+ public static ByteBuffer arrayToX11BGRAImages(final IOUtil.ClassResources resources, final int[] data_size, final int[] elem_bytesize) throws UnsupportedOperationException, InterruptedException, IOException, MalformedURLException {
if( avail ) {
return jogamp.newt.driver.opengl.JoglUtilPNGIcon.arrayToX11BGRAImages(resources, data_size, elem_bytesize);
}
diff --git a/src/newt/classes/jogamp/newt/driver/android/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/android/DisplayDriver.java
index 32bd970a1..a5f4fc769 100644
--- a/src/newt/classes/jogamp/newt/driver/android/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/android/DisplayDriver.java
@@ -56,7 +56,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
aDevice.open();
}
- protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+ protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
aDevice.close();
}
diff --git a/src/newt/classes/jogamp/newt/driver/android/MD.java b/src/newt/classes/jogamp/newt/driver/android/MD.java
index f2f30937b..e6316004b 100644
--- a/src/newt/classes/jogamp/newt/driver/android/MD.java
+++ b/src/newt/classes/jogamp/newt/driver/android/MD.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,13 +20,15 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
package jogamp.newt.driver.android;
+import jogamp.common.os.PlatformPropsImpl;
+
import com.jogamp.common.GlueGenVersion;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.VersionUtil;
@@ -34,22 +36,22 @@ import com.jogamp.opengl.JoglVersion;
public class MD {
public static final String TAG = "JogAmp.NEWT";
-
- public static String getInfo() {
- StringBuilder sb = new StringBuilder();
-
- sb.append(VersionUtil.getPlatformInfo()).append(Platform.NEWLINE)
- .append(GlueGenVersion.getInstance()).append(Platform.NEWLINE)
- .append(JoglVersion.getInstance()).append(Platform.NEWLINE)
- .append(Platform.NEWLINE);
-
+
+ public static String getInfo() {
+ final StringBuilder sb = new StringBuilder();
+
+ sb.append(VersionUtil.getPlatformInfo()).append(PlatformPropsImpl.NEWLINE)
+ .append(GlueGenVersion.getInstance()).append(PlatformPropsImpl.NEWLINE)
+ .append(JoglVersion.getInstance()).append(PlatformPropsImpl.NEWLINE)
+ .append(PlatformPropsImpl.NEWLINE);
+
JoglVersion.getDefaultOpenGLInfo(null, sb, true);
- return sb.toString();
+ return sb.toString();
}
-
- public static void main(String args[]) {
-
+
+ public static void main(final String args[]) {
+
System.err.println(getInfo());
}
}
diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java
index 27c570722..68d43ac75 100644
--- a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java
+++ b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java
@@ -57,7 +57,7 @@ public class NewtBaseActivity extends Activity {
Activity rootActivity;
boolean setThemeCalled = false;
- protected void startAnimation(boolean start) {
+ protected void startAnimation(final boolean start) {
if(null != animator) {
final boolean res;
if( start ) {
@@ -95,7 +95,7 @@ public class NewtBaseActivity extends Activity {
rootActivity = this;
}
- public void setRootActivity(Activity rootActivity) {
+ public void setRootActivity(final Activity rootActivity) {
this.rootActivity = rootActivity;
this.isDelegatedActivity = this != rootActivity;
}
@@ -194,11 +194,11 @@ public class NewtBaseActivity extends Activity {
}
private final GLStateKeeper.Listener glStateKeeperListener = new GLStateKeeper.Listener() {
@Override
- public void glStatePreserveNotify(GLStateKeeper glsk) {
+ public void glStatePreserveNotify(final GLStateKeeper glsk) {
Log.d(MD.TAG, "GLStateKeeper Preserving: 0x"+Integer.toHexString(glsk.hashCode()));
}
@Override
- public void glStateRestored(GLStateKeeper glsk) {
+ public void glStateRestored(final GLStateKeeper glsk) {
Log.d(MD.TAG, "GLStateKeeper Restored: 0x"+Integer.toHexString(glsk.hashCode()));
startAnimation(true);
}
@@ -212,7 +212,7 @@ public class NewtBaseActivity extends Activity {
* @param androidWindow
* @param newtWindow
*/
- public void layoutForNEWTWindow(android.view.Window androidWindow, Window newtWindow) {
+ public void layoutForNEWTWindow(final android.view.Window androidWindow, final Window newtWindow) {
if(null == androidWindow || null == newtWindow) {
throw new IllegalArgumentException("Android or NEWT Window null");
}
@@ -241,7 +241,7 @@ public class NewtBaseActivity extends Activity {
* @param androidWindow
* @param newtWindow
*/
- public void setFullscreenFeature(android.view.Window androidWindow, boolean fullscreen) {
+ public void setFullscreenFeature(final android.view.Window androidWindow, final boolean fullscreen) {
if(null == androidWindow) {
throw new IllegalArgumentException("Android or Window null");
}
@@ -262,7 +262,7 @@ public class NewtBaseActivity extends Activity {
* Must be called before creating the view and adding any content, i.e. setContentView() !
* </p>
*/
- protected void adaptTheme4Transparency(CapabilitiesImmutable caps) {
+ protected void adaptTheme4Transparency(final CapabilitiesImmutable caps) {
if(!caps.isBackgroundOpaque()) {
setTransparencyTheme();
}
@@ -308,7 +308,7 @@ public class NewtBaseActivity extends Activity {
* @see #setContentView(android.view.Window, Window)
* @see #addContentView(android.view.Window, Window, android.view.ViewGroup.LayoutParams)
*/
- public void setAnimator(GLAnimatorControl animator) {
+ public void setAnimator(final GLAnimatorControl animator) {
this.animator = animator;
if(!animator.isStarted()) {
animator.start();
@@ -326,7 +326,7 @@ public class NewtBaseActivity extends Activity {
}
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
Log.d(MD.TAG, "onCreate.0");
if(!isDelegatedActivity()) {
super.onCreate(savedInstanceState);
diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java
index 09de62326..4dd96c9a0 100644
--- a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java
+++ b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java
@@ -33,6 +33,8 @@ import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
+import jogamp.common.os.PlatformPropsImpl;
+
import com.jogamp.common.GlueGenVersion;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.VersionUtil;
@@ -49,7 +51,7 @@ import android.widget.TextView;
public class NewtVersionActivity extends NewtBaseActivity {
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setFullscreenFeature(getWindow(), true);
@@ -62,7 +64,7 @@ public class NewtVersionActivity extends NewtBaseActivity {
scroller.addView(tv);
viewGroup.addView(scroller, new android.widget.FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, Gravity.TOP|Gravity.LEFT));
- final String info1 = "JOGL Version Info"+Platform.NEWLINE+VersionUtil.getPlatformInfo()+Platform.NEWLINE+GlueGenVersion.getInstance()+Platform.NEWLINE+JoglVersion.getInstance()+Platform.NEWLINE;
+ final String info1 = "JOGL Version Info"+PlatformPropsImpl.NEWLINE+VersionUtil.getPlatformInfo()+PlatformPropsImpl.NEWLINE+GlueGenVersion.getInstance()+PlatformPropsImpl.NEWLINE+JoglVersion.getInstance()+PlatformPropsImpl.NEWLINE;
Log.d(MD.TAG, info1);
tv.setText(info1);
@@ -77,8 +79,8 @@ public class NewtVersionActivity extends NewtBaseActivity {
}
if( null != glp ) {
// create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
- GLCapabilities caps = new GLCapabilities(glp);
- GLWindow glWindow = GLWindow.create(caps);
+ final GLCapabilities caps = new GLCapabilities(glp);
+ final GLWindow glWindow = GLWindow.create(caps);
glWindow.setUndecorated(true);
glWindow.setSize(32, 32);
glWindow.setPosition(0, 0);
@@ -87,14 +89,14 @@ public class NewtVersionActivity extends NewtBaseActivity {
registerNEWTWindow(glWindow);
glWindow.addGLEventListener(new GLEventListener() {
- public void init(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
+ public void init(final GLAutoDrawable drawable) {
+ final GL gl = drawable.getGL();
final StringBuilder sb = new StringBuilder();
- sb.append(JoglVersion.getGLInfo(gl, null, true)).append(Platform.NEWLINE);
- sb.append("Requested: ").append(Platform.NEWLINE);
- sb.append(drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities()).append(Platform.NEWLINE).append(Platform.NEWLINE);
- sb.append("Chosen: ").append(Platform.NEWLINE);
- sb.append(drawable.getChosenGLCapabilities()).append(Platform.NEWLINE).append(Platform.NEWLINE);
+ sb.append(JoglVersion.getGLInfo(gl, null, true)).append(PlatformPropsImpl.NEWLINE);
+ sb.append("Requested: ").append(PlatformPropsImpl.NEWLINE);
+ sb.append(drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities()).append(PlatformPropsImpl.NEWLINE).append(PlatformPropsImpl.NEWLINE);
+ sb.append("Chosen: ").append(PlatformPropsImpl.NEWLINE);
+ sb.append(drawable.getChosenGLCapabilities()).append(PlatformPropsImpl.NEWLINE).append(PlatformPropsImpl.NEWLINE);
final String info2 = sb.toString();
// Log.d(MD.TAG, info2); // too big!
System.err.println(info2);
@@ -105,13 +107,13 @@ public class NewtVersionActivity extends NewtBaseActivity {
} } );
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
});
glWindow.setVisible(true);
diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java
index 553900f6a..190f55e71 100644
--- a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java
+++ b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java
@@ -8,7 +8,7 @@ import android.util.Log;
public class NewtVersionActivityLauncher extends Activity {
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Uri uri = Uri.parse("launch://jogamp.org/jogamp.newt.driver.android.NewtVersionActivity?sys=com.jogamp.common&sys=javax.media.opengl&pkg=com.jogamp.opengl.test&jogamp.debug=all&nativewindow.debug=all&jogl.debug=all&newt.debug=all");
diff --git a/src/newt/classes/jogamp/newt/driver/android/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/android/ScreenDriver.java
index a4c70343d..b28cdcbed 100644
--- a/src/newt/classes/jogamp/newt/driver/android/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/android/ScreenDriver.java
@@ -60,11 +60,11 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
protected void closeNativeImpl() { }
@Override
- protected int validateScreenIndex(int idx) {
+ protected int validateScreenIndex(final int idx) {
return 0; // FIXME: only one screen available ?
}
- private final MonitorMode getModeImpl(final Cache cache, final android.view.Display aDisplay, DisplayMetrics outMetrics, int modeIdx, int screenSizeNRot, int nrot) {
+ private final MonitorMode getModeImpl(final Cache cache, final android.view.Display aDisplay, final DisplayMetrics outMetrics, final int modeIdx, final int screenSizeNRot, final int nrot) {
final int[] props = new int[MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL];
int i = 0;
props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
@@ -78,7 +78,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
}
@Override
- protected void collectNativeMonitorModesAndDevicesImpl(Cache cache) {
+ protected void collectNativeMonitorModesAndDevicesImpl(final Cache cache) {
// FIXME: Multi Monitor Implementation missing [for newer Android version ?]
final Context ctx = jogamp.common.os.android.StaticContext.getContext();
@@ -94,7 +94,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
MonitorMode currentMode = null;
for(int r=0; r<4; r++) { // for all rotations
final int nrot_i = r*MonitorMode.ROTATE_90;
- MonitorMode mode = getModeImpl(cache, aDisplay, outMetrics, modeIdx, 0, nrot_i);
+ final MonitorMode mode = getModeImpl(cache, aDisplay, outMetrics, modeIdx, 0, nrot_i);
if( nrot == nrot_i ) {
currentMode = mode;
}
@@ -117,7 +117,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
}
@Override
- protected MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor) {
+ protected MonitorMode queryCurrentMonitorModeImpl(final MonitorDevice monitor) {
final Context ctx = jogamp.common.os.android.StaticContext.getContext();
final WindowManager wmgr = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE);
final DisplayMetrics outMetrics = new DisplayMetrics();
@@ -129,14 +129,14 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
}
@Override
- protected boolean setCurrentMonitorModeImpl(MonitorDevice monitor, MonitorMode mode) {
+ protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
return false;
}
//----------------------------------------------------------------------
// Internals only
//
- static int androidRotation2NewtRotation(int arot) {
+ static int androidRotation2NewtRotation(final int arot) {
switch(arot) {
case Surface.ROTATION_270: return MonitorMode.ROTATE_270;
case Surface.ROTATION_180: return MonitorMode.ROTATE_180;
@@ -145,7 +145,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
}
return MonitorMode.ROTATE_0;
}
- static int getScreenSize(DisplayMetrics outMetrics, int nrot, int[] props, int offset) {
+ static int getScreenSize(final DisplayMetrics outMetrics, final int nrot, final int[] props, int offset) {
// swap width and height, since Android reflects rotated dimension, we don't
if (MonitorMode.ROTATE_90 == nrot || MonitorMode.ROTATE_270 == nrot) {
props[offset++] = outMetrics.heightPixels;
@@ -156,7 +156,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
}
return offset;
}
- static int getBpp(android.view.Display aDisplay, int[] props, int offset) {
+ static int getBpp(final android.view.Display aDisplay, final int[] props, int offset) {
int bpp;
switch(aDisplay.getPixelFormat()) {
case PixelFormat.RGBA_8888: bpp=32; break;
@@ -171,7 +171,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
props[offset++] = bpp;
return offset;
}
- static int getScreenSizeMM(DisplayMetrics outMetrics, int[] props, int offset) {
+ static int getScreenSizeMM(final DisplayMetrics outMetrics, final int[] props, int offset) {
final float inW = outMetrics.widthPixels / outMetrics.xdpi;
final float inH = outMetrics.heightPixels / outMetrics.ydpi;
final float mmpi = 25.4f;
diff --git a/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java
index db530cb7e..786ebb31c 100644
--- a/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java
@@ -50,6 +50,7 @@ import javax.media.opengl.GLException;
import com.jogamp.common.os.AndroidVersion;
import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
import com.jogamp.newt.MonitorDevice;
+import com.jogamp.newt.Window;
import jogamp.opengl.egl.EGL;
import jogamp.opengl.egl.EGLDisplayUtil;
@@ -87,7 +88,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
* @param rCaps requested Capabilities
* @return An Android PixelFormat number suitable for {@link SurfaceHolder#setFormat(int)}.
*/
- public static final int getSurfaceHolderFormat(CapabilitiesImmutable rCaps) {
+ public static final int getSurfaceHolderFormat(final CapabilitiesImmutable rCaps) {
int fmt = PixelFormat.UNKNOWN;
if( !rCaps.isBackgroundOpaque() ) {
@@ -121,7 +122,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
* @param androidPixelFormat An Android PixelFormat delivered via {@link Callback2#surfaceChanged(SurfaceHolder, int, int, int)} params.
* @return A native Android PixelFormat number suitable for {@link #setSurfaceVisualID0(long, int)}.
*/
- public static final int getANativeWindowFormat(int androidPixelFormat) {
+ public static final int getANativeWindowFormat(final int androidPixelFormat) {
final int nativePixelFormat;
switch(androidPixelFormat) {
case PixelFormat.RGBA_8888:
@@ -155,8 +156,8 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
* @param rCaps requested Capabilities
* @return The fixed Capabilities
*/
- public static final CapabilitiesImmutable fixCaps(boolean matchFormatPrecise, int format, CapabilitiesImmutable rCaps) {
- PixelFormat pf = new PixelFormat();
+ public static final CapabilitiesImmutable fixCaps(final boolean matchFormatPrecise, final int format, final CapabilitiesImmutable rCaps) {
+ final PixelFormat pf = new PixelFormat();
PixelFormat.getPixelFormatInfo(format, pf);
final CapabilitiesImmutable res;
int r, g, b, a;
@@ -178,7 +179,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
rCaps.getAlphaBits() > a ;
if(change) {
- Capabilities nCaps = (Capabilities) rCaps.cloneMutable();
+ final Capabilities nCaps = (Capabilities) rCaps.cloneMutable();
nCaps.setRedBits(r);
nCaps.setGreenBits(g);
nCaps.setBlueBits(b);
@@ -194,7 +195,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
return res;
}
- public static final boolean isAndroidFormatTransparent(int aFormat) {
+ public static final boolean isAndroidFormatTransparent(final int aFormat) {
switch (aFormat) {
case PixelFormat.TRANSLUCENT:
case PixelFormat.TRANSPARENT:
@@ -211,7 +212,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
reset();
}
- public void registerActivity(Activity activity) {
+ public void registerActivity(final Activity activity) {
this.activity = activity;
}
protected Activity activity = null;
@@ -253,7 +254,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
}
}
- private final void setupAndroidView(Context ctx) {
+ private final void setupAndroidView(final Context ctx) {
androidView = new MSurfaceView(ctx);
final SurfaceHolder sh = androidView.getHolder();
@@ -280,7 +281,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
@Override
protected final boolean canCreateNativeImpl() {
Log.d(MD.TAG, "canCreateNativeImpl.0: surfaceHandle ready "+(0!=surfaceHandle)+" - on thread "+Thread.currentThread().getName());
- if(WindowImpl.DEBUG_IMPLEMENTATION) {
+ if(Window.DEBUG_IMPLEMENTATION) {
Thread.dumpStack();
}
@@ -308,7 +309,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
Log.d(MD.TAG, "canCreateNativeImpl: added to static ViewGroup - on thread "+Thread.currentThread().getName());
} });
for(long sleep = TIMEOUT_NATIVEWINDOW; 0<sleep && 0 == surfaceHandle; sleep-=10 ) {
- try { Thread.sleep(10); } catch (InterruptedException ie) {}
+ try { Thread.sleep(10); } catch (final InterruptedException ie) {}
}
b = 0 != surfaceHandle;
Log.d(MD.TAG, "canCreateNativeImpl: surfaceHandle ready(2) "+b+" - on thread "+Thread.currentThread().getName());
@@ -384,7 +385,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
", format [a "+androidFormat+", n "+nativeFormat+"], win["+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+
"], pixel["+getSurfaceWidth()+"x"+getSurfaceHeight()+"],"+
" - on thread "+Thread.currentThread().getName());
- if(WindowImpl.DEBUG_IMPLEMENTATION) {
+ if(Window.DEBUG_IMPLEMENTATION) {
Thread.dumpStack();
}
@@ -395,7 +396,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
if (!EGL.eglDestroySurface(eglDevice.getHandle(), eglSurface)) {
throw new GLException("Error destroying window surface (eglDestroySurface)");
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
Log.d(MD.TAG, "closeNativeImpl: Catch exception "+t.getMessage());
t.printStackTrace();
} finally {
@@ -437,12 +438,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
* {@inheritDoc}
*/
@Override
- public final void focusChanged(boolean defer, boolean focusGained) {
+ public final void focusChanged(final boolean defer, final boolean focusGained) {
super.focusChanged(defer, focusGained);
}
@Override
- protected final void requestFocusImpl(boolean reparented) {
+ protected final void requestFocusImpl(final boolean reparented) {
if(null != androidView) {
Log.d(MD.TAG, "requestFocusImpl: reparented "+reparented);
androidView.post(new Runnable() {
@@ -455,7 +456,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
}
@Override
- protected final boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+ protected final boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final int flags) {
boolean res = true;
if( 0 != ( FLAG_CHANGE_FULLSCREEN & flags) ) {
@@ -485,12 +486,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
}
@Override
- protected final Point getLocationOnScreenImpl(int x, int y) {
+ protected final Point getLocationOnScreenImpl(final int x, final int y) {
return new Point(x,y);
}
@Override
- protected final void updateInsetsImpl(Insets insets) {
+ protected final void updateInsetsImpl(final Insets insets) {
// nop ..
}
@@ -504,7 +505,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
}
@Override
- public void onReceiveResult(int r, Bundle data) {
+ public void onReceiveResult(final int r, final Bundle data) {
boolean v = false;
switch(r) {
@@ -524,7 +525,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
private final KeyboardVisibleReceiver keyboardVisibleReceiver = new KeyboardVisibleReceiver();
@Override
- protected final boolean setKeyboardVisibleImpl(boolean visible) {
+ protected final boolean setKeyboardVisibleImpl(final boolean visible) {
if(null != androidView) {
final InputMethodManager imm = (InputMethodManager) getAndroidView().getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
final IBinder winid = getAndroidView().getWindowToken();
@@ -547,15 +548,15 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
//
@Override
- public final void surfaceCreated(SurfaceHolder holder) {
+ public final void surfaceCreated(final SurfaceHolder holder) {
Log.d(MD.TAG, "surfaceCreated: win["+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+
"], pixels["+" "+getSurfaceWidth()+"x"+getSurfaceHeight()+"] - on thread "+Thread.currentThread().getName());
}
@Override
- public final void surfaceChanged(SurfaceHolder aHolder, int aFormat, int aWidth, int aHeight) {
+ public final void surfaceChanged(final SurfaceHolder aHolder, final int aFormat, final int aWidth, final int aHeight) {
Log.d(MD.TAG, "surfaceChanged: f "+nativeFormat+" -> "+aFormat+", "+aWidth+"x"+aHeight+", current surfaceHandle: 0x"+Long.toHexString(surfaceHandle)+" - on thread "+Thread.currentThread().getName());
- if(WindowImpl.DEBUG_IMPLEMENTATION) {
+ if(Window.DEBUG_IMPLEMENTATION) {
Thread.dumpStack();
}
if(0!=surfaceHandle && androidFormat != aFormat ) {
@@ -607,19 +608,19 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
}
@Override
- public final void surfaceDestroyed(SurfaceHolder holder) {
+ public final void surfaceDestroyed(final SurfaceHolder holder) {
Log.d(MD.TAG, "surfaceDestroyed - on thread "+Thread.currentThread().getName());
windowDestroyNotify(true); // actually too late .. however ..
Thread.dumpStack();
}
@Override
- public final void surfaceRedrawNeeded(SurfaceHolder holder) {
+ public final void surfaceRedrawNeeded(final SurfaceHolder holder) {
Log.d(MD.TAG, "surfaceRedrawNeeded - on thread "+Thread.currentThread().getName());
windowRepaint(0, 0, getSurfaceWidth(), getSurfaceHeight());
}
- protected boolean handleKeyCodeBack(KeyEvent.DispatcherState state, android.view.KeyEvent event) {
+ protected boolean handleKeyCodeBack(final KeyEvent.DispatcherState state, final android.view.KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount() == 0) {
Log.d(MD.TAG, "handleKeyCodeBack.0 : "+event);
state.startTracking(event, this);
@@ -646,7 +647,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
}
return false; // continue w/ further processing
}
- private void enqueueAKey2NKeyUpDown(android.view.KeyEvent aEvent, short newtKeyCode) {
+ private void enqueueAKey2NKeyUpDown(final android.view.KeyEvent aEvent, final short newtKeyCode) {
final com.jogamp.newt.event.KeyEvent eDown = AndroidNewtEventFactory.createKeyEvent(aEvent, newtKeyCode, com.jogamp.newt.event.KeyEvent.EVENT_KEY_PRESSED, this);
final com.jogamp.newt.event.KeyEvent eUp = AndroidNewtEventFactory.createKeyEvent(aEvent, newtKeyCode, com.jogamp.newt.event.KeyEvent.EVENT_KEY_RELEASED, this);
enqueueEvent(false, eDown);
@@ -654,7 +655,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
}
@Override
- protected void consumeKeyEvent(com.jogamp.newt.event.KeyEvent e) {
+ protected void consumeKeyEvent(final com.jogamp.newt.event.KeyEvent e) {
super.consumeKeyEvent(e); // consume event, i.e. call all KeyListener
if( com.jogamp.newt.event.KeyEvent.EVENT_KEY_RELEASED == e.getEventType() && !e.isConsumed() ) {
if( com.jogamp.newt.event.KeyEvent.VK_ESCAPE == e.getKeyCode() ) {
@@ -667,11 +668,11 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
}
}
private void triggerHome() {
- Context ctx = StaticContext.getContext();
+ final Context ctx = StaticContext.getContext();
if(null == ctx) {
throw new NativeWindowException("No static [Application] Context has been set. Call StaticContext.setContext(Context) first.");
}
- Intent showOptions = new Intent(Intent.ACTION_MAIN);
+ final Intent showOptions = new Intent(Intent.ACTION_MAIN);
showOptions.addCategory(Intent.CATEGORY_HOME);
ctx.startActivity(showOptions);
}
@@ -686,14 +687,14 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
private long eglSurface;
class MSurfaceView extends SurfaceView {
- public MSurfaceView (Context ctx) {
+ public MSurfaceView (final Context ctx) {
super(ctx);
setBackgroundDrawable(null);
// setBackgroundColor(Color.TRANSPARENT);
}
@Override
- public boolean onKeyPreIme(int keyCode, KeyEvent event) {
+ public boolean onKeyPreIme(final int keyCode, final KeyEvent event) {
Log.d(MD.TAG, "onKeyPreIme : "+event);
if ( event.getKeyCode() == KeyEvent.KEYCODE_BACK ) {
final KeyEvent.DispatcherState state = getKeyDispatcherState();
diff --git a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java
index aef822262..05191e200 100644
--- a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java
@@ -43,7 +43,7 @@ public class AndroidNewtEventFactory {
/** API Level 12: {@link android.view.MotionEvent#ACTION_SCROLL} = {@value} */
private static final int ACTION_SCROLL = 8;
- private static final com.jogamp.newt.event.MouseEvent.PointerType aToolType2PointerType(int aToolType) {
+ private static final com.jogamp.newt.event.MouseEvent.PointerType aToolType2PointerType(final int aToolType) {
switch( aToolType ) {
case MotionEvent.TOOL_TYPE_FINGER:
return com.jogamp.newt.event.MouseEvent.PointerType.TouchScreen;
@@ -57,7 +57,7 @@ public class AndroidNewtEventFactory {
}
}
- private static final short aMotionEventType2Newt(int aType) {
+ private static final short aMotionEventType2Newt(final int aType) {
switch( aType ) {
case android.view.MotionEvent.ACTION_DOWN:
case android.view.MotionEvent.ACTION_POINTER_DOWN:
@@ -79,7 +79,7 @@ public class AndroidNewtEventFactory {
return (short)0;
}
- private static final short aAccessibilityEventType2Newt(int aType) {
+ private static final short aAccessibilityEventType2Newt(final int aType) {
switch( aType ) {
case android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED:
return com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_GAINED_FOCUS;
@@ -87,7 +87,7 @@ public class AndroidNewtEventFactory {
return (short)0;
}
- private static final short aKeyEventType2NewtEventType(int androidKeyAction) {
+ private static final short aKeyEventType2NewtEventType(final int androidKeyAction) {
switch(androidKeyAction) {
case android.view.KeyEvent.ACTION_DOWN:
case android.view.KeyEvent.ACTION_MULTIPLE:
@@ -98,7 +98,7 @@ public class AndroidNewtEventFactory {
return (short)0;
}
- private static final short aKeyCode2NewtKeyCode(int androidKeyCode, boolean inclSysKeys) {
+ private static final short aKeyCode2NewtKeyCode(final int androidKeyCode, final boolean inclSysKeys) {
if(android.view.KeyEvent.KEYCODE_0 <= androidKeyCode && androidKeyCode <= android.view.KeyEvent.KEYCODE_9) {
return (short) ( com.jogamp.newt.event.KeyEvent.VK_0 + ( androidKeyCode - android.view.KeyEvent.KEYCODE_0 ) );
}
@@ -156,7 +156,7 @@ public class AndroidNewtEventFactory {
return com.jogamp.newt.event.KeyEvent.VK_UNDEFINED;
}
- private static final int aKeyModifiers2Newt(int androidMods) {
+ private static final int aKeyModifiers2Newt(final int androidMods) {
int newtMods = 0;
if ((androidMods & android.view.KeyEvent.META_SYM_ON) != 0) newtMods |= com.jogamp.newt.event.InputEvent.META_MASK;
if ((androidMods & android.view.KeyEvent.META_SHIFT_ON) != 0) newtMods |= com.jogamp.newt.event.InputEvent.SHIFT_MASK;
@@ -165,7 +165,7 @@ public class AndroidNewtEventFactory {
return newtMods;
}
- public static com.jogamp.newt.event.WindowEvent createWindowEvent(android.view.accessibility.AccessibilityEvent event, com.jogamp.newt.Window newtSource) {
+ public static com.jogamp.newt.event.WindowEvent createWindowEvent(final android.view.accessibility.AccessibilityEvent event, final com.jogamp.newt.Window newtSource) {
final int aType = event.getEventType();
final short nType = aAccessibilityEventType2Newt(aType);
@@ -176,7 +176,7 @@ public class AndroidNewtEventFactory {
}
- public static com.jogamp.newt.event.KeyEvent createKeyEvent(android.view.KeyEvent aEvent, com.jogamp.newt.Window newtSource, boolean inclSysKeys) {
+ public static com.jogamp.newt.event.KeyEvent createKeyEvent(final android.view.KeyEvent aEvent, final com.jogamp.newt.Window newtSource, final boolean inclSysKeys) {
final com.jogamp.newt.event.KeyEvent res;
final short newtType = aKeyEventType2NewtEventType(aEvent.getAction());
if( (short)0 != newtType) {
@@ -191,7 +191,7 @@ public class AndroidNewtEventFactory {
return res;
}
- public static com.jogamp.newt.event.KeyEvent createKeyEvent(android.view.KeyEvent aEvent, short newtType, com.jogamp.newt.Window newtSource, boolean inclSysKeys) {
+ public static com.jogamp.newt.event.KeyEvent createKeyEvent(final android.view.KeyEvent aEvent, final short newtType, final com.jogamp.newt.Window newtSource, final boolean inclSysKeys) {
final short newtKeyCode = aKeyCode2NewtKeyCode(aEvent.getKeyCode(), inclSysKeys);
final com.jogamp.newt.event.KeyEvent res = createKeyEventImpl(aEvent, newtType, newtKeyCode, newtSource);
if(DEBUG_KEY_EVENT) {
@@ -200,7 +200,7 @@ public class AndroidNewtEventFactory {
return res;
}
- public static com.jogamp.newt.event.KeyEvent createKeyEvent(android.view.KeyEvent aEvent, short newtKeyCode, short newtType, com.jogamp.newt.Window newtSource) {
+ public static com.jogamp.newt.event.KeyEvent createKeyEvent(final android.view.KeyEvent aEvent, final short newtKeyCode, final short newtType, final com.jogamp.newt.Window newtSource) {
final com.jogamp.newt.event.KeyEvent res = createKeyEventImpl(aEvent, newtType, newtKeyCode, newtSource);
if(DEBUG_KEY_EVENT) {
System.err.println("createKeyEvent2: newtType "+NEWTEvent.toHexString(newtType)+", "+aEvent+" -> "+res);
@@ -208,7 +208,7 @@ public class AndroidNewtEventFactory {
return res;
}
- private static com.jogamp.newt.event.KeyEvent createKeyEventImpl(android.view.KeyEvent aEvent, short newtType, short newtKeyCode, com.jogamp.newt.Window newtSource) {
+ private static com.jogamp.newt.event.KeyEvent createKeyEventImpl(final android.view.KeyEvent aEvent, final short newtType, final short newtKeyCode, final com.jogamp.newt.Window newtSource) {
if( (short)0 != newtType && com.jogamp.newt.event.KeyEvent.VK_UNDEFINED != newtKeyCode ) {
final Object src = null==newtSource ? null : newtSource;
final long unixTime = System.currentTimeMillis() + ( aEvent.getEventTime() - android.os.SystemClock.uptimeMillis() );
@@ -243,7 +243,7 @@ public class AndroidNewtEventFactory {
}
private final int touchSlop;
- public AndroidNewtEventFactory(android.content.Context context, android.os.Handler handler) {
+ public AndroidNewtEventFactory(final android.content.Context context, final android.os.Handler handler) {
final android.view.ViewConfiguration configuration = android.view.ViewConfiguration.get(context);
touchSlop = configuration.getScaledTouchSlop();
final int doubleTapSlop = configuration.getScaledDoubleTapSlop();
@@ -253,7 +253,7 @@ public class AndroidNewtEventFactory {
}
}
- private static void collectPointerData(MotionEvent e, int count, final int[] x, final int[] y, final float[] pressure,
+ private static void collectPointerData(final MotionEvent e, final int count, final int[] x, final int[] y, final float[] pressure,
final short[] pointerIds, final MouseEvent.PointerType[] pointerTypes) {
for(int i=0; i < count; i++) {
x[i] = (int)e.getX(i);
@@ -270,8 +270,8 @@ public class AndroidNewtEventFactory {
}
}
- public boolean sendPointerEvent(boolean enqueue, boolean wait, boolean setFocusOnDown, boolean isOnTouchEvent,
- android.view.MotionEvent event, jogamp.newt.driver.android.WindowDriver newtSource) {
+ public boolean sendPointerEvent(final boolean enqueue, final boolean wait, final boolean setFocusOnDown, final boolean isOnTouchEvent,
+ final android.view.MotionEvent event, final jogamp.newt.driver.android.WindowDriver newtSource) {
if(DEBUG_MOUSE_EVENT) {
System.err.println("createMouseEvent: isOnTouchEvent "+isOnTouchEvent+", "+event);
}
diff --git a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventTranslator.java b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventTranslator.java
index 5a4743f73..8d20ef448 100644
--- a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventTranslator.java
+++ b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventTranslator.java
@@ -6,35 +6,35 @@ import android.view.View;
public class AndroidNewtEventTranslator implements View.OnKeyListener, View.OnTouchListener, View.OnFocusChangeListener, View.OnGenericMotionListener {
private final WindowDriver newtWindow;
private final AndroidNewtEventFactory factory;
-
- public AndroidNewtEventTranslator(WindowDriver newtWindow, android.content.Context context, android.os.Handler handler) {
+
+ public AndroidNewtEventTranslator(final WindowDriver newtWindow, final android.content.Context context, final android.os.Handler handler) {
this.newtWindow = newtWindow;
- this.factory = new AndroidNewtEventFactory(context, handler);
+ this.factory = new AndroidNewtEventFactory(context, handler);
}
-
- private final boolean processTouchMotionEvents(View v, android.view.MotionEvent event, boolean isOnTouchEvent) {
- final boolean eventSent = factory.sendPointerEvent(true /*enqueue*/, false /*wait*/, true /*setFocusOnDown*/,
+
+ private final boolean processTouchMotionEvents(final View v, final android.view.MotionEvent event, final boolean isOnTouchEvent) {
+ final boolean eventSent = factory.sendPointerEvent(true /*enqueue*/, false /*wait*/, true /*setFocusOnDown*/,
isOnTouchEvent, event, newtWindow);
if( eventSent ) {
try { Thread.sleep((long) (100.0F/3.0F)); } // 33 ms - FIXME ??
- catch(InterruptedException e) { }
+ catch(final InterruptedException e) { }
return true; // consumed/handled, further interest in events
}
- return false; // no mapping, no further interest in the event!
+ return false; // no mapping, no further interest in the event!
}
-
+
@Override
- public boolean onTouch(View v, android.view.MotionEvent event) {
+ public boolean onTouch(final View v, final android.view.MotionEvent event) {
return processTouchMotionEvents(v, event, true);
}
@Override
- public boolean onGenericMotion(View v, android.view.MotionEvent event) {
+ public boolean onGenericMotion(final View v, final android.view.MotionEvent event) {
return processTouchMotionEvents(v, event, false);
}
-
+
@Override
- public boolean onKey(View v, int keyCode, android.view.KeyEvent event) {
+ public boolean onKey(final View v, final int keyCode, final android.view.KeyEvent event) {
final com.jogamp.newt.event.KeyEvent newtEvent = AndroidNewtEventFactory.createKeyEvent(event, newtWindow, false /* no system keys */);
if(null != newtEvent) {
newtWindow.enqueueEvent(false, newtEvent);
@@ -42,9 +42,9 @@ public class AndroidNewtEventTranslator implements View.OnKeyListener, View.OnTo
}
return false;
}
-
+
@Override
- public void onFocusChange(View v, boolean hasFocus) {
+ public void onFocusChange(final View v, final boolean hasFocus) {
newtWindow.focusChanged(false, hasFocus);
}
}
diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
index 540d9b7e8..eccdd63cf 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
@@ -75,7 +75,7 @@ public class AWTCanvas extends Canvas {
private boolean displayConfigChanged=false;
- public AWTCanvas(CapabilitiesImmutable capabilities, CapabilitiesChooser chooser, UpstreamScalable upstreamScale) {
+ public AWTCanvas(final CapabilitiesImmutable capabilities, final CapabilitiesChooser chooser, final UpstreamScalable upstreamScale) {
super();
if(null==capabilities) {
@@ -95,7 +95,7 @@ public class AWTCanvas extends Canvas {
* canvas from interfering with the OpenGL rendering.
*/
@Override
- public void update(Graphics g) {
+ public void update(final Graphics g) {
// paint(g);
}
@@ -105,11 +105,11 @@ public class AWTCanvas extends Canvas {
properly.
*/
@Override
- public void paint(Graphics g) {
+ public void paint(final Graphics g) {
}
public boolean hasDeviceChanged() {
- boolean res = displayConfigChanged;
+ final boolean res = displayConfigChanged;
displayConfigChanged=false;
return res;
}
@@ -152,7 +152,7 @@ public class AWTCanvas extends Canvas {
jawtWindow.unlockSurface();
}
- GraphicsConfiguration gc = super.getGraphicsConfiguration();
+ final GraphicsConfiguration gc = super.getGraphicsConfiguration();
if(null!=gc) {
device = gc.getDevice();
}
@@ -188,12 +188,12 @@ public class AWTCanvas extends Canvas {
jawtWindow=null;
}
if(null != awtConfig) {
- AbstractGraphicsDevice adevice = awtConfig.getNativeGraphicsConfiguration().getScreen().getDevice();
+ final AbstractGraphicsDevice adevice = awtConfig.getNativeGraphicsConfiguration().getScreen().getDevice();
String adeviceMsg=null;
if(Window.DEBUG_IMPLEMENTATION) {
adeviceMsg = adevice.toString();
}
- boolean closed = adevice.close();
+ final boolean closed = adevice.close();
if(Window.DEBUG_IMPLEMENTATION) {
System.err.println(getThreadName()+": AWTCanvas.dispose(): closed GraphicsDevice: "+adeviceMsg+", result: "+closed);
}
@@ -255,11 +255,11 @@ public class AWTCanvas extends Canvas {
* block, both devices should have the same visual list, and the
* same configuration should be selected here.
*/
- AWTGraphicsConfiguration config = chooseGraphicsConfiguration(
+ final AWTGraphicsConfiguration config = chooseGraphicsConfiguration(
awtConfig.getChosenCapabilities(), awtConfig.getRequestedCapabilities(), chooser, gc.getDevice());
final GraphicsConfiguration compatible = (null!=config)?config.getAWTGraphicsConfiguration():null;
if(Window.DEBUG_IMPLEMENTATION) {
- Exception e = new Exception("Info: Call Stack: "+Thread.currentThread().getName());
+ final Exception e = new Exception("Info: Call Stack: "+Thread.currentThread().getName());
e.printStackTrace();
System.err.println("Created Config (n): HAVE GC "+chosen);
System.err.println("Created Config (n): THIS GC "+gc);
@@ -307,14 +307,14 @@ public class AWTCanvas extends Canvas {
return gc;
}
- private static AWTGraphicsConfiguration chooseGraphicsConfiguration(CapabilitiesImmutable capsChosen,
- CapabilitiesImmutable capsRequested,
- CapabilitiesChooser chooser,
- GraphicsDevice device) {
+ private static AWTGraphicsConfiguration chooseGraphicsConfiguration(final CapabilitiesImmutable capsChosen,
+ final CapabilitiesImmutable capsRequested,
+ final CapabilitiesChooser chooser,
+ final GraphicsDevice device) {
final AbstractGraphicsScreen aScreen = null != device ?
AWTGraphicsScreen.createScreenDevice(device, AbstractGraphicsDevice.DEFAULT_UNIT):
AWTGraphicsScreen.createDefault();
- AWTGraphicsConfiguration config = (AWTGraphicsConfiguration)
+ final AWTGraphicsConfiguration config = (AWTGraphicsConfiguration)
GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class, capsChosen.getClass()).chooseGraphicsConfiguration(capsChosen,
capsRequested,
chooser, aScreen, VisualIDHolder.VID_UNDEFINED);
@@ -346,16 +346,16 @@ public class AWTCanvas extends Canvas {
clazz.getDeclaredMethod("disableBackgroundErase",
new Class[] { Canvas.class });
disableBackgroundEraseMethod.setAccessible(true);
- } catch (Exception e) {
+ } catch (final Exception e) {
clazz = clazz.getSuperclass();
}
}
- } catch (Exception e) {
+ } catch (final Exception e) {
}
return null;
}
});
- } catch (Exception e) {
+ } catch (final Exception e) {
}
disableBackgroundEraseInitialized = true;
if(Window.DEBUG_IMPLEMENTATION) {
@@ -367,7 +367,7 @@ public class AWTCanvas extends Canvas {
Throwable t=null;
try {
disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this });
- } catch (Exception e) {
+ } catch (final Exception e) {
// FIXME: workaround for 6504460 (incorrect backport of 6333613 in 5.0u10)
// throw new GLException(e);
t = e;
diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
index 407d3abf9..c961669e8 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
@@ -49,7 +49,7 @@ public class AWTEDTUtil implements EDTUtil {
private int start_iter=0;
private static long pollPeriod = EDTUtil.defaultEDTPollPeriod;
- public AWTEDTUtil(ThreadGroup tg, String name, Runnable dispatchMessages) {
+ public AWTEDTUtil(final ThreadGroup tg, final String name, final Runnable dispatchMessages) {
this.threadGroup = tg;
this.name=Thread.currentThread().getName()+"-"+name+"-EDT-";
this.dispatchMessages=dispatchMessages;
@@ -63,7 +63,7 @@ public class AWTEDTUtil implements EDTUtil {
}
@Override
- final public void setPollPeriod(long ms) {
+ final public void setPollPeriod(final long ms) {
pollPeriod = ms;
}
@@ -121,16 +121,16 @@ public class AWTEDTUtil implements EDTUtil {
}
@Override
- public final boolean invokeStop(boolean wait, Runnable task) {
+ public final boolean invokeStop(final boolean wait, final Runnable task) {
return invokeImpl(wait, task, true);
}
@Override
- public final boolean invoke(boolean wait, Runnable task) {
+ public final boolean invoke(final boolean wait, final Runnable task) {
return invokeImpl(wait, task, false);
}
- private final boolean invokeImpl(boolean wait, Runnable task, boolean stop) {
+ private final boolean invokeImpl(boolean wait, final Runnable task, final boolean stop) {
Throwable throwable = null;
RunnableTask rTask = null;
final Object rTaskLock = new Object();
@@ -187,7 +187,7 @@ public class AWTEDTUtil implements EDTUtil {
if( wait ) {
try {
rTaskLock.wait(); // free lock, allow execution of rTask
- } catch (InterruptedException ie) {
+ } catch (final InterruptedException ie) {
throwable = ie;
}
if(null==throwable) {
@@ -218,7 +218,7 @@ public class AWTEDTUtil implements EDTUtil {
@Override
public void run() { }
});
- } catch (Exception e) { }
+ } catch (final Exception e) { }
return true;
}
@@ -229,7 +229,7 @@ public class AWTEDTUtil implements EDTUtil {
while( nedt.isRunning ) {
try {
edtLock.wait();
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -245,7 +245,7 @@ public class AWTEDTUtil implements EDTUtil {
volatile boolean isRunning = false;
Object sync = new Object();
- public NEDT(ThreadGroup tg, String name) {
+ public NEDT(final ThreadGroup tg, final String name) {
super(tg, name);
}
@@ -284,13 +284,13 @@ public class AWTEDTUtil implements EDTUtil {
if(!shouldStop) {
try {
sync.wait(pollPeriod);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
}
} while(!shouldStop) ;
- } catch (Throwable t) {
+ } catch (final Throwable t) {
// handle errors ..
shouldStop = true;
if(t instanceof RuntimeException) {
diff --git a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
index d9a4a48e5..23da69dba 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
@@ -51,7 +51,7 @@ public class DisplayDriver extends DisplayImpl {
aDevice = AWTGraphicsDevice.createDefault();
}
- protected void setAWTGraphicsDevice(AWTGraphicsDevice d) {
+ protected void setAWTGraphicsDevice(final AWTGraphicsDevice d) {
aDevice = d;
}
@@ -70,7 +70,7 @@ public class DisplayDriver extends DisplayImpl {
}
@Override
- protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+ protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
aDevice.close();
}
diff --git a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
index 128c94e87..57948cfc3 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
@@ -54,7 +54,7 @@ public class ScreenDriver extends ScreenImpl {
aScreen = new AWTGraphicsScreen((AWTGraphicsDevice)display.getGraphicsDevice());
}
- protected void setAWTGraphicsScreen(AWTGraphicsScreen s) {
+ protected void setAWTGraphicsScreen(final AWTGraphicsScreen s) {
aScreen = s;
}
@@ -70,11 +70,11 @@ public class ScreenDriver extends ScreenImpl {
protected void closeNativeImpl() { }
@Override
- protected int validateScreenIndex(int idx) {
+ protected int validateScreenIndex(final int idx) {
return idx; // pass through ...
}
- private static MonitorMode getModeProps(Cache cache, DisplayMode mode) {
+ private static MonitorMode getModeProps(final Cache cache, final DisplayMode mode) {
int rate = mode.getRefreshRate();
if( DisplayMode.REFRESH_RATE_UNKNOWN == rate ) {
rate = ScreenImpl.default_sm_rate;
@@ -83,7 +83,7 @@ public class ScreenDriver extends ScreenImpl {
if( DisplayMode.BIT_DEPTH_MULTI == bpp ) {
bpp= ScreenImpl.default_sm_bpp;
}
- int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
+ final int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
int i = 0;
props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
props[i++] = mode.getWidth();
@@ -97,7 +97,7 @@ public class ScreenDriver extends ScreenImpl {
}
@Override
- protected void collectNativeMonitorModesAndDevicesImpl(Cache cache) {
+ protected void collectNativeMonitorModesAndDevicesImpl(final Cache cache) {
final GraphicsDevice awtGD = ((AWTGraphicsDevice)getDisplay().getGraphicsDevice()).getGraphicsDevice();
final DisplayMode[] awtModes = awtGD.getDisplayModes();
for(int i=0; i<awtModes.length; i++) {
@@ -123,12 +123,12 @@ public class ScreenDriver extends ScreenImpl {
}
@Override
- protected MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor) {
+ protected MonitorMode queryCurrentMonitorModeImpl(final MonitorDevice monitor) {
return null;
}
@Override
- protected boolean setCurrentMonitorModeImpl(MonitorDevice monitor, MonitorMode mode) {
+ protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
return false;
}
diff --git a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
index 4064fdb05..06dcb8ff5 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
@@ -72,7 +72,7 @@ public class WindowDriver extends WindowImpl {
return new Class<?>[] { Container.class } ;
}
- public WindowDriver(Container container) {
+ public WindowDriver(final Container container) {
super();
this.awtContainer = container;
if(container instanceof Frame) {
@@ -87,7 +87,7 @@ public class WindowDriver extends WindowImpl {
private AWTCanvas awtCanvas;
@Override
- protected void requestFocusImpl(boolean reparented) {
+ protected void requestFocusImpl(final boolean reparented) {
awtContainer.requestFocus();
}
@@ -174,7 +174,7 @@ public class WindowDriver extends WindowImpl {
@Override
public boolean hasDeviceChanged() {
- boolean res = awtCanvas.hasDeviceChanged();
+ final boolean res = awtCanvas.hasDeviceChanged();
if(res) {
final AWTGraphicsConfiguration cfg = awtCanvas.getAWTGraphicsConfiguration();
if (null == cfg) {
@@ -192,12 +192,12 @@ public class WindowDriver extends WindowImpl {
}
@Override
- protected void updateInsetsImpl(javax.media.nativewindow.util.Insets insets) {
+ protected void updateInsetsImpl(final javax.media.nativewindow.util.Insets insets) {
final Insets contInsets = awtContainer.getInsets();
insets.set(contInsets.left, contInsets.right, contInsets.top, contInsets.bottom);
}
- private void setCanvasSizeImpl(int width, int height) {
+ private void setCanvasSizeImpl(final int width, final int height) {
final Dimension szClient = new Dimension(width, height);
final java.awt.Window awtWindow = AWTMisc.getWindow(awtCanvas);
final Container c= null != awtWindow ? awtWindow : awtContainer;
@@ -217,7 +217,7 @@ public class WindowDriver extends WindowImpl {
awtContainer.validate();
}
}
- private void setFrameSizeImpl(int width, int height) {
+ private void setFrameSizeImpl(final int width, final int height) {
final Insets insets = awtContainer.getInsets();
final Dimension szContainer = new Dimension(width + insets.left + insets.right,
height + insets.top + insets.bottom);
@@ -231,7 +231,7 @@ public class WindowDriver extends WindowImpl {
}
@Override
- protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+ protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final int flags) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("AWTWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+
getReconfigureFlagsAsString(null, flags));
@@ -284,8 +284,8 @@ public class WindowDriver extends WindowImpl {
}
@Override
- protected Point getLocationOnScreenImpl(int x, int y) {
- java.awt.Point ap = awtCanvas.getLocationOnScreen();
+ protected Point getLocationOnScreenImpl(final int x, final int y) {
+ final java.awt.Point ap = awtCanvas.getLocationOnScreen();
ap.translate(x, y);
return new Point((int)(ap.getX()+0.5),(int)(ap.getY()+0.5));
}
@@ -297,13 +297,13 @@ public class WindowDriver extends WindowImpl {
class LocalWindowListener implements com.jogamp.newt.event.WindowListener {
@Override
- public void windowMoved(com.jogamp.newt.event.WindowEvent e) {
+ public void windowMoved(final com.jogamp.newt.event.WindowEvent e) {
if(null!=awtContainer) {
WindowDriver.this.positionChanged(false, awtContainer.getX(), awtContainer.getY());
}
}
@Override
- public void windowResized(com.jogamp.newt.event.WindowEvent e) {
+ public void windowResized(final com.jogamp.newt.event.WindowEvent e) {
if(null!=awtCanvas) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window Resized: "+awtCanvas);
@@ -313,23 +313,23 @@ public class WindowDriver extends WindowImpl {
}
}
@Override
- public void windowDestroyNotify(WindowEvent e) {
+ public void windowDestroyNotify(final WindowEvent e) {
WindowDriver.this.windowDestroyNotify(false);
}
@Override
- public void windowDestroyed(WindowEvent e) {
+ public void windowDestroyed(final WindowEvent e) {
// Not fwd by AWTWindowAdapter, synthesized by NEWT
}
@Override
- public void windowGainedFocus(WindowEvent e) {
+ public void windowGainedFocus(final WindowEvent e) {
WindowDriver.this.focusChanged(false, true);
}
@Override
- public void windowLostFocus(WindowEvent e) {
+ public void windowLostFocus(final WindowEvent e) {
WindowDriver.this.focusChanged(false, false);
}
@Override
- public void windowRepaint(WindowUpdateEvent e) {
+ public void windowRepaint(final WindowUpdateEvent e) {
if(null!=awtCanvas) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window Repaint: "+awtCanvas);
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
index d1b30f7cc..ceb337150 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
@@ -70,7 +70,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
}
@Override
- protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+ protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) {
DestroyDisplay(aDevice.getHandle());
}
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
index efedf7c7a..fab3fe882 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
@@ -62,12 +62,12 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
protected void closeNativeImpl() { }
@Override
- protected int validateScreenIndex(int idx) {
+ protected int validateScreenIndex(final int idx) {
return 0; // only one screen available
}
@Override
- protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
+ protected final void collectNativeMonitorModesAndDevicesImpl(final MonitorModeProps.Cache cache) {
int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
int i = 0;
props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
@@ -108,7 +108,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
}
@Override
- protected void calcVirtualScreenOriginAndSize(Rectangle viewport, Rectangle viewportInWindowUnits) {
+ protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
viewport.set(0, 0, fixedWidth, fixedHeight); // FIXME
}
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
index 64b856707..aec85f875 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
@@ -82,9 +82,9 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
}
@Override
- protected void requestFocusImpl(boolean reparented) { }
+ protected void requestFocusImpl(final boolean reparented) { }
- protected void setSizeImpl(int width, int height) {
+ protected void setSizeImpl(final int width, final int height) {
if(0!=getWindowHandle()) {
// n/a in BroadcomEGL
System.err.println("BCEGL Window.setSizeImpl n/a in BroadcomEGL with realized window");
@@ -94,7 +94,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
}
@Override
- protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+ protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final int flags) {
if(0!=getWindowHandle()) {
if(0 != ( FLAG_CHANGE_FULLSCREEN & flags)) {
if( 0 != ( FLAG_IS_FULLSCREEN & flags) ) {
@@ -123,12 +123,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
}
@Override
- protected Point getLocationOnScreenImpl(int x, int y) {
+ protected Point getLocationOnScreenImpl(final int x, final int y) {
return new Point(x,y);
}
@Override
- protected void updateInsetsImpl(Insets insets) {
+ protected void updateInsetsImpl(final Insets insets) {
// nop ..
}
@@ -148,11 +148,11 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
private native void SwapWindow(long eglDisplayHandle, long eglWindowHandle);
- private long realizeWindow(boolean chromaKey, int width, int height) {
+ private long realizeWindow(final boolean chromaKey, final int width, final int height) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("BCEGL Window.realizeWindow() with: chroma "+chromaKey+", "+width+"x"+height+", "+getGraphicsConfiguration());
}
- long handle = CreateWindow(getDisplayHandle(), chromaKey, width, height);
+ final long handle = CreateWindow(getDisplayHandle(), chromaKey, width, height);
if (0 == handle) {
throw new NativeWindowException("Error native Window Handle is null");
}
@@ -160,9 +160,9 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
return handle;
}
- private void windowCreated(int cfgID, int width, int height) {
+ private void windowCreated(final int cfgID, final int width, final int height) {
defineSize(width, height);
- GLCapabilitiesImmutable capsReq = (GLCapabilitiesImmutable) getGraphicsConfiguration().getRequestedCapabilities();
+ final GLCapabilitiesImmutable capsReq = (GLCapabilitiesImmutable) getGraphicsConfiguration().getRequestedCapabilities();
final AbstractGraphicsConfiguration cfg = EGLGraphicsConfiguration.create(capsReq, getScreen().getGraphicsScreen(), cfgID);
if (null == cfg) {
throw new NativeWindowException("Error creating EGLGraphicsConfiguration from id: "+cfgID+", "+this);
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
index 178bb70f7..1b67fa755 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
@@ -69,7 +69,7 @@ public class DisplayDriver extends DisplayImpl {
try {
final URLConnection urlConn = res.resolve(0);
image = PNGPixelRect.read(urlConn.getInputStream(), PixelFormat.BGRA8888, false /* directBuffer */, 0 /* destMinStrideInBytes */, false /* destIsGLOriented */);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -106,7 +106,7 @@ public class DisplayDriver extends DisplayImpl {
private PointerIconImpl defaultPointerIcon = null;
@Override
- protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+ protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
aDevice.close();
CloseBCMDisplay0(bcmHandle);
bcmHandle = 0;
@@ -123,12 +123,12 @@ public class DisplayDriver extends DisplayImpl {
// public final PixelFormat getNativePointerIconPixelFormat() { return PixelFormat.BGRA8888; }
@Override
- protected final long createPointerIconImpl(PixelFormat pixelformat, int width, int height, final ByteBuffer pixels, final int hotX, final int hotY) {
+ protected final long createPointerIconImpl(final PixelFormat pixelformat, final int width, final int height, final ByteBuffer pixels, final int hotX, final int hotY) {
return CreatePointerIcon(bcmHandle, pixels, width, height, hotX, hotY);
}
@Override
- protected final void destroyPointerIconImpl(final long displayHandle, long piHandle) {
+ protected final void destroyPointerIconImpl(final long displayHandle, final long piHandle) {
DestroyPointerIcon0(piHandle);
}
@@ -187,7 +187,7 @@ public class DisplayDriver extends DisplayImpl {
private static native long OpenBCMDisplay0();
private static native void CloseBCMDisplay0(long handle);
- private static long CreatePointerIcon(long bcmHandle, Buffer pixels, int width, int height, int hotX, int hotY) {
+ private static long CreatePointerIcon(final long bcmHandle, final Buffer pixels, final int width, final int height, final int hotX, final int hotY) {
final boolean pixels_is_direct = Buffers.isDirect(pixels);
return CreatePointerIcon0(pixels_is_direct ? pixels : Buffers.getArray(pixels),
pixels_is_direct ? Buffers.getDirectBufferByteOffset(pixels) : Buffers.getIndirectBufferByteOffset(pixels),
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
index 404f03eed..5c1c08ca8 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
@@ -55,12 +55,12 @@ public class ScreenDriver extends ScreenImpl {
protected void closeNativeImpl() { }
@Override
- protected int validateScreenIndex(int idx) {
+ protected int validateScreenIndex(final int idx) {
return 0; // only one screen available
}
@Override
- protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
+ protected final void collectNativeMonitorModesAndDevicesImpl(final MonitorModeProps.Cache cache) {
int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
int i = 0;
props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
@@ -101,12 +101,12 @@ public class ScreenDriver extends ScreenImpl {
}
@Override
- protected void calcVirtualScreenOriginAndSize(Rectangle viewport, Rectangle viewportInWindowUnits) {
+ protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
viewport.set(0, 0, cachedWidth, cachedHeight);
}
/** Called from {@link #initNative()}. */
- protected void setScreenSize(int width, int height) {
+ protected void setScreenSize(final int width, final int height) {
cachedWidth = width;
cachedHeight = height;
}
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
index b5e874f65..ad6d0b688 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
@@ -149,23 +149,23 @@ public class WindowDriver extends WindowImpl {
}
@Override
- protected void requestFocusImpl(boolean reparented) {
+ protected void requestFocusImpl(final boolean reparented) {
focusChanged(false, true);
}
@Override
- protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+ protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final int flags) {
reconfigure0(nativeWindowHandle, x, y, width, height, flags);
return true;
}
@Override
- protected Point getLocationOnScreenImpl(int x, int y) {
+ protected Point getLocationOnScreenImpl(final int x, final int y) {
return new Point(x,y);
}
@Override
- protected void updateInsetsImpl(Insets insets) {
+ protected void updateInsetsImpl(final Insets insets) {
// nop ..
}
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
index cc435540f..1d43017c3 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
@@ -74,7 +74,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
}
@Override
- protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+ protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
if(0==displayHandle) {
throw new NativeWindowException("displayHandle null; initCnt "+initCounter);
}
@@ -96,7 +96,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
}
}
- protected void setFocus(WindowDriver focus) {
+ protected void setFocus(final WindowDriver focus) {
focusedWindow = focus;
}
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
index 89d7540da..b5400c386 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
@@ -55,7 +55,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
@Override
protected void createNativeImpl() {
- AbstractGraphicsDevice adevice = getDisplay().getGraphicsDevice();
+ final AbstractGraphicsDevice adevice = getDisplay().getGraphicsDevice();
GetScreenInfo(adevice.getHandle(), screen_idx);
aScreen = new DefaultGraphicsScreen(adevice, screen_idx);
}
@@ -64,12 +64,12 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
protected void closeNativeImpl() { }
@Override
- protected int validateScreenIndex(int idx) {
+ protected int validateScreenIndex(final int idx) {
return 0; // only one screen available
}
@Override
- protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
+ protected final void collectNativeMonitorModesAndDevicesImpl(final MonitorModeProps.Cache cache) {
int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
int i = 0;
props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
@@ -110,7 +110,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
}
@Override
- protected void calcVirtualScreenOriginAndSize(Rectangle viewport, Rectangle viewportInWindowUnits) {
+ protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
viewport.set(0, 0, cachedWidth, cachedHeight);
}
@@ -122,7 +122,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
private native void GetScreenInfo(long displayHandle, int screen_idx);
// called by GetScreenInfo() ..
- private void screenCreated(int width, int height) {
+ private void screenCreated(final int width, final int height) {
cachedWidth = width;
cachedHeight = height;
}
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
index cf169f1c7..d7bd17e42 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
@@ -86,8 +86,8 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
}
@Override
- protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
- ScreenDriver screen = (ScreenDriver) getScreen();
+ protected boolean reconfigureWindowImpl(int x, int y, int width, int height, final int flags) {
+ final ScreenDriver screen = (ScreenDriver) getScreen();
// Note for GDL: window units == pixel units
if(width>screen.getWidth()) {
@@ -118,7 +118,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
}
@Override
- protected void requestFocusImpl(boolean reparented) {
+ protected void requestFocusImpl(final boolean reparented) {
((DisplayDriver)getScreen().getDisplay()).setFocus(this);
}
@@ -128,12 +128,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
}
@Override
- protected Point getLocationOnScreenImpl(int x, int y) {
+ protected Point getLocationOnScreenImpl(final int x, final int y) {
return new Point(x,y);
}
@Override
- protected void updateInsetsImpl(Insets insets) {
+ protected void updateInsetsImpl(final Insets insets) {
// nop ..
}
@@ -146,7 +146,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
private native void CloseSurface(long displayHandle, long surfaceHandle);
private native void SetBounds0(long surfaceHandle, int scrn_width, int scrn_height, int x, int y, int width, int height);
- private void updateBounds(int x, int y, int width, int height) {
+ private void updateBounds(final int x, final int y, final int width, final int height) {
definePosition(x, y);
defineSize(width, height);
}
diff --git a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
index 6c706148a..e72ddbc11 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
@@ -67,7 +67,7 @@ public class DisplayDriver extends DisplayImpl {
}
@Override
- protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+ protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
aDevice.close();
}
diff --git a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
index 6245f3207..06485ccef 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
@@ -60,12 +60,12 @@ public class ScreenDriver extends ScreenImpl {
protected void closeNativeImpl() { }
@Override
- protected int validateScreenIndex(int idx) {
+ protected int validateScreenIndex(final int idx) {
return 0; // only one screen available
}
@Override
- protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
+ protected final void collectNativeMonitorModesAndDevicesImpl(final MonitorModeProps.Cache cache) {
int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
int i = 0;
props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
@@ -106,11 +106,11 @@ public class ScreenDriver extends ScreenImpl {
}
@Override
- protected void calcVirtualScreenOriginAndSize(Rectangle viewport, Rectangle viewportInWindowUnits) {
+ protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
viewport.set(0, 0, cachedWidth, cachedHeight);
}
- protected void sizeChanged(int w, int h) {
+ protected void sizeChanged(final int w, final int h) {
cachedWidth = w;
cachedHeight = h;
}
diff --git a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
index 158e6ab2f..d53ef00cd 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
@@ -68,9 +68,9 @@ public class WindowDriver extends WindowImpl {
}
setGraphicsConfiguration(cfg);
- GLCapabilitiesImmutable eglCaps = (GLCapabilitiesImmutable) cfg.getChosenCapabilities();
- int eglConfigID = eglCaps.getVisualID(VIDType.EGL_CONFIG);
- long eglConfig = EGLGraphicsConfiguration.EGLConfigId2EGLConfig(getDisplayHandle(), eglConfigID);
+ final GLCapabilitiesImmutable eglCaps = (GLCapabilitiesImmutable) cfg.getChosenCapabilities();
+ final int eglConfigID = eglCaps.getVisualID(VIDType.EGL_CONFIG);
+ final long eglConfig = EGLGraphicsConfiguration.EGLConfigId2EGLConfig(getDisplayHandle(), eglConfigID);
eglWindowHandle = CreateWindow(getDisplayHandle(), eglConfig);
if (eglWindowHandle == 0) {
@@ -93,10 +93,10 @@ public class WindowDriver extends WindowImpl {
}
@Override
- protected void requestFocusImpl(boolean reparented) { }
+ protected void requestFocusImpl(final boolean reparented) { }
@Override
- protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+ protected boolean reconfigureWindowImpl(final int x, final int y, int width, int height, final int flags) {
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
setVisible0(eglWindowHandle, 0 != ( FLAG_IS_VISIBLE & flags));
visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
@@ -130,12 +130,12 @@ public class WindowDriver extends WindowImpl {
}
@Override
- protected Point getLocationOnScreenImpl(int x, int y) {
+ protected Point getLocationOnScreenImpl(final int x, final int y) {
return new Point(x,y);
}
@Override
- protected void updateInsetsImpl(Insets insets) {
+ protected void updateInsetsImpl(final Insets insets) {
// nop ..
}
@@ -151,12 +151,12 @@ public class WindowDriver extends WindowImpl {
private native void setSize0(long eglWindowHandle, int width, int height);
private native void setFullScreen0(long eglWindowHandle, boolean fullscreen);
- private void windowCreated(long userData) {
+ private void windowCreated(final long userData) {
windowUserData=userData;
}
@Override
- protected void sizeChanged(boolean defer, int newWidth, int newHeight, boolean force) {
+ protected void sizeChanged(final boolean defer, final int newWidth, final int newHeight, final boolean force) {
if(isFullscreen()) {
((ScreenDriver)getScreen()).sizeChanged(getWidth(), getHeight());
}
diff --git a/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java b/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java
index b7c86a26d..49a815cb6 100644
--- a/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java
+++ b/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java
@@ -72,7 +72,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
}
private WindowImpl focusedWindow = null;
- private EventDeviceManager eventDeviceManager = new EventDeviceManager();
+ private final EventDeviceManager eventDeviceManager = new EventDeviceManager();
/*
The devices are in /dev/input:
@@ -85,56 +85,56 @@ public class LinuxEventDeviceTracker implements WindowListener {
And so on up to event31.
*/
- private EventDevicePoller[] eventDevicePollers = new EventDevicePoller[32];
+ private final EventDevicePoller[] eventDevicePollers = new EventDevicePoller[32];
@Override
- public void windowResized(WindowEvent e) { }
+ public void windowResized(final WindowEvent e) { }
@Override
- public void windowMoved(WindowEvent e) { }
+ public void windowMoved(final WindowEvent e) { }
@Override
- public void windowDestroyNotify(WindowEvent e) {
- Object s = e.getSource();
+ public void windowDestroyNotify(final WindowEvent e) {
+ final Object s = e.getSource();
if(focusedWindow == s) {
focusedWindow = null;
}
}
@Override
- public void windowDestroyed(WindowEvent e) { }
+ public void windowDestroyed(final WindowEvent e) { }
@Override
- public void windowGainedFocus(WindowEvent e) {
- Object s = e.getSource();
+ public void windowGainedFocus(final WindowEvent e) {
+ final Object s = e.getSource();
if(s instanceof WindowImpl) {
focusedWindow = (WindowImpl) s;
}
}
@Override
- public void windowLostFocus(WindowEvent e) {
- Object s = e.getSource();
+ public void windowLostFocus(final WindowEvent e) {
+ final Object s = e.getSource();
if(focusedWindow == s) {
focusedWindow = null;
}
}
- public static void main(String[] args ){
+ public static void main(final String[] args ){
System.setProperty("newt.debug.Window.KeyEvent", "true");
LinuxEventDeviceTracker.getSingleton();
try {
while(true) {
Thread.sleep(1000);
}
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
- public void windowRepaint(WindowUpdateEvent e) { }
+ public void windowRepaint(final WindowUpdateEvent e) { }
class EventDeviceManager implements Runnable {
@@ -142,17 +142,17 @@ public class LinuxEventDeviceTracker implements WindowListener {
@Override
public void run() {
- File f = new File("/dev/input/");
+ final File f = new File("/dev/input/");
int number;
while(!stop){
- for(String path:f.list()){
+ for(final String path:f.list()){
if(path.startsWith("event")) {
- String stringNumber = path.substring(5);
+ final String stringNumber = path.substring(5);
number = Integer.parseInt(stringNumber);
if(number<32&&number>=0) {
if(eventDevicePollers[number]==null){
eventDevicePollers[number] = new EventDevicePoller(number);
- Thread t = new Thread(eventDevicePollers[number], "NEWT-LinuxEventDeviceTracker-event"+number);
+ final Thread t = new Thread(eventDevicePollers[number], "NEWT-LinuxEventDeviceTracker-event"+number);
t.setDaemon(true);
t.start();
} else if(eventDevicePollers[number].stop) {
@@ -163,7 +163,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
}
try {
Thread.sleep(2000);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
@@ -174,9 +174,9 @@ public class LinuxEventDeviceTracker implements WindowListener {
class EventDevicePoller implements Runnable {
private volatile boolean stop = false;
- private String eventDeviceName;
+ private final String eventDeviceName;
- public EventDevicePoller(int eventDeviceNumber){
+ public EventDevicePoller(final int eventDeviceNumber){
this.eventDeviceName="/dev/input/event"+eventDeviceNumber;
}
@@ -194,14 +194,14 @@ public class LinuxEventDeviceTracker implements WindowListener {
* unsigned int value;
* };
*/
- ByteBuffer bb = ByteBuffer.wrap(b);
- StructAccessor s = new StructAccessor(bb);
+ final ByteBuffer bb = ByteBuffer.wrap(b);
+ final StructAccessor s = new StructAccessor(bb);
final File f = new File(eventDeviceName);
f.setReadOnly();
InputStream fis;
try {
fis = new FileInputStream(f);
- } catch (FileNotFoundException e) {
+ } catch (final FileNotFoundException e) {
stop=true;
return;
}
@@ -224,7 +224,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
int read = 0;
try {
read = fis.read(b, 0, remaining);
- } catch (IOException e) {
+ } catch (final IOException e) {
stop = true;
break loop;
}
@@ -369,13 +369,13 @@ public class LinuxEventDeviceTracker implements WindowListener {
if(null != fis) {
try {
fis.close();
- } catch (IOException e) {
+ } catch (final IOException e) {
}
}
stop=true;
}
- private char NewtVKey2Unicode(short VK, int modifiers) {
+ private char NewtVKey2Unicode(final short VK, final int modifiers) {
if( KeyEvent.isPrintableKey(VK, true) ) {
if((modifiers & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK) {
return (char)VK;
@@ -387,7 +387,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
}
@SuppressWarnings("unused")
- private char LinuxEVKey2Unicode(short EVKey) {
+ private char LinuxEVKey2Unicode(final short EVKey) {
// This is the stuff normally mapped by a system keymap
switch(EVKey) {
@@ -443,7 +443,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
return 0;
}
- private short LinuxEVKey2NewtVKey(short EVKey) {
+ private short LinuxEVKey2NewtVKey(final short EVKey) {
switch(EVKey) {
case 1: // ESC
diff --git a/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java b/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java
index 3663ef0d4..1d9377563 100644
--- a/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java
+++ b/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java
@@ -79,40 +79,40 @@ public class LinuxMouseTracker implements WindowListener {
public final int getLastY() { return lastFocusedY; }
@Override
- public void windowResized(WindowEvent e) { }
+ public void windowResized(final WindowEvent e) { }
@Override
- public void windowMoved(WindowEvent e) { }
+ public void windowMoved(final WindowEvent e) { }
@Override
- public void windowDestroyNotify(WindowEvent e) {
- Object s = e.getSource();
+ public void windowDestroyNotify(final WindowEvent e) {
+ final Object s = e.getSource();
if(focusedWindow == s) {
focusedWindow = null;
}
}
@Override
- public void windowDestroyed(WindowEvent e) { }
+ public void windowDestroyed(final WindowEvent e) { }
@Override
- public void windowGainedFocus(WindowEvent e) {
- Object s = e.getSource();
+ public void windowGainedFocus(final WindowEvent e) {
+ final Object s = e.getSource();
if(s instanceof WindowImpl) {
focusedWindow = (WindowImpl) s;
}
}
@Override
- public void windowLostFocus(WindowEvent e) {
- Object s = e.getSource();
+ public void windowLostFocus(final WindowEvent e) {
+ final Object s = e.getSource();
if(focusedWindow == s) {
focusedWindow = null;
}
}
@Override
- public void windowRepaint(WindowUpdateEvent e) { }
+ public void windowRepaint(final WindowUpdateEvent e) { }
class MouseDevicePoller implements Runnable {
@Override
@@ -123,7 +123,7 @@ public class LinuxMouseTracker implements WindowListener {
InputStream fis;
try {
fis = new FileInputStream(f);
- } catch (FileNotFoundException e) {
+ } catch (final FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return;
@@ -137,7 +137,7 @@ public class LinuxMouseTracker implements WindowListener {
int read = 0;
try {
read = fis.read(b, 0, remaining);
- } catch (IOException e) {
+ } catch (final IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
@@ -222,7 +222,7 @@ public class LinuxMouseTracker implements WindowListener {
if(null != fis) {
try {
fis.close();
- } catch (IOException e) {
+ } catch (final IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
index d850a18af..4ecc2fdcf 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
@@ -71,7 +71,7 @@ public class DisplayDriver extends DisplayImpl {
final IOUtil.ClassResources iconRes = NewtFactory.getWindowIcons();
final URLConnection urlConn = iconRes.resolve(iconRes.resourceCount()-1);
image = PNGPixelRect.read(urlConn.getInputStream(), PixelFormat.BGRA8888, true /* directBuffer */, 0 /* destMinStrideInBytes */, false /* destIsGLOriented */);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -107,7 +107,7 @@ public class DisplayDriver extends DisplayImpl {
}
@Override
- protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+ protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
aDevice.close();
}
@@ -121,14 +121,14 @@ public class DisplayDriver extends DisplayImpl {
public final boolean getNativePointerIconForceDirectNIO() { return true; }
@Override
- protected final long createPointerIconImpl(PixelFormat pixelformat, int width, int height, final ByteBuffer pixels, final int hotX, final int hotY) {
+ protected final long createPointerIconImpl(final PixelFormat pixelformat, final int width, final int height, final ByteBuffer pixels, final int hotX, final int hotY) {
return createPointerIcon0(
pixels, Buffers.getDirectBufferByteOffset(pixels), true /* pixels_is_direct */,
width, height, hotX, hotY);
}
@Override
- protected final void destroyPointerIconImpl(final long displayHandle, long piHandle) {
+ protected final void destroyPointerIconImpl(final long displayHandle, final long piHandle) {
destroyPointerIcon0(piHandle);
}
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java b/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java
index a89150d7c..d80d43e8f 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java
@@ -231,7 +231,7 @@ public class MacKeyUtil {
private static final char NSModeSwitchFunctionKey = 0xF747;
*/
- static short validateKeyCode(short keyCode, char keyChar) {
+ static short validateKeyCode(final short keyCode, final char keyChar) {
// OS X Virtual Keycodes
switch(keyCode) {
//
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
index fe7411f29..c0f7d3859 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
@@ -128,13 +128,13 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
@Override
- protected void setScreen(ScreenImpl newScreen) { // never null !
+ protected void setScreen(final ScreenImpl newScreen) { // never null !
super.setScreen(newScreen);
updatePixelScaleByScreenIdx(false /* sendEvent*/); // caller (reparent, ..) will send reshape event
}
@Override
- protected void monitorModeChanged(MonitorEvent me, boolean success) {
+ protected void monitorModeChanged(final MonitorEvent me, final boolean success) {
updatePixelScaleByWindowHandle(false /* sendEvent*/); // send reshape event itself
}
@@ -210,9 +210,9 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
close0( handle );
} });
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if(DEBUG_IMPLEMENTATION) {
- Exception e = new Exception("Warning: closeNative failed - "+Thread.currentThread().getName(), t);
+ final Exception e = new Exception("Warning: closeNative failed - "+Thread.currentThread().getName(), t);
e.printStackTrace();
}
}
@@ -255,7 +255,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
@Override
- public void setSurfaceHandle(long surfaceHandle) {
+ public void setSurfaceHandle(final long surfaceHandle) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("MacWindow.setSurfaceHandle(): 0x"+Long.toHexString(surfaceHandle));
}
@@ -324,10 +324,10 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
}
- private boolean useParent(NativeWindow parent) { return null != parent && 0 != parent.getWindowHandle(); }
+ private boolean useParent(final NativeWindow parent) { return null != parent && 0 != parent.getWindowHandle(); }
@Override
- public void updatePosition(int x, int y) {
+ public void updatePosition(final int x, final int y) {
final long handle = getWindowHandle();
if( 0 != handle && !isOffscreenInstance ) {
final NativeWindow parent = getParent();
@@ -348,7 +348,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
@Override
- protected void sizeChanged(boolean defer, int newWidth, int newHeight, boolean force) {
+ protected void sizeChanged(final boolean defer, final int newWidth, final int newHeight, final boolean force) {
final long handle = getWindowHandle();
if( 0 != handle && !isOffscreenInstance ) {
final NativeWindow parent = getParent();
@@ -370,7 +370,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
@Override
- protected boolean reconfigureWindowImpl(int x, int y, final int width, final int height, int flags) {
+ protected boolean reconfigureWindowImpl(int x, int y, final int width, final int height, final int flags) {
final boolean _isOffscreenInstance = isOffscreenInstance(this, this.getParent());
isOffscreenInstance = 0 != sscSurfaceHandle || _isOffscreenInstance;
final PointImmutable pClientLevelOnSreen;
@@ -471,7 +471,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
@Override
- protected Point getLocationOnScreenImpl(int x, int y) {
+ protected Point getLocationOnScreenImpl(final int x, final int y) {
final NativeWindow parent = getParent();
final boolean useParent = useParent(parent);
return getLocationOnScreenImpl(x, y, parent, useParent);
@@ -490,12 +490,12 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
@Override
- protected void updateInsetsImpl(Insets insets) {
+ protected void updateInsetsImpl(final Insets insets) {
// nop - using event driven insetsChange(..)
}
/** Callback for native screen position change event of the client area. */
- protected void screenPositionChanged(boolean defer, int newX, int newY) {
+ protected void screenPositionChanged(final boolean defer, final int newX, final int newY) {
// passed coordinates are in screen position of the client area
if(getWindowHandle()!=0) {
final NativeWindow parent = getParent();
@@ -506,8 +506,8 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
positionChanged(defer, newX, newY);
} else {
// screen position -> rel child window position
- Point absPos = new Point(newX, newY);
- Point parentOnScreen = parent.getLocationOnScreen(null);
+ final Point absPos = new Point(newX, newY);
+ final Point parentOnScreen = parent.getLocationOnScreen(null);
absPos.translate( parentOnScreen.scale(-1, -1) );
if(DEBUG_IMPLEMENTATION) {
System.err.println("MacWindow.positionChanged.1 (Screen Pos - CHILD): ("+getThreadName()+"): (defer: "+defer+") "+getX()+"/"+getY()+" -> absPos "+newX+"/"+newY+", parentOnScreen "+parentOnScreen+" -> "+absPos);
@@ -567,22 +567,22 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
@Override
- public final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+ public final void sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
}
@Override
- public final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short _keyCode, short _keySym, char keyChar) {
+ public final void enqueueKeyEvent(final boolean wait, final short eventType, final int modifiers, final short _keyCode, final short _keySym, final char keyChar) {
throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
}
- protected final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short _keyCode, char keyChar, char keySymChar) {
+ protected final void enqueueKeyEvent(final boolean wait, final short eventType, int modifiers, final short _keyCode, final char keyChar, final char keySymChar) {
// Note that we send the key char for the key code on this
// platform -- we do not get any useful key codes out of the system
final short keyCode = MacKeyUtil.validateKeyCode(_keyCode, keyChar);
final short keySym;
{
- short _keySym = KeyEvent.NULL_CHAR != keySymChar ? KeyEvent.utf16ToVKey(keySymChar) : KeyEvent.VK_UNDEFINED;
+ final short _keySym = KeyEvent.NULL_CHAR != keySymChar ? KeyEvent.utf16ToVKey(keySymChar) : KeyEvent.VK_UNDEFINED;
keySym = KeyEvent.VK_UNDEFINED != _keySym ? _keySym : keyCode;
}
/**
@@ -682,7 +682,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
setAlwaysOnTop0(getWindowHandle(), alwaysOnTop);
}
} });
- } catch (Exception ie) {
+ } catch (final Exception ie) {
ie.printStackTrace();
}
}
diff --git a/src/newt/classes/jogamp/newt/driver/opengl/JoglUtilPNGIcon.java b/src/newt/classes/jogamp/newt/driver/opengl/JoglUtilPNGIcon.java
index 551929b8d..5e703f690 100644
--- a/src/newt/classes/jogamp/newt/driver/opengl/JoglUtilPNGIcon.java
+++ b/src/newt/classes/jogamp/newt/driver/opengl/JoglUtilPNGIcon.java
@@ -41,7 +41,7 @@ import com.jogamp.opengl.util.PNGPixelRect;
public class JoglUtilPNGIcon {
- public static ByteBuffer arrayToX11BGRAImages(IOUtil.ClassResources resources, int[] data_size, int[] elem_bytesize) throws UnsupportedOperationException, InterruptedException, IOException, MalformedURLException {
+ public static ByteBuffer arrayToX11BGRAImages(final IOUtil.ClassResources resources, final int[] data_size, final int[] elem_bytesize) throws UnsupportedOperationException, InterruptedException, IOException, MalformedURLException {
final PNGPixelRect[] images = new PNGPixelRect[resources.resourceCount()];
data_size[0] = 0;
for(int i=0; i<resources.resourceCount(); i++) {
diff --git a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
index a30431788..8973ae7ed 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
@@ -62,7 +62,7 @@ public class DisplayDriver extends DisplayImpl {
static {
NEWTJNILibLoader.loadNEWT();
{
- long[] _defaultIconHandle = { 0, 0 };
+ final long[] _defaultIconHandle = { 0, 0 };
if( DisplayImpl.isPNGUtilAvailable() ) {
try {
final IOUtil.ClassResources iconRes = NewtFactory.getWindowIcons();
@@ -76,7 +76,7 @@ public class DisplayDriver extends DisplayImpl {
final PNGPixelRect image = PNGPixelRect.read(urlConn.getInputStream(), PixelFormat.BGRA8888, false /* directBuffer */, 0 /* destMinStrideInBytes */, false /* destIsGLOriented */);
_defaultIconHandle[1] = DisplayDriver.createBGRA8888Icon0(image.getPixels(), image.getSize().getWidth(), image.getSize().getHeight(), false, 0, 0);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -110,7 +110,7 @@ public class DisplayDriver extends DisplayImpl {
}
@Override
- protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+ protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
sharedClassFactory.releaseSharedClass();
aDevice.close();
}
@@ -125,12 +125,12 @@ public class DisplayDriver extends DisplayImpl {
}
@Override
- protected final long createPointerIconImpl(PixelFormat pixelformat, int width, int height, final ByteBuffer pixels, final int hotX, final int hotY) {
+ protected final long createPointerIconImpl(final PixelFormat pixelformat, final int width, final int height, final ByteBuffer pixels, final int hotX, final int hotY) {
return createBGRA8888Icon0(pixels, width, height, true, hotX, hotY);
}
@Override
- protected final void destroyPointerIconImpl(final long displayHandle, long piHandle) {
+ protected final void destroyPointerIconImpl(final long displayHandle, final long piHandle) {
destroyIcon0(piHandle);
}
@@ -139,7 +139,7 @@ public class DisplayDriver extends DisplayImpl {
//
private static native void DispatchMessages0();
- static long createBGRA8888Icon0(Buffer pixels, int width, int height, boolean isCursor, int hotX, int hotY) {
+ static long createBGRA8888Icon0(final Buffer pixels, final int width, final int height, final boolean isCursor, final int hotX, final int hotY) {
if( null == pixels ) {
throw new IllegalArgumentException("data buffer/size");
}
diff --git a/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java
index af265cfd3..1cba421bc 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java
@@ -156,7 +156,7 @@ public class ScreenDriver extends ScreenImpl {
}
@Override
- protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, Rectangle viewportInWindowUnits) {
+ protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
viewport.set(getVirtualOriginX0(), getVirtualOriginY0(), getVirtualWidthImpl0(), getVirtualHeightImpl0());
}
diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
index bda844bb5..1c5c34457 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
@@ -116,7 +116,7 @@ public class WindowDriver extends WindowImpl {
@Override
public boolean hasDeviceChanged() {
if(0!=getWindowHandle()) {
- long _hmon = MonitorFromWindow0(getWindowHandle());
+ final long _hmon = MonitorFromWindow0(getWindowHandle());
if (hmon != _hmon) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Info: Window Device Changed "+Thread.currentThread().getName()+
@@ -154,7 +154,7 @@ public class WindowDriver extends WindowImpl {
windowHandleClose = _windowHandle;
if(DEBUG_IMPLEMENTATION) {
- Exception e = new Exception("Info: Window new window handle "+Thread.currentThread().getName()+
+ final Exception e = new Exception("Info: Window new window handle "+Thread.currentThread().getName()+
" (Parent HWND "+toHexString(getParentWindowHandle())+
") : HWND "+toHexString(_windowHandle)+", "+Thread.currentThread());
e.printStackTrace();
@@ -167,18 +167,18 @@ public class WindowDriver extends WindowImpl {
if ( 0 != hdc ) {
try {
GDI.ReleaseDC(windowHandleClose, hdc);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if(DEBUG_IMPLEMENTATION) {
- Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
+ final Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
e.printStackTrace();
}
}
}
try {
GDI.DestroyWindow(windowHandleClose);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if(DEBUG_IMPLEMENTATION) {
- Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
+ final Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
e.printStackTrace();
}
}
@@ -189,7 +189,7 @@ public class WindowDriver extends WindowImpl {
}
@Override
- protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+ protected boolean reconfigureWindowImpl(int x, int y, int width, int height, final int flags) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("WindowsWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+
getReconfigureFlagsAsString(null, flags));
@@ -217,7 +217,7 @@ public class WindowDriver extends WindowImpl {
}
@Override
- protected void requestFocusImpl(boolean force) {
+ protected void requestFocusImpl(final boolean force) {
requestFocus0(getWindowHandle(), force);
}
@@ -273,12 +273,12 @@ public class WindowDriver extends WindowImpl {
}
@Override
- protected Point getLocationOnScreenImpl(int x, int y) {
+ protected Point getLocationOnScreenImpl(final int x, final int y) {
return GDIUtil.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y);
}
@Override
- protected void updateInsetsImpl(Insets insets) {
+ protected void updateInsetsImpl(final Insets insets) {
// nop - using event driven insetsChange(..)
}
@@ -295,9 +295,9 @@ public class WindowDriver extends WindowImpl {
* for details.
* </p>
*/
- public final void sendTouchScreenEvent(short eventType, int modifiers,
- int pActionIdx, int[] pNames,
- int[] pX, int[] pY, float[] pPressure, float maxPressure) {
+ public final void sendTouchScreenEvent(final short eventType, final int modifiers,
+ final int pActionIdx, final int[] pNames,
+ final int[] pX, final int[] pY, final float[] pPressure, final float maxPressure) {
final int pCount = pNames.length;
final MouseEvent.PointerType[] pTypes = new MouseEvent.PointerType[pCount];
for(int i=pCount-1; i>=0; i--) { pTypes[i] = PointerType.TouchScreen; }
@@ -311,7 +311,7 @@ public class WindowDriver extends WindowImpl {
//
private short repeatedKey = KeyEvent.VK_UNDEFINED;
- private final boolean handlePressTypedAutoRepeat(boolean isModifierKey, int modifiers, short keyCode, short keySym, char keyChar) {
+ private final boolean handlePressTypedAutoRepeat(final boolean isModifierKey, int modifiers, final short keyCode, final short keySym, final char keyChar) {
if( setKeyPressed(keyCode, true) ) {
// AR: Key was already pressed: Either [enter | within] AR mode
final boolean withinAR = repeatedKey == keyCode;
@@ -331,7 +331,7 @@ public class WindowDriver extends WindowImpl {
}
@Override
- public final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+ public final void sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
final boolean isModifierKey = KeyEvent.isModifierKey(keySym);
// System.err.println("*** sendKeyEvent: event "+KeyEvent.getEventTypeString(eventType)+", keyCode "+toHexString(keyCode)+", keyChar <"+keyChar+">, mods "+toHexString(modifiers)+
// ", isKeyCodeTracked "+isKeyCodeTracked(keyCode)+", was: pressed "+isKeyPressed(keyCode)+", printableKey "+KeyEvent.isPrintableKey(keyCode, false)+" [modifierKey "+isModifierKey+"] - "+System.currentTimeMillis());
@@ -359,7 +359,7 @@ public class WindowDriver extends WindowImpl {
}
@Override
- public final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+ public final void enqueueKeyEvent(final boolean wait, final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
}
diff --git a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
index 5c2820dab..759c27450 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
@@ -69,7 +69,7 @@ public class DisplayDriver extends DisplayImpl {
}
@Override
- public String validateDisplayName(String name, long handle) {
+ public String validateDisplayName(final String name, final long handle) {
return X11Util.validateDisplayName(name, handle);
}
@@ -81,21 +81,21 @@ public class DisplayDriver extends DisplayImpl {
@Override
protected void createNativeImpl() {
X11Util.setX11ErrorHandler(true, DEBUG ? false : true); // make sure X11 error handler is set
- long handle = X11Util.openDisplay(name);
+ final long handle = X11Util.openDisplay(name);
if( 0 == handle ) {
throw new RuntimeException("Error creating display(Win): "+name);
}
aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
try {
CompleteDisplay0(aDevice.getHandle());
- } catch(RuntimeException e) {
+ } catch(final RuntimeException e) {
closeNativeImpl(aDevice);
throw e;
}
}
@Override
- protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+ protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
DisplayRelease0(aDevice.getHandle(), javaObjectAtom, windowDeleteAtom /*, kbdHandle */); // XKB disabled for now
javaObjectAtom = 0;
windowDeleteAtom = 0;
@@ -128,12 +128,12 @@ public class DisplayDriver extends DisplayImpl {
public final PixelFormat getNativePointerIconPixelFormat() { return PixelFormat.RGBA8888; }
@Override
- protected final long createPointerIconImpl(PixelFormat pixelformat, int width, int height, final ByteBuffer pixels, final int hotX, final int hotY) {
+ protected final long createPointerIconImpl(final PixelFormat pixelformat, final int width, final int height, final ByteBuffer pixels, final int hotX, final int hotY) {
return createPointerIcon(getHandle(), pixels, width, height, hotX, hotY);
}
@Override
- protected final void destroyPointerIconImpl(final long displayHandle, long piHandle) {
+ protected final void destroyPointerIconImpl(final long displayHandle, final long piHandle) {
destroyPointerIcon0(displayHandle, piHandle);
}
@@ -145,7 +145,7 @@ public class DisplayDriver extends DisplayImpl {
private native void CompleteDisplay0(long handle);
- private void displayCompleted(long javaObjectAtom, long windowDeleteAtom /*, long kbdHandle */) {
+ private void displayCompleted(final long javaObjectAtom, final long windowDeleteAtom /*, long kbdHandle */) {
this.javaObjectAtom=javaObjectAtom;
this.windowDeleteAtom=windowDeleteAtom;
// this.kbdHandle = kbdHandle; // XKB disabled for now
@@ -154,7 +154,7 @@ public class DisplayDriver extends DisplayImpl {
private native void DispatchMessages0(long display, long javaObjectAtom, long windowDeleteAtom /* , long kbdHandle */); // XKB disabled for now
- private static long createPointerIcon(long display, Buffer pixels, int width, int height, int hotX, int hotY) {
+ private static long createPointerIcon(final long display, final Buffer pixels, final int width, final int height, final int hotX, final int hotY) {
final boolean pixels_is_direct = Buffers.isDirect(pixels);
return createPointerIcon0(display,
pixels_is_direct ? pixels : Buffers.getArray(pixels),
diff --git a/src/newt/classes/jogamp/newt/driver/x11/RandR11.java b/src/newt/classes/jogamp/newt/driver/x11/RandR11.java
index 23fd0f80f..4803852f9 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/RandR11.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/RandR11.java
@@ -35,6 +35,7 @@ import jogamp.newt.ScreenImpl;
import com.jogamp.common.util.VersionNumber;
import com.jogamp.newt.MonitorDevice;
import com.jogamp.newt.MonitorMode;
+import com.jogamp.newt.Screen;
class RandR11 implements RandR {
private static final boolean DEBUG = ScreenDriver.DEBUG;
@@ -59,7 +60,7 @@ class RandR11 implements RandR {
private int[] idx_rate = null, idx_res = null;
@Override
- public boolean beginInitialQuery(long dpy, ScreenDriver screen) {
+ public boolean beginInitialQuery(final long dpy, final ScreenDriver screen) {
// initialize iterators and static data
final int screen_idx = screen.getIndex();
resolutionCount = getNumScreenResolutions0(dpy, screen_idx);
@@ -96,7 +97,7 @@ class RandR11 implements RandR {
}
@Override
- public void endInitialQuery(long dpy, ScreenDriver screen) {
+ public void endInitialQuery(final long dpy, final ScreenDriver screen) {
idx_rate=null;
idx_res=null;
nrates=null;
@@ -153,7 +154,7 @@ class RandR11 implements RandR {
}
}
- int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
+ final int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
int i = 0;
props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
props[i++] = res[0]; // width
@@ -210,14 +211,14 @@ class RandR11 implements RandR {
return null;
}
final int screen_idx = screen.getIndex();
- long screenConfigHandle = getScreenConfiguration0(dpy, screen_idx);
+ final long screenConfigHandle = getScreenConfiguration0(dpy, screen_idx);
if(0 == screenConfigHandle) {
return null;
}
int[] res;
final int nres_idx;
try {
- int resNumber = getNumScreenResolutions0(dpy, screen_idx);
+ final int resNumber = getNumScreenResolutions0(dpy, screen_idx);
if(0==resNumber) {
return null;
}
@@ -239,7 +240,7 @@ class RandR11 implements RandR {
} finally {
freeScreenConfiguration0(screenConfigHandle);
}
- int[] props = new int[4];
+ final int[] props = new int[4];
int i = 0;
props[i++] = 0;
props[i++] = 0;
@@ -255,7 +256,7 @@ class RandR11 implements RandR {
return null;
}
final int screen_idx = screen.getIndex();
- long screenConfigHandle = getScreenConfiguration0(dpy, screen_idx);
+ final long screenConfigHandle = getScreenConfiguration0(dpy, screen_idx);
if(0 == screenConfigHandle) {
return null;
}
@@ -263,7 +264,7 @@ class RandR11 implements RandR {
int rate, rot;
final int nres_idx;
try {
- int resNumber = getNumScreenResolutions0(dpy, screen_idx);
+ final int resNumber = getNumScreenResolutions0(dpy, screen_idx);
if(0==resNumber) {
return null;
}
@@ -293,7 +294,7 @@ class RandR11 implements RandR {
} finally {
freeScreenConfiguration0(screenConfigHandle);
}
- int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
+ final int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
int i = 0;
props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
props[i++] = res[0]; // width
@@ -310,11 +311,11 @@ class RandR11 implements RandR {
}
@Override
- public boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, MonitorDevice monitor, final MonitorMode mode) {
+ public boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, final MonitorDevice monitor, final MonitorMode mode) {
final long t0 = System.currentTimeMillis();
boolean done = false;
final int screen_idx = screen.getIndex();
- long screenConfigHandle = getScreenConfiguration0(dpy, screen_idx);
+ final long screenConfigHandle = getScreenConfiguration0(dpy, screen_idx);
if(0 == screenConfigHandle) {
return Boolean.valueOf(done);
}
@@ -327,10 +328,10 @@ class RandR11 implements RandR {
final int r = mode.getRotation();
if( setCurrentScreenModeStart0(dpy, screen_idx, screenConfigHandle, resId, f, r) ) {
- while(!done && System.currentTimeMillis()-t0 < ScreenImpl.SCREEN_MODE_CHANGE_TIMEOUT) {
+ while(!done && System.currentTimeMillis()-t0 < Screen.SCREEN_MODE_CHANGE_TIMEOUT) {
done = setCurrentScreenModePollEnd0(dpy, screen_idx, resId, f, r);
if(!done) {
- try { Thread.sleep(10); } catch (InterruptedException e) { }
+ try { Thread.sleep(10); } catch (final InterruptedException e) { }
}
}
}
@@ -341,7 +342,7 @@ class RandR11 implements RandR {
}
@Override
- public final void updateScreenViewport(final long dpy, final ScreenDriver screen, RectangleImmutable viewport) {
+ public final void updateScreenViewport(final long dpy, final ScreenDriver screen, final RectangleImmutable viewport) {
// nop
}
diff --git a/src/newt/classes/jogamp/newt/driver/x11/RandR13.java b/src/newt/classes/jogamp/newt/driver/x11/RandR13.java
index a08741d9e..7a409bba1 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/RandR13.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/RandR13.java
@@ -58,7 +58,7 @@ class RandR13 implements RandR {
@Override
public void dumpInfo(final long dpy, final int screen_idx) {
- long screenResources = getScreenResources0(dpy, screen_idx);
+ final long screenResources = getScreenResources0(dpy, screen_idx);
if(0 == screenResources) {
return;
}
@@ -73,7 +73,7 @@ class RandR13 implements RandR {
IntLongHashMap crtInfoHandleMap = null;
@Override
- public boolean beginInitialQuery(long dpy, ScreenDriver screen) {
+ public boolean beginInitialQuery(final long dpy, final ScreenDriver screen) {
final int screen_idx = screen.getIndex();
sessionScreenResources = getScreenResources0(dpy, screen_idx);
if( 0 != sessionScreenResources ) {
@@ -86,9 +86,9 @@ class RandR13 implements RandR {
}
@Override
- public void endInitialQuery(long dpy, ScreenDriver screen) {
+ public void endInitialQuery(final long dpy, final ScreenDriver screen) {
if( null != crtInfoHandleMap ) {
- for(Iterator<IntLongHashMap.Entry> iter = crtInfoHandleMap.iterator(); iter.hasNext(); ) {
+ for(final Iterator<IntLongHashMap.Entry> iter = crtInfoHandleMap.iterator(); iter.hasNext(); ) {
final IntLongHashMap.Entry entry = iter.next();
freeMonitorInfoHandle0(entry.value);
}
@@ -113,7 +113,7 @@ class RandR13 implements RandR {
}
}
- private final long getMonitorInfoHandle(final long dpy, final int screen_idx, long screenResources, final int monitor_idx) {
+ private final long getMonitorInfoHandle(final long dpy, final int screen_idx, final long screenResources, final int monitor_idx) {
if( null != crtInfoHandleMap ) {
long h = crtInfoHandleMap.get(monitor_idx);
if( 0 == h ) {
@@ -174,7 +174,7 @@ class RandR13 implements RandR {
}
@Override
- public int[] getMonitorDeviceProps(final long dpy, final ScreenDriver screen, MonitorModeProps.Cache cache, final int crt_idx) {
+ public int[] getMonitorDeviceProps(final long dpy, final ScreenDriver screen, final MonitorModeProps.Cache cache, final int crt_idx) {
final int screen_idx = screen.getIndex();
final long screenResources = getScreenResourceHandle(dpy, screen_idx);
try {
@@ -222,7 +222,7 @@ class RandR13 implements RandR {
}
@Override
- public boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, MonitorDevice monitor, final MonitorMode mode) {
+ public boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, final MonitorDevice monitor, final MonitorMode mode) {
final int screen_idx = screen.getIndex();
final long screenResources = getScreenResourceHandle(dpy, screen_idx);
final boolean res;
diff --git a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
index 2d7c6509d..7ae68e510 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
@@ -48,6 +48,7 @@ import jogamp.newt.DisplayImpl.DisplayRunnable;
import jogamp.newt.ScreenImpl;
import com.jogamp.common.util.ArrayHashSet;
+import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.VersionNumber;
import com.jogamp.nativewindow.x11.X11GraphicsDevice;
import com.jogamp.nativewindow.x11.X11GraphicsScreen;
@@ -59,7 +60,7 @@ public class ScreenDriver extends ScreenImpl {
static {
Debug.initSingleton();
- DEBUG_TEST_RANDR13_DISABLED = Debug.isPropertyDefined("newt.test.Screen.disableRandR13", true);
+ DEBUG_TEST_RANDR13_DISABLED = PropertyAccess.isPropertyDefined("newt.test.Screen.disableRandR13", true);
DisplayDriver.initSingleton();
}
@@ -73,9 +74,9 @@ public class ScreenDriver extends ScreenImpl {
@Override
protected void createNativeImpl() {
// validate screen index
- Long handle = runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Long>() {
+ final Long handle = runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Long>() {
@Override
- public Long run(long dpy) {
+ public Long run(final long dpy) {
return new Long(GetScreen0(dpy, screen_idx));
} } );
if (handle.longValue() == 0) {
@@ -85,7 +86,7 @@ public class ScreenDriver extends ScreenImpl {
final long dpy = x11dev.getHandle();
aScreen = new X11GraphicsScreen(x11dev, screen_idx);
{
- int v[] = getRandRVersion0(dpy);
+ final int v[] = getRandRVersion0(dpy);
randrVersion = new VersionNumber(v[0], v[1], 0);
}
{
@@ -169,7 +170,7 @@ public class ScreenDriver extends ScreenImpl {
final AbstractGraphicsDevice device = getDisplay().getGraphicsDevice();
device.lock();
try {
- int[] viewportProps = rAndR.getMonitorDeviceViewport(device.getHandle(), this, monitor.getId());
+ final int[] viewportProps = rAndR.getMonitorDeviceViewport(device.getHandle(), this, monitor.getId());
viewportPU.set(viewportProps[0], viewportProps[1], viewportProps[2], viewportProps[3]);
viewportWU.set(viewportProps[0], viewportProps[1], viewportProps[2], viewportProps[3]); // equal window-units and pixel-units
return true;
@@ -184,7 +185,7 @@ public class ScreenDriver extends ScreenImpl {
return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<MonitorMode>() {
@Override
- public MonitorMode run(long dpy) {
+ public MonitorMode run(final long dpy) {
final int[] currentModeProps = rAndR.getCurrentMonitorModeProps(dpy, ScreenDriver.this, monitor.getId());
return MonitorModeProps.streamInMonitorMode(null, null, currentModeProps, 0);
} } );
@@ -195,9 +196,9 @@ public class ScreenDriver extends ScreenImpl {
if( null == rAndR ) { return false; }
final long t0 = System.currentTimeMillis();
- boolean done = runWithOptTempDisplayHandle( new DisplayImpl.DisplayRunnable<Boolean>() {
+ final boolean done = runWithOptTempDisplayHandle( new DisplayImpl.DisplayRunnable<Boolean>() {
@Override
- public Boolean run(long dpy) {
+ public Boolean run(final long dpy) {
return Boolean.valueOf( rAndR.setCurrentMonitorMode(dpy, ScreenDriver.this, monitor, mode) );
}
}).booleanValue();
@@ -211,7 +212,7 @@ public class ScreenDriver extends ScreenImpl {
private final DisplayImpl.DisplayRunnable<Boolean> xineramaEnabledQueryWithTemp = new DisplayImpl.DisplayRunnable<Boolean>() {
@Override
- public Boolean run(long dpy) {
+ public Boolean run(final long dpy) {
return new Boolean(X11Util.XineramaIsEnabled(dpy));
} };
@@ -227,7 +228,7 @@ public class ScreenDriver extends ScreenImpl {
}
@Override
- protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, Rectangle viewportInWindowUnits) {
+ protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
final RectangleImmutable ov = DEBUG ? (RectangleImmutable) getViewport().cloneMutable() : null;
/**
if( null != rAndR && rAndR.getVersion().compareTo(RandR.version130) >= 0 && getMonitorDevices().size()>0 ) {
@@ -243,7 +244,7 @@ public class ScreenDriver extends ScreenImpl {
} else */ {
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
@Override
- public Object run(long dpy) {
+ public Object run(final long dpy) {
viewport.set(0, 0, getWidth0(dpy, screen_idx), getHeight0(dpy, screen_idx));
return null;
} } );
diff --git a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
index 0eda37eac..4a3b9442d 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
@@ -80,7 +80,7 @@ public class WindowDriver extends WindowImpl {
_icon_data = PNGIcon.arrayToX11BGRAImages(NewtFactory.getWindowIcons(), data_size, elem_bytesize);
_icon_data_size = data_size[0];
_icon_elem_bytesize = elem_bytesize[0];
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -143,15 +143,15 @@ public class WindowDriver extends WindowImpl {
@Override
protected void closeNativeImpl() {
if(0!=windowHandleClose && null!=getScreen() ) {
- DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
+ final DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
final AbstractGraphicsDevice edtDevice = display.getGraphicsDevice();
edtDevice.lock();
try {
CloseWindow0(edtDevice.getHandle(), windowHandleClose,
display.getJavaObjectAtom(), display.getWindowDeleteAtom() /* , display.getKbdHandle() */); // XKB disabled for now
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if(DEBUG_IMPLEMENTATION) {
- Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
+ final Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
e.printStackTrace();
}
} finally {
@@ -172,7 +172,7 @@ public class WindowDriver extends WindowImpl {
* {@inheritDoc}
*/
@Override
- protected boolean isReconfigureFlagSupported(int changeFlags) {
+ protected boolean isReconfigureFlagSupported(final int changeFlags) {
return true; // all flags!
}
@@ -208,7 +208,7 @@ public class WindowDriver extends WindowImpl {
final DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
@Override
- public Object run(long dpy) {
+ public Object run(final long dpy) {
reconfigureWindow0( dpy, getScreenIndex(),
getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(),
_x, _y, width, height, fflags);
@@ -226,7 +226,7 @@ public class WindowDriver extends WindowImpl {
* {@inheritDoc}
*/
@Override
- protected void focusChanged(boolean defer, boolean focusGained) {
+ protected void focusChanged(final boolean defer, final boolean focusGained) {
if( isNativeValid() && isFullscreen() && tempFSAlwaysOnTop && hasFocus() != focusGained ) {
final int flags = getReconfigureFlags(FLAG_CHANGE_ALWAYSONTOP, isVisible()) | ( focusGained ? FLAG_IS_ALWAYSONTOP : 0 );
if(DEBUG_IMPLEMENTATION) {
@@ -235,7 +235,7 @@ public class WindowDriver extends WindowImpl {
final DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
@Override
- public Object run(long dpy) {
+ public Object run(final long dpy) {
reconfigureWindow0( dpy, getScreenIndex(),
getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(),
getX(), getY(), getWidth(), getHeight(), flags);
@@ -246,7 +246,7 @@ public class WindowDriver extends WindowImpl {
super.focusChanged(defer, focusGained);
}
- protected void reparentNotify(long newParentWindowHandle) {
+ protected void reparentNotify(final long newParentWindowHandle) {
if(DEBUG_IMPLEMENTATION) {
final long p0 = getParentWindowHandle();
System.err.println("Window.reparentNotify ("+getThreadName()+"): "+toHexString(p0)+" -> "+toHexString(newParentWindowHandle));
@@ -257,7 +257,7 @@ public class WindowDriver extends WindowImpl {
protected void requestFocusImpl(final boolean force) {
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
@Override
- public Object run(long dpy) {
+ public Object run(final long dpy) {
requestFocus0(dpy, getWindowHandle(), force);
return null;
}
@@ -268,7 +268,7 @@ public class WindowDriver extends WindowImpl {
protected void setTitleImpl(final String title) {
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
@Override
- public Object run(long dpy) {
+ public Object run(final long dpy) {
setTitle0(dpy, getWindowHandle(), title);
return null;
}
@@ -279,10 +279,10 @@ public class WindowDriver extends WindowImpl {
protected void setPointerIconImpl(final PointerIconImpl pi) {
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
@Override
- public Object run(long dpy) {
+ public Object run(final long dpy) {
try {
setPointerIcon0(dpy, getWindowHandle(), null != pi ? pi.validatedHandle() : 0);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
return null;
@@ -294,7 +294,7 @@ public class WindowDriver extends WindowImpl {
protected boolean setPointerVisibleImpl(final boolean pointerVisible) {
return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Boolean>() {
@Override
- public Boolean run(long dpy) {
+ public Boolean run(final long dpy) {
final PointerIconImpl pi = (PointerIconImpl)getPointerIcon();
final boolean res;
if( pointerVisible && null != pi ) {
@@ -312,7 +312,7 @@ public class WindowDriver extends WindowImpl {
protected boolean confinePointerImpl(final boolean confine) {
return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Boolean>() {
@Override
- public Boolean run(long dpy) {
+ public Boolean run(final long dpy) {
return Boolean.valueOf(confinePointer0(dpy, getWindowHandle(), confine));
}
}).booleanValue();
@@ -322,7 +322,7 @@ public class WindowDriver extends WindowImpl {
protected void warpPointerImpl(final int x, final int y) {
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
@Override
- public Object run(long dpy) {
+ public Object run(final long dpy) {
warpPointer0(dpy, getWindowHandle(), x, y);
return null;
}
@@ -333,20 +333,20 @@ public class WindowDriver extends WindowImpl {
protected Point getLocationOnScreenImpl(final int x, final int y) {
return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Point>() {
@Override
- public Point run(long dpy) {
+ public Point run(final long dpy) {
return X11Lib.GetRelativeLocation(dpy, getScreenIndex(), getWindowHandle(), 0 /*root win*/, x, y);
}
} );
}
@Override
- protected void updateInsetsImpl(Insets insets) {
+ protected void updateInsetsImpl(final Insets insets) {
// nop - using event driven insetsChange(..)
}
@Override
- protected final void doMouseEvent(boolean enqueue, boolean wait, short eventType, int modifiers,
- int x, int y, short button, float[] rotationXYZ, float rotationScale) {
+ protected final void doMouseEvent(final boolean enqueue, final boolean wait, short eventType, int modifiers,
+ final int x, final int y, short button, final float[] rotationXYZ, final float rotationScale) {
switch(eventType) {
case MouseEvent.EVENT_MOUSE_PRESSED:
switch(button) {
@@ -390,10 +390,10 @@ public class WindowDriver extends WindowImpl {
}
/** Called by native TK */
- protected final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar0, String keyString) {
+ protected final void sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar0, final String keyString) {
// handleKeyEvent(true, false, eventType, modifiers, keyCode, keyChar);
final boolean isModifierKey = KeyEvent.isModifierKey(keyCode);
- final boolean isAutoRepeat = 0 != ( KeyEvent.AUTOREPEAT_MASK & modifiers );
+ final boolean isAutoRepeat = 0 != ( InputEvent.AUTOREPEAT_MASK & modifiers );
final char keyChar = ( null != keyString ) ? keyString.charAt(0) : keyChar0;
// System.err.println("*** sendKeyEvent: event "+KeyEvent.getEventTypeString(eventType)+", keyCode "+toHexString(keyCode)+", keyChar <"+keyChar0+">/<"+keyChar+">, keyString "+keyString+", mods "+toHexString(modifiers)+
// ", isKeyCodeTracked "+isKeyCodeTracked(keyCode)+", was: pressed "+isKeyPressed(keyCode)+", repeat "+isAutoRepeat+", [modifierKey "+isModifierKey+"] - "+System.currentTimeMillis());
@@ -412,11 +412,11 @@ public class WindowDriver extends WindowImpl {
}
@Override
- public final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+ public final void sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
}
@Override
- public final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+ public final void enqueueKeyEvent(final boolean wait, final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
}
@@ -426,16 +426,16 @@ public class WindowDriver extends WindowImpl {
private static final String getCurrentThreadName() { return Thread.currentThread().getName(); } // Callback for JNI
private static final void dumpStack() { Thread.dumpStack(); } // Callback for JNI
- private final <T> T runWithLockedDisplayDevice(DisplayRunnable<T> action) {
+ private final <T> T runWithLockedDisplayDevice(final DisplayRunnable<T> action) {
return ((DisplayDriver) getScreen().getDisplay()).runWithLockedDisplayDevice(action);
}
protected static native boolean initIDs0();
- private long CreateWindow(long parentWindowHandle, long display, int screen_index,
- int visualID, long javaObjectAtom, long windowDeleteAtom,
- int x, int y, int width, int height, boolean autoPosition, int flags,
- int pixelDataSize, Buffer pixels) {
+ private long CreateWindow(final long parentWindowHandle, final long display, final int screen_index,
+ final int visualID, final long javaObjectAtom, final long windowDeleteAtom,
+ final int x, final int y, final int width, final int height, final boolean autoPosition, final int flags,
+ final int pixelDataSize, final Buffer pixels) {
// NOTE: MUST BE DIRECT BUFFER, since _NET_WM_ICON Atom uses buffer directly!
if( !Buffers.isDirect(pixels) ) {
throw new IllegalArgumentException("data buffer is not direct "+pixels);
diff --git a/src/newt/classes/jogamp/newt/event/NEWTEventTask.java b/src/newt/classes/jogamp/newt/event/NEWTEventTask.java
index 38a434279..2bdab2796 100644
--- a/src/newt/classes/jogamp/newt/event/NEWTEventTask.java
+++ b/src/newt/classes/jogamp/newt/event/NEWTEventTask.java
@@ -35,18 +35,18 @@ import com.jogamp.newt.event.NEWTEvent;
* which notifies after sending the event for the <code>invokeAndWait()</code> semantics.
*/
public class NEWTEventTask {
- private NEWTEvent event;
- private Object notifyObject;
+ private final NEWTEvent event;
+ private final Object notifyObject;
private RuntimeException exception;
- public NEWTEventTask(NEWTEvent event, Object notifyObject) {
+ public NEWTEventTask(final NEWTEvent event, final Object notifyObject) {
this.event = event ;
this.notifyObject = notifyObject ;
this.exception = null;
}
public final NEWTEvent get() { return event; }
- public final void setException(RuntimeException e) { exception = e; }
+ public final void setException(final RuntimeException e) { exception = e; }
public final RuntimeException getException() { return exception; }
public final boolean isCallerWaiting() { return null != notifyObject; }
diff --git a/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java b/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
index 91c18f023..4d5d9724a 100644
--- a/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
@@ -50,7 +50,7 @@ public class SWTEDTUtil implements EDTUtil {
private int start_iter=0;
private static long pollPeriod = EDTUtil.defaultEDTPollPeriod;
- public SWTEDTUtil(final com.jogamp.newt.Display newtDisplay, org.eclipse.swt.widgets.Display swtDisplay) {
+ public SWTEDTUtil(final com.jogamp.newt.Display newtDisplay, final org.eclipse.swt.widgets.Display swtDisplay) {
this.threadGroup = Thread.currentThread().getThreadGroup();
this.name=Thread.currentThread().getName()+"-SWTDisplay-"+newtDisplay.getFQName()+"-EDT-";
this.dispatchMessages = new Runnable() {
@@ -73,7 +73,7 @@ public class SWTEDTUtil implements EDTUtil {
}
@Override
- public void setPollPeriod(long ms) {
+ public void setPollPeriod(final long ms) {
pollPeriod = ms;
}
@@ -142,16 +142,16 @@ public class SWTEDTUtil implements EDTUtil {
}
@Override
- public final boolean invokeStop(boolean wait, Runnable task) {
+ public final boolean invokeStop(final boolean wait, final Runnable task) {
return invokeImpl(wait, task, true);
}
@Override
- public final boolean invoke(boolean wait, Runnable task) {
+ public final boolean invoke(final boolean wait, final Runnable task) {
return invokeImpl(wait, task, false);
}
- private final boolean invokeImpl(boolean wait, Runnable task, boolean stop) {
+ private final boolean invokeImpl(boolean wait, final Runnable task, boolean stop) {
Throwable throwable = null;
RunnableTask rTask = null;
final Object rTaskLock = new Object();
@@ -221,7 +221,7 @@ public class SWTEDTUtil implements EDTUtil {
if( wait ) {
try {
rTaskLock.wait(); // free lock, allow execution of rTask
- } catch (InterruptedException ie) {
+ } catch (final InterruptedException ie) {
throwable = ie;
}
if(null==throwable) {
@@ -253,7 +253,7 @@ public class SWTEDTUtil implements EDTUtil {
@Override
public void run() { }
});
- } catch (Exception e) { }
+ } catch (final Exception e) { }
return true;
}
@@ -267,7 +267,7 @@ public class SWTEDTUtil implements EDTUtil {
while( nedt.isRunning ) {
try {
edtLock.wait();
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -283,7 +283,7 @@ public class SWTEDTUtil implements EDTUtil {
volatile boolean isRunning = false;
Object sync = new Object();
- public NEDT(ThreadGroup tg, String name) {
+ public NEDT(final ThreadGroup tg, final String name) {
super(tg, name);
}
@@ -326,13 +326,13 @@ public class SWTEDTUtil implements EDTUtil {
if(!shouldStop) {
try {
sync.wait(pollPeriod);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
}
} while(!shouldStop) ;
- } catch (Throwable t) {
+ } catch (final Throwable t) {
// handle errors ..
shouldStop = true;
if(t instanceof RuntimeException) {
diff --git a/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java
index 386149b22..a989345dd 100644
--- a/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java
@@ -46,7 +46,7 @@ import com.jogamp.newt.event.MouseEvent;
*/
public class SWTNewtEventFactory {
- public static final short eventTypeSWT2NEWT(int swtType) {
+ public static final short eventTypeSWT2NEWT(final int swtType) {
switch( swtType ) {
// case SWT.MouseXXX: return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_CLICKED;
case SWT.MouseDown: return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_PRESSED;
@@ -63,7 +63,7 @@ public class SWTNewtEventFactory {
return (short)0;
}
- public static final int swtModifiers2Newt(int awtMods, boolean mouseHint) {
+ public static final int swtModifiers2Newt(final int awtMods, final boolean mouseHint) {
int newtMods = 0;
if ((awtMods & SWT.SHIFT) != 0) newtMods |= com.jogamp.newt.event.InputEvent.SHIFT_MASK;
if ((awtMods & SWT.CTRL) != 0) newtMods |= com.jogamp.newt.event.InputEvent.CTRL_MASK;
@@ -202,7 +202,7 @@ public class SWTNewtEventFactory {
}
- public static final com.jogamp.newt.event.InputEvent createInputEvent(org.eclipse.swt.widgets.Event event, NativeSurfaceHolder sourceHolder) {
+ public static final com.jogamp.newt.event.InputEvent createInputEvent(final org.eclipse.swt.widgets.Event event, final NativeSurfaceHolder sourceHolder) {
com.jogamp.newt.event.InputEvent res = createMouseEvent(event, sourceHolder);
if(null == res) {
res = createKeyEvent(event, sourceHolder);
@@ -210,7 +210,7 @@ public class SWTNewtEventFactory {
return res;
}
- public static final com.jogamp.newt.event.MouseEvent createMouseEvent(org.eclipse.swt.widgets.Event event, NativeSurfaceHolder sourceHolder) {
+ public static final com.jogamp.newt.event.MouseEvent createMouseEvent(final org.eclipse.swt.widgets.Event event, final NativeSurfaceHolder sourceHolder) {
switch(event.type) {
case SWT.MouseDown:
case SWT.MouseUp:
@@ -257,7 +257,7 @@ public class SWTNewtEventFactory {
return null; // no mapping ..
}
- public static final com.jogamp.newt.event.KeyEvent createKeyEvent(org.eclipse.swt.widgets.Event event, NativeSurfaceHolder sourceHolder) {
+ public static final com.jogamp.newt.event.KeyEvent createKeyEvent(final org.eclipse.swt.widgets.Event event, final NativeSurfaceHolder sourceHolder) {
switch(event.type) {
case SWT.KeyDown:
case SWT.KeyUp:
@@ -290,8 +290,8 @@ public class SWTNewtEventFactory {
dragButtonDown = 0;
}
- public final boolean dispatchMouseEvent(org.eclipse.swt.widgets.Event event, NativeSurfaceHolder sourceHolder, com.jogamp.newt.event.MouseListener l) {
- com.jogamp.newt.event.MouseEvent res = createMouseEvent(event, sourceHolder);
+ public final boolean dispatchMouseEvent(final org.eclipse.swt.widgets.Event event, final NativeSurfaceHolder sourceHolder, final com.jogamp.newt.event.MouseListener l) {
+ final com.jogamp.newt.event.MouseEvent res = createMouseEvent(event, sourceHolder);
if(null != res) {
if(null != l) {
switch(event.type) {
@@ -341,8 +341,8 @@ public class SWTNewtEventFactory {
return false;
}
- public final boolean dispatchKeyEvent(org.eclipse.swt.widgets.Event event, NativeSurfaceHolder sourceHolder, com.jogamp.newt.event.KeyListener l) {
- com.jogamp.newt.event.KeyEvent res = createKeyEvent(event, sourceHolder);
+ public final boolean dispatchKeyEvent(final org.eclipse.swt.widgets.Event event, final NativeSurfaceHolder sourceHolder, final com.jogamp.newt.event.KeyListener l) {
+ final com.jogamp.newt.event.KeyEvent res = createKeyEvent(event, sourceHolder);
if(null != res) {
if(null != l) {
switch(event.type) {
@@ -372,7 +372,7 @@ public class SWTNewtEventFactory {
if( null != ml ) {
final Listener listener = new Listener () {
@Override
- public void handleEvent (Event event) {
+ public void handleEvent (final Event event) {
dispatchMouseEvent( event, sourceHolder, ml );
} };
ctrl.addListener(SWT.MouseDown, listener);
@@ -385,7 +385,7 @@ public class SWTNewtEventFactory {
if( null != kl ) {
final Listener listener = new Listener () {
@Override
- public void handleEvent (Event event) {
+ public void handleEvent (final Event event) {
dispatchKeyEvent( event, sourceHolder, kl );
} };
ctrl.addListener(SWT.KeyDown, listener);
diff --git a/src/oculusvr/classes/com/jogamp/oculusvr/OVRVersion.java b/src/oculusvr/classes/com/jogamp/oculusvr/OVRVersion.java
index eebd771d8..cf6eb5dda 100644
--- a/src/oculusvr/classes/com/jogamp/oculusvr/OVRVersion.java
+++ b/src/oculusvr/classes/com/jogamp/oculusvr/OVRVersion.java
@@ -45,7 +45,7 @@ public class OVRVersion extends JogampVersion {
protected static volatile OVRVersion jogampCommonVersionInfo;
- protected OVRVersion(String packageName, Manifest mf) {
+ protected OVRVersion(final String packageName, final Manifest mf) {
super(packageName, mf);
}
@@ -95,11 +95,11 @@ public class OVRVersion extends JogampVersion {
if(null==sb) {
sb = new StringBuilder();
}
- ovrHmdDesc hmdDesc = ovrHmdDesc.create();
+ final ovrHmdDesc hmdDesc = ovrHmdDesc.create();
OVR.ovrHmd_GetDesc(ovrHmdCtx, hmdDesc);
getAvailableCapabilitiesInfo(hmdDesc, ovrHmdIndex, sb);
- ovrSensorDesc sensorDesc = ovrSensorDesc.create();
+ final ovrSensorDesc sensorDesc = ovrSensorDesc.create();
if( OVR.ovrHmd_GetSensorDesc(ovrHmdCtx, sensorDesc) ) {
sb.append("\thmd."+ovrHmdIndex+".sensor.productId:\t0x"+Integer.toHexString(sensorDesc.getProductId())).append(Platform.getNewline());
sb.append("\thmd."+ovrHmdIndex+".sensor.vendorId:\t0x"+Integer.toHexString(sensorDesc.getVendorId())).append(Platform.getNewline());
@@ -116,7 +116,7 @@ public class OVRVersion extends JogampVersion {
* @param sb
* @return
*/
- public static StringBuilder getAvailableCapabilitiesInfo(ovrHmdDesc hmdDesc, final int ovrHmdIndex, StringBuilder sb) {
+ public static StringBuilder getAvailableCapabilitiesInfo(final ovrHmdDesc hmdDesc, final int ovrHmdIndex, StringBuilder sb) {
if(null==sb) {
sb = new StringBuilder();
}
@@ -129,7 +129,7 @@ public class OVRVersion extends JogampVersion {
sb.append("\thmd."+ovrHmdIndex+".sensorCaps:\t"+hmdDesc.getSensorCaps()).append(Platform.getNewline());
final ovrSizei resolution = hmdDesc.getResolution();
sb.append("\thmd."+ovrHmdIndex+".resolution:\t"+resolution.getW()+"x"+resolution.getH()).append(Platform.getNewline());
- ovrVector2i winPos = hmdDesc.getWindowsPos();
+ final ovrVector2i winPos = hmdDesc.getWindowsPos();
sb.append("\thmd."+ovrHmdIndex+".winPos:\t"+winPos.getX()+" / "+winPos.getY()).append(Platform.getNewline());
return sb;
}
@@ -144,7 +144,7 @@ public class OVRVersion extends JogampVersion {
return sb;
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
System.err.println(VersionUtil.getPlatformInfo());
System.err.println(GlueGenVersion.getInstance());
// System.err.println(NativeWindowVersion.getInstance());
diff --git a/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererDualFBO.java b/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererDualFBO.java
index 026345067..9af3397cf 100644
--- a/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererDualFBO.java
+++ b/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererDualFBO.java
@@ -96,7 +96,7 @@ public class OVRSBSRendererDualFBO implements GLEventListener {
final FBObject ssink0 = new FBObject();
{
ssink0.reset(gl, width, height);
- ssink0.attachTexture2D(gl, 0, false, magFilter, minFilter, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ ssink0.attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
ssink0.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
}
fbos[0].setSamplingSink(ssink0);
@@ -108,16 +108,16 @@ public class OVRSBSRendererDualFBO implements GLEventListener {
final FBObject ssink1 = new FBObject();
{
ssink1.reset(gl, width, height);
- ssink1.attachTexture2D(gl, 0, false, magFilter, minFilter, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ ssink1.attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
ssink1.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
}
fbos[1].setSamplingSink(ssink1);
fbos[1].resetSamplingSink(gl); // validate
fboTexs[1] = fbos[1].getSamplingSink();
} else {
- fboTexs[0] = fbos[0].attachTexture2D(gl, 0, false, magFilter, minFilter, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ fboTexs[0] = fbos[0].attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
fbos[0].attachRenderbuffer(gl, Type.DEPTH, 24);
- fboTexs[1] = fbos[1].attachTexture2D(gl, 0, false, magFilter, minFilter, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ fboTexs[1] = fbos[1].attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
fbos[1].attachRenderbuffer(gl, Type.DEPTH, 24);
}
fbos[0].unbind(gl);
diff --git a/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererSingleFBO.java b/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererSingleFBO.java
index bfc0dd57a..b18d1634e 100644
--- a/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererSingleFBO.java
+++ b/src/oculusvr/classes/com/jogamp/opengl/oculusvr/OVRSBSRendererSingleFBO.java
@@ -97,14 +97,14 @@ public class OVRSBSRendererSingleFBO implements GLEventListener {
final FBObject ssink = new FBObject();
{
ssink.reset(gl, width, height);
- ssink.attachTexture2D(gl, 0, false, magFilter, minFilter, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ ssink.attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
ssink.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
}
fbo.setSamplingSink(ssink);
fbo.resetSamplingSink(gl); // validate
fboTex = fbo.getSamplingSink();
} else {
- fboTex = fbo.attachTexture2D(gl, 0, false, magFilter, minFilter, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+ fboTex = fbo.attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
fbo.attachRenderbuffer(gl, Type.DEPTH, 24);
}
fbo.unbind(gl);
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRDistortion.java b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRDistortion.java
index 902429900..c32270ac4 100644
--- a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRDistortion.java
+++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRDistortion.java
@@ -37,6 +37,8 @@ import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLException;
import javax.media.opengl.GLUniformData;
+import jogamp.common.os.PlatformPropsImpl;
+
import com.jogamp.common.nio.Buffers;
import com.jogamp.common.os.Platform;
import com.jogamp.oculusvr.OVR;
@@ -163,7 +165,7 @@ public class OVRDistortion {
vboTexCoordsG = null;
vboTexCoordsB = null;
}
- indices = GLArrayDataServer.createData(1, GL2ES2.GL_SHORT, indexCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+ indices = GLArrayDataServer.createData(1, GL.GL_SHORT, indexCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
// Setup: eyeToSourceUVScale, eyeToSourceUVOffset
{
@@ -356,7 +358,7 @@ public class OVRDistortion {
return "OVRDist[caps 0x"+Integer.toHexString(distortionCaps)+", "+
", tex "+textureSize[0]+"x"+textureSize[1]+
", vignette "+useVignette()+", chromatic "+useChromatic()+", timewarp "+useTimewarp()+
- ", "+Platform.NEWLINE+" "+eyes[0]+", "+Platform.NEWLINE+" "+eyes[1]+"]";
+ ", "+PlatformPropsImpl.NEWLINE+" "+eyes[0]+", "+PlatformPropsImpl.NEWLINE+" "+eyes[1]+"]";
}
public static OVRDistortion create(final OvrHmdContext hmdCtx, final boolean sbsSingleTexture,
@@ -567,7 +569,7 @@ public class OVRDistortion {
eye.updateUniform(gl, sp);
eye.enableVBO(gl, true);
if( usesDistMesh ) {
- gl.glDrawElements(GL.GL_TRIANGLES, eye.indexCount, GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, eye.indexCount, GL.GL_UNSIGNED_SHORT, 0);
} else {
gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, eye.vertexCount);
}
@@ -622,7 +624,7 @@ public class OVRDistortion {
eye.updateUniform(gl, sp);
eye.enableVBO(gl, true);
if( usesDistMesh ) {
- gl.glDrawElements(GL.GL_TRIANGLES, eye.indexCount, GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, eye.indexCount, GL.GL_UNSIGNED_SHORT, 0);
} else {
gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, eye.vertexCount);
}
diff --git a/src/test/com/jogamp/opengl/test/android/LauncherUtil.java b/src/test/com/jogamp/opengl/test/android/LauncherUtil.java
index ac69e1e4e..11dbe12cf 100644
--- a/src/test/com/jogamp/opengl/test/android/LauncherUtil.java
+++ b/src/test/com/jogamp/opengl/test/android/LauncherUtil.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -43,45 +43,45 @@ import android.util.Log;
* Helper class to parse Uri's and programmatically add package names and properties to create an Uri or Intend.
* <p>
* The order of the Uri segments (any arguments) is preserved.
- * </p>
+ * </p>
*/
public class LauncherUtil {
-
+
/** Default launch mode. */
public static final String LAUNCH_ACTIVITY_NORMAL = "org.jogamp.launcher.action.LAUNCH_ACTIVITY_NORMAL";
-
+
/** Transparent launch mode. Note: This seems to be required to achieve translucency, since setTheme(..) doesn't work. */
public static final String LAUNCH_ACTIVITY_TRANSPARENT = "org.jogamp.launcher.action.LAUNCH_ACTIVITY_TRANSPARENT";
-
+
/** FIXME: TODO */
public static final String LAUNCH_MAIN = "org.jogamp.launcher.action.LAUNCH_MAIN";
-
+
/** FIXME: TODO */
public static final String LAUNCH_JUNIT = "org.jogamp.launcher.action.LAUNCH_JUNIT";
-
+
/** The protocol <code>launch</code> */
public static final String SCHEME = "launch";
-
+
/** The host <code>jogamp.org</code> */
public static final String HOST = "jogamp.org";
-
+
static final String SYS_PKG = "sys";
-
+
static final String USR_PKG = "pkg";
-
+
static final String ARG = "arg";
-
+
public static abstract class BaseActivityLauncher extends Activity {
final OrderedProperties props = new OrderedProperties();
final ArrayList<String> args = new ArrayList<String>();
- /**
+ /**
* Returns the default {@link LauncherUtil#LAUNCH_ACTIVITY_NORMAL} action.
* <p>
* Should be overridden for other action, eg. {@link LauncherUtil#LAUNCH_ACTIVITY_TRANSPARENT}.
* </p>
*/
public String getAction() { return LAUNCH_ACTIVITY_NORMAL; }
-
+
/**
* Returns the properties, which are being propagated to the target activity.
* <p>
@@ -89,58 +89,58 @@ public class LauncherUtil {
* </p>
*/
public final OrderedProperties getProperties() { return props; }
-
+
/**
* Returns the commandline arguments, which are being propagated to the target activity.
* <p>
* Maybe be used to set custom commandline arguments.
* </p>
*/
- public final ArrayList<String> getArguments() { return args; }
-
+ public final ArrayList<String> getArguments() { return args; }
+
/** Custom initialization hook which can be overriden to setup data, e.g. fill the properties retrieved by {@link #getProperties()}. */
public void init() { }
-
+
/** Returns true if this launcher activity shall end after starting the downstream activity. Defaults to <code>true</code>, override to change behavior. */
public boolean finishAfterDelegate() { return true; }
-
+
/** Must return the downstream Activity class name */
public abstract String getActivityName();
-
+
/** Must return a list of required user packages, at least one containing the activity. */
public abstract List<String> getUsrPackages();
-
+
/** Return a list of required system packages w/ native libraries, may return null or a zero sized list. */
public abstract List<String> getSysPackages();
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
+
init();
-
+
final DataSet data = new DataSet();
data.setActivityName(getActivityName());
data.addAllSysPackages(getSysPackages());
data.addAllUsrPackages(getUsrPackages());
data.addAllProperties(props);
data.addAllArguments(args);
-
+
final Intent intent = LauncherUtil.getIntent(getAction(), data);
Log.d(getClass().getSimpleName(), "Launching Activity: "+intent);
startActivity (intent);
-
+
if(finishAfterDelegate()) {
finish(); // done
}
- }
+ }
}
-
+
public static class OrderedProperties {
HashMap<String, String> map = new HashMap<String, String>();
- ArrayList<String> keyList = new ArrayList<String>();
-
- public final void setProperty(String key, String value) {
+ ArrayList<String> keyList = new ArrayList<String>();
+
+ public final void setProperty(final String key, final String value) {
if(key.equals(SYS_PKG)) {
throw new IllegalArgumentException("Illegal property key, '"+SYS_PKG+"' is reserved");
}
@@ -157,36 +157,36 @@ public class LauncherUtil {
}
keyList.add(key); // new key
}
-
- public final void addAll(OrderedProperties props) {
- Iterator<String> argKeys = props.keyList.iterator();
+
+ public final void addAll(final OrderedProperties props) {
+ final Iterator<String> argKeys = props.keyList.iterator();
while(argKeys.hasNext()) {
final String key = argKeys.next();
setProperty(key, props.map.get(key));
- }
+ }
}
-
+
public final void setSystemProperties() {
- Iterator<String> argKeys = keyList.iterator();
+ final Iterator<String> argKeys = keyList.iterator();
while(argKeys.hasNext()) {
final String key = argKeys.next();
System.setProperty(key, map.get(key));
}
}
public final void clearSystemProperties() {
- Iterator<String> argKeys = keyList.iterator();
+ final Iterator<String> argKeys = keyList.iterator();
while(argKeys.hasNext()) {
System.clearProperty(argKeys.next());
}
}
-
- public final String getProperty(String key) { return map.get(key); }
+
+ public final String getProperty(final String key) { return map.get(key); }
public final Map<String, String> getProperties() { return map; }
-
+
/** Returns the list of property keys in the order, as they were added. */
- public final List<String> getPropertyKeys() { return keyList; }
+ public final List<String> getPropertyKeys() { return keyList; }
}
-
+
/**
* Data set to transfer from and to launch URI consisting out of:
* <ul>
@@ -205,56 +205,56 @@ public class LauncherUtil {
static final char ASSIG = '=';
static final String COLSLASH2 = "://";
static final String EMPTY = "";
-
+
String activityName = null;
ArrayList<String> sysPackages = new ArrayList<String>();
ArrayList<String> usrPackages = new ArrayList<String>();
OrderedProperties properties = new OrderedProperties();
ArrayList<String> arguments = new ArrayList<String>();
-
- public final void setActivityName(String name) { activityName = name; }
+
+ public final void setActivityName(final String name) { activityName = name; }
public final String getActivityName() { return activityName; }
-
- public final void addSysPackage(String p) {
- sysPackages.add(p);
- }
- public final void addAllSysPackages(List<String> plist) {
+
+ public final void addSysPackage(final String p) {
+ sysPackages.add(p);
+ }
+ public final void addAllSysPackages(final List<String> plist) {
sysPackages.addAll(plist);
- }
+ }
public final List<String> getSysPackages() { return sysPackages; }
-
- public final void addUsrPackage(String p) {
- usrPackages.add(p);
- }
- public final void addAllUsrPackages(List<String> plist) {
+
+ public final void addUsrPackage(final String p) {
+ usrPackages.add(p);
+ }
+ public final void addAllUsrPackages(final List<String> plist) {
usrPackages.addAll(plist);
- }
+ }
public final List<String> getUsrPackages() { return usrPackages; }
-
- public final void setProperty(String key, String value) {
+
+ public final void setProperty(final String key, final String value) {
properties.setProperty(key, value);
}
- public final void addAllProperties(OrderedProperties props) {
+ public final void addAllProperties(final OrderedProperties props) {
properties.addAll(props);
}
public final void setSystemProperties() {
properties.setSystemProperties();
- }
+ }
public final void clearSystemProperties() {
properties.clearSystemProperties();
- }
- public final String getProperty(String key) { return properties.getProperty(key); }
+ }
+ public final String getProperty(final String key) { return properties.getProperty(key); }
public final OrderedProperties getProperties() { return properties; }
public final List<String> getPropertyKeys() { return properties.getPropertyKeys(); }
-
- public final void addArgument(String arg) { arguments.add(arg); }
- public final void addAllArguments(List<String> args) {
+
+ public final void addArgument(final String arg) { arguments.add(arg); }
+ public final void addAllArguments(final List<String> args) {
arguments.addAll(args);
}
public final ArrayList<String> getArguments() { return arguments; }
-
+
public final Uri getUri() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(SCHEME).append(COLSLASH2).append(HOST).append(SLASH).append(getActivityName());
boolean needsQMark = true;
boolean needsSep = false;
@@ -284,7 +284,7 @@ public class LauncherUtil {
needsSep = true;
}
}
- Iterator<String> propKeys = properties.keyList.iterator();
+ final Iterator<String> propKeys = properties.keyList.iterator();
while(propKeys.hasNext()) {
if( needsQMark ) {
sb.append(QMARK);
@@ -297,7 +297,7 @@ public class LauncherUtil {
sb.append(key).append(ASSIG).append(properties.map.get(key));
needsSep = true;
}
- Iterator<String> args = arguments.iterator();
+ final Iterator<String> args = arguments.iterator();
while(args.hasNext()) {
if( needsQMark ) {
sb.append(QMARK);
@@ -308,18 +308,18 @@ public class LauncherUtil {
}
sb.append(ARG).append(ASSIG).append(args.next());
needsSep = true;
- }
+ }
return Uri.parse(sb.toString());
}
-
- public static final DataSet create(Uri uri) {
+
+ public static final DataSet create(final Uri uri) {
if(!uri.getScheme().equals(SCHEME)) {
return null;
}
if(!uri.getHost().equals(HOST)) {
return null;
}
- DataSet data = new DataSet();
+ final DataSet data = new DataSet();
{
String an = uri.getPath();
if(SLASH == an.charAt(0)) {
@@ -330,16 +330,16 @@ public class LauncherUtil {
}
data.setActivityName(an);
}
-
+
final String q = uri.getQuery();
final int q_l = null != q ? q.length() : -1;
int q_e = -1;
while(q_e < q_l) {
- int q_b = q_e + 1; // next term
+ final int q_b = q_e + 1; // next term
q_e = q.indexOf(AMPER, q_b);
if(0 == q_e) {
// single separator
- continue;
+ continue;
}
if(0 > q_e) {
// end
@@ -381,41 +381,41 @@ public class LauncherUtil {
data.validate();
return data;
}
-
+
public final void validate() {
if(null == activityName) {
throw new RuntimeException("Activity is not NULL");
}
}
}
-
- public final static Intent getIntent(String action, DataSet data) {
+
+ public final static Intent getIntent(final String action, final DataSet data) {
data.validate();
return new Intent(action, data.getUri());
}
-
+
public static void main(String[] args) {
if(args.length==0) {
args = new String[] {
- SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+SYS_PKG+"=jogamp.pack1&"+SYS_PKG+"=javax.pack2&"+USR_PKG+"=com.jogamp.pack3&"+USR_PKG+"=com.jogamp.pack4&jogamp.common.debug=true&com.jogamp.test=false",
+ SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+SYS_PKG+"=jogamp.pack1&"+SYS_PKG+"=javax.pack2&"+USR_PKG+"=com.jogamp.pack3&"+USR_PKG+"=com.jogamp.pack4&jogamp.common.debug=true&com.jogamp.test=false",
SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+SYS_PKG+"=jogamp.pack1&jogamp.common.debug=true&com.jogamp.test=false",
SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&jogamp.common.debug=true&com.jogamp.test=false",
SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&"+USR_PKG+"=com.jogamp.pack2",
- SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&"+USR_PKG+"=javax.pack2&"+USR_PKG+"=com.jogamp.pack3&jogamp.common.debug=true&com.jogamp.test=false&"+ARG+"=arg1&"+ARG+"=arg2=arg2value&"+ARG+"=arg3",
- SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&jogamp.common.debug=true&com.jogamp.test=false&"+ARG+"=arg1&"+ARG+"=arg2=arg2value&"+ARG+"=arg3",
- SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&"+ARG+"=arg1&"+ARG+"=arg2=arg2value&"+ARG+"=arg3"
+ SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&"+USR_PKG+"=javax.pack2&"+USR_PKG+"=com.jogamp.pack3&jogamp.common.debug=true&com.jogamp.test=false&"+ARG+"=arg1&"+ARG+"=arg2=arg2value&"+ARG+"=arg3",
+ SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&jogamp.common.debug=true&com.jogamp.test=false&"+ARG+"=arg1&"+ARG+"=arg2=arg2value&"+ARG+"=arg3",
+ SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&"+ARG+"=arg1&"+ARG+"=arg2=arg2value&"+ARG+"=arg3"
};
}
int errors = 0;
for(int i=0; i<args.length; i++) {
- String uri_s = args[i];
- Uri uri0 = Uri.parse(uri_s);
- DataSet data = DataSet.create(uri0);
+ final String uri_s = args[i];
+ final Uri uri0 = Uri.parse(uri_s);
+ final DataSet data = DataSet.create(uri0);
if(null == data) {
errors++;
System.err.println("Error: NULL JogAmpLauncherUtil: <"+uri_s+"> -> "+uri0+" -> NULL");
} else {
- Uri uri1 = data.getUri();
+ final Uri uri1 = data.getUri();
if(!uri0.equals(uri1)) {
errors++;
System.err.println("Error: Not equal: <"+uri_s+"> -> "+uri0+" -> "+uri1);
@@ -426,5 +426,5 @@ public class LauncherUtil {
}
System.err.println("LauncherUtil Self Test: Errors: "+errors);
}
-
+
}
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0a.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0a.java
index ff1ab5e3d..79b6952ee 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0a.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0a.java
@@ -60,7 +60,7 @@ public class MovieCubeActivity0a extends NewtBaseActivity {
MouseAdapter showKeyboardMouseListener = new MouseAdapter() {
@Override
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
if( e.getPointerCount() == 4 && e.getPressure(0, true) > 0.7f ) {
((com.jogamp.newt.Window) e.getSource()).setKeyboardVisible(true);
}
@@ -68,10 +68,10 @@ public class MovieCubeActivity0a extends NewtBaseActivity {
};
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- String[] streamLocs = new String[] {
+ final String[] streamLocs = new String[] {
System.getProperty("jnlp.media0_url0"),
System.getProperty("jnlp.media0_url1"),
System.getProperty("jnlp.media0_url2") };
@@ -102,11 +102,11 @@ public class MovieCubeActivity0a extends NewtBaseActivity {
final GLMediaPlayer mPlayer = demoMain.getGLMediaPlayer();
mPlayer.addEventListener(new GLMediaEventListener() {
@Override
- public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
+ public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) {
}
@Override
- public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+ public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
System.err.println("MovieCubeActivity0 AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
System.err.println("MovieCubeActivity0 State: "+mp);
if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
@@ -127,7 +127,7 @@ public class MovieCubeActivity0a extends NewtBaseActivity {
}
});
demoMain.initStream(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 0);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
@@ -136,7 +136,7 @@ public class MovieCubeActivity0a extends NewtBaseActivity {
Log.d(TAG, "onCreate - X");
}
- static URI getURI(String path[], int off, boolean checkAvail) {
+ static URI getURI(final String path[], final int off, final boolean checkAvail) {
URI uri = null;
for(int i=off; null==uri && i<path.length; i++) {
if(null != path[i] && path[i].length()>0) {
@@ -145,7 +145,7 @@ public class MovieCubeActivity0a extends NewtBaseActivity {
if( null != uc ) {
try {
uri = uc.getURL().toURI();
- } catch (URISyntaxException e) {
+ } catch (final URISyntaxException e) {
uri = null;
}
if( uc instanceof HttpURLConnection ) {
@@ -155,7 +155,7 @@ public class MovieCubeActivity0a extends NewtBaseActivity {
} else {
try {
uri = new URI(path[i]);
- } catch (URISyntaxException e) {
+ } catch (final URISyntaxException e) {
uri = null;
}
}
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0b.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0b.java
index 2707fbbec..5303276a6 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0b.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0b.java
@@ -60,7 +60,7 @@ public class MovieCubeActivity0b extends NewtBaseActivity {
MouseAdapter showKeyboardMouseListener = new MouseAdapter() {
@Override
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
if( e.getPointerCount() == 4 && e.getPressure(0, true) > 0.7f ) {
((com.jogamp.newt.Window) e.getSource()).setKeyboardVisible(true);
}
@@ -68,10 +68,10 @@ public class MovieCubeActivity0b extends NewtBaseActivity {
};
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- String[] streamLocs = new String[] {
+ final String[] streamLocs = new String[] {
System.getProperty("jnlp.media0_url0"),
System.getProperty("jnlp.media0_url1"),
System.getProperty("jnlp.media0_url2") };
@@ -104,11 +104,11 @@ public class MovieCubeActivity0b extends NewtBaseActivity {
final GLMediaPlayer mPlayer = demoMain.getGLMediaPlayer();
mPlayer.addEventListener(new GLMediaEventListener() {
@Override
- public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
+ public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) {
}
@Override
- public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+ public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
System.err.println("MovieCubeActivity0 AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
System.err.println("MovieCubeActivity0 State: "+mp);
if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
@@ -129,7 +129,7 @@ public class MovieCubeActivity0b extends NewtBaseActivity {
}
});
demoMain.initStream(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 0);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
@@ -138,7 +138,7 @@ public class MovieCubeActivity0b extends NewtBaseActivity {
Log.d(TAG, "onCreate - X");
}
- static URI getURI(String path[], int off, boolean checkAvail) {
+ static URI getURI(final String path[], final int off, final boolean checkAvail) {
URI uri = null;
for(int i=off; null==uri && i<path.length; i++) {
if(null != path[i] && path[i].length()>0) {
@@ -147,7 +147,7 @@ public class MovieCubeActivity0b extends NewtBaseActivity {
if( null != uc ) {
try {
uri = uc.getURL().toURI();
- } catch (URISyntaxException e) {
+ } catch (final URISyntaxException e) {
uri = null;
}
if( uc instanceof HttpURLConnection ) {
@@ -157,7 +157,7 @@ public class MovieCubeActivity0b extends NewtBaseActivity {
} else {
try {
uri = new URI(path[i]);
- } catch (URISyntaxException e) {
+ } catch (final URISyntaxException e) {
uri = null;
}
}
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
index 9af75d138..47e1b1796 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
@@ -59,15 +59,15 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
static String TAG = "MovieSimpleActivity0";
MouseAdapter toFrontMouseListener = new MouseAdapter() {
- public void mouseClicked(MouseEvent e) {
- Object src = e.getSource();
+ public void mouseClicked(final MouseEvent e) {
+ final Object src = e.getSource();
if(src instanceof Window) {
((Window)src).requestFocus(false);
}
} };
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final String[] streamLocs = new String[] {
@@ -102,10 +102,10 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
final GLMediaPlayer mPlayer = demoMain.getGLMediaPlayer();
mPlayer.addEventListener( new GLMediaPlayer.GLMediaEventListener() {
@Override
- public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
+ public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) { }
@Override
- public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
+ public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
System.err.println("MovieSimpleActivity0 AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
System.err.println("MovieSimpleActivity0 State: "+mp);
if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
@@ -129,7 +129,7 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
Log.d(TAG, "onCreate - X");
}
- static URI getURI(String path[], int off, boolean checkAvail) {
+ static URI getURI(final String path[], final int off, final boolean checkAvail) {
URI uri = null;
for(int i=off; null==uri && i<path.length; i++) {
if(null != path[i] && path[i].length()>0) {
@@ -138,7 +138,7 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
if( null != uc ) {
try {
uri = uc.getURL().toURI();
- } catch (URISyntaxException e) {
+ } catch (final URISyntaxException e) {
uri = null;
}
if( uc instanceof HttpURLConnection ) {
@@ -148,7 +148,7 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
} else {
try {
uri = new URI(path[i]);
- } catch (URISyntaxException e) {
+ } catch (final URISyntaxException e) {
uri = null;
}
}
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
index 54b994d1f..1fc736ee7 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
@@ -62,15 +62,15 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
static String TAG = "MovieSimpleActivity1";
MouseAdapter toFrontMouseListener = new MouseAdapter() {
- public void mouseClicked(MouseEvent e) {
- Object src = e.getSource();
+ public void mouseClicked(final MouseEvent e) {
+ final Object src = e.getSource();
if(src instanceof Window) {
((Window)src).requestFocus(false);
}
} };
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final boolean mPlayerNoZoom = Boolean.valueOf(System.getProperty("jnlp.mplayer.nozoom"));
@@ -78,7 +78,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
final boolean mPlayerSharedHUD = mPlayerHUD && Boolean.valueOf(System.getProperty("jnlp.mplayer.hud.shared"));
Log.d(TAG, "onCreate - 0 - mPlayerNoScale "+mPlayerNoZoom+", mPlayerHUD "+mPlayerHUD+", mPlayerSharedHUD "+mPlayerSharedHUD);
- String[] streamLocs = new String[] {
+ final String[] streamLocs = new String[] {
System.getProperty("jnlp.media0_url0"),
System.getProperty("jnlp.media0_url1"),
System.getProperty("jnlp.media0_url2") };
@@ -89,7 +89,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
{
URI _streamLoc1 = null;
if(mPlayerHUD && !mPlayerSharedHUD) {
- String[] urls1 = new String[] { System.getProperty("jnlp.media1_url0") };
+ final String[] urls1 = new String[] { System.getProperty("jnlp.media1_url0") };
_streamLoc1 = getURI(urls1, 1, false);
}
if(null == _streamLoc1) { _streamLoc1 = streamLoc0; }
@@ -138,10 +138,10 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
demoMain.setScaleOrig(mPlayerNoZoom);
mPlayerMain.addEventListener( new GLMediaPlayer.GLMediaEventListener() {
@Override
- public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
+ public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) { }
@Override
- public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
+ public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
System.err.println("MovieSimpleActivity1 AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
System.err.println("MovieSimpleActivity1 State: "+mp);
if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
@@ -169,7 +169,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
final GLWindow glWindowHUD = GLWindow.create(scrn, capsHUD);
glWindowMain.invoke(false, new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
final GLMediaPlayer mPlayerSub;
final MovieSimple demoHUD;
final Rectangle windowBounds = (Rectangle) scrn.getViewportInWindowUnits().cloneMutable();
@@ -189,10 +189,10 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
}
mPlayerSub.addEventListener( new GLMediaPlayer.GLMediaEventListener() {
@Override
- public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
+ public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) { }
@Override
- public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
+ public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
glWindowHUD.addGLEventListener(demoHUD);
}
@@ -231,7 +231,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
Log.d(TAG, "onCreate - X");
}
- static URI getURI(String path[], int off, boolean checkAvail) {
+ static URI getURI(final String path[], final int off, final boolean checkAvail) {
URI uri = null;
for(int i=off; null==uri && i<path.length; i++) {
if(null != path[i] && path[i].length()>0) {
@@ -240,7 +240,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
if( null != uc ) {
try {
uri = uc.getURL().toURI();
- } catch (URISyntaxException e) {
+ } catch (final URISyntaxException e) {
uri = null;
}
if( uc instanceof HttpURLConnection ) {
@@ -250,7 +250,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
} else {
try {
uri = new URI(path[i]);
- } catch (URISyntaxException e) {
+ } catch (final URISyntaxException e) {
uri = null;
}
}
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTElektronActivity.java b/src/test/com/jogamp/opengl/test/android/NEWTElektronActivity.java
index 596c2c84e..9183e572c 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTElektronActivity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTElektronActivity.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -44,35 +44,35 @@ import android.util.Log;
public class NEWTElektronActivity extends NewtBaseActivity {
static String TAG = "NEWTElektronActivity";
-
+
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
Log.d(TAG, "onCreate - 0");
super.onCreate(savedInstanceState);
-
+
// create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
Log.d(TAG, "req caps: "+caps);
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
glWindow.setFullscreen(true);
setContentView(getWindow(), glWindow);
-
+
glWindow.addGLEventListener(new ElektronenMultiplizierer());
glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
@Override
- public void monitorModeChangeNotify(MonitorEvent me) { }
+ public void monitorModeChangeNotify(final MonitorEvent me) { }
@Override
- public void monitorModeChanged(MonitorEvent me, boolean success) {
+ public void monitorModeChanged(final MonitorEvent me, final boolean success) {
System.err.println("MonitorMode Changed (success "+success+"): "+me);
}
});
glWindow.setVisible(true);
- Animator animator = new Animator(glWindow);
-
+ final Animator animator = new Animator(glWindow);
+
animator.setUpdateFPSFrames(60, System.err);
animator.resetFPSCounter();
glWindow.resetFPSCounter();
-
+
Log.d(TAG, "onCreate - X");
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTElektronActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTElektronActivityLauncher.java
index 527d66108..95504b7a7 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTElektronActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTElektronActivityLauncher.java
@@ -8,16 +8,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
public class NEWTElektronActivityLauncher extends LauncherUtil.BaseActivityLauncher {
static String demo = "com.jogamp.opengl.test.android.NEWTElektronActivity";
- static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
+ static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-
+
@Override
public void init() {
- final OrderedProperties props = getProperties();
+ final OrderedProperties props = getProperties();
// props.setProperty("jogamp.debug.JNILibLoader", "true");
// props.setProperty("jogamp.debug.NativeLibrary", "true");
// properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
- // properties.setProperty("jogamp.debug.IOUtil", "true");
+ // properties.setProperty("jogamp.debug.IOUtil", "true");
// properties.setProperty("nativewindow.debug", "all");
props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
// properties.setProperty("jogl.debug", "all");
@@ -25,7 +25,7 @@ public class NEWTElektronActivityLauncher extends LauncherUtil.BaseActivityLaunc
props.setProperty("jogl.debug.GLDrawable", "true");
props.setProperty("jogl.debug.GLContext", "true");
props.setProperty("jogl.debug.GLSLCode", "true");
- props.setProperty("jogl.debug.CapabilitiesChooser", "true");
+ props.setProperty("jogl.debug.CapabilitiesChooser", "true");
// properties.setProperty("jogl.debug.GLSLState", "true");
// properties.setProperty("jogl.debug.DebugGL", "true");
// properties.setProperty("jogl.debug.TraceGL", "true");
@@ -34,7 +34,7 @@ public class NEWTElektronActivityLauncher extends LauncherUtil.BaseActivityLaunc
// properties.setProperty("newt.debug.Window.MouseEvent", "true");
// properties.setProperty("newt.debug.Window.KeyEvent", "true");
}
-
+
@Override
public String getActivityName() {
return demo;
@@ -43,7 +43,7 @@ public class NEWTElektronActivityLauncher extends LauncherUtil.BaseActivityLaunc
public List<String> getSysPackages() {
return Arrays.asList(sys_pkgs);
}
-
+
@Override
public List<String> getUsrPackages() {
return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES1Activity.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES1Activity.java
index f10cfc11f..3ec85c108 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES1Activity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES1Activity.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -44,40 +44,40 @@ import android.util.Log;
public class NEWTGearsES1Activity extends NewtBaseActivity {
static String TAG = "NEWTGearsES1Activity";
-
+
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
Log.d(TAG, "onCreate - 0");
super.onCreate(savedInstanceState);
-
+
// create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
/*
caps.setRedBits(5);
caps.setGreenBits(6);
caps.setBlueBits(5);
caps.setAlphaBits(0); */
Log.d(TAG, "req caps: "+caps);
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
glWindow.setFullscreen(true);
setContentView(getWindow(), glWindow);
-
+
glWindow.addGLEventListener(new GearsES1(-1));
glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
@Override
- public void monitorModeChangeNotify(MonitorEvent me) { }
+ public void monitorModeChangeNotify(final MonitorEvent me) { }
@Override
- public void monitorModeChanged(MonitorEvent me, boolean success) {
+ public void monitorModeChanged(final MonitorEvent me, final boolean success) {
System.err.println("MonitorMode Changed (success "+success+"): "+me);
}
});
glWindow.setVisible(true);
- Animator animator = new Animator(glWindow);
-
+ final Animator animator = new Animator(glWindow);
+
animator.setUpdateFPSFrames(60, System.err);
animator.resetFPSCounter();
glWindow.resetFPSCounter();
-
+
Log.d(TAG, "onCreate - X");
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES1ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES1ActivityLauncher.java
index dca453126..db4d57825 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES1ActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES1ActivityLauncher.java
@@ -7,16 +7,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
public class NEWTGearsES1ActivityLauncher extends LauncherUtil.BaseActivityLauncher {
static String demo = "com.jogamp.opengl.test.android.NEWTGearsES1Activity";
- static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
+ static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-
+
@Override
public void init() {
- final OrderedProperties props = getProperties();
+ final OrderedProperties props = getProperties();
// props.setProperty("jogamp.debug.JNILibLoader", "true");
// props.setProperty("jogamp.debug.NativeLibrary", "true");
// properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
- // properties.setProperty("jogamp.debug.IOUtil", "true");
+ // properties.setProperty("jogamp.debug.IOUtil", "true");
// properties.setProperty("nativewindow.debug", "all");
props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
// properties.setProperty("jogl.debug", "all");
@@ -24,7 +24,7 @@ public class NEWTGearsES1ActivityLauncher extends LauncherUtil.BaseActivityLaunc
props.setProperty("jogl.debug.GLDrawable", "true");
props.setProperty("jogl.debug.GLContext", "true");
props.setProperty("jogl.debug.GLSLCode", "true");
- props.setProperty("jogl.debug.CapabilitiesChooser", "true");
+ props.setProperty("jogl.debug.CapabilitiesChooser", "true");
// properties.setProperty("jogl.debug.GLSLState", "true");
// properties.setProperty("jogl.debug.DebugGL", "true");
// properties.setProperty("jogl.debug.TraceGL", "true");
@@ -33,7 +33,7 @@ public class NEWTGearsES1ActivityLauncher extends LauncherUtil.BaseActivityLaunc
// properties.setProperty("newt.debug.Window.MouseEvent", "true");
// properties.setProperty("newt.debug.Window.KeyEvent", "true");
}
-
+
@Override
public String getActivityName() {
return demo;
@@ -42,7 +42,7 @@ public class NEWTGearsES1ActivityLauncher extends LauncherUtil.BaseActivityLaunc
public List<String> getSysPackages() {
return Arrays.asList(sys_pkgs);
}
-
+
@Override
public List<String> getUsrPackages() {
return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java
index 9572ef6de..eff2c876a 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java
@@ -56,30 +56,30 @@ public class NEWTGearsES2Activity extends NewtBaseActivity {
static final String forceKillProcessTest = "demo.force.killProcessTest";
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
Log.d(TAG, "onCreate - 0");
super.onCreate(savedInstanceState);
// create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
if( null != System.getProperty(forceRGBA5650) ) {
Log.d(TAG, "forceRGBA5650");
caps.setRedBits(5); caps.setGreenBits(6); caps.setBlueBits(5);
}
Log.d(TAG, "req caps: "+caps);
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
glWindow.setFullscreen(true);
setContentView(getWindow(), glWindow);
- GearsES2 demo = new GearsES2(-1);
+ final GearsES2 demo = new GearsES2(-1);
// demo.enableAndroidTrace(true);
glWindow.addGLEventListener(demo);
glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
@Override
- public void monitorModeChangeNotify(MonitorEvent me) { }
+ public void monitorModeChangeNotify(final MonitorEvent me) { }
@Override
- public void monitorModeChanged(MonitorEvent me, boolean success) {
+ public void monitorModeChanged(final MonitorEvent me, final boolean success) {
System.err.println("MonitorMode Changed (success "+success+"): "+me);
}
});
@@ -87,12 +87,12 @@ public class NEWTGearsES2Activity extends NewtBaseActivity {
Log.d(TAG, "forceKillProcessTest");
glWindow.addMouseListener(new MouseAdapter() {
@Override
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
if( e.getPointerCount() == 3 ) {
Log.d(TAG, "MemoryHog");
new Thread(new Runnable() {
public void run() {
- ArrayList<Buffer> buffers = new ArrayList<Buffer>();
+ final ArrayList<Buffer> buffers = new ArrayList<Buffer>();
while(true) {
final int halfMB = 512 * 1024;
final float osizeMB = buffers.size() * 0.5f;
@@ -102,7 +102,7 @@ public class NEWTGearsES2Activity extends NewtBaseActivity {
System.err.println("MemoryHog: ****** +4k: "+osizeMB+" MB +"+nsizeMB+" MB - Done");
try {
Thread.sleep(500);
- } catch (Exception e) {};
+ } catch (final Exception e) {};
}
} }, "MemoryHog").start();
} else if( e.getPointerCount() == 4 ) {
@@ -112,7 +112,7 @@ public class NEWTGearsES2Activity extends NewtBaseActivity {
}
});
}
- Animator animator = new Animator(glWindow);
+ final Animator animator = new Animator(glWindow);
// animator.setRunAsFastAsPossible(true);
// glWindow.setSkipContextReleaseThread(animator.getThread());
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java
index c87e66189..06316c4b0 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -37,13 +37,13 @@ public class NEWTGearsES2ActivityLauncher extends LauncherUtil.BaseActivityLaunc
static String demo = "com.jogamp.opengl.test.android.NEWTGearsES2Activity";
static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-
+
@Override
public void init() {
- final OrderedProperties props = getProperties();
+ final OrderedProperties props = getProperties();
// props.setProperty("jogamp.debug.JNILibLoader", "true");
// props.setProperty("jogamp.debug.NativeLibrary", "true");
- // props.setProperty("jogamp.debug.IOUtil", "true");
+ // props.setProperty("jogamp.debug.IOUtil", "true");
// properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
// props.setProperty("nativewindow.debug", "all");
props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
@@ -52,7 +52,7 @@ public class NEWTGearsES2ActivityLauncher extends LauncherUtil.BaseActivityLaunc
// props.setProperty("jogl.debug.GLDrawable", "true");
props.setProperty("jogl.debug.GLContext", "true");
props.setProperty("jogl.debug.GLSLCode", "true");
- // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
+ // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
// props.setProperty("jogl.debug.GLSLState", "true");
// props.setProperty("jogl.debug.DebugGL", "true");
// props.setProperty("jogl.debug.TraceGL", "true");
@@ -62,20 +62,20 @@ public class NEWTGearsES2ActivityLauncher extends LauncherUtil.BaseActivityLaunc
props.setProperty("newt.debug.Window.MouseEvent", "true");
props.setProperty("newt.debug.Window.KeyEvent", "true");
// props.setProperty("newt.debug.Android.MouseEvent", "true");
-
+
// props.setProperty("demo.force.killProcessTest", "true");
}
-
+
@Override
public String getActivityName() {
return demo;
}
-
+
@Override
public List<String> getSysPackages() {
return Arrays.asList(sys_pkgs);
}
-
+
@Override
public List<String> getUsrPackages() {
return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java
index fb00ecbad..2e005cb7f 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -35,15 +35,15 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
public class NEWTGearsES2ECTActivityLauncher extends LauncherUtil.BaseActivityLauncher {
static String demo = "com.jogamp.opengl.test.android.NEWTGearsES2Activity";
- static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
+ static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-
+
@Override
public void init() {
- final OrderedProperties props = getProperties();
+ final OrderedProperties props = getProperties();
// props.setProperty("jogamp.debug.JNILibLoader", "true");
// props.setProperty("jogamp.debug.NativeLibrary", "true");
- // props.setProperty("jogamp.debug.IOUtil", "true");
+ // props.setProperty("jogamp.debug.IOUtil", "true");
// properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
// props.setProperty("nativewindow.debug", "all");
props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
@@ -52,7 +52,7 @@ public class NEWTGearsES2ECTActivityLauncher extends LauncherUtil.BaseActivityLa
// props.setProperty("jogl.debug.GLDrawable", "true");
props.setProperty("jogl.debug.GLContext", "true");
props.setProperty("jogl.debug.GLSLCode", "true");
- // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
+ // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
// props.setProperty("jogl.debug.GLSLState", "true");
// props.setProperty("jogl.debug.DebugGL", "true");
// props.setProperty("jogl.debug.TraceGL", "true");
@@ -60,10 +60,10 @@ public class NEWTGearsES2ECTActivityLauncher extends LauncherUtil.BaseActivityLa
props.setProperty("newt.debug.Window", "true");
props.setProperty("newt.debug.Window.MouseEvent", "true");
props.setProperty("newt.debug.Window.KeyEvent", "true");
-
- props.setProperty("demo.force.ect", "true");
+
+ props.setProperty("demo.force.ect", "true");
}
-
+
@Override
public String getActivityName() {
return demo;
@@ -72,7 +72,7 @@ public class NEWTGearsES2ECTActivityLauncher extends LauncherUtil.BaseActivityLa
public List<String> getSysPackages() {
return Arrays.asList(sys_pkgs);
}
-
+
@Override
public List<String> getUsrPackages() {
return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java
index 8acd2c05a..94e32f1d0 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -35,15 +35,15 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
public class NEWTGearsES2RGB565ActivityLauncher extends LauncherUtil.BaseActivityLauncher {
static String demo = "com.jogamp.opengl.test.android.NEWTGearsES2Activity";
- static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
+ static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-
+
@Override
public void init() {
- final OrderedProperties props = getProperties();
+ final OrderedProperties props = getProperties();
// props.setProperty("jogamp.debug.JNILibLoader", "true");
// props.setProperty("jogamp.debug.NativeLibrary", "true");
- // props.setProperty("jogamp.debug.IOUtil", "true");
+ // props.setProperty("jogamp.debug.IOUtil", "true");
// properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
// props.setProperty("nativewindow.debug", "all");
props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
@@ -52,7 +52,7 @@ public class NEWTGearsES2RGB565ActivityLauncher extends LauncherUtil.BaseActivit
// props.setProperty("jogl.debug.GLDrawable", "true");
props.setProperty("jogl.debug.GLContext", "true");
props.setProperty("jogl.debug.GLSLCode", "true");
- // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
+ // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
// props.setProperty("jogl.debug.GLSLState", "true");
// props.setProperty("jogl.debug.DebugGL", "true");
// props.setProperty("jogl.debug.TraceGL", "true");
@@ -60,10 +60,10 @@ public class NEWTGearsES2RGB565ActivityLauncher extends LauncherUtil.BaseActivit
props.setProperty("newt.debug.Window", "true");
props.setProperty("newt.debug.Window.MouseEvent", "true");
props.setProperty("newt.debug.Window.KeyEvent", "true");
-
+
props.setProperty("demo.force.rgba5650", "true");
}
-
+
@Override
public String getActivityName() {
return demo;
@@ -72,7 +72,7 @@ public class NEWTGearsES2RGB565ActivityLauncher extends LauncherUtil.BaseActivit
public List<String> getSysPackages() {
return Arrays.asList(sys_pkgs);
}
-
+
@Override
public List<String> getUsrPackages() {
return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivity.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivity.java
index a07d3c97b..1080b2d89 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivity.java
@@ -48,18 +48,18 @@ public class NEWTGearsES2TransActivity extends NewtBaseActivity {
static String TAG = "NEWTGearsES2TransActivity";
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
Log.d(TAG, "onCreate - 0");
super.onCreate(savedInstanceState);
// create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
caps.setBackgroundOpaque(false);
Log.d(TAG, "req caps: "+caps);
- Screen screen = NewtFactory.createScreen(NewtFactory.createDisplay(null), 0);
+ final Screen screen = NewtFactory.createScreen(NewtFactory.createDisplay(null), 0);
screen.addReference();
- GLWindow glWindow = GLWindow.create(screen, caps);
+ final GLWindow glWindow = GLWindow.create(screen, caps);
glWindow.setSurfaceSize(2*screen.getWidth()/3, 2*screen.getHeight()/3);
glWindow.setUndecorated(true);
setContentView(getWindow(), glWindow);
@@ -67,13 +67,13 @@ public class NEWTGearsES2TransActivity extends NewtBaseActivity {
glWindow.addGLEventListener(new GearsES2(-1));
glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
@Override
- public void monitorModeChangeNotify(MonitorEvent me) { }
+ public void monitorModeChangeNotify(final MonitorEvent me) { }
@Override
- public void monitorModeChanged(MonitorEvent me, boolean success) {
+ public void monitorModeChanged(final MonitorEvent me, final boolean success) {
System.err.println("MonitorMode Changed (success "+success+"): "+me);
}
});
- Animator animator = new Animator(glWindow);
+ final Animator animator = new Animator(glWindow);
// glWindow.setSkipContextReleaseThread(animator.getThread());
glWindow.setVisible(true);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivityLauncher.java
index e6fe2a23f..332b26e76 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivityLauncher.java
@@ -7,17 +7,17 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
public class NEWTGearsES2TransActivityLauncher extends LauncherUtil.BaseActivityLauncher {
static String demo = "com.jogamp.opengl.test.android.NEWTGearsES2TransActivity";
- static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
+ static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-
+
@Override
public void init() {
- final OrderedProperties props = getProperties();
+ final OrderedProperties props = getProperties();
// props.setProperty("jnlp.android.translucent", "true");
// props.setProperty("jogamp.debug.JNILibLoader", "true");
// props.setProperty("jogamp.debug.NativeLibrary", "true");
// properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
- // properties.setProperty("jogamp.debug.IOUtil", "true");
+ // properties.setProperty("jogamp.debug.IOUtil", "true");
// properties.setProperty("nativewindow.debug", "all");
props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
// properties.setProperty("jogl.debug", "all");
@@ -25,7 +25,7 @@ public class NEWTGearsES2TransActivityLauncher extends LauncherUtil.BaseActivity
props.setProperty("jogl.debug.GLDrawable", "true");
props.setProperty("jogl.debug.GLContext", "true");
props.setProperty("jogl.debug.GLSLCode", "true");
- props.setProperty("jogl.debug.CapabilitiesChooser", "true");
+ props.setProperty("jogl.debug.CapabilitiesChooser", "true");
// properties.setProperty("jogl.debug.GLSLState", "true");
// properties.setProperty("jogl.debug.DebugGL", "true");
// properties.setProperty("jogl.debug.TraceGL", "true");
@@ -35,24 +35,24 @@ public class NEWTGearsES2TransActivityLauncher extends LauncherUtil.BaseActivity
// properties.setProperty("newt.debug.Window.KeyEvent", "true");
props.setProperty("jogamp.debug.IOUtil", "true");
}
-
+
@Override
public String getActivityName() {
return demo;
}
-
+
@Override
public List<String> getSysPackages() {
return Arrays.asList(sys_pkgs);
}
-
+
@Override
public List<String> getUsrPackages() {
return Arrays.asList(usr_pkgs);
}
-
+
@Override
public String getAction() {
return LauncherUtil.LAUNCH_ACTIVITY_TRANSPARENT;
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java
index 26adf0c4b..cd7eb4c66 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -44,38 +44,38 @@ import android.util.Log;
public class NEWTGraphUI1pActivity extends NewtBaseActivity {
static String TAG = "NEWTGraphUIActivity";
-
+
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
Log.d(TAG, "onCreate - 0");
super.onCreate(savedInstanceState);
-
+
// create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
caps.setAlphaBits(4);
caps.setNumSamples(4);
caps.setSampleBuffers(true);
Log.d(TAG, "req caps: "+caps);
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
glWindow.setFullscreen(true);
setContentView(getWindow(), glWindow);
-
+
glWindow.addGLEventListener(new GPUUISceneGLListener0A(0));
glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
@Override
- public void monitorModeChangeNotify(MonitorEvent me) { }
+ public void monitorModeChangeNotify(final MonitorEvent me) { }
@Override
- public void monitorModeChanged(MonitorEvent me, boolean success) {
+ public void monitorModeChanged(final MonitorEvent me, final boolean success) {
System.err.println("MonitorMode Changed (success "+success+"): "+me);
}
});
glWindow.setVisible(true);
- Animator animator = new Animator(glWindow);
-
+ final Animator animator = new Animator(glWindow);
+
animator.setUpdateFPSFrames(60, System.err);
animator.resetFPSCounter();
glWindow.resetFPSCounter();
-
+
Log.d(TAG, "onCreate - X");
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivityLauncher.java
index c18cf1611..5dd8686b4 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivityLauncher.java
@@ -7,16 +7,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
public class NEWTGraphUI1pActivityLauncher extends LauncherUtil.BaseActivityLauncher {
static String demo = "com.jogamp.opengl.test.android.NEWTGraphUI1pActivity";
- static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
+ static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-
+
@Override
public void init() {
- final OrderedProperties props = getProperties();
+ final OrderedProperties props = getProperties();
// props.setProperty("jogamp.debug.JNILibLoader", "true");
// props.setProperty("jogamp.debug.NativeLibrary", "true");
// props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
- // props.setProperty("jogamp.debug.IOUtil", "true");
+ // props.setProperty("jogamp.debug.IOUtil", "true");
// props.setProperty("nativewindow.debug", "all");
props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
// props.setProperty("jogl.debug", "all");
@@ -24,7 +24,7 @@ public class NEWTGraphUI1pActivityLauncher extends LauncherUtil.BaseActivityLaun
props.setProperty("jogl.debug.GLDrawable", "true");
props.setProperty("jogl.debug.GLContext", "true");
props.setProperty("jogl.debug.GLSLCode", "true");
- props.setProperty("jogl.debug.CapabilitiesChooser", "true");
+ props.setProperty("jogl.debug.CapabilitiesChooser", "true");
// props.setProperty("jogl.debug.GLSLState", "true");
// props.setProperty("jogl.debug.DebugGL", "true");
// props.setProperty("jogl.debug.TraceGL", "true");
@@ -33,17 +33,17 @@ public class NEWTGraphUI1pActivityLauncher extends LauncherUtil.BaseActivityLaun
// props.setProperty("newt.debug.Window.MouseEvent", "true");
// props.setProperty("newt.debug.Window.KeyEvent", "true");
}
-
+
@Override
public String getActivityName() {
return demo;
}
-
+
@Override
public List<String> getSysPackages() {
return Arrays.asList(sys_pkgs);
}
-
+
@Override
public List<String> getUsrPackages() {
return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java
index 43e26171e..55bdbcff6 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java
@@ -47,29 +47,29 @@ public class NEWTGraphUI2pActivity extends NewtBaseActivity {
static String TAG = "NEWTGraphUIActivity";
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
Log.d(TAG, "onCreate - 0");
super.onCreate(savedInstanceState);
// create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
caps.setAlphaBits(4);
Log.d(TAG, "req caps: "+caps);
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
glWindow.setFullscreen(true);
setContentView(getWindow(), glWindow);
glWindow.addGLEventListener(new GPUUISceneGLListener0A(Region.VBAA_RENDERING_BIT));
glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
@Override
- public void monitorModeChangeNotify(MonitorEvent me) { }
+ public void monitorModeChangeNotify(final MonitorEvent me) { }
@Override
- public void monitorModeChanged(MonitorEvent me, boolean success) {
+ public void monitorModeChanged(final MonitorEvent me, final boolean success) {
System.err.println("MonitorMode Changed (success "+success+"): "+me);
}
});
glWindow.setVisible(true);
- Animator animator = new Animator(glWindow);
+ final Animator animator = new Animator(glWindow);
animator.setUpdateFPSFrames(60, System.err);
animator.resetFPSCounter();
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivityLauncher.java
index 501d42566..09e500b36 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivityLauncher.java
@@ -7,16 +7,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
public class NEWTGraphUI2pActivityLauncher extends LauncherUtil.BaseActivityLauncher {
static String demo = "com.jogamp.opengl.test.android.NEWTGraphUI2pActivity";
- static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
+ static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-
+
@Override
public void init() {
- final OrderedProperties props = getProperties();
+ final OrderedProperties props = getProperties();
// props.setProperty("jogamp.debug.JNILibLoader", "true");
// props.setProperty("jogamp.debug.NativeLibrary", "true");
// properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
- // properties.setProperty("jogamp.debug.IOUtil", "true");
+ // properties.setProperty("jogamp.debug.IOUtil", "true");
// properties.setProperty("nativewindow.debug", "all");
props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
// properties.setProperty("jogl.debug", "all");
@@ -24,7 +24,7 @@ public class NEWTGraphUI2pActivityLauncher extends LauncherUtil.BaseActivityLaun
props.setProperty("jogl.debug.GLDrawable", "true");
props.setProperty("jogl.debug.GLContext", "true");
props.setProperty("jogl.debug.GLSLCode", "true");
- props.setProperty("jogl.debug.CapabilitiesChooser", "true");
+ props.setProperty("jogl.debug.CapabilitiesChooser", "true");
// properties.setProperty("jogl.debug.GLSLState", "true");
// properties.setProperty("jogl.debug.DebugGL", "true");
// properties.setProperty("jogl.debug.TraceGL", "true");
@@ -33,17 +33,17 @@ public class NEWTGraphUI2pActivityLauncher extends LauncherUtil.BaseActivityLaun
// properties.setProperty("newt.debug.Window.MouseEvent", "true");
// properties.setProperty("newt.debug.Window.KeyEvent", "true");
}
-
+
@Override
public String getActivityName() {
return demo;
}
-
+
@Override
public List<String> getSysPackages() {
return Arrays.asList(sys_pkgs);
}
-
+
@Override
public List<String> getUsrPackages() {
return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1Activity.java b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1Activity.java
index 08fbf643d..f256f98a9 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1Activity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1Activity.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -44,34 +44,34 @@ import android.util.Log;
public class NEWTRedSquareES1Activity extends NewtBaseActivity {
static String TAG = "NEWTGearsES1Activity";
-
+
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
Log.d(TAG, "onCreate - 0");
super.onCreate(savedInstanceState);
-
+
// create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
Log.d(TAG, "req caps: "+caps);
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
setContentView(getWindow(), glWindow);
-
+
glWindow.addGLEventListener(new RedSquareES1(-1));
glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
@Override
- public void monitorModeChangeNotify(MonitorEvent me) { }
+ public void monitorModeChangeNotify(final MonitorEvent me) { }
@Override
- public void monitorModeChanged(MonitorEvent me, boolean success) {
+ public void monitorModeChanged(final MonitorEvent me, final boolean success) {
System.err.println("MonitorMode Changed (success "+success+"): "+me);
}
});
glWindow.setVisible(true);
- Animator animator = new Animator(glWindow);
-
+ final Animator animator = new Animator(glWindow);
+
animator.setUpdateFPSFrames(60, System.err);
animator.resetFPSCounter();
glWindow.resetFPSCounter();
-
+
Log.d(TAG, "onCreate - X");
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1ActivityLauncher.java
index 59bf5ceee..4b5a05f37 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1ActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1ActivityLauncher.java
@@ -7,16 +7,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
public class NEWTRedSquareES1ActivityLauncher extends LauncherUtil.BaseActivityLauncher {
static String demo = "com.jogamp.opengl.test.android.NEWTRedSquareES1Activity";
- static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
+ static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-
+
@Override
public void init() {
- final OrderedProperties props = getProperties();
+ final OrderedProperties props = getProperties();
// props.setProperty("jogamp.debug.JNILibLoader", "true");
// props.setProperty("jogamp.debug.NativeLibrary", "true");
// properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
- // properties.setProperty("jogamp.debug.IOUtil", "true");
+ // properties.setProperty("jogamp.debug.IOUtil", "true");
// properties.setProperty("nativewindow.debug", "all");
props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
// properties.setProperty("jogl.debug", "all");
@@ -24,7 +24,7 @@ public class NEWTRedSquareES1ActivityLauncher extends LauncherUtil.BaseActivityL
props.setProperty("jogl.debug.GLDrawable", "true");
props.setProperty("jogl.debug.GLContext", "true");
props.setProperty("jogl.debug.GLSLCode", "true");
- props.setProperty("jogl.debug.CapabilitiesChooser", "true");
+ props.setProperty("jogl.debug.CapabilitiesChooser", "true");
// properties.setProperty("jogl.debug.GLSLState", "true");
// properties.setProperty("jogl.debug.DebugGL", "true");
// properties.setProperty("jogl.debug.TraceGL", "true");
@@ -33,17 +33,17 @@ public class NEWTRedSquareES1ActivityLauncher extends LauncherUtil.BaseActivityL
// properties.setProperty("newt.debug.Window.MouseEvent", "true");
// properties.setProperty("newt.debug.Window.KeyEvent", "true");
}
-
+
@Override
public String getActivityName() {
return demo;
}
-
+
@Override
public List<String> getSysPackages() {
return Arrays.asList(sys_pkgs);
}
-
+
@Override
public List<String> getUsrPackages() {
return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2Activity.java b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2Activity.java
index 75ae94e89..99c65d6ad 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2Activity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2Activity.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -44,56 +44,56 @@ import android.util.Log;
public class NEWTRedSquareES2Activity extends NewtBaseActivity {
static String TAG = "NEWTGearsES2Activity";
-
+
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
Log.d(TAG, "onCreate - 0");
super.onCreate(savedInstanceState);
-
+
// create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
Log.d(TAG, "req caps: "+caps);
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
// glWindow.setSize(200, 200);
// glWindow.setUndecorated(true);
- glWindow.setFullscreen(true);
+ glWindow.setFullscreen(true);
setContentView(getWindow(), glWindow);
-
+
final RedSquareES2 demo = new RedSquareES2(-1);
// demo.enableAndroidTrace(true);
glWindow.addGLEventListener(demo);
glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
@Override
- public void monitorModeChangeNotify(MonitorEvent me) { }
+ public void monitorModeChangeNotify(final MonitorEvent me) { }
@Override
- public void monitorModeChanged(MonitorEvent me, boolean success) {
+ public void monitorModeChanged(final MonitorEvent me, final boolean success) {
System.err.println("MonitorMode Changed (success "+success+"): "+me);
}
});
- Animator animator = new Animator(glWindow);
+ final Animator animator = new Animator(glWindow);
// animator.setRunAsFastAsPossible(true);
// glWindow.setSkipContextReleaseThread(animator.getThread());
glWindow.setVisible(true);
-
+
animator.setUpdateFPSFrames(60, System.err);
animator.resetFPSCounter();
glWindow.resetFPSCounter();
-
+
Log.d(TAG, "onCreate - X");
}
-
+
@Override
public void onResume() {
// android.os.Debug.startMethodTracing("GearsES2.trace");
- // android.os.Debug.startAllocCounting();
+ // android.os.Debug.startAllocCounting();
super.onResume();
}
-
+
@Override
public void onPause() {
// android.os.Debug.stopAllocCounting();
// android.os.Debug.stopMethodTracing();
- super.onPause();
+ super.onPause();
}
-
+
}
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2ActivityLauncher.java
index a631eab8e..40cb4bfb5 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2ActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2ActivityLauncher.java
@@ -8,14 +8,14 @@ import android.util.Log;
public class NEWTRedSquareES2ActivityLauncher extends Activity {
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
+
final Uri uri = Uri.parse("launch://jogamp.org/com.jogamp.opengl.test.android.NEWTRedSquareES2Activity?sys=com.jogamp.common&sys=javax.media.opengl&pkg=com.jogamp.opengl.test");
- final Intent intent = new Intent("org.jogamp.launcher.action.LAUNCH_ACTIVITY_NORMAL", uri);
+ final Intent intent = new Intent("org.jogamp.launcher.action.LAUNCH_ACTIVITY_NORMAL", uri);
Log.d(getClass().getSimpleName(), "Launching Activity: "+intent);
startActivity (intent);
-
+
finish(); // done
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java b/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java
index 66889e9ed..9136b4e61 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java
@@ -1,9 +1,12 @@
package com.jogamp.opengl.test.bugs;
import javax.swing.*;
+
import java.awt.*;
+
import javax.media.opengl.*;
import javax.media.opengl.awt.*;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
public class Bug427GLJPanelTest1 extends JFrame implements GLEventListener {
@@ -20,35 +23,35 @@ public class Bug427GLJPanelTest1 extends JFrame implements GLEventListener {
setLocation(40, 40);
setVisible(true);
} } );
- } catch(Exception ex) {
+ } catch(final Exception ex) {
throw new RuntimeException(ex);
}
- GLProfile glp = GLProfile.get(GLProfile.GL2);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.get(GLProfile.GL2);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setDoubleBuffered(true);
caps.setHardwareAccelerated(true);
- GLJPanel panel = new GLJPanel(caps);
+ final GLJPanel panel = new GLJPanel(caps);
panel.addGLEventListener(this);
add(panel, BorderLayout.CENTER);
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
final Bug427GLJPanelTest1 demo = new Bug427GLJPanelTest1();
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
demo.setVisible(true);
} } );
- } catch(Exception ex) {
+ } catch(final Exception ex) {
throw new RuntimeException(ex);
}
}
- public void display(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
gl.glClear(GL.GL_COLOR_BUFFER_BIT);
gl.glBegin(GL.GL_TRIANGLES);
@@ -66,21 +69,21 @@ public class Bug427GLJPanelTest1 extends JFrame implements GLEventListener {
gl.glFlush();
}
- public void init(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+ public void init(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
gl.glClearColor(0, 0, 0, 0);
- gl.glMatrixMode(GL2.GL_PROJECTION);
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(0, 1, 0, 1, -1, 1);
}
- public void reshape(GLAutoDrawable glDrawable, int x, int y, int w, int h) {
+ public void reshape(final GLAutoDrawable glDrawable, final int x, final int y, final int w, final int h) {
}
- public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
+ public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {
}
-
- public void dispose(GLAutoDrawable drawable) {
+
+ public void dispose(final GLAutoDrawable drawable) {
}
}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv0AppletAWT.java b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv0AppletAWT.java
index f443459c3..7b8313b7f 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv0AppletAWT.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv0AppletAWT.java
@@ -49,15 +49,15 @@ import com.jogamp.opengl.util.glsl.ShaderState;
public class Bug735Inv0AppletAWT extends Applet implements Runnable {
static public int AWT = 0;
static public int NEWT = 1;
-
+
static public int APPLET_WIDTH = 500;
static public int APPLET_HEIGHT = 290;
static public int TARGET_FPS = 120;
static public int TOOLKIT = NEWT;
static public boolean MANUAL_FRAME_HANDLING = true;
-
+
//////////////////////////////////////////////////////////////////////////////
-
+
static private Frame frame;
static private Bug735Inv0AppletAWT applet;
private GLCanvas awtCanvas;
@@ -66,52 +66,52 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
private DrawRunnable drawRunnable;
private GLContext context;
private GLU glu;
-
+
private int width;
private int height;
private Thread thread;
-
+
private boolean doneInit = false;
private boolean doneSetup = false;
-
- private long frameRatePeriod = 1000000000L / TARGET_FPS;
+
+ private final long frameRatePeriod = 1000000000L / TARGET_FPS;
private long millisOffset;
private int frameCount;
private float frameRate;
-
+
private ShaderCode vertShader;
private ShaderCode fragShader;
private ShaderProgram shaderProg;
private ShaderState shaderState;
private GLUniformData resolution;
- private GLUniformData time;
- private GLArrayDataServer vertices;
-
- private int fcount = 0, lastm = 0;
- private int fint = 1;
-
+ private GLUniformData time;
+ private GLArrayDataServer vertices;
+
+ private int fcount = 0, lastm = 0;
+ private final int fint = 1;
+
public void init() {
setSize(APPLET_WIDTH, APPLET_HEIGHT);
setPreferredSize(new Dimension(APPLET_WIDTH, APPLET_HEIGHT));
width = APPLET_WIDTH;
height = APPLET_HEIGHT;
}
-
+
public void start() {
thread = new Thread(this, "Animation Thread");
- thread.start();
+ thread.start();
}
-
- public void run() {
+
+ public void run() {
int noDelays = 0;
// Number of frames with a delay of 0 ms before the
// animation thread yields to other running threads.
final int NO_DELAYS_PER_YIELD = 15;
final int TIMEOUT_SECONDS = 2;
-
+
long beforeTime = System.nanoTime();
long overSleepTime = 0L;
-
+
millisOffset = System.currentTimeMillis();
frameCount = 1;
while (Thread.currentThread() == thread) {
@@ -119,26 +119,26 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
requestDraw(latch);
try {
latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
-
+
if (frameCount == 1) {
EventQueue.invokeLater(new Runnable() {
public void run() {
requestFocusInWindow();
}
});
- }
-
- long afterTime = System.nanoTime();
- long timeDiff = afterTime - beforeTime;
- long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;
+ }
+
+ final long afterTime = System.nanoTime();
+ final long timeDiff = afterTime - beforeTime;
+ final long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;
if (sleepTime > 0) { // some time left in this cycle
try {
Thread.sleep(sleepTime / 1000000L, (int) (sleepTime % 1000000L));
noDelays = 0; // Got some sleep, not delaying anymore
- } catch (InterruptedException ex) { }
+ } catch (final InterruptedException ex) { }
overSleepTime = (System.nanoTime() - afterTime) - sleepTime;
} else { // sleepTime <= 0; the frame took longer than the period
overSleepTime = 0L;
@@ -147,54 +147,54 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
Thread.yield(); // give another thread a chance to run
noDelays = 0;
}
- }
+ }
beforeTime = System.nanoTime();
}
}
-
- public void requestDraw(CountDownLatch latch) {
+
+ public void requestDraw(final CountDownLatch latch) {
if (!doneInit) {
initDraw();
}
-
- if (TOOLKIT == AWT) {
- awtCanvas.invoke(true, drawRunnable);
- } else if (TOOLKIT == NEWT) {
- newtWindow.invoke(true, drawRunnable);
+
+ if (TOOLKIT == AWT) {
+ awtCanvas.invoke(true, drawRunnable);
+ } else if (TOOLKIT == NEWT) {
+ newtWindow.invoke(true, drawRunnable);
}
-
+
if (latch != null) {
latch.countDown();
- }
+ }
}
-
+
private class DrawRunnable implements GLRunnable {
private boolean notCurrent;
-
+
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
if (MANUAL_FRAME_HANDLING) {
- makeContextCurrent();
+ makeContextCurrent();
}
-
+
if (doneSetup) {
draw(drawable.getGL().getGL2ES2());
} else {
setup(drawable.getGL().getGL2ES2());
- }
+ }
checkGLErrors(drawable.getGL());
-
+
if (MANUAL_FRAME_HANDLING) {
swapBuffers();
releaseCurrentContext();
}
-
+
return true;
}
-
+
private void makeContextCurrent() {
- int MAX_CONTEXT_GRAB_ATTEMPTS = 10;
-
+ final int MAX_CONTEXT_GRAB_ATTEMPTS = 10;
+
if (context.isCurrent()) {
notCurrent = false;
} else {
@@ -218,17 +218,17 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
} catch (final InterruptedException e) {
e.printStackTrace();
}
-
+
} while (value == GLContext.CONTEXT_NOT_CURRENT);
- }
+ }
}
-
+
private void swapBuffers() {
final GL gl = GLContext.getCurrentGL();
gl.glFlush();
- GLContext.getCurrent().getGLDrawable().swapBuffers();
+ GLContext.getCurrent().getGLDrawable().swapBuffers();
}
-
+
private void releaseCurrentContext() {
if (notCurrent) {
try {
@@ -237,31 +237,31 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
} catch (final GLException gle) {
gle.printStackTrace();
}
- }
+ }
}
}
-
+
private void initGL() {
- GLProfile profile = GLProfile.getDefault();
- GLCapabilities caps = new GLCapabilities(profile);
+ final GLProfile profile = GLProfile.getDefault();
+ final GLCapabilities caps = new GLCapabilities(profile);
caps.setBackgroundOpaque(true);
caps.setOnscreen(true);
caps.setSampleBuffers(false);
-
+
if (TOOLKIT == AWT) {
awtCanvas = new GLCanvas(caps);
awtCanvas.setBounds(0, 0, applet.width, applet.height);
awtCanvas.setBackground(new Color(0xFFCCCCCC, true));
- awtCanvas.setFocusable(true);
-
+ awtCanvas.setFocusable(true);
+
applet.setLayout(new BorderLayout());
applet.add(awtCanvas, BorderLayout.CENTER);
-
+
if (MANUAL_FRAME_HANDLING) {
awtCanvas.setIgnoreRepaint(true);
- awtCanvas.setAutoSwapBufferMode(false);
+ awtCanvas.setAutoSwapBufferMode(false);
}
- } else if (TOOLKIT == NEWT) {
+ } else if (TOOLKIT == NEWT) {
newtWindow = GLWindow.create(caps);
newtCanvas = new NewtCanvasAWT(newtWindow);
newtCanvas.setBounds(0, 0, applet.width, applet.height);
@@ -270,14 +270,14 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
applet.setLayout(new BorderLayout());
applet.add(newtCanvas, BorderLayout.CENTER);
-
+
if (MANUAL_FRAME_HANDLING) {
newtCanvas.setIgnoreRepaint(true);
- newtWindow.setAutoSwapBufferMode(false);
+ newtWindow.setAutoSwapBufferMode(false);
}
}
}
-
+
private void initDraw() {
if (TOOLKIT == AWT) {
awtCanvas.setVisible(true);
@@ -287,7 +287,7 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
// Request the focus here as it cannot work when the window is not visible
awtCanvas.requestFocus();
context = awtCanvas.getContext();
- }
+ }
} else if (TOOLKIT == NEWT) {
newtCanvas.setVisible(true);
// Force the realization
@@ -298,37 +298,37 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
context = newtWindow.getContext();
}
}
-
+
drawRunnable = new DrawRunnable();
-
+
doneInit = true;
}
-
- private void setup(GL2ES2 gl) {
+
+ private void setup(final GL2ES2 gl) {
if (60 < TARGET_FPS) {
// Disables vsync
- gl.setSwapInterval(0);
+ gl.setSwapInterval(0);
}
glu = new GLU();
-
+
vertShader = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, LandscapeES2.class, "shader", "shader/bin", "landscape", true);
fragShader = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, LandscapeES2.class, "shader", "shader/bin", "landscape", true);
vertShader.defaultShaderCustomization(gl, true, true);
fragShader.defaultShaderCustomization(gl, true, true);
shaderProg = new ShaderProgram();
shaderProg.add(gl, vertShader, System.err);
- shaderProg.add(gl, fragShader, System.err);
-
+ shaderProg.add(gl, fragShader, System.err);
+
shaderState = new ShaderState();
shaderState.attachShaderProgram(gl, shaderProg, true);
-
+
resolution = new GLUniformData("iResolution", 3, FloatBuffer.wrap(new float[] {width, height, 0}));
shaderState.ownUniform(resolution);
- shaderState.uniform(gl, resolution);
-
+ shaderState.uniform(gl, resolution);
+
time = new GLUniformData("iGlobalTime", 0.0f);
shaderState.ownUniform(time);
-
+
vertices = GLArrayDataServer.createGLSL("inVertex", 2, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
vertices.putf(-1.0f); vertices.putf(-1.0f);
vertices.putf(+1.0f); vertices.putf(-1.0f);
@@ -337,94 +337,94 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
vertices.seal(gl, true);
shaderState.ownAttribute(vertices, true);
shaderState.useProgram(gl, false);
-
+
doneSetup = true;
}
- private void draw(GL2ES2 gl) {
+ private void draw(final GL2ES2 gl) {
// gl.glClearColor(0.5f, 0.1f, 0.1f, 1);
// gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT);
-
- shaderState.useProgram(gl, true);
-
+
+ shaderState.useProgram(gl, true);
+
time.setData((System.currentTimeMillis() - millisOffset) / 1000.0f);
shaderState.uniform(gl, time);
vertices.enableBuffer(gl, true);
- gl.glDrawArrays(GL2ES2.GL_TRIANGLE_STRIP, 0, 4);
+ gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
vertices.enableBuffer(gl, false);
-
+
shaderState.useProgram(gl, false);
-
+
// Compute current framerate and printout.
- frameCount++;
+ frameCount++;
fcount += 1;
- int m = (int) (System.currentTimeMillis() - millisOffset);
+ final int m = (int) (System.currentTimeMillis() - millisOffset);
if (m - lastm > 1000 * fint) {
frameRate = (float)(fcount) / fint;
fcount = 0;
lastm = m;
- }
+ }
if (frameCount % TARGET_FPS == 0) {
- System.out.println("FrameCount: " + frameCount + " - " +
+ System.out.println("FrameCount: " + frameCount + " - " +
"FrameRate: " + frameRate);
- }
- }
-
- private void checkGLErrors(GL gl) {
- int err = gl.glGetError();
+ }
+ }
+
+ private void checkGLErrors(final GL gl) {
+ final int err = gl.glGetError();
if (err != 0) {
- String errString = glu.gluErrorString(err);
+ final String errString = glu.gluErrorString(err);
System.out.println(errString);
- }
+ }
}
-
- static public void main(String[] args) {
- GraphicsEnvironment environment =
+
+ static public void main(final String[] args) {
+ final GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
+ final GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
frame = new Frame(displayDevice.getDefaultConfiguration());
frame.setBackground(new Color(0xCC, 0xCC, 0xCC));
frame.setTitle("TestBug735Inv0AppletAWT");
-
+
try {
- Class<?> c = Thread.currentThread().getContextClassLoader().
+ final Class<?> c = Thread.currentThread().getContextClassLoader().
loadClass(Bug735Inv0AppletAWT.class.getName());
applet = (Bug735Inv0AppletAWT) c.newInstance();
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException(e);
- }
-
+ }
+
frame.setLayout(null);
frame.add(applet);
frame.pack();
frame.setResizable(false);
-
+
applet.init();
-
- Insets insets = frame.getInsets();
- int windowW = applet.width + insets.left + insets.right;
- int windowH = applet.height + insets.top + insets.bottom;
- frame.setSize(windowW, windowH);
-
- Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
+
+ final Insets insets = frame.getInsets();
+ final int windowW = applet.width + insets.left + insets.right;
+ final int windowH = applet.height + insets.top + insets.bottom;
+ frame.setSize(windowW, windowH);
+
+ final Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
frame.setLocation(screenRect.x + (screenRect.width - applet.width) / 2,
- screenRect.y + (screenRect.height - applet.height) / 2);
-
- int usableWindowH = windowH - insets.top - insets.bottom;
+ screenRect.y + (screenRect.height - applet.height) / 2);
+
+ final int usableWindowH = windowH - insets.top - insets.bottom;
applet.setBounds((windowW - applet.width)/2,
insets.top + (usableWindowH - applet.height)/2,
applet.width, applet.height);
-
+
// This allows to close the frame.
frame.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
System.exit(0);
}
});
-
+
applet.initGL();
frame.setVisible(true);
- applet.start();
+ applet.start();
}
}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv1AppletAWT.java b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv1AppletAWT.java
index e8cef5e16..377f5e7ef 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv1AppletAWT.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv1AppletAWT.java
@@ -51,15 +51,15 @@ import com.jogamp.opengl.util.glsl.ShaderState;
public class Bug735Inv1AppletAWT extends Applet implements Runnable {
static public int AWT = 0;
static public int NEWT = 1;
-
+
static public int APPLET_WIDTH = 500;
static public int APPLET_HEIGHT = 290;
static public int TARGET_FPS = 120;
static public int TOOLKIT = NEWT;
static public boolean MANUAL_FRAME_HANDLING = true;
-
+
//////////////////////////////////////////////////////////////////////////////
-
+
static private Frame frame;
static private Bug735Inv1AppletAWT applet;
private GLCanvas awtCanvas;
@@ -68,52 +68,52 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
private DrawRunnable drawRunnable;
// JAU private GLContext context;
private GLU glu;
-
+
private int width;
private int height;
private Thread thread;
-
+
private boolean doneInit = false;
private boolean doneSetup = false;
-
- private long frameRatePeriod = 1000000000L / TARGET_FPS;
+
+ private final long frameRatePeriod = 1000000000L / TARGET_FPS;
private long millisOffset;
private int frameCount;
private float frameRate;
-
+
private ShaderCode vertShader;
private ShaderCode fragShader;
private ShaderProgram shaderProg;
private ShaderState shaderState;
private GLUniformData resolution;
- private GLUniformData time;
- private GLArrayDataServer vertices;
-
- private int fcount = 0, lastm = 0;
- private int fint = 1;
-
+ private GLUniformData time;
+ private GLArrayDataServer vertices;
+
+ private int fcount = 0, lastm = 0;
+ private final int fint = 1;
+
public void init() {
setSize(APPLET_WIDTH, APPLET_HEIGHT);
setPreferredSize(new Dimension(APPLET_WIDTH, APPLET_HEIGHT));
width = APPLET_WIDTH;
height = APPLET_HEIGHT;
}
-
+
public void start() {
thread = new Thread(this, "Animation Thread");
- thread.start();
+ thread.start();
}
-
- public void run() {
+
+ public void run() {
int noDelays = 0;
// Number of frames with a delay of 0 ms before the
// animation thread yields to other running threads.
final int NO_DELAYS_PER_YIELD = 15;
final int TIMEOUT_SECONDS = 2;
-
+
long beforeTime = System.nanoTime();
long overSleepTime = 0L;
-
+
millisOffset = System.currentTimeMillis();
frameCount = 1;
while (Thread.currentThread() == thread) {
@@ -121,26 +121,26 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
requestDraw(latch);
try {
latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
-
+
if (frameCount == 1) {
EventQueue.invokeLater(new Runnable() {
public void run() {
requestFocusInWindow();
}
});
- }
-
- long afterTime = System.nanoTime();
- long timeDiff = afterTime - beforeTime;
- long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;
+ }
+
+ final long afterTime = System.nanoTime();
+ final long timeDiff = afterTime - beforeTime;
+ final long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;
if (sleepTime > 0) { // some time left in this cycle
try {
Thread.sleep(sleepTime / 1000000L, (int) (sleepTime % 1000000L));
noDelays = 0; // Got some sleep, not delaying anymore
- } catch (InterruptedException ex) { }
+ } catch (final InterruptedException ex) { }
overSleepTime = (System.nanoTime() - afterTime) - sleepTime;
} else { // sleepTime <= 0; the frame took longer than the period
overSleepTime = 0L;
@@ -149,53 +149,53 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
Thread.yield(); // give another thread a chance to run
noDelays = 0;
}
- }
+ }
beforeTime = System.nanoTime();
}
}
-
- public void requestDraw(CountDownLatch latch) {
+
+ public void requestDraw(final CountDownLatch latch) {
if (!doneInit) {
initDraw();
}
-
- if (TOOLKIT == AWT) {
- awtCanvas.invoke(true, drawRunnable);
- } else if (TOOLKIT == NEWT) {
- newtWindow.invoke(true, drawRunnable);
+
+ if (TOOLKIT == AWT) {
+ awtCanvas.invoke(true, drawRunnable);
+ } else if (TOOLKIT == NEWT) {
+ newtWindow.invoke(true, drawRunnable);
}
-
+
if (latch != null) {
latch.countDown();
- }
+ }
}
-
+
private class DrawRunnable implements GLRunnable {
private boolean notCurrent;
-
+
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
if (MANUAL_FRAME_HANDLING) {
- makeContextCurrent(drawable.getContext());
+ makeContextCurrent(drawable.getContext());
}
-
+
if (!doneSetup) {
setup(drawable.getGL().getGL2ES2());
}
draw(drawable.getGL().getGL2ES2());
checkGLErrors(drawable.getGL());
-
+
if (MANUAL_FRAME_HANDLING) {
swapBuffers(drawable.getContext());
releaseCurrentContext(drawable.getContext());
}
-
+
return true;
}
-
- private void makeContextCurrent(GLContext context) {
- int MAX_CONTEXT_GRAB_ATTEMPTS = 10;
-
+
+ private void makeContextCurrent(final GLContext context) {
+ final int MAX_CONTEXT_GRAB_ATTEMPTS = 10;
+
if (context.isCurrent()) {
notCurrent = false;
} else {
@@ -219,18 +219,18 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
} catch (final InterruptedException e) {
e.printStackTrace();
}
-
+
} while (value == GLContext.CONTEXT_NOT_CURRENT);
- }
+ }
}
-
- private void swapBuffers(GLContext context) {
+
+ private void swapBuffers(final GLContext context) {
final GL gl = context.getGL();
gl.glFlush();
- context.getGLDrawable().swapBuffers();
+ context.getGLDrawable().swapBuffers();
}
-
- private void releaseCurrentContext(GLContext context) {
+
+ private void releaseCurrentContext(final GLContext context) {
if (notCurrent) {
try {
context.release();
@@ -238,31 +238,31 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
} catch (final GLException gle) {
gle.printStackTrace();
}
- }
+ }
}
}
-
+
private void initGL() {
- GLProfile profile = GLProfile.getDefault();
- GLCapabilities caps = new GLCapabilities(profile);
+ final GLProfile profile = GLProfile.getDefault();
+ final GLCapabilities caps = new GLCapabilities(profile);
caps.setBackgroundOpaque(true);
caps.setOnscreen(true);
caps.setSampleBuffers(false);
-
+
if (TOOLKIT == AWT) {
awtCanvas = new GLCanvas(caps);
awtCanvas.setBounds(0, 0, applet.width, applet.height);
awtCanvas.setBackground(new Color(0xFFCCCCCC, true));
- awtCanvas.setFocusable(true);
-
+ awtCanvas.setFocusable(true);
+
applet.setLayout(new BorderLayout());
applet.add(awtCanvas, BorderLayout.CENTER);
-
+
if (MANUAL_FRAME_HANDLING) {
awtCanvas.setIgnoreRepaint(true);
- awtCanvas.setAutoSwapBufferMode(false);
+ awtCanvas.setAutoSwapBufferMode(false);
}
- } else if (TOOLKIT == NEWT) {
+ } else if (TOOLKIT == NEWT) {
newtWindow = GLWindow.create(caps);
newtCanvas = new NewtCanvasAWT(newtWindow);
newtCanvas.setBounds(0, 0, applet.width, applet.height);
@@ -271,14 +271,14 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
applet.setLayout(new BorderLayout());
applet.add(newtCanvas, BorderLayout.CENTER);
-
+
if (MANUAL_FRAME_HANDLING) {
newtCanvas.setIgnoreRepaint(true);
- newtWindow.setAutoSwapBufferMode(false);
+ newtWindow.setAutoSwapBufferMode(false);
}
}
}
-
+
private void initDraw() {
if (TOOLKIT == AWT) {
awtCanvas.setVisible(true);
@@ -287,7 +287,7 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
if (awtCanvas.getDelegatedDrawable().isRealized()) {
// Request the focus here as it cannot work when the window is not visible
awtCanvas.requestFocus();
- }
+ }
} else if (TOOLKIT == NEWT) {
newtCanvas.setVisible(true);
// Force the realization
@@ -297,37 +297,37 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
newtCanvas.requestFocus();
}
}
-
+
drawRunnable = new DrawRunnable();
-
+
doneInit = true;
}
-
- private void setup(GL2ES2 gl) {
+
+ private void setup(final GL2ES2 gl) {
if (60 < TARGET_FPS) {
// Disables vsync
- gl.setSwapInterval(0);
- }
+ gl.setSwapInterval(0);
+ }
glu = new GLU();
-
+
vertShader = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, LandscapeES2.class, "shader", "shader/bin", "landscape", true);
fragShader = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, LandscapeES2.class, "shader", "shader/bin", "landscape", true);
vertShader.defaultShaderCustomization(gl, true, true);
fragShader.defaultShaderCustomization(gl, true, true);
shaderProg = new ShaderProgram();
shaderProg.add(gl, vertShader, System.err);
- shaderProg.add(gl, fragShader, System.err);
-
+ shaderProg.add(gl, fragShader, System.err);
+
shaderState = new ShaderState();
shaderState.attachShaderProgram(gl, shaderProg, true);
-
+
resolution = new GLUniformData("iResolution", 3, FloatBuffer.wrap(new float[] {width, height, 0}));
shaderState.ownUniform(resolution);
- shaderState.uniform(gl, resolution);
-
+ shaderState.uniform(gl, resolution);
+
time = new GLUniformData("iGlobalTime", 0.0f);
shaderState.ownUniform(time);
-
+
vertices = GLArrayDataServer.createGLSL("inVertex", 2, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
vertices.putf(-1.0f); vertices.putf(-1.0f);
vertices.putf(+1.0f); vertices.putf(-1.0f);
@@ -336,94 +336,94 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
vertices.seal(gl, true);
shaderState.ownAttribute(vertices, true);
shaderState.useProgram(gl, false);
-
+
doneSetup = true;
}
- private void draw(GL2ES2 gl) {
+ private void draw(final GL2ES2 gl) {
// gl.glClearColor(0.5f, 0.1f, 0.1f, 1);
// gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT);
-
- shaderState.useProgram(gl, true);
-
+
+ shaderState.useProgram(gl, true);
+
time.setData((System.currentTimeMillis() - millisOffset) / 1000.0f);
shaderState.uniform(gl, time);
vertices.enableBuffer(gl, true);
- gl.glDrawArrays(GL2ES2.GL_TRIANGLE_STRIP, 0, 4);
+ gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
vertices.enableBuffer(gl, false);
-
+
shaderState.useProgram(gl, false);
-
+
// Compute current framerate and printout.
- frameCount++;
+ frameCount++;
fcount += 1;
- int m = (int) (System.currentTimeMillis() - millisOffset);
+ final int m = (int) (System.currentTimeMillis() - millisOffset);
if (m - lastm > 1000 * fint) {
frameRate = (float)(fcount) / fint;
fcount = 0;
lastm = m;
- }
+ }
if (frameCount % TARGET_FPS == 0) {
- System.out.println("FrameCount: " + frameCount + " - " +
+ System.out.println("FrameCount: " + frameCount + " - " +
"FrameRate: " + frameRate);
}
- }
-
- private void checkGLErrors(GL gl) {
- int err = gl.glGetError();
+ }
+
+ private void checkGLErrors(final GL gl) {
+ final int err = gl.glGetError();
if (err != 0) {
- String errString = glu.gluErrorString(err);
+ final String errString = glu.gluErrorString(err);
System.out.println(errString);
- }
+ }
}
-
- static public void main(String[] args) {
- GraphicsEnvironment environment =
+
+ static public void main(final String[] args) {
+ final GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
+ final GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
frame = new Frame(displayDevice.getDefaultConfiguration());
frame.setBackground(new Color(0xCC, 0xCC, 0xCC));
frame.setTitle("TestBug735Inv1AppletAWT");
-
+
try {
- Class<?> c = Thread.currentThread().getContextClassLoader().
+ final Class<?> c = Thread.currentThread().getContextClassLoader().
loadClass(Bug735Inv1AppletAWT.class.getName());
applet = (Bug735Inv1AppletAWT) c.newInstance();
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException(e);
- }
-
+ }
+
frame.setLayout(null);
frame.add(applet);
frame.pack();
frame.setResizable(false);
-
+
applet.init();
-
- Insets insets = frame.getInsets();
- int windowW = applet.width + insets.left + insets.right;
- int windowH = applet.height + insets.top + insets.bottom;
- frame.setSize(windowW, windowH);
-
- Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
+
+ final Insets insets = frame.getInsets();
+ final int windowW = applet.width + insets.left + insets.right;
+ final int windowH = applet.height + insets.top + insets.bottom;
+ frame.setSize(windowW, windowH);
+
+ final Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
frame.setLocation(screenRect.x + (screenRect.width - applet.width) / 2,
- screenRect.y + (screenRect.height - applet.height) / 2);
-
- int usableWindowH = windowH - insets.top - insets.bottom;
+ screenRect.y + (screenRect.height - applet.height) / 2);
+
+ final int usableWindowH = windowH - insets.top - insets.bottom;
applet.setBounds((windowW - applet.width)/2,
insets.top + (usableWindowH - applet.height)/2,
applet.width, applet.height);
-
+
// This allows to close the frame.
frame.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
System.exit(0);
}
});
-
+
applet.initGL();
frame.setVisible(true);
- applet.start();
+ applet.start();
}
}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv2AppletAWT.java b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv2AppletAWT.java
index 6340d2b64..109bb1a42 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv2AppletAWT.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv2AppletAWT.java
@@ -33,7 +33,7 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
* - Use GLEventListener
* - Add GLEventListener to GLAutoDrawable
* - Use GLAutoDrawable.display() instead of GLAutoDrawable.invoke(true, GLRunnable { init / render })
- * - Removed MANUAL_FRAME_HANDLING, obsolete due to GLAutoDrawable/GLEventListener
+ * - Removed MANUAL_FRAME_HANDLING, obsolete due to GLAutoDrawable/GLEventListener
* </pre>
* OSX Results:
* <pre>
@@ -45,7 +45,7 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
public class Bug735Inv2AppletAWT extends Applet implements Runnable {
static public int AWT = 0;
static public int NEWT = 1;
-
+
static public int APPLET_WIDTH = 500;
static public int APPLET_HEIGHT = 290;
static public int TARGET_FPS = 120;
@@ -53,10 +53,10 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
static public boolean IGNORE_AWT_REPAINT = false;
static public boolean USE_ECT = false;
static public int SWAP_INTERVAL = 1;
-
+
//////////////////////////////////////////////////////////////////////////////
-
- static boolean waitForKey = false;
+
+ static boolean waitForKey = false;
static private Frame frame;
static private Bug735Inv2AppletAWT applet;
private GLCanvas awtCanvas;
@@ -64,14 +64,14 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
private GLAutoDrawable glad;
private NewtCanvasAWT newtCanvas;
private GLEventListener demo;
-
+
private int width;
private int height;
private Thread thread;
-
- private long frameRatePeriod = 1000000000L / TARGET_FPS;
+
+ private final long frameRatePeriod = 1000000000L / TARGET_FPS;
private int frameCount;
-
+
public void init() {
setSize(APPLET_WIDTH, APPLET_HEIGHT);
setPreferredSize(new Dimension(APPLET_WIDTH, APPLET_HEIGHT));
@@ -79,23 +79,23 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
height = APPLET_HEIGHT;
initGL();
}
-
+
public void start() {
initDraw();
thread = new Thread(this, "Animation Thread");
- thread.start();
+ thread.start();
}
-
- public void run() {
+
+ public void run() {
int noDelays = 0;
// Number of frames with a delay of 0 ms before the
// animation thread yields to other running threads.
final int NO_DELAYS_PER_YIELD = 15;
final int TIMEOUT_SECONDS = 2;
-
+
long beforeTime = System.nanoTime();
long overSleepTime = 0L;
-
+
frameCount = 1;
while (Thread.currentThread() == thread) {
if (frameCount == 1) {
@@ -107,23 +107,23 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
if( USE_ECT ) {
glad.setExclusiveContextThread(thread);
}
- }
+ }
final CountDownLatch latch = new CountDownLatch(1);
requestDraw(latch);
try {
latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
-
- long afterTime = System.nanoTime();
- long timeDiff = afterTime - beforeTime;
- long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;
+
+ final long afterTime = System.nanoTime();
+ final long timeDiff = afterTime - beforeTime;
+ final long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;
if (sleepTime > 0) { // some time left in this cycle
try {
Thread.sleep(sleepTime / 1000000L, (int) (sleepTime % 1000000L));
noDelays = 0; // Got some sleep, not delaying anymore
- } catch (InterruptedException ex) { }
+ } catch (final InterruptedException ex) { }
overSleepTime = (System.nanoTime() - afterTime) - sleepTime;
} else { // sleepTime <= 0; the frame took longer than the period
overSleepTime = 0L;
@@ -132,40 +132,40 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
Thread.yield(); // give another thread a chance to run
noDelays = 0;
}
- }
+ }
beforeTime = System.nanoTime();
}
}
-
- public void requestDraw(CountDownLatch latch) {
+
+ public void requestDraw(final CountDownLatch latch) {
glad.display();
if (latch != null) {
latch.countDown();
- }
+ }
}
-
+
private void initGL() {
- GLProfile profile = GLProfile.getDefault();
- GLCapabilities caps = new GLCapabilities(profile);
+ final GLProfile profile = GLProfile.getDefault();
+ final GLCapabilities caps = new GLCapabilities(profile);
caps.setBackgroundOpaque(true);
caps.setOnscreen(true);
caps.setSampleBuffers(false);
-
+
if (TOOLKIT == AWT) {
awtCanvas = new GLCanvas(caps);
awtCanvas.setBounds(0, 0, applet.width, applet.height);
awtCanvas.setBackground(new Color(0xFFCCCCCC, true));
- awtCanvas.setFocusable(true);
-
+ awtCanvas.setFocusable(true);
+
applet.setLayout(new BorderLayout());
applet.add(awtCanvas, BorderLayout.CENTER);
-
+
if (IGNORE_AWT_REPAINT) {
awtCanvas.setIgnoreRepaint(true);
}
glad = awtCanvas;
- } else if (TOOLKIT == NEWT) {
+ } else if (TOOLKIT == NEWT) {
newtWindow = GLWindow.create(caps);
newtCanvas = new NewtCanvasAWT(newtWindow);
newtCanvas.setBounds(0, 0, applet.width, applet.height);
@@ -174,17 +174,17 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
applet.setLayout(new BorderLayout());
applet.add(newtCanvas, BorderLayout.CENTER);
-
+
if (IGNORE_AWT_REPAINT) {
newtCanvas.setIgnoreRepaint(true);
}
glad = newtWindow;
}
-
+
demo = new LandscapeES2(SWAP_INTERVAL);
glad.addGLEventListener(demo);
}
-
+
private void initDraw() {
if (TOOLKIT == AWT) {
awtCanvas.setVisible(true);
@@ -193,7 +193,7 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
if (awtCanvas.getDelegatedDrawable().isRealized()) {
// Request the focus here as it cannot work when the window is not visible
awtCanvas.requestFocus();
- }
+ }
} else if (TOOLKIT == NEWT) {
newtCanvas.setVisible(true);
// Force the realization
@@ -204,8 +204,8 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
}
}
}
-
- static public void main(String[] args) {
+
+ static public void main(final String[] args) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-vsync")) {
i++;
@@ -217,56 +217,56 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
}
}
System.err.println("swapInterval "+SWAP_INTERVAL);
- System.err.println("exclusiveContext "+USE_ECT);
+ System.err.println("exclusiveContext "+USE_ECT);
if(waitForKey) {
UITestCase.waitForKey("Start");
}
-
- GraphicsEnvironment environment =
+
+ final GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
+ final GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
frame = new Frame(displayDevice.getDefaultConfiguration());
frame.setBackground(new Color(0xCC, 0xCC, 0xCC));
frame.setTitle("TestBug735Inv2AppletAWT");
-
+
try {
- Class<?> c = Thread.currentThread().getContextClassLoader().
+ final Class<?> c = Thread.currentThread().getContextClassLoader().
loadClass(Bug735Inv2AppletAWT.class.getName());
applet = (Bug735Inv2AppletAWT) c.newInstance();
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException(e);
- }
-
+ }
+
frame.setLayout(null);
frame.add(applet);
frame.pack();
frame.setResizable(false);
-
+
applet.init();
-
- Insets insets = frame.getInsets();
- int windowW = applet.width + insets.left + insets.right;
- int windowH = applet.height + insets.top + insets.bottom;
- frame.setSize(windowW, windowH);
-
- Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
+
+ final Insets insets = frame.getInsets();
+ final int windowW = applet.width + insets.left + insets.right;
+ final int windowH = applet.height + insets.top + insets.bottom;
+ frame.setSize(windowW, windowH);
+
+ final Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
frame.setLocation(screenRect.x + (screenRect.width - applet.width) / 2,
- screenRect.y + (screenRect.height - applet.height) / 2);
-
- int usableWindowH = windowH - insets.top - insets.bottom;
+ screenRect.y + (screenRect.height - applet.height) / 2);
+
+ final int usableWindowH = windowH - insets.top - insets.bottom;
applet.setBounds((windowW - applet.width)/2,
insets.top + (usableWindowH - applet.height)/2,
applet.width, applet.height);
-
+
// This allows to close the frame.
frame.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
System.exit(0);
}
});
-
+
frame.setVisible(true);
- applet.start();
+ applet.start();
}
}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv3AppletAWT.java b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv3AppletAWT.java
index 0a4c54046..883a40345 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv3AppletAWT.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv3AppletAWT.java
@@ -32,7 +32,7 @@ import com.jogamp.opengl.util.AnimatorBase;
* - Use GLEventListener
* - Add GLEventListener to GLAutoDrawable
* - Use GLAutoDrawable.display() instead of GLAutoDrawable.invoke(true, GLRunnable { init / render })
- * - Removed MANUAL_FRAME_HANDLING, obsolete due to GLAutoDrawable/GLEventListener
+ * - Removed MANUAL_FRAME_HANDLING, obsolete due to GLAutoDrawable/GLEventListener
* - Use Animator
* - Remove applet, component sizes, use frame based size via validate
* - Run frame validation/visibility on AWT-EDT
@@ -48,17 +48,17 @@ import com.jogamp.opengl.util.AnimatorBase;
public class Bug735Inv3AppletAWT extends Applet {
static public int AWT = 0;
static public int NEWT = 1;
-
+
static public int APPLET_WIDTH = 500;
static public int APPLET_HEIGHT = 290;
static public int TOOLKIT = NEWT;
static public boolean IGNORE_AWT_REPAINT = false;
static public boolean USE_ECT = false;
static public int SWAP_INTERVAL = 1;
-
+
//////////////////////////////////////////////////////////////////////////////
-
- static boolean waitForKey = false;
+
+ static boolean waitForKey = false;
static private Frame frame;
static private Bug735Inv3AppletAWT applet;
private GLCanvas awtCanvas;
@@ -67,10 +67,10 @@ public class Bug735Inv3AppletAWT extends Applet {
private NewtCanvasAWT newtCanvas;
private GLEventListener demo;
private AnimatorBase animator;
-
+
private int width;
private int height;
-
+
public void init() {
setSize(APPLET_WIDTH, APPLET_HEIGHT);
// JAU setPreferredSize(new Dimension(APPLET_WIDTH, APPLET_HEIGHT));
@@ -78,34 +78,34 @@ public class Bug735Inv3AppletAWT extends Applet {
height = APPLET_HEIGHT;
initGL();
}
-
+
public void start() {
initDraw();
animator.start();
animator.setUpdateFPSFrames(60, System.err);
}
-
+
private void initGL() {
- GLProfile profile = GLProfile.getDefault();
- GLCapabilities caps = new GLCapabilities(profile);
+ final GLProfile profile = GLProfile.getDefault();
+ final GLCapabilities caps = new GLCapabilities(profile);
caps.setBackgroundOpaque(true);
caps.setOnscreen(true);
caps.setSampleBuffers(false);
-
+
if (TOOLKIT == AWT) {
awtCanvas = new GLCanvas(caps);
// JAU awtCanvas.setBounds(0, 0, applet.width, applet.height);
awtCanvas.setBackground(new Color(0xFFCCCCCC, true));
- awtCanvas.setFocusable(true);
-
+ awtCanvas.setFocusable(true);
+
applet.setLayout(new BorderLayout());
applet.add(awtCanvas, BorderLayout.CENTER);
-
+
if (IGNORE_AWT_REPAINT) {
awtCanvas.setIgnoreRepaint(true);
}
glad = awtCanvas;
- } else if (TOOLKIT == NEWT) {
+ } else if (TOOLKIT == NEWT) {
newtWindow = GLWindow.create(caps);
newtCanvas = new NewtCanvasAWT(newtWindow);
// JAU newtCanvas.setBounds(0, 0, applet.width, applet.height);
@@ -114,27 +114,27 @@ public class Bug735Inv3AppletAWT extends Applet {
applet.setLayout(new BorderLayout());
applet.add(newtCanvas, BorderLayout.CENTER);
-
+
if (IGNORE_AWT_REPAINT) {
newtCanvas.setIgnoreRepaint(true);
}
glad = newtWindow;
}
-
+
demo = new LandscapeES2(SWAP_INTERVAL);
// demo = new GearsES2(SWAP_INTERVAL);
glad.addGLEventListener(demo);
animator = new Animator(glad);
animator.setExclusiveContext(USE_ECT);
}
-
+
private void initDraw() {
if (TOOLKIT == AWT) {
// JAU awtCanvas.setVisible(true);
if (awtCanvas.getDelegatedDrawable().isRealized()) {
// Request the focus here as it cannot work when the window is not visible
awtCanvas.requestFocus();
- }
+ }
} else if (TOOLKIT == NEWT) {
// JAU newtCanvas.setVisible(true);
// Force the realization
@@ -143,10 +143,10 @@ public class Bug735Inv3AppletAWT extends Applet {
// Request the focus here as it cannot work when the window is not visible
newtCanvas.requestFocus();
}
- }
+ }
}
-
- static public void main(String[] args) {
+
+ static public void main(final String[] args) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-vsync")) {
i++;
@@ -158,61 +158,61 @@ public class Bug735Inv3AppletAWT extends Applet {
}
}
System.err.println("swapInterval "+SWAP_INTERVAL);
- System.err.println("exclusiveContext "+USE_ECT);
+ System.err.println("exclusiveContext "+USE_ECT);
if(waitForKey) {
UITestCase.waitForKey("Start");
}
-
- final GraphicsEnvironment environment =
+
+ final GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
final GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
frame = new Frame(displayDevice.getDefaultConfiguration());
frame.setBackground(new Color(0xCC, 0xCC, 0xCC));
frame.setTitle("TestBug735Inv3AppletAWT");
-
+
// This allows to close the frame.
frame.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
System.exit(0);
}
});
-
+
try {
- Class<?> c = Thread.currentThread().getContextClassLoader().
+ final Class<?> c = Thread.currentThread().getContextClassLoader().
loadClass(Bug735Inv3AppletAWT.class.getName());
applet = (Bug735Inv3AppletAWT) c.newInstance();
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException(e);
- }
-
+ }
+
// JAU frame.setLayout(null);
frame.add(applet);
-
+
applet.init();
-
- Insets insets = frame.getInsets();
+
+ final Insets insets = frame.getInsets();
final int windowW = applet.width + insets.left + insets.right;
final int windowH = applet.height + insets.top + insets.bottom;
-
+
try {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setSize(windowW, windowH);
frame.validate();
// JAU frame.pack();
- Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
+ final Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
frame.setLocation(screenRect.x + (screenRect.width - applet.width) / 2,
- screenRect.y + (screenRect.height - applet.height) / 2);
-
+ screenRect.y + (screenRect.height - applet.height) / 2);
+
frame.setResizable(false);
- frame.setVisible(true);
+ frame.setVisible(true);
}
});
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
- }
-
- applet.start();
+ }
+
+ applet.start();
}
}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv4AWT.java b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv4AWT.java
index f0be22b65..c9df683b1 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv4AWT.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv4AWT.java
@@ -30,7 +30,7 @@ import com.jogamp.opengl.util.AnimatorBase;
* - Use GLEventListener
* - Add GLEventListener to GLAutoDrawable
* - Use GLAutoDrawable.display() instead of GLAutoDrawable.invoke(true, GLRunnable { init / render })
- * - Removed MANUAL_FRAME_HANDLING, obsolete due to GLAutoDrawable/GLEventListener
+ * - Removed MANUAL_FRAME_HANDLING, obsolete due to GLAutoDrawable/GLEventListener
* - Use Animator
* - Remove component sizes, use frame based size via validate
* - Run frame validation/visibility on AWT-EDT
@@ -46,17 +46,17 @@ import com.jogamp.opengl.util.AnimatorBase;
public class Bug735Inv4AWT {
static public int AWT = 0;
static public int NEWT = 1;
-
+
static public int APPLET_WIDTH = 500;
static public int APPLET_HEIGHT = 290;
static public int TOOLKIT = NEWT;
static public boolean IGNORE_AWT_REPAINT = false;
static public boolean USE_ECT = false;
static public int SWAP_INTERVAL = 1;
-
+
//////////////////////////////////////////////////////////////////////////////
-
- static boolean waitForKey = false;
+
+ static boolean waitForKey = false;
static private Frame frame;
static private Bug735Inv4AWT applet;
private GLCanvas awtCanvas;
@@ -65,39 +65,39 @@ public class Bug735Inv4AWT {
private NewtCanvasAWT newtCanvas;
private GLEventListener demo;
private AnimatorBase animator;
-
+
private int width;
private int height;
-
+
public void init() {
width = APPLET_WIDTH;
height = APPLET_HEIGHT;
initGL();
}
-
+
public void start() {
initDraw();
animator.start();
animator.setUpdateFPSFrames(60, System.err);
}
-
+
private void initGL() {
- GLProfile profile = GLProfile.getDefault();
- GLCapabilities caps = new GLCapabilities(profile);
+ final GLProfile profile = GLProfile.getDefault();
+ final GLCapabilities caps = new GLCapabilities(profile);
caps.setBackgroundOpaque(true);
caps.setOnscreen(true);
caps.setSampleBuffers(false);
-
+
if (TOOLKIT == AWT) {
awtCanvas = new GLCanvas(caps);
awtCanvas.setBackground(new Color(0xFFCCCCCC, true));
- awtCanvas.setFocusable(true);
-
+ awtCanvas.setFocusable(true);
+
if (IGNORE_AWT_REPAINT) {
awtCanvas.setIgnoreRepaint(true);
}
glad = awtCanvas;
- } else if (TOOLKIT == NEWT) {
+ } else if (TOOLKIT == NEWT) {
newtWindow = GLWindow.create(caps);
newtCanvas = new NewtCanvasAWT(newtWindow);
newtCanvas.setBackground(new Color(0xFFCCCCCC, true));
@@ -108,20 +108,20 @@ public class Bug735Inv4AWT {
}
glad = newtWindow;
}
-
+
demo = new LandscapeES2(SWAP_INTERVAL);
// demo = new GearsES2(SWAP_INTERVAL);
glad.addGLEventListener(demo);
animator = new Animator(glad);
animator.setExclusiveContext(USE_ECT);
}
-
+
private void initDraw() {
if (TOOLKIT == AWT) {
if (awtCanvas.getDelegatedDrawable().isRealized()) {
// Request the focus here as it cannot work when the window is not visible
awtCanvas.requestFocus();
- }
+ }
} else if (TOOLKIT == NEWT) {
// newtCanvas.repaint();
// Force the realization
@@ -130,10 +130,10 @@ public class Bug735Inv4AWT {
// Request the focus here as it cannot work when the window is not visible
newtCanvas.requestFocus();
}
- }
+ }
}
-
- static public void main(String[] args) {
+
+ static public void main(final String[] args) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-vsync")) {
i++;
@@ -145,29 +145,29 @@ public class Bug735Inv4AWT {
}
}
System.err.println("swapInterval "+SWAP_INTERVAL);
- System.err.println("exclusiveContext "+USE_ECT);
+ System.err.println("exclusiveContext "+USE_ECT);
if(waitForKey) {
UITestCase.waitForKey("Start");
}
-
- final GraphicsEnvironment environment =
+
+ final GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
final GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
frame = new Frame(displayDevice.getDefaultConfiguration());
// JAU frame.setBackground(new Color(0xCC, 0xCC, 0xCC));
frame.setTitle("TestBug735Inv4AWT");
-
+
// This allows to close the frame.
frame.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
System.exit(0);
}
});
-
+
applet = new Bug735Inv4AWT();
applet.init();
-
+
if (TOOLKIT == AWT) {
frame.add(applet.awtCanvas);
} else if (TOOLKIT == NEWT) {
@@ -175,28 +175,28 @@ public class Bug735Inv4AWT {
}
// frame.pack();
// frame.setResizable(false);
-
- Insets insets = frame.getInsets();
+
+ final Insets insets = frame.getInsets();
final int windowW = applet.width + insets.left + insets.right;
final int windowH = applet.height + insets.top + insets.bottom;
-
+
try {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setSize(windowW, windowH);
frame.validate();
// frame.pack();
- Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
+ final Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
frame.setLocation(screenRect.x + (screenRect.width - applet.width) / 2,
- screenRect.y + (screenRect.height - applet.height) / 2);
-
- frame.setVisible(true);
+ screenRect.y + (screenRect.height - applet.height) / 2);
+
+ frame.setVisible(true);
}
});
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
- }
-
- applet.start();
+ }
+
+ applet.start();
}
}
diff --git a/src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java b/src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java
index 1d7f6e78c..20573aa4b 100644
--- a/src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java
+++ b/src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java
@@ -41,7 +41,7 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
private static String currentThreadName() { return "["+Thread.currentThread().getName()+", isAWT-EDT "+EventQueue.isDispatchThread()+"]"; }
- private static void invoke(boolean wait, Runnable r) {
+ private static void invoke(final boolean wait, final Runnable r) {
if(EventQueue.isDispatchThread()) {
r.run();
} else {
@@ -51,24 +51,24 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
} else {
EventQueue.invokeLater(r);
}
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw new RuntimeException(e.getTargetException());
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
throw new RuntimeException(e);
}
}
}
- private static final String comp2Str(Component c) {
+ private static final String comp2Str(final Component c) {
return c.getClass().getSimpleName()+"[visible "+c.isVisible()+", showing "+c.isShowing()+", valid "+c.isValid()+
", displayable "+c.isDisplayable()+", "+c.getX()+"/"+c.getY()+" "+c.getWidth()+"x"+c.getHeight()+"]";
}
- private void println(String msg) {
+ private void println(final String msg) {
System.err.println(msg);
}
- private final void checkComponentState(String msg, boolean expIsContained, int expAddNotifyCount, int expRemoveNotifyCount) {
+ private final void checkComponentState(final String msg, final boolean expIsContained, final int expAddNotifyCount, final int expRemoveNotifyCount) {
final int compCount = getComponentCount();
final Component c = 1 <= compCount ? getComponent(0) : null;
final String clazzName = null != c ? c.getName() : "n/a";
@@ -88,8 +88,8 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
volatile int stopCount = 0;
volatile int destroyCount = 0;
- private final void checkAppletState(String msg, boolean expIsActive,
- int expInitCount, int expStartCount, int expStopCount, boolean startStopCountEquals, int expDestroyCount) {
+ private final void checkAppletState(final String msg, final boolean expIsActive,
+ final int expInitCount, final int expStartCount, final int expStopCount, final boolean startStopCountEquals, final int expDestroyCount) {
final boolean isActive = this.isActive();
final String okS = ( expInitCount == initCount &&
expIsActive == isActive &&
@@ -144,7 +144,7 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
}
@Override
- public void paint(Graphics g) {
+ public void paint(final Graphics g) {
super.paint(g);
paintCount++;
final int width = getWidth();
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue326Test1.java b/src/test/com/jogamp/opengl/test/bugs/Issue326Test1.java
index 833f34153..802bd65d5 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue326Test1.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue326Test1.java
@@ -9,16 +9,18 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Random;
+import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import javax.media.opengl.glu.GLU;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.awt.TextRenderer;
-/**
+/**
* Demonstrates corruption with older versions of TextRenderer. Two
* problems: errors when punting from glyph-based renderer to
* string-by-string renderer, and failure of glyph-based renderer when
@@ -31,64 +33,64 @@ public class Issue326Test1 extends Frame implements GLEventListener {
int width, height;
- public static void main(String[] args) {
- new Issue326Test1();
+ public static void main(final String[] args) {
+ new Issue326Test1();
}
-
+
GLCanvas canvas;
TextRenderer tr ;
-
+
public Issue326Test1() {
super("TextTest");
this.setSize(800, 800);
canvas = new GLCanvas();
canvas.addGLEventListener(this);
add(canvas);
-
+
setVisible(true);
addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
System.exit(0);
}
});
}
- public void display(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
gl.glClearColor(0, 0, 0, 0);
- gl.glClear(GL2.GL_COLOR_BUFFER_BIT|GL2.GL_DEPTH_BUFFER_BIT);
-
-
- gl.glMatrixMode(GL2.GL_PROJECTION);
- gl.glLoadIdentity();
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT);
+
+
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+ gl.glLoadIdentity();
//new GLU().gluPerspective(45f, (float)width/(float)height, 0.1f, 1000f);
gl.glOrtho(0.0, 800, 0.0, 800, -100.0, 100.0);
- gl.glMatrixMode(GL2.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
-
+
tr.beginRendering(800,800);
tr.draw( "die Marktwirtschaft. Da regelt sich � angeblich", 16, 32);
tr.draw( "Hello World! This text is scrambled", 16, 16);
tr.endRendering();
-
+
}
- public void init(GLAutoDrawable arg0) {
+ public void init(final GLAutoDrawable arg0) {
tr = new TextRenderer(new java.awt.Font("Verdana", java.awt.Font.PLAIN, 12), true, false, null, false);
tr.setColor(1, 1, 1 ,1);
}
- public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) {
+ public void reshape(final GLAutoDrawable arg0, final int arg1, final int arg2, final int arg3, final int arg4) {
width = arg3;
height = arg4;
- GL2 gl = arg0.getGL().getGL2();
+ final GL2 gl = arg0.getGL().getGL2();
gl.glViewport(0, 0, width, height);
- gl.glMatrixMode(GL2.GL_PROJECTION);
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(0.0, 800, 0.0, 200, -100.0, 100.0);
- gl.glMatrixMode(GL2.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
}
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java b/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java
index 2a8fd3a39..032eaa23c 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java
@@ -3,10 +3,13 @@ package com.jogamp.opengl.test.bugs;
import java.awt.Font;
import java.awt.Frame;
import java.awt.event.*;
+
+import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.opengl.util.awt.*;
@@ -20,54 +23,54 @@ public class Issue326Test2 extends Frame implements GLEventListener {
int width, height;
- public static void main(String[] args) {
- new Issue326Test2();
+ public static void main(final String[] args) {
+ new Issue326Test2();
}
-
+
GLCanvas canvas;
TextRenderer tr;
-
+
public Issue326Test2() {
super("");
this.setSize(800, 800);
canvas = new GLCanvas();
canvas.addGLEventListener(this);
add(canvas);
-
+
setVisible(true);
addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
System.exit(0);
}
});
}
- public void display(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
gl.glClearColor(0, 0, 0, 0);
- gl.glClear(GL2.GL_COLOR_BUFFER_BIT|GL2.GL_DEPTH_BUFFER_BIT);
-
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT);
+
tr.beginRendering(drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
tr.draw("LA CLAPI\u00c8RE \nAlt: 1100-1700m \nGlissement de terrain majeur", 16, 80);
tr.draw("dans la haute Tin\u00e9e, sur un flanc du Parc du Mercantour.", 16, 16);
tr.endRendering();
-
+
}
- public void init(GLAutoDrawable arg0) {
+ public void init(final GLAutoDrawable arg0) {
tr = new TextRenderer(Font.decode("Arial-BOLD-64"));
tr.setColor(1, 1, 1 ,1);
}
- public void reshape(GLAutoDrawable arg0, int x, int y, int w, int h) {
- GL2 gl = arg0.getGL().getGL2();
- gl.glMatrixMode(GL2.GL_PROJECTION);
+ public void reshape(final GLAutoDrawable arg0, final int x, final int y, final int w, final int h) {
+ final GL2 gl = arg0.getGL().getGL2();
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(0.0, w, 0.0, h, -1, 1);
- gl.glMatrixMode(GL2.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
}
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java
index 2a7afabff..7692a30b7 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java
@@ -6,11 +6,14 @@ import java.awt.Frame;
import java.awt.event.*;
import java.awt.geom.*;
+import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import javax.media.opengl.glu.*;
+
import com.jogamp.opengl.util.awt.TextRenderer;
/** Test Code adapted from TextCube.java (in JOGL demos)
@@ -35,17 +38,17 @@ public abstract class Issue344Base implements GLEventListener
protected abstract String getText();
- protected void run(String[] args) {
+ protected void run(final String[] args) {
final Frame frame = new Frame(getClass().getName());
frame.setLayout(new BorderLayout());
- GLCanvas canvas = new GLCanvas();
+ final GLCanvas canvas = new GLCanvas();
canvas.addGLEventListener(this);
frame.add(canvas, BorderLayout.CENTER);
frame.setSize(512, 512);
frame.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
new Thread(new Runnable() {
public void run() {
System.exit(0);
@@ -58,57 +61,57 @@ public abstract class Issue344Base implements GLEventListener
public void run() {
frame.setVisible(true);
} } );
- } catch(Exception ex) {
+ } catch(final Exception ex) {
throw new RuntimeException(ex);
}
}
- public void init(GLAutoDrawable drawable)
+ public void init(final GLAutoDrawable drawable)
{
- GL2 gl = drawable.getGL().getGL2();
+ final GL2 gl = drawable.getGL().getGL2();
- gl.glEnable(GL2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
renderer = new TextRenderer(font, useMipMaps);
- Rectangle2D bounds = renderer.getBounds(getText());
- float w = (float) bounds.getWidth();
- float h = (float) bounds.getHeight();
+ final Rectangle2D bounds = renderer.getBounds(getText());
+ final float w = (float) bounds.getWidth();
+ final float h = (float) bounds.getHeight();
textScaleFactor = 2.0f / (w * 1.1f);
gl.setSwapInterval(0);
}
- public void display(GLAutoDrawable drawable)
+ public void display(final GLAutoDrawable drawable)
{
- GL2 gl = drawable.getGL().getGL2();
- gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
+ final GL2 gl = drawable.getGL().getGL2();
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
- gl.glMatrixMode(GL2.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
glu.gluLookAt(0, 0, 10,
0, 0, 0,
0, 1, 0);
renderer.begin3DRendering();
- Rectangle2D bounds = renderer.getBounds(getText());
- float w = (float) bounds.getWidth();
- float h = (float) bounds.getHeight();
+ final Rectangle2D bounds = renderer.getBounds(getText());
+ final float w = (float) bounds.getWidth();
+ final float h = (float) bounds.getHeight();
renderer.draw3D(getText(),
w / -2.0f * textScaleFactor,
h / -2.0f * textScaleFactor,
3f,
textScaleFactor);
-
+
renderer.end3DRendering();
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height)
{
- GL2 gl = drawable.getGL().getGL2();
- gl.glMatrixMode(GL2.GL_PROJECTION);
+ final GL2 gl = drawable.getGL().getGL2();
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
glu.gluPerspective(15, (float) width / (float) height, 5, 15);
}
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Test1.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Test1.java
index f0da7cbf8..384b6e993 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue344Test1.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Test1.java
@@ -2,11 +2,11 @@ package com.jogamp.opengl.test.bugs;
public class Issue344Test1 extends Issue344Base {
protected String getText() {
- // test 1 - weird artifacts appear with a large font & long string
+ // test 1 - weird artifacts appear with a large font & long string
return "abcdefghijklmnopqrstuvwxyz1234567890";
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
new Issue344Test1().run(args);
}
}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Test2.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Test2.java
index bb1acf2de..9941b3f5b 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue344Test2.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Test2.java
@@ -6,7 +6,7 @@ public class Issue344Test2 extends Issue344Base {
return "\u201Cabcdefghijklmnopqrstuvwxyz\u201D";
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
new Issue344Test2().run(args);
}
}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Test3.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Test3.java
index bb73d84ec..7ae4245c6 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue344Test3.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Test3.java
@@ -6,7 +6,7 @@ public class Issue344Test3 extends Issue344Base {
return "abcde";
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
new Issue344Test3().run(args);
}
}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Test4.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Test4.java
index de4c37a40..87a5b644e 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue344Test4.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Test4.java
@@ -6,7 +6,7 @@ public class Issue344Test4 extends Issue344Base {
return "\u201CGreetings\u201D!";
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
new Issue344Test4().run(args);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java b/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java
index fd1486995..23b39926d 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java
@@ -36,6 +36,8 @@ import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLException;
import javax.media.opengl.GLProfile;
+import jogamp.common.os.PlatformPropsImpl;
+
import org.junit.Assert;
import org.junit.Test;
import org.junit.FixMethodOrder;
@@ -55,21 +57,21 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestRegionRendererNEWT01 extends UITestCase {
- public static void main(String args[]) throws IOException {
- String tstname = TestRegionRendererNEWT01.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestRegionRendererNEWT01.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
- static void destroyWindow(GLWindow window) {
+ static void destroyWindow(final GLWindow window) {
if(null!=window) {
window.destroy();
}
}
- static GLWindow createWindow(String title, GLCapabilitiesImmutable caps, int width, int height) {
+ static GLWindow createWindow(final String title, final GLCapabilitiesImmutable caps, final int width, final int height) {
Assert.assertNotNull(caps);
- GLWindow window = GLWindow.create(caps);
+ final GLWindow window = GLWindow.create(caps);
window.setSize(width, height);
window.setPosition(10, 10);
window.setTitle(title);
@@ -81,19 +83,19 @@ public class TestRegionRendererNEWT01 extends UITestCase {
// @Test
public void test00RegionRendererNONE01() throws InterruptedException {
- GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+ final GLCapabilities caps = new GLCapabilities(glp);
// caps.setOnscreen(false);
caps.setAlphaBits(4);
- GLWindow window = createWindow("shape-vbaa0-msaa0", caps, 800, 400);
- RenderState rs = RenderState.createRenderState(SVertex.factory());
+ final GLWindow window = createWindow("shape-vbaa0-msaa0", caps, 800, 400);
+ final RenderState rs = RenderState.createRenderState(SVertex.factory());
- GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, 0, 0, false, false);
+ final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, 0, 0, false, false);
demo01Listener.attachInputListenerTo(window);
window.addGLEventListener(demo01Listener);
- RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion01");
+ final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion01");
window.addGLEventListener(listener);
listener.setTech(-20, 0, -300, 0f, 2);
@@ -110,24 +112,24 @@ public class TestRegionRendererNEWT01 extends UITestCase {
// @Test
public void test01RegionRendererNONE02() throws InterruptedException {
- if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME
+ if(Platform.CPUFamily.X86 != PlatformPropsImpl.CPU_ARCH.family) { // FIXME
// FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise).
// FIXME: Also the GLSL code for VARIABLE_CURVE is not fit for mobile yet!
System.err.println("disabled on non desktop (x86) arch for now ..");
return;
}
- GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(4);
- GLWindow window = createWindow("shape-vbaa0-msaa0", caps, 800, 400);
- RenderState rs = RenderState.createRenderState(SVertex.factory());
+ final GLWindow window = createWindow("shape-vbaa0-msaa0", caps, 800, 400);
+ final RenderState rs = RenderState.createRenderState(SVertex.factory());
- GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, Region.VARWEIGHT_RENDERING_BIT, 0, false, false);
+ final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, Region.VARWEIGHT_RENDERING_BIT, 0, false, false);
demo01Listener.attachInputListenerTo(window);
window.addGLEventListener(demo01Listener);
- RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion02");
+ final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion02");
window.addGLEventListener(listener);
listener.setTech(-20, 0, -300, 0f, 2);
@@ -144,21 +146,21 @@ public class TestRegionRendererNEWT01 extends UITestCase {
@Test
public void test10RegionRendererMSAA01() throws InterruptedException {
- GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+ final GLCapabilities caps = new GLCapabilities(glp);
// caps.setOnscreen(false);
caps.setAlphaBits(4);
caps.setSampleBuffers(true);
caps.setNumSamples(4);
- GLWindow window = createWindow("shape-vbaa0-msaa1", caps, 800, 400);
- RenderState rs = RenderState.createRenderState(SVertex.factory());
+ final GLWindow window = createWindow("shape-vbaa0-msaa1", caps, 800, 400);
+ final RenderState rs = RenderState.createRenderState(SVertex.factory());
- GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, 0, 0, false, false);
+ final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, 0, 0, false, false);
demo01Listener.attachInputListenerTo(window);
window.addGLEventListener(demo01Listener);
- RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion01");
+ final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion01");
window.addGLEventListener(listener);
listener.setTech(-20, 00, -300, 0f, 2);
@@ -175,26 +177,26 @@ public class TestRegionRendererNEWT01 extends UITestCase {
// @Test
public void test11RegionRendererMSAA02() throws InterruptedException {
- if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME
+ if(Platform.CPUFamily.X86 != PlatformPropsImpl.CPU_ARCH.family) { // FIXME
// FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise).
// FIXME: Also the GLSL code for VARIABLE_CURVE is not fit for mobile yet!
System.err.println("disabled on non desktop (x86) arch for now ..");
return;
}
- GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(4);
caps.setSampleBuffers(true);
caps.setNumSamples(4);
- GLWindow window = createWindow("shape-vbaa0-msaa1", caps, 800, 400);
- RenderState rs = RenderState.createRenderState(SVertex.factory());
+ final GLWindow window = createWindow("shape-vbaa0-msaa1", caps, 800, 400);
+ final RenderState rs = RenderState.createRenderState(SVertex.factory());
- GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, Region.VARWEIGHT_RENDERING_BIT, 0, false, false);
+ final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, Region.VARWEIGHT_RENDERING_BIT, 0, false, false);
demo01Listener.attachInputListenerTo(window);
window.addGLEventListener(demo01Listener);
- RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion02");
+ final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion02");
window.addGLEventListener(listener);
listener.setTech(-20, 00, -300, 0f, 2);
@@ -211,24 +213,24 @@ public class TestRegionRendererNEWT01 extends UITestCase {
@Test
public void test20RegionRendererR2T01() throws InterruptedException {
- if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME
+ if(Platform.CPUFamily.X86 != PlatformPropsImpl.CPU_ARCH.family) { // FIXME
// FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise).
System.err.println("disabled on non desktop (x86) arch for now ..");
return;
}
- GLProfile glp = GLProfile.getGL2ES2();
+ final GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
//caps.setOnscreen(false);
caps.setAlphaBits(4);
- GLWindow window = createWindow("shape-vbaa1-msaa0", caps, 800,400);
- RenderState rs = RenderState.createRenderState(SVertex.factory());
- GPURegionGLListener02 demo02Listener = new GPURegionGLListener02 (rs, Region.VBAA_RENDERING_BIT, 4, false, false);
+ final GLWindow window = createWindow("shape-vbaa1-msaa0", caps, 800,400);
+ final RenderState rs = RenderState.createRenderState(SVertex.factory());
+ final GPURegionGLListener02 demo02Listener = new GPURegionGLListener02 (rs, Region.VBAA_RENDERING_BIT, 4, false, false);
demo02Listener.attachInputListenerTo(window);
window.addGLEventListener(demo02Listener);
- RegionGLListener listener = new RegionGLListener(demo02Listener, window.getTitle(), "GPURegionNewtDemo02");
+ final RegionGLListener listener = new RegionGLListener(demo02Listener, window.getTitle(), "GPURegionNewtDemo02");
window.addGLEventListener(listener);
listener.setTech(-20, 00, -300, 0f, 2);
@@ -248,38 +250,38 @@ public class TestRegionRendererNEWT01 extends UITestCase {
String name;
GPURendererListenerBase01 impl;
- public RegionGLListener(GPURendererListenerBase01 impl, String title, String name) {
+ public RegionGLListener(final GPURendererListenerBase01 impl, final String title, final String name) {
this.impl = impl;
this.winTitle = title;
this.name = name;
}
- public void setTech(float xt, float yt, int zt, float angle, int sampleCount){
+ public void setTech(final float xt, final float yt, final int zt, final float angle, final int sampleCount){
impl.setMatrix(xt, yt, zt, angle, sampleCount);
}
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
impl.init(drawable);
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
impl.display(drawable);
try {
impl.printScreen(drawable, "./", winTitle, name, false);
- } catch (GLException e) {
+ } catch (final GLException e) {
e.printStackTrace();
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
impl.dispose(drawable);
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
impl.reshape(drawable, x, y, width, height);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java
index 2e0be5b79..cc9762fe8 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java
@@ -80,13 +80,13 @@ public class TestTextRendererNEWT00 extends UITestCase {
static int fontStylebits = 0;
static float fontSizeFixed = 14f;
- static int atoi(String a) {
+ static int atoi(final String a) {
try {
return Integer.parseInt(a);
- } catch (Exception ex) { throw new RuntimeException(ex); }
+ } catch (final Exception ex) { throw new RuntimeException(ex); }
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
ManualTest = args.length > 0;
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
@@ -130,7 +130,7 @@ public class TestTextRendererNEWT00 extends UITestCase {
System.err.println("Graph MSAA Samples "+GraphMSAASamples);
System.err.println("Graph VBAA Samples "+GraphVBAASamples);
System.err.println("swapInterval "+SwapInterval);
- String tstname = TestTextRendererNEWT00.class.getName();
+ final String tstname = TestTextRendererNEWT00.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
@@ -141,19 +141,19 @@ public class TestTextRendererNEWT00 extends UITestCase {
try {
System.err.println("** new frame ** (sleep: "+d+"ms)");
Thread.sleep(d);
- } catch (InterruptedException ie) {}
+ } catch (final InterruptedException ie) {}
}
- static void destroyWindow(GLWindow window) {
+ static void destroyWindow(final GLWindow window) {
if(null!=window) {
window.destroy();
}
}
- static GLWindow createWindow(String title, GLCapabilitiesImmutable caps, int width, int height) {
+ static GLWindow createWindow(final String title, final GLCapabilitiesImmutable caps, final int width, final int height) {
Assert.assertNotNull(caps);
- GLWindow window = GLWindow.create(caps);
+ final GLWindow window = GLWindow.create(caps);
window.setSize(width, height);
window.setPosition(10, 10);
window.setTitle(title);
@@ -195,8 +195,8 @@ public class TestTextRendererNEWT00 extends UITestCase {
}
public void testImpl(final int sceneMSAASamples, final int graphMSAASamples, final int graphVBAASamples) throws InterruptedException {
- GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(4);
if( 0 < sceneMSAASamples ) {
caps.setSampleBuffers(true);
@@ -204,7 +204,7 @@ public class TestTextRendererNEWT00 extends UITestCase {
}
System.err.println("Requested: "+caps+", graph[msaaSamples "+graphMSAASamples+", vbaaSamples "+graphVBAASamples+"]");
- GLWindow window = createWindow("text-gvbaa"+graphVBAASamples+"-gmsaa"+graphMSAASamples+"-smsaa"+sceneMSAASamples, caps, 1024, 640);
+ final GLWindow window = createWindow("text-gvbaa"+graphVBAASamples+"-gmsaa"+graphMSAASamples+"-smsaa"+sceneMSAASamples, caps, 1024, 640);
window.display();
System.err.println("Chosen: "+window.getChosenGLCapabilities());
if( WaitStartEnd ) {
@@ -228,18 +228,18 @@ public class TestTextRendererNEWT00 extends UITestCase {
window.addGLEventListener(textGLListener);
- Animator anim = new Animator();
+ final Animator anim = new Animator();
anim.add(window);
anim.start();
anim.setUpdateFPSFrames(60, null);
sleep();
window.invoke(true, new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
try {
textGLListener.printScreen(renderModes, drawable, "./", "TestTextRendererNEWT00-snap"+screenshot_num, false);
screenshot_num++;
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
return true;
@@ -283,7 +283,7 @@ public class TestTextRendererNEWT00 extends UITestCase {
Font _font = null;
try {
_font = FontFactory.get(getClass(), fontFileName, false);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
font = _font;
@@ -305,7 +305,7 @@ public class TestTextRendererNEWT00 extends UITestCase {
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
super.init(drawable);
drawable.getGL().setSwapInterval(SwapInterval);
t0 = Platform.currentTimeMillis();
@@ -319,7 +319,7 @@ public class TestTextRendererNEWT00 extends UITestCase {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
screenshot.dispose(gl);
regionFPS.destroy(gl);
@@ -327,7 +327,7 @@ public class TestTextRendererNEWT00 extends UITestCase {
super.dispose(drawable);
}
- public void printScreen(int renderModes, GLAutoDrawable drawable, String dir, String objName, boolean exportAlpha) throws GLException, IOException {
+ public void printScreen(final int renderModes, final GLAutoDrawable drawable, final String dir, final String objName, final boolean exportAlpha) throws GLException, IOException {
final String modeS = Region.getRenderModeString(renderModes);
final String bname = String.format("%s-msaa%02d-fontsz%02.1f-%03dx%03d-%s%04d", objName,
drawable.getChosenGLCapabilities().getNumSamples(),
@@ -348,7 +348,7 @@ public class TestTextRendererNEWT00 extends UITestCase {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java
index 247ba69b3..a96c1e926 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java
@@ -37,6 +37,8 @@ import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLException;
import javax.media.opengl.GLProfile;
+import jogamp.common.os.PlatformPropsImpl;
+
import org.junit.Assert;
import org.junit.Test;
import org.junit.FixMethodOrder;
@@ -58,20 +60,20 @@ public class TestTextRendererNEWT01 extends UITestCase {
static final boolean TRACE = false;
static long duration = 100; // ms
- static int atoi(String a) {
+ static int atoi(final String a) {
try {
return Integer.parseInt(a);
- } catch (Exception ex) { throw new RuntimeException(ex); }
+ } catch (final Exception ex) { throw new RuntimeException(ex); }
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
duration = atoi(args[i]);
}
}
- String tstname = TestTextRendererNEWT01.class.getName();
+ final String tstname = TestTextRendererNEWT01.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
@@ -79,19 +81,19 @@ public class TestTextRendererNEWT01 extends UITestCase {
try {
System.err.println("** new frame ** (sleep: "+duration+"ms)");
Thread.sleep(duration);
- } catch (InterruptedException ie) {}
+ } catch (final InterruptedException ie) {}
}
- static void destroyWindow(GLWindow window) {
+ static void destroyWindow(final GLWindow window) {
if(null!=window) {
window.destroy();
}
}
- static GLWindow createWindow(String title, GLCapabilitiesImmutable caps, int width, int height) {
+ static GLWindow createWindow(final String title, final GLCapabilitiesImmutable caps, final int width, final int height) {
Assert.assertNotNull(caps);
- GLWindow window = GLWindow.create(caps);
+ final GLWindow window = GLWindow.create(caps);
window.setSize(width, height);
window.setPosition(10, 10);
window.setTitle(title);
@@ -103,23 +105,23 @@ public class TestTextRendererNEWT01 extends UITestCase {
@Test
public void testTextRendererR2T01() throws InterruptedException {
- if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME
+ if(Platform.CPUFamily.X86 != PlatformPropsImpl.CPU_ARCH.family) { // FIXME
// FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise).
System.err.println("disabled on non desktop (x86) arch for now ..");
return;
}
- GLProfile glp = GLProfile.getGL2ES2();
+ final GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(4);
System.err.println("Requested: "+caps);
- GLWindow window = createWindow("text-vbaa1-msaa0", caps, 800,400);
+ final GLWindow window = createWindow("text-vbaa1-msaa0", caps, 800,400);
window.display();
System.err.println("Chosen: "+window.getChosenGLCapabilities());
- RenderState rs = RenderState.createRenderState(SVertex.factory());
- TextGLListener textGLListener = new TextGLListener(rs, Region.VBAA_RENDERING_BIT, DEBUG, TRACE);
+ final RenderState rs = RenderState.createRenderState(SVertex.factory());
+ final TextGLListener textGLListener = new TextGLListener(rs, Region.VBAA_RENDERING_BIT, DEBUG, TRACE);
textGLListener.attachInputListenerTo(window);
window.addGLEventListener(textGLListener);
@@ -156,19 +158,19 @@ public class TestTextRendererNEWT01 extends UITestCase {
@Test
public void testTextRendererMSAA01() throws InterruptedException {
- GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(4);
caps.setSampleBuffers(true);
caps.setNumSamples(4);
System.err.println("Requested: "+caps);
- GLWindow window = createWindow("text-vbaa0-msaa1", caps, 800, 400);
+ final GLWindow window = createWindow("text-vbaa0-msaa1", caps, 800, 400);
window.display();
System.err.println("Chosen: "+window.getChosenGLCapabilities());
- RenderState rs = RenderState.createRenderState(SVertex.factory());
- TextGLListener textGLListener = new TextGLListener(rs, 0, DEBUG, TRACE);
+ final RenderState rs = RenderState.createRenderState(SVertex.factory());
+ final TextGLListener textGLListener = new TextGLListener(rs, 0, DEBUG, TRACE);
textGLListener.attachInputListenerTo(window);
window.addGLEventListener(textGLListener);
@@ -206,22 +208,22 @@ public class TestTextRendererNEWT01 extends UITestCase {
private class TextGLListener extends GPUTextRendererListenerBase01 {
String winTitle;
- public TextGLListener(RenderState rs, int type, boolean debug, boolean trace) {
+ public TextGLListener(final RenderState rs, final int type, final boolean debug, final boolean trace) {
super(rs, type, 4, true, debug, trace);
}
- public void attachInputListenerTo(GLWindow window) {
+ public void attachInputListenerTo(final GLWindow window) {
super.attachInputListenerTo(window);
winTitle = window.getTitle();
}
- public void setTech(float xt, float yt, float angle, int zoom, int sampleCount){
+ public void setTech(final float xt, final float yt, final float angle, final int zoom, final int sampleCount){
setMatrix(xt, yt, zoom, angle, sampleCount);
}
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
super.init(drawable);
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.setSwapInterval(1);
gl.glEnable(GL.GL_DEPTH_TEST);
@@ -229,14 +231,14 @@ public class TestTextRendererNEWT01 extends UITestCase {
rs.setColorStatic(0.1f, 0.1f, 0.1f, 1.0f);
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
super.display(drawable);
try {
printScreen(drawable, "./", winTitle, false);
- } catch (GLException e) {
+ } catch (final GLException e) {
e.printStackTrace();
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java
index de71f65d3..cb9f3e3d4 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java
@@ -73,13 +73,13 @@ public class TestTextRendererNEWT10 extends UITestCase {
font = FontFactory.get(FontFactory.UBUNTU).getDefault();
}
- static int atoi(String a) {
+ static int atoi(final String a) {
try {
return Integer.parseInt(a);
- } catch (Exception ex) { throw new RuntimeException(ex); }
+ } catch (final Exception ex) { throw new RuntimeException(ex); }
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
mainRun = true;
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
@@ -93,7 +93,7 @@ public class TestTextRendererNEWT10 extends UITestCase {
forceGL3 = true;
}
}
- String tstname = TestTextRendererNEWT10.class.getName();
+ final String tstname = TestTextRendererNEWT10.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
@@ -101,7 +101,7 @@ public class TestTextRendererNEWT10 extends UITestCase {
try {
System.err.println("** new frame ** (sleep: "+duration+"ms)");
Thread.sleep(duration);
- } catch (InterruptedException ie) {}
+ } catch (final InterruptedException ie) {}
}
// @Test
@@ -114,7 +114,7 @@ public class TestTextRendererNEWT10 extends UITestCase {
testTextRendererImpl(4);
}
- void testTextRendererImpl(int sampleCount) throws InterruptedException {
+ void testTextRendererImpl(final int sampleCount) throws InterruptedException {
final GLProfile glp;
if(forceGL3) {
glp = GLProfile.get(GLProfile.GL3);
@@ -180,7 +180,7 @@ public class TestTextRendererNEWT10 extends UITestCase {
int lastRow = -1;
- void renderString(GLDrawable drawable, GL2ES2 gl, RegionRenderer renderer, TextRegionUtil textRenderUtil, String text, int column, int row, int z0) {
+ void renderString(final GLDrawable drawable, final GL2ES2 gl, final RegionRenderer renderer, final TextRegionUtil textRenderUtil, final String text, final int column, int row, final int z0) {
final int height = drawable.getSurfaceHeight();
int dx = 0;
@@ -188,7 +188,7 @@ public class TestTextRendererNEWT10 extends UITestCase {
if(0>row) {
row = lastRow + 1;
}
- AABBox textBox = font.getMetricBounds(text, fontSize);
+ final AABBox textBox = font.getMetricBounds(text, fontSize);
dx += font.getAdvanceWidth('X', fontSize) * column;
dy -= (int)textBox.getHeight() * ( row + 1 );
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java b/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java
index 1c4a20bea..f1a6b761b 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java
@@ -75,7 +75,7 @@ public abstract class TextRendererGLELBase implements GLEventListener {
public static Font getFont(final int fontSet, final int fontFamily, final int fontStylebits) {
try {
return FontFactory.get(fontSet).get(fontFamily, fontStylebits);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
return null;
@@ -86,7 +86,7 @@ public abstract class TextRendererGLELBase implements GLEventListener {
* @param sampleCount desired multisampling sample count for msaa-rendering.
* @see #setRendererCallbacks(com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback, com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback)
*/
- public TextRendererGLELBase(final int renderModes, int[] sampleCount) {
+ public TextRendererGLELBase(final int renderModes, final int[] sampleCount) {
this.renderModes = renderModes;
this.vbaaSampleCount = sampleCount;
}
@@ -97,7 +97,7 @@ public abstract class TextRendererGLELBase implements GLEventListener {
* </p>
* @param rs
*/
- public void setRenderState(RenderState rs) { this.rs = rs; }
+ public void setRenderState(final RenderState rs) { this.rs = rs; }
/**
* In exclusive mode, impl. uses a pixelScale of 1f and orthogonal PMV on window dimensions
@@ -110,7 +110,7 @@ public abstract class TextRendererGLELBase implements GLEventListener {
* Must be called before {@link #init(GLAutoDrawable)}.
* </p>
*/
- public void setSharedPMVMatrix(PMVMatrix pmv) {
+ public void setSharedPMVMatrix(final PMVMatrix pmv) {
this.sharedPMVMatrix = pmv;
}
@@ -120,17 +120,17 @@ public abstract class TextRendererGLELBase implements GLEventListener {
* Must be called before {@link #init(GLAutoDrawable)}.
* </p>
*/
- public void setRendererCallbacks(RegionRenderer.GLCallback enable, RegionRenderer.GLCallback disable) {
+ public void setRendererCallbacks(final RegionRenderer.GLCallback enable, final RegionRenderer.GLCallback disable) {
this.enableCallback = enable;
this.disableCallback = disable;
}
- public void setFlipVerticalInGLOrientation(boolean v) { flipVerticalInGLOrientation=v; }
+ public void setFlipVerticalInGLOrientation(final boolean v) { flipVerticalInGLOrientation=v; }
public final RegionRenderer getRenderer() { return renderer; }
public final TextRegionUtil getTextRenderUtil() { return textRenderUtil; }
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
if( null == this.rs ) {
exclusivePMVMatrix = null == sharedPMVMatrix;
this.rs = RenderState.createRenderState(SVertex.factory(), sharedPMVMatrix);
@@ -151,7 +151,7 @@ public abstract class TextRendererGLELBase implements GLEventListener {
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
if( null != renderer ) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
renderer.enable(gl, true);
@@ -170,7 +170,7 @@ public abstract class TextRendererGLELBase implements GLEventListener {
public abstract void display(GLAutoDrawable drawable);
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
if( null != renderer ) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
renderer.destroy(gl);
@@ -191,16 +191,16 @@ public abstract class TextRendererGLELBase implements GLEventListener {
* @param tz
* @param cacheRegion
*/
- public void renderString(GLAutoDrawable drawable,
- Font font, float pixelSize, String text,
- int column, float tx, float ty, float tz, boolean cacheRegion) {
+ public void renderString(final GLAutoDrawable drawable,
+ final Font font, final float pixelSize, final String text,
+ final int column, final float tx, final float ty, final float tz, final boolean cacheRegion) {
final int row = lastRow + 1;
renderStringImpl(drawable, font, pixelSize, text, column, row, tx, ty, tz, cacheRegion, null);
}
- public void renderString(GLAutoDrawable drawable,
- Font font, float pixelSize, String text,
- int column, float tx, float ty, float tz, GLRegion region) {
+ public void renderString(final GLAutoDrawable drawable,
+ final Font font, final float pixelSize, final String text,
+ final int column, final float tx, final float ty, final float tz, final GLRegion region) {
final int row = lastRow + 1;
renderStringImpl(drawable, font, pixelSize, text, column, row, tx, ty, tz, false, region);
}
@@ -218,24 +218,24 @@ public abstract class TextRendererGLELBase implements GLEventListener {
* @param tz
* @param cacheRegion
*/
- public void renderString(GLAutoDrawable drawable,
- Font font, float pixelSize, String text,
- int column, int row,
- float tx, float ty, float tz, boolean cacheRegion) {
+ public void renderString(final GLAutoDrawable drawable,
+ final Font font, final float pixelSize, final String text,
+ final int column, final int row,
+ final float tx, final float ty, final float tz, final boolean cacheRegion) {
renderStringImpl(drawable, font, pixelSize, text, column, row, tx, ty, tz, cacheRegion, null);
}
- public void renderString(GLAutoDrawable drawable,
- Font font, float pixelSize, String text,
- int column, int row,
- float tx, float ty, float tz, GLRegion region) {
+ public void renderString(final GLAutoDrawable drawable,
+ final Font font, final float pixelSize, final String text,
+ final int column, final int row,
+ final float tx, final float ty, final float tz, final GLRegion region) {
renderStringImpl(drawable, font, pixelSize, text, column, row, tx, ty, tz, false, region);
}
- private void renderStringImpl(GLAutoDrawable drawable,
- Font font, float pixelSize, String text,
- int column, int row,
- float tx, float ty, float tz, boolean cacheRegion, GLRegion region) {
+ private void renderStringImpl(final GLAutoDrawable drawable,
+ final Font font, final float pixelSize, final String text,
+ final int column, final int row,
+ final float tx, final float ty, final float tz, final boolean cacheRegion, final GLRegion region) {
if( null != renderer ) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java
index 4bcbdb380..82d129f4e 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java
@@ -49,7 +49,7 @@ import com.jogamp.opengl.util.PMVMatrix;
public class GPURegionGLListener01 extends GPURendererListenerBase01 {
OutlineShape outlineShape = null;
- public GPURegionGLListener01 (RenderState rs, int renderModes, int sampleCount, boolean debug, boolean trace) {
+ public GPURegionGLListener01 (final RenderState rs, final int renderModes, final int sampleCount, final boolean debug, final boolean trace) {
super(RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable), renderModes, debug, trace);
rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
setMatrix(-20, 00, -50, 0f, sampleCount);
@@ -95,23 +95,23 @@ public class GPURegionGLListener01 extends GPURendererListenerBase01 {
region.addOutlineShape(outlineShape, null, region.hasColorChannel() ? getRenderer().getRenderState().getColorStatic(new float[4]) : null);
}
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
super.init(drawable);
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
final RenderState rs = getRenderer().getRenderState();
gl.setSwapInterval(1);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
- gl.glEnable(GL2ES2.GL_BLEND);
+ gl.glEnable(GL.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_BLEND);
rs.setColorStatic(0.0f, 0.0f, 0.0f, 1.0f);
createTestOutline();
}
- public void display(GLAutoDrawable drawable) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java
index ca9f4fda7..2486b5853 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java
@@ -49,7 +49,7 @@ import com.jogamp.opengl.util.PMVMatrix;
public class GPURegionGLListener02 extends GPURendererListenerBase01 {
List<OutlineShape> outlineShapes = new ArrayList<OutlineShape>();
- public GPURegionGLListener02 (RenderState rs, int renderModes, int sampleCount, boolean debug, boolean trace) {
+ public GPURegionGLListener02 (final RenderState rs, final int renderModes, final int sampleCount, final boolean debug, final boolean trace) {
super(RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable), renderModes, debug, trace);
rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
setMatrix(-20, 00, -50, 0f, sampleCount);
@@ -97,23 +97,23 @@ public class GPURegionGLListener02 extends GPURendererListenerBase01 {
region.addOutlineShapes(outlineShapes, null, null);
}
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
super.init(drawable);
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
final RenderState rs = getRenderer().getRenderState();
gl.setSwapInterval(1);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
- gl.glEnable(GL2ES2.GL_BLEND);
+ gl.glEnable(GL.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_BLEND);
rs.setColorStatic(0.0f, 0.0f, 0.0f, 1.0f);
createTestOutline();
}
- public void display(GLAutoDrawable drawable) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo.java
index 14ff53f10..77456d5e3 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo.java
@@ -58,7 +58,7 @@ public class GPURegionNewtDemo {
static int GraphMSAASamples = 0;
static boolean GraphUseWeight = true;
- public static void main(String[] args) {
+ public static void main(final String[] args) {
int width = 800, height = 400;
int x = 10, y = 10;
if( 0 != args.length ) {
@@ -103,8 +103,8 @@ public class GPURegionNewtDemo {
System.err.println("Graph VBAA Samples "+GraphVBAASamples);
System.err.println("Graph Weight Mode "+GraphUseWeight);
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(4);
if( SceneMSAASamples > 0 ) {
caps.setSampleBuffers(true);
@@ -127,8 +127,8 @@ public class GPURegionNewtDemo {
window.setSize(width, height);
window.setTitle("GPU Curve Region Newt Demo - graph[vbaa"+GraphVBAASamples+" msaa"+GraphMSAASamples+"], msaa "+SceneMSAASamples);
- RenderState rs = RenderState.createRenderState(SVertex.factory());
- GPURegionGLListener01 regionGLListener = new GPURegionGLListener01 (rs, rmode, sampleCount, DEBUG, TRACE);
+ final RenderState rs = RenderState.createRenderState(SVertex.factory());
+ final GPURegionGLListener01 regionGLListener = new GPURegionGLListener01 (rs, rmode, sampleCount, DEBUG, TRACE);
regionGLListener.attachInputListenerTo(window);
window.addGLEventListener(regionGLListener);
window.setVisible(true);
@@ -139,14 +139,14 @@ public class GPURegionNewtDemo {
animator.add(window);
window.addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent arg0) {
+ public void keyPressed(final KeyEvent arg0) {
if(arg0.getKeyCode() == KeyEvent.VK_F4) {
window.destroy();
}
}
});
window.addWindowListener(new WindowAdapter() {
- public void windowDestroyed(WindowEvent e) {
+ public void windowDestroyed(final WindowEvent e) {
animator.stop();
}
});
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java
index ef72b3d45..159d4b84c 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java
@@ -93,7 +93,7 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
protected volatile float weight = 1.0f;
boolean ignoreInput = false;
- public GPURendererListenerBase01(RegionRenderer renderer, int renderModes, boolean debug, boolean trace) {
+ public GPURendererListenerBase01(final RegionRenderer renderer, final int renderModes, final boolean debug, final boolean trace) {
this.renderer = renderer;
this.renderModes = renderModes;
this.debug = debug;
@@ -111,7 +111,7 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
public final int[] getSampleCount() { return sampleCount; }
public final float[] getPosition() { return position; }
- public void setMatrix(float xtrans, float ytrans, float zTran, float angle, int sampleCount) {
+ public void setMatrix(final float xtrans, final float ytrans, final float zTran, final float angle, final int sampleCount) {
this.xTran = xtrans;
this.yTran = ytrans;
this.zTran = zTran;
@@ -120,7 +120,7 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
autoDrawable = drawable;
GL2ES2 gl = drawable.getGL().getGL2ES2();
if(debug) {
@@ -138,14 +138,14 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
public static void mapWin2ObjectCoords(final PMVMatrix pmv, final int[] view,
final float zNear, final float zFar,
- float orthoX, float orthoY, float orthoDist,
+ final float orthoX, final float orthoY, final float orthoDist,
final float[] winZ, final float[] objPos) {
winZ[0] = (1f/zNear-1f/orthoDist)/(1f/zNear-1f/zFar);
pmv.gluUnProject(orthoX, orthoY, winZ[0], view, 0, objPos, 0);
}
@Override
- public void reshape(GLAutoDrawable drawable, int xstart, int ystart, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int xstart, final int ystart, final int width, final int height) {
final PMVMatrix pmv = renderer.getMatrix();
renderer.reshapePerspective(45.0f, width, height, zNear, zFar);
pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
@@ -179,9 +179,9 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
autoDrawable = null;
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
if(null != region) {
region.destroy(gl);
}
@@ -189,22 +189,22 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
renderer.destroy(gl);
}
- public void zoom(int v){
+ public void zoom(final int v){
zTran += v;
dumpMatrix();
}
- public void move(float x, float y){
+ public void move(final float x, final float y){
xTran += x;
yTran += y;
dumpMatrix();
}
- public void rotate(float delta){
+ public void rotate(final float delta){
ang += delta;
ang %= 360.0f;
dumpMatrix();
}
- public void editGlobalWeight(float delta) {
+ public void editGlobalWeight(final float delta) {
if( !RenderState.isWeightValid(weight+delta) ) {
return;
}
@@ -217,23 +217,23 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
}
/** Attach the input listener to the window */
- public void attachInputListenerTo(GLWindow window) {
+ public void attachInputListenerTo(final GLWindow window) {
if ( null == keyAction ) {
keyAction = new KeyAction();
window.addKeyListener(keyAction);
}
}
- public void detachInputListenerFrom(GLWindow window) {
+ public void detachInputListenerFrom(final GLWindow window) {
if ( null == keyAction ) {
return;
}
window.removeKeyListener(keyAction);
}
- public void printScreen(GLAutoDrawable drawable, String dir, String tech, String objName, boolean exportAlpha) throws GLException, IOException {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
+ public void printScreen(final GLAutoDrawable drawable, final String dir, final String tech, final String objName, final boolean exportAlpha) throws GLException, IOException {
+ final StringWriter sw = new StringWriter();
+ final PrintWriter pw = new PrintWriter(sw);
pw.printf("-%03dx%03d-Z%04d-S%02d-%s", drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), (int)Math.abs(zTran), sampleCount[0], objName);
final String filename = dir + tech + sw +".png";
@@ -244,7 +244,7 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
int screenshot_num = 0;
- public void setIgnoreInput(boolean v) {
+ public void setIgnoreInput(final boolean v) {
ignoreInput = v;
}
public boolean getIgnoreInput() {
@@ -253,7 +253,7 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
public class KeyAction implements KeyListener {
@Override
- public void keyPressed(KeyEvent arg0) {
+ public void keyPressed(final KeyEvent arg0) {
if(ignoreInput) {
return;
}
@@ -300,8 +300,8 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
if(null != autoDrawable) {
autoDrawable.invoke(false, new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
+ public boolean run(final GLAutoDrawable drawable) {
+ final GL gl = drawable.getGL();
int i = gl.getSwapInterval();
i = i==0 ? 1 : 0;
gl.setSwapInterval(i);
@@ -323,15 +323,15 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
if(null != autoDrawable) {
autoDrawable.invoke(false, new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
try {
final String modeS = Region.getRenderModeString(renderModes);
final String type = modeS + ( Region.hasVariableWeight(renderModes) ? "-vc" : "-uc" ) ;
printScreen(drawable, "./", "demo-"+type, "snap"+screenshot_num, false);
screenshot_num++;
- } catch (GLException e) {
+ } catch (final GLException e) {
e.printStackTrace();
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
return true;
@@ -341,6 +341,6 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
}
}
@Override
- public void keyReleased(KeyEvent arg0) {}
+ public void keyReleased(final KeyEvent arg0) {}
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java
index 08d2f0d70..602879319 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java
@@ -28,6 +28,7 @@
package com.jogamp.opengl.test.junit.graph.demos;
+import javax.media.opengl.GL;
import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLAutoDrawable;
@@ -43,28 +44,28 @@ public class GPUTextGLListener0A extends GPUTextRendererListenerBase01 {
super(RenderState.createRenderState(SVertex.factory()), Region.VBAA_RENDERING_BIT, 4, true, false, false);
}
- public GPUTextGLListener0A(RenderState rs, int renderModes, int sampleCount, boolean blending, boolean debug, boolean trace) {
+ public GPUTextGLListener0A(final RenderState rs, final int renderModes, final int sampleCount, final boolean blending, final boolean debug, final boolean trace) {
super(rs, renderModes, sampleCount, blending, debug, trace);
}
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
if(drawable instanceof GLWindow) {
final GLWindow glw = (GLWindow) drawable;
attachInputListenerTo(glw);
}
super.init(drawable);
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
final RenderState rs = getRenderer().getRenderState();
gl.setSwapInterval(1);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
- gl.glEnable(GL2ES2.GL_BLEND);
+ gl.glEnable(GL.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_BLEND);
rs.setColorStatic(0.1f, 0.1f, 0.1f, 1.0f);
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
if(drawable instanceof GLWindow) {
final GLWindow glw = (GLWindow) drawable;
detachInputListenerFrom(glw);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java
index 6a91d005e..cba70c09f 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java
@@ -59,7 +59,7 @@ public class GPUTextNewtDemo {
static int GraphVBAASamples = 4;
static int GraphMSAASamples = 0;
- public static void main(String[] args) {
+ public static void main(final String[] args) {
int width = 800, height = 400;
int x = 10, y = 10;
if( 0 != args.length ) {
@@ -100,9 +100,9 @@ public class GPUTextNewtDemo {
System.err.println("Graph MSAA Samples "+GraphMSAASamples);
System.err.println("Graph VBAA Samples "+GraphVBAASamples);
- GLProfile glp = GLProfile.getGL2ES2();
+ final GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(4);
if( SceneMSAASamples > 0 ) {
caps.setSampleBuffers(true);
@@ -125,8 +125,8 @@ public class GPUTextNewtDemo {
window.setSize(width, height);
window.setTitle("GPU Text Newt Demo - graph[vbaa"+GraphVBAASamples+" msaa"+GraphMSAASamples+"], msaa "+SceneMSAASamples);
- RenderState rs = RenderState.createRenderState(SVertex.factory());
- GPUTextGLListener0A textGLListener = new GPUTextGLListener0A(rs, rmode, sampleCount, true, DEBUG, TRACE);
+ final RenderState rs = RenderState.createRenderState(SVertex.factory());
+ final GPUTextGLListener0A textGLListener = new GPUTextGLListener0A(rs, rmode, sampleCount, true, DEBUG, TRACE);
// ((TextRenderer)textGLListener.getRenderer()).setCacheLimit(32);
window.addGLEventListener(textGLListener);
window.setVisible(true);
@@ -136,14 +136,14 @@ public class GPUTextNewtDemo {
animator.add(window);
window.addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent arg0) {
+ public void keyPressed(final KeyEvent arg0) {
if(arg0.getKeyCode() == KeyEvent.VK_F4) {
window.destroy();
}
}
});
window.addWindowListener(new WindowAdapter() {
- public void windowDestroyed(WindowEvent e) {
+ public void windowDestroyed(final WindowEvent e) {
animator.stop();
}
});
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java
index 67e2555fd..bb688f9b3 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java
@@ -111,7 +111,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
StringBuilder userString = new StringBuilder();
boolean userInput = false;
- public GPUTextRendererListenerBase01(RenderState rs, int renderModes, int sampleCount, boolean blending, boolean debug, boolean trace) {
+ public GPUTextRendererListenerBase01(final RenderState rs, final int renderModes, final int sampleCount, final boolean blending, final boolean debug, final boolean trace) {
// NOTE_ALPHA_BLENDING: We use alpha-blending
super(RegionRenderer.create(rs, blending ? RegionRenderer.defaultBlendEnable : null,
blending ? RegionRenderer.defaultBlendDisable : null),
@@ -125,7 +125,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
dumpFontNames();
this.fontName = font.toString();
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
System.err.println("Caught: "+ioe.getMessage());
ioe.printStackTrace();
}
@@ -161,7 +161,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
super.init(drawable);
final Object upObj = drawable.getUpstreamWidget();
if( upObj instanceof Window ) {
@@ -175,7 +175,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
}
@Override
- public void reshape(GLAutoDrawable drawable, int xstart, int ystart, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int xstart, final int ystart, final int width, final int height) {
super.reshape(drawable, xstart, ystart, width, height);
final float dist = 100f;
nearPlaneX0 = nearPlane1Box.getMinX() * dist;
@@ -191,17 +191,17 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
float nearPlaneX0, nearPlaneY0, nearPlaneZ0, nearPlaneSx, nearPlaneSy, nearPlaneS;
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
regionFPS.destroy(drawable.getGL().getGL2ES2());
regionBottom.destroy(drawable.getGL().getGL2ES2());
super.dispose(drawable);
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final int width = drawable.getSurfaceWidth();
final int height = drawable.getSurfaceHeight();
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
@@ -301,12 +301,12 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
}
final boolean bottomTextUseFrustum = true;
- public void fontBottomIncr(int v) {
+ public void fontBottomIncr(final int v) {
fontSizeBottom = Math.abs((fontSizeBottom + v) % fontSizeModulo) ;
dumpMatrix(true);
}
- public void fontHeadIncr(int v) {
+ public void fontHeadIncr(final int v) {
fontSizeHead = Math.abs((fontSizeHead + v) % fontSizeModulo) ;
if(null != headtext) {
headbox = font.getMetricBounds(headtext, font.getPixelSize(fontSizeHead, dpiH));
@@ -315,8 +315,8 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
public boolean nextFontSet() {
try {
- int set = ( fontSet == FontFactory.UBUNTU ) ? FontFactory.JAVA : FontFactory.UBUNTU ;
- Font _font = FontFactory.get(set).getDefault();
+ final int set = ( fontSet == FontFactory.UBUNTU ) ? FontFactory.JAVA : FontFactory.UBUNTU ;
+ final Font _font = FontFactory.get(set).getDefault();
if(null != _font) {
fontSet = set;
font = _font;
@@ -325,15 +325,15 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
dumpFontNames();
return true;
}
- } catch (IOException ex) {
+ } catch (final IOException ex) {
System.err.println("Caught: "+ex.getMessage());
}
return false;
}
- public boolean setFontSet(int set, int family, int stylebits) {
+ public boolean setFontSet(final int set, final int family, final int stylebits) {
try {
- Font _font = FontFactory.get(set).get(family, stylebits);
+ final Font _font = FontFactory.get(set).get(family, stylebits);
if(null != _font) {
fontSet = set;
font = _font;
@@ -342,7 +342,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
dumpFontNames();
return true;
}
- } catch (IOException ex) {
+ } catch (final IOException ex) {
System.err.println("Caught: "+ex.getMessage());
}
return false;
@@ -350,7 +350,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
public boolean isUserInputMode() { return userInput; }
- void dumpMatrix(boolean bbox) {
+ void dumpMatrix(final boolean bbox) {
System.err.println("Matrix: " + getXTran() + "/" + getYTran() + " x"+getZTran() + " @"+getAngle() +" fontSize "+fontSizeBottom);
if(bbox) {
System.err.println("bbox: "+font.getMetricBounds(text2, nearPlaneS * font.getPixelSize(fontSizeBottom, dpiH)));
@@ -360,7 +360,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
KeyAction keyAction = null;
@Override
- public void attachInputListenerTo(GLWindow window) {
+ public void attachInputListenerTo(final GLWindow window) {
if ( null == keyAction ) {
keyAction = new KeyAction();
window.addKeyListener(keyAction);
@@ -369,7 +369,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
}
@Override
- public void detachInputListenerFrom(GLWindow window) {
+ public void detachInputListenerFrom(final GLWindow window) {
super.detachInputListenerFrom(window);
if ( null == keyAction ) {
return;
@@ -377,7 +377,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
window.removeKeyListener(keyAction);
}
- public void printScreen(GLAutoDrawable drawable, String dir, String tech, boolean exportAlpha) throws GLException, IOException {
+ public void printScreen(final GLAutoDrawable drawable, final String dir, final String tech, final boolean exportAlpha) throws GLException, IOException {
final String fn = font.getFullFamilyName(null).toString();
printScreen(drawable, dir, tech, fn.replace(' ', '_'), exportAlpha);
}
@@ -386,7 +386,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
public class KeyAction implements KeyListener {
@Override
- public void keyPressed(KeyEvent e) {
+ public void keyPressed(final KeyEvent e) {
if(userInput) {
return;
}
@@ -421,7 +421,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
}
@Override
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java
index 89361b511..45ed14f7b 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java
@@ -124,7 +124,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
/**
* @param renderModes
*/
- public GPUUISceneGLListener0A(int renderModes) {
+ public GPUUISceneGLListener0A(final int renderModes) {
this(renderModes, false, false);
}
@@ -133,7 +133,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
* @param debug
* @param trace
*/
- public GPUUISceneGLListener0A(int renderModes, boolean debug, boolean trace) {
+ public GPUUISceneGLListener0A(final int renderModes, final boolean debug, final boolean trace) {
this(0f, renderModes, debug, trace);
}
@@ -142,11 +142,11 @@ public class GPUUISceneGLListener0A implements GLEventListener {
* @param debug
* @param trace
*/
- public GPUUISceneGLListener0A(final float noAADPIThreshold, boolean debug, boolean trace) {
+ public GPUUISceneGLListener0A(final float noAADPIThreshold, final boolean debug, final boolean trace) {
this(noAADPIThreshold, 0, debug, trace);
}
- private GPUUISceneGLListener0A(final float noAADPIThreshold, int renderModes, boolean debug, boolean trace) {
+ private GPUUISceneGLListener0A(final float noAADPIThreshold, final int renderModes, final boolean debug, final boolean trace) {
this.noAADPIThreshold = noAADPIThreshold;
this.rs = RenderState.createRenderState(SVertex.factory());
this.debug = debug;
@@ -156,7 +156,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
try {
font = FontFactory.get(FontFactory.UBUNTU).getDefault();
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
System.err.println("Caught: "+ioe.getMessage());
ioe.printStackTrace();
}
@@ -170,13 +170,13 @@ public class GPUUISceneGLListener0A implements GLEventListener {
buttons.get(i).getRotation().rotateByEuler( angdeg );
}
}
- private void translateButtons(float tx, float ty, float tz) {
+ private void translateButtons(final float tx, final float ty, final float tz) {
for(int i=0; i<buttons.size(); i++) {
buttons.get(i).translate(tx, ty, tz);
}
}
- private void setButtonsSpacing(float dx, float dy) {
+ private void setButtonsSpacing(final float dx, final float dy) {
for(int i=0; i<buttons.size(); i++) {
final RoundButton b = buttons.get(i);
if( b instanceof LabelButton ) {
@@ -188,7 +188,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
}
}
- private void setButtonsCorner(float dc) {
+ private void setButtonsCorner(final float dc) {
for(int i=0; i<buttons.size(); i++) {
final float c = buttons.get(i).getCorner()+dc;
System.err.println("Corner: "+c);
@@ -224,7 +224,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button.translate(xStartLeft,yStartTop-diffY*buttons.size(), 0f);
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
if( null != labels[currentText] ) {
labels[currentText].setEnabled(false);
}
@@ -243,7 +243,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button.setToggle(fpsLabel.isEnabled());
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
final GLAnimatorControl a = cDrawable.getAnimator();
if( null != a ) {
a.resetFPSCounter();
@@ -259,11 +259,11 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button.setToggle(gl.getSwapInterval()>0);
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
cDrawable.invoke(false, new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
+ public boolean run(final GLAutoDrawable drawable) {
+ final GL gl = drawable.getGL();
gl.setSwapInterval(gl.getSwapInterval()<=0?1:0);
final GLAnimatorControl a = drawable.getAnimator();
if( null != a ) {
@@ -280,7 +280,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
final Object attachment = e.getAttachment();
if( attachment instanceof UIShape.PointerEventInfo ) {
final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
@@ -292,7 +292,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
}
}
@Override
- public void mouseWheelMoved(MouseEvent e) {
+ public void mouseWheelMoved(final MouseEvent e) {
rotateButtons(new float[] { 0f, e.getRotation()[1], 0f});
} } );
buttons.add(button);
@@ -302,7 +302,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
final Object attachment = e.getAttachment();
if( attachment instanceof UIShape.PointerEventInfo ) {
final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
@@ -328,7 +328,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
final Object attachment = e.getAttachment();
if( attachment instanceof UIShape.PointerEventInfo ) {
final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
@@ -359,7 +359,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button.setPressedColorMod(1.1f, 0.0f, 0.0f, 1.0f);
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
new Thread() {
public void run() {
if( null != cDrawable ) {
@@ -376,13 +376,13 @@ public class GPUUISceneGLListener0A implements GLEventListener {
// second column to the left
{
- int j = 1; // column
+ final int j = 1; // column
int k = 0; // row
button = new LabelButton(SVertex.factory(), renderModes, font, "y flip", buttonXSize, buttonYSize);
button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
rotateButtons(new float[] { 0f, 180f, 0f});
} } );
button.addMouseListener(dragZoomRotateListener);
@@ -393,7 +393,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
rotateButtons(new float[] { 180f, 0f, 0f});
} } );
button.addMouseListener(dragZoomRotateListener);
@@ -404,7 +404,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
final Object attachment = e.getAttachment();
if( attachment instanceof UIShape.PointerEventInfo ) {
final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
@@ -431,7 +431,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
final Object attachment = e.getAttachment();
if( attachment instanceof UIShape.PointerEventInfo ) {
final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
@@ -445,7 +445,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
}
}
@Override
- public void mouseWheelMoved(MouseEvent e) {
+ public void mouseWheelMoved(final MouseEvent e) {
setButtonsSpacing(e.getRotation()[0]/100f, e.getRotation()[1]/200f);
} } );
buttons.add(button);
@@ -455,7 +455,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
final Object attachment = e.getAttachment();
if( attachment instanceof UIShape.PointerEventInfo ) {
final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
@@ -470,7 +470,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
}
@Override
- public void mouseWheelMoved(MouseEvent e) {
+ public void mouseWheelMoved(final MouseEvent e) {
setButtonsCorner(e.getRotation()[1]/20f);
} } );
buttons.add(button);
@@ -480,7 +480,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
resetButtons();
} } );
button.addMouseListener(dragZoomRotateListener);
@@ -491,10 +491,10 @@ public class GPUUISceneGLListener0A implements GLEventListener {
button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
button.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
cDrawable.invoke(false, new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
printScreen(drawable.getGL());
return true;
}
@@ -535,14 +535,14 @@ public class GPUUISceneGLListener0A implements GLEventListener {
mPlayerButton.addMouseListener(dragZoomRotateListener);
mPlayerButton.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
mPlayer.setAudioVolume( mPlayerButton.isToggleOn() ? 1f : 0f );
} } );
buttons.add(mPlayerButton);
try {
final URI streamLoc = new URI("http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
mPlayer.initStream(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.TEXTURE_COUNT_DEFAULT);
- } catch (URISyntaxException e1) {
+ } catch (final URISyntaxException e1) {
e1.printStackTrace();
}
}
@@ -553,7 +553,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
try {
imgSeq.addFrame(gl, GPUUISceneGLListener0A.class, "button-released-145x53.png", TextureIO.PNG);
imgSeq.addFrame(gl, GPUUISceneGLListener0A.class, "button-pressed-145x53.png", TextureIO.PNG);
- } catch (IOException e2) {
+ } catch (final IOException e2) {
e2.printStackTrace();
}
imgSeq.setManualStepping(true);
@@ -561,12 +561,12 @@ public class GPUUISceneGLListener0A implements GLEventListener {
imgButton.addMouseListener(dragZoomRotateListener);
imgButton.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
imgButton.setCurrentIdx(1);
System.err.println("XXX: "+imgButton);
}
@Override
- public void mouseReleased(MouseEvent e) {
+ public void mouseReleased(final MouseEvent e) {
imgButton.setCurrentIdx(0);
} } );
buttons.add(imgButton);
@@ -585,15 +585,15 @@ public class GPUUISceneGLListener0A implements GLEventListener {
} else {
glel = new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glClearColor(0.0f, 0.0f, 1.0f, 0.0f);
// gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
@@ -601,7 +601,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
};
@@ -617,7 +617,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
glelButton.addMouseListener(dragZoomRotateListener);
glelButton.addMouseListener(new UIShape.MouseGestureAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
glelButton.setAnimate( glelButton.isToggleOn() );
} } );
buttons.add(glelButton);
@@ -666,7 +666,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
final boolean enableOthers = true;
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
final Object upObj = drawable.getUpstreamWidget();
if( upObj instanceof Window ) {
final Window upWin = (Window)upObj;
@@ -707,7 +707,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
try {
font = FontFactory.get(fontSet).getDefault();
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
System.err.println("Caught: "+ioe.getMessage());
ioe.printStackTrace();
}
@@ -717,8 +717,8 @@ public class GPUUISceneGLListener0A implements GLEventListener {
// renderer = RegionRenderer.create(rs, null, null);
gl.setSwapInterval(1);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
- gl.glEnable(GL2ES2.GL_BLEND);
+ gl.glEnable(GL.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_BLEND);
renderer.init(gl, renderModes);
@@ -772,7 +772,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
if(drawable instanceof GLWindow) {
System.err.println("GPUUISceneGLListener0A: dispose (1)");
final GLWindow glw = (GLWindow) drawable;
@@ -783,7 +783,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
sceneUIController.dispose(drawable); // disposes all registered UIShapes
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
renderer.destroy(gl);
screenshot.dispose(gl);
}
@@ -803,7 +803,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
// System.err.println("GPUUISceneGLListener0A: display");
final GL2ES2 gl = drawable.getGL().getGL2ES2();
@@ -856,7 +856,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
float lastWidth = 0f, lastHeight = 0f;
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
System.err.println("GPUUISceneGLListener0A: reshape");
//
@@ -897,14 +897,14 @@ public class GPUUISceneGLListener0A implements GLEventListener {
lastHeight = height;
}
- public void attachInputListenerTo(GLWindow window) {
+ public void attachInputListenerTo(final GLWindow window) {
if ( !ioAttached ) {
ioAttached = true;
sceneUIController.attachInputListenerTo(window);
}
}
- public void detachInputListenerFrom(GLWindow window) {
+ public void detachInputListenerFrom(final GLWindow window) {
if ( ioAttached ) {
ioAttached = false;
sceneUIController.detachInputListenerFrom(window);
@@ -920,18 +920,18 @@ public class GPUUISceneGLListener0A implements GLEventListener {
boolean dragFirst = false;
@Override
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
dragFirst = true;
}
@Override
- public void mouseReleased(MouseEvent e) {
+ public void mouseReleased(final MouseEvent e) {
dragFirst = false;
actionText = null;
}
@Override
- public void mouseDragged(MouseEvent e) {
+ public void mouseDragged(final MouseEvent e) {
final Object attachment = e.getAttachment();
if( attachment instanceof UIShape.PointerEventInfo ) {
final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
@@ -956,7 +956,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
}
@Override
- public void mouseWheelMoved(MouseEvent e) {
+ public void mouseWheelMoved(final MouseEvent e) {
final Object attachment = e.getAttachment();
if( attachment instanceof UIShape.PointerEventInfo ) {
final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
@@ -979,7 +979,7 @@ public class GPUUISceneGLListener0A implements GLEventListener {
}
}
@Override
- public void gestureDetected(GestureEvent e) {
+ public void gestureDetected(final GestureEvent e) {
final Object attachment = e.getAttachment();
if( attachment instanceof UIShape.PointerEventInfo ) {
final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtCanvasAWTDemo.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtCanvasAWTDemo.java
index 993734e46..274fbea2a 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtCanvasAWTDemo.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtCanvasAWTDemo.java
@@ -36,18 +36,18 @@ public class GPUUISceneNewtCanvasAWTDemo {
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
+ final java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
comp.setMinimumSize(d);
comp.setPreferredSize(d);
comp.setSize(d);
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
}
- public static void main(String[] args) throws InterruptedException, InvocationTargetException {
+ public static void main(final String[] args) throws InterruptedException, InvocationTargetException {
int width = 800, height = 400;
int x = 10, y = 10;
@@ -129,7 +129,7 @@ public class GPUUISceneNewtCanvasAWTDemo {
glp = GLProfile.getGL2ES2();
}
System.err.println("GLProfile: "+glp);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(4);
if( SceneMSAASamples > 0 ) {
caps.setSampleBuffers(true);
@@ -153,7 +153,7 @@ public class GPUUISceneNewtCanvasAWTDemo {
window.setSurfaceScale(reqSurfacePixelScale);
final int[] valReqSurfacePixelScale = window.getRequestedSurfaceScale(new int[2]);
- GPUUISceneGLListener0A sceneGLListener = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(GraphAutoMode, DEBUG, TRACE) :
+ final GPUUISceneGLListener0A sceneGLListener = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(GraphAutoMode, DEBUG, TRACE) :
new GPUUISceneGLListener0A(rmode, DEBUG, TRACE);
window.addGLEventListener(sceneGLListener);
@@ -164,7 +164,7 @@ public class GPUUISceneNewtCanvasAWTDemo {
animator.add(window);
window.addWindowListener(new WindowAdapter() {
- public void windowDestroyed(WindowEvent e) {
+ public void windowDestroyed(final WindowEvent e) {
animator.stop();
}
});
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo.java
index 15cf99f3b..16d56a041 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo.java
@@ -22,7 +22,7 @@ public class GPUUISceneNewtDemo {
static int[] reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
- public static void main(String[] args) {
+ public static void main(final String[] args) {
int width = 800, height = 400;
int x = 10, y = 10;
@@ -104,7 +104,7 @@ public class GPUUISceneNewtDemo {
glp = GLProfile.getGL2ES2();
}
System.err.println("GLProfile: "+glp);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(4);
if( SceneMSAASamples > 0 ) {
caps.setSampleBuffers(true);
@@ -128,7 +128,7 @@ public class GPUUISceneNewtDemo {
window.setSurfaceScale(reqSurfacePixelScale);
final int[] valReqSurfacePixelScale = window.getRequestedSurfaceScale(new int[2]);
- GPUUISceneGLListener0A sceneGLListener = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(GraphAutoMode, DEBUG, TRACE) :
+ final GPUUISceneGLListener0A sceneGLListener = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(GraphAutoMode, DEBUG, TRACE) :
new GPUUISceneGLListener0A(rmode, DEBUG, TRACE);
window.addGLEventListener(sceneGLListener);
@@ -139,7 +139,7 @@ public class GPUUISceneNewtDemo {
animator.add(window);
window.addWindowListener(new WindowAdapter() {
- public void windowDestroyed(WindowEvent e) {
+ public void windowDestroyed(final WindowEvent e) {
animator.stop();
}
});
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/MSAATool.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/MSAATool.java
index 3a4e3c4ce..d838e42e8 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/MSAATool.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/MSAATool.java
@@ -34,55 +34,55 @@ import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilitiesImmutable;
public class MSAATool {
- public static boolean glIsEnabled(GL gl, int name) {
+ public static boolean glIsEnabled(final GL gl, final int name) {
boolean isEnabled = false;
try {
isEnabled = gl.glIsEnabled(name);
- int glerr = gl.glGetError();
+ final int glerr = gl.glGetError();
if(GL.GL_NO_ERROR != glerr) {
System.err.println("glIsEnabled(0x"+Integer.toHexString(name)+") -> error 0x"+Integer.toHexString(glerr));
}
- } catch (Exception e) {
+ } catch (final Exception e) {
System.err.println("Caught exception: "+e.getMessage());
// e.printStackTrace();
}
return isEnabled;
}
- public static void dump(GLAutoDrawable drawable) {
- float[] vf = new float[] { 0f };
- byte[] vb = new byte[] { 0 };
- int[] vi = new int[] { 0, 0 };
+ public static void dump(final GLAutoDrawable drawable) {
+ final float[] vf = new float[] { 0f };
+ final byte[] vb = new byte[] { 0 };
+ final int[] vi = new int[] { 0, 0 };
System.out.println("GL MSAA SETUP:");
- GL2ES2 gl = drawable.getGL().getGL2ES2();
- GLCapabilitiesImmutable caps = drawable.getChosenGLCapabilities();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GLCapabilitiesImmutable caps = drawable.getChosenGLCapabilities();
System.out.println(" Caps realised "+caps);
System.out.println(" Caps sample buffers "+caps.getSampleBuffers()+", samples "+caps.getNumSamples());
- System.out.println(" GL MULTISAMPLE "+glIsEnabled(gl, GL2ES2.GL_MULTISAMPLE));
+ System.out.println(" GL MULTISAMPLE "+glIsEnabled(gl, GL.GL_MULTISAMPLE));
// sample buffers min 0, same as GLX_SAMPLE_BUFFERS_ARB or WGL_SAMPLE_BUFFERS_ARB
- gl.glGetIntegerv(GL2GL3.GL_SAMPLE_BUFFERS, vi, 0);
+ gl.glGetIntegerv(GL.GL_SAMPLE_BUFFERS, vi, 0);
// samples min 0
- gl.glGetIntegerv(GL2GL3.GL_SAMPLES, vi, 1);
+ gl.glGetIntegerv(GL.GL_SAMPLES, vi, 1);
System.out.println(" GL SAMPLE_BUFFERS "+vi[0]+", SAMPLES "+vi[1]);
System.out.println("GL CSAA SETUP:");
// default FALSE
- System.out.println(" GL SAMPLE COVERAGE "+glIsEnabled(gl, GL2GL3.GL_SAMPLE_COVERAGE));
+ System.out.println(" GL SAMPLE COVERAGE "+glIsEnabled(gl, GL.GL_SAMPLE_COVERAGE));
// default FALSE
- System.out.println(" GL SAMPLE_ALPHA_TO_COVERAGE "+glIsEnabled(gl, GL2GL3.GL_SAMPLE_ALPHA_TO_COVERAGE));
+ System.out.println(" GL SAMPLE_ALPHA_TO_COVERAGE "+glIsEnabled(gl, GL.GL_SAMPLE_ALPHA_TO_COVERAGE));
// default FALSE
- System.out.println(" GL SAMPLE_ALPHA_TO_ONE "+glIsEnabled(gl, GL2GL3.GL_SAMPLE_ALPHA_TO_ONE));
+ System.out.println(" GL SAMPLE_ALPHA_TO_ONE "+glIsEnabled(gl, GL.GL_SAMPLE_ALPHA_TO_ONE));
// default FALSE, value 1, invert false
- gl.glGetFloatv(GL2GL3.GL_SAMPLE_COVERAGE_VALUE, vf, 0);
- gl.glGetBooleanv(GL2GL3.GL_SAMPLE_COVERAGE_INVERT, vb, 0);
- System.out.println(" GL SAMPLE_COVERAGE "+glIsEnabled(gl, GL2GL3.GL_SAMPLE_COVERAGE) +
+ gl.glGetFloatv(GL.GL_SAMPLE_COVERAGE_VALUE, vf, 0);
+ gl.glGetBooleanv(GL.GL_SAMPLE_COVERAGE_INVERT, vb, 0);
+ System.out.println(" GL SAMPLE_COVERAGE "+glIsEnabled(gl, GL.GL_SAMPLE_COVERAGE) +
": SAMPLE_COVERAGE_VALUE "+vf[0]+
", SAMPLE_COVERAGE_INVERT "+vb[0]);
dumpBlend(gl);
}
- public static void dumpBlend(GL gl) {
- int[] vi = new int[] { 0, 0, 0, 0 };
+ public static void dumpBlend(final GL gl) {
+ final int[] vi = new int[] { 0, 0, 0, 0 };
gl.glGetIntegerv(GL.GL_BLEND, vi, 0);
gl.glGetIntegerv(GL.GL_BLEND_SRC_ALPHA, vi, 1);
gl.glGetIntegerv(GL.GL_BLEND_SRC_RGB, vi, 2);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/CrossHair.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/CrossHair.java
index 1056bb0f9..0086222dc 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/CrossHair.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/CrossHair.java
@@ -40,7 +40,7 @@ import com.jogamp.graph.geom.Vertex.Factory;
public class CrossHair extends UIShape {
private float width, height, lineWidth;
- public CrossHair(Factory<? extends Vertex> factory, int renderModes, float width, float height, float linewidth) {
+ public CrossHair(final Factory<? extends Vertex> factory, final int renderModes, final float width, final float height, final float linewidth) {
super(factory, renderModes);
this.width = width;
this.height = height;
@@ -51,7 +51,7 @@ public class CrossHair extends UIShape {
public final float getHeight() { return height; }
public final float getLineWidth() { return lineWidth; }
- public void setDimension(float width, float height, float lineWidth) {
+ public void setDimension(final float width, final float height, final float lineWidth) {
this.width = width;
this.height = height;
this.lineWidth = lineWidth;
@@ -59,15 +59,15 @@ public class CrossHair extends UIShape {
}
@Override
- protected void clearImpl(GL2ES2 gl, RegionRenderer renderer) {
+ protected void clearImpl(final GL2ES2 gl, final RegionRenderer renderer) {
}
@Override
- protected void destroyImpl(GL2ES2 gl, RegionRenderer renderer) {
+ protected void destroyImpl(final GL2ES2 gl, final RegionRenderer renderer) {
}
@Override
- protected void addShapeToRegion(GL2ES2 gl, RegionRenderer renderer) {
+ protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) {
final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory());
final float tw = getWidth();
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/GLEventListenerButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/GLEventListenerButton.java
index 6dada5f1e..bdbb77f2d 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/GLEventListenerButton.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/GLEventListenerButton.java
@@ -72,7 +72,7 @@ public class GLEventListenerButton extends TextureSeqButton {
this.fboHeight = fboHeight;
}
- public final void setAnimate(boolean v) { animateGLEL = v; }
+ public final void setAnimate(final boolean v) { animateGLEL = v; }
public final boolean getAnimate() { return animateGLEL; }
public final void setFBOSize(final int fboWidth, final int fboHeight) {
@@ -83,7 +83,7 @@ public class GLEventListenerButton extends TextureSeqButton {
public final GLOffscreenAutoDrawable.FBO getFBOAutoDrawable() { return fboGLAD; }
@Override
- public void drawShape(GL2ES2 gl, RegionRenderer renderer, int[] sampleCount) {
+ public void drawShape(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) {
if( null == fboGLAD ) {
final ImageSequence imgSeq = (ImageSequence)texSeq;
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/ImageSeqButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/ImageSeqButton.java
index ca6f79448..5d8e9e8db 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/ImageSeqButton.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/ImageSeqButton.java
@@ -54,7 +54,7 @@ public class ImageSeqButton extends TextureSeqButton {
}
@Override
- public void drawShape(GL2ES2 gl, RegionRenderer renderer, int[] sampleCount) {
+ public void drawShape(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) {
super.drawShape(gl, renderer, sampleCount);
if( !((ImageSequence)texSeq).getManualStepping() ) {
markStateDirty(); // keep on going
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java
index 175d18135..1181ef914 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java
@@ -43,7 +43,7 @@ public class Label extends UIShape {
protected float pixelSize;
protected String text;
- public Label(Factory<? extends Vertex> factory, int renderModes, Font font, float pixelSize, String text) {
+ public Label(final Factory<? extends Vertex> factory, final int renderModes, final Font font, final float pixelSize, final String text) {
super(factory, renderModes);
this.font = font;
this.pixelSize = pixelSize;
@@ -54,7 +54,7 @@ public class Label extends UIShape {
return text;
}
- public void setText(String text) {
+ public void setText(final String text) {
this.text = text;
markShapeDirty();
}
@@ -63,7 +63,7 @@ public class Label extends UIShape {
return font;
}
- public void setFont(Font font) {
+ public void setFont(final Font font) {
this.font = font;
markShapeDirty();
}
@@ -76,17 +76,17 @@ public class Label extends UIShape {
return font.getLineHeight(pixelSize);
}
- public void setPixelSize(float pixelSize) {
+ public void setPixelSize(final float pixelSize) {
this.pixelSize = pixelSize;
markShapeDirty();
}
@Override
- protected void clearImpl(GL2ES2 gl, RegionRenderer renderer) {
+ protected void clearImpl(final GL2ES2 gl, final RegionRenderer renderer) {
}
@Override
- protected void destroyImpl(GL2ES2 gl, RegionRenderer renderer) {
+ protected void destroyImpl(final GL2ES2 gl, final RegionRenderer renderer) {
}
private final float[] tmpV3 = new float[3];
@@ -95,7 +95,7 @@ public class Label extends UIShape {
private final TextRegionUtil.ShapeVisitor shapeVisitor = new TextRegionUtil.ShapeVisitor() {
@Override
- public void visit(OutlineShape shape, AffineTransform t) {
+ public void visit(final OutlineShape shape, final AffineTransform t) {
shape.setSharpness(shapesSharpness);
region.addOutlineShape(shape, t, rgbaColor);
box.resize(shape.getBounds(), t, tmpV3);
@@ -103,7 +103,7 @@ public class Label extends UIShape {
};
@Override
- protected void addShapeToRegion(GL2ES2 gl, RegionRenderer renderer) {
+ protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) {
TextRegionUtil.processString(shapeVisitor, null, font, pixelSize, text, tempT1, tempT2);
final float[] ctr = box.getCenter();
setRotationOrigin( ctr[0], ctr[1], ctr[2]);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label0.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label0.java
index 573dd5604..9a12b7175 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label0.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label0.java
@@ -41,7 +41,7 @@ public class Label0 {
protected final float[] rgbaColor;
protected final AABBox box;
- public Label0(Font font, String text, float[] rgbaColor) {
+ public Label0(final Font font, final String text, final float[] rgbaColor) {
this.font = font;
this.text = text;
this.rgbaColor = rgbaColor;
@@ -52,20 +52,20 @@ public class Label0 {
public final float[] getColor() { return rgbaColor; }
- public final void setColor(float r, float g, float b, float a) {
+ public final void setColor(final float r, final float g, final float b, final float a) {
this.rgbaColor[0] = r;
this.rgbaColor[1] = g;
this.rgbaColor[2] = b;
this.rgbaColor[3] = a;
}
- public final void setText(String text) {
+ public final void setText(final String text) {
this.text = text;
}
public final Font getFont() { return font; }
- public final void setFont(Font font) {
+ public final void setFont(final Font font) {
this.font = font;
}
@@ -77,7 +77,7 @@ public class Label0 {
private final TextRegionUtil.ShapeVisitor shapeVisitor = new TextRegionUtil.ShapeVisitor() {
@Override
- public void visit(OutlineShape shape, AffineTransform t) {
+ public void visit(final OutlineShape shape, final AffineTransform t) {
final AffineTransform t1 = t.preConcatenate(tLeft);
region.addOutlineShape(shape, t1, rgbaColor);
box.resize(shape.getBounds(), t1, tmpV3);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/LabelButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/LabelButton.java
index 0ac728e50..4943c9418 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/LabelButton.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/LabelButton.java
@@ -27,6 +27,7 @@
*/
package com.jogamp.opengl.test.junit.graph.demos.ui;
+import javax.media.opengl.GL;
import javax.media.opengl.GL2ES2;
import com.jogamp.graph.curve.OutlineShape;
@@ -64,20 +65,20 @@ public class LabelButton extends RoundButton {
}
@Override
- public void drawShape(GL2ES2 gl, RegionRenderer renderer, int[] sampleCount) {
+ public void drawShape(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) {
if( false ) {
// Setup poly offset for z-fighting
- gl.glEnable(GL2ES2.GL_POLYGON_OFFSET_FILL);
+ gl.glEnable(GL.GL_POLYGON_OFFSET_FILL);
gl.glPolygonOffset(0f, 1f);
super.drawShape(gl, renderer, sampleCount);
- gl.glDisable(GL2ES2.GL_POLYGON_OFFSET_FILL);
+ gl.glDisable(GL.GL_POLYGON_OFFSET_FILL);
} else {
super.drawShape(gl, renderer, sampleCount);
}
}
@Override
- protected void addShapeToRegion(GL2ES2 gl, RegionRenderer renderer) {
+ protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) {
final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory());
if(corner == 0.0f) {
createSharpOutline(shape, DEFAULT_2PASS_LABEL_ZOFFSET);
@@ -133,7 +134,7 @@ public class LabelButton extends RoundButton {
* @param spacingX spacing in percent on X, default is {@link #DEFAULT_SPACING_X}
* @param spacingY spacing in percent on Y, default is {@link #DEFAULT_SPACING_Y}
*/
- public final void setSpacing(float spacingX, float spacingY) {
+ public final void setSpacing(final float spacingX, final float spacingY) {
if ( spacingX < 0.0f ) {
this.spacingX = 0.0f;
} else if ( spacingX > 1.0f ) {
@@ -155,7 +156,7 @@ public class LabelButton extends RoundButton {
return label.getColor();
}
- public final void setLabelColor(float r, float g, float b) {
+ public final void setLabelColor(final float r, final float g, final float b) {
label.setColor(r, g, b, 1.0f);
markShapeDirty();
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/MediaPlayerButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/MediaPlayerButton.java
index 7ec653b62..76b70ddf8 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/MediaPlayerButton.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/MediaPlayerButton.java
@@ -73,12 +73,12 @@ public class MediaPlayerButton extends TextureSeqButton {
private final GLMediaEventListener defGLMediaEventListener = new GLMediaEventListener() {
@Override
- public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
+ public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) {
// texButton.markStateDirty();
}
@Override
- public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+ public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
final GLMediaPlayer mPlayer = (GLMediaPlayer)texSeq;
if( verbose ) {
System.err.println("MovieCube AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
@@ -107,12 +107,12 @@ public class MediaPlayerButton extends TextureSeqButton {
@Override
- protected void destroyImpl(GL2ES2 gl, RegionRenderer renderer) {
+ protected void destroyImpl(final GL2ES2 gl, final RegionRenderer renderer) {
((GLMediaPlayer)texSeq).destroy(gl);
}
@Override
- public void drawShape(GL2ES2 gl, RegionRenderer renderer, int[] sampleCount) {
+ public void drawShape(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) {
final GLMediaPlayer mPlayer = (GLMediaPlayer)texSeq;
if( GLMediaPlayer.State.Initialized == mPlayer.getState() ) {
try {
@@ -120,7 +120,7 @@ public class MediaPlayerButton extends TextureSeqButton {
mPlayer.setAudioVolume( 0f );
mPlayer.play();
markStateDirty();
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RoundButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RoundButton.java
index 2d7320f64..c455ea365 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RoundButton.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RoundButton.java
@@ -53,11 +53,11 @@ public abstract class RoundButton extends UIShape {
}
@Override
- protected void clearImpl(GL2ES2 gl, RegionRenderer renderer) {
+ protected void clearImpl(final GL2ES2 gl, final RegionRenderer renderer) {
}
@Override
- protected void destroyImpl(GL2ES2 gl, RegionRenderer renderer) {
+ protected void destroyImpl(final GL2ES2 gl, final RegionRenderer renderer) {
}
public final float getWidth() { return width; }
@@ -66,7 +66,7 @@ public abstract class RoundButton extends UIShape {
public final float getCorner() { return corner; }
- public void setDimension(float width, float height) {
+ public void setDimension(final float width, final float height) {
this.width = width;
this.height = height;
markShapeDirty();
@@ -115,7 +115,7 @@ public abstract class RoundButton extends UIShape {
}
/** Set corner size, default is {@link #DEFAULT_CORNER} */
- public void setCorner(float corner) {
+ public void setCorner(final float corner) {
if(corner > 1.0f){
this.corner = 1.0f;
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java
index 4581223d7..008d4e038 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java
@@ -54,7 +54,7 @@ public class SceneUIController implements GLEventListener{
this(null, sceneDist, zNear, zFar);
}
- public SceneUIController(RegionRenderer renderer, float sceneDist, float zNear, float zFar) {
+ public SceneUIController(final RegionRenderer renderer, final float sceneDist, final float zNear, final float zFar) {
this.renderer = renderer;
this.sceneDist = sceneDist;
this.zFar = zFar;
@@ -62,11 +62,11 @@ public class SceneUIController implements GLEventListener{
this.sampleCount[0] = 4;
}
- public void setRenderer(RegionRenderer renderer) {
+ public void setRenderer(final RegionRenderer renderer) {
this.renderer = renderer;
}
- public void attachInputListenerTo(GLWindow window) {
+ public void attachInputListenerTo(final GLWindow window) {
if(null == sbcMouseListener) {
sbcMouseListener = new SBCMouseListener();
window.addMouseListener(sbcMouseListener);
@@ -77,7 +77,7 @@ public class SceneUIController implements GLEventListener{
}
}
- public void detachInputListenerFrom(GLWindow window) {
+ public void detachInputListenerFrom(final GLWindow window) {
if(null != sbcMouseListener) {
window.removeMouseListener(sbcMouseListener);
sbcMouseListener = null;
@@ -91,15 +91,15 @@ public class SceneUIController implements GLEventListener{
public ArrayList<UIShape> getShapes() {
return shapes;
}
- public void addShape(UIShape b) {
+ public void addShape(final UIShape b) {
shapes.add(b);
}
- public void removeShape(UIShape b) {
+ public void removeShape(final UIShape b) {
shapes.remove(b);
}
public int getSampleCount() { return sampleCount[0]; }
- public void setSampleCount(int v) { sampleCount[0]=v; markAllShapesDirty(); }
+ public void setSampleCount(final int v) { sampleCount[0]=v; markAllShapesDirty(); }
public void setAllShapesQuality(final int q) {
for(int i=0; i<shapes.size(); i++) {
@@ -121,7 +121,7 @@ public class SceneUIController implements GLEventListener{
public final float[] getScenePlaneOrigin() { return scenePlaneOrigin; }
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
System.err.println("SceneUIController: init");
cDrawable = drawable;
}
@@ -171,7 +171,7 @@ public class SceneUIController implements GLEventListener{
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
@@ -209,7 +209,7 @@ public class SceneUIController implements GLEventListener{
}
cDrawable.invoke(false, new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
shape[0] = pickShapeImpl(glWinX, glWinY, objPos);
if( null != shape[0] ) {
runnable.run();
@@ -267,7 +267,7 @@ public class SceneUIController implements GLEventListener{
}
cDrawable.invoke(false, new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
if( windowToShapeCoordsImpl(activeShape, glWinX, glWinY, objPos) ) {
runnable.run();
}
@@ -294,7 +294,7 @@ public class SceneUIController implements GLEventListener{
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
System.err.println("SceneUIController: dispose");
final GL2ES2 gl = drawable.getGL().getGL2ES2();
for(int i=0; i<shapes.size(); i++) {
@@ -306,14 +306,14 @@ public class SceneUIController implements GLEventListener{
public static void mapWin2ObjectCoords(final PMVMatrix pmv, final int[] view,
final float zNear, final float zFar,
- float orthoX, float orthoY, float orthoDist,
+ final float orthoX, final float orthoY, final float orthoDist,
final float[] winZ, final float[] objPos) {
winZ[0] = FloatUtil.getOrthoWinZ(orthoDist, zNear, zFar);
pmv.gluUnProject(orthoX, orthoY, winZ[0], view, 0, objPos, 0);
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
viewport[0] = x;
viewport[1] = y;
viewport[2] = width;
@@ -448,7 +448,7 @@ public class SceneUIController implements GLEventListener{
}
@Override
- public void mouseReleased(MouseEvent e) {
+ public void mouseReleased(final MouseEvent e) {
// flip to GL window coordinates
final int glWinX = e.getX();
final int glWinY = viewport[3] - e.getY() - 1;
@@ -496,7 +496,7 @@ public class SceneUIController implements GLEventListener{
}
@Override
- public void mouseMoved(MouseEvent e) {
+ public void mouseMoved(final MouseEvent e) {
if( -1 == lId || e.getPointerId(0) == lId ) {
lx = e.getX();
ly = e.getY();
@@ -504,9 +504,9 @@ public class SceneUIController implements GLEventListener{
}
}
@Override
- public void mouseEntered(MouseEvent e) { }
+ public void mouseEntered(final MouseEvent e) { }
@Override
- public void mouseExited(MouseEvent e) {
+ public void mouseExited(final MouseEvent e) {
release();
clear();
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/TextureSeqButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/TextureSeqButton.java
index 2a5212566..25134edf6 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/TextureSeqButton.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/TextureSeqButton.java
@@ -57,7 +57,7 @@ public class TextureSeqButton extends RoundButton {
public final TextureSequence getTextureSequence() { return this.texSeq; }
@Override
- protected void addShapeToRegion(GL2ES2 gl, RegionRenderer renderer) {
+ protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) {
final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory());
if(corner == 0.0f) {
createSharpOutline(shape, 0f);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java
index c57f65567..65031d7a0 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java
@@ -45,7 +45,7 @@ import com.jogamp.opengl.util.PMVMatrix;
public class UIGLListener01 extends UIListenerBase01 {
- public UIGLListener01 (int renderModes, RenderState rs, boolean debug, boolean trace) {
+ public UIGLListener01 (final int renderModes, final RenderState rs, final boolean debug, final boolean trace) {
super(renderModes, RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable), debug, trace);
setMatrix(-20, 00, 0f, -50);
try {
@@ -59,28 +59,28 @@ public class UIGLListener01 extends UIListenerBase01 {
button.setSpacing(2.0f);
*/
System.err.println(button);
- } catch (IOException ex) {
+ } catch (final IOException ex) {
System.err.println("Caught: "+ex.getMessage());
ex.printStackTrace();
}
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
super.init(drawable);
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.setSwapInterval(1);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
- gl.glEnable(GL2ES2.GL_POLYGON_OFFSET_FILL);
+ gl.glEnable(GL.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_POLYGON_OFFSET_FILL);
MSAATool.dump(drawable);
}
@Override
- public void display(GLAutoDrawable drawable) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
@@ -99,7 +99,7 @@ public class UIGLListener01 extends UIListenerBase01 {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
button.destroy(gl, getRegionRenderer());
super.dispose(drawable);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIListenerBase01.java
index a2bc57a8b..796ed2513 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIListenerBase01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIListenerBase01.java
@@ -83,7 +83,7 @@ public abstract class UIListenerBase01 implements GLEventListener {
boolean ignoreInput = false;
- public UIListenerBase01(int renderModes, RegionRenderer rRenderer, boolean debug, boolean trace) {
+ public UIListenerBase01(final int renderModes, final RegionRenderer rRenderer, final boolean debug, final boolean trace) {
this.renderModes = renderModes;
this.rRenderer = rRenderer;
this.debug = debug;
@@ -98,14 +98,14 @@ public abstract class UIListenerBase01 implements GLEventListener {
public final float getAngle() { return ang; }
public final float[] getPosition() { return position; }
- public void setMatrix(float xtrans, float ytrans, float angle, int zoom) {
+ public void setMatrix(final float xtrans, final float ytrans, final float angle, final int zoom) {
this.xTran = xtrans;
this.yTran = ytrans;
this.ang = angle;
this.zoom = zoom;
}
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
autoDrawable = drawable;
GL2ES2 gl = drawable.getGL().getGL2ES2();
if(debug) {
@@ -118,32 +118,32 @@ public abstract class UIListenerBase01 implements GLEventListener {
getRegionRenderer().init(gl, renderModes);
}
- public void reshape(GLAutoDrawable drawable, int xstart, int ystart, int width, int height) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ public void reshape(final GLAutoDrawable drawable, final int xstart, final int ystart, final int width, final int height) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glViewport(xstart, ystart, width, height);
rRenderer.reshapePerspective(45.0f, width, height, 0.1f, 7000.0f);
dumpMatrix();
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
autoDrawable = null;
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
screenshot.dispose(gl);
rRenderer.destroy(gl);
}
- public void zoom(int v){
+ public void zoom(final int v){
zoom += v;
dumpMatrix();
}
- public void move(float x, float y){
+ public void move(final float x, final float y){
xTran += x;
yTran += y;
dumpMatrix();
}
- public void rotate(float delta){
+ public void rotate(final float delta){
ang += delta;
ang %= 360.0f;
dumpMatrix();
@@ -154,7 +154,7 @@ public abstract class UIListenerBase01 implements GLEventListener {
}
/** Attach the input listener to the window */
- public void attachInputListenerTo(GLWindow window) {
+ public void attachInputListenerTo(final GLWindow window) {
if ( null == keyAction ) {
keyAction = new KeyAction();
window.addKeyListener(keyAction);
@@ -165,7 +165,7 @@ public abstract class UIListenerBase01 implements GLEventListener {
}
}
- public void detachFrom(GLWindow window) {
+ public void detachFrom(final GLWindow window) {
if ( null == keyAction ) {
return;
}
@@ -177,9 +177,9 @@ public abstract class UIListenerBase01 implements GLEventListener {
window.removeMouseListener(mouseAction);
}
- public void printScreen(GLAutoDrawable drawable, String dir, String tech, String objName, boolean exportAlpha) throws GLException, IOException {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
+ public void printScreen(final GLAutoDrawable drawable, final String dir, final String tech, final String objName, final boolean exportAlpha) throws GLException, IOException {
+ final StringWriter sw = new StringWriter();
+ final PrintWriter pw = new PrintWriter(sw);
pw.printf("-%03dx%03d-Z%04d-T%04d-%s", drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), (int)Math.abs(zoom), 0, objName);
final String filename = dir + tech + sw +".png";
@@ -190,7 +190,7 @@ public abstract class UIListenerBase01 implements GLEventListener {
int screenshot_num = 0;
- public void setIgnoreInput(boolean v) {
+ public void setIgnoreInput(final boolean v) {
ignoreInput = v;
}
public boolean getIgnoreInput() {
@@ -199,37 +199,37 @@ public abstract class UIListenerBase01 implements GLEventListener {
public class MouseAction implements MouseListener{
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
}
- public void mouseEntered(MouseEvent e) {
+ public void mouseEntered(final MouseEvent e) {
}
- public void mouseExited(MouseEvent e) {
+ public void mouseExited(final MouseEvent e) {
}
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
button.setLabelColor(0.8f,0.8f,0.8f);
button.setColor(0.1f, 0.1f, 0.1f, 1.0f);
}
- public void mouseReleased(MouseEvent e) {
+ public void mouseReleased(final MouseEvent e) {
button.setLabelColor(1.0f,1.0f,1.0f);
button.setColor(0.6f,0.6f,0.6f, 1.0f);
}
- public void mouseMoved(MouseEvent e) {
+ public void mouseMoved(final MouseEvent e) {
// TODO Auto-generated method stub
}
- public void mouseDragged(MouseEvent e) {
+ public void mouseDragged(final MouseEvent e) {
// TODO Auto-generated method stub
}
- public void mouseWheelMoved(MouseEvent e) {
+ public void mouseWheelMoved(final MouseEvent e) {
// TODO Auto-generated method stub
}
@@ -237,7 +237,7 @@ public abstract class UIListenerBase01 implements GLEventListener {
}
public class KeyAction implements KeyListener {
- public void keyPressed(KeyEvent arg0) {
+ public void keyPressed(final KeyEvent arg0) {
if(ignoreInput) {
return;
}
@@ -285,8 +285,8 @@ public abstract class UIListenerBase01 implements GLEventListener {
else if(arg0.getKeyCode() == KeyEvent.VK_V) {
if(null != autoDrawable) {
autoDrawable.invoke(false, new GLRunnable() {
- public boolean run(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
+ public boolean run(final GLAutoDrawable drawable) {
+ final GL gl = drawable.getGL();
int i = gl.getSwapInterval();
i = i==0 ? 1 : 0;
gl.setSwapInterval(i);
@@ -304,14 +304,14 @@ public abstract class UIListenerBase01 implements GLEventListener {
rotate(-1);
if(null != autoDrawable) {
autoDrawable.invoke(false, new GLRunnable() {
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
try {
final String type = Region.getRenderModeString(renderModes);
printScreen(drawable, "./", "demo-"+type, "snap"+screenshot_num, false);
screenshot_num++;
- } catch (GLException e) {
+ } catch (final GLException e) {
e.printStackTrace();
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
return true;
@@ -320,6 +320,6 @@ public abstract class UIListenerBase01 implements GLEventListener {
}
}
}
- public void keyReleased(KeyEvent arg0) {}
+ public void keyReleased(final KeyEvent arg0) {}
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UINewtDemo01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UINewtDemo01.java
index 27a91befc..cd74f194c 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UINewtDemo01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UINewtDemo01.java
@@ -51,9 +51,9 @@ public class UINewtDemo01 {
static final boolean DEBUG = false;
static final boolean TRACE = false;
- public static void main(String[] args) {
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ public static void main(final String[] args) {
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(4);
caps.setSampleBuffers(true);
caps.setNumSamples(4);
@@ -63,8 +63,8 @@ public class UINewtDemo01 {
window.setPosition(10, 10);
window.setSize(800, 400);
window.setTitle("GPU UI Newt Demo 01");
- RenderState rs = RenderState.createRenderState(SVertex.factory());
- UIGLListener01 uiGLListener = new UIGLListener01 (0, rs, DEBUG, TRACE);
+ final RenderState rs = RenderState.createRenderState(SVertex.factory());
+ final UIGLListener01 uiGLListener = new UIGLListener01 (0, rs, DEBUG, TRACE);
uiGLListener.attachInputListenerTo(window);
window.addGLEventListener(uiGLListener);
window.setVisible(true);
@@ -74,14 +74,14 @@ public class UINewtDemo01 {
animator.add(window);
window.addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent arg0) {
+ public void keyPressed(final KeyEvent arg0) {
if(arg0.getKeyCode() == KeyEvent.VK_F4) {
window.destroy();
}
}
});
window.addWindowListener(new WindowAdapter() {
- public void windowDestroyed(WindowEvent e) {
+ public void windowDestroyed(final WindowEvent e) {
animator.stop();
}
});
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java
index e3513d40d..3b8c71ed0 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java
@@ -97,14 +97,14 @@ public abstract class UIShape {
public final Vertex.Factory<? extends Vertex> getVertexFactory() { return vertexFactory; }
public boolean isEnabled() { return enabled; }
- public void setEnabled(boolean v) { enabled = v; }
+ public void setEnabled(final boolean v) { enabled = v; }
/**
* Clears all data and reset all states as if this instance was newly created
* @param gl TODO
* @param renderer TODO\
*/
- public void clear(GL2ES2 gl, RegionRenderer renderer) {
+ public void clear(final GL2ES2 gl, final RegionRenderer renderer) {
clearImpl(gl, renderer);
translate[0] = 0f;
translate[1] = 0f;
@@ -125,7 +125,7 @@ public abstract class UIShape {
* @param gl
* @param renderer
*/
- public void destroy(GL2ES2 gl, RegionRenderer renderer) {
+ public void destroy(final GL2ES2 gl, final RegionRenderer renderer) {
destroyImpl(gl, renderer);
translate[0] = 0f;
translate[1] = 0f;
@@ -141,13 +141,13 @@ public abstract class UIShape {
markShapeDirty();
}
- public void setTranslate(float tx, float ty, float tz) {
+ public void setTranslate(final float tx, final float ty, final float tz) {
translate[0] = tx;
translate[1] = ty;
translate[2] = tz;
// System.err.println("UIShape.setTranslate: "+tx+"/"+ty+"/"+tz+": "+toString());
}
- public void translate(float tx, float ty, float tz) {
+ public void translate(final float tx, final float ty, final float tz) {
translate[0] += tx;
translate[1] += ty;
translate[2] += tz;
@@ -156,17 +156,17 @@ public abstract class UIShape {
public final float[] getTranslate() { return translate; }
public final Quaternion getRotation() { return rotation; }
public final float[] getRotationOrigin() { return rotOrigin; }
- public void setRotationOrigin(float rx, float ry, float rz) {
+ public void setRotationOrigin(final float rx, final float ry, final float rz) {
rotOrigin[0] = rx;
rotOrigin[1] = ry;
rotOrigin[2] = rz;
}
- public void setScale(float sx, float sy, float sz) {
+ public void setScale(final float sx, final float sy, final float sz) {
scale[0] = sx;
scale[1] = sy;
scale[2] = sz;
}
- public void scale(float sx, float sy, float sz) {
+ public void scale(final float sx, final float sy, final float sz) {
scale[0] *= sx;
scale[1] *= sy;
scale[2] *= sz;
@@ -190,7 +190,7 @@ public abstract class UIShape {
public final int getRenderModes() { return renderModes; }
- public GLRegion getRegion(GL2ES2 gl, RegionRenderer renderer) {
+ public GLRegion getRegion(final GL2ES2 gl, final RegionRenderer renderer) {
validate(gl, renderer);
return region;
}
@@ -204,7 +204,7 @@ public abstract class UIShape {
* @param renderer
* @param sampleCount
*/
- public void drawShape(GL2ES2 gl, RegionRenderer renderer, int[] sampleCount) {
+ public void drawShape(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) {
final float r, g, b, a;
final boolean isPressed = isPressed(), isToggleOn = isToggleOn();
final boolean modBaseColor = !Region.hasColorChannel( renderModes ) && !Region.hasColorTexture( renderModes );
@@ -271,7 +271,7 @@ public abstract class UIShape {
* @param gl
* @param renderer
*/
- public final void validate(GL2ES2 gl, RegionRenderer renderer) {
+ public final void validate(final GL2ES2 gl, final RegionRenderer renderer) {
if( isShapeDirty() || null == region ) {
box.reset();
if( null == region ) {
@@ -306,7 +306,7 @@ public abstract class UIShape {
region.setQuality(q);
}
}
- public final void setSharpness(float sharpness) {
+ public final void setSharpness(final float sharpness) {
this.shapesSharpness = sharpness;
markShapeDirty();
}
@@ -314,25 +314,25 @@ public abstract class UIShape {
return shapesSharpness;
}
- public final void setColor(float r, float g, float b, float a) {
+ public final void setColor(final float r, final float g, final float b, final float a) {
this.rgbaColor[0] = r;
this.rgbaColor[1] = g;
this.rgbaColor[2] = b;
this.rgbaColor[3] = a;
}
- public final void setPressedColorMod(float r, float g, float b, float a) {
+ public final void setPressedColorMod(final float r, final float g, final float b, final float a) {
this.pressedRGBAModulate[0] = r;
this.pressedRGBAModulate[1] = g;
this.pressedRGBAModulate[2] = b;
this.pressedRGBAModulate[3] = a;
}
- public final void setToggleOnColorMod(float r, float g, float b, float a) {
+ public final void setToggleOnColorMod(final float r, final float g, final float b, final float a) {
this.toggleOnRGBAModulate[0] = r;
this.toggleOnRGBAModulate[1] = g;
this.toggleOnRGBAModulate[2] = b;
this.toggleOnRGBAModulate[3] = a;
}
- public final void setToggleOffColorMod(float r, float g, float b, float a) {
+ public final void setToggleOffColorMod(final float r, final float g, final float b, final float a) {
this.toggleOffRGBAModulate[0] = r;
this.toggleOffRGBAModulate[1] = g;
this.toggleOffRGBAModulate[2] = b;
@@ -409,7 +409,7 @@ public abstract class UIShape {
*/
public static abstract class MouseGestureAdapter extends MouseAdapter implements MouseGestureListener {
@Override
- public void gestureDetected(GestureEvent gh) {
+ public void gestureDetected(final GestureEvent gh) {
}
}
@@ -522,7 +522,7 @@ public abstract class UIShape {
//
//
- protected OutlineShape createDebugOutline(OutlineShape shape, AABBox box) {
+ protected OutlineShape createDebugOutline(final OutlineShape shape, final AABBox box) {
final float tw = box.getWidth();
final float th = box.getHeight();
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/GLReadBuffer00Base.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/GLReadBuffer00Base.java
index f4504dbc7..26974eb30 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/GLReadBuffer00Base.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/GLReadBuffer00Base.java
@@ -72,13 +72,13 @@ public abstract class GLReadBuffer00Base extends UITestCase {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
regionFPS.destroy(drawable.getGL().getGL2ES2());
super.dispose(drawable);
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final String text = String.format("Frame %04d (%03d): %04dx%04d", frameNo, userCounter, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
System.err.println("TextRendererGLEL.display: "+text);
if( null != renderer ) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/InitConcurrentBaseNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/InitConcurrentBaseNEWT.java
index 00001d8d2..505e9a748 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/InitConcurrentBaseNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/InitConcurrentBaseNEWT.java
@@ -64,7 +64,7 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
@BeforeClass
public static void initClass() {
- Window dummyWindow = NewtFactory.createWindow(new Capabilities());
+ final Window dummyWindow = NewtFactory.createWindow(new Capabilities());
dummyWindow.setSize(demoWinSize, demoWinSize);
dummyWindow.setVisible(true);
Assert.assertEquals(true, dummyWindow.isVisible());
@@ -85,14 +85,14 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
private final boolean reuse;
private boolean done = false;
- public JOGLTask(Object postSync, int id, boolean reuse) {
+ public JOGLTask(final Object postSync, final int id, final boolean reuse) {
this.postSync = postSync;
this.id = id;
this.reuse = reuse;
}
public void run() {
- int x = ( id % num_x ) * ( demoWinSize + insets.getTotalHeight() );
- int y = ( (id / num_x) % num_y ) * ( demoWinSize + insets.getTotalHeight() );
+ final int x = ( id % num_x ) * ( demoWinSize + insets.getTotalHeight() );
+ final int y = ( (id / num_x) % num_y ) * ( demoWinSize + insets.getTotalHeight() );
System.err.println("JOGLTask "+id+": START: "+x+"/"+y+", reuse "+reuse+" - "+Thread.currentThread().getName());
final Display display = NewtFactory.createDisplay(null, reuse);
@@ -105,7 +105,7 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
glWindow.addGLEventListener(new ValidateLockListener());
glWindow.addGLEventListener(new GearsES2(0));
- Animator animator = new Animator(glWindow);
+ final Animator animator = new Animator(glWindow);
glWindow.setSize(demoWinSize, demoWinSize);
glWindow.setVisible(true);
@@ -123,7 +123,7 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
while(animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
try {
Thread.sleep(100);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -142,7 +142,7 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
public boolean done() { return done; }
}
- protected static boolean done(JOGLTask[] tasks) {
+ protected static boolean done(final JOGLTask[] tasks) {
for(int i=tasks.length-1; i>=0; i--) {
if(!tasks[i].done()) {
return false;
@@ -150,8 +150,8 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
}
return true;
}
- protected static String doneDump(JOGLTask[] tasks) {
- StringBuilder sb = new StringBuilder();
+ protected static String doneDump(final JOGLTask[] tasks) {
+ final StringBuilder sb = new StringBuilder();
sb.append("[");
for(int i=0; i<tasks.length; i++) {
if(i>0) {
@@ -163,7 +163,7 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
return sb.toString();
}
- protected static boolean isDead(Thread[] threads) {
+ protected static boolean isDead(final Thread[] threads) {
for(int i=threads.length-1; i>=0; i--) {
if(threads[i].isAlive()) {
return false;
@@ -171,8 +171,8 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
}
return true;
}
- protected static String isAliveDump(Thread[] threads) {
- StringBuilder sb = new StringBuilder();
+ protected static String isAliveDump(final Thread[] threads) {
+ final StringBuilder sb = new StringBuilder();
sb.append("[");
for(int i=0; i<threads.length; i++) {
if(i>0) {
@@ -184,7 +184,7 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
return sb.toString();
}
- protected void runJOGLTasks(int num, boolean reuse) throws InterruptedException {
+ protected void runJOGLTasks(final int num, final boolean reuse) throws InterruptedException {
System.err.println("InitConcurrentBaseNEWT "+num+" threads, reuse display: "+reuse);
final String currentThreadName = Thread.currentThread().getName();
final Object syncDone = new Object();
@@ -205,7 +205,7 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
while(!done(tasks)) {
try {
syncDone.wait(500);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
throw new RuntimeException(e);
}
System.err.println(i+": "+doneDump(tasks));
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java
index d8506a0d6..0913cd2a8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java
@@ -25,18 +25,18 @@ public class TestAWTCloseX11DisplayBug565 {
try {
for ( int j = 0; j < 10; j++ ) {
final int open0;
- if(NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(false)) {
+ if(NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(false)) {
open0 = X11Util.getOpenDisplayConnectionNumber();
} else {
open0 = 0;
}
-
- GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault( ) );
+
+ final GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault( ) );
final Frame frame = new Frame( "AWT Resource X11 Leak - #" + j );
-
+
final GLCanvas glCanvas = new GLCanvas( caps );
frame.add( glCanvas );
-
+
try {
javax.swing.SwingUtilities.invokeAndWait( new Runnable() {
public void run() {
@@ -45,7 +45,7 @@ public class TestAWTCloseX11DisplayBug565 {
}
} );
}
- catch ( Throwable t ) {
+ catch ( final Throwable t ) {
t.printStackTrace();
Assert.fail(t.getMessage());
}
@@ -59,7 +59,7 @@ public class TestAWTCloseX11DisplayBug565 {
}
} );
}
- catch ( Throwable t ) {
+ catch ( final Throwable t ) {
t.printStackTrace();
Assert.fail(t.getMessage());
}
@@ -74,16 +74,16 @@ public class TestAWTCloseX11DisplayBug565 {
}
}
}
- catch ( Exception e ) {
+ catch ( final Exception e ) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestAWTCloseX11DisplayBug565.class.getName());
}
-
+
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove01GLCanvasSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove01GLCanvasSwingAWT.java
index 8dfd93e47..87da6991a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove01GLCanvasSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove01GLCanvasSwingAWT.java
@@ -42,6 +42,7 @@ import javax.media.opengl.awt.GLCanvas;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
import jogamp.nativewindow.jawt.JAWTUtil;
@@ -100,7 +101,7 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
final JFrame jFrame1 = new JFrame("JFrame #"+num);
// jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+ jFrame1.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
jFrame1.getContentPane().add(jPanel[0]);
jFrame1.setSize(width, height);
@@ -145,7 +146,7 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
} } ) ;
}
- protected void runTestGL(boolean onscreen, GLCapabilities caps, int addRemoveOpCount)
+ protected void runTestGL(final boolean onscreen, final GLCapabilities caps, final int addRemoveOpCount)
throws AWTException, InterruptedException, InvocationTargetException
{
if(waitForKey) {
@@ -159,7 +160,7 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
if( !onscreen ) {
glc.setShallUseOffscreenLayer(true);
}
- Dimension glc_sz = new Dimension(width, height);
+ final Dimension glc_sz = new Dimension(width, height);
glc.setMinimumSize(glc_sz);
glc.setPreferredSize(glc_sz);
glc.setSize(glc_sz);
@@ -203,7 +204,7 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
System.err.println("No onscreen test requested or platform doesn't support onscreen rendering.");
return;
}
- GLCapabilities caps = new GLCapabilities(glpGL2ES2);
+ final GLCapabilities caps = new GLCapabilities(glpGL2ES2);
runTestGL(true, caps, addRemoveCount);
}
@@ -219,7 +220,7 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
System.err.println("Only PBuffer test is requested.");
return;
}
- GLCapabilities caps = new GLCapabilities(glpGL2ES2);
+ final GLCapabilities caps = new GLCapabilities(glpGL2ES2);
if(offscreenPBufferOnly) {
caps.setPBuffer(true);
caps.setOnscreen(true); // simulate normal behavior ..
@@ -239,19 +240,19 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
System.err.println("Only FBO test is requested.");
return;
}
- GLCapabilities caps = new GLCapabilities(glpGL2);
+ final GLCapabilities caps = new GLCapabilities(glpGL2);
caps.setPBuffer(true);
caps.setOnscreen(true); // simulate normal behavior ..
runTestGL(false, caps, addRemoveCount);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
durationPerTest = Long.parseLong(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-loops")) {
i++;
addRemoveCount = MiscUtils.atoi(args[i], addRemoveCount);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove02GLWindowNewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove02GLWindowNewtCanvasAWT.java
index be8dd3d46..7a26c0282 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove02GLWindowNewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove02GLWindowNewtCanvasAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import java.awt.AWTException;
@@ -42,6 +42,7 @@ import javax.media.opengl.awt.GLCanvas;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
import jogamp.nativewindow.jawt.JAWTUtil;
@@ -88,45 +89,45 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
@AfterClass
public static void releaseClass() {
}
-
- protected JPanel create(final JFrame[] top, final int width, final int height, final int num)
- throws InterruptedException, InvocationTargetException
+
+ protected JPanel create(final JFrame[] top, final int width, final int height, final int num)
+ throws InterruptedException, InvocationTargetException
{
final JPanel[] jPanel = new JPanel[] { null };
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
jPanel[0] = new JPanel();
jPanel[0].setLayout(new BorderLayout());
-
+
final JFrame jFrame1 = new JFrame("JFrame #"+num);
// jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+ jFrame1.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
jFrame1.getContentPane().add(jPanel[0]);
jFrame1.setSize(width, height);
-
+
top[0] = jFrame1;
} } );
- return jPanel[0];
+ return jPanel[0];
}
- protected void add(final Container cont, final Component comp)
- throws InterruptedException, InvocationTargetException
+ protected void add(final Container cont, final Component comp)
+ throws InterruptedException, InvocationTargetException
{
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- cont.add(comp, BorderLayout.CENTER);
+ cont.add(comp, BorderLayout.CENTER);
} } );
}
-
- protected void dispose(final GLCanvas glc)
- throws InterruptedException, InvocationTargetException
+
+ protected void dispose(final GLCanvas glc)
+ throws InterruptedException, InvocationTargetException
{
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- glc.destroy();
+ glc.destroy();
} } );
}
-
+
protected void setVisible(final JFrame jFrame, final boolean visible) throws InterruptedException, InvocationTargetException {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -135,54 +136,54 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
jFrame.validate();
}
jFrame.setVisible(visible);
- } } ) ;
+ } } ) ;
}
-
+
protected void dispose(final JFrame jFrame) throws InterruptedException, InvocationTargetException {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
jFrame.dispose();
- } } ) ;
+ } } ) ;
}
-
- protected void runTestGL(boolean onscreen, GLCapabilities caps, int addRemoveOpCount)
+
+ protected void runTestGL(final boolean onscreen, final GLCapabilities caps, final int addRemoveOpCount)
throws AWTException, InterruptedException, InvocationTargetException
{
for(int i=0; i<addRemoveOpCount; i++) {
System.err.println("Loop # "+i+" / "+addRemoveCount);
final GLWindow glw = GLWindow.create(caps);
- Assert.assertNotNull(glw);
+ Assert.assertNotNull(glw);
final NewtCanvasAWT glc = new NewtCanvasAWT(glw);
Assert.assertNotNull(glc);
if( !onscreen ) {
glc.setShallUseOffscreenLayer(true);
}
- Dimension glc_sz = new Dimension(width, height);
+ final Dimension glc_sz = new Dimension(width, height);
glc.setMinimumSize(glc_sz);
glc.setPreferredSize(glc_sz);
glc.setSize(glc_sz);
final GearsES2 gears = new GearsES2(1);
gears.setVerbose(false);
glw.addGLEventListener(gears);
-
+
final JFrame[] top = new JFrame[] { null };
final Container glcCont = create(top, width, height, i);
add(glcCont, glc);
-
+
setVisible(top[0], true);
-
+
final long t0 = System.currentTimeMillis();
do {
glw.display();
Thread.sleep(10);
} while ( ( System.currentTimeMillis() - t0 ) < durationPerTest ) ;
-
+
System.err.println("GLCanvas isOffscreenLayerSurfaceEnabled: "+glc.isOffscreenLayerSurfaceEnabled()+": "+glw.getChosenGLCapabilities());
-
+
dispose(top[0]);
glw.destroy();
-
+
if( 0 < pauseEach && 0 == i % pauseEach ) {
System.err.println("******* P A U S E ********");
Thread.sleep(pauseDuration);
@@ -190,7 +191,7 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
}
if(waitForKeyPost) {
UITestCase.waitForKey("End");
- }
+ }
}
@Test
@@ -201,7 +202,7 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
System.err.println("No onscreen test requested or platform doesn't support onscreen rendering.");
return;
}
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(true, caps, addRemoveCount);
}
@@ -217,10 +218,10 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
System.err.println("Only PBuffer test is requested.");
return;
}
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(false, caps, addRemoveCount);
}
-
+
@Test
public void test03OffscreenPBuffer()
throws AWTException, InterruptedException, InvocationTargetException
@@ -233,19 +234,19 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
System.err.println("Only FBO test is requested.");
return;
}
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setPBuffer(true);
caps.setOnscreen(true); // simulate normal behavior ..
runTestGL(false, caps, addRemoveCount);
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
durationPerTest = Long.parseLong(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-loops")) {
i++;
addRemoveCount = MiscUtils.atoi(args[i], addRemoveCount);
@@ -267,15 +268,15 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
waitForKey = true;
} else if(args[i].equals("-waitPost")) {
waitForKeyPost = true;
- }
+ }
}
System.err.println("waitForKey "+waitForKey);
System.err.println("waitForKeyPost "+waitForKeyPost);
-
+
System.err.println("addRemoveCount "+addRemoveCount);
System.err.println("pauseEach "+pauseEach);
- System.err.println("pauseDuration "+pauseDuration);
-
+ System.err.println("pauseDuration "+pauseDuration);
+
System.err.println("noOnscreenTest "+noOnscreenTest);
System.err.println("noOffscreenTest "+noOffscreenTest);
System.err.println("offscreenPBufferOnly "+offscreenPBufferOnly);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove03GLWindowNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove03GLWindowNEWT.java
index d99475442..70aa4dff3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove03GLWindowNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove03GLWindowNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import java.io.IOException;
@@ -71,33 +71,33 @@ public class TestAddRemove03GLWindowNEWT extends UITestCase {
@AfterClass
public static void releaseClass() {
}
-
- protected void runTestGL(GLCapabilities caps, int addRemoveOpCount)
+
+ protected void runTestGL(final GLCapabilities caps, final int addRemoveOpCount)
throws InterruptedException, InvocationTargetException
{
for(int i=0; i<addRemoveOpCount; i++) {
System.err.println("Loop # "+i+" / "+addRemoveCount);
final GLWindow glw = GLWindow.create(caps);
- Assert.assertNotNull(glw);
+ Assert.assertNotNull(glw);
glw.setTitle("GLWindow #"+i);
glw.setSize(width, height);
final GearsES2 gears = new GearsES2(1);
gears.setVerbose(false);
glw.addGLEventListener(gears);
-
+
glw.setVisible(true);
-
+
final long t0 = System.currentTimeMillis();
do {
glw.display();
Thread.sleep(10);
} while ( ( System.currentTimeMillis() - t0 ) < durationPerTest ) ;
-
+
System.err.println("GLWindow: "+glw.getChosenGLCapabilities());
-
+
glw.destroy();
-
+
if( 0 < pauseEach && 0 == i % pauseEach ) {
System.err.println("******* P A U S E ********");
Thread.sleep(pauseDuration);
@@ -109,17 +109,17 @@ public class TestAddRemove03GLWindowNEWT extends UITestCase {
public void test01Onscreen()
throws InterruptedException, InvocationTargetException
{
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, addRemoveCount);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
durationPerTest = Long.parseLong(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-loops")) {
i++;
addRemoveCount = MiscUtils.atoi(args[i], addRemoveCount);
@@ -131,14 +131,14 @@ public class TestAddRemove03GLWindowNEWT extends UITestCase {
pauseDuration = MiscUtils.atoi(args[i], pauseDuration);
} else if(args[i].equals("-wait")) {
waitForKey = true;
- }
+ }
}
System.err.println("waitForKey "+waitForKey);
-
+
System.err.println("addRemoveCount "+addRemoveCount);
System.err.println("pauseEach "+pauseEach);
- System.err.println("pauseDuration "+pauseDuration);
-
+ System.err.println("pauseDuration "+pauseDuration);
+
if(waitForKey) {
UITestCase.waitForKey("Start");
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext01NEWT.java
index d61ac9ab3..c17f669ee 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext01NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -47,12 +47,12 @@ import com.jogamp.opengl.util.Animator;
/**
* Tests simple recursive GLContext behavior.
- *
+ *
* <p>
* Issues {@link GLContext#makeCurrent()} and {@link GLContext#release()}
* from within {@link GLEventListener#display(GLAutoDrawable)}.
- * </p>
- *
+ * </p>
+ *
* <https://jogamp.org/bugzilla/show_bug.cgi?id=669>
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@@ -62,64 +62,64 @@ public class TestBug669RecursiveGLContext01NEWT extends UITestCase {
public void test01_Plain() {
test01Impl(false);
}
-
+
@Test(timeout=5000)
public void test01_Anim() {
test01Impl(true);
}
-
- private void test01Impl(boolean anim) {
+
+ private void test01Impl(final boolean anim) {
final String profile = GLProfile.GL2ES2;
if(!GLProfile.isAvailable(profile)) { System.err.println(profile+" n/a"); return; }
-
+
final GLProfile pro = GLProfile.get(profile);
final GLCapabilities caps = new GLCapabilities(pro);
final GLWindow window = GLWindow.create(caps);
-
+
final Animator animator = new Animator();
if(anim) {
animator.add(window);
}
animator.start();
- window.setSize(640, 480);
+ window.setSize(640, 480);
window.addGLEventListener(new GLEventListener() {
- private void makeCurrentRecursive(GLContextImpl context, int lockCount) {
+ private void makeCurrentRecursive(final GLContextImpl context, final int lockCount) {
Assert.assertEquals(true, context.isOwner(Thread.currentThread()));
Assert.assertEquals(lockCount, context.getLockCount());
Assert.assertEquals(true, context.isCurrent());
-
+
Assert.assertEquals(GLContext.CONTEXT_CURRENT, context.makeCurrent()); // recursive: lock +1
-
+
Assert.assertEquals(true, context.isOwner(Thread.currentThread()));
Assert.assertEquals(lockCount+1, context.getLockCount());
Assert.assertEquals(true, context.isCurrent());
}
- private void releaseRecursive(GLContextImpl context, int lockCount) {
+ private void releaseRecursive(final GLContextImpl context, final int lockCount) {
Assert.assertEquals(true, context.isOwner(Thread.currentThread()));
Assert.assertEquals(lockCount, context.getLockCount());
Assert.assertEquals(true, context.isCurrent()); // still current
-
+
context.release(); // recursive: lock -1
-
+
Assert.assertEquals(true, context.isOwner(Thread.currentThread()));
Assert.assertEquals(lockCount-1, context.getLockCount());
Assert.assertEquals(true, context.isCurrent()); // still current
}
-
+
public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
public void init(final GLAutoDrawable drawable) { }
public void dispose(final GLAutoDrawable drawable) { }
- public void display(final GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GLContextImpl context = (GLContextImpl)drawable.getContext();
makeCurrentRecursive(context, 1);
releaseRecursive(context, 2);
}
});
- window.addGLEventListener(new GearsES2());
+ window.addGLEventListener(new GearsES2());
try {
window.setVisible(true);
@@ -129,10 +129,10 @@ public class TestBug669RecursiveGLContext01NEWT extends UITestCase {
window.destroy();
}
}
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestBug669RecursiveGLContext01NEWT.class.getName());
}
-
+
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext02NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext02NEWT.java
index d83101659..54afe9143 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext02NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -45,12 +45,12 @@ import com.jogamp.opengl.util.Animator;
/**
* Tests recursive GLContext behavior.
- *
+ *
* <p>
- * Issues {@link GLAutoDrawable#display()} of another {@link GLAutoDrawable}
+ * Issues {@link GLAutoDrawable#display()} of another {@link GLAutoDrawable}
* from within {@link GLEventListener#display(GLAutoDrawable)}.
* </p>
- *
+ *
* <https://jogamp.org/bugzilla/show_bug.cgi?id=669>
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@@ -60,26 +60,26 @@ public class TestBug669RecursiveGLContext02NEWT extends UITestCase {
public void test01_Plain() {
test01Impl(false);
}
-
+
@Test(timeout=5000)
public void test01_Anim() {
test01Impl(true);
}
-
- private void test01Impl(boolean anim) {
+
+ private void test01Impl(final boolean anim) {
final String profile = GLProfile.GL2ES2;
if(!GLProfile.isAvailable(profile)) { System.err.println(profile+" n/a"); return; }
-
+
final GLProfile pro = GLProfile.get(profile);
final GLCapabilities caps = new GLCapabilities(pro);
-
+
final GLWindow window2 = GLWindow.create(caps); // display() triggered by window's GLEventListener!
window2.setPosition(0, 0);
window2.setSize(200, 200);
window2.addGLEventListener(new RedSquareES2());
-
+
final GLWindow window1 = GLWindow.create(caps);
-
+
final Animator animator1 = new Animator();
final Animator animator2 = new Animator();
if(anim) {
@@ -112,11 +112,11 @@ public class TestBug669RecursiveGLContext02NEWT extends UITestCase {
if(anim) {
try {
Thread.sleep(500);
- } catch(InterruptedException ie) {}
+ } catch(final InterruptedException ie) {}
}
} finally {
animator1.stop();
-
+
final int win1Frames = window1.getTotalFPSFrames();
final int win2Frames = window2.getTotalFPSFrames();
System.err.println("Window1: frames "+win1Frames);
@@ -126,10 +126,10 @@ public class TestBug669RecursiveGLContext02NEWT extends UITestCase {
window2.destroy();
}
}
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestBug669RecursiveGLContext02NEWT.class.getName());
}
-
+
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug692GL3VAONEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug692GL3VAONEWT.java
index 5337b64a0..0a9ff5a28 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug692GL3VAONEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug692GL3VAONEWT.java
@@ -33,6 +33,8 @@ import java.nio.ShortBuffer;
import java.util.logging.Level;
import java.util.logging.Logger;
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
import javax.media.opengl.GL3;
import javax.media.opengl.GL3bc;
import javax.media.opengl.GLAutoDrawable;
@@ -83,7 +85,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
public enum Mode {
CPU_SRC {
@Override
- void display(GL3VAODemo t, GL3bc gl) {
+ void display(final GL3VAODemo t, final GL3bc gl) {
t.displayCPUSourcing(gl);
}
},
@@ -91,7 +93,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
/** Traditional one without using VAO */
VBO_ONLY {
@Override
- void display(GL3VAODemo t, GL3bc gl) {
+ void display(final GL3VAODemo t, final GL3bc gl) {
t.displayVBOOnly(gl);
}
},
@@ -99,7 +101,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
/** Using VAOs throws [incorrectly as of JOGL 2.0rc11] a GLException */
VBO_VAO {
@Override
- void display(GL3VAODemo t, GL3bc gl) {
+ void display(final GL3VAODemo t, final GL3bc gl) {
t.displayVBOVAO(gl);
}
};
@@ -111,7 +113,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
private Mode currentMode;
private int currentModeIdx;
- public GL3VAODemo(Mode[] modes) {
+ public GL3VAODemo(final Mode[] modes) {
allModes = modes;
currentMode = allModes[0];
currentModeIdx = 0;
@@ -136,11 +138,11 @@ public class TestBug692GL3VAONEWT extends UITestCase {
private int vao = -1;
- private static int createShader(final GL3 gl, int type,
+ private static int createShader(final GL3 gl, final int type,
final String[] srcLines){
- int shaderID = gl.glCreateShader(type);
+ final int shaderID = gl.glCreateShader(type);
assert shaderID > 0;
- int[] lengths = new int[srcLines.length];
+ final int[] lengths = new int[srcLines.length];
for (int i = 0; i < srcLines.length; i++) {
lengths[i] = srcLines[i].length();
}
@@ -149,28 +151,28 @@ public class TestBug692GL3VAONEWT extends UITestCase {
return shaderID;
}
- private void initBuffers(GL3 gl) {
+ private void initBuffers(final GL3 gl) {
// IDs for 2 buffers
- int[] buffArray = new int[2];
+ final int[] buffArray = new int[2];
gl.glGenBuffers(buffArray.length, buffArray, 0);
vbo = buffArray[0];
assert vbo > 0;
// Bind buffer and upload data
- gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, vbo);
- gl.glBufferData(GL3.GL_ARRAY_BUFFER, vertexColorData.length * Buffers.SIZEOF_FLOAT,
- vertexColorDataBuffer, GL3.GL_STATIC_DRAW);
- gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, 0);
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo);
+ gl.glBufferData(GL.GL_ARRAY_BUFFER, vertexColorData.length * Buffers.SIZEOF_FLOAT,
+ vertexColorDataBuffer, GL.GL_STATIC_DRAW);
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
// Buffer with the 3 indices required for one triangle
ibo = buffArray[1];
assert ibo > 0;
- gl.glBindBuffer(GL3.GL_ELEMENT_ARRAY_BUFFER, ibo);
- gl.glBufferData(GL3.GL_ELEMENT_ARRAY_BUFFER,indices.length*Buffers.SIZEOF_SHORT,
- indicesBuffer, GL3.GL_STATIC_DRAW);
- gl.glBindBuffer(GL3.GL_ELEMENT_ARRAY_BUFFER, 0);
+ gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, ibo);
+ gl.glBufferData(GL.GL_ELEMENT_ARRAY_BUFFER,indices.length*Buffers.SIZEOF_SHORT,
+ indicesBuffer, GL.GL_STATIC_DRAW);
+ gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
}
- private void initShaders(GL3 gl) {
+ private void initShaders(final GL3 gl) {
final String[] vertSrc = new String[]{
"#version 150\n",
"in vec4 vPosition;\n",
@@ -181,7 +183,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
" gl_Position = vPosition;\n",
"}\n"
};
- vertID = createShader(gl, GL3.GL_VERTEX_SHADER, vertSrc);
+ vertID = createShader(gl, GL2ES2.GL_VERTEX_SHADER, vertSrc);
final String[] fragSrc = new String[]{
"#version 150\n",
@@ -190,7 +192,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
" gl_FragColor = pColor;\n",
"}\n"
};
- fragID = createShader(gl, GL3.GL_FRAGMENT_SHADER, fragSrc);
+ fragID = createShader(gl, GL2ES2.GL_FRAGMENT_SHADER, fragSrc);
// We're done with the compiler
gl.glReleaseShaderCompiler();
@@ -203,10 +205,10 @@ public class TestBug692GL3VAONEWT extends UITestCase {
gl.glValidateProgram(progID);
}
- private int initVAO(GL3 gl) {
- int[] buff = new int[1];
+ private int initVAO(final GL3 gl) {
+ final int[] buff = new int[1];
gl.glGenVertexArrays(1, buff, 0);
- int vao = buff[0];
+ final int vao = buff[0];
Assert.assertTrue("Invalid VAO: "+vao, vao > 0);
@@ -216,29 +218,29 @@ public class TestBug692GL3VAONEWT extends UITestCase {
gl.glUseProgram(0);
gl.glBindVertexArray(vao);
- gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, vbo);
- gl.glBindBuffer(GL3.GL_ELEMENT_ARRAY_BUFFER, ibo);
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo);
+ gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, ibo);
gl.glEnableVertexAttribArray(posLoc);
gl.glEnableVertexAttribArray(colorLoc);
final int stride = 6 * Buffers.SIZEOF_FLOAT;
final int cOff = 3 * Buffers.SIZEOF_FLOAT;
- gl.glVertexAttribPointer(posLoc, 3, GL3.GL_FLOAT, false, stride, 0L);
- gl.glVertexAttribPointer(colorLoc,3, GL3.GL_FLOAT, false, stride, cOff);
+ gl.glVertexAttribPointer(posLoc, 3, GL.GL_FLOAT, false, stride, 0L);
+ gl.glVertexAttribPointer(colorLoc,3, GL.GL_FLOAT, false, stride, cOff);
gl.glBindVertexArray(0);
// See class documentation above!
- gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, 0);
- gl.glBindBuffer(GL3.GL_ELEMENT_ARRAY_BUFFER, 0);
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+ gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
return vao;
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
final GL3 gl = drawable.getGL().getGL3();
- gl.glEnable(GL3.GL_DEPTH_TEST);
- gl.glDisable(GL3.GL_CULL_FACE);
+ gl.glEnable(GL.GL_DEPTH_TEST);
+ gl.glDisable(GL.GL_CULL_FACE);
initBuffers(gl);
initShaders(gl);
@@ -248,7 +250,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
final GL3 gl = drawable.getGL().getGL3();
gl.glDeleteBuffers(2, new int[]{vbo, ibo}, 0);
gl.glDetachShader(progID, fragID);
@@ -266,12 +268,12 @@ public class TestBug692GL3VAONEWT extends UITestCase {
final int stride = 6 * Buffers.SIZEOF_FLOAT;
// final int cOff = 3 * Buffers.SIZEOF_FLOAT;
- gl.glVertexAttribPointer(posLoc, 3, GL3.GL_FLOAT, false, stride, vertexColorDataBuffer);
+ gl.glVertexAttribPointer(posLoc, 3, GL.GL_FLOAT, false, stride, vertexColorDataBuffer);
vertexColorDataBuffer.position(3); // move to cOff
- gl.glVertexAttribPointer(colorLoc,3, GL3.GL_FLOAT, false, stride, vertexColorDataBuffer);
+ gl.glVertexAttribPointer(colorLoc,3, GL.GL_FLOAT, false, stride, vertexColorDataBuffer);
vertexColorDataBuffer.position(0); // rewind cOff
- gl.glDrawElements(GL3.GL_TRIANGLES, 3, GL3.GL_UNSIGNED_SHORT, indicesBuffer);
+ gl.glDrawElements(GL.GL_TRIANGLES, 3, GL.GL_UNSIGNED_SHORT, indicesBuffer);
gl.glDisableVertexAttribArray(posLoc);
gl.glDisableVertexAttribArray(colorLoc);
@@ -283,36 +285,36 @@ public class TestBug692GL3VAONEWT extends UITestCase {
gl.glEnableVertexAttribArray(posLoc);
gl.glEnableVertexAttribArray(colorLoc);
- gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, vbo);
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo);
final int stride = 6 * Buffers.SIZEOF_FLOAT;
final int cOff = 3 * Buffers.SIZEOF_FLOAT;
- gl.glVertexAttribPointer(posLoc, 3, GL3.GL_FLOAT, false, stride, 0L);
- gl.glVertexAttribPointer(colorLoc,3, GL3.GL_FLOAT, false, stride, cOff);
- gl.glBindBuffer(GL3.GL_ELEMENT_ARRAY_BUFFER, ibo);
- gl.glDrawElements(GL3.GL_TRIANGLES, 3, GL3.GL_UNSIGNED_SHORT, 0L);
+ gl.glVertexAttribPointer(posLoc, 3, GL.GL_FLOAT, false, stride, 0L);
+ gl.glVertexAttribPointer(colorLoc,3, GL.GL_FLOAT, false, stride, cOff);
+ gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, ibo);
+ gl.glDrawElements(GL.GL_TRIANGLES, 3, GL.GL_UNSIGNED_SHORT, 0L);
gl.glDisableVertexAttribArray(posLoc);
gl.glDisableVertexAttribArray(colorLoc);
- gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, 0);
- gl.glBindBuffer(GL3.GL_ELEMENT_ARRAY_BUFFER, 0);
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+ gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
}
private void displayVBOVAO(final GL3 gl) {
try {
gl.glBindVertexArray(vao);
- gl.glDrawElements(GL3.GL_TRIANGLES, 3, GL3.GL_UNSIGNED_SHORT, 0L);
+ gl.glDrawElements(GL.GL_TRIANGLES, 3, GL.GL_UNSIGNED_SHORT, 0L);
gl.glBindVertexArray(0);
- } catch (GLException ex) {
+ } catch (final GLException ex) {
Logger.getLogger(TestBug692GL3VAONEWT.class.getName()).log(Level.SEVERE,null,ex);
}
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GL3bc gl = drawable.getGL().getGL3bc();
- float color = ((float) currentMode.ordinal() + 1) / (Mode.values().length + 2);
+ final float color = ((float) currentMode.ordinal() + 1) / (Mode.values().length + 2);
gl.glClearColor(color, color, color, 0);
- gl.glClear(GL3.GL_COLOR_BUFFER_BIT | GL3.GL_DEPTH_BUFFER_BIT);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glUseProgram(progID);
final Mode newMode;
{
@@ -328,18 +330,18 @@ public class TestBug692GL3VAONEWT extends UITestCase {
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int w, final int h) {
}
}
- private void testImpl(GLProfile profile, GL3VAODemo.Mode[] modes) throws InterruptedException {
+ private void testImpl(final GLProfile profile, final GL3VAODemo.Mode[] modes) throws InterruptedException {
final GLCapabilities capabilities = new GLCapabilities(profile);
final GLWindow glWindow = GLWindow.create(capabilities);
glWindow.setSize(512, 512);
- Animator anim = new Animator(glWindow);
+ final Animator anim = new Animator(glWindow);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
glWindow.addKeyListener(quitAdapter);
glWindow.addWindowListener(quitAdapter);
@@ -365,7 +367,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
System.err.println("GL3bc n/a");
return;
}
- GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC };
+ final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC };
testImpl(GLProfile.get(GLProfile.GL3bc), modes);
}
@@ -375,7 +377,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
System.err.println("GL3bc n/a");
return;
}
- GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.VBO_ONLY };
+ final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.VBO_ONLY };
testImpl(GLProfile.get(GLProfile.GL3bc), modes);
}
@@ -385,7 +387,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
System.err.println("GL3bc n/a");
return;
}
- GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.VBO_VAO };
+ final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.VBO_VAO };
testImpl(GLProfile.get(GLProfile.GL3bc), modes);
}
@@ -395,7 +397,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
System.err.println("GL3bc n/a");
return;
}
- GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC, GL3VAODemo.Mode.VBO_ONLY };
+ final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC, GL3VAODemo.Mode.VBO_ONLY };
testImpl(GLProfile.get(GLProfile.GL3bc), modes);
}
@@ -405,7 +407,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
System.err.println("GL3bc n/a");
return;
}
- GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC, GL3VAODemo.Mode.VBO_VAO };
+ final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC, GL3VAODemo.Mode.VBO_VAO };
testImpl(GLProfile.get(GLProfile.GL3bc), modes);
}
@@ -415,7 +417,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
System.err.println("GL3bc n/a");
return;
}
- GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.VBO_ONLY, GL3VAODemo.Mode.VBO_VAO };
+ final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.VBO_ONLY, GL3VAODemo.Mode.VBO_VAO };
testImpl(GLProfile.get(GLProfile.GL3bc), modes);
}
@@ -425,17 +427,17 @@ public class TestBug692GL3VAONEWT extends UITestCase {
System.err.println("GL3bc n/a");
return;
}
- GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC, GL3VAODemo.Mode.VBO_ONLY, GL3VAODemo.Mode.VBO_VAO };
+ final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC, GL3VAODemo.Mode.VBO_ONLY, GL3VAODemo.Mode.VBO_VAO };
testImpl(GLProfile.get(GLProfile.GL3bc), modes);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
duration = MiscUtils.atoi(args[++i], (int)duration);
}
}
- String tstname = TestBug692GL3VAONEWT.class.getName();
+ final String tstname = TestBug692GL3VAONEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestCPUSourcingAPINEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestCPUSourcingAPINEWT.java
index 388c57904..fe598db35 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestCPUSourcingAPINEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestCPUSourcingAPINEWT.java
@@ -36,6 +36,7 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.util.GLBuffers;
+import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLAutoDrawable;
@@ -71,11 +72,11 @@ public class TestCPUSourcingAPINEWT extends UITestCase {
private int fragID = -1;
private int progID = -1;
- private static int createShader(final GL2ES2 gl, int type,
+ private static int createShader(final GL2ES2 gl, final int type,
final String[] srcLines){
- int shaderID = gl.glCreateShader(type);
+ final int shaderID = gl.glCreateShader(type);
assert shaderID > 0;
- int[] lengths = new int[srcLines.length];
+ final int[] lengths = new int[srcLines.length];
for (int i = 0; i < srcLines.length; i++) {
lengths[i] = srcLines[i].length();
}
@@ -84,7 +85,7 @@ public class TestCPUSourcingAPINEWT extends UITestCase {
return shaderID;
}
- private void initShaders(GL2ES2 gl) {
+ private void initShaders(final GL2ES2 gl) {
final String[] vertSrc = new String[]{
"#version 150\n",
"in vec4 vPosition;\n",
@@ -118,17 +119,17 @@ public class TestCPUSourcingAPINEWT extends UITestCase {
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
- gl.glDisable(GL2ES2.GL_CULL_FACE);
+ gl.glEnable(GL.GL_DEPTH_TEST);
+ gl.glDisable(GL.GL_CULL_FACE);
initShaders(gl);
gl.setSwapInterval(1);
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glDetachShader(progID, fragID);
gl.glDetachShader(progID, vertID);
@@ -145,22 +146,22 @@ public class TestCPUSourcingAPINEWT extends UITestCase {
final int stride = 6 * Buffers.SIZEOF_FLOAT;
// final int cOff = 3 * Buffers.SIZEOF_FLOAT;
- gl.glVertexAttribPointer(posLoc, 3, GL2ES2.GL_FLOAT, false, stride, vertexColorDataBuffer);
+ gl.glVertexAttribPointer(posLoc, 3, GL.GL_FLOAT, false, stride, vertexColorDataBuffer);
vertexColorDataBuffer.position(3); // move to cOff
- gl.glVertexAttribPointer(colorLoc,3, GL2ES2.GL_FLOAT, false, stride, vertexColorDataBuffer);
+ gl.glVertexAttribPointer(colorLoc,3, GL.GL_FLOAT, false, stride, vertexColorDataBuffer);
vertexColorDataBuffer.position(0); // rewind cOff
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, 3, GL2ES2.GL_UNSIGNED_SHORT, indicesBuffer);
+ gl.glDrawElements(GL.GL_TRIANGLES, 3, GL.GL_UNSIGNED_SHORT, indicesBuffer);
gl.glDisableVertexAttribArray(posLoc);
gl.glDisableVertexAttribArray(colorLoc);
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glClearColor(0x44, 0x44, 0x44, 0);
- gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT | GL2ES2.GL_DEPTH_BUFFER_BIT);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glUseProgram(progID);
// Hard casting is of course invalid!
@@ -171,14 +172,14 @@ public class TestCPUSourcingAPINEWT extends UITestCase {
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int w, final int h) {
}
}
- private void testImpl(GLProfile profile) throws InterruptedException {
+ private void testImpl(final GLProfile profile) throws InterruptedException {
final GLCapabilities capabilities = new GLCapabilities(profile);
- GLDrawableFactory factory = GLDrawableFactory.getFactory(profile);
- GLOffscreenAutoDrawable glad = factory.createOffscreenAutoDrawable(null, capabilities, null, 512, 512);
+ final GLDrawableFactory factory = GLDrawableFactory.getFactory(profile);
+ final GLOffscreenAutoDrawable glad = factory.createOffscreenAutoDrawable(null, capabilities, null, 512, 512);
final Demo vaoTest = new Demo();
glad.addGLEventListener(vaoTest);
@@ -206,14 +207,14 @@ public class TestCPUSourcingAPINEWT extends UITestCase {
GLException exp = null;
try {
testImpl(glp);
- } catch(GLException gle) {
+ } catch(final GLException gle) {
exp = gle;
System.err.println("Expected Exception: "+exp.getMessage());
}
Assert.assertNotNull("Excpected GLException missing due to CPU Sourcing w/ GL3 core context", exp);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableDeadlockAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableDeadlockAWT.java
index 1548c08b5..2559fe363 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableDeadlockAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableDeadlockAWT.java
@@ -60,7 +60,7 @@ public class TestFBOAutoDrawableDeadlockAWT extends UITestCase {
height = 512;
}
- protected void runTestGL( GLCapabilities caps ) throws InterruptedException, InvocationTargetException {
+ protected void runTestGL( final GLCapabilities caps ) throws InterruptedException, InvocationTargetException {
final GLOffscreenAutoDrawable fbod = GLDrawableFactory.getFactory(caps.getGLProfile()).createOffscreenAutoDrawable(
null, caps, new DefaultGLCapabilitiesChooser(), 512, 512);
@@ -88,7 +88,7 @@ public class TestFBOAutoDrawableDeadlockAWT extends UITestCase {
System.err.println("BB.2");
rTask.getSyncObject().wait();
System.err.println("BB.3");
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
throw new RuntimeException(e);
}
System.err.println("BB.X");
@@ -104,20 +104,20 @@ public class TestFBOAutoDrawableDeadlockAWT extends UITestCase {
@Test(timeout = 2000) // 2s timeout
public void testDeadlock() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities( glp );
+ final GLCapabilities caps = new GLCapabilities( glp );
runTestGL( caps );
}
static long duration = 500; // ms
- public static void main( String args[] ) {
+ public static void main( final String args[] ) {
for ( int i = 0; i < args.length; i++ ) {
if ( args[ i ].equals( "-time" ) ) {
i++;
try {
duration = Integer.parseInt( args[ i ] );
}
- catch ( Exception ex ) {
+ catch ( final Exception ex ) {
ex.printStackTrace();
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java
index 387000b16..a0a5e8969 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java
@@ -141,7 +141,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
}
}
- void testGLFBODrawableImpl(GLCapabilities caps, GLEventListener demo) throws InterruptedException {
+ void testGLFBODrawableImpl(final GLCapabilities caps, final GLEventListener demo) throws InterruptedException {
caps.setFBO(true);
final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
final GLOffscreenAutoDrawable.FBO glad = (GLOffscreenAutoDrawable.FBO)
@@ -233,24 +233,24 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
if( chosenCaps.getNumSamples() > 0 ) {
// MSAA
- FBObject _fboFront = glad.getFBObject(GL.GL_FRONT);
- FBObject _fboBack = glad.getFBObject(GL.GL_BACK);
+ final FBObject _fboFront = glad.getFBObject(GL.GL_FRONT);
+ final FBObject _fboBack = glad.getFBObject(GL.GL_BACK);
Assert.assertTrue("FBO are not equal: "+fboFront+" != "+_fboFront, fboFront.equals(_fboFront));
Assert.assertSame(fboFront, _fboFront);
Assert.assertTrue("FBO are not equal: "+fboBack+" != "+_fboBack, fboBack.equals(_fboBack));
Assert.assertSame(fboBack, _fboBack);
} else if( chosenCaps.getDoubleBuffered() ) {
// real double buffer
- FBObject _fboFront = glad.getFBObject(GL.GL_FRONT);
- FBObject _fboBack = glad.getFBObject(GL.GL_BACK);
+ final FBObject _fboFront = glad.getFBObject(GL.GL_FRONT);
+ final FBObject _fboBack = glad.getFBObject(GL.GL_BACK);
Assert.assertTrue("FBO are not equal: "+fboBack+" != "+_fboFront, fboBack.equals(_fboFront));
Assert.assertSame(fboBack, _fboFront);
Assert.assertTrue("FBO are not equal: "+fboFront+" != "+_fboBack, fboFront.equals(_fboBack));
Assert.assertSame(fboFront, _fboBack);
} else {
// single buffer
- FBObject _fboFront = glad.getFBObject(GL.GL_FRONT);
- FBObject _fboBack = glad.getFBObject(GL.GL_BACK);
+ final FBObject _fboFront = glad.getFBObject(GL.GL_FRONT);
+ final FBObject _fboBack = glad.getFBObject(GL.GL_BACK);
Assert.assertTrue("FBO are not equal: "+fboFront+" != "+_fboFront, fboFront.equals(_fboFront));
Assert.assertSame(fboFront, _fboFront);
Assert.assertTrue("FBO are not equal: "+fboBack+" != "+_fboFront, fboBack.equals(_fboFront));
@@ -380,7 +380,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
System.out.println("Fin: "+glad);
}
- public static void main(String args[]) throws Exception {
+ public static void main(final String args[]) throws Exception {
org.junit.runner.JUnitCore.main(TestFBOAutoDrawableFactoryNEWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMRTNEWT01.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMRTNEWT01.java
index 49db27af9..ba57c6dbd 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMRTNEWT01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMRTNEWT01.java
@@ -52,6 +52,7 @@ import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLDrawable;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import org.junit.Assert;
import org.junit.Test;
@@ -73,17 +74,17 @@ public class TestFBOMRTNEWT01 extends UITestCase {
return;
}
final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(
- new GLCapabilities(GLProfile.getGL2GL3()), width/step, height/step, true);
+ new GLCapabilities(GLProfile.getGL2GL3()), width/step, height/step, true);
final GLDrawable drawable = winctx.context.getGLDrawable();
- GL2GL3 gl = winctx.context.getGL().getGL2GL3();
+ final GL2GL3 gl = winctx.context.getGL().getGL2GL3();
// gl = gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", null, gl, null) ).getGL2GL3();
System.err.println(winctx.context);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- // test code ..
+ // test code ..
final ShaderState st = new ShaderState();
// st.setVerbose(true);
-
+
final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
"shader/bin", "fbo-mrt-1", true);
final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -93,12 +94,12 @@ public class TestFBOMRTNEWT01 extends UITestCase {
final ShaderProgram sp0 = new ShaderProgram();
sp0.add(gl, vp0, System.err);
sp0.add(gl, fp0, System.err);
- Assert.assertTrue(0 != sp0.program());
+ Assert.assertTrue(0 != sp0.program());
Assert.assertTrue(!sp0.inUse());
Assert.assertTrue(!sp0.linked());
- Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+ Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
st.attachShaderProgram(gl, sp0, false);
-
+
final ShaderCode vp1 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
"shader/bin", "fbo-mrt-2", true);
final ShaderCode fp1 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -107,20 +108,20 @@ public class TestFBOMRTNEWT01 extends UITestCase {
fp1.defaultShaderCustomization(gl, true, true);
final ShaderProgram sp1 = new ShaderProgram();
sp1.add(gl, vp1, System.err);
- sp1.add(gl, fp1, System.err);
- Assert.assertTrue(0 != sp1.program());
+ sp1.add(gl, fp1, System.err);
+ Assert.assertTrue(0 != sp1.program());
Assert.assertTrue(!sp1.inUse());
Assert.assertTrue(!sp1.linked());
- Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+ Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
st.attachShaderProgram(gl, sp1, true);
-
+
final PMVMatrix pmvMatrix = new PMVMatrix();
final GLUniformData pmvMatrixUniform = new GLUniformData("gcu_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- st.ownUniform(pmvMatrixUniform);
+ st.ownUniform(pmvMatrixUniform);
st.uniform(gl, pmvMatrixUniform);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
final GLArrayDataServer vertices0 = GLArrayDataServer.createGLSL("gca_Vertices", 3, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
// st.bindAttribLocation(gl, 0, vertices0);
vertices0.putf(0); vertices0.putf(1); vertices0.putf(0);
@@ -131,7 +132,7 @@ public class TestFBOMRTNEWT01 extends UITestCase {
st.ownAttribute(vertices0, true);
vertices0.enableBuffer(gl, false);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
final GLArrayDataServer colors0 = GLArrayDataServer.createGLSL("gca_Colors", 4, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
// st.bindAttribLocation(gl, 1, colors0);
colors0.putf(1); colors0.putf(0); colors0.putf(1); colors0.putf(1);
@@ -142,20 +143,20 @@ public class TestFBOMRTNEWT01 extends UITestCase {
st.ownAttribute(colors0, true);
colors0.enableBuffer(gl, false);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
final GLUniformData texUnit0 = new GLUniformData("gcs_TexUnit0", 0);
- st.ownUniform(texUnit0);
+ st.ownUniform(texUnit0);
st.uniform(gl, texUnit0);
final GLUniformData texUnit1 = new GLUniformData("gcs_TexUnit1", 1);
- st.ownUniform(texUnit1);
+ st.ownUniform(texUnit1);
st.uniform(gl, texUnit1);
-
+
final GLArrayDataServer texCoords0 = GLArrayDataServer.createGLSL("gca_TexCoords", 2, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
// st.bindAttribLocation(gl, 2, texCoords0);
texCoords0.putf(0f); texCoords0.putf(1f);
texCoords0.putf(1f); texCoords0.putf(1f);
texCoords0.putf(0f); texCoords0.putf(0f);
- texCoords0.putf(1f); texCoords0.putf(0f);
+ texCoords0.putf(1f); texCoords0.putf(0f);
texCoords0.seal(gl, true);
st.ownAttribute(texCoords0, true);
texCoords0.enableBuffer(gl, false);
@@ -163,7 +164,7 @@ public class TestFBOMRTNEWT01 extends UITestCase {
final int texA0Point = 0; // attachment point for texA0
final int texA1Point = 1; // attachment point for texA1
-
+
// FBO w/ 2 texture2D color buffers
final FBObject fbo_mrt = new FBObject();
fbo_mrt.reset(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
@@ -178,44 +179,44 @@ public class TestFBOMRTNEWT01 extends UITestCase {
fbo_mrt.attachRenderbuffer(gl, Type.DEPTH, 24);
Assert.assertTrue( fbo_mrt.isStatusValid() ) ;
fbo_mrt.unbind(gl);
-
+
// misc GL setup
gl.glClearColor(1, 1, 1, 1);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
// reshape
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
pmvMatrix.glOrthof(0f, 1f, 0f, 1f, -10f, 10f);
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
st.uniform(gl, pmvMatrixUniform);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
final int[] two_buffers = new int[] { GL.GL_COLOR_ATTACHMENT0+texA0Point, GL.GL_COLOR_ATTACHMENT0+texA1Point };
final int[] bck_buffers = new int[] { GL2GL3.GL_BACK_LEFT };
-
+
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
int step_i = 0;
- int[] last_snap_size = new int[] { 0, 0 };
-
+ final int[] last_snap_size = new int[] { 0, 0 };
+
for(int i=0; i<durationPerTest; i+=50) {
// pass 1 - MRT: Red -> buffer0, Green -> buffer1
- st.attachShaderProgram(gl, sp0, true);
+ st.attachShaderProgram(gl, sp0, true);
vertices0.enableBuffer(gl, true);
colors0.enableBuffer(gl, true);
-
+
fbo_mrt.bind(gl);
gl.glDrawBuffers(2, two_buffers, 0);
- gl.glViewport(0, 0, fbo_mrt.getWidth(), fbo_mrt.getHeight());
-
+ gl.glViewport(0, 0, fbo_mrt.getWidth(), fbo_mrt.getHeight());
+
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
fbo_mrt.unbind(gl);
vertices0.enableBuffer(gl, false);
colors0.enableBuffer(gl, false);
-
+
// pass 2 - mix buffer0, buffer1 and blue
// rg = buffer0.rg + buffer1.rg, b = Blue - length(rg);
st.attachShaderProgram(gl, sp1, true);
@@ -223,10 +224,10 @@ public class TestFBOMRTNEWT01 extends UITestCase {
colors0.enableBuffer(gl, true);
texCoords0.enableBuffer(gl, true);
gl.glDrawBuffers(1, bck_buffers, 0);
-
+
gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
-
- gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit0.intValue());
+
+ gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit0.intValue());
fbo_mrt.use(gl, texA0);
if(null != texA1) {
gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit1.intValue());
@@ -238,7 +239,7 @@ public class TestFBOMRTNEWT01 extends UITestCase {
vertices0.enableBuffer(gl, false);
colors0.enableBuffer(gl, false);
texCoords0.enableBuffer(gl, false);
-
+
{
final NativeSurface ns = gl.getContext().getGLReadDrawable().getNativeSurface();
if(last_snap_size[0] != ns.getSurfaceWidth() && last_snap_size[1] != ns.getSurfaceHeight()) {
@@ -248,33 +249,33 @@ public class TestFBOMRTNEWT01 extends UITestCase {
last_snap_size[1] = ns.getSurfaceHeight();
}
}
-
+
drawable.swapBuffers();
Thread.sleep(50);
- int j = (int) ( (long)i / (durationPerTest/(long)step) ) + 1;
+ final int j = (int) ( i / (durationPerTest/step) ) + 1;
if(j>step_i) {
- int w = width/step * j;
- int h = height/step * j;
+ final int w = width/step * j;
+ final int h = height/step * j;
System.err.println("resize: "+step_i+" -> "+j+" - "+w+"x"+h);
fbo_mrt.reset(gl, w, h);
winctx.window.setSize(w, h);
step_i = j;
}
}
-
+
NEWTGLContext.destroyWindow(winctx);
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
System.err.println("main - start");
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
}
}
- String tstname = TestFBOMRTNEWT01.class.getName();
+ final String tstname = TestFBOMRTNEWT01.class.getName();
org.junit.runner.JUnitCore.main(tstname);
System.err.println("main - end");
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMix2DemosES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMix2DemosES2NEWT.java
index d337bf938..f8feefdcf 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMix2DemosES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMix2DemosES2NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import java.io.BufferedReader;
@@ -61,7 +61,7 @@ import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestFBOMix2DemosES2NEWT extends UITestCase {
+public class TestFBOMix2DemosES2NEWT extends UITestCase {
static long duration = 500; // ms
static int swapInterval = 1;
static boolean showFPS = false;
@@ -70,19 +70,19 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase {
static boolean demo0Only = false;
static int globalNumSamples = 0;
static boolean mainRun = false;
-
+
@AfterClass
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilitiesImmutable caps, int numSamples) throws InterruptedException {
+ protected void runTestGL(final GLCapabilitiesImmutable caps, final int numSamples) throws InterruptedException {
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
System.err.println("requested: vsync "+swapInterval+", "+caps);
final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle("Gears NEWT Test (translucent "+!caps.isBackgroundOpaque()+"), swapInterval "+swapInterval);
if(mainRun) {
- glWindow.setSize(512, 512);
+ glWindow.setSize(512, 512);
} else {
glWindow.setSize(128, 128);
}
@@ -95,50 +95,50 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase {
glWindow.addGLEventListener(new GLEventListener() {
int i=0, c=0;
int origS;
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
origS = demo.getMSAA();
}
- public void dispose(GLAutoDrawable drawable) {}
- public void display(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {
if(mainRun) return;
-
+
final int dw = drawable.getSurfaceWidth();
final int dh = drawable.getSurfaceHeight();
c++;
-
+
if(dw<800) {
System.err.println("XXX: "+dw+"x"+dh+", c "+c);
if(0 == c%3) {
- snapshot(i++, "msaa"+demo.getMSAA(), drawable.getGL(), screenshot, TextureIO.PNG, null);
+ snapshot(i++, "msaa"+demo.getMSAA(), drawable.getGL(), screenshot, TextureIO.PNG, null);
}
if( 3 == c ) {
- new Thread() {
+ new Thread() {
@Override
public void run() {
demo.setMSAA(4);
} }.start();
} else if( 6 == c ) {
- new Thread() {
+ new Thread() {
@Override
public void run() {
demo.setMSAA(8);
} }.start();
} else if(9 == c) {
c=0;
- new Thread() {
+ new Thread() {
@Override
public void run() {
glWindow.setSize(dw+256, dh+256);
demo.setMSAA(origS);
- } }.start();
+ } }.start();
}
}
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
-
- Animator animator = new Animator(glWindow);
- QuitAdapter quitAdapter = new QuitAdapter();
+
+ final Animator animator = new Animator(glWindow);
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -146,19 +146,19 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase {
glWindow.addWindowListener(quitAdapter);
glWindow.addWindowListener(new WindowAdapter() {
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
- public void windowMoved(WindowEvent e) {
+ public void windowMoved(final WindowEvent e) {
System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
- }
+ }
});
-
+
glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
- }
+ }
System.err.println("*** "+e);
if(e.getKeyChar()=='f') {
new Thread() {
@@ -170,11 +170,11 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase {
} else if(e.getKeyChar()=='d') {
demo.setDemo0Only(!demo.getDemo0Only());
} else {
- int num = e.getKeyChar() - '0';
+ final int num = e.getKeyChar() - '0';
System.err.println("*** "+num);
if(0 <= num && num <= 8) {
System.err.println("MSAA: "+demo.getMSAA()+" -> "+num);
- demo.setMSAA(num);
+ demo.setMSAA(num);
}
}
}
@@ -184,13 +184,13 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase {
// glWindow.setSkipContextReleaseThread(animator.getThread());
glWindow.setVisible(true);
-
+
System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
-
+
animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
-
+
while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
Thread.sleep(100);
}
@@ -205,25 +205,25 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase {
@Test
public void test01_Main() throws InterruptedException {
if( mainRun ) {
- GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
+ final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
caps.setAlphaBits(1);
- runTestGL(caps, globalNumSamples);
+ runTestGL(caps, globalNumSamples);
}
}
-
+
@Test
public void test01() throws InterruptedException {
if( mainRun ) return ;
- GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
+ final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
caps.setAlphaBits(1);
runTestGL(caps, 0);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
boolean waitForKey = false;
-
+
mainRun = true;
-
+
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
@@ -248,16 +248,16 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase {
mainRun = false;
}
}
-
+
System.err.println("swapInterval "+swapInterval);
System.err.println("forceES2 "+forceES2);
if(waitForKey) {
- BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
try {
System.err.println(stdin.readLine());
- } catch (IOException e) { }
+ } catch (final IOException e) { }
}
org.junit.runner.JUnitCore.main(TestFBOMix2DemosES2NEWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java
index 8a833be05..e1e1c3fbc 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java
@@ -107,7 +107,7 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException {
+ protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException {
final GLReadBufferUtil screenshot = new GLReadBufferUtil(false, false);
System.err.println("requested: vsync "+swapInterval+", "+caps);
@@ -127,7 +127,7 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
final int fbod2_texUnit = 1;
final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
- GLCapabilities fbodCaps = (GLCapabilities) caps.cloneMutable();
+ final GLCapabilities fbodCaps = (GLCapabilities) caps.cloneMutable();
// fbodCaps.setDoubleBuffered(false);
final Mix2TexturesES2 mixerDemo = new Mix2TexturesES2(1, fbod1_texUnit, fbod2_texUnit);
@@ -139,14 +139,14 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
fbod1.setUpstreamWidget(glWindow); // connect the real GLWindow (mouse/key) to offscreen!
fbod1.setTextureUnit(fbod1_texUnit);
{
- GearsES2 demo0 = new GearsES2(-1);
+ final GearsES2 demo0 = new GearsES2(-1);
fbod1.addGLEventListener(demo0);
fbod1.addGLEventListener(new GLFinishOnDisplay());
demo0.setIgnoreFocus(true);
}
fbod1.getNativeSurface().addSurfaceUpdatedListener(new SurfaceUpdatedListener() {
@Override
- public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+ public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
mixerDemo.setTexID0(fbod1.getTextureBuffer(GL.GL_FRONT).getName());
} });
fbod1.display(); // init
@@ -162,7 +162,7 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
fbod2.addGLEventListener(new GLFinishOnDisplay());
fbod2.getNativeSurface().addSurfaceUpdatedListener(new SurfaceUpdatedListener() {
@Override
- public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+ public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
mixerDemo.setTexID1(fbod2.getTextureBuffer(GL.GL_FRONT).getName());
} });
fbod2.display(); // init
@@ -176,9 +176,9 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
glWindow.addGLEventListener(mixerDemo);
glWindow.addGLEventListener(new GLEventListener() {
int i=0, c=0;
- public void init(GLAutoDrawable drawable) {}
- public void dispose(GLAutoDrawable drawable) {}
- public void display(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {
if(mainRun) return;
final int dw = drawable.getSurfaceWidth();
@@ -200,7 +200,7 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
}
}
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
fbod1.setSurfaceSize(width, height);
fbod2.setSurfaceSize(width, height);
}
@@ -213,7 +213,7 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
final Animator animator1 = new Animator();
animator1.add(glWindow);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -221,10 +221,10 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
glWindow.addWindowListener(quitAdapter);
glWindow.addWindowListener(new WindowAdapter() {
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
- public void windowMoved(WindowEvent e) {
+ public void windowMoved(final WindowEvent e) {
System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
});
@@ -263,12 +263,12 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
@Test
public void test01() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
+ final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
caps.setAlphaBits(1);
runTestGL(caps);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
boolean waitForKey = false;
mainRun = true;
@@ -295,11 +295,11 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
System.err.println("forceES2 "+forceES2);
if(waitForKey) {
- BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
try {
System.err.println(stdin.readLine());
- } catch (IOException e) { }
+ } catch (final IOException e) { }
}
org.junit.runner.JUnitCore.main(TestFBOOffThreadSharedContextMix2DemosES2NEWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java
index 155162964..c9c156218 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java
@@ -105,7 +105,7 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException {
+ protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException {
final GLReadBufferUtil screenshot = new GLReadBufferUtil(false, false);
System.err.println("requested: vsync "+swapInterval+", "+caps);
@@ -124,7 +124,7 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
final int fbod1_texUnit = 0;
final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
- GLCapabilities fbodCaps = (GLCapabilities) caps.cloneMutable();
+ final GLCapabilities fbodCaps = (GLCapabilities) caps.cloneMutable();
// fbodCaps.setDoubleBuffered(false);
final Mix2TexturesES2 mixerDemo = new Mix2TexturesES2(1, fbod1_texUnit, 0);
@@ -136,14 +136,14 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
fbod1.setUpstreamWidget(glWindow); // connect the real GLWindow (mouse/key) to offscreen!
fbod1.setTextureUnit(fbod1_texUnit);
{
- GearsES2 demo0 = new GearsES2(-1);
+ final GearsES2 demo0 = new GearsES2(-1);
fbod1.addGLEventListener(demo0);
fbod1.addGLEventListener(new GLFinishOnDisplay());
demo0.setIgnoreFocus(true);
}
fbod1.getNativeSurface().addSurfaceUpdatedListener(new SurfaceUpdatedListener() {
@Override
- public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+ public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
mixerDemo.setTexID0(fbod1.getTextureBuffer(GL.GL_FRONT).getName());
} });
fbod1.display(); // init
@@ -155,16 +155,16 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
glWindow.addWindowListener(new WindowAdapter() {
@Override
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
fbod1.setSurfaceSize(glWindow.getSurfaceWidth(), glWindow.getSurfaceHeight());
}
});
glWindow.addGLEventListener(mixerDemo);
glWindow.addGLEventListener(new GLEventListener() {
int i=0, c=0;
- public void init(GLAutoDrawable drawable) {}
- public void dispose(GLAutoDrawable drawable) {}
- public void display(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {
if(mainRun) return;
final int dw = drawable.getSurfaceWidth();
@@ -186,14 +186,14 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
}
}
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
final Animator animator1 = new Animator();
animator1.add(fbod1);
animator1.add(glWindow);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -201,10 +201,10 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
glWindow.addWindowListener(quitAdapter);
glWindow.addWindowListener(new WindowAdapter() {
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
- public void windowMoved(WindowEvent e) {
+ public void windowMoved(final WindowEvent e) {
System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
});
@@ -236,12 +236,12 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
@Test
public void test01() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
+ final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
caps.setAlphaBits(1);
runTestGL(caps);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
boolean waitForKey = false;
mainRun = true;
@@ -268,11 +268,11 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
System.err.println("forceES2 "+forceES2);
if(waitForKey) {
- BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
try {
System.err.println(stdin.readLine());
- } catch (IOException e) { }
+ } catch (final IOException e) { }
}
org.junit.runner.JUnitCore.main(TestFBOOnThreadSharedContext1DemoES2NEWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateNEWT.java
index 597d72269..85f9d9e2b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateNEWT.java
@@ -55,6 +55,7 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
/**
* Test using a NEWT {@link Window} for onscreen case.
@@ -72,7 +73,7 @@ import com.jogamp.opengl.util.Animator;
public class TestGLAutoDrawableDelegateNEWT extends UITestCase {
static long duration = 500; // ms
- void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+ void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
//
@@ -105,27 +106,27 @@ public class TestGLAutoDrawableDelegateNEWT extends UITestCase {
window.addWindowListener(new WindowAdapter() {
@Override
- public void windowRepaint(WindowUpdateEvent e) {
+ public void windowRepaint(final WindowUpdateEvent e) {
glad.windowRepaintOp();
}
@Override
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
glad.windowResizedOp(window.getSurfaceWidth(), window.getSurfaceHeight());
}
});
glad.addGLEventListener(demo);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
window.addKeyListener(quitAdapter);
window.addWindowListener(quitAdapter);
- Animator animator = new Animator();
+ final Animator animator = new Animator();
animator.setUpdateFPSFrames(60, System.err);
- animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+ animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
animator.add(glad);
animator.start();
Assert.assertTrue(animator.isStarted());
@@ -150,7 +151,7 @@ public class TestGLAutoDrawableDelegateNEWT extends UITestCase {
doTest(reqGLCaps, new GearsES2(1));
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java
index 8113f34ee..94bff728e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java
@@ -76,7 +76,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
static final int heightStep = 600/4;
volatile int szStep = 2;
- static GLCapabilities getCaps(String profile) {
+ static GLCapabilities getCaps(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
@@ -84,7 +84,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
return new GLCapabilities(GLProfile.get(profile));
}
- void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+ void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
System.out.println("Requested GL Caps: "+reqGLCaps);
final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
@@ -140,7 +140,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
final GLContext context = drawable.createContext(null);
Assert.assertNotNull(context);
- int res = context.makeCurrent();
+ final int res = context.makeCurrent();
Assert.assertTrue(GLContext.CONTEXT_CURRENT_NEW==res || GLContext.CONTEXT_CURRENT==res);
context.release();
@@ -179,12 +179,12 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
window.addWindowListener(new WindowAdapter() {
@Override
- public void windowRepaint(WindowUpdateEvent e) {
+ public void windowRepaint(final WindowUpdateEvent e) {
glad.windowRepaintOp();
}
@Override
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
glad.windowResizedOp(window.getSurfaceWidth(), window.getSurfaceHeight());
}
});
@@ -388,7 +388,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
doTest(reqGLCaps, new GearsES2(1));
} */
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
org.junit.runner.JUnitCore.main(TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java
index 06c09bbbf..5c90e8021 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java
@@ -64,7 +64,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase {
static final int heightStep = 600/4;
volatile int szStep = 2;
- static GLCapabilities getCaps(String profile) {
+ static GLCapabilities getCaps(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
@@ -72,7 +72,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase {
return new GLCapabilities(GLProfile.get(profile));
}
- void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+ void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
System.out.println("Requested GL Caps: "+reqGLCaps);
final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
@@ -338,7 +338,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase {
doTest(reqGLCaps, new GearsES2(1));
} */
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
org.junit.runner.JUnitCore.main(TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java
index ffa64d894..a5a340b36 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java
@@ -64,7 +64,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase {
static final int heightStep = 600/4;
volatile int szStep = 2;
- static GLCapabilities getCaps(String profile) {
+ static GLCapabilities getCaps(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
@@ -72,7 +72,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase {
return new GLCapabilities(GLProfile.get(profile));
}
- void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+ void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
System.out.println("Requested GL Caps: "+reqGLCaps);
final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
@@ -377,7 +377,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase {
doTest(reqGLCaps, new Gears(1));
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
org.junit.runner.JUnitCore.main(TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java
index 8d3d05869..51c7c0772 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java
@@ -64,7 +64,7 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase {
static final int heightStep = 600/4;
volatile int szStep = 2;
- void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+ void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
System.out.println("Requested GL Caps: "+reqGLCaps);
final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
@@ -178,7 +178,7 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase {
doTest(reqGLCaps, new Gears(1));
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
org.junit.runner.JUnitCore.main(TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java
index 2d231fb6d..8f8bb8f3e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java
@@ -67,7 +67,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
static boolean waitForKey = false;
volatile int szStep = 2;
- static GLCapabilities getCaps(String profile) {
+ static GLCapabilities getCaps(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
@@ -86,7 +86,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
frame.pack();
frame.validate();
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -96,7 +96,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
void setMakeSnapshot();
}
- void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+ void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
if(reqGLCaps.isOnscreen() && JAWTUtil.isOffscreenLayerRequired()) {
System.err.println("onscreen layer n/a");
return;
@@ -114,7 +114,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
//
final GLCanvas glad = new GLCanvas(reqGLCaps); // will implicit trigger offscreen layer - if !onscreen && supported
Assert.assertNotNull(glad);
- Dimension glc_sz = new Dimension(widthStep*szStep, heightStep*szStep);
+ final Dimension glc_sz = new Dimension(widthStep*szStep, heightStep*szStep);
glad.setMinimumSize(glc_sz);
glad.setPreferredSize(glc_sz);
glad.setSize(glc_sz);
@@ -128,7 +128,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
frame.pack();
frame.setVisible(true);
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -179,7 +179,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
} */
{
- GLContext context = glad.getContext();
+ final GLContext context = glad.getContext();
System.out.println("Chosen GL CTX (2): "+context.getGLVersion());
Assert.assertNotNull(context);
Assert.assertTrue(context.isCreated());
@@ -235,7 +235,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
frame.remove(glad);
frame.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -338,7 +338,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
doTest(reqGLCaps, new GearsES2(1));
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-wait")) {
waitForKey = true;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java
index 8acec337b..2e29340a1 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java
@@ -70,7 +70,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
void setMakeSnapshot();
}
- static GLCapabilities getCaps(String profile) {
+ static GLCapabilities getCaps(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
@@ -78,7 +78,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
return new GLCapabilities(GLProfile.get(profile));
}
- void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+ void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
System.out.println("Requested GL Caps: "+reqGLCaps);
final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
@@ -135,7 +135,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
glad.display();
{
- GLContext context = glad.getContext();
+ final GLContext context = glad.getContext();
System.out.println("Chosen GL CTX (2): "+context.getGLVersion());
Assert.assertNotNull(context);
Assert.assertTrue(context.isCreated());
@@ -462,7 +462,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
doTest(reqGLCaps, new GearsES2(1));
} */
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
org.junit.runner.JUnitCore.main(TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java
index bfdad4427..b95fa0c8c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java
@@ -72,7 +72,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
static final int heightStep = 600/4;
volatile int szStep = 2;
- static GLCapabilities getCaps(String profile) {
+ static GLCapabilities getCaps(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
@@ -91,7 +91,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
frame.pack();
frame.validate();
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -101,7 +101,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
void setMakeSnapshot();
}
- void doTest(boolean offscreenLayer, GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+ void doTest(final boolean offscreenLayer, final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
if(!offscreenLayer && JAWTUtil.isOffscreenLayerRequired()) {
System.err.println("onscreen layer n/a");
return;
@@ -124,7 +124,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
final NewtCanvasAWT nca = new NewtCanvasAWT(glad);
Assert.assertNotNull(nca);
- Dimension size0 = new Dimension(widthStep*szStep, heightStep*szStep);
+ final Dimension size0 = new Dimension(widthStep*szStep, heightStep*szStep);
nca.setShallUseOffscreenLayer(offscreenLayer); // trigger offscreen layer - if supported
nca.setPreferredSize(size0);
nca.setMinimumSize(size0);
@@ -140,7 +140,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
frame.pack();
frame.setVisible(true);
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -191,7 +191,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
} */
{
- GLContext context = glad.getContext();
+ final GLContext context = glad.getContext();
System.out.println("Chosen GL CTX (2): "+context.getGLVersion());
Assert.assertNotNull(context);
Assert.assertTrue(context.isCreated());
@@ -247,7 +247,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
frame.remove(nca);
frame.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -351,7 +351,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
doTest(true, reqGLCaps, new GearsES2(1));
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
org.junit.runner.JUnitCore.main(TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextSurfaceLockNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextSurfaceLockNEWT.java
index 1e78e492c..3900817c5 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextSurfaceLockNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextSurfaceLockNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import java.io.IOException;
@@ -47,37 +47,37 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestGLContextSurfaceLockNEWT extends UITestCase {
static final int demoSize = 64;
-
+
public abstract class MyRunnable implements Runnable {
final Object postSync;
final int id;
boolean done = false;
-
- public MyRunnable(Object postSync, int id) {
+
+ public MyRunnable(final Object postSync, final int id) {
this.postSync = postSync;
this.id = id;
}
-
+
public boolean done() { return done; }
}
-
+
public class RudeAnimator extends MyRunnable {
private final GLAutoDrawable glad;
private final int frameCount;
-
- public RudeAnimator(GLAutoDrawable glad, int frameCount, Object postSync, int id) {
+
+ public RudeAnimator(final GLAutoDrawable glad, final int frameCount, final Object postSync, final int id) {
super(postSync, id);
this.glad = glad;
this.frameCount = frameCount;
}
-
+
public void run() {
System.err.println("Animatr "+id+", count "+frameCount+": PRE: "+Thread.currentThread().getName());
-
+
for(int c=0; c<frameCount; c++) {
glad.display();
}
-
+
System.err.println("Animatr "+id+": DONE/SYNC: "+Thread.currentThread().getName());
synchronized (postSync) {
done = true;
@@ -94,16 +94,16 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
public class RudeResizer extends MyRunnable {
private final GLWindow win;
private final int actionCount;
-
- public RudeResizer(GLWindow win, int actionCount, Object postSync, int id) {
+
+ public RudeResizer(final GLWindow win, final int actionCount, final Object postSync, final int id) {
super(postSync, id);
this.win = win;
this.actionCount = actionCount;
}
-
+
public void run() {
System.err.println("Resizer "+id+", count "+actionCount+": PRE: "+Thread.currentThread().getName());
-
+
for(int c=0; c<actionCount; c++) {
win.runOnEDTIfAvail(true, new Runnable() {
public void run() {
@@ -111,9 +111,9 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
win.setSize(win.getSurfaceWidth()+1, win.getSurfaceHeight()+1);
// Force display within surface lock.
- // This procedure emulates the sensitive behavior
+ // This procedure emulates the sensitive behavior
// for all platforms directly.
- int res = win.lockSurface();
+ final int res = win.lockSurface();
if(res > NativeSurface.LOCK_SURFACE_NOT_READY) {
try {
win.display();
@@ -123,7 +123,7 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
}
}});
}
-
+
System.err.println("Resizer "+id+": DONE/SYNC: "+Thread.currentThread().getName());
synchronized (postSync) {
done = true;
@@ -132,8 +132,8 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
}
}
}
-
- protected static boolean done(MyRunnable[] tasks) {
+
+ protected static boolean done(final MyRunnable[] tasks) {
for(int i=tasks.length-1; i>=0; i--) {
if(!tasks[i].done()) {
return false;
@@ -141,8 +141,8 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
}
return true;
}
-
- protected static boolean isDead(Thread[] threads) {
+
+ protected static boolean isDead(final Thread[] threads) {
for(int i=threads.length-1; i>=0; i--) {
if(threads[i].isAlive()) {
return false;
@@ -150,52 +150,52 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
}
return true;
}
-
+
protected class MyEventCounter implements GLEventListener {
volatile int reshapeCount = 0;
volatile int displayCount = 0;
-
+
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
System.err.println("*** reshapes: "+reshapeCount+", displays "+displayCount);
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
displayCount++;
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
reshapeCount++;
}
-
+
public void reset() {
reshapeCount = 0;
- displayCount = 0;
+ displayCount = 0;
}
}
-
- protected void runJOGLTasks(int animThreadCount, int frameCount, int reszThreadCount, int resizeCount) throws InterruptedException {
+
+ protected void runJOGLTasks(final int animThreadCount, final int frameCount, final int reszThreadCount, final int resizeCount) throws InterruptedException {
final GLWindow glWindow = GLWindow.create(new GLCapabilities(GLProfile.getDefault()));
final MyEventCounter myEventCounter = new MyEventCounter();
-
+
glWindow.addGLEventListener(new GearsES2(0));
glWindow.addGLEventListener(myEventCounter);
glWindow.setSize(demoSize, demoSize);
glWindow.setVisible(true);
-
+
final String currentThreadName = Thread.currentThread().getName();
final Object sync = new Object();
final MyRunnable[] animTasks = new MyRunnable[animThreadCount];
final MyRunnable[] resizeTasks = new MyRunnable[animThreadCount];
final Thread[] animThreads = new Thread[reszThreadCount];
final Thread[] resizeThreads = new Thread[reszThreadCount];
-
+
System.err.println("animThreadCount "+animThreadCount+", frameCount "+frameCount);
System.err.println("reszThreadCount "+reszThreadCount+", resizeCount "+resizeCount);
System.err.println("tasks "+(animTasks.length+resizeTasks.length)+", threads "+(animThreads.length+resizeThreads.length));
@@ -212,7 +212,7 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
}
myEventCounter.reset();
-
+
int j=0, k=0;
for(int i=0; i<reszThreadCount+animThreadCount; i++) {
if(0==i%2) {
@@ -227,7 +227,7 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
while(!done(resizeTasks) || !done(animTasks)) {
try {
sync.wait();
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
throw new RuntimeException(e);
}
}
@@ -237,30 +237,30 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
Thread.sleep(100);
i++;
}
-
+
glWindow.destroy();
}
-
+
@Test
public void test01_1A1RThreads_100Resizes() throws InterruptedException {
runJOGLTasks(1, 200, 1, 100);
}
-
+
@Test
public void test01_3A3RThreads_50Resizes() throws InterruptedException {
runJOGLTasks(3, 100, 3, 50);
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
// duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
- String tstname = TestGLContextSurfaceLockNEWT.class.getName();
+ final String tstname = TestGLContextSurfaceLockNEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java
index f0950fba8..26a69d463 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,17 +20,18 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import java.io.IOException;
import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLContext;
@@ -53,56 +54,56 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestGLDebug00NEWT extends UITestCase {
-
+
static String dbgTstMsg0 = "Hello World";
static int dbgTstId0 = 42;
-
- public class WindowContext {
+
+ public class WindowContext {
public final Window window;
public final GLContext context;
-
- public WindowContext(Window w, GLContext c) {
+
+ public WindowContext(final Window w, final GLContext c) {
window = w;
context = c;
}
- }
-
- WindowContext createWindow(GLProfile glp, boolean debugGL) {
- GLCapabilities caps = new GLCapabilities(glp);
+ }
+
+ WindowContext createWindow(final GLProfile glp, final boolean debugGL) {
+ final GLCapabilities caps = new GLCapabilities(glp);
//
// Create native windowing resources .. X11/Win/OSX
- //
- Display display = NewtFactory.createDisplay(null); // local display
+ //
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
- Window window = NewtFactory.createWindow(screen, caps);
+ final Window window = NewtFactory.createWindow(screen, caps);
Assert.assertNotNull(window);
window.setSize(128, 128);
window.setVisible(true);
- GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
- GLDrawable drawable = factory.createGLDrawable(window);
+ final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
+ final GLDrawable drawable = factory.createGLDrawable(window);
Assert.assertNotNull(drawable);
-
+
drawable.setRealized(true);
-
- GLContext context = drawable.createContext(null);
+
+ final GLContext context = drawable.createContext(null);
Assert.assertNotNull(context);
-
+
context.enableGLDebugMessage(debugGL);
-
- int res = context.makeCurrent();
+
+ final int res = context.makeCurrent();
Assert.assertTrue(GLContext.CONTEXT_CURRENT_NEW==res || GLContext.CONTEXT_CURRENT==res);
-
+
return new WindowContext(window, context);
}
- void destroyWindow(WindowContext winctx) {
- GLDrawable drawable = winctx.context.getGLDrawable();
-
+ void destroyWindow(final WindowContext winctx) {
+ final GLDrawable drawable = winctx.context.getGLDrawable();
+
Assert.assertNotNull(winctx.context);
winctx.context.destroy();
@@ -113,19 +114,19 @@ public class TestGLDebug00NEWT extends UITestCase {
winctx.window.destroy();
}
-
- void test01GLDebug01EnableDisable(boolean enable) throws InterruptedException {
- GLProfile glp = GLProfile.getDefault();
-
- WindowContext winctx = createWindow(glp, enable);
- String glDebugExt = winctx.context.getGLDebugMessageExtension();
+
+ void test01GLDebug01EnableDisable(final boolean enable) throws InterruptedException {
+ final GLProfile glp = GLProfile.getDefault();
+
+ final WindowContext winctx = createWindow(glp, enable);
+ final String glDebugExt = winctx.context.getGLDebugMessageExtension();
System.err.println("glDebug extension: "+glDebugExt);
System.err.println("glDebug enabled: "+winctx.context.isGLDebugMessageEnabled());
System.err.println("glDebug sync: "+winctx.context.isGLDebugSynchronous());
- System.err.println("context version: "+winctx.context.getGLVersion());
-
+ System.err.println("context version: "+winctx.context.getGLVersion());
+
Assert.assertEquals((null == glDebugExt) ? false : enable, winctx.context.isGLDebugMessageEnabled());
-
+
destroyWindow(winctx);
}
@@ -138,95 +139,95 @@ public class TestGLDebug00NEWT extends UITestCase {
public void test01GLDebugEnabled() throws InterruptedException {
test01GLDebug01EnableDisable(true);
}
-
+
@Test
public void test02GLDebugError() throws InterruptedException {
- GLProfile glp = GLProfile.getDefault();
-
- WindowContext winctx = createWindow(glp, true);
-
- MyGLDebugListener myGLDebugListener = new MyGLDebugListener(
- GL2GL3.GL_DEBUG_SOURCE_API,
- GL2GL3.GL_DEBUG_TYPE_ERROR,
- GL2GL3.GL_DEBUG_SEVERITY_HIGH);
+ final GLProfile glp = GLProfile.getDefault();
+
+ final WindowContext winctx = createWindow(glp, true);
+
+ final MyGLDebugListener myGLDebugListener = new MyGLDebugListener(
+ GL2ES2.GL_DEBUG_SOURCE_API,
+ GL2ES2.GL_DEBUG_TYPE_ERROR,
+ GL2ES2.GL_DEBUG_SEVERITY_HIGH);
winctx.context.addGLDebugListener(myGLDebugListener);
-
- GL gl = winctx.context.getGL();
-
+
+ final GL gl = winctx.context.getGL();
+
gl.glBindFramebuffer(-1, -1); // ERROR !
-
+
if( winctx.context.isGLDebugMessageEnabled() ) {
Assert.assertEquals(true, myGLDebugListener.received());
- }
-
+ }
+
destroyWindow(winctx);
}
-
+
@Test
public void test03GLDebugInsert() throws InterruptedException {
- GLProfile glp = GLProfile.getDefault();
- WindowContext winctx = createWindow(glp, true);
- MyGLDebugListener myGLDebugListener = new MyGLDebugListener(dbgTstMsg0, dbgTstId0);
+ final GLProfile glp = GLProfile.getDefault();
+ final WindowContext winctx = createWindow(glp, true);
+ final MyGLDebugListener myGLDebugListener = new MyGLDebugListener(dbgTstMsg0, dbgTstId0);
winctx.context.addGLDebugListener(myGLDebugListener);
-
- String glDebugExt = winctx.context.getGLDebugMessageExtension();
+
+ final String glDebugExt = winctx.context.getGLDebugMessageExtension();
Assert.assertEquals((null == glDebugExt) ? false : true, winctx.context.isGLDebugMessageEnabled());
-
+
if( winctx.context.isGLDebugMessageEnabled() ) {
- winctx.context.glDebugMessageInsert(GL2GL3.GL_DEBUG_SOURCE_APPLICATION,
- GL2GL3.GL_DEBUG_TYPE_OTHER,
- dbgTstId0,
- GL2GL3.GL_DEBUG_SEVERITY_MEDIUM, dbgTstMsg0);
+ winctx.context.glDebugMessageInsert(GL2ES2.GL_DEBUG_SOURCE_APPLICATION,
+ GL2ES2.GL_DEBUG_TYPE_OTHER,
+ dbgTstId0,
+ GL2ES2.GL_DEBUG_SEVERITY_MEDIUM, dbgTstMsg0);
Assert.assertEquals(true, myGLDebugListener.received());
- }
-
+ }
+
destroyWindow(winctx);
}
-
- public static void main(String args[]) throws IOException {
- String tstname = TestGLDebug00NEWT.class.getName();
+
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestGLDebug00NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
-
+
public class MyGLDebugListener implements GLDebugListener {
int recSource;
int recType;
int recSeverity;
-
+
String recMsg;
int recId;
boolean received = false;
-
- public MyGLDebugListener(int recSource, int recType, int recSeverity) {
+
+ public MyGLDebugListener(final int recSource, final int recType, final int recSeverity) {
this.recSource = recSource;
this.recType = recType;
this.recSeverity = recSeverity;
this.recMsg = null;
this.recId = -1;
-
+
}
- public MyGLDebugListener(String recMsg, int recId) {
+ public MyGLDebugListener(final String recMsg, final int recId) {
this.recSource = -1;
this.recType = -1;
this.recSeverity = -1;
this.recMsg = recMsg;
this.recId = recId;
}
-
+
public boolean received() { return received; }
-
- public void messageSent(GLDebugMessage event) {
- System.err.println("XXX: "+event);
+
+ public void messageSent(final GLDebugMessage event) {
+ System.err.println("XXX: "+event);
if(null != recMsg && recMsg.equals(event.getDbgMsg()) && recId == event.getDbgId()) {
received = true;
- } else if(0 <= recSource && recSource == event.getDbgSource() &&
+ } else if(0 <= recSource && recSource == event.getDbgSource() &&
recType == event.getDbgType() &&
recSeverity== event.getDbgSeverity() ) {
- received = true;
+ received = true;
}
// Thread.dumpStack();
- }
+ }
}
}
-
+
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java
index 76bf33044..67588a0d0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,16 +20,17 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import java.io.IOException;
+import javax.media.opengl.GL2ES2;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
@@ -49,16 +50,16 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestGLDebug01NEWT extends UITestCase {
-
+
static String dbgTstMsg0 = "Hello World";
static int dbgTstId0 = 42;
-
- GLWindow createWindow(GLProfile glp, boolean debugGL) {
- GLCapabilities caps = new GLCapabilities(glp);
+
+ GLWindow createWindow(final GLProfile glp, final boolean debugGL) {
+ final GLCapabilities caps = new GLCapabilities(glp);
//
// Create native windowing resources .. X11/Win/OSX
- //
- GLWindow window = GLWindow.create(caps);
+ //
+ final GLWindow window = GLWindow.create(caps);
Assert.assertNotNull(window);
window.setContextCreationFlags(debugGL?GLContext.CTX_OPTION_DEBUG:0);
window.setSize(128, 128);
@@ -66,44 +67,44 @@ public class TestGLDebug01NEWT extends UITestCase {
Assert.assertNotNull(window.getContext());
Assert.assertNotNull(window.getContext().isCreated());
-
+
return window;
}
- void destroyWindow(GLWindow window) {
+ void destroyWindow(final GLWindow window) {
window.destroy();
}
-
- void test01GLDebug01EnableDisable(boolean enable, final String dbgTstMsg, final int dbgTstId) throws InterruptedException {
- GLProfile glp = GLProfile.getDefault();
-
+
+ void test01GLDebug01EnableDisable(final boolean enable, final String dbgTstMsg, final int dbgTstId) throws InterruptedException {
+ final GLProfile glp = GLProfile.getDefault();
+
final GLWindow window = createWindow(glp, enable);
final GLContext ctx = window.getContext();
- MyGLDebugListener myGLDebugListener = new MyGLDebugListener(dbgTstMsg, dbgTstId);
+ final MyGLDebugListener myGLDebugListener = new MyGLDebugListener(dbgTstMsg, dbgTstId);
if(enable) {
ctx.addGLDebugListener(myGLDebugListener);
- }
- String glDebugExt = ctx.getGLDebugMessageExtension();
+ }
+ final String glDebugExt = ctx.getGLDebugMessageExtension();
System.err.println("glDebug extension: "+glDebugExt);
System.err.println("glDebug enabled: "+ctx.isGLDebugMessageEnabled());
System.err.println("glDebug sync: "+ ctx.isGLDebugSynchronous());
System.err.println("context version: "+ctx.getGLVersion());
-
+
Assert.assertEquals((null == glDebugExt) ? false : enable, ctx.isGLDebugMessageEnabled());
if(ctx.isGLDebugMessageEnabled() && null != dbgTstMsg && 0 <= dbgTstId) {
window.invoke(true, new GLRunnable() {
- public boolean run(GLAutoDrawable drawable) {
- drawable.getContext().glDebugMessageInsert(GL2GL3.GL_DEBUG_SOURCE_APPLICATION,
- GL2GL3.GL_DEBUG_TYPE_OTHER,
- dbgTstId,
- GL2GL3.GL_DEBUG_SEVERITY_MEDIUM, dbgTstMsg);
+ public boolean run(final GLAutoDrawable drawable) {
+ drawable.getContext().glDebugMessageInsert(GL2ES2.GL_DEBUG_SOURCE_APPLICATION,
+ GL2ES2.GL_DEBUG_TYPE_OTHER,
+ dbgTstId,
+ GL2ES2.GL_DEBUG_SEVERITY_MEDIUM, dbgTstMsg);
return true;
}
});
Assert.assertEquals(true, myGLDebugListener.received());
- }
-
+ }
+
destroyWindow(window);
}
@@ -116,77 +117,77 @@ public class TestGLDebug01NEWT extends UITestCase {
public void test01GLDebug01Enabled() throws InterruptedException {
test01GLDebug01EnableDisable(true, dbgTstMsg0, dbgTstId0);
}
-
+
@Test
public void test02GLDebug01Error() throws InterruptedException {
- GLProfile glp = GLProfile.getDefault();
-
- GLWindow window = createWindow(glp, true);
-
- MyGLDebugListener myGLDebugListener = new MyGLDebugListener(
- GL2GL3.GL_DEBUG_SOURCE_API,
- GL2GL3.GL_DEBUG_TYPE_ERROR,
- GL2GL3.GL_DEBUG_SEVERITY_HIGH);
+ final GLProfile glp = GLProfile.getDefault();
+
+ final GLWindow window = createWindow(glp, true);
+
+ final MyGLDebugListener myGLDebugListener = new MyGLDebugListener(
+ GL2ES2.GL_DEBUG_SOURCE_API,
+ GL2ES2.GL_DEBUG_TYPE_ERROR,
+ GL2ES2.GL_DEBUG_SEVERITY_HIGH);
window.getContext().addGLDebugListener(myGLDebugListener);
-
+
window.invoke(true, new GLRunnable() {
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
drawable.getGL().glBindFramebuffer(-1, -1); // ERROR !
return true;
}
} );
-
+
if( window.getContext().isGLDebugMessageEnabled() ) {
Assert.assertEquals(true, myGLDebugListener.received());
- }
-
+ }
+
destroyWindow(window);
}
-
-
- public static void main(String args[]) throws IOException {
- String tstname = TestGLDebug01NEWT.class.getName();
+
+
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestGLDebug01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
-
+
public class MyGLDebugListener implements GLDebugListener {
int recSource;
int recType;
int recSeverity;
-
+
String recMsg;
int recId;
boolean received = false;
-
- public MyGLDebugListener(int recSource, int recType, int recSeverity) {
+
+ public MyGLDebugListener(final int recSource, final int recType, final int recSeverity) {
this.recSource = recSource;
this.recType = recType;
this.recSeverity = recSeverity;
this.recMsg = null;
this.recId = -1;
-
+
}
- public MyGLDebugListener(String recMsg, int recId) {
+ public MyGLDebugListener(final String recMsg, final int recId) {
this.recSource = -1;
this.recType = -1;
this.recSeverity = -1;
this.recMsg = recMsg;
this.recId = recId;
}
-
+
public boolean received() { return received; }
-
- public void messageSent(GLDebugMessage event) {
- System.err.println("XXX: "+event);
+
+ public void messageSent(final GLDebugMessage event) {
+ System.err.println("XXX: "+event);
if(null != recMsg && recMsg.equals(event.getDbgMsg()) && recId == event.getDbgId()) {
received = true;
- } else if(0 <= recSource && recSource == event.getDbgSource() &&
+ } else if(0 <= recSource && recSource == event.getDbgSource() &&
recType == event.getDbgType() &&
recSeverity== event.getDbgSeverity() ) {
- received = true;
+ received = true;
}
// Thread.dumpStack();
- }
+ }
}
}
-
+
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLExtensionQueryOffscreen.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLExtensionQueryOffscreen.java
index 4bc8e7ee3..1e938c200 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLExtensionQueryOffscreen.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLExtensionQueryOffscreen.java
@@ -48,8 +48,8 @@ import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestGLExtensionQueryOffscreen {
- public static void main(String[] args) {
- TestGLExtensionQueryOffscreen instance = new TestGLExtensionQueryOffscreen();
+ public static void main(final String[] args) {
+ final TestGLExtensionQueryOffscreen instance = new TestGLExtensionQueryOffscreen();
instance.testJogl2ExtensionCheck1();
instance.testJogl2ExtensionCheck2();
}
@@ -59,8 +59,8 @@ public class TestGLExtensionQueryOffscreen {
*/
@Test
public void testJogl2ExtensionCheck1() {
- GLDrawableFactoryImpl factory = (GLDrawableFactoryImpl) GLDrawableFactory.getDesktopFactory();
- GLContext sharedContext = factory.getOrCreateSharedContext(null);
+ final GLDrawableFactoryImpl factory = (GLDrawableFactoryImpl) GLDrawableFactory.getDesktopFactory();
+ final GLContext sharedContext = factory.getOrCreateSharedContext(null);
sharedContext.makeCurrent();
String extensions;
try {
@@ -68,8 +68,8 @@ public class TestGLExtensionQueryOffscreen {
} finally {
sharedContext.release();
}
- String[] tabExtensions = extensions.split(" ");
- SortedSet<String> setExtensions = new TreeSet<String>();
+ final String[] tabExtensions = extensions.split(" ");
+ final SortedSet<String> setExtensions = new TreeSet<String>();
Collections.addAll(setExtensions, tabExtensions);
System.out.println("SharedContext: "+sharedContext);
System.out.println("SharedContext: "+setExtensions);
@@ -89,8 +89,8 @@ public class TestGLExtensionQueryOffscreen {
} finally {
context.release();
}
- String[] tabExtensions = extensions.split(" ");
- SortedSet<String> setExtensions = new TreeSet<String>();
+ final String[] tabExtensions = extensions.split(" ");
+ final SortedSet<String> setExtensions = new TreeSet<String>();
Collections.addAll(setExtensions, tabExtensions);
System.out.println("DefaultContext: "+context);
System.out.println("DefaultContext: "+setExtensions);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug651NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug651NEWT.java
index 5efe21e16..6359b87f8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug651NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug651NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import com.jogamp.newt.opengl.GLWindow;
@@ -34,6 +34,7 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
import javax.media.opengl.GL;
import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL2ES3;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
@@ -50,11 +51,11 @@ import org.junit.runners.MethodSorters;
/**
* Some GL state values are broken w/ Mesa 9.0 w/ multiple different context.
* <p>
- * This bug lies within Mesa3D (any renderer) and is fixed in
+ * This bug lies within Mesa3D (any renderer) and is fixed in
* commit 8dc79ae7d73cf6711c2182ff9a5d37ef6c989d23.
* </p>
* <p>
- * Mesa3D Version 9.0 still exposes this bug,
+ * Mesa3D Version 9.0 still exposes this bug,
* where 9.0.1 has it fixed w/ above commit.
* </p>
* <https://jogamp.org/bugzilla/show_bug.cgi?id=651>
@@ -75,7 +76,7 @@ public class TestGLMesaBug651NEWT extends UITestCase {
class UnitTester implements GLEventListener {
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
final GL gl = drawable.getGL();
System.err.println("GL UnitTester");
System.err.println(" GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
@@ -86,37 +87,37 @@ public class TestGLMesaBug651NEWT extends UITestCase {
System.err.println(" GL Profile: "+gl.getGLProfile());
System.err.println(" GL Renderer Quirks:" + gl.getContext().getRendererQuirks().toString());
System.err.println(" GL:" + gl + ", " + gl.getContext().getGLVersion());
-
+
final int _glerr = gl.glGetError(); // clear pre-error
System.err.println(" - pre GL-Error 0x"+Integer.toHexString(_glerr));
-
- final int[] val = new int[1];
+
+ final int[] val = new int[1];
final int[] glerr = new int[] { GL.GL_NO_ERROR, GL.GL_NO_ERROR, GL.GL_NO_ERROR, GL.GL_NO_ERROR, GL.GL_NO_ERROR };
- int i=0;
-
+ int i=0;
+
val[0]=0;
gl.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, val, 0);
- System.out.println(" - GL_MAX_TEXTURE_SIZE: " + val[0]);
+ System.out.println(" - GL_MAX_TEXTURE_SIZE: " + val[0]);
glerr[i] = gl.glGetError(); // clear pre-error
System.err.println(" - GL-Error 0x"+Integer.toHexString(glerr[i]));
i++;
-
+
val[0]=0;
- gl.glGetIntegerv(GL2ES2.GL_ACTIVE_TEXTURE, val, 0);
- System.out.println(" - GL_ACTIVE_TEXTURE: " + val[0]);
+ gl.glGetIntegerv(GL.GL_ACTIVE_TEXTURE, val, 0);
+ System.out.println(" - GL_ACTIVE_TEXTURE: " + val[0]);
glerr[i] = gl.glGetError(); // clear pre-error
System.err.println(" - GL-Error 0x"+Integer.toHexString(glerr[i]));
i++;
-
+
if(gl.isGL2ES2()) {
val[0]=0;
gl.glGetIntegerv(GL2ES2.GL_MAX_TEXTURE_IMAGE_UNITS, val, 0);
- System.out.println(" - GL_MAX_TEXTURE_IMAGE_UNITS: " + val[0]);
+ System.out.println(" - GL_MAX_TEXTURE_IMAGE_UNITS: " + val[0]);
glerr[i] = gl.glGetError(); // clear pre-error
System.err.println(" - GL-Error 0x"+Integer.toHexString(glerr[i]));
}
i++;
-
+
if( gl.hasFullFBOSupport() || gl.isExtensionAvailable(GLExtensions.NV_fbo_color_attachments) ) {
val[0]=0;
gl.glGetIntegerv(GL2ES2.GL_MAX_COLOR_ATTACHMENTS, val, 0);
@@ -125,24 +126,24 @@ public class TestGLMesaBug651NEWT extends UITestCase {
System.err.println(" - GL-Error 0x"+Integer.toHexString(glerr[i]));
}
i++;
-
+
if( gl.hasFullFBOSupport() ) {
val[0]=0;
- gl.glGetIntegerv(GL2GL3.GL_MAX_SAMPLES, val, 0);
+ gl.glGetIntegerv(GL2ES3.GL_MAX_SAMPLES, val, 0);
System.out.println(" - GL_MAX_SAMPLES: " + val[0]);
glerr[i] = gl.glGetError(); // clear pre-error
System.err.println(" - GL-Error 0x"+Integer.toHexString(glerr[i]));
}
i++;
-
+
boolean ok = true;
String res="";
for(int j=0; j<i; j++) {
- switch(j) {
+ switch(j) {
case 0: res += "GL_MAX_TEXTURE_SIZE"; break;
case 1: res += "GL_ACTIVE_TEXTURE"; break;
case 2: res += "GL_MAX_TEXTURE_IMAGE_UNITS"; break;
- case 3: res += "GL_MAX_COLOR_ATTACHMENTS"; break;
+ case 3: res += "GL_MAX_COLOR_ATTACHMENTS"; break;
case 4: res += "GL_MAX_SAMPLES"; break;
}
if(GL.GL_NO_ERROR == glerr[j]) {
@@ -156,70 +157,70 @@ public class TestGLMesaBug651NEWT extends UITestCase {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
- }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ }
}
-
- protected void runTestGL(GLCapabilities caps) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+
+ protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle(getSimpleTestName("."));
- UnitTester demo = new UnitTester();
-
+ final UnitTester demo = new UnitTester();
+
glWindow.addGLEventListener(demo);
glWindow.setSize(width, height);
- glWindow.setVisible(true);
+ glWindow.setVisible(true);
glWindow.display();
-
+
glWindow.destroy();
}
-
+
@Test
public void test01_ES1() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GLES1)) { System.err.println("GLES1 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
runTestGL(caps);
}
-
+
@Test
public void test02__ES2() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GLES2)) { System.err.println("GLES2 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
runTestGL(caps);
}
-
+
@Test
public void test03_GL2() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GL2)) { System.err.println("GL2 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
runTestGL(caps);
}
-
+
@Test
public void test04_GL3() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GL3)) { System.err.println("GL3 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL3));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL3));
runTestGL(caps);
}
-
+
@Test
public void test05_GL4() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GL4)) { System.err.println("GL4 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL4));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL4));
runTestGL(caps);
}
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestGLMesaBug651NEWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug658NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug658NEWT.java
index cb225b96f..a91eae04c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug658NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug658NEWT.java
@@ -20,11 +20,11 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
/**
* The 3.1 compatibility context on Mesa >= 9.0 seems to be broken.
* <p>
- * This bug lies within Mesa3D (any renderer) and is fixed in
+ * This bug lies within Mesa3D (any renderer) and is fixed in
* commit ??? (not yet).
* </p>
* <p>
- * Mesa3D Version 9.0 still exposes this bug,
+ * Mesa3D Version 9.0 still exposes this bug,
* where 9.?.? has it fixed w/ above commit.
* </p>
* <https://jogamp.org/bugzilla/show_bug.cgi?id=658>
@@ -36,25 +36,25 @@ public class TestGLMesaBug658NEWT extends UITestCase {
public void test00ShowAvailProfiles() {
System.err.println(JoglVersion.getDefaultOpenGLInfo(null, null, false).toString());
}
-
+
@Test
public void test10GL2PolygonModeFailure() {
testGLNPolygonModeFailureImpl(GLProfile.GL2);
}
-
+
@Test
public void test11GL3bcPolygonModeFailure() {
testGLNPolygonModeFailureImpl(GLProfile.GL3bc);
}
-
+
@Test
public void test12GL3PolygonModeFailure() {
testGLNPolygonModeFailureImpl(GLProfile.GL3);
}
-
- private void testGLNPolygonModeFailureImpl(String profile) {
+
+ private void testGLNPolygonModeFailureImpl(final String profile) {
if(!GLProfile.isAvailable(profile)) { System.err.println(profile+" n/a"); return; }
-
+
final GLProfile pro = GLProfile.get(profile);
final GLCapabilities caps = new GLCapabilities(pro);
final GLWindow window = GLWindow.create(caps);
@@ -82,7 +82,7 @@ public class TestGLMesaBug658NEWT extends UITestCase {
System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));
System.err.println("GL Renderer Quirks:" + gl.getContext().getRendererQuirks().toString());
-
+
if( gl.isGL2() || gl.isGLES2() ) { // compatibility profile || ES2
gl.glPolygonMode(GL.GL_FRONT, GL2GL3.GL_FILL);
} else {
@@ -113,24 +113,24 @@ public class TestGLMesaBug658NEWT extends UITestCase {
}
}
- @Test
+ @Test
public void test20GL2BindArrayAttributeFails() {
testGLNBindArrayAttributeFailsImpl(GLProfile.GL2);
}
-
- @Test
+
+ @Test
public void test21GL3bcBindArrayAttributeFails() {
testGLNBindArrayAttributeFailsImpl(GLProfile.GL3bc);
}
-
- @Test
+
+ @Test
public void test22GL3BindArrayAttributeFails() {
testGLNBindArrayAttributeFailsImpl(GLProfile.GL3);
}
-
- private void testGLNBindArrayAttributeFailsImpl(String profile) {
+
+ private void testGLNBindArrayAttributeFailsImpl(final String profile) {
if(!GLProfile.isAvailable(profile)) { System.err.println(profile+ " n/a"); return; }
-
+
final GLProfile pro = GLProfile.get(profile);
final GLCapabilities caps = new GLCapabilities(pro);
final GLWindow window = GLWindow.create(caps);
@@ -172,7 +172,7 @@ public class TestGLMesaBug658NEWT extends UITestCase {
gl.glEnableVertexAttribArray(1);
Assert.assertTrue(gl.glGetError() == GL.GL_NO_ERROR);
gl.glVertexAttribPointer(1, 4, GL.GL_FLOAT, false, 0, 0L);
- Assert.assertTrue(gl.glGetError() == GL.GL_NO_ERROR); // FIXME On Mesa 9.0.1 w/ GL 3.1 -> GL.GL_INVALID_OPERATION ?
+ Assert.assertTrue(gl.glGetError() == GL.GL_NO_ERROR); // FIXME On Mesa 9.0.1 w/ GL 3.1 -> GL.GL_INVALID_OPERATION ?
}
public void dispose(
@@ -194,10 +194,10 @@ public class TestGLMesaBug658NEWT extends UITestCase {
window.destroy();
}
}
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestGLMesaBug658NEWT.class.getName());
}
-
+
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLPointsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLPointsNEWT.java
index 7d3a7b896..fb6a50f7b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLPointsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLPointsNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import com.jogamp.newt.opengl.GLWindow;
@@ -59,8 +59,8 @@ public class TestGLPointsNEWT extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL0(GLCapabilities caps, PointsDemo demo) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+ protected void runTestGL0(final GLCapabilities caps, final PointsDemo demo) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle(getSimpleTestName("."));
@@ -71,87 +71,87 @@ public class TestGLPointsNEWT extends UITestCase {
glWindow.setSize(width, height);
glWindow.setVisible(true);
-
+
demo.setSmoothPoints(false);
snap.setMakeSnapshot();
snap.setPostSNDetail("flat");
glWindow.display();
-
+
demo.setSmoothPoints(true);
snap.setMakeSnapshot();
snap.setPostSNDetail("smooth");
glWindow.display();
-
- demo.setPointParams(2f, 40f, 0.01f, 0.0f, 0.01f, 1f);
+
+ demo.setPointParams(2f, 40f, 0.01f, 0.0f, 0.01f, 1f);
snap.setMakeSnapshot();
snap.setPostSNDetail("attn0");
glWindow.display();
-
+
glWindow.removeGLEventListener(demo);
-
+
glWindow.destroy();
}
-
- protected void runTestGL(GLCapabilities caps, PointsDemo demo, boolean forceFFPEmu) throws InterruptedException {
+
+ protected void runTestGL(final GLCapabilities caps, final PointsDemo demo, final boolean forceFFPEmu) throws InterruptedException {
// final PointsDemoES2 demo01 = new PointsDemoES2();
- runTestGL0(caps, demo);
+ runTestGL0(caps, demo);
}
@Test
public void test01FFP__GL2() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GL2)) { System.err.println("GL2 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
runTestGL(caps, new PointsDemoES1(), false);
}
-
+
@Test
public void test02FFP__ES1() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GLES1)) { System.err.println("GLES1 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
runTestGL(caps, new PointsDemoES1(), false);
}
-
+
@Test
public void test03FFP__ES2() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GLES2)) { System.err.println("GLES2 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
- PointsDemoES1 demo = new PointsDemoES1();
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
+ final PointsDemoES1 demo = new PointsDemoES1();
demo.setForceFFPEmu(true, false, false, false);
runTestGL(caps, demo, false);
}
-
+
@Test
public void test04FFP__GL2ES2() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GL2ES2)) { System.err.println("GL2ES2 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
- PointsDemoES1 demo = new PointsDemoES1();
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+ final PointsDemoES1 demo = new PointsDemoES1();
demo.setForceFFPEmu(true, false, false, false);
runTestGL(caps, demo, false);
}
-
+
@Test
public void test11GLSL_GL2() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GL2)) { System.err.println("GL2 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
runTestGL(caps, new PointsDemoES2(), false);
}
-
+
@Test
public void test12GLSL_ES2() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GLES2)) { System.err.println("GLES2 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
runTestGL(caps, new PointsDemoES2(), false); // should be FFPEmu implicit
}
-
+
static long duration = 1000; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestGLPointsNEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java
index df182c5d3..5861d4233 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java
@@ -47,7 +47,7 @@ public class TestGLProfile00NEWT extends UITestCase {
public void testInitSingleton() throws InterruptedException {
GLProfile.initSingleton();
System.err.println("Desktop");
- GLDrawableFactory desktopFactory = GLDrawableFactory.getDesktopFactory();
+ final GLDrawableFactory desktopFactory = GLDrawableFactory.getDesktopFactory();
if( null != desktopFactory ) {
System.err.println(JoglVersion.getDefaultOpenGLInfo(desktopFactory.getDefaultDevice(), null, false));
System.err.println(Platform.getNewline()+Platform.getNewline()+Platform.getNewline());
@@ -56,7 +56,7 @@ public class TestGLProfile00NEWT extends UITestCase {
}
System.err.println("EGL");
- GLDrawableFactory eglFactory = GLDrawableFactory.getEGLFactory();
+ final GLDrawableFactory eglFactory = GLDrawableFactory.getEGLFactory();
if( null != eglFactory ) {
System.err.println(JoglVersion.getDefaultOpenGLInfo(eglFactory.getDefaultDevice(), null, false));
} else {
@@ -64,8 +64,8 @@ public class TestGLProfile00NEWT extends UITestCase {
}
}
- public static void main(String args[]) throws IOException {
- String tstname = TestGLProfile00NEWT.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestGLProfile00NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
index 88d643aa6..633a2822e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
@@ -72,7 +72,7 @@ public class TestGLProfile01NEWT extends UITestCase {
}
}
- static void validate(GLProfile glp) {
+ static void validate(final GLProfile glp) {
final boolean gles3CompatAvail = GLContext.isGLES3CompatibleAvailable(GLProfile.getDefaultDevice());
if( glp.getImplName().equals(GLProfile.GL4bc) ) {
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4bc));
@@ -169,7 +169,7 @@ public class TestGLProfile01NEWT extends UITestCase {
}
}
- static void validate(GL gl) {
+ static void validate(final GL gl) {
final GLContext ctx = gl.getContext();
final boolean gles3CompatAvail = ctx.isGLES3Compatible();
@@ -282,7 +282,7 @@ public class TestGLProfile01NEWT extends UITestCase {
public void test01GLProfileDefault() throws InterruptedException {
System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
System.out.println("GLProfile.getDefaultDevice(): "+GLProfile.getDefaultDevice());
- GLProfile glp = GLProfile.getDefault();
+ final GLProfile glp = GLProfile.getDefault();
System.out.println("GLProfile.getDefault(): "+glp);
validate(glp);
dumpVersion(glp);
@@ -291,7 +291,7 @@ public class TestGLProfile01NEWT extends UITestCase {
@Test
public void test02GLProfileMaxProgrammable() throws InterruptedException {
// Assuming at least one programmable profile is available
- GLProfile glp = GLProfile.getMaxProgrammable(true);
+ final GLProfile glp = GLProfile.getMaxProgrammable(true);
System.out.println("GLProfile.getMaxProgrammable(): "+glp);
validate(glp);
dumpVersion(glp);
@@ -300,7 +300,7 @@ public class TestGLProfile01NEWT extends UITestCase {
@Test
public void test03GLProfileMaxFixedFunc() throws InterruptedException {
// Assuming at least one fixed function profile is available
- GLProfile glp = GLProfile.getMaxFixedFunc(true);
+ final GLProfile glp = GLProfile.getMaxFixedFunc(true);
System.out.println("GLProfile.getMaxFixedFunc(): "+glp);
validate(glp);
dumpVersion(glp);
@@ -312,7 +312,7 @@ public class TestGLProfile01NEWT extends UITestCase {
System.out.println("GLProfile GL2ES1 n/a");
return;
}
- GLProfile glp = GLProfile.getGL2ES1();
+ final GLProfile glp = GLProfile.getGL2ES1();
System.out.println("GLProfile GL2ES1: "+glp);
validate(glp);
dumpVersion(glp);
@@ -324,7 +324,7 @@ public class TestGLProfile01NEWT extends UITestCase {
System.out.println("GLProfile GL2ES2 n/a");
return;
}
- GLProfile glp = GLProfile.getGL2ES2();
+ final GLProfile glp = GLProfile.getGL2ES2();
System.out.println("GLProfile GL2ES2: "+glp);
validate(glp);
dumpVersion(glp);
@@ -336,15 +336,15 @@ public class TestGLProfile01NEWT extends UITestCase {
System.out.println("GLProfile GL4ES3 n/a");
return;
}
- GLProfile glp = GLProfile.getGL4ES3();
+ final GLProfile glp = GLProfile.getGL4ES3();
System.out.println("GLProfile GL4ES3: "+glp);
validate(glp);
dumpVersion(glp);
}
- void testSpecificProfile(String glps) throws InterruptedException {
+ void testSpecificProfile(final String glps) throws InterruptedException {
if(GLProfile.isAvailable(glps)) {
- GLProfile glp = GLProfile.get(glps);
+ final GLProfile glp = GLProfile.get(glps);
validate(glp);
dumpVersion(glp);
} else {
@@ -392,15 +392,15 @@ public class TestGLProfile01NEWT extends UITestCase {
testSpecificProfile(GLProfile.GLES3);
}
- protected void dumpVersion(GLProfile glp) throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
- GLWindow glWindow = GLWindow.create(caps);
+ protected void dumpVersion(final GLProfile glp) throws InterruptedException {
+ final GLCapabilities caps = new GLCapabilities(glp);
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle("TestGLProfile01NEWT");
glWindow.addGLEventListener(new GLEventListener() {
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
final GL gl = drawable.getGL();
System.err.println(JoglVersion.getGLStrings(gl, null, true));
@@ -446,13 +446,13 @@ public class TestGLProfile01NEWT extends UITestCase {
}
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
});
@@ -464,8 +464,8 @@ public class TestGLProfile01NEWT extends UITestCase {
glWindow.destroy();
}
- public static void main(String args[]) throws IOException {
- String tstname = TestGLProfile01NEWT.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestGLProfile01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLCanvasAWT.java
index 1da40728a..2b6c84bf3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLCanvasAWT.java
@@ -100,7 +100,7 @@ public class TestGLReadBuffer01GLCanvasAWT extends GLReadBuffer00Base {
frame.pack();
frame.setVisible(true);
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -118,34 +118,34 @@ public class TestGLReadBuffer01GLCanvasAWT extends GLReadBuffer00Base {
textRendererGLEL.userCounter = i + 1;
glad.display();
}
- try { Thread.sleep(duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(duration); } catch (final InterruptedException e) { }
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setSize(size1);
frame.validate();
} } );
- try { Thread.sleep(duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(duration); } catch (final InterruptedException e) { }
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setSize(size2);
frame.validate();
} } );
- try { Thread.sleep(duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(duration); } catch (final InterruptedException e) { }
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setSize(size0);
frame.validate();
} } );
- try { Thread.sleep(duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(duration); } catch (final InterruptedException e) { }
if( doSnapshot ) {
glad.disposeGLEventListener(snapshotGLEL, true /* remove */);
}
final Animator anim = new Animator(glad);
anim.start();
- try { Thread.sleep(2*duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(2*duration); } catch (final InterruptedException e) { }
anim.stop();
- } catch (Exception e1) {
+ } catch (final Exception e1) {
e1.printStackTrace();
}
try {
@@ -153,7 +153,7 @@ public class TestGLReadBuffer01GLCanvasAWT extends GLReadBuffer00Base {
public void run() {
frame.dispose();
} } );
- } catch (Exception e1) {
+ } catch (final Exception e1) {
e1.printStackTrace();
}
}
@@ -182,22 +182,22 @@ public class TestGLReadBuffer01GLCanvasAWT extends GLReadBuffer00Base {
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
defAutoSwapMode = drawable.getAutoSwapBufferMode();
swapBuffersBeforeRead = GLDrawableUtil.swapBuffersBeforeRead(drawable.getChosenGLCapabilities());
drawable.setAutoSwapBufferMode( !swapBuffersBeforeRead );
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
drawable.setAutoSwapBufferMode( defAutoSwapMode );
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
snapshot(i++, drawable.getGL(), TextureIO.PNG, null);
}
- public void snapshot(int sn, GL gl, String fileSuffix, String destPath) {
+ public void snapshot(final int sn, final GL gl, final String fileSuffix, final String destPath) {
final GLDrawable drawable = gl.getContext().getGLReadDrawable();
final String postSNDetail = String.format("awt-usr%03d", textRendererGLEL.userCounter);
final String filenameAWT = getSnapshotFilename(sn, postSNDetail,
@@ -219,7 +219,7 @@ public class TestGLReadBuffer01GLCanvasAWT extends GLReadBuffer00Base {
final File fout = new File(filenameAWT);
try {
ImageIO.write(image, "png", fout);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
/**
@@ -235,7 +235,7 @@ public class TestGLReadBuffer01GLCanvasAWT extends GLReadBuffer00Base {
static boolean doSnapshot = true;
static boolean keyFrame = false;
- public static void main(String[] args) {
+ public static void main(final String[] args) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLJPanelAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLJPanelAWT.java
index 633a54ecc..7f5755fc7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLJPanelAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLJPanelAWT.java
@@ -98,7 +98,7 @@ public class TestGLReadBuffer01GLJPanelAWT extends GLReadBuffer00Base {
frame.pack();
frame.setVisible(true);
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -116,34 +116,34 @@ public class TestGLReadBuffer01GLJPanelAWT extends GLReadBuffer00Base {
textRendererGLEL.userCounter = i + 1;
glad.display();
}
- try { Thread.sleep(duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(duration); } catch (final InterruptedException e) { }
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setSize(size1);
frame.validate();
} } );
- try { Thread.sleep(duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(duration); } catch (final InterruptedException e) { }
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setSize(size2);
frame.validate();
} } );
- try { Thread.sleep(duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(duration); } catch (final InterruptedException e) { }
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setSize(size0);
frame.validate();
} } );
- try { Thread.sleep(duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(duration); } catch (final InterruptedException e) { }
if( doSnapshot ) {
glad.disposeGLEventListener(snapshotGLEL, true /* remove */);
}
final Animator anim = new Animator(glad);
anim.start();
- try { Thread.sleep(2*duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(2*duration); } catch (final InterruptedException e) { }
anim.stop();
- } catch (Exception e1) {
+ } catch (final Exception e1) {
e1.printStackTrace();
}
try {
@@ -151,7 +151,7 @@ public class TestGLReadBuffer01GLJPanelAWT extends GLReadBuffer00Base {
public void run() {
frame.dispose();
} } );
- } catch (Exception e1) {
+ } catch (final Exception e1) {
e1.printStackTrace();
}
}
@@ -184,22 +184,22 @@ public class TestGLReadBuffer01GLJPanelAWT extends GLReadBuffer00Base {
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
defAutoSwapMode = drawable.getAutoSwapBufferMode();
swapBuffersBeforeRead = GLDrawableUtil.swapBuffersBeforeRead(drawable.getChosenGLCapabilities());
drawable.setAutoSwapBufferMode( !swapBuffersBeforeRead );
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
drawable.setAutoSwapBufferMode( defAutoSwapMode );
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
snapshot(i++, drawable.getGL(), TextureIO.PNG, null);
}
- public void snapshot(int sn, GL gl, String fileSuffix, String destPath) {
+ public void snapshot(final int sn, final GL gl, final String fileSuffix, final String destPath) {
final GLDrawable drawable = gl.getContext().getGLReadDrawable();
final String postSNDetail = String.format("awt-usr%03d", textRendererGLEL.userCounter);
final String filenameAWT = getSnapshotFilename(sn, postSNDetail,
@@ -221,7 +221,7 @@ public class TestGLReadBuffer01GLJPanelAWT extends GLReadBuffer00Base {
final File fout = new File(filenameAWT);
try {
ImageIO.write(image, "png", fout);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
/**
@@ -237,7 +237,7 @@ public class TestGLReadBuffer01GLJPanelAWT extends GLReadBuffer00Base {
static boolean doSnapshot = true;
static boolean keyFrame = false;
- public static void main(String[] args) {
+ public static void main(final String[] args) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLWindowNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLWindowNEWT.java
index e6ce9e548..8e0e6bfb9 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLWindowNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLWindowNEWT.java
@@ -82,7 +82,7 @@ public class TestGLReadBuffer01GLWindowNEWT extends GLReadBuffer00Base {
glad.addGLEventListener(snapshotGLEL);
}
glad.setVisible(true);
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -99,22 +99,22 @@ public class TestGLReadBuffer01GLWindowNEWT extends GLReadBuffer00Base {
textRendererGLEL.userCounter = i + 1;
glad.display();
}
- try { Thread.sleep(duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(duration); } catch (final InterruptedException e) { }
glad.setSize(size1.getWidth(), size1.getHeight());
- try { Thread.sleep(duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(duration); } catch (final InterruptedException e) { }
glad.setSize(size2.getWidth(), size2.getHeight());
- try { Thread.sleep(duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(duration); } catch (final InterruptedException e) { }
glad.setSize(size0.getWidth(), size0.getHeight());
- try { Thread.sleep(duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(duration); } catch (final InterruptedException e) { }
if( doSnapshot ) {
glad.disposeGLEventListener(snapshotGLEL, true /* remove */);
}
final Animator anim = new Animator(glad);
anim.start();
- try { Thread.sleep(2*duration); } catch (InterruptedException e) { }
+ try { Thread.sleep(2*duration); } catch (final InterruptedException e) { }
anim.stop();
- } catch (Exception e1) {
+ } catch (final Exception e1) {
e1.printStackTrace();
}
glad.destroy();
@@ -136,22 +136,22 @@ public class TestGLReadBuffer01GLWindowNEWT extends GLReadBuffer00Base {
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
defAutoSwapMode = drawable.getAutoSwapBufferMode();
swapBuffersBeforeRead = GLDrawableUtil.swapBuffersBeforeRead(drawable.getChosenGLCapabilities());
drawable.setAutoSwapBufferMode( !swapBuffersBeforeRead );
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
drawable.setAutoSwapBufferMode( defAutoSwapMode );
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
snapshot(i++, drawable, TextureIO.PNG, null);
}
- public void snapshot(int sn, GLAutoDrawable drawable, String fileSuffix, String destPath) {
+ public void snapshot(final int sn, final GLAutoDrawable drawable, final String fileSuffix, final String destPath) {
final GL gl = drawable.getGL();
final String postSNDetail = String.format("jgl-usr%03d", textRendererGLEL.userCounter);
final String filenameJGL = getSnapshotFilename(sn, postSNDetail,
@@ -178,7 +178,7 @@ public class TestGLReadBuffer01GLWindowNEWT extends GLReadBuffer00Base {
static boolean doSnapshot = true;
static boolean keyFrame = false;
- public static void main(String[] args) {
+ public static void main(final String[] args) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java
index 7ae49fe54..44c937251 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import java.io.IOException;
@@ -75,20 +75,20 @@ public class TestGLVersionParsing00NEWT extends UITestCase {
"OpenGL 2.1 LaLa", // 3
"4.2.11762 Compatibility Profile Context" // 4
};
-
+
public static final VersionNumberString[] glVersionNumbers = new VersionNumberString[] {
- new VersionNumberString(2, 1, 0, glVersionStrings00[0]),
- new VersionNumberString(2, 1, 0, glVersionStrings00[1]),
+ new VersionNumberString(2, 1, 0, glVersionStrings00[0]),
+ new VersionNumberString(2, 1, 0, glVersionStrings00[1]),
new VersionNumberString(4, 2, 0, glVersionStrings00[2]),
new VersionNumberString(4, 2, 0, glVersionStrings00[3]),
- new VersionNumberString(2, 1, 0, glVersionStrings00[4]),
+ new VersionNumberString(2, 1, 0, glVersionStrings00[4]),
new VersionNumberString(4, 2, 0, glVersionStrings00[5]),
new VersionNumberString(4, 2, 0, glVersionStrings00[6]),
new VersionNumberString(2, 0, 0, glVersionStrings00[7]),
new VersionNumberString(2, 0, 0, glVersionStrings00[8]),
new VersionNumberString(2, 0, 0, glVersionStrings00[9]),
new VersionNumberString(2, 0, 0, glVersionStrings00[10]),
-
+
new VersionNumberString(2, 1, 0, glVersionStrings01[0]),
new VersionNumberString(2, 1, 0, glVersionStrings01[1]),
new VersionNumberString(2, 1, 0, glVersionStrings01[2]),
@@ -99,7 +99,7 @@ public class TestGLVersionParsing00NEWT extends UITestCase {
new VersionNumberString(2, 0, 0, glVersionStrings01[7]),
new VersionNumberString(2, 0, 0, glVersionStrings01[8]),
new VersionNumberString(2, 0, 0, glVersionStrings01[9]),
-
+
new VersionNumberString(2, 1, 0, glVersionStrings02[0]),
new VersionNumberString(2, 0, 0, glVersionStrings02[1]),
new VersionNumberString(2, 0, 0, glVersionStrings02[2]),
@@ -135,10 +135,10 @@ public class TestGLVersionParsing00NEWT extends UITestCase {
new VersionNumberString(0, 0, 0, glVersionStrings02[0]),
new VersionNumberString(0, 0, 0, glVersionStrings02[1]),
new VersionNumberString(0, 0, 0, glVersionStrings02[2]),
- new VersionNumberString(0, 0, 0, glVersionStrings02[3]),
- new VersionNumberString(0, 0, 0, glVersionStrings02[4])
+ new VersionNumberString(0, 0, 0, glVersionStrings02[3]),
+ new VersionNumberString(0, 0, 0, glVersionStrings02[4])
};
-
+
@Test
public void test01GLVersion() throws InterruptedException {
for(int i=0; i<glVersionNumbers.length; i++) {
@@ -166,7 +166,7 @@ public class TestGLVersionParsing00NEWT extends UITestCase {
Assert.assertTrue(!has.hasMinor());
Assert.assertTrue(!has.hasSub());
Assert.assertTrue(!has.isValid());
- }
+ }
{
final GLVersionNumber has = GLVersionNumber.create("GL Nope");
System.err.println("Test-X3: "+has+", valid "+has.isValid()+", define ["+has.hasMajor()+":"+has.hasMinor()+":"+has.hasSub()+"]");
@@ -174,10 +174,10 @@ public class TestGLVersionParsing00NEWT extends UITestCase {
Assert.assertTrue(!has.hasMinor());
Assert.assertTrue(!has.hasSub());
Assert.assertTrue(!has.isValid());
- }
+ }
}
- private void testGLVendorVersionImpl(VersionNumberString[] versionNumberString, boolean withMajor, boolean withMinor, boolean withSub) throws InterruptedException {
+ private void testGLVendorVersionImpl(final VersionNumberString[] versionNumberString, final boolean withMajor, final boolean withMinor, final boolean withSub) throws InterruptedException {
for(int i=0; i<versionNumberString.length; i++) {
final VersionNumberString exp = versionNumberString[i];
final VersionNumberString has = GLVersionNumber.createVendorVersion(exp.getVersionString());
@@ -188,16 +188,16 @@ public class TestGLVersionParsing00NEWT extends UITestCase {
Assert.assertEquals(exp, has);
}
}
-
+
@Test
public void test02GLVendorVersion() throws InterruptedException {
testGLVendorVersionImpl(glVendorVersionNumbersWithSub, true, true, true);
testGLVendorVersionImpl(glVendorVersionNumbersNoSub, true, true, false);
testGLVendorVersionImpl(glVendorVersionNumbersNone, false, false, false);
}
-
- public static void main(String args[]) throws IOException {
- String tstname = TestGLVersionParsing00NEWT.class.getName();
+
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestGLVersionParsing00NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java
index 173df57f6..1f9e6e877 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java
@@ -50,17 +50,17 @@ import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestGPUMemSec01NEWT extends UITestCase {
- static String hexString(int i) {
+ static String hexString(final int i) {
return "0x"+Integer.toHexString(i);
}
- static String exceptionMsg(String pre, int format, int type, int components, int width, int height, int rl1, int rl4, int rl8) {
+ static String exceptionMsg(final String pre, final int format, final int type, final int components, final int width, final int height, final int rl1, final int rl4, final int rl8) {
return pre +
": fmt "+hexString(format)+", type "+hexString(type)+", comps "+components+
", "+width+"x"+height+
", rowlenA1 "+rl1+", rowlenA4 "+rl4+", rowlenA8 "+rl8;
}
- static NEWTGLContext.WindowContext createCurrentGLOffscreenWindow(GLProfile glp, int width, int height) throws GLException, InterruptedException {
+ static NEWTGLContext.WindowContext createCurrentGLOffscreenWindow(final GLProfile glp, final int width, final int height) throws GLException, InterruptedException {
final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOffscreenWindow(
new GLCapabilities(glp), width, height, true);
final GL gl = winctx.context.getGL();
@@ -80,7 +80,7 @@ public class TestGPUMemSec01NEWT extends UITestCase {
return winctx;
}
- static int readPixelsCheck(GL gl, int format, int type, int components, int width, int height) throws InterruptedException {
+ static int readPixelsCheck(final GL gl, final int format, final int type, final int components, final int width, final int height) throws InterruptedException {
int expectedExceptions = 0;
final int rowlenA1 = width * components;
@@ -91,17 +91,17 @@ public class TestGPUMemSec01NEWT extends UITestCase {
final int rowlenA8 = ( ( width * components + 7 ) / 8 ) * 8 ;
Assert.assertTrue(rowlenA8 % 8 == 0);
- GLPixelStorageModes psm = new GLPixelStorageModes();
+ final GLPixelStorageModes psm = new GLPixelStorageModes();
psm.setPackAlignment(gl, 1);
Exception ee = null;
// ok size !
try {
- ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1);
+ final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1);
gl.glReadPixels(0, 0, width, height, format, type, bb);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- } catch(IndexOutOfBoundsException e) {
+ } catch(final IndexOutOfBoundsException e) {
ee = e;
}
Assert.assertNull(
@@ -112,10 +112,10 @@ public class TestGPUMemSec01NEWT extends UITestCase {
// too small -10 !
try {
- ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1-10);
+ final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1-10);
gl.glReadPixels(0, 0, width, height, format, type, bb);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- } catch(IndexOutOfBoundsException e) {
+ } catch(final IndexOutOfBoundsException e) {
ee = e;
System.err.println(
exceptionMsg("OK Expected IndexOutOfBoundsException (size-10 bytes)",
@@ -130,10 +130,10 @@ public class TestGPUMemSec01NEWT extends UITestCase {
// too small size/4 !
try {
- ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1/4);
+ final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1/4);
gl.glReadPixels(0, 0, width, height, format, type, bb);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- } catch(IndexOutOfBoundsException e) {
+ } catch(final IndexOutOfBoundsException e) {
ee = e;
System.err.println(
exceptionMsg("OK Expected IndexOutOfBoundsException (size/4 bytes)",
@@ -153,10 +153,10 @@ public class TestGPUMemSec01NEWT extends UITestCase {
// ok size !
try {
- ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA4);
+ final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA4);
gl.glReadPixels(0, 0, width, height, format, type, bb);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- } catch(IndexOutOfBoundsException e) {
+ } catch(final IndexOutOfBoundsException e) {
ee = e;
}
Assert.assertNull(
@@ -166,10 +166,10 @@ public class TestGPUMemSec01NEWT extends UITestCase {
// too small if rowlenA1%4 > 0
try {
- ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1);
+ final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1);
gl.glReadPixels(0, 0, width, height, format, type, bb);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- } catch(IndexOutOfBoundsException e) {
+ } catch(final IndexOutOfBoundsException e) {
ee = e;
if(rowlenA1%4>0) {
System.err.println(
@@ -194,10 +194,10 @@ public class TestGPUMemSec01NEWT extends UITestCase {
// ok size !
try {
- ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA8);
+ final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA8);
gl.glReadPixels(0, 0, width, height, format, type, bb);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- } catch(IndexOutOfBoundsException e) {
+ } catch(final IndexOutOfBoundsException e) {
ee = e;
}
Assert.assertNull(
@@ -207,10 +207,10 @@ public class TestGPUMemSec01NEWT extends UITestCase {
// too small if rowlenA1%8 > 0
try {
- ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1);
+ final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1);
gl.glReadPixels(0, 0, width, height, format, type, bb);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- } catch(IndexOutOfBoundsException e) {
+ } catch(final IndexOutOfBoundsException e) {
ee = e;
if(rowlenA1%8>0) {
System.err.println(
@@ -238,7 +238,7 @@ public class TestGPUMemSec01NEWT extends UITestCase {
@Test
public void testReadPixelsGL_640x480xRGBAxUB() throws InterruptedException {
- GLProfile glp = GLProfile.getDefault();
+ final GLProfile glp = GLProfile.getDefault();
final int width = 640;
final int height= 480;
@@ -258,7 +258,7 @@ public class TestGPUMemSec01NEWT extends UITestCase {
@Test
public void testReadPixelsGL_99x100xRGBxUB() throws InterruptedException {
- GLProfile glp = GLProfile.getGL2ES2();
+ final GLProfile glp = GLProfile.getGL2ES2();
final int wwidth = 640;
final int wheight= 480;
final int rwidth = 99;
@@ -280,7 +280,7 @@ public class TestGPUMemSec01NEWT extends UITestCase {
@Test
public void testReadPixelsGL2GL3_640x480xRGBxUB() throws InterruptedException {
- GLProfile glp = GLProfile.getGL2ES2();
+ final GLProfile glp = GLProfile.getGL2ES2();
if(!glp.isGL2ES3()) {
System.err.println("GL2ES3 n/a skip test");
return;
@@ -304,7 +304,7 @@ public class TestGPUMemSec01NEWT extends UITestCase {
@Test
public void testReadPixelsGL2GL3_99x100xRGBxUB() throws InterruptedException {
- GLProfile glp = GLProfile.getGL2ES2();
+ final GLProfile glp = GLProfile.getGL2ES2();
if(!glp.isGL2ES3()) {
System.err.println("GL2ES3 n/a skip test");
return;
@@ -330,7 +330,7 @@ public class TestGPUMemSec01NEWT extends UITestCase {
@Test
public void testReadPixelsGL2GL3_640x480xREDxUB() throws InterruptedException {
- GLProfile glp = GLProfile.getGL2ES2();
+ final GLProfile glp = GLProfile.getGL2ES2();
if(!glp.isGL2ES3()) {
System.err.println("GL2ES3 n/a skip test");
return;
@@ -354,15 +354,15 @@ public class TestGPUMemSec01NEWT extends UITestCase {
@Test
public void testReadPixelsGL2GL3_102x100xREDxUB() throws InterruptedException {
- GLProfile glp = GLProfile.getGL2ES2();
+ final GLProfile glp = GLProfile.getGL2ES2();
if(!glp.isGL2ES3()) {
System.err.println("GL2ES3 n/a skip test");
return;
}
- int wwidth = 640;
- int wheight= 480;
- int rwidth = 102;
- int rheight= 100;
+ final int wwidth = 640;
+ final int wheight= 480;
+ final int rwidth = 102;
+ final int rheight= 100;
// preset ..
final NEWTGLContext.WindowContext winctx = createCurrentGLOffscreenWindow(glp, wwidth, wheight);
@@ -378,8 +378,8 @@ public class TestGPUMemSec01NEWT extends UITestCase {
NEWTGLContext.destroyWindow(winctx);
}
- public static void main(String args[]) throws IOException {
- String tstname = TestGPUMemSec01NEWT.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestGPUMemSec01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent01NEWT.java
index 7aca28006..2fc3071c6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent01NEWT.java
@@ -66,16 +66,16 @@ public class TestInitConcurrent01NEWT extends InitConcurrentBaseNEWT {
}
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
- String tstname = TestInitConcurrent01NEWT.class.getName();
+ final String tstname = TestInitConcurrent01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent02NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent02NEWT.java
index 67b3cef38..71796e5c2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent02NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import java.io.IOException;
@@ -46,7 +46,7 @@ import com.jogamp.common.os.Platform;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestInitConcurrent02NEWT extends InitConcurrentBaseNEWT {
static boolean mainRun = false;
-
+
@Test(timeout=180000) // TO 3 min
public void test02TwoThreads() throws InterruptedException {
if(!mainRun) {
@@ -55,7 +55,7 @@ public class TestInitConcurrent02NEWT extends InitConcurrentBaseNEWT {
}
runJOGLTasks(2, false);
}
-
+
@Test(timeout=180000) // TO 3 min
public void test02FourThreads() throws InterruptedException {
if(!mainRun) {
@@ -64,7 +64,7 @@ public class TestInitConcurrent02NEWT extends InitConcurrentBaseNEWT {
}
runJOGLTasks(4, false);
}
-
+
@Test(timeout=180000) // TO 3 min
public void test16SixteenThreads() throws InterruptedException {
if(!mainRun) {
@@ -78,9 +78,9 @@ public class TestInitConcurrent02NEWT extends InitConcurrentBaseNEWT {
runJOGLTasks( 6, false);
}
}
-
- public static void main(String args[]) throws IOException {
- mainRun = true;
+
+ public static void main(final String args[]) throws IOException {
+ mainRun = true;
for(int i=0; i<args.length; i++) {
if(args[i].equals("-normalRun")) {
mainRun = false;
@@ -88,10 +88,10 @@ public class TestInitConcurrent02NEWT extends InitConcurrentBaseNEWT {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
- String tstname = TestInitConcurrent02NEWT.class.getName();
+ final String tstname = TestInitConcurrent02NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java
index 5c60d094f..5f5053089 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import java.io.IOException;
@@ -47,8 +47,8 @@ public class TestMainVersionGLCanvasAWT extends UITestCase {
}
- public static void main(String args[]) throws IOException {
- String tstname = TestMainVersionGLCanvasAWT.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestMainVersionGLCanvasAWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLWindowNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLWindowNEWT.java
index 85de65e2a..3b9a8c97a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLWindowNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLWindowNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import java.io.IOException;
@@ -43,7 +43,7 @@ public class TestMainVersionGLWindowNEWT extends UITestCase {
@Test
public void testMain() throws InterruptedException {
- JoglVersion j = JoglVersion.getInstance();
+ final JoglVersion j = JoglVersion.getInstance();
System.out.println("Implementation-Version: "+j.getImplementationVersion());
System.out.println("Implementation-Build: "+j.getImplementationBuild());
System.out.println("Implementation-Branch: "+j.getImplementationBranch());
@@ -52,9 +52,9 @@ public class TestMainVersionGLWindowNEWT extends UITestCase {
}
- public static void main(String[] args) throws IOException {
+ public static void main(final String[] args) throws IOException {
TestMainVersionGLWindowNEWT.args = args;
- String tstname = TestMainVersionGLWindowNEWT.class.getName();
+ final String tstname = TestMainVersionGLWindowNEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMapBufferRead01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMapBufferRead01NEWT.java
index 23778ecf6..d94c24af0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMapBufferRead01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMapBufferRead01NEWT.java
@@ -63,7 +63,7 @@ public class TestMapBufferRead01NEWT extends UITestCase {
System.err.println("Test requires GL2/GL3 profile.");
return;
}
- ByteBuffer verticiesBB = ByteBuffer.allocate(4*9);
+ final ByteBuffer verticiesBB = ByteBuffer.allocate(4*9);
verticiesBB.order(ByteOrder.nativeOrder());
testWriteRead01(verticiesBB, false /* useRange */);
}
@@ -73,7 +73,7 @@ public class TestMapBufferRead01NEWT extends UITestCase {
System.err.println("Test requires GL2/GL3 profile.");
return;
}
- ByteBuffer verticiesBB = Buffers.newDirectByteBuffer(4*9);
+ final ByteBuffer verticiesBB = Buffers.newDirectByteBuffer(4*9);
testWriteRead01(verticiesBB, false /* useRange */);
}
@@ -83,7 +83,7 @@ public class TestMapBufferRead01NEWT extends UITestCase {
System.err.println("Test requires GL3 or GLES3 profile.");
return;
}
- ByteBuffer verticiesBB = ByteBuffer.allocate(4*9);
+ final ByteBuffer verticiesBB = ByteBuffer.allocate(4*9);
verticiesBB.order(ByteOrder.nativeOrder());
testWriteRead01(verticiesBB, true/* useRange */);
}
@@ -93,18 +93,18 @@ public class TestMapBufferRead01NEWT extends UITestCase {
System.err.println("Test requires GL3 or GLES3 profile.");
return;
}
- ByteBuffer verticiesBB = Buffers.newDirectByteBuffer(4*9);
+ final ByteBuffer verticiesBB = Buffers.newDirectByteBuffer(4*9);
testWriteRead01(verticiesBB, true /* useRange */);
}
- private void testWriteRead01(ByteBuffer verticiesBB, boolean useRange) throws InterruptedException {
+ private void testWriteRead01(final ByteBuffer verticiesBB, final boolean useRange) throws InterruptedException {
final GLProfile glp = GLProfile.getMaxProgrammable(true);
final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOffscreenWindow(
new GLCapabilities(glp), 800, 600, true);
try {
final GL gl = winctx.context.getGL();
- int[] vertexBuffer = new int[1];
+ final int[] vertexBuffer = new int[1];
verticiesBB.putFloat(-0.3f);
verticiesBB.putFloat(-0.2f);
@@ -171,8 +171,8 @@ public class TestMapBufferRead01NEWT extends UITestCase {
NEWTGLContext.destroyWindow(winctx);
}
}
- public static void main(String args[]) throws IOException {
- String tstname = TestMapBufferRead01NEWT.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestMapBufferRead01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNEWTCloseX11DisplayBug565.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNEWTCloseX11DisplayBug565.java
index 83e55b7e0..f91e34c12 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNEWTCloseX11DisplayBug565.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNEWTCloseX11DisplayBug565.java
@@ -36,9 +36,9 @@ public class TestNEWTCloseX11DisplayBug565 {
open0 = 0;
}
- GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault( ) );
+ final GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault( ) );
- GLWindow window = GLWindow.create(caps);
+ final GLWindow window = GLWindow.create(caps);
window.setTitle("NEWT Resource X11 Leak - #" + j );
window.setSize( 128, 128 );
window.setVisible(true);
@@ -56,7 +56,7 @@ public class TestNEWTCloseX11DisplayBug565 {
}
}
}
- catch ( Exception e ) {
+ catch ( final Exception e ) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
@@ -75,10 +75,10 @@ public class TestNEWTCloseX11DisplayBug565 {
open0 = 0;
}
final GLProfile glp = GLProfile.getDefault( );
- GLCapabilitiesImmutable caps = new GLCapabilities( glp );
+ final GLCapabilitiesImmutable caps = new GLCapabilities( glp );
- GLPbuffer buffer = GLDrawableFactory.getFactory( glp ).createGLPbuffer(
+ final GLPbuffer buffer = GLDrawableFactory.getFactory( glp ).createGLPbuffer(
null,
caps,
new DefaultGLCapabilitiesChooser(),
@@ -99,7 +99,7 @@ public class TestNEWTCloseX11DisplayBug565 {
}
}
}
- catch ( Exception e ) {
+ catch ( final Exception e ) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
@@ -117,10 +117,10 @@ public class TestNEWTCloseX11DisplayBug565 {
open0 = 0;
}
final GLProfile glp = GLProfile.getDefault( );
- GLCapabilitiesImmutable caps = new GLCapabilities( glp );
+ final GLCapabilitiesImmutable caps = new GLCapabilities( glp );
- GLOffscreenAutoDrawable buffer = GLDrawableFactory.getFactory( glp ).createOffscreenAutoDrawable(
+ final GLOffscreenAutoDrawable buffer = GLDrawableFactory.getFactory( glp ).createOffscreenAutoDrawable(
null, caps, new DefaultGLCapabilitiesChooser(), 256, 256);
buffer.display();
buffer.destroy();
@@ -135,13 +135,13 @@ public class TestNEWTCloseX11DisplayBug565 {
}
}
}
- catch ( Exception e ) {
+ catch ( final Exception e ) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestNEWTCloseX11DisplayBug565.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNVSwapGroupNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNVSwapGroupNEWT.java
index e41f22ab0..b0c6bd670 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNVSwapGroupNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNVSwapGroupNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import com.jogamp.newt.opengl.GLWindow;
@@ -63,31 +63,31 @@ public class TestNVSwapGroupNEWT extends UITestCase {
height = 256;
}
- protected GLWindow runTestGL(Animator animator, int x, int y, final int group, final int barrier) {
- GLWindow glWindow = GLWindow.create(caps);
+ protected GLWindow runTestGL(final Animator animator, final int x, final int y, final int group, final int barrier) {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y);
glWindow.setSize(width, height);
- GearsES2 gears = new GearsES2(1);
+ final GearsES2 gears = new GearsES2(1);
glWindow.addGLEventListener(new GLEventListener() {
- public void init(GLAutoDrawable drawable) {
- int[] maxVals = new int[] { -1, -1 } ;
- GLContext glc = drawable.getContext();
- boolean r = glc.queryMaxSwapGroups(maxVals, 0, maxVals, 1);
+ public void init(final GLAutoDrawable drawable) {
+ final int[] maxVals = new int[] { -1, -1 } ;
+ final GLContext glc = drawable.getContext();
+ final boolean r = glc.queryMaxSwapGroups(maxVals, 0, maxVals, 1);
System.err.println("swap group max groups "+maxVals[0]+", barriers "+maxVals[0]+", "+r);
if(maxVals[0]>=group) {
System.err.println("swap group joing 1: "+glc.joinSwapGroup(group));
if(maxVals[1]>=barrier) {
System.err.println("swap group bind 1-1: "+glc.bindSwapBarrier(group, barrier));
}
- }
+ }
}
- public void dispose(GLAutoDrawable drawable) {}
- public void display(GLAutoDrawable drawable) {}
- public void reshape(GLAutoDrawable drawable, int x, int y,
- int width, int height) {}
+ public void dispose(final GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {}
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y,
+ final int width, final int height) {}
});
glWindow.addGLEventListener(gears);
@@ -105,14 +105,14 @@ public class TestNVSwapGroupNEWT extends UITestCase {
@Test
public void test01() throws InterruptedException {
// make sure it won't be active for now !
- int swap_group = 9999;
- int swap_barrier = 9999;
-
- Animator animator = new Animator();
- GLWindow f1 = runTestGL(animator, 0, 0, swap_group, swap_barrier);
- InsetsImmutable insets = f1.getInsets();
- GLWindow f2 = runTestGL(animator, width+insets.getTotalWidth(), 0, swap_group, swap_barrier);
- animator.setUpdateFPSFrames(1, null);
+ final int swap_group = 9999;
+ final int swap_barrier = 9999;
+
+ final Animator animator = new Animator();
+ final GLWindow f1 = runTestGL(animator, 0, 0, swap_group, swap_barrier);
+ final InsetsImmutable insets = f1.getInsets();
+ final GLWindow f2 = runTestGL(animator, width+insets.getTotalWidth(), 0, swap_group, swap_barrier);
+ animator.setUpdateFPSFrames(1, null);
animator.start();
while(animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
Thread.sleep(100);
@@ -128,13 +128,13 @@ public class TestNVSwapGroupNEWT extends UITestCase {
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestNVSwapGroupNEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer01GLCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer01GLCanvasAWT.java
index c93e54eb9..f96886712 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer01GLCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer01GLCanvasAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import java.awt.BorderLayout;
@@ -80,32 +80,32 @@ public class TestOffscreenLayer01GLCanvasAWT extends UITestCase {
preferredGLSize = new Dimension(400,200);
}
- private void setupFrameAndShow(final Frame f, java.awt.Component comp) throws InterruptedException, InvocationTargetException {
-
- Container c = new Container();
+ private void setupFrameAndShow(final Frame f, final java.awt.Component comp) throws InterruptedException, InvocationTargetException {
+
+ final Container c = new Container();
c.setLayout(new BorderLayout());
c.add(new Button("north"), BorderLayout.NORTH);
c.add(new Button("south"), BorderLayout.SOUTH);
c.add(new Button("east"), BorderLayout.EAST);
c.add(new Button("west"), BorderLayout.WEST);
c.add(comp, BorderLayout.CENTER);
-
+
f.setLayout(new BorderLayout());
f.add(new Button("NORTH"), BorderLayout.NORTH);
f.add(new Button("SOUTH"), BorderLayout.SOUTH);
f.add(new Button("EAST"), BorderLayout.EAST);
f.add(new Button("WEST"), BorderLayout.WEST);
f.add(c, BorderLayout.CENTER);
-
+
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
f.pack();
f.validate();
f.setVisible(true);
- }});
+ }});
}
-
- private void end(GLAnimatorControl actrl, final Frame f, Window w) throws InterruptedException, InvocationTargetException {
+
+ private void end(final GLAnimatorControl actrl, final Frame f, final Window w) throws InterruptedException, InvocationTargetException {
actrl.stop();
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -119,33 +119,33 @@ public class TestOffscreenLayer01GLCanvasAWT extends UITestCase {
@Test
public void testInfo00() throws InterruptedException, InvocationTargetException {
System.err.println("Java Version: "+Platform.getJavaVersionNumber());
- System.err.println("OS Version: "+Platform.getOSVersionNumber());
+ System.err.println("OS Version: "+Platform.getOSVersionNumber());
System.err.println("JAWTUtil.isOffscreenLayerRequired(): "+JAWTUtil.isOffscreenLayerRequired());
System.err.println("JAWTUtil.isOffscreenLayerSupported(): "+JAWTUtil.isOffscreenLayerSupported());
}
-
+
@Test
- public void test01_GLDefault() throws InterruptedException, InvocationTargetException {
+ public void test01_GLDefault() throws InterruptedException, InvocationTargetException {
testOffscreenLayerGLCanvas_Impl(null);
}
-
+
@Test
- public void test01_GL3() throws InterruptedException, InvocationTargetException {
+ public void test01_GL3() throws InterruptedException, InvocationTargetException {
if( !GLProfile.isAvailable(GLProfile.GL3) ) {
System.err.println("GL3 n/a");
return;
}
testOffscreenLayerGLCanvas_Impl(GLProfile.get(GLProfile.GL3));
}
-
- private void testOffscreenLayerGLCanvas_Impl(GLProfile glp) throws InterruptedException, InvocationTargetException {
+
+ private void testOffscreenLayerGLCanvas_Impl(final GLProfile glp) throws InterruptedException, InvocationTargetException {
if(!JAWTUtil.isOffscreenLayerSupported()) {
System.err.println("offscreen layer n/a");
return;
- }
+ }
final Frame frame1 = new Frame("AWT Parent Frame");
-
- GLCapabilities caps = new GLCapabilities(glp);
+
+ final GLCapabilities caps = new GLCapabilities(glp);
if(singleBuffer) {
caps.setDoubleBuffered(false);
}
@@ -162,20 +162,20 @@ public class TestOffscreenLayer01GLCanvasAWT extends UITestCase {
glc.setPreferredSize(preferredGLSize);
glc.setMinimumSize(preferredGLSize);
glc.setSize(preferredGLSize);
-
- GearsES2 demo1 = new GearsES2(swapInterval);
+
+ final GearsES2 demo1 = new GearsES2(swapInterval);
if(noAnimation) {
demo1.setDoRotation(false);
}
glc.addGLEventListener(demo1);
-
+
frame1.setSize(frameSize0);
setupFrameAndShow(frame1, glc);
Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc, true));
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(glc, true));
Assert.assertEquals(true, glc.isOffscreenLayerSurfaceEnabled());
-
- GLAnimatorControl animator1 = new Animator(glc);
+
+ final GLAnimatorControl animator1 = new Animator(glc);
if(!noAnimation) {
animator1.start();
}
@@ -187,20 +187,20 @@ public class TestOffscreenLayer01GLCanvasAWT extends UITestCase {
frame1.setSize(frameSize1);
frame1.pack();
frame1.validate();
- }});
-
+ }});
+
Thread.sleep(durationPerTest/2);
-
- end(animator1, frame1, null);
+
+ end(animator1, frame1, null);
if( waitForKey ) {
UITestCase.waitForKey("Continue");
}
}
-
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
- Window window = glWindow.getDelegatedWindow();
+ final Window window = glWindow.getDelegatedWindow();
if(debug) {
MiscUtils.setFieldIfExists(demo, "glDebug", true);
MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -210,15 +210,15 @@ public class TestOffscreenLayer01GLCanvasAWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
@@ -240,7 +240,7 @@ public class TestOffscreenLayer01GLCanvasAWT extends UITestCase {
if(waitForKey) {
UITestCase.waitForKey("Start");
}
- String tstname = TestOffscreenLayer01GLCanvasAWT.class.getName();
+ final String tstname = TestOffscreenLayer01GLCanvasAWT.class.getName();
/*
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer02NewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer02NewtCanvasAWT.java
index 5335d858e..d48d490b2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer02NewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer02NewtCanvasAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import java.awt.BorderLayout;
@@ -80,31 +80,31 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
preferredGLSize = new Dimension(400,200);
}
- private void setupFrameAndShow(final Frame f, java.awt.Component comp) throws InterruptedException, InvocationTargetException {
- Container c = new Container();
+ private void setupFrameAndShow(final Frame f, final java.awt.Component comp) throws InterruptedException, InvocationTargetException {
+ final Container c = new Container();
c.setLayout(new BorderLayout());
c.add(new Button("north"), BorderLayout.NORTH);
c.add(new Button("south"), BorderLayout.SOUTH);
c.add(new Button("east"), BorderLayout.EAST);
c.add(new Button("west"), BorderLayout.WEST);
c.add(comp, BorderLayout.CENTER);
-
+
f.setLayout(new BorderLayout());
f.add(new Button("NORTH"), BorderLayout.NORTH);
f.add(new Button("SOUTH"), BorderLayout.SOUTH);
f.add(new Button("EAST"), BorderLayout.EAST);
f.add(new Button("WEST"), BorderLayout.WEST);
f.add(c, BorderLayout.CENTER);
-
+
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
f.pack();
f.validate();
f.setVisible(true);
- }});
+ }});
}
-
- private void end(GLAnimatorControl actrl, final Frame f, Window w) throws InterruptedException, InvocationTargetException {
+
+ private void end(final GLAnimatorControl actrl, final Frame f, final Window w) throws InterruptedException, InvocationTargetException {
actrl.stop();
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -114,12 +114,12 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
w.destroy();
}
}
-
+
@Test
- public void test01_GLDefault() throws InterruptedException, InvocationTargetException {
+ public void test01_GLDefault() throws InterruptedException, InvocationTargetException {
testOffscreenLayerNewtCanvas_Impl(null);
}
-
+
@Test
public void test02_GL3() throws InterruptedException, InvocationTargetException {
if( !GLProfile.isAvailable(GLProfile.GL3) ) {
@@ -128,15 +128,15 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
}
testOffscreenLayerNewtCanvas_Impl(GLProfile.get(GLProfile.GL3));
}
-
- private void testOffscreenLayerNewtCanvas_Impl(GLProfile glp) throws InterruptedException, InvocationTargetException {
+
+ private void testOffscreenLayerNewtCanvas_Impl(final GLProfile glp) throws InterruptedException, InvocationTargetException {
if(!JAWTUtil.isOffscreenLayerSupported()) {
System.err.println("offscreen layer n/a");
return;
- }
+ }
final Frame frame1 = new Frame("AWT Parent Frame");
-
- GLCapabilities caps = new GLCapabilities(glp);
+
+ final GLCapabilities caps = new GLCapabilities(glp);
if(singleBuffer) {
caps.setDoubleBuffered(false);
}
@@ -148,30 +148,30 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
caps.setPBuffer(true);
caps.setOnscreen(true); // get native NEWT Window, not OffscreenWindow
}
- GLWindow glWindow1 = GLWindow.create(caps);
-
+ final GLWindow glWindow1 = GLWindow.create(caps);
+
final NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(glWindow1);
newtCanvasAWT1.setShallUseOffscreenLayer(true); // trigger offscreen layer - if supported
newtCanvasAWT1.setPreferredSize(preferredGLSize);
newtCanvasAWT1.setMinimumSize(preferredGLSize);
newtCanvasAWT1.setSize(preferredGLSize);
-
- GearsES2 demo1 = new GearsES2(swapInterval);
+
+ final GearsES2 demo1 = new GearsES2(swapInterval);
if(noAnimation) {
demo1.setDoRotation(false);
}
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
glWindow1.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT1, glWindow1, null));
-
+
frame1.setSize(frameSize0);
setupFrameAndShow(frame1, newtCanvasAWT1);
Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow1, true));
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(glWindow1, true));
Assert.assertEquals(newtCanvasAWT1.getNativeWindow(),glWindow1.getParent());
Assert.assertEquals(true, newtCanvasAWT1.isOffscreenLayerSurfaceEnabled());
-
- GLAnimatorControl animator1 = new Animator(glWindow1);
+
+ final GLAnimatorControl animator1 = new Animator(glWindow1);
if(!noAnimation) {
animator1.start();
}
@@ -183,20 +183,20 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
frame1.setSize(frameSize1);
frame1.pack();
frame1.validate();
- }});
-
+ }});
+
Thread.sleep(durationPerTest/2);
-
+
end(animator1, frame1, glWindow1);
if( waitForKey ) {
UITestCase.waitForKey("Continue");
}
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
- Window window = glWindow.getDelegatedWindow();
+ final Window window = glWindow.getDelegatedWindow();
if(debug) {
MiscUtils.setFieldIfExists(demo, "glDebug", true);
MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -206,15 +206,15 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
@@ -236,7 +236,7 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
if(waitForKey) {
UITestCase.waitForKey("Start");
}
- String tstname = TestOffscreenLayer02NewtCanvasAWT.class.getName();
+ final String tstname = TestOffscreenLayer02NewtCanvasAWT.class.getName();
/*
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestPBufferDeadlockAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestPBufferDeadlockAWT.java
index a1f0d3330..7138513d5 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestPBufferDeadlockAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestPBufferDeadlockAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -61,7 +61,7 @@ public class TestPBufferDeadlockAWT extends UITestCase {
height = 512;
}
- protected void runTestGL( GLCapabilities caps ) throws InterruptedException, InvocationTargetException {
+ protected void runTestGL( final GLCapabilities caps ) throws InterruptedException, InvocationTargetException {
final GLPbuffer pbuffer = GLDrawableFactory.getFactory( GLProfile.getGL2ES2() ).createGLPbuffer(
null,
caps, new DefaultGLCapabilitiesChooser(),
@@ -78,30 +78,30 @@ public class TestPBufferDeadlockAWT extends UITestCase {
System.err.println("AA.X");
}
};
-
+
EventQueue.invokeAndWait(new Runnable() {
public void run() {
Assert.assertTrue(EventQueue.isDispatchThread());
JAWTUtil.lockToolkit();
try {
- final RunnableTask rTask = new RunnableTask(pbufferCreationAction, new Object(), false, null);
+ final RunnableTask rTask = new RunnableTask(pbufferCreationAction, new Object(), false, null);
System.err.println("BB.0: "+rTask.getSyncObject());
synchronized (rTask.getSyncObject()) {
System.err.println("BB.1: "+rTask.getSyncObject());
- new Thread(rTask, Thread.currentThread().getName()+"-Pbuffer_Creation").start();
+ new Thread(rTask, Thread.currentThread().getName()+"-Pbuffer_Creation").start();
try {
System.err.println("BB.2");
rTask.getSyncObject().wait();
System.err.println("BB.3");
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
throw new RuntimeException(e);
- }
+ }
System.err.println("BB.X");
}
} finally {
JAWTUtil.unlockToolkit();
}
- }
+ }
});
Assert.assertTrue(done[0]);
pbuffer.destroy();
@@ -109,24 +109,24 @@ public class TestPBufferDeadlockAWT extends UITestCase {
@Test(timeout = 2000) // 2s timeout
public void testDeadlock() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities( glp );
+ final GLCapabilities caps = new GLCapabilities( glp );
runTestGL( caps );
}
static long duration = 500; // ms
- public static void main( String args[] ) {
+ public static void main( final String args[] ) {
for ( int i = 0; i < args.length; i++ ) {
if ( args[ i ].equals( "-time" ) ) {
i++;
try {
duration = Integer.parseInt( args[ i ] );
}
- catch ( Exception ex ) {
+ catch ( final Exception ex ) {
ex.printStackTrace();
}
}
}
org.junit.runner.JUnitCore.main( TestPBufferDeadlockAWT.class.getName() );
}
-}
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
index 77657f6f1..44ff2d20b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
@@ -106,7 +106,7 @@ public class TestSharedContextListAWT extends UITestCase {
frame.setLocation(x, y);
frame.setSize(width, height);
- Gears gears = new Gears(vsync ? 1 : 0);
+ final Gears gears = new Gears(vsync ? 1 : 0);
if(useShared) {
gears.setGears(sharedGears.getGear1(), sharedGears.getGear2(), sharedGears.getGear3());
}
@@ -129,11 +129,11 @@ public class TestSharedContextListAWT extends UITestCase {
final Frame f1 = new Frame();
final Frame f2 = new Frame();
final Frame f3 = new Frame();
- Animator animator = new Animator();
+ final Animator animator = new Animator();
final GLCanvas glc1 = runTestGL(f1, animator, 0, 0, true, false);
- int x0 = f1.getX();
- int y0 = f1.getY();
+ final int x0 = f1.getX();
+ final int y0 = f1.getY();
final GLCanvas glc2 = runTestGL(f2, animator,
x0+width,
@@ -166,11 +166,11 @@ public class TestSharedContextListAWT extends UITestCase {
Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc2, false));
f3.dispose();
Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc3, false));
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -180,13 +180,13 @@ public class TestSharedContextListAWT extends UITestCase {
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestSharedContextListAWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java
index 09173fb24..0469092fb 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java
@@ -87,8 +87,8 @@ public class TestSharedContextListNEWT extends UITestCase {
sharedDrawable = null;
}
- protected GLWindow runTestGL(Animator animator, int x, int y, boolean useShared, boolean vsync) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+ protected GLWindow runTestGL(final Animator animator, final int x, final int y, final boolean useShared, final boolean vsync) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared "+useShared);
if(useShared) {
@@ -97,7 +97,7 @@ public class TestSharedContextListNEWT extends UITestCase {
glWindow.setSize(width, height);
- Gears gears = new Gears(vsync ? 1 : 0);
+ final Gears gears = new Gears(vsync ? 1 : 0);
if(useShared) {
gears.setGears(sharedGears.getGear1(), sharedGears.getGear2(), sharedGears.getGear3());
}
@@ -116,12 +116,12 @@ public class TestSharedContextListNEWT extends UITestCase {
@Test
public void test01() throws InterruptedException {
initShared();
- Animator animator = new Animator();
- GLWindow f1 = runTestGL(animator, 0, 0, true, false);
- InsetsImmutable insets = f1.getInsets();
- GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
+ final Animator animator = new Animator();
+ final GLWindow f1 = runTestGL(animator, 0, 0, true, false);
+ final InsetsImmutable insets = f1.getInsets();
+ final GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
f1.getY()+0, true, false);
- GLWindow f3 = runTestGL(animator, f1.getX()+0,
+ final GLWindow f3 = runTestGL(animator, f1.getX()+0,
f1.getY()+height+insets.getTotalHeight(), false, true);
animator.setUpdateFPSFrames(1, null);
animator.start();
@@ -139,13 +139,13 @@ public class TestSharedContextListNEWT extends UITestCase {
static long duration = 500; // ms
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java
index 967c94ec6..a11ddcdb0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import java.io.IOException;
@@ -87,9 +87,9 @@ public class TestSharedContextListNEWT2 extends UITestCase {
sharedDrawable = null;
}
- protected GLWindow runTestGL(Animator animator, int x, int y, boolean useShared, boolean vsync) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
-
+ protected GLWindow runTestGL(final Animator animator, final int x, final int y, final boolean useShared, final boolean vsync) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
+
Assert.assertNotNull(glWindow);
glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared "+useShared);
if(useShared) {
@@ -98,7 +98,7 @@ public class TestSharedContextListNEWT2 extends UITestCase {
glWindow.setSize(width, height);
- Gears gears = new Gears(vsync ? 1 : 0);
+ final Gears gears = new Gears(vsync ? 1 : 0);
if(useShared) {
gears.setGears(sharedGears.getGear1(), sharedGears.getGear2(), sharedGears.getGear3());
}
@@ -111,31 +111,31 @@ public class TestSharedContextListNEWT2 extends UITestCase {
Assert.assertTrue(AWTRobotUtil.waitForRealized(glWindow, true));
Assert.assertTrue(AWTRobotUtil.waitForVisible(glWindow, true));
glWindow.setPosition(x, y);
-
+
return glWindow;
}
@Test(timeout=10000)
public void test01() throws InterruptedException {
initShared();
-
+
final GLWindow f1 = runTestGL(new Animator(), 0, 0, true, false);
final InsetsImmutable insets = f1.getInsets();
- final GLWindow f2 = runTestGL(new Animator(), f1.getX()+width+insets.getTotalWidth(),
+ final GLWindow f2 = runTestGL(new Animator(), f1.getX()+width+insets.getTotalWidth(),
f1.getY()+0, true, false);
- final GLWindow f3 = runTestGL(new Animator(), f1.getX()+0,
+ final GLWindow f3 = runTestGL(new Animator(), f1.getX()+0,
f1.getY()+height+insets.getTotalHeight(), true, false);
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
f1.destroy();
f2.destroy();
f3.destroy();
-
+
// f1.getAnimator().stop();
// f2.getAnimator().stop();
// f3.getAnimator().stop();
@@ -145,19 +145,19 @@ public class TestSharedContextListNEWT2 extends UITestCase {
static long duration = 2000; // ms
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
- System.err.println(stdin.readLine()); */
+ System.err.println(stdin.readLine()); */
org.junit.runner.JUnitCore.main(TestSharedContextListNEWT2.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java
index ff98d6f57..a1a33531a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java
@@ -51,6 +51,8 @@ import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLOffscreenAutoDrawable;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+import javax.media.opengl.fixedfunc.GLPointerFunc;
import javax.media.opengl.glu.GLU;
import javax.swing.Box;
import javax.swing.BoxLayout;
@@ -58,6 +60,7 @@ import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;
+import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@@ -129,7 +132,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
}
}
- static private GLOffscreenAutoDrawable initShared(GLCapabilities caps) {
+ static private GLOffscreenAutoDrawable initShared(final GLCapabilities caps) {
final GLOffscreenAutoDrawable sharedDrawable = GLDrawableFactory.getFactory(caps.getGLProfile()).createOffscreenAutoDrawable(null, caps, null, 64, 64);
Assert.assertNotNull(sharedDrawable);
// init and render one frame, which will setup the Gears display lists
@@ -140,7 +143,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
return sharedDrawable;
}
- static private void releaseShared(GLOffscreenAutoDrawable sharedDrawable) {
+ static private void releaseShared(final GLOffscreenAutoDrawable sharedDrawable) {
if(null != sharedDrawable) {
sharedDrawable.destroy();
}
@@ -165,8 +168,8 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
private final int [] privateVertexBufferObjects = {0};
private final int [] privateIndexBufferObjects = {0};
- public static int createVertexBuffer(GL2 gl2) {
- final FloatBuffer vertexBuffer = GLBuffers.newDirectFloatBuffer(18);
+ public static int createVertexBuffer(final GL2 gl2) {
+ final FloatBuffer vertexBuffer = Buffers.newDirectFloatBuffer(18);
vertexBuffer.put(new float[]{
1.0f, -0.5f, 0f, // vertex 1
0f, 0f, 1f, // normal 1
@@ -179,46 +182,46 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
final int[] vbo = { 0 };
gl2.glGenBuffers(1, vbo, 0);
- gl2.glBindBuffer(GL2.GL_ARRAY_BUFFER, vbo[0]);
- gl2.glBufferData(GL2.GL_ARRAY_BUFFER, vertexBuffer.capacity() * Buffers.SIZEOF_FLOAT, vertexBuffer, GL2.GL_STATIC_DRAW);
- gl2.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
+ gl2.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo[0]);
+ gl2.glBufferData(GL.GL_ARRAY_BUFFER, vertexBuffer.capacity() * Buffers.SIZEOF_FLOAT, vertexBuffer, GL.GL_STATIC_DRAW);
+ gl2.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
return vbo[0];
}
- public static int createVertexIndexBuffer(GL2 gl2) {
- final IntBuffer indexBuffer = GLBuffers.newDirectIntBuffer(3);
+ public static int createVertexIndexBuffer(final GL2 gl2) {
+ final IntBuffer indexBuffer = Buffers.newDirectIntBuffer(3);
indexBuffer.put(new int[]{0, 1, 2});
indexBuffer.position(0);
final int[] vbo = { 0 };
gl2.glGenBuffers(1, vbo, 0);
- gl2.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, vbo[0]);
- gl2.glBufferData(GL2.GL_ELEMENT_ARRAY_BUFFER, indexBuffer.capacity() * Buffers.SIZEOF_INT, indexBuffer, GL2.GL_STATIC_DRAW);
- gl2.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, 0);
+ gl2.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, vbo[0]);
+ gl2.glBufferData(GL.GL_ELEMENT_ARRAY_BUFFER, indexBuffer.capacity() * Buffers.SIZEOF_INT, indexBuffer, GL.GL_STATIC_DRAW);
+ gl2.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
return vbo[0];
}
- TwoTriangles (int canvasWidth, int canvasHeight, boolean useShared) {
+ TwoTriangles (final int canvasWidth, final int canvasHeight, final boolean useShared) {
// instanceNum = instanceCounter++;
this.canvasWidth = canvasWidth;
this.canvasHeight = canvasHeight;
this.useShared = useShared;
}
- public void setXAxisRotation(float xRot) {
+ public void setXAxisRotation(final float xRot) {
xAxisRotation = xRot;
}
- public void setYAxisRotation(float yRot) {
+ public void setYAxisRotation(final float yRot) {
yAxisRotation = yRot;
}
- public void setViewDistanceFactor(float factor) {
+ public void setViewDistanceFactor(final float factor) {
viewDistanceFactor = factor;
}
- public void init(GLAutoDrawable drawable) {
- GL2 gl2 = drawable.getGL().getGL2();
+ public void init(final GLAutoDrawable drawable) {
+ final GL2 gl2 = drawable.getGL().getGL2();
System.err.println("INIT GL IS: " + gl2.getClass().getName());
@@ -259,13 +262,13 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
// I found that with my system glDrawElements causes a runtime exception 50% of the time. Executing the binds
// to unshareable buffers sets up glDrawElements for unpredictable crashes -- sometimes it does, sometimes not.
if (gl2.glIsBuffer(vertexBufferObjects[0])) {
- gl2.glBindBuffer(GL2.GL_ARRAY_BUFFER, vertexBufferObjects[0]);
+ gl2.glBindBuffer(GL.GL_ARRAY_BUFFER, vertexBufferObjects[0]);
//
- gl2.glEnableClientState(GL2.GL_VERTEX_ARRAY);
- gl2.glVertexPointer(3, GL2.GL_FLOAT, 6 * GLBuffers.SIZEOF_FLOAT, 0);
+ gl2.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
+ gl2.glVertexPointer(3, GL.GL_FLOAT, 6 * Buffers.SIZEOF_FLOAT, 0);
//
- gl2.glEnableClientState(GL2.GL_NORMAL_ARRAY);
- gl2.glNormalPointer(GL2.GL_FLOAT, 6 * GLBuffers.SIZEOF_FLOAT, 3 * GLBuffers.SIZEOF_FLOAT);
+ gl2.glEnableClientState(GLPointerFunc.GL_NORMAL_ARRAY);
+ gl2.glNormalPointer(GL.GL_FLOAT, 6 * Buffers.SIZEOF_FLOAT, 3 * Buffers.SIZEOF_FLOAT);
} else {
System.err.println("Vertex VBO is not a buffer on slave 0x"+Integer.toHexString(hashCode()));
}
@@ -277,15 +280,15 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
// again, a check in the case that buffer sharing is enabled but context sharing is not enabled
if (gl2.glIsBuffer(indexBufferObjects[0])) {
- gl2.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, indexBufferObjects[0]);
+ gl2.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, indexBufferObjects[0]);
} else {
System.err.println("Index VBO is not a buffer on slave 0x"+Integer.toHexString(hashCode()));
}
- gl2.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, 0);
- gl2.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
- gl2.glDisableClientState(GL2.GL_VERTEX_ARRAY);
- gl2.glDisableClientState(GL2.GL_NORMAL_ARRAY);
+ gl2.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
+ gl2.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+ gl2.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
+ gl2.glDisableClientState(GLPointerFunc.GL_NORMAL_ARRAY);
initializationCounter++;
} // synchronized (this)
@@ -295,12 +298,12 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
synchronized (this) {
initializationCounter--;
- GL2 gl2 = drawable.getGL().getGL2();
+ final GL2 gl2 = drawable.getGL().getGL2();
// release shared resources
if (initializationCounter == 0 || !useShared) {
@@ -328,10 +331,10 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
} // synchronized (this)
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
// wait until all instances are initialized before attempting to draw using the
// vertex array object, because the buffers are allocated in init and when the
@@ -342,22 +345,22 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
}
}
- GL2 gl2 = drawable.getGL().getGL2();
- GLU glu = new GLU();
+ final GL2 gl2 = drawable.getGL().getGL2();
+ final GLU glu = new GLU();
logAnyErrorCodes(this, gl2, "display.0");
// Clear the drawing area
- gl2.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
+ gl2.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl2.glViewport(0, 0, canvasWidth, canvasHeight);
- gl2.glMatrixMode(GL2.GL_PROJECTION);
+ gl2.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl2.glLoadIdentity();
glu.gluPerspective(viewFovDegrees, (float)canvasWidth/(float)canvasHeight,
viewDistance*viewDistanceFactor-boundsRadius, viewDistance*viewDistanceFactor+boundsRadius);
// Reset the current matrix to the "identity"
- gl2.glMatrixMode(GL2.GL_MODELVIEW);
+ gl2.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl2.glLoadIdentity();
// draw the scene
@@ -368,8 +371,8 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
gl2.glRotatef(xAxisRotation, 1, 0, 0);
gl2.glRotatef(yAxisRotation, 0, 1, 0);
- gl2.glDisable(GL2.GL_CULL_FACE);
- gl2.glEnable(GL2.GL_DEPTH_TEST);
+ gl2.glDisable(GL.GL_CULL_FACE);
+ gl2.glEnable(GL.GL_DEPTH_TEST);
logAnyErrorCodes(this, gl2, "display.1");
@@ -385,11 +388,11 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
logAnyErrorCodes(this, gl2, "display.X");
}
- public void drawTwoTriangles(GL2 gl2) {
+ public void drawTwoTriangles(final GL2 gl2) {
// draw a red triangle the old fashioned way
gl2.glColor3f(1f, 0f, 0f);
- gl2.glBegin(GL2.GL_TRIANGLES);
+ gl2.glBegin(GL.GL_TRIANGLES);
gl2.glVertex3d(-1.5, -0.5, 0);
gl2.glNormal3d(0, 0, 1);
gl2.glVertex3d(-0.5, -0.5, 0);
@@ -429,12 +432,12 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
final boolean isVBO2 = gl2.glIsBuffer(vertexBufferObjects[0]);
final boolean useVBO = isVBO1 && isVBO2;
if ( useVBO ) {
- gl2.glBindBuffer(GL2.GL_ARRAY_BUFFER, vertexBufferObjects[0]);
- gl2.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, indexBufferObjects[0]);
+ gl2.glBindBuffer(GL.GL_ARRAY_BUFFER, vertexBufferObjects[0]);
+ gl2.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, indexBufferObjects[0]);
- gl2.glEnableClientState(GL2.GL_VERTEX_ARRAY);
+ gl2.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
// gl2.glVertexPointer(3, GL2.GL_FLOAT, 6 * GLBuffers.SIZEOF_FLOAT, 0);
- gl2.glEnableClientState(GL2.GL_NORMAL_ARRAY);
+ gl2.glEnableClientState(GLPointerFunc.GL_NORMAL_ARRAY);
// gl2.glNormalPointer(GL2.GL_FLOAT, 6 * GLBuffers.SIZEOF_FLOAT, 3 * GLBuffers.SIZEOF_FLOAT);
vboBound = true;
}
@@ -444,24 +447,24 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
if (vboBound) {
gl2.glColor3f(0f, 0f, 1f);
- gl2.glDrawElements(GL2.GL_TRIANGLES, 3, GL2.GL_UNSIGNED_INT, 0);
- gl2.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
- gl2.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, 0);
- gl2.glDisableClientState(GL2.GL_VERTEX_ARRAY);
- gl2.glDisableClientState(GL2.GL_NORMAL_ARRAY);
+ gl2.glDrawElements(GL.GL_TRIANGLES, 3, GL.GL_UNSIGNED_INT, 0);
+ gl2.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+ gl2.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
+ gl2.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
+ gl2.glDisableClientState(GLPointerFunc.GL_NORMAL_ARRAY);
}
logAnyErrorCodes(this, gl2, "drawTwoTriangles.3");
}
- public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
+ public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {
}
} // inner class TwoTriangles
private static final Set<String> errorSet = new HashSet<String>();
- public static void logAnyErrorCodes(Object obj, GL gl, String prefix) {
+ public static void logAnyErrorCodes(final Object obj, final GL gl, final String prefix) {
final int glError = gl.glGetError();
if(glError != GL.GL_NO_ERROR) {
final String errStr = "GL-Error: "+prefix + " on obj 0x"+Integer.toHexString(obj.hashCode())+", OpenGL error: 0x" + Integer.toHexString(glError);
@@ -498,19 +501,19 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
* @return the distance the camera should be from the center of the scenes
* bounding sphere
*/
- public static float setupViewFrustum(GL2 gl2, int width, int height, float boundsRadius, float zoomFactor, float viewFovDegrees) {
+ public static float setupViewFrustum(final GL2 gl2, final int width, final int height, final float boundsRadius, final float zoomFactor, final float viewFovDegrees) {
assert boundsRadius > 0.0f;
assert zoomFactor > 0.0f;
assert viewFovDegrees > 0.0f;
- GLU glu = new GLU();
+ final GLU glu = new GLU();
final float aspectRatio = (float) width / (float) height;
final float boundRadiusAdjusted = boundsRadius / zoomFactor;
final float lowestFov = aspectRatio > 1.0f ? viewFovDegrees : aspectRatio * viewFovDegrees;
final float viewDist = (float) (boundRadiusAdjusted / Math.sin( (lowestFov / 2.0) * (Math.PI / 180.0) ));
- gl2.glMatrixMode(GL2.GL_PROJECTION);
+ gl2.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl2.glLoadIdentity();
glu.gluPerspective(viewFovDegrees, aspectRatio, 0.1*viewDist, viewDist + boundRadiusAdjusted);
@@ -549,7 +552,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
// GLDrawableFactory factory = GLDrawableFactory.getFactory(GLProfile.get(GLProfile.GL2));
// GLContext sharedContext = factory.getOrCreateSharedContext(factory.getDefaultDevice());
//
- GLCapabilities glCapabilities = new GLCapabilities(GLProfile.get(GLProfile.GL2));
+ final GLCapabilities glCapabilities = new GLCapabilities(GLProfile.get(GLProfile.GL2));
glCapabilities.setSampleBuffers(true);
glCapabilities.setNumSamples(4);
@@ -569,19 +572,19 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
final GLAutoDrawable openGLAutoDrawable2;
if (useNewt) {
- GLWindow glWindow1 = GLWindow.create(glCapabilities);
+ final GLWindow glWindow1 = GLWindow.create(glCapabilities);
if(shareContext) {
glWindow1.setSharedAutoDrawable(sharedDrawable);
}
- NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(glWindow1);
+ final NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(glWindow1);
newtCanvasAWT1.setPreferredSize(new Dimension(eventListener1.canvasWidth, eventListener1.canvasHeight));
glWindow1.addGLEventListener(eventListener1);
//
- GLWindow glWindow2 = GLWindow.create(glCapabilities);
+ final GLWindow glWindow2 = GLWindow.create(glCapabilities);
if(shareContext) {
glWindow2.setSharedAutoDrawable(sharedDrawable);
}
- NewtCanvasAWT newtCanvasAWT2 = new NewtCanvasAWT(glWindow2);
+ final NewtCanvasAWT newtCanvasAWT2 = new NewtCanvasAWT(glWindow2);
newtCanvasAWT2.setPreferredSize(new Dimension(eventListener2.canvasWidth, eventListener2.canvasHeight));
glWindow2.addGLEventListener(eventListener2);
@@ -620,52 +623,52 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
// Create slider for x rotation.
// The vertically oriented slider rotates around the x axis
- final JSlider xAxisRotationSlider = new JSlider(JSlider.VERTICAL, -180, 180, 1);
+ final JSlider xAxisRotationSlider = new JSlider(SwingConstants.VERTICAL, -180, 180, 1);
xAxisRotationSlider.setPaintTicks(false);
xAxisRotationSlider.setPaintLabels(false);
xAxisRotationSlider.setSnapToTicks(false);
xAxisRotationSlider.addChangeListener(new ChangeListener() {
- public void stateChanged(ChangeEvent e) {
+ public void stateChanged(final ChangeEvent e) {
eventListener1.setXAxisRotation(xAxisRotationSlider.getValue());
eventListener2.setXAxisRotation(xAxisRotationSlider.getValue());
}
});
- JLabel xAxisRotationLabel = new JLabel("X-Axis Rotation");
+ final JLabel xAxisRotationLabel = new JLabel("X-Axis Rotation");
// Create slider for y rotation.
// The horizontally oriented slider rotates around the y axis
- final JSlider yAxisRotationSlider = new JSlider(JSlider.HORIZONTAL, -180, 180, 1);
+ final JSlider yAxisRotationSlider = new JSlider(SwingConstants.HORIZONTAL, -180, 180, 1);
yAxisRotationSlider.setPaintTicks(false);
yAxisRotationSlider.setPaintLabels(false);
yAxisRotationSlider.setSnapToTicks(false);
yAxisRotationSlider.addChangeListener(new ChangeListener() {
- public void stateChanged(ChangeEvent e) {
+ public void stateChanged(final ChangeEvent e) {
eventListener1.setYAxisRotation(yAxisRotationSlider.getValue());
eventListener2.setYAxisRotation(yAxisRotationSlider.getValue());
}
});
- JLabel yAxisRotationLabel = new JLabel("Y-Axis Rotation");
+ final JLabel yAxisRotationLabel = new JLabel("Y-Axis Rotation");
// Create slider for view distance factor.
// We want a range of 0.0 to 10.0 with 0.1 increments (so we can scale down using 0.0 to 1.0).
// So, set JSlider to 0 to 100 and divide by 10.0 in stateChanged
- final JSlider viewDistanceFactorSlider = new JSlider(JSlider.HORIZONTAL, 0, 100, 10);
+ final JSlider viewDistanceFactorSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 100, 10);
viewDistanceFactorSlider.setPaintTicks(false);
viewDistanceFactorSlider.setPaintLabels(false);
viewDistanceFactorSlider.setSnapToTicks(false);
viewDistanceFactorSlider.addChangeListener(new ChangeListener() {
- public void stateChanged(ChangeEvent e) {
+ public void stateChanged(final ChangeEvent e) {
eventListener1.setViewDistanceFactor(viewDistanceFactorSlider.getValue() / 10.0f);
eventListener2.setViewDistanceFactor(viewDistanceFactorSlider.getValue() / 10.0f);
}
});
- JLabel viewDistanceFactorLabel = new JLabel("View Distance Factor");
+ final JLabel viewDistanceFactorLabel = new JLabel("View Distance Factor");
// group the view distance and label into a vertical panel
- JPanel viewDistancePanel = new JPanel();
+ final JPanel viewDistancePanel = new JPanel();
viewDistancePanel.setLayout(new BoxLayout(viewDistancePanel, BoxLayout.PAGE_AXIS));
viewDistancePanel.add(Box.createVerticalGlue());
viewDistancePanel.add(viewDistanceFactorSlider);
@@ -673,14 +676,14 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
viewDistancePanel.add(Box.createVerticalGlue());
// group both OpenGL canvases / windows into a horizontal panel
- JPanel openGLPanel = new JPanel();
+ final JPanel openGLPanel = new JPanel();
openGLPanel.setLayout(new BoxLayout(openGLPanel, BoxLayout.LINE_AXIS));
openGLPanel.add(openGLComponent1);
openGLPanel.add(Box.createHorizontalStrut(5));
openGLPanel.add(openGLComponent2);
// group the open GL panel and the y-axis rotation slider into a vertical panel.
- JPanel canvasAndYAxisPanel = new JPanel();
+ final JPanel canvasAndYAxisPanel = new JPanel();
canvasAndYAxisPanel.setLayout(new BoxLayout(canvasAndYAxisPanel, BoxLayout.PAGE_AXIS));
canvasAndYAxisPanel.add(openGLPanel);
canvasAndYAxisPanel.add(Box.createVerticalGlue());
@@ -688,12 +691,12 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
canvasAndYAxisPanel.add(yAxisRotationLabel);
// group the X-axis rotation slider and label into a horizontal panel.
- JPanel xAxisPanel = new JPanel();
+ final JPanel xAxisPanel = new JPanel();
xAxisPanel.setLayout(new BoxLayout(xAxisPanel, BoxLayout.LINE_AXIS));
xAxisPanel.add(xAxisRotationSlider);
xAxisPanel.add(xAxisRotationLabel);
- JPanel mainPanel = (JPanel) frame.getContentPane();
+ final JPanel mainPanel = (JPanel) frame.getContentPane();
mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.LINE_AXIS));
mainPanel.add(viewDistancePanel);
mainPanel.add(Box.createHorizontalGlue());
@@ -713,7 +716,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
frame.addWindowListener(new WindowAdapter() {
@Override
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
closingSemaphore.release();
}
});
@@ -729,9 +732,9 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
// wait for the window to be visible and start the animation
try {
- boolean windowOpened = windowOpenSemaphore.tryAcquire(5000, TimeUnit.MILLISECONDS);
+ final boolean windowOpened = windowOpenSemaphore.tryAcquire(5000, TimeUnit.MILLISECONDS);
Assert.assertEquals(true, windowOpened);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
System.err.println("Closing wait interrupted: " + e.getMessage());
}
animator.start();
@@ -742,9 +745,9 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
Thread.sleep(100);
}
AWTRobotUtil.closeWindow(frame, true, awtClosingListener);
- boolean windowClosed = closingSemaphore.tryAcquire(5000, TimeUnit.MILLISECONDS);
+ final boolean windowClosed = closingSemaphore.tryAcquire(5000, TimeUnit.MILLISECONDS);
Assert.assertEquals(true, windowClosed);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
System.err.println("Closing wait interrupted: " + e.getMessage());
}
animator.stop();
@@ -766,9 +769,9 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
// wait for orderly destruction; it seems that if we share a GLContext across newt windows, bad things happen;
// I must be doing something wrong but I haven't figured it out yet
try {
- boolean windowsDisposed = closingSemaphore.tryAcquire(5000, TimeUnit.MILLISECONDS);
+ final boolean windowsDisposed = closingSemaphore.tryAcquire(5000, TimeUnit.MILLISECONDS);
Assert.assertEquals(true, windowsDisposed);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
System.err.println("Closing wait interrupted: " + e.getMessage());
}
@@ -784,7 +787,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
if (acquired){
disposalSuccesses++;
}
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
System.err.println("Clean exit interrupted: " + e.getMessage());
}
@@ -793,15 +796,15 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
releaseShared(sharedDrawable);
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String[] args) throws IOException {
+ public static void main(final String[] args) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
if (++i < args.length) {
@@ -810,7 +813,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
}
}
- String testname = TestSharedContextNewtAWTBug523.class.getName();
+ final String testname = TestSharedContextNewtAWTBug523.class.getName();
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
testname,
"filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java
index 0f4f8fc34..a9e7c0cc1 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java
@@ -92,7 +92,7 @@ public class TestSharedContextVBOES1NEWT extends UITestCase {
}
private void initShared() throws InterruptedException {
- GLDrawable dummyDrawable = GLDrawableFactory.getFactory(glp).createDummyDrawable(null, true /* createNewDevice */, caps, null);
+ final GLDrawable dummyDrawable = GLDrawableFactory.getFactory(glp).createDummyDrawable(null, true /* createNewDevice */, caps, null);
dummyDrawable.setRealized(true);
sharedDrawable = new GLAutoDrawableDelegate(dummyDrawable, null, null, true /*ownDevice*/, null) { };
Assert.assertNotNull(sharedDrawable);
@@ -114,8 +114,8 @@ public class TestSharedContextVBOES1NEWT extends UITestCase {
sharedDrawable.destroy();
}
- protected GLWindow runTestGL(Animator animator, int x, int y, boolean useShared, boolean vsync) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+ protected GLWindow runTestGL(final Animator animator, final int x, final int y, final boolean useShared, final boolean vsync) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setPosition(x, y);
glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared "+useShared);
@@ -125,7 +125,7 @@ public class TestSharedContextVBOES1NEWT extends UITestCase {
glWindow.setSize(width, height);
- GearsES1 gears = new GearsES1(vsync ? 1 : 0);
+ final GearsES1 gears = new GearsES1(vsync ? 1 : 0);
if(useShared) {
gears.setSharedGearsObjects(sharedGears.getGear1(), sharedGears.getGear2(), sharedGears.getGear3());
}
@@ -153,12 +153,12 @@ public class TestSharedContextVBOES1NEWT extends UITestCase {
@Test
public void test01() throws InterruptedException {
initShared();
- Animator animator = new Animator();
- GLWindow f1 = runTestGL(animator, 0, 0, true, false);
- InsetsImmutable insets = f1.getInsets();
- GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
+ final Animator animator = new Animator();
+ final GLWindow f1 = runTestGL(animator, 0, 0, true, false);
+ final InsetsImmutable insets = f1.getInsets();
+ final GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
f1.getY()+0, true, false);
- GLWindow f3 = runTestGL(animator, f1.getX()+0,
+ final GLWindow f3 = runTestGL(animator, f1.getX()+0,
f1.getY()+height+insets.getTotalHeight(), false, true);
animator.setUpdateFPSFrames(1, null);
animator.start();
@@ -176,13 +176,13 @@ public class TestSharedContextVBOES1NEWT extends UITestCase {
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestSharedContextVBOES1NEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java
index 3b576fabd..a0662f862 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java
@@ -81,7 +81,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
}
}
- protected GLCanvas createGLCanvas(final Frame frame, int x, int y, GearsES2 gears) throws InterruptedException {
+ protected GLCanvas createGLCanvas(final Frame frame, final int x, final int y, final GearsES2 gears) throws InterruptedException {
final GLCanvas glCanvas = new GLCanvas(caps);
Assert.assertNotNull(glCanvas);
glCanvas.addGLEventListener(gears);
@@ -178,7 +178,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
// Stopped animator allows native windowing system 'repaint' event
@@ -199,7 +199,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
} else {
f1.dispose();
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
}});
@@ -212,7 +212,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
} else {
f2.dispose();
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
}});
@@ -225,7 +225,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
} else {
f3.dispose();
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
}});
@@ -332,7 +332,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
// Stopped animator allows native windowing system 'repaint' event
@@ -357,7 +357,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
} else {
f1.dispose();
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
}});
@@ -370,7 +370,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
} else {
f2.dispose();
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
}});
@@ -383,7 +383,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
} else {
f3.dispose();
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
}});
@@ -395,13 +395,13 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
static long duration = 1000; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java
index d4079e30c..4c9cb7253 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java
@@ -81,7 +81,7 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase {
}
}
- protected GLJPanel createGLJPanel(final Frame frame, int x, int y, GearsES2 gears) throws InterruptedException {
+ protected GLJPanel createGLJPanel(final Frame frame, final int x, final int y, final GearsES2 gears) throws InterruptedException {
final GLJPanel glCanvas = new GLJPanel(caps);
Assert.assertNotNull(glCanvas);
glCanvas.addGLEventListener(gears);
@@ -169,7 +169,7 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase {
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
// Stopped animator allows native windowing system 'repaint' event
@@ -183,7 +183,7 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase {
f3.dispose();
f2.dispose();
f1.dispose();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
}});
@@ -281,7 +281,7 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase {
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
// Stopped animator allows native windowing system 'repaint' event
@@ -299,7 +299,7 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase {
f3.dispose();
f2.dispose();
f1.dispose();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
}});
@@ -311,13 +311,13 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase {
static long duration = 1000; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java
index 010368b4b..3efbabb20 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java
@@ -76,9 +76,9 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
}
}
- protected GLWindow runTestGL(Animator animator, int x, int y, GearsES2 gears, GLContext sharedContext) throws InterruptedException {
+ protected GLWindow runTestGL(final Animator animator, final int x, final int y, final GearsES2 gears, final GLContext sharedContext) throws InterruptedException {
final boolean useShared = null != sharedContext;
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setPosition(x, y);
glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared "+useShared);
@@ -107,7 +107,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
public void test02CommonAnimatorMapBuffer() throws InterruptedException {
testCommonAnimatorSharedImpl(true);
}
- private void testCommonAnimatorSharedImpl(boolean useMappedBuffers) throws InterruptedException {
+ private void testCommonAnimatorSharedImpl(final boolean useMappedBuffers) throws InterruptedException {
final Animator animator = new Animator();
//
@@ -184,7 +184,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -210,7 +210,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
Assert.assertEquals("Ctx2 has unexpected number of created shares", 1, ctx2Shares.size());
Assert.assertEquals("Ctx3 has unexpected number of created shares", 2, ctx3Shares.size());
}
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
f2.destroy();
Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, false));
@@ -234,7 +234,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
Assert.assertEquals("Ctx2 has unexpected number of created shares", 1, ctx2Shares.size());
Assert.assertEquals("Ctx3 has unexpected number of created shares", 1, ctx3Shares.size());
}
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
f1.destroy();
Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false));
@@ -258,7 +258,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
Assert.assertEquals("Ctx2 has unexpected number of created shares", 0, ctx2Shares.size());
Assert.assertEquals("Ctx3 has unexpected number of created shares", 0, ctx3Shares.size());
}
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
animator.stop();
Assert.assertEquals(false, animator.isAnimating());
@@ -267,13 +267,13 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
static long duration = 1000; // ms
static long durationPostDestroy = 1000; // ms - ~60 frames post destroy
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java
index 7051bac13..3a61f169e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java
@@ -97,9 +97,9 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
}
}
- private void initShared(boolean onscreen) throws InterruptedException {
+ private void initShared(final boolean onscreen) throws InterruptedException {
if(onscreen) {
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setSize(width, height);
glWindow.setVisible(true);
@@ -129,8 +129,8 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
sharedDrawable = null;
}
- protected GLWindow runTestGL(Animator animator, int x, int y, boolean useShared, boolean vsync) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+ protected GLWindow runTestGL(final Animator animator, final int x, final int y, final boolean useShared, final boolean vsync) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setPosition(x, y);
glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared "+useShared);
@@ -140,7 +140,7 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
glWindow.setSize(width, height);
- GearsES2 gears = new GearsES2(vsync ? 1 : 0);
+ final GearsES2 gears = new GearsES2(vsync ? 1 : 0);
if(useShared) {
gears.setSharedGearsObjects(sharedGears.getGear1(), sharedGears.getGear2(), sharedGears.getGear3());
}
@@ -172,16 +172,16 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
@Test
public void test01CommonAnimatorSharedOnscreen() throws InterruptedException {
initShared(true);
- Animator animator = new Animator();
- GLWindow f1 = runTestGL(animator, 0, 0, true, false);
- InsetsImmutable insets = f1.getInsets();
- GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
+ final Animator animator = new Animator();
+ final GLWindow f1 = runTestGL(animator, 0, 0, true, false);
+ final InsetsImmutable insets = f1.getInsets();
+ final GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
f1.getY()+0, true, false);
- GLWindow f3 = runTestGL(animator, f1.getX()+0,
+ final GLWindow f3 = runTestGL(animator, f1.getX()+0,
f1.getY()+height+insets.getTotalHeight(), true, false);
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
animator.stop();
@@ -205,16 +205,16 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
@Test
public void test02CommonAnimatorSharedOffscreen() throws InterruptedException {
initShared(false);
- Animator animator = new Animator();
- GLWindow f1 = runTestGL(animator, 0, 0, true, false);
- InsetsImmutable insets = f1.getInsets();
- GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
+ final Animator animator = new Animator();
+ final GLWindow f1 = runTestGL(animator, 0, 0, true, false);
+ final InsetsImmutable insets = f1.getInsets();
+ final GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
f1.getY()+0, true, false);
- GLWindow f3 = runTestGL(animator, f1.getX()+0,
+ final GLWindow f3 = runTestGL(animator, f1.getX()+0,
f1.getY()+height+insets.getTotalHeight(), true, false);
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
animator.stop();
@@ -238,19 +238,19 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
@Test
public void test03EachWithAnimatorSharedOffscreen() throws InterruptedException {
initShared(false);
- Animator animator1 = new Animator();
- Animator animator2 = new Animator();
- Animator animator3 = new Animator();
- GLWindow f1 = runTestGL(animator1, 0, 0, true, false);
- InsetsImmutable insets = f1.getInsets();
- GLWindow f2 = runTestGL(animator2, f1.getX()+width+insets.getTotalWidth(),
+ final Animator animator1 = new Animator();
+ final Animator animator2 = new Animator();
+ final Animator animator3 = new Animator();
+ final GLWindow f1 = runTestGL(animator1, 0, 0, true, false);
+ final InsetsImmutable insets = f1.getInsets();
+ final GLWindow f2 = runTestGL(animator2, f1.getX()+width+insets.getTotalWidth(),
f1.getY()+0, true, false);
- GLWindow f3 = runTestGL(animator3, f1.getX()+0,
+ final GLWindow f3 = runTestGL(animator3, f1.getX()+0,
f1.getY()+height+insets.getTotalHeight(), true, false);
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
animator1.stop();
@@ -275,13 +275,13 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
static long duration = 1000; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java
index e8e4cc739..1921dca60 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java
@@ -84,8 +84,8 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
}
}
- protected GLWindow createGLWindow(int x, int y, GearsES2 gears) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+ protected GLWindow createGLWindow(final int x, final int y, final GearsES2 gears) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setPosition(x, y);
glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared true");
@@ -105,12 +105,12 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
syncedOneAnimator(false);
}
- public void syncedOneAnimator(boolean destroyCleanOrder) throws InterruptedException {
+ public void syncedOneAnimator(final boolean destroyCleanOrder) throws InterruptedException {
final Animator animator = new Animator();
final GearsES2 g1 = new GearsES2(0);
final GLWindow f1 = createGLWindow(0, 0, g1);
animator.add(f1);
- InsetsImmutable insets = f1.getInsets();
+ final InsetsImmutable insets = f1.getInsets();
final GearsES2 g2 = new GearsES2(0);
g2.setSharedGears(g1);
@@ -127,7 +127,7 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
// f1's shared GLContext is ready !
f1.invoke(false, new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
final GLContext ctx1 = f1.getContext();
Assert.assertTrue("Ctx is shared before shared creation", !ctx1.isShared());
f2.setSharedContext(ctx1);
@@ -188,7 +188,7 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
animator.stop();
@@ -223,7 +223,7 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
asyncEachAnimator(false);
}
- public void asyncEachAnimator(boolean destroyCleanOrder) throws InterruptedException {
+ public void asyncEachAnimator(final boolean destroyCleanOrder) throws InterruptedException {
final Animator a1 = new Animator();
final GearsES2 g1 = new GearsES2(0);
final GLWindow f1 = createGLWindow(0, 0, g1);
@@ -231,7 +231,7 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
a1.start();
f1.setVisible(true);
- InsetsImmutable insets = f1.getInsets();
+ final InsetsImmutable insets = f1.getInsets();
final Animator a2 = new Animator();
final GearsES2 g2 = new GearsES2(0);
@@ -252,7 +252,7 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
// f1's shared GLContext is ready !
f1.invoke(false, new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
final GLContext ctx1 = f1.getContext();
Assert.assertTrue("Ctx is shared before shared creation", !ctx1.isShared());
f2.setSharedContext(ctx1);
@@ -305,7 +305,7 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
// Stopped animator allows native windowing system 'repaint' event
@@ -338,13 +338,13 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
static long duration = 1000; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java
index a8684ad4c..bfd1a92ce 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java
@@ -81,8 +81,8 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
}
}
- protected GLWindow createGLWindow(int x, int y, GearsES2 gears) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+ protected GLWindow createGLWindow(final int x, final int y, final GearsES2 gears) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setPosition(x, y);
glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared true");
@@ -110,14 +110,14 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
syncedOneAnimator(false, true);
}
- public void syncedOneAnimator(boolean destroyCleanOrder, boolean useMappedBuffers) throws InterruptedException {
+ public void syncedOneAnimator(final boolean destroyCleanOrder, final boolean useMappedBuffers) throws InterruptedException {
final Animator animator = new Animator();
final GearsES2 g1 = new GearsES2(0);
g1.setUseMappedBuffers(useMappedBuffers);
g1.setValidateBuffers(true);
final GLWindow f1 = createGLWindow(0, 0, g1);
animator.add(f1);
- InsetsImmutable insets = f1.getInsets();
+ final InsetsImmutable insets = f1.getInsets();
final GearsES2 g2 = new GearsES2(0);
g2.setSharedGears(g1);
@@ -183,32 +183,32 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
if( destroyCleanOrder ) {
System.err.println("XXX Destroy in clean order NOW");
f3.destroy();
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
f2.destroy();
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
f1.destroy();
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
} else {
System.err.println("XXX Destroy in creation order NOW - Driver Impl. Ma trigger driver Bug i.e. not postponing GL ctx destruction after releasing all refs.");
animator.pause();
f1.destroy();
animator.resume();
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
animator.pause();
f2.destroy();
animator.resume();
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
f3.destroy();
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
}
Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false));
Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false));
@@ -238,7 +238,7 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
asyncEachAnimator(false, true);
}
- public void asyncEachAnimator(boolean destroyCleanOrder, boolean useMappedBuffers) throws InterruptedException {
+ public void asyncEachAnimator(final boolean destroyCleanOrder, final boolean useMappedBuffers) throws InterruptedException {
final Animator a1 = new Animator();
final GearsES2 g1 = new GearsES2(0);
g1.setUseMappedBuffers(useMappedBuffers);
@@ -248,7 +248,7 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
a1.start();
// f1.setVisible(true); // we do this post f2 .. to test pending creation!
- InsetsImmutable insets = f1.getInsets();
+ final InsetsImmutable insets = f1.getInsets();
final Animator a2 = new Animator();
final GearsES2 g2 = new GearsES2(0);
@@ -317,7 +317,7 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -325,13 +325,13 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
System.err.println("XXX Destroy in clean order NOW");
a3.stop();
f3.destroy();
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
a2.stop();
f2.destroy();
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
a1.stop();
f1.destroy();
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
} else {
System.err.println("XXX Destroy in creation order NOW - Driver Impl. May trigger driver Bug i.e. not postponing GL ctx destruction after releasing all refs.");
a1.stop();
@@ -340,17 +340,17 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
f1.destroy();
a2.resume();
a3.resume();
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
a2.stop();
a3.pause();
f2.destroy();
a3.resume();
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
a3.stop();
f3.destroy();
- try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+ try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
}
Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false));
Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false));
@@ -363,13 +363,13 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
static long duration = 1000; // ms
static long durationPostDestroy = 1000; // ms - ~60 frames post destroy
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java
index 9ccfd394f..90cb503ce 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java
@@ -149,7 +149,7 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase {
display.dispose();
}});
}
- catch( Throwable throwable ) {
+ catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -162,7 +162,7 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase {
composite3 = null;
}
- protected GLCanvas createGLCanvas(final Shell shell, final Composite composite, final int x, final int y, GearsES2 gears) throws InterruptedException {
+ protected GLCanvas createGLCanvas(final Shell shell, final Composite composite, final int x, final int y, final GearsES2 gears) throws InterruptedException {
final GLCanvas glCanvas = GLCanvas.create( composite, 0, caps, null);
Assert.assertNotNull( glCanvas );
glCanvas.addGLEventListener(gears);
@@ -241,7 +241,7 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase {
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
// Stopped animator allows native windowing system 'repaint' event
@@ -335,7 +335,7 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase {
try {
Thread.sleep(duration);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
// Stopped animator allows native windowing system 'repaint' event
@@ -357,13 +357,13 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase {
static long duration = 1000; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java
index d6a6f7bed..e62bbc63e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java
@@ -43,6 +43,9 @@ import javax.media.opengl.GLContext;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+import javax.media.opengl.fixedfunc.GLPointerFunc;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
@@ -63,7 +66,7 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
static class DemoInstance {
protected static GLCapabilities getCaps() {
- GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
caps.setAlphaBits(8);
caps.setRedBits(8);
@@ -82,8 +85,8 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
final GLCanvas canvas;
final boolean shared;
- public SharedGLPanel(GLCanvas shareWith, int width, int height) {
- GLContext sharedCtx = shareWith != null ? shareWith.getContext() : null;
+ public SharedGLPanel(final GLCanvas shareWith, final int width, final int height) {
+ final GLContext sharedCtx = shareWith != null ? shareWith.getContext() : null;
System.err.println("XXX WWPanel: shareWith "+shareWith+", sharedCtx "+sharedCtx);
canvas = new GLCanvas(getCaps()); // same caps for 1st and 2nd shared ctx !
if( null != shareWith) {
@@ -102,7 +105,7 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
}
@Override
- public void init(GLAutoDrawable glAutoDrawable) {
+ public void init(final GLAutoDrawable glAutoDrawable) {
if (!shared) {
Assert.assertNull("Buffer is set, but instance is share master", bufferId);
makeVBO(glAutoDrawable);
@@ -120,56 +123,56 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
gl.glColor3f(0, 0, 0);
gl.glClearColor(1f, 1f, 1f, 1f);
}
- gl.glShadeModel(GL2.GL_FLAT);
+ gl.glShadeModel(GLLightingFunc.GL_FLAT);
}
@Override
- public void dispose(GLAutoDrawable glAutoDrawable) {}
+ public void dispose(final GLAutoDrawable glAutoDrawable) {}
@Override
- public void display(GLAutoDrawable glAutoDrawable) {
+ public void display(final GLAutoDrawable glAutoDrawable) {
final GL2 gl = glAutoDrawable.getGL().getGL2();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
- gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, bufferId[0]);
- gl.glVertexPointer(3, GL2.GL_FLOAT, 0, 0);
- gl.glDrawArrays(GL2.GL_LINES, 0, 2);
+ gl.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, bufferId[0]);
+ gl.glVertexPointer(3, GL.GL_FLOAT, 0, 0);
+ gl.glDrawArrays(GL.GL_LINES, 0, 2);
}
@Override
- public void reshape(GLAutoDrawable glAutoDrawable, int i, int i1, int i2, int i3) {
- int w = getWidth();
- int h = getHeight();
+ public void reshape(final GLAutoDrawable glAutoDrawable, final int i, final int i1, final int i2, final int i3) {
+ final int w = getWidth();
+ final int h = getHeight();
final GL2 gl = glAutoDrawable.getGL().getGL2();
gl.glViewport(0, 0, w, h);
- gl.glMatrixMode(GL2.GL_PROJECTION);
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(0, 1, 0, 1, -1, 1);
- gl.glMatrixMode(GL2.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
}
}
- protected void makeVBO(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+ protected void makeVBO(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
bufferId = new int[1];
gl.glGenBuffers(1, bufferId, 0);
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, bufferId[0]);
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, bufferId[0]);
- FloatBuffer vertices = Buffers.newDirectFloatBuffer(6);
+ final FloatBuffer vertices = Buffers.newDirectFloatBuffer(6);
vertices.put(0).put(0).put(0);
vertices.put(1).put(1).put(0);
- gl.glBufferData(GL2.GL_ARRAY_BUFFER, vertices.capacity() * 4, vertices.rewind(), GL2.GL_STATIC_DRAW);
+ gl.glBufferData(GL.GL_ARRAY_BUFFER, vertices.capacity() * 4, vertices.rewind(), GL.GL_STATIC_DRAW);
}
public JTabbedPane tabbedPanel;
- public DemoInstance(JFrame f) {
+ public DemoInstance(final JFrame f) {
try
{
GLProfile.initSingleton(); // Lets have init debug messages above below marker
@@ -180,8 +183,8 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
f.add(tabbedPanel, BorderLayout.CENTER);
// Create two World Windows that share resources.
- SharedGLPanel wwpA = new SharedGLPanel(null, 600, 600);
- SharedGLPanel wwpB = new SharedGLPanel(wwpA.canvas, wwpA.getWidth(), wwpA.getHeight());
+ final SharedGLPanel wwpA = new SharedGLPanel(null, 600, 600);
+ final SharedGLPanel wwpB = new SharedGLPanel(wwpA.canvas, wwpA.getWidth(), wwpA.getHeight());
tabbedPanel.add(wwpA, "Window A");
tabbedPanel.add(wwpB, "Window B");
@@ -194,7 +197,7 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.pack();
f.setResizable(true);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -251,7 +254,7 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
} });
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java
index 9f367ef0b..d8ae8bcc5 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java
@@ -63,7 +63,7 @@ public class TestShutdownCompleteAWT extends UITestCase {
glCanvas.addGLEventListener(new GearsES2(1));
- Animator animator = new Animator(glCanvas);
+ final Animator animator = new Animator(glCanvas);
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -103,7 +103,7 @@ public class TestShutdownCompleteAWT extends UITestCase {
}
}
- protected void oneLife(boolean glInfo) throws InterruptedException, InvocationTargetException {
+ protected void oneLife(final boolean glInfo) throws InterruptedException, InvocationTargetException {
final long t0 = Platform.currentTimeMicros();
GLProfile.initSingleton();
final long t1 = Platform.currentTimeMicros();
@@ -148,7 +148,7 @@ public class TestShutdownCompleteAWT extends UITestCase {
static boolean initOnly = false;
static boolean waitForKey = false;
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-wait")) {
waitForKey = true;
@@ -160,7 +160,7 @@ public class TestShutdownCompleteAWT extends UITestCase {
if(waitForKey) {
UITestCase.waitForKey("Start");
}
- String tstname = TestShutdownCompleteAWT.class.getName();
+ final String tstname = TestShutdownCompleteAWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java
index e7d1cb8e9..10f334244 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java
@@ -51,18 +51,18 @@ public class TestShutdownCompleteNEWT extends UITestCase {
static long duration = 300; // ms
- protected void runTestGL(boolean onscreen) throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
+ protected void runTestGL(final boolean onscreen) throws InterruptedException {
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
caps.setOnscreen(onscreen);
caps.setPBuffer(!onscreen);
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle("Gears NEWT Test");
glWindow.addGLEventListener(new GearsES2());
- Animator animator = new Animator(glWindow);
+ final Animator animator = new Animator(glWindow);
glWindow.setSize(256, 256);
glWindow.setVisible(true);
@@ -88,7 +88,7 @@ public class TestShutdownCompleteNEWT extends UITestCase {
}
}
- protected void oneLife(boolean glInfo) throws InterruptedException {
+ protected void oneLife(final boolean glInfo) throws InterruptedException {
if(waitForEach) {
UITestCase.waitForKey("Start One Life");
}
@@ -137,7 +137,7 @@ public class TestShutdownCompleteNEWT extends UITestCase {
static boolean waitForEach = false;
static boolean waitForKey = false;
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-wait")) {
waitForKey = true;
@@ -153,7 +153,7 @@ public class TestShutdownCompleteNEWT extends UITestCase {
UITestCase.waitForKey("Start");
}
- String tstname = TestShutdownCompleteNEWT.class.getName();
+ final String tstname = TestShutdownCompleteNEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java
index 3120264b6..6f38c4b2f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java
@@ -106,8 +106,8 @@ public class TestVersionSemanticsNOUI extends JunitTracer {
excludes);
}
- public static void main(String args[]) throws IOException {
- String tstname = TestVersionSemanticsNOUI.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestVersionSemanticsNOUI.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestX11DefaultDisplay.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestX11DefaultDisplay.java
index deb800441..9ac190bc7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestX11DefaultDisplay.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestX11DefaultDisplay.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore;
import javax.media.nativewindow.AbstractGraphicsDevice;
@@ -64,7 +64,7 @@ public class TestX11DefaultDisplay extends UITestCase {
System.setProperty("nativewindow.x11.display.default", x11DefaultDisplay);
}
- protected void runTestGL(GLCapabilities caps) throws InterruptedException {
+ protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle(getSimpleTestName("."));
@@ -76,21 +76,21 @@ public class TestX11DefaultDisplay extends UITestCase {
final SnapshotGLEventListener snap = new SnapshotGLEventListener();
snap.setPostSNDetail(demo.getClass().getSimpleName());
glWindow.addGLEventListener(snap);
-
- Animator animator = new Animator(glWindow);
- QuitAdapter quitAdapter = new QuitAdapter();
+
+ final Animator animator = new Animator(glWindow);
+ final QuitAdapter quitAdapter = new QuitAdapter();
glWindow.addKeyListener(quitAdapter);
glWindow.addWindowListener(quitAdapter);
animator.start();
-
+
glWindow.setVisible(true);
System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
-
+
animator.setUpdateFPSFrames(60, System.err);
snap.setMakeSnapshot();
@@ -106,12 +106,12 @@ public class TestX11DefaultDisplay extends UITestCase {
public void test00_DefaultDevice() {
final AbstractGraphicsDevice defaultDevice = GLProfile.getDefaultDevice();
System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
- System.out.println("GLProfile.getDefaultDevice(): "+defaultDevice);
- GLProfile glp = GLProfile.getDefault();
+ System.out.println("GLProfile.getDefaultDevice(): "+defaultDevice);
+ final GLProfile glp = GLProfile.getDefault();
System.out.println("GLProfile.getDefault(): "+glp);
-
- GLCapabilities caps = new GLCapabilities(glp);
- GLWindow glWindow = GLWindow.create(caps);
+
+ final GLCapabilities caps = new GLCapabilities(glp);
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.addGLEventListener(new DumpGLInfo());
@@ -121,19 +121,19 @@ public class TestX11DefaultDisplay extends UITestCase {
glWindow.display();
glWindow.destroy();
-
+
if( NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(true) ) {
Assert.assertEquals("X11 Default device does not match", defaultDevice.getConnection(), x11DefaultDisplay);
}
}
-
+
@Test
public void test01_GLDefaultRendering() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(null);
+ final GLCapabilities caps = new GLCapabilities(null);
runTestGL(caps);
}
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/Bug898AnimatorFromEDTAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/Bug898AnimatorFromEDTAWT.java
index 55e045d48..764973f06 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/Bug898AnimatorFromEDTAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/Bug898AnimatorFromEDTAWT.java
@@ -56,7 +56,7 @@ public class Bug898AnimatorFromEDTAWT extends javax.swing.JFrame {
//Layout
setMinimumSize(new Dimension(640, 480));
getContentPane().setLayout(new BorderLayout());
- GLCanvas panel = new GLCanvas(new GLCapabilities(GLProfile.getMaxProgrammable(true)));
+ final GLCanvas panel = new GLCanvas(new GLCapabilities(GLProfile.getMaxProgrammable(true)));
getContentPane().add(panel, BorderLayout.CENTER);
pack();
//Animator
@@ -69,19 +69,19 @@ public class Bug898AnimatorFromEDTAWT extends javax.swing.JFrame {
long step = 1;
@Override
- public void init(GLAutoDrawable glad) {
+ public void init(final GLAutoDrawable glad) {
startTime = System.currentTimeMillis();
}
@Override
- public void dispose(GLAutoDrawable glad) {
+ public void dispose(final GLAutoDrawable glad) {
}
@Override
- public void display(GLAutoDrawable glad) {
- long time = System.currentTimeMillis();
+ public void display(final GLAutoDrawable glad) {
+ final long time = System.currentTimeMillis();
if (animator.isAnimating() && step * 2000 < time - startTime) {
- long td = time - lastTime;
+ final long td = time - lastTime;
lastTime = time;
animator.pause();
System.out.println(Thread.currentThread().getName()+": #"+step+" "+td+" ms: animator.pause(): paused "+animator);
@@ -89,13 +89,13 @@ public class Bug898AnimatorFromEDTAWT extends javax.swing.JFrame {
public void run() {
try {
Thread.sleep(1000);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
- long td = System.currentTimeMillis() - lastTime;
+ final long td = System.currentTimeMillis() - lastTime;
if (animator.isPaused()) {
animator.resume(); //Doesn't work on v2.0.2 or higher
System.out.println(Thread.currentThread().getName()+": #"+step+" "+td+" ms: animator.resume(): animating "+animator);
@@ -110,7 +110,7 @@ public class Bug898AnimatorFromEDTAWT extends javax.swing.JFrame {
}
@Override
- public void reshape(GLAutoDrawable glad, int i, int i1, int i2, int i3) {
+ public void reshape(final GLAutoDrawable glad, final int i, final int i1, final int i2, final int i3) {
}
});
//Start animation
@@ -118,7 +118,7 @@ public class Bug898AnimatorFromEDTAWT extends javax.swing.JFrame {
System.out.println("animator.start()");
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java
index 3790a87f7..97f8b3f48 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java
@@ -18,6 +18,7 @@ import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
+import javax.swing.WindowConstants;
import org.junit.Test;
import org.junit.FixMethodOrder;
@@ -74,12 +75,12 @@ public class TestAWTCardLayoutAnimatorStartStopBug532 extends UITestCase {
testImpl(AnimatorControlBehavior.Continue, false);
}
- private static String id(Object obj) { return "0x" + ( null!=obj ? Integer.toHexString(obj.hashCode()) : "nil" ); }
- private static String str(Component c) {
+ private static String id(final Object obj) { return "0x" + ( null!=obj ? Integer.toHexString(obj.hashCode()) : "nil" ); }
+ private static String str(final Component c) {
return id(c)+": "+c.getClass().getSimpleName()+"[visible "+c.isVisible()+", showing "+c.isShowing()+", valid "+c.isValid()+
", displayable "+c.isDisplayable()+", "+c.getX()+"/"+c.getY()+" "+c.getWidth()+"x"+c.getHeight()+"]";
}
- void testImpl(final AnimatorControlBehavior animCtrl, boolean useFPSAnimator) throws InterruptedException, InvocationTargetException {
+ void testImpl(final AnimatorControlBehavior animCtrl, final boolean useFPSAnimator) throws InterruptedException, InvocationTargetException {
final GLProfile glp = GLProfile.get(GLProfile.GL2);
final GLCapabilities caps = new GLCapabilities(glp);
final GLCanvas canvas = new GLCanvas(caps);
@@ -119,12 +120,12 @@ public class TestAWTCardLayoutAnimatorStartStopBug532 extends UITestCase {
final JFrame frame = new JFrame();
frame.setTitle(getSimpleTestName(" - "));
frame.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
animatorCtrl.stop();
shouldStop = true;
}
});
- frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+ frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
final JLabel label = new JLabel("A label to cover the canvas");
@@ -235,7 +236,7 @@ public class TestAWTCardLayoutAnimatorStartStopBug532 extends UITestCase {
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java
index 42f170a06..d39abba41 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java
@@ -49,7 +49,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
static final int width = 640;
static final int height = 480;
- protected GLJPanel createGLJPanel(final GLCapabilities caps, final Frame frame, int x, int y, GearsES2 gears) throws InterruptedException {
+ protected GLJPanel createGLJPanel(final GLCapabilities caps, final Frame frame, final int x, final int y, final GearsES2 gears) throws InterruptedException {
final GLJPanel glCanvas = new GLJPanel(caps);
Assert.assertNotNull(glCanvas);
glCanvas.addGLEventListener(gears);
@@ -60,7 +60,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
return glCanvas;
}
- static void pauseAnimator(Animator animator, boolean pause) {
+ static void pauseAnimator(final Animator animator, final boolean pause) {
if(pause) {
animator.pause();
Assert.assertEquals(true, animator.isStarted());
@@ -73,7 +73,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
Assert.assertEquals(true, animator.isAnimating());
}
}
- static void stopAnimator(Animator animator) {
+ static void stopAnimator(final Animator animator) {
animator.stop();
Assert.assertEquals(false, animator.isStarted());
Assert.assertEquals(false, animator.isPaused());
@@ -133,7 +133,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
try {
Thread.sleep(duration/3);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -141,7 +141,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
try {
Thread.sleep(duration/3);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -149,7 +149,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
try {
Thread.sleep(duration/3);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -163,7 +163,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
f1.dispose();
f2.dispose();
f3.dispose();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
}});
@@ -235,7 +235,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
try {
Thread.sleep(duration/3);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -245,7 +245,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
try {
Thread.sleep(duration/3);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -255,7 +255,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
try {
Thread.sleep(duration/3);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -271,7 +271,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
f1.dispose();
f2.dispose();
f3.dispose();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new RuntimeException(t);
}
}});
@@ -283,13 +283,13 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
static long duration = 3*500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java
index 7b0fbe9ee..03892518b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java
@@ -48,7 +48,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
static final int width = 640;
static final int height = 480;
- protected GLWindow createGLWindow(final GLCapabilities caps, int x, int y, GearsES2 gears) throws InterruptedException {
+ protected GLWindow createGLWindow(final GLCapabilities caps, final int x, final int y, final GearsES2 gears) throws InterruptedException {
final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.addGLEventListener(gears);
@@ -58,7 +58,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
return glWindow;
}
- static void pauseAnimator(Animator animator, boolean pause) {
+ static void pauseAnimator(final Animator animator, final boolean pause) {
if(pause) {
animator.pause();
Assert.assertEquals(true, animator.isStarted());
@@ -71,7 +71,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
Assert.assertEquals(true, animator.isAnimating());
}
}
- static void stopAnimator(Animator animator) {
+ static void stopAnimator(final Animator animator) {
animator.stop();
Assert.assertEquals(false, animator.isStarted());
Assert.assertEquals(false, animator.isPaused());
@@ -125,7 +125,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
try {
Thread.sleep(duration/3);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -133,7 +133,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
try {
Thread.sleep(duration/3);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -141,7 +141,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
try {
Thread.sleep(duration/3);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -208,7 +208,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
try {
Thread.sleep(duration/3);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -218,7 +218,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
try {
Thread.sleep(duration/3);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -228,7 +228,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
try {
Thread.sleep(duration/3);
- } catch(Exception e) {
+ } catch(final Exception e) {
e.printStackTrace();
}
@@ -249,13 +249,13 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
static long duration = 3*500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java
index f1a185c31..6e10d65da 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java
@@ -74,7 +74,7 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
@BeforeClass
public static void initClass00() {
- Window dummyWindow = NewtFactory.createWindow(new Capabilities());
+ final Window dummyWindow = NewtFactory.createWindow(new Capabilities());
dummyWindow.setSize(demoWinSize, demoWinSize);
dummyWindow.setVisible(true);
Assert.assertEquals(true, dummyWindow.isVisible());
@@ -100,7 +100,7 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
protected abstract void setGLAutoDrawableVisible(GLAutoDrawable[] glads);
protected abstract void destroyGLAutoDrawableVisible(GLAutoDrawable glad);
- protected void runTestGL(GLCapabilitiesImmutable caps, int drawableCount, boolean exclusive, boolean preAdd, boolean shortenTest) throws InterruptedException {
+ protected void runTestGL(final GLCapabilitiesImmutable caps, final int drawableCount, final boolean exclusive, final boolean preAdd, final boolean shortenTest) throws InterruptedException {
final boolean useAWTRenderThread = isAWTTestCase();
if( useAWTRenderThread && exclusive ) {
if( testExclusiveWithAWT ) {
@@ -117,7 +117,7 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
final Thread awtRenderThread = getAWTRenderThread();
final AnimatorBase animator = createAnimator();
if( !useAWTRenderThread ) {
- animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+ animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
}
final GLAutoDrawable[] drawables = new GLAutoDrawable[drawableCount];
for(int i=0; i<drawableCount; i++) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00AWT.java
index 5608fe282..414841ab0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.ect;
import java.awt.BorderLayout;
@@ -49,62 +49,62 @@ import com.jogamp.common.os.Platform;
import com.jogamp.common.util.VersionNumber;
/**
- * ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature _and_ AnimatorBase with AWT.
+ * ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature _and_ AnimatorBase with AWT.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public abstract class ExclusiveContextBase00AWT extends ExclusiveContextBase00 {
static Thread awtEDT;
- static boolean osxCALayerAWTModBug;
-
+ static boolean osxCALayerAWTModBug;
+
@BeforeClass
public static void initClass00AWT() {
-
+
final VersionNumber version170 = new VersionNumber(1, 7, 0);
- osxCALayerAWTModBug = Platform.OSType.MACOS == Platform.getOSType() &&
+ osxCALayerAWTModBug = Platform.OSType.MACOS == Platform.getOSType() &&
0 > Platform.getJavaVersionNumber().compareTo(version170);
System.err.println("OSX CALayer AWT-Mod Bug "+osxCALayerAWTModBug);
System.err.println("OSType "+Platform.getOSType());
System.err.println("Java Version "+Platform.getJavaVersionNumber());
-
+
try {
EventQueue.invokeAndWait(new Runnable() {
public void run() {
awtEDT = Thread.currentThread();
} } );
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
Assert.assertNull(e);
}
-
+
}
-
+
@AfterClass
public static void releaseClass00AWT() {
}
-
+
@Override
protected boolean isAWTTestCase() { return true; }
-
+
@Override
protected Thread getAWTRenderThread() {
return awtEDT;
}
-
+
@Override
- protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, GLCapabilitiesImmutable caps) {
+ protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, final GLCapabilitiesImmutable caps) {
final GLCanvas glCanvas = new GLCanvas();
-
+
// FIXME: Below AWT layouts freezes OSX/Java7 @ setVisible: Window.setVisible .. [email protected]
// final Dimension sz = new Dimension(width, height);
// glCanvas.setMinimumSize(sz);
// glCanvas.setPreferredSize(sz);
- // glCanvas.setSize(sz);
+ // glCanvas.setSize(sz);
try {
EventQueue.invokeAndWait(new Runnable() {
public void run() {
- final Frame frame = new Frame();
- frame.setLayout(new BorderLayout());
+ final Frame frame = new Frame();
+ frame.setLayout(new BorderLayout());
frame.setMinimumSize(new Dimension(width, height));
frame.setBounds(x, y, width, height);
frame.add(glCanvas, BorderLayout.CENTER);
@@ -114,22 +114,22 @@ public abstract class ExclusiveContextBase00AWT extends ExclusiveContextBase00 {
frame.setTitle(title);
}
} });
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
Assert.assertNull(e);
}
-
+
return glCanvas;
}
-
- protected Frame getFrame(GLAutoDrawable glad) {
+
+ protected Frame getFrame(final GLAutoDrawable glad) {
Container p = ((Component)glad).getParent();
while( null != p && !( p instanceof Frame ) ) {
p = p.getParent();
}
- return (Frame)p;
+ return (Frame)p;
}
-
+
@Override
protected void setGLAutoDrawableVisible(final GLAutoDrawable[] glads) {
try {
@@ -138,27 +138,27 @@ public abstract class ExclusiveContextBase00AWT extends ExclusiveContextBase00 {
final int count = glads.length;
for(int i=0; i<count; i++) {
final GLAutoDrawable glad = glads[i];
- final Frame frame = getFrame(glad);
+ final Frame frame = getFrame(glad);
frame.setVisible(true);
- }
+ }
} } );
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
Assert.assertNull(e);
}
}
-
+
@Override
- protected void destroyGLAutoDrawableVisible(GLAutoDrawable glad) {
+ protected void destroyGLAutoDrawableVisible(final GLAutoDrawable glad) {
final Frame frame = getFrame(glad);
try {
EventQueue.invokeAndWait(new Runnable() {
public void run() {
frame.dispose();
} } );
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
Assert.assertNull(e);
}
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00NEWT.java
index 3f2de0156..9fe8bd03f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.ect;
import com.jogamp.newt.Display;
@@ -43,55 +43,55 @@ import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
/**
- * ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature _and_ AnimatorBase with NEWT.
+ * ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature _and_ AnimatorBase with NEWT.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public abstract class ExclusiveContextBase00NEWT extends ExclusiveContextBase00 {
static Display dpy;
static Screen screen;
-
+
@BeforeClass
public static void initClass00NEWT() {
dpy = NewtFactory.createDisplay(null);
- screen = NewtFactory.createScreen(dpy, 0);
+ screen = NewtFactory.createScreen(dpy, 0);
}
-
+
@AfterClass
public static void releaseClass00NEWT() {
screen = null;
dpy = null;
}
-
+
@Override
protected boolean isAWTTestCase() { return false; }
-
+
@Override
protected Thread getAWTRenderThread() {
return null;
}
-
+
@Override
- protected GLAutoDrawable createGLAutoDrawable(String title, int x, int y, int width, int height, GLCapabilitiesImmutable caps) {
- GLWindow glWindow = GLWindow.create(screen, caps);
+ protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, final GLCapabilitiesImmutable caps) {
+ final GLWindow glWindow = GLWindow.create(screen, caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle(title);
glWindow.setSize(width, height);
glWindow.setPosition(x, y);
return glWindow;
}
-
+
@Override
- protected void setGLAutoDrawableVisible(GLAutoDrawable[] glads) {
+ protected void setGLAutoDrawableVisible(final GLAutoDrawable[] glads) {
final int count = glads.length;
for(int i=0; i<count; i++) {
final GLAutoDrawable glad = glads[i];
((GLWindow)glad).setVisible(true);
}
}
-
+
@Override
- protected void destroyGLAutoDrawableVisible(GLAutoDrawable glad) {
+ protected void destroyGLAutoDrawableVisible(final GLAutoDrawable glad) {
((GLWindow)glad).destroy();
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10.java
index b6d4c4e6b..02f6efdeb 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10.java
@@ -73,7 +73,7 @@ public abstract class ExclusiveContextBase10 extends UITestCase {
@BeforeClass
public static void initClass00() {
- Window dummyWindow = NewtFactory.createWindow(new Capabilities());
+ final Window dummyWindow = NewtFactory.createWindow(new Capabilities());
dummyWindow.setSize(demoWinSize, demoWinSize);
dummyWindow.setVisible(true);
Assert.assertEquals(true, dummyWindow.isVisible());
@@ -99,7 +99,7 @@ public abstract class ExclusiveContextBase10 extends UITestCase {
protected abstract void setGLAutoDrawableVisible(GLAutoDrawable[] glads);
protected abstract void destroyGLAutoDrawableVisible(GLAutoDrawable glad);
- protected void runTestGL(GLCapabilitiesImmutable caps, int drawableCount, boolean exclusive) throws InterruptedException {
+ protected void runTestGL(final GLCapabilitiesImmutable caps, final int drawableCount, final boolean exclusive) throws InterruptedException {
final boolean useAWTRenderThread = isAWTTestCase();
if( useAWTRenderThread && exclusive ) {
if( testExclusiveWithAWT ) {
@@ -116,7 +116,7 @@ public abstract class ExclusiveContextBase10 extends UITestCase {
final Thread awtRenderThread = getAWTRenderThread();
final AnimatorBase animator = createAnimator();
if( !useAWTRenderThread ) {
- animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+ animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
}
final GLAutoDrawable[] drawables = new GLAutoDrawable[drawableCount];
for(int i=0; i<drawableCount; i++) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10AWT.java
index 237479e5a..8f4715056 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.ect;
import java.awt.BorderLayout;
@@ -49,62 +49,62 @@ import com.jogamp.common.os.Platform;
import com.jogamp.common.util.VersionNumber;
/**
- * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with AnimatorBase and AWT.
+ * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with AnimatorBase and AWT.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public abstract class ExclusiveContextBase10AWT extends ExclusiveContextBase10 {
static Thread awtEDT;
- static boolean osxCALayerAWTModBug;
-
+ static boolean osxCALayerAWTModBug;
+
@BeforeClass
public static void initClass00AWT() {
-
+
final VersionNumber version170 = new VersionNumber(1, 7, 0);
- osxCALayerAWTModBug = Platform.OSType.MACOS == Platform.getOSType() &&
+ osxCALayerAWTModBug = Platform.OSType.MACOS == Platform.getOSType() &&
0 > Platform.getJavaVersionNumber().compareTo(version170);
System.err.println("OSX CALayer AWT-Mod Bug "+osxCALayerAWTModBug);
System.err.println("OSType "+Platform.getOSType());
System.err.println("Java Version "+Platform.getJavaVersionNumber());
-
+
try {
EventQueue.invokeAndWait(new Runnable() {
public void run() {
awtEDT = Thread.currentThread();
} } );
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
Assert.assertNull(e);
}
-
+
}
-
+
@AfterClass
public static void releaseClass00AWT() {
}
-
+
@Override
protected boolean isAWTTestCase() { return true; }
-
+
@Override
protected Thread getAWTRenderThread() {
return awtEDT;
}
-
+
@Override
- protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, GLCapabilitiesImmutable caps) {
+ protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, final GLCapabilitiesImmutable caps) {
final GLCanvas glCanvas = new GLCanvas();
-
+
// FIXME: Below AWT layouts freezes OSX/Java7 @ setVisible: Window.setVisible .. [email protected]
// final Dimension sz = new Dimension(width, height);
// glCanvas.setMinimumSize(sz);
// glCanvas.setPreferredSize(sz);
- // glCanvas.setSize(sz);
+ // glCanvas.setSize(sz);
try {
EventQueue.invokeAndWait(new Runnable() {
public void run() {
- final Frame frame = new Frame();
- frame.setLayout(new BorderLayout());
+ final Frame frame = new Frame();
+ frame.setLayout(new BorderLayout());
frame.setMinimumSize(new Dimension(width, height));
frame.setBounds(x, y, width, height);
frame.add(glCanvas, BorderLayout.CENTER);
@@ -114,22 +114,22 @@ public abstract class ExclusiveContextBase10AWT extends ExclusiveContextBase10 {
frame.setTitle(title);
}
} });
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
Assert.assertNull(e);
}
-
+
return glCanvas;
}
-
- protected Frame getFrame(GLAutoDrawable glad) {
+
+ protected Frame getFrame(final GLAutoDrawable glad) {
Container p = ((Component)glad).getParent();
while( null != p && !( p instanceof Frame ) ) {
p = p.getParent();
}
- return (Frame)p;
+ return (Frame)p;
}
-
+
@Override
protected void setGLAutoDrawableVisible(final GLAutoDrawable[] glads) {
try {
@@ -138,27 +138,27 @@ public abstract class ExclusiveContextBase10AWT extends ExclusiveContextBase10 {
final int count = glads.length;
for(int i=0; i<count; i++) {
final GLAutoDrawable glad = glads[i];
- final Frame frame = getFrame(glad);
+ final Frame frame = getFrame(glad);
frame.setVisible(true);
- }
+ }
} } );
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
Assert.assertNull(e);
}
}
-
+
@Override
- protected void destroyGLAutoDrawableVisible(GLAutoDrawable glad) {
+ protected void destroyGLAutoDrawableVisible(final GLAutoDrawable glad) {
final Frame frame = getFrame(glad);
try {
EventQueue.invokeAndWait(new Runnable() {
public void run() {
frame.dispose();
} } );
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
Assert.assertNull(e);
}
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10NEWT.java
index fc8cad04c..84e6ed7f3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.ect;
import com.jogamp.newt.Display;
@@ -43,55 +43,55 @@ import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
/**
- * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with AnimatorBase and NEWT.
+ * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with AnimatorBase and NEWT.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public abstract class ExclusiveContextBase10NEWT extends ExclusiveContextBase10 {
static Display dpy;
static Screen screen;
-
+
@BeforeClass
public static void initClass00NEWT() {
dpy = NewtFactory.createDisplay(null);
- screen = NewtFactory.createScreen(dpy, 0);
+ screen = NewtFactory.createScreen(dpy, 0);
}
-
+
@AfterClass
public static void releaseClass00NEWT() {
screen = null;
dpy = null;
}
-
+
@Override
protected boolean isAWTTestCase() { return false; }
-
+
@Override
protected Thread getAWTRenderThread() {
return null;
}
-
+
@Override
- protected GLAutoDrawable createGLAutoDrawable(String title, int x, int y, int width, int height, GLCapabilitiesImmutable caps) {
- GLWindow glWindow = GLWindow.create(screen, caps);
+ protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, final GLCapabilitiesImmutable caps) {
+ final GLWindow glWindow = GLWindow.create(screen, caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle(title);
glWindow.setSize(width, height);
glWindow.setPosition(x, y);
return glWindow;
}
-
+
@Override
- protected void setGLAutoDrawableVisible(GLAutoDrawable[] glads) {
+ protected void setGLAutoDrawableVisible(final GLAutoDrawable[] glads) {
final int count = glads.length;
for(int i=0; i<count; i++) {
final GLAutoDrawable glad = glads[i];
((GLWindow)glad).setVisible(true);
}
}
-
+
@Override
- protected void destroyGLAutoDrawableVisible(GLAutoDrawable glad) {
+ protected void destroyGLAutoDrawableVisible(final GLAutoDrawable glad) {
((GLWindow)glad).destroy();
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimAWT.java
index 038e0781f..6a6f579a6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.ect;
import java.io.IOException;
@@ -39,17 +39,17 @@ import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
/**
- * ExclusiveContextThread VSync Animator to test correctness of the ExclusiveContext feature _and_ Animator with AWT.
+ * ExclusiveContextThread VSync Animator to test correctness of the ExclusiveContext feature _and_ Animator with AWT.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestExclusiveContext01VSyncAnimAWT extends ExclusiveContextBase00AWT {
-
+public class TestExclusiveContext01VSyncAnimAWT extends ExclusiveContextBase00AWT {
+
@Override
protected AnimatorBase createAnimator() {
return new Animator();
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimNEWT.java
index d52347920..a90dc0a5a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.ect;
import java.io.IOException;
@@ -38,17 +38,17 @@ import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
/**
- * ExclusiveContextThread VSync Animator to test correctness of the ExclusiveContext feature _and_ Animator with NEWT.
+ * ExclusiveContextThread VSync Animator to test correctness of the ExclusiveContext feature _and_ Animator with NEWT.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestExclusiveContext01VSyncAnimNEWT extends ExclusiveContextBase00NEWT {
+public class TestExclusiveContext01VSyncAnimNEWT extends ExclusiveContextBase00NEWT {
@Override
protected AnimatorBase createAnimator() {
return new Animator();
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimAWT.java
index f6697c608..0769fc93e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.ect;
import java.io.IOException;
@@ -38,17 +38,17 @@ import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
/**
- * ExclusiveContextThread FPS Animator to test correctness of the ExclusiveContext feature _and_ FPSAnimator with AWT.
+ * ExclusiveContextThread FPS Animator to test correctness of the ExclusiveContext feature _and_ FPSAnimator with AWT.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestExclusiveContext02FPSAnimAWT extends ExclusiveContextBase00AWT {
-
+public class TestExclusiveContext02FPSAnimAWT extends ExclusiveContextBase00AWT {
+
@Override
protected AnimatorBase createAnimator() {
return new FPSAnimator(0);
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimNEWT.java
index 33819c845..c9193071b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.ect;
import java.io.IOException;
@@ -38,17 +38,17 @@ import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
/**
- * ExclusiveContextThread FPS Animator to test correctness of the ExclusiveContext feature _and_ FPSAnimator with NEWT.
+ * ExclusiveContextThread FPS Animator to test correctness of the ExclusiveContext feature _and_ FPSAnimator with NEWT.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestExclusiveContext02FPSAnimNEWT extends ExclusiveContextBase00NEWT {
-
+public class TestExclusiveContext02FPSAnimNEWT extends ExclusiveContextBase00NEWT {
+
@Override
protected AnimatorBase createAnimator() {
return new FPSAnimator(0);
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext11VSyncAnimNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext11VSyncAnimNEWT.java
index 5067d6c57..08d385dc3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext11VSyncAnimNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext11VSyncAnimNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.ect;
import java.io.IOException;
@@ -38,17 +38,17 @@ import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
/**
- * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with Animator and NEWT.
+ * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with Animator and NEWT.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestExclusiveContext11VSyncAnimNEWT extends ExclusiveContextBase10NEWT {
+public class TestExclusiveContext11VSyncAnimNEWT extends ExclusiveContextBase10NEWT {
@Override
protected AnimatorBase createAnimator() {
return new Animator();
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext12FPSAnimNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext12FPSAnimNEWT.java
index 993b67e80..8a4519228 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext12FPSAnimNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext12FPSAnimNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.ect;
import java.io.IOException;
@@ -38,17 +38,17 @@ import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
/**
- * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with FPSAnimator and NEWT.
+ * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with FPSAnimator and NEWT.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestExclusiveContext12FPSAnimNEWT extends ExclusiveContextBase10NEWT {
-
+public class TestExclusiveContext12FPSAnimNEWT extends ExclusiveContextBase10NEWT {
+
@Override
protected AnimatorBase createAnimator() {
return new FPSAnimator(0);
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase.java
index 8c9d6c24a..b19dc38f2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase.java
@@ -76,7 +76,7 @@ public abstract class GLContextDrawableSwitchBase extends UITestCase {
static int width, height;
- static GLCapabilities getCaps(String profile) {
+ static GLCapabilities getCaps(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
@@ -98,7 +98,7 @@ public abstract class GLContextDrawableSwitchBase extends UITestCase {
glc.setPreferredSize(new_sz);
glc.setSize(new_sz);
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -111,7 +111,7 @@ public abstract class GLContextDrawableSwitchBase extends UITestCase {
frame.pack();
frame.setVisible(true);
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -123,18 +123,18 @@ public abstract class GLContextDrawableSwitchBase extends UITestCase {
public void run() {
frame.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
}
- private GLOffscreenAutoDrawable createGLOffscreenAutoDrawable(GLCapabilities caps, int width, int height) throws InterruptedException {
+ private GLOffscreenAutoDrawable createGLOffscreenAutoDrawable(final GLCapabilities caps, final int width, final int height) throws InterruptedException {
final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
return factory.createOffscreenAutoDrawable(null, caps, null, width, height);
}
- protected static boolean validateOnOffscreenLayer(GLADType gladType1, GLADType gladType2) {
+ protected static boolean validateOnOffscreenLayer(final GLADType gladType1, final GLADType gladType2) {
final boolean useOffscreenLayer = GLADType.GLCanvasOffscreen == gladType1 || GLADType.GLCanvasOffscreen == gladType2 ;
final boolean useOnscreenLayer = GLADType.GLCanvasOnscreen == gladType1 || GLADType.GLCanvasOnscreen == gladType2 ;
if( useOffscreenLayer ) {
@@ -151,9 +151,9 @@ public abstract class GLContextDrawableSwitchBase extends UITestCase {
return true;
}
- protected void testGLADOneLifecycle(Screen screen, GLCapabilities caps, GLADType gladType, int width,
- int height, GLEventListenerCounter glelTracker,
- SnapshotGLEventListener snapshotGLEventListener, final GLEventListenerState glelsIn, final GLEventListenerState glelsOut[], GLAnimatorControl animator)
+ protected void testGLADOneLifecycle(final Screen screen, final GLCapabilities caps, final GLADType gladType, final int width,
+ final int height, final GLEventListenerCounter glelTracker,
+ final SnapshotGLEventListener snapshotGLEventListener, final GLEventListenerState glelsIn, final GLEventListenerState glelsOut[], final GLAnimatorControl animator)
throws InterruptedException {
System.err.println("GLAD Lifecycle.0 "+gladType+", restoring "+((null!=glelsIn)?true:false)+", preserving "+((null!=glelsOut)?true:false));
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestBug722GLContextDrawableSwitchNewt2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestBug722GLContextDrawableSwitchNewt2AWT.java
index 24eefe73c..512ebc974 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestBug722GLContextDrawableSwitchNewt2AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestBug722GLContextDrawableSwitchNewt2AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.glels;
import java.io.IOException;
@@ -58,16 +58,16 @@ public class TestBug722GLContextDrawableSwitchNewt2AWT extends GLContextDrawable
static int loops = 10;
static long duration2 = 100; // ms
-
+
/**
* Interesting artifact w/ ATI proprietary driver is that the
* bug causing the quirk {@link GLRendererQuirks#DontCloseX11Display}
* also causes an XCB crash when reusing the X11 display connection
* from AWT -> NEWT. Pre-allocating the X11 Display and keeping it referenced
- * to avoid such re-usage worksaround this problem.
+ * to avoid such re-usage worksaround this problem.
*/
public static boolean fixedNewtDisplay = true;
-
+
@Test(timeout=180000) // TO 3 min
public void test11GLWindow2GLCanvasOnScrnGL2ES2() throws InterruptedException {
final GLCapabilities caps = getCaps(GLProfile.GL2ES2);
@@ -80,14 +80,14 @@ public class TestBug722GLContextDrawableSwitchNewt2AWT extends GLContextDrawable
return;
}
-
- GLADType gladType1 = GLADType.GLWindow;
- GLADType gladType2 = GLADType.GLCanvasOnscreen;
-
- final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
+
+ final GLADType gladType1 = GLADType.GLWindow;
+ final GLADType gladType2 = GLADType.GLCanvasOnscreen;
+
+ final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
final Animator animator = new Animator();
animator.start();
-
+
final Display dpy;
final Screen screen;
if( fixedNewtDisplay ) {
@@ -97,43 +97,43 @@ public class TestBug722GLContextDrawableSwitchNewt2AWT extends GLContextDrawable
} else {
dpy = null;
screen = null;
- }
-
+ }
+
duration = duration2;
-
- for(int i=0; i<loops; i++) {
+
+ for(int i=0; i<loops; i++) {
final GLEventListenerState glels[] = new GLEventListenerState[1];
final GLEventListenerCounter glelTracker = new GLEventListenerCounter();
-
+
// - create glad1 w/o context
// - create context using glad1 and assign it to glad1
{
System.err.println("Test "+i+"/"+loops+".1: GLAD-1 "+gladType1+", preserving.");
- testGLADOneLifecycle(screen, caps, gladType1, width, height,
+ testGLADOneLifecycle(screen, caps, gladType1, width, height,
glelTracker, snapshotGLEventListener,
- null,
- glels, animator);
+ null,
+ glels, animator);
System.err.println("Test "+i+"/"+loops+".1: done");
}
-
+
// - create glad2 w/ survived context
{
System.err.println("Test "+i+"/"+loops+".2: GLAD-1 "+gladType2+", restoring.");
- testGLADOneLifecycle(screen, caps, gladType2, width+100, height+100,
+ testGLADOneLifecycle(screen, caps, gladType2, width+100, height+100,
glelTracker, snapshotGLEventListener,
- glels[0],
+ glels[0],
null, null);
System.err.println("Test "+i+"/"+loops+".2: done.");
}
}
animator.stop();
-
+
if( fixedNewtDisplay ) {
screen.removeReference();
}
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
@@ -148,7 +148,7 @@ public class TestBug722GLContextDrawableSwitchNewt2AWT extends GLContextDrawable
/**
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
- System.err.println(stdin.readLine()); */
+ System.err.println(stdin.readLine()); */
org.junit.runner.JUnitCore.main(TestBug722GLContextDrawableSwitchNewt2AWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch01NEWT.java
index 8ad3e0242..603c858c9 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch01NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.glels;
import java.io.IOException;
@@ -69,21 +69,21 @@ import org.junit.runners.MethodSorters;
public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
static int width, height;
- static GLCapabilities getCaps(String profile) {
+ static GLCapabilities getCaps(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
}
return new GLCapabilities(GLProfile.get(profile));
}
-
+
@BeforeClass
public static void initClass() {
width = 256;
height = 256;
}
- private GLAutoDrawable createGLAutoDrawable(GLCapabilities caps, int x, int y, int width, int height, WindowListener wl) throws InterruptedException {
+ private GLAutoDrawable createGLAutoDrawable(final GLCapabilities caps, final int x, final int y, final int width, final int height, final WindowListener wl) throws InterruptedException {
final Window window = NewtFactory.createWindow(caps);
Assert.assertNotNull(window);
window.setPosition(x, y);
@@ -91,71 +91,71 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
window.setVisible(true);
Assert.assertTrue(AWTRobotUtil.waitForVisible(window, true));
Assert.assertTrue(AWTRobotUtil.waitForRealized(window, true));
-
+
final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
final GLDrawable drawable = factory.createGLDrawable(window);
Assert.assertNotNull(drawable);
-
+
drawable.setRealized(true);
Assert.assertTrue(drawable.isRealized());
-
+
final GLContext context = drawable.createContext(null);
Assert.assertNotNull(context);
-
+
final GLAutoDrawableDelegate glad = new GLAutoDrawableDelegate(drawable, context, window, false, null) {
@Override
protected void destroyImplInLock() {
super.destroyImplInLock();
window.destroy(); // destroys the actual window
- }
+ }
};
-
+
window.setWindowDestroyNotifyAction( new Runnable() {
public void run() {
glad.windowDestroyNotifyOp();
} } );
-
+
// add basic window interaction
window.addWindowListener(new WindowAdapter() {
@Override
- public void windowRepaint(WindowUpdateEvent e) {
+ public void windowRepaint(final WindowUpdateEvent e) {
glad.windowRepaintOp();
}
@Override
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
glad.windowResizedOp(window.getSurfaceWidth(), window.getSurfaceHeight());
}
});
window.addWindowListener(wl);
-
+
return glad;
}
-
+
@Test(timeout=30000)
public void testSwitch2WindowSingleContextGL2ES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
if(null == reqGLCaps) return;
testSwitch2WindowSingleContextImpl(reqGLCaps);
}
-
+
@Test(timeout=30000)
public void testSwitch2WindowSingleContextGLES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
if(null == reqGLCaps) return;
testSwitch2WindowSingleContextImpl(reqGLCaps);
}
-
- private void testSwitch2WindowSingleContextImpl(GLCapabilities caps) throws InterruptedException {
+
+ private void testSwitch2WindowSingleContextImpl(final GLCapabilities caps) throws InterruptedException {
final QuitAdapter quitAdapter = new QuitAdapter();
-
- GLAutoDrawable glad1 = createGLAutoDrawable(caps, 64, 64, width, height, quitAdapter);
- GLAutoDrawable glad2 = createGLAutoDrawable(caps, 2*64+width, 64, width+100, height+100, quitAdapter);
-
+
+ final GLAutoDrawable glad1 = createGLAutoDrawable(caps, 64, 64, width, height, quitAdapter);
+ final GLAutoDrawable glad2 = createGLAutoDrawable(caps, 2*64+width, 64, width+100, height+100, quitAdapter);
+
// create single context using glad1 and assign it to glad1,
// destroy the prev. context afterwards.
{
final GLContext newCtx = glad1.createContext(null);
- Assert.assertNotNull(newCtx);
+ Assert.assertNotNull(newCtx);
final GLContext oldCtx = glad1.setContext(newCtx, true);
Assert.assertNotNull(oldCtx);
Assert.assertFalse(oldCtx.isCreated());
@@ -163,22 +163,22 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
Assert.assertTrue(GLContext.CONTEXT_CURRENT_NEW==res || GLContext.CONTEXT_CURRENT==res);
newCtx.release();
}
-
- final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
- GearsES2 gears = new GearsES2(1);
+
+ final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
+ final GearsES2 gears = new GearsES2(1);
glad1.addGLEventListener(gears);
glad1.addGLEventListener(snapshotGLEventListener);
snapshotGLEventListener.setMakeSnapshot();
-
- Animator animator = new Animator();
+
+ final Animator animator = new Animator();
animator.add(glad1);
animator.add(glad2);
animator.start();
-
+
int s = 0;
- long t0 = System.currentTimeMillis();
+ final long t0 = System.currentTimeMillis();
long t1 = t0;
-
+
while( !quitAdapter.shouldQuit() && ( t1 - t0 ) < duration ) {
if( ( t1 - t0 ) / period > s) {
s++;
@@ -186,8 +186,8 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
// switch context _and_ the demo synchronously
GLDrawableUtil.swapGLContextAndAllGLEventListener(glad1, glad2);
-
- System.err.println(s+" - switch - END "+ ( t1 - t0 ));
+
+ System.err.println(s+" - switch - END "+ ( t1 - t0 ));
}
Thread.sleep(100);
t1 = System.currentTimeMillis();
@@ -195,56 +195,56 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
animator.stop();
glad1.destroy();
- glad2.destroy();
+ glad2.destroy();
}
-
+
@Test(timeout=30000)
public void testSwitch2GLWindowOneDemoGL2ES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
if(null == reqGLCaps) return;
testSwitch2GLWindowOneDemoImpl(reqGLCaps);
}
-
+
@Test(timeout=30000)
public void testSwitch2GLWindowOneDemoGLES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
if(null == reqGLCaps) return;
testSwitch2GLWindowOneDemoImpl(reqGLCaps);
}
-
- private void testSwitch2GLWindowOneDemoImpl(GLCapabilities caps) throws InterruptedException {
- final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
+
+ private void testSwitch2GLWindowOneDemoImpl(final GLCapabilities caps) throws InterruptedException {
+ final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
final GearsES2 gears = new GearsES2(1);
final QuitAdapter quitAdapter = new QuitAdapter();
-
- GLWindow glWindow1 = GLWindow.create(caps);
+
+ final GLWindow glWindow1 = GLWindow.create(caps);
glWindow1.setTitle("win1");
glWindow1.setSize(width, height);
glWindow1.setPosition(64, 64);
glWindow1.addGLEventListener(0, gears);
glWindow1.addGLEventListener(snapshotGLEventListener);
glWindow1.addWindowListener(quitAdapter);
-
- GLWindow glWindow2 = GLWindow.create(caps);
- glWindow2.setTitle("win2");
+
+ final GLWindow glWindow2 = GLWindow.create(caps);
+ glWindow2.setTitle("win2");
glWindow2.setSize(width+100, height+100);
glWindow2.setPosition(2*64+width, 64);
glWindow2.addWindowListener(quitAdapter);
- Animator animator = new Animator();
+ final Animator animator = new Animator();
animator.add(glWindow1);
animator.add(glWindow2);
animator.start();
-
+
glWindow1.setVisible(true);
glWindow2.setVisible(true);
snapshotGLEventListener.setMakeSnapshot();
-
+
int s = 0;
- long t0 = System.currentTimeMillis();
+ final long t0 = System.currentTimeMillis();
long t1 = t0;
-
+
while( !quitAdapter.shouldQuit() && ( t1 - t0 ) < duration ) {
if( ( t1 - t0 ) / period > s) {
s++;
@@ -254,11 +254,11 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
// switch context _and_ the demo synchronously
GLDrawableUtil.swapGLContextAndAllGLEventListener(glWindow1, glWindow2);
-
+
System.err.println(s+" - B w1-h 0x"+Long.toHexString(glWindow1.getHandle())+",-ctx 0x"+Long.toHexString(glWindow1.getContext().getHandle()));
System.err.println(s+" - B w2-h 0x"+Long.toHexString(glWindow2.getHandle())+",-ctx 0x"+Long.toHexString(glWindow2.getContext().getHandle()));
System.err.println(s+" - switch - END "+ ( t1 - t0 ));
-
+
snapshotGLEventListener.setMakeSnapshot();
}
Thread.sleep(100);
@@ -268,61 +268,61 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
animator.stop();
glWindow1.destroy();
glWindow2.destroy();
-
+
}
-
+
@Test(timeout=30000)
public void testSwitch2GLWindowEachWithOwnDemoGL2ES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
if(null == reqGLCaps) return;
testSwitch2GLWindowEachWithOwnDemoImpl(reqGLCaps);
}
-
+
@Test(timeout=30000)
public void testSwitch2GLWindowEachWithOwnDemoGLES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
if(null == reqGLCaps) return;
testSwitch2GLWindowEachWithOwnDemoImpl(reqGLCaps);
}
-
- public void testSwitch2GLWindowEachWithOwnDemoImpl(GLCapabilities caps) throws InterruptedException {
+
+ public void testSwitch2GLWindowEachWithOwnDemoImpl(final GLCapabilities caps) throws InterruptedException {
final GearsES2 gears = new GearsES2(1);
final RedSquareES2 rsquare = new RedSquareES2(1);
final QuitAdapter quitAdapter = new QuitAdapter();
- final SnapshotGLEventListener snapshotGLEventListener1 = new SnapshotGLEventListener();
- final SnapshotGLEventListener snapshotGLEventListener2 = new SnapshotGLEventListener();
-
- GLWindow glWindow1 = GLWindow.create(caps);
+ final SnapshotGLEventListener snapshotGLEventListener1 = new SnapshotGLEventListener();
+ final SnapshotGLEventListener snapshotGLEventListener2 = new SnapshotGLEventListener();
+
+ final GLWindow glWindow1 = GLWindow.create(caps);
glWindow1.setTitle("win1");
glWindow1.setSize(width, height);
glWindow1.setPosition(64, 64);
glWindow1.addGLEventListener(0, gears);
glWindow1.addGLEventListener(snapshotGLEventListener1);
glWindow1.addWindowListener(quitAdapter);
-
- GLWindow glWindow2 = GLWindow.create(caps);
- glWindow2.setTitle("win2");
+
+ final GLWindow glWindow2 = GLWindow.create(caps);
+ glWindow2.setTitle("win2");
glWindow2.setSize(width+100, height+100);
glWindow2.setPosition(2*64+width, 64);
glWindow2.addGLEventListener(0, rsquare);
glWindow2.addGLEventListener(snapshotGLEventListener2);
glWindow2.addWindowListener(quitAdapter);
- Animator animator = new Animator();
+ final Animator animator = new Animator();
animator.add(glWindow1);
animator.add(glWindow2);
animator.start();
-
+
glWindow1.setVisible(true);
glWindow2.setVisible(true);
snapshotGLEventListener1.setMakeSnapshot();
snapshotGLEventListener2.setMakeSnapshot();
-
+
int s = 0;
- long t0 = System.currentTimeMillis();
+ final long t0 = System.currentTimeMillis();
long t1 = t0;
-
+
while( !quitAdapter.shouldQuit() && ( t1 - t0 ) < duration ) {
if( ( t1 - t0 ) / period > s) {
s++;
@@ -330,7 +330,7 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
System.err.println(s+" - A w1-h 0x"+Long.toHexString(glWindow1.getHandle())+",-ctx 0x"+Long.toHexString(glWindow1.getContext().getHandle()));
System.err.println(s+" - A w2-h 0x"+Long.toHexString(glWindow2.getHandle())+",-ctx 0x"+Long.toHexString(glWindow2.getContext().getHandle()));
GLDrawableUtil.swapGLContextAndAllGLEventListener(glWindow1, glWindow2);
- System.err.println(s+" - B w1-h 0x"+Long.toHexString(glWindow1.getHandle())+",-ctx 0x"+Long.toHexString(glWindow1.getContext().getHandle()));
+ System.err.println(s+" - B w1-h 0x"+Long.toHexString(glWindow1.getHandle())+",-ctx 0x"+Long.toHexString(glWindow1.getContext().getHandle()));
System.err.println(s+" - B w2-h 0x"+Long.toHexString(glWindow2.getHandle())+",-ctx 0x"+Long.toHexString(glWindow2.getContext().getHandle()));
System.err.println(s+" - switch - END "+ ( t1 - t0 ));
snapshotGLEventListener1.setMakeSnapshot();
@@ -347,31 +347,31 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
// System.err.println("post-del-w1: w1: "+glWindow1);
// System.err.println("post-del-w1: w2: "+glWindow2);
glWindow2.destroy();
-
+
}
// default timing for 2 switches
static long duration = 2200; // ms
static long period = 1000; // ms
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-period")) {
i++;
try {
period = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
- System.err.println(stdin.readLine()); */
+ System.err.println(stdin.readLine()); */
org.junit.runner.JUnitCore.main(TestGLContextDrawableSwitch01NEWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch02AWT.java
index c612f1204..d665c1a87 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch02AWT.java
@@ -63,7 +63,7 @@ import org.junit.runners.MethodSorters;
public class TestGLContextDrawableSwitch02AWT extends UITestCase {
static int width, height;
- static GLCapabilities getCaps(String profile) {
+ static GLCapabilities getCaps(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
@@ -77,12 +77,12 @@ public class TestGLContextDrawableSwitch02AWT extends UITestCase {
height = 256;
}
- private GLAutoDrawable createGLAutoDrawable(final Frame frame, GLCapabilities caps, int width, int height) throws InterruptedException, InvocationTargetException {
+ private GLAutoDrawable createGLAutoDrawable(final Frame frame, final GLCapabilities caps, final int width, final int height) throws InterruptedException, InvocationTargetException {
final GLAutoDrawable glad;
if( caps.isOnscreen() ) {
- GLCanvas glCanvas = new GLCanvas(caps);
+ final GLCanvas glCanvas = new GLCanvas(caps);
Assert.assertNotNull(glCanvas);
- Dimension glc_sz = new Dimension(width, height);
+ final Dimension glc_sz = new Dimension(width, height);
glCanvas.setMinimumSize(glc_sz);
glCanvas.setPreferredSize(glc_sz);
glCanvas.setSize(glc_sz);
@@ -111,33 +111,33 @@ public class TestGLContextDrawableSwitch02AWT extends UITestCase {
testSwitch2AWTGLCanvas2OffscreenImpl(reqGLCaps);
}
- private void testSwitch2AWTGLCanvas2OffscreenImpl(GLCapabilities capsOnscreen) throws InterruptedException, InvocationTargetException {
+ private void testSwitch2AWTGLCanvas2OffscreenImpl(final GLCapabilities capsOnscreen) throws InterruptedException, InvocationTargetException {
final GLCapabilities capsOffscreen = (GLCapabilities) capsOnscreen.clone();
capsOffscreen.setOnscreen(false);
final Frame frame = new Frame("Gears AWT Test");
Assert.assertNotNull(frame);
- GLAutoDrawable glCanvas = createGLAutoDrawable(frame, capsOnscreen, width, height);
+ final GLAutoDrawable glCanvas = createGLAutoDrawable(frame, capsOnscreen, width, height);
final QuitAdapter quitAdapter = new QuitAdapter();
new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glCanvas).addTo(frame);
final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
- GearsES2 gears = new GearsES2(1);
+ final GearsES2 gears = new GearsES2(1);
glCanvas.addGLEventListener(gears);
glCanvas.addGLEventListener(snapshotGLEventListener);
snapshotGLEventListener.setMakeSnapshot();
- Animator animator = new Animator();
+ final Animator animator = new Animator();
animator.add(glCanvas);
animator.start();
int s = 0;
- long t0 = System.currentTimeMillis();
+ final long t0 = System.currentTimeMillis();
long t1 = t0;
- GLAutoDrawable glOffscreen = createGLAutoDrawable(null, capsOffscreen, width, height);
+ final GLAutoDrawable glOffscreen = createGLAutoDrawable(null, capsOffscreen, width, height);
while( !quitAdapter.shouldQuit() && ( t1 - t0 ) < duration ) {
if( ( t1 - t0 ) / period > s) {
s++;
@@ -168,18 +168,18 @@ public class TestGLContextDrawableSwitch02AWT extends UITestCase {
static long duration = 2900; // ms
static long period = 1000; // ms
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-period")) {
i++;
try {
period = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch10NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch10NEWT.java
index 52743d819..822898e0b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch10NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch10NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.glels;
import java.io.IOException;
@@ -63,11 +63,11 @@ import org.junit.runners.MethodSorters;
/**
* Test re-association of GLContext/GLDrawables,
- * here GLContext's survival of GLDrawable destruction
+ * here GLContext's survival of GLDrawable destruction
* and reuse w/ new or recreated GLDrawable.
* <p>
- * Test utilizes {@link GLEventListenerState} for preserving the
- * GLAutoDrawable state, i.e. GLContext, all GLEventListener
+ * Test utilizes {@link GLEventListenerState} for preserving the
+ * GLAutoDrawable state, i.e. GLContext, all GLEventListener
* and the GLAnimatorControl association.
* </p>
* <p>
@@ -84,21 +84,21 @@ public class TestGLContextDrawableSwitch10NEWT extends UITestCase {
static int width, height;
- static GLCapabilities getCaps(String profile) {
+ static GLCapabilities getCaps(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
}
return new GLCapabilities(GLProfile.get(profile));
}
-
+
@BeforeClass
public static void initClass() {
width = 256;
height = 256;
}
- private GLAutoDrawable createGLAutoDrawableWithoutContext(GLCapabilities caps, int x, int y, int width, int height, WindowListener wl) throws InterruptedException {
+ private GLAutoDrawable createGLAutoDrawableWithoutContext(final GLCapabilities caps, final int x, final int y, final int width, final int height, final WindowListener wl) throws InterruptedException {
final Window window = NewtFactory.createWindow(caps);
Assert.assertNotNull(window);
window.setPosition(x, y);
@@ -106,87 +106,87 @@ public class TestGLContextDrawableSwitch10NEWT extends UITestCase {
window.setVisible(true);
Assert.assertTrue(AWTRobotUtil.waitForVisible(window, true));
Assert.assertTrue(AWTRobotUtil.waitForRealized(window, true));
-
+
final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
final GLDrawable drawable = factory.createGLDrawable(window);
Assert.assertNotNull(drawable);
-
+
drawable.setRealized(true);
Assert.assertTrue(drawable.isRealized());
-
+
final GLAutoDrawableDelegate glad = new GLAutoDrawableDelegate(drawable, null, window, false, null) {
@Override
protected void destroyImplInLock() {
super.destroyImplInLock();
window.destroy(); // destroys the actual window
- }
+ }
};
-
+
window.setWindowDestroyNotifyAction( new Runnable() {
public void run() {
glad.windowDestroyNotifyOp();
} } );
-
+
// add basic window interaction
window.addWindowListener(new WindowAdapter() {
@Override
- public void windowRepaint(WindowUpdateEvent e) {
+ public void windowRepaint(final WindowUpdateEvent e) {
glad.windowRepaintOp();
}
@Override
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
glad.windowResizedOp(window.getSurfaceWidth(), window.getSurfaceHeight());
}
});
window.addWindowListener(wl);
-
+
return glad;
}
-
+
@Test(timeout=30000)
public void test01GLADDelegateGL2ES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
if(null == reqGLCaps) return;
testGLADDelegateImpl(reqGLCaps);
}
-
+
@Test(timeout=30000)
public void test02GLADDelegateGLES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
if(null == reqGLCaps) return;
testGLADDelegateImpl(reqGLCaps);
}
-
- private void testGLADDelegateImpl(GLCapabilities caps) throws InterruptedException {
+
+ private void testGLADDelegateImpl(final GLCapabilities caps) throws InterruptedException {
final GLEventListenerCounter glelCounter = new GLEventListenerCounter();
- final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
+ final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
final Animator animator = new Animator();
animator.start();
-
+
final GLEventListenerState glls1;
-
+
// - create glad1 w/o context
// - create context using glad1 and assign it to glad1
{
- final QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
final GLAutoDrawable glad1 = createGLAutoDrawableWithoutContext(caps, 64, 64, width, height, quitAdapter);
final GLContext context1 = glad1.createContext(null);
glad1.setContext(context1, true);
animator.add(glad1);
-
+
glad1.addGLEventListener(glelCounter);
glad1.addGLEventListener(new GearsES2(1));
glad1.addGLEventListener(snapshotGLEventListener);
snapshotGLEventListener.setMakeSnapshot();
-
+
final long t0 = System.currentTimeMillis();
long t1 = t0;
-
+
while( !quitAdapter.shouldQuit() && ( t1 - t0 ) < duration ) {
Thread.sleep(100);
t1 = System.currentTimeMillis();
}
-
+
Assert.assertEquals(1, glelCounter.initCount);
Assert.assertTrue(1 <= glelCounter.reshapeCount);
Assert.assertTrue(1 <= glelCounter.displayCount);
@@ -195,11 +195,11 @@ public class TestGLContextDrawableSwitch10NEWT extends UITestCase {
Assert.assertEquals(3, glad1.getGLEventListenerCount());
Assert.assertEquals(context1.getGLReadDrawable(), glad1.getDelegatedDrawable());
Assert.assertEquals(context1.getGLDrawable(), glad1.getDelegatedDrawable());
-
+
// - dis-associate context from glad1
// - destroy glad1
glls1 = GLEventListenerState.moveFrom(glad1);
-
+
Assert.assertEquals(1, glelCounter.initCount);
Assert.assertTrue(1 <= glelCounter.reshapeCount);
Assert.assertTrue(1 <= glelCounter.displayCount);
@@ -211,27 +211,27 @@ public class TestGLContextDrawableSwitch10NEWT extends UITestCase {
Assert.assertEquals(true, glls1.isOwner());
Assert.assertEquals(null, glad1.getContext());
Assert.assertEquals(0, glad1.getGLEventListenerCount());
-
+
glad1.destroy();
Assert.assertEquals(1, glelCounter.initCount);
Assert.assertTrue(1 <= glelCounter.reshapeCount);
Assert.assertTrue(1 <= glelCounter.displayCount);
Assert.assertEquals(0, glelCounter.disposeCount);
}
-
+
// - create glad2 w/ survived context
{
- final QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
final GLAutoDrawable glad2 = createGLAutoDrawableWithoutContext(caps, 2*64+width, 64, width+100, height+100, quitAdapter);
snapshotGLEventListener.setMakeSnapshot();
-
+
Assert.assertEquals(null, glad2.getContext());
Assert.assertEquals(0, glad2.getGLEventListenerCount());
-
+
glls1.moveTo(glad2);
-
+
Assert.assertTrue(glad2.isRealized());
-
+
Assert.assertEquals(1, glelCounter.initCount);
Assert.assertTrue(1 <= glelCounter.reshapeCount);
Assert.assertTrue(1 <= glelCounter.displayCount);
@@ -241,15 +241,15 @@ public class TestGLContextDrawableSwitch10NEWT extends UITestCase {
Assert.assertEquals(glls1.context.getGLReadDrawable(), glad2.getDelegatedDrawable());
Assert.assertEquals(glls1.context.getGLDrawable(), glad2.getDelegatedDrawable());
Assert.assertEquals(false, glls1.isOwner());
-
+
final long t0 = System.currentTimeMillis();
long t1 = t0;
-
+
while( !quitAdapter.shouldQuit() && ( t1 - t0 ) < duration ) {
Thread.sleep(100);
t1 = System.currentTimeMillis();
}
-
+
glad2.destroy();
Assert.assertEquals(1, glelCounter.initCount);
Assert.assertTrue(1 <= glelCounter.reshapeCount);
@@ -258,20 +258,20 @@ public class TestGLContextDrawableSwitch10NEWT extends UITestCase {
}
animator.stop();
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
- System.err.println(stdin.readLine()); */
+ System.err.println(stdin.readLine()); */
org.junit.runner.JUnitCore.main(TestGLContextDrawableSwitch10NEWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch11NewtAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch11NewtAWT.java
index e5f61a4be..9697869bc 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch11NewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch11NewtAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.glels;
import java.io.IOException;
@@ -45,11 +45,11 @@ import org.junit.runners.MethodSorters;
/**
* Test re-association of GLContext/GLDrawables,
- * here GLContext's survival of GLDrawable destruction
+ * here GLContext's survival of GLDrawable destruction
* and reuse w/ new or recreated GLDrawable.
* <p>
- * Test utilizes {@link GLEventListenerState} for preserving the
- * GLAutoDrawable state, i.e. GLContext, all GLEventListener
+ * Test utilizes {@link GLEventListenerState} for preserving the
+ * GLAutoDrawable state, i.e. GLContext, all GLEventListener
* and the GLAnimatorControl association.
* </p>
* <p>
@@ -68,54 +68,54 @@ public class TestGLContextDrawableSwitch11NewtAWT extends GLContextDrawableSwitc
if(null == reqGLCaps) return;
testGLWindowImpl(reqGLCaps);
}
-
+
@Test(timeout=30000)
public void test22GLWindowGLES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
if(null == reqGLCaps) return;
testGLWindowImpl(reqGLCaps);
}
-
- private void testGLWindowImpl(GLCapabilities caps) throws InterruptedException {
- final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
+
+ private void testGLWindowImpl(final GLCapabilities caps) throws InterruptedException {
+ final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
final GLEventListenerCounter glelTracker = new GLEventListenerCounter();
final Animator animator = new Animator();
animator.start();
-
+
final GLEventListenerState glels[] = new GLEventListenerState[1];
-
+
// - create glad1 w/o context
// - create context using glad1 and assign it to glad1
{
- testGLADOneLifecycle(null, caps, GLADType.GLWindow, width,
+ testGLADOneLifecycle(null, caps, GLADType.GLWindow, width,
height, glelTracker,
- snapshotGLEventListener,
- null, glels, animator);
+ snapshotGLEventListener,
+ null, glels, animator);
}
-
+
// - create glad2 w/ survived context
{
- testGLADOneLifecycle(null, caps, GLADType.GLWindow, width+100,
+ testGLADOneLifecycle(null, caps, GLADType.GLWindow, width+100,
height+100, glelTracker,
- snapshotGLEventListener,
+ snapshotGLEventListener,
glels[0], null, null);
}
animator.stop();
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
- System.err.println(stdin.readLine()); */
+ System.err.println(stdin.readLine()); */
org.junit.runner.JUnitCore.main(TestGLContextDrawableSwitch11NewtAWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch12AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch12AWT.java
index d17d899b8..4ad0b1dc5 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch12AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch12AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.glels;
import java.io.IOException;
@@ -46,11 +46,11 @@ import org.junit.runners.MethodSorters;
/**
* Test re-association of GLContext/GLDrawables,
- * here GLContext's survival of GLDrawable destruction
+ * here GLContext's survival of GLDrawable destruction
* and reuse w/ new or recreated GLDrawable.
* <p>
- * Test utilizes {@link GLEventListenerState} for preserving the
- * GLAutoDrawable state, i.e. GLContext, all GLEventListener
+ * Test utilizes {@link GLEventListenerState} for preserving the
+ * GLAutoDrawable state, i.e. GLContext, all GLEventListener
* and the GLAnimatorControl association.
* </p>
* <p>
@@ -69,29 +69,29 @@ public class TestGLContextDrawableSwitch12AWT extends GLContextDrawableSwitchBas
if(null == reqGLCaps) return;
testGLCanvasImpl(reqGLCaps, false);
}
-
+
@Test(timeout=30000)
public void test02GLCanvasOnscreenGLES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
if(null == reqGLCaps) return;
testGLCanvasImpl(reqGLCaps, false);
}
-
+
@Test(timeout=30000)
public void test11GLCanvasOffscreenGL2ES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
if(null == reqGLCaps) return;
testGLCanvasImpl(reqGLCaps, true);
}
-
+
@Test(timeout=30000)
public void test12GLCanvasOffscreenGLES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
if(null == reqGLCaps) return;
testGLCanvasImpl(reqGLCaps, true);
}
-
- private void testGLCanvasImpl(GLCapabilities caps, boolean offscreenLayer) throws InterruptedException {
+
+ private void testGLCanvasImpl(final GLCapabilities caps, final boolean offscreenLayer) throws InterruptedException {
if( offscreenLayer ) {
if( !JAWTUtil.isOffscreenLayerSupported() ) {
System.err.println("Platform doesn't support offscreen rendering.");
@@ -103,45 +103,45 @@ public class TestGLContextDrawableSwitch12AWT extends GLContextDrawableSwitchBas
return;
}
}
- final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
+ final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
final GLEventListenerCounter glelTracker = new GLEventListenerCounter();
final Animator animator = new Animator();
animator.start();
-
+
final GLEventListenerState glels[] = new GLEventListenerState[1];
-
+
// - create glad1 w/o context
// - create context using glad1 and assign it to glad1
{
- testGLADOneLifecycle(null, caps, offscreenLayer ? GLADType.GLCanvasOffscreen : GLADType.GLCanvasOnscreen, width,
+ testGLADOneLifecycle(null, caps, offscreenLayer ? GLADType.GLCanvasOffscreen : GLADType.GLCanvasOnscreen, width,
height, glelTracker,
- snapshotGLEventListener,
- null, glels, animator);
+ snapshotGLEventListener,
+ null, glels, animator);
}
-
+
// - create glad2 w/ survived context
{
- testGLADOneLifecycle(null, caps, offscreenLayer ? GLADType.GLCanvasOffscreen : GLADType.GLCanvasOnscreen, width+100,
+ testGLADOneLifecycle(null, caps, offscreenLayer ? GLADType.GLCanvasOffscreen : GLADType.GLCanvasOnscreen, width+100,
height+100, glelTracker,
- snapshotGLEventListener,
+ snapshotGLEventListener,
glels[0], null, null);
}
animator.stop();
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
- System.err.println(stdin.readLine()); */
+ System.err.println(stdin.readLine()); */
org.junit.runner.JUnitCore.main(TestGLContextDrawableSwitch12AWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch21Newt2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch21Newt2AWT.java
index 2b0f43d68..eaf3d37d4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch21Newt2AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch21Newt2AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.acore.glels;
import java.io.IOException;
@@ -49,17 +49,17 @@ import org.junit.runners.MethodSorters;
/**
* Test re-association of GLContext/GLDrawables,
- * here GLContext's survival of GLDrawable destruction
+ * here GLContext's survival of GLDrawable destruction
* and reuse w/ new or recreated GLDrawable.
* <p>
- * Test utilizes {@link GLEventListenerState} for preserving the
- * GLAutoDrawable state, i.e. GLContext, all GLEventListener
+ * Test utilizes {@link GLEventListenerState} for preserving the
+ * GLAutoDrawable state, i.e. GLContext, all GLEventListener
* and the GLAnimatorControl association.
* </p>
* <p>
- * This test moves the {@link GLEventListenerState} from a
+ * This test moves the {@link GLEventListenerState} from a
* NEWT GLWindow before it's destruction to an AWT GLCanvas after it's creation
- * and vice versa
+ * and vice versa
* </p>
* <p>
* See Bug 665 - https://jogamp.org/bugzilla/show_bug.cgi?id=665.
@@ -69,7 +69,7 @@ import org.junit.runners.MethodSorters;
* bug causing the quirk {@link GLRendererQuirks#DontCloseX11Display}
* also causes an XCB crash when reusing the X11 display connection
* from AWT -> NEWT. Pre-allocating the X11 Display and keeping it referenced
- * to avoid such re-usage worksaround this problem.
+ * to avoid such re-usage worksaround this problem.
* </p>
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@@ -81,14 +81,14 @@ public class TestGLContextDrawableSwitch21Newt2AWT extends GLContextDrawableSwit
if(null == reqGLCaps) return;
testGLCanvas2GLWindowImpl(null, reqGLCaps, GLADType.GLCanvasOnscreen, GLADType.GLWindow);
}
-
+
@Test(timeout=30000)
public void test02GLCanvasOnScrn2GLWindowGLES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
if(null == reqGLCaps) return;
testGLCanvas2GLWindowImpl(null, reqGLCaps, GLADType.GLCanvasOnscreen, GLADType.GLWindow);
}
-
+
@Test(timeout=30000)
public void test11GLWindow2GLCanvasOnScrnGL2ES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
@@ -99,7 +99,7 @@ public class TestGLContextDrawableSwitch21Newt2AWT extends GLContextDrawableSwit
testGLCanvas2GLWindowImpl(screen, reqGLCaps, GLADType.GLWindow, GLADType.GLCanvasOnscreen);
screen.removeReference();
}
-
+
@Test(timeout=30000)
public void test12GLWindow2GLCanvasOnScrnGLES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -110,21 +110,21 @@ public class TestGLContextDrawableSwitch21Newt2AWT extends GLContextDrawableSwit
testGLCanvas2GLWindowImpl(screen, reqGLCaps, GLADType.GLWindow, GLADType.GLCanvasOnscreen);
screen.removeReference();
}
-
+
@Test(timeout=30000)
public void test21GLCanvasOffScrn2GLWindowGL2ES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
if(null == reqGLCaps) return;
testGLCanvas2GLWindowImpl(null, reqGLCaps, GLADType.GLCanvasOffscreen, GLADType.GLWindow);
}
-
+
@Test(timeout=30000)
public void test22GLCanvasOffScrn2GLWindowGLES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
if(null == reqGLCaps) return;
testGLCanvas2GLWindowImpl(null, reqGLCaps, GLADType.GLCanvasOffscreen, GLADType.GLWindow);
}
-
+
@Test(timeout=30000)
public void test31GLWindow2GLCanvasOffScrnGL2ES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
@@ -135,7 +135,7 @@ public class TestGLContextDrawableSwitch21Newt2AWT extends GLContextDrawableSwit
testGLCanvas2GLWindowImpl(screen, reqGLCaps, GLADType.GLWindow, GLADType.GLCanvasOffscreen);
screen.removeReference();
}
-
+
@Test(timeout=30000)
public void test32GLWindow2GLCanvasOffScrnGLES2() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -146,50 +146,50 @@ public class TestGLContextDrawableSwitch21Newt2AWT extends GLContextDrawableSwit
testGLCanvas2GLWindowImpl(screen, reqGLCaps, GLADType.GLWindow, GLADType.GLCanvasOffscreen);
screen.removeReference();
}
-
- private void testGLCanvas2GLWindowImpl(Screen screen, GLCapabilities caps, GLADType gladType1, GLADType gladType2) throws InterruptedException {
+
+ private void testGLCanvas2GLWindowImpl(final Screen screen, final GLCapabilities caps, final GLADType gladType1, final GLADType gladType2) throws InterruptedException {
if( !validateOnOffscreenLayer(gladType1, gladType2) ) {
return;
}
- final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
+ final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
final GLEventListenerCounter glelTracker = new GLEventListenerCounter();
final Animator animator = new Animator();
animator.start();
-
+
final GLEventListenerState glels[] = new GLEventListenerState[1];
-
+
// - create glad1 w/o context
// - create context using glad1 and assign it to glad1
{
- testGLADOneLifecycle(screen, caps, gladType1, width,
+ testGLADOneLifecycle(screen, caps, gladType1, width,
height, glelTracker,
- snapshotGLEventListener,
- null, glels, animator);
+ snapshotGLEventListener,
+ null, glels, animator);
}
-
+
// - create glad2 w/ survived context
{
- testGLADOneLifecycle(screen, caps, gladType2, width+100,
+ testGLADOneLifecycle(screen, caps, gladType2, width+100,
height+100, glelTracker,
- snapshotGLEventListener,
+ snapshotGLEventListener,
glels[0], null, null);
}
animator.stop();
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
/**
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
- System.err.println(stdin.readLine()); */
+ System.err.println(stdin.readLine()); */
org.junit.runner.JUnitCore.main(TestGLContextDrawableSwitch21Newt2AWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/ManualHiDPIBufferedImage01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/ManualHiDPIBufferedImage01AWT.java
index 0b67cfe46..6ccc9d2c4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/ManualHiDPIBufferedImage01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/ManualHiDPIBufferedImage01AWT.java
@@ -22,7 +22,7 @@ public class ManualHiDPIBufferedImage01AWT {
static final int width = 200;
static final int height = 100;
- public static void main(String[] args) throws InterruptedException, InvocationTargetException {
+ public static void main(final String[] args) throws InterruptedException, InvocationTargetException {
final JFrame frame = new JFrame();
SwingUtilities.invokeLater(new Runnable() {
@@ -36,7 +36,7 @@ public class ManualHiDPIBufferedImage01AWT {
@SuppressWarnings("serial")
final Canvas canvas = new Canvas() {
@Override
- public void paint(Graphics g) {
+ public void paint(final Graphics g) {
super.paint(g);
g.drawImage(image1, 0, 0, width, height, this);
g.drawImage(image2, 0, height + 5, width, height, this);
@@ -52,14 +52,14 @@ public class ManualHiDPIBufferedImage01AWT {
});
}
- static JCheckBox getCheckBox(String text, boolean selected) {
- JCheckBox checkBox = new JCheckBox(text);
+ static JCheckBox getCheckBox(final String text, final boolean selected) {
+ final JCheckBox checkBox = new JCheckBox(text);
checkBox.setSelected(selected);
checkBox.setSize(new Dimension(width, height));
return checkBox;
}
- static Image getImage(JComponent component, int width, int height, int scale) {
+ static Image getImage(final JComponent component, final int width, final int height, final int scale) {
final BufferedImage image = new BufferedImage(width*scale, height*scale, BufferedImage.TYPE_INT_ARGB);
final Graphics g = image.getGraphics();
((Graphics2D) g).scale(scale, scale);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java
index 6152fb144..1bfe313ff 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.awt;
import javax.media.opengl.GLProfile;
@@ -53,13 +53,13 @@ public class TestAWT01GLn extends UITestCase {
System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
}
- protected void runTestGL(GLCapabilities caps) throws InterruptedException {
+ protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
final Frame frame = new Frame("Texture Test");
Assert.assertNotNull(frame);
-
+
final GLCanvas glCanvas = new GLCanvas(caps);
Assert.assertNotNull(glCanvas);
-
+
glCanvas.addGLEventListener(new GearsES2());
frame.add(glCanvas);
@@ -71,23 +71,23 @@ public class TestAWT01GLn extends UITestCase {
// Ensure 1st paint of GLCanvas will have a valid size, hence drawable gets created.
frame.setSize(512, 512);
frame.validate();
-
+
frame.setVisible(true);
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
glCanvas.display(); // one in process display
- Animator animator = new Animator(glCanvas);
+ final Animator animator = new Animator(glCanvas);
animator.start();
Thread.sleep(500); // 500 ms
animator.stop();
-
+
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -95,7 +95,7 @@ public class TestAWT01GLn extends UITestCase {
frame.remove(glCanvas);
frame.dispose();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
@@ -103,10 +103,10 @@ public class TestAWT01GLn extends UITestCase {
@Test
public void test01GLDefault() throws InterruptedException {
- GLProfile glp = GLProfile.getDefault();
+ final GLProfile glp = GLProfile.getDefault();
System.out.println("GLProfile Default: "+glp);
if(glp.isGL2ES2()) {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps);
} else {
System.out.println("not a GL2ES2 profile");
@@ -116,9 +116,9 @@ public class TestAWT01GLn extends UITestCase {
@Test
public void test02GL2() throws InterruptedException {
if(GLProfile.isAvailable(GLProfile.GL2)) {
- GLProfile glprofile = GLProfile.get(GLProfile.GL2);
+ final GLProfile glprofile = GLProfile.get(GLProfile.GL2);
System.out.println( "GLProfile GL2: " + glprofile );
- GLCapabilities caps = new GLCapabilities(glprofile);
+ final GLCapabilities caps = new GLCapabilities(glprofile);
runTestGL(caps);
} else {
System.out.println("GL2 n/a");
@@ -128,16 +128,16 @@ public class TestAWT01GLn extends UITestCase {
@Test
public void test02ES2() throws InterruptedException {
if(GLProfile.isAvailable(GLProfile.GLES2)) {
- GLProfile glprofile = GLProfile.get(GLProfile.GLES2);
+ final GLProfile glprofile = GLProfile.get(GLProfile.GLES2);
System.out.println( "GLProfile GLES2: " + glprofile );
- GLCapabilities caps = new GLCapabilities(glprofile);
+ final GLCapabilities caps = new GLCapabilities(glprofile);
runTestGL(caps);
} else {
System.out.println("GLES2 n/a");
}
}
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestAWT01GLn.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java
index 349674eef..412209482 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.awt;
import com.jogamp.opengl.test.junit.util.UITestCase;
@@ -47,7 +47,7 @@ public class TestAWT02WindowClosing extends UITestCase {
@Test
public void test01WindowClosing() throws InterruptedException {
final Frame frame = new Frame();
- ClosingWindowAdapter closingWindowAdapter = new ClosingWindowAdapter(frame);
+ final ClosingWindowAdapter closingWindowAdapter = new ClosingWindowAdapter(frame);
frame.addWindowListener(closingWindowAdapter);
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -55,7 +55,7 @@ public class TestAWT02WindowClosing extends UITestCase {
frame.setSize(500, 500);
frame.setVisible(true);
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
@@ -63,8 +63,8 @@ public class TestAWT02WindowClosing extends UITestCase {
Thread.sleep(durationPerTest);
if(!closingWindowAdapter.closingCalled) {
// programatically issue windowClosing
- Toolkit tk = Toolkit.getDefaultToolkit();
- EventQueue evtQ = tk.getSystemEventQueue();
+ final Toolkit tk = Toolkit.getDefaultToolkit();
+ final EventQueue evtQ = tk.getSystemEventQueue();
evtQ.postEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));
Thread.sleep(200);
}
@@ -74,25 +74,25 @@ public class TestAWT02WindowClosing extends UITestCase {
static class ClosingWindowAdapter extends WindowAdapter {
boolean closingCalled = false;
Frame frame;
- public ClosingWindowAdapter(Frame frame) {
+ public ClosingWindowAdapter(final Frame frame) {
this.frame = frame;
}
- public void windowClosing(WindowEvent ev) {
+ public void windowClosing(final WindowEvent ev) {
System.out.println("windowClosing() called ..");
closingCalled = true;
frame.dispose();
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java
index 7282687e5..920fdda31 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.awt;
import javax.media.opengl.GLProfile;
@@ -81,7 +81,7 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
frame1.add(label);
frame1.setSize(512, 512);
frame1.setLocation(0, 0);
-
+
frame2 = new Frame("Frame 2");
Assert.assertNotNull(frame2);
frame2.add(label);
@@ -101,7 +101,7 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
frame1.dispose();
frame2.dispose();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
@@ -121,7 +121,7 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
frame.add(glCanvas);
frame.validate();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
@@ -135,7 +135,7 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
frame.add(label);
frame.validate();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
@@ -147,7 +147,7 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
public void run() {
frame.setVisible(v);
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
@@ -175,7 +175,7 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
Thread.sleep(durationPerTest/4);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java
index 00e14b094..8fbe680df 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.awt;
import javax.media.opengl.GLCapabilities;
@@ -40,18 +40,18 @@ import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestBug460GLCanvasNPEAWT {
- public static void main(String[] args) {
- TestBug460GLCanvasNPEAWT instance = new TestBug460GLCanvasNPEAWT();
+ public static void main(final String[] args) {
+ final TestBug460GLCanvasNPEAWT instance = new TestBug460GLCanvasNPEAWT();
instance.testIncompleteGLCanvasNPE();
}
@Test
public void testIncompleteGLCanvasNPE() {
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
- GLCanvas glc = new GLCanvas(caps);
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCanvas glc = new GLCanvas(caps);
// GLDrawableFactory factory = glc.getFactory(); // null ok: not realized
// GLCapabilitiesImmutable glci = glc.getChosenGLCapabilities(); -> NPE ok: .. not realized
- GLCapabilitiesImmutable glCapsRequested = glc.getRequestedGLCapabilities();
+ final GLCapabilitiesImmutable glCapsRequested = glc.getRequestedGLCapabilities();
System.out.println("ReqCaps: "+glCapsRequested);
System.out.println("GLCanvas: "+glc);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java
index 96ec8ab75..19c96af14 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java
@@ -69,8 +69,8 @@ public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GL
GLOffscreenAutoDrawable offScreenBuffer;
AWTGLReadBufferUtil awtGLReadBufferUtil;
- private void render(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+ private void render(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
Assert.assertNotNull(gl);
gl.glClear(GL.GL_COLOR_BUFFER_BIT);
@@ -86,37 +86,37 @@ public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GL
}
/* @Override */
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
awtGLReadBufferUtil = new AWTGLReadBufferUtil(drawable.getGLProfile(), false);
}
/* @Override */
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
/* @Override */
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
render(offScreenBuffer);
// BufferedImage outputImage = com.jogamp.opengl.util.awt.Screenshot.readToBufferedImage(200, 200, false);
- BufferedImage outputImage = awtGLReadBufferUtil.readPixelsToBufferedImage(drawable.getGL(), 0, 0, 200, 200, true /* awtOrientation */);
+ final BufferedImage outputImage = awtGLReadBufferUtil.readPixelsToBufferedImage(drawable.getGL(), 0, 0, 200, 200, true /* awtOrientation */);
Assert.assertNotNull(outputImage);
- ImageIcon imageIcon = new ImageIcon(outputImage);
+ final ImageIcon imageIcon = new ImageIcon(outputImage);
final JLabel imageLabel = new JLabel(imageIcon);
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- Container cont = jframe.getContentPane();
+ final Container cont = jframe.getContentPane();
cont.removeAll();
cont.add(imageLabel);
cont.validate();
}});
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
/* @Override */
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
try {
awtGLReadBufferUtil.dispose(drawable.getGL());
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -124,7 +124,7 @@ public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GL
jframe.setVisible(false);
jframe.dispose();
}});
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -134,20 +134,20 @@ public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GL
jframe = new JFrame("Offscreen Supersampling");
Assert.assertNotNull(jframe);
jframe.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
System.exit(0);
}
});
- GLProfile glp = GLProfile.get(GLProfile.GL2);
+ final GLProfile glp = GLProfile.get(GLProfile.GL2);
Assert.assertNotNull(glp);
- GLDrawableFactory fac = GLDrawableFactory.getFactory(glp);
+ final GLDrawableFactory fac = GLDrawableFactory.getFactory(glp);
Assert.assertNotNull(fac);
Assert.assertTrue( fac.canCreateGLPbuffer(GLProfile.getDefaultDevice(), glp) );
- GLCapabilities glCap = new GLCapabilities(glp);
+ final GLCapabilities glCap = new GLCapabilities(glp);
Assert.assertNotNull(glCap);
// COMMENTING OUT THIS LINE FIXES THE ISSUE.
@@ -177,7 +177,7 @@ public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GL
offScreenBuffer.destroy();
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461PBufferSupersamplingSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461PBufferSupersamplingSwingAWT.java
index a1abbe2aa..1e0f8fe4a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461PBufferSupersamplingSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461PBufferSupersamplingSwingAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -30,7 +30,7 @@ package com.jogamp.opengl.test.junit.jogl.awt;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
-
+
import java.awt.image.BufferedImage;
import java.lang.reflect.InvocationTargetException;
@@ -64,11 +64,11 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
public class TestBug461PBufferSupersamplingSwingAWT extends UITestCase implements GLEventListener {
JFrame jframe;
GLPbuffer offScreenBuffer;
-
- private void render(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+
+ private void render(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
Assert.assertNotNull(gl);
- gl.glClear(GL.GL_COLOR_BUFFER_BIT);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT);
// draw a triangle filling the window
gl.glBegin(GL.GL_TRIANGLES);
@@ -80,34 +80,34 @@ public class TestBug461PBufferSupersamplingSwingAWT extends UITestCase implement
gl.glVertex2d(1, -1);
gl.glEnd();
}
-
+
/* @Override */
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
}
/* @Override */
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
- }
-
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ }
+
/* @Override */
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
render(offScreenBuffer);
- BufferedImage outputImage = com.jogamp.opengl.util.awt.Screenshot.readToBufferedImage(200, 200, false);
+ final BufferedImage outputImage = com.jogamp.opengl.util.awt.Screenshot.readToBufferedImage(200, 200, false);
Assert.assertNotNull(outputImage);
- ImageIcon imageIcon = new ImageIcon(outputImage);
- JLabel imageLabel = new JLabel(imageIcon);
+ final ImageIcon imageIcon = new ImageIcon(outputImage);
+ final JLabel imageLabel = new JLabel(imageIcon);
jframe.getContentPane().add(imageLabel);
}
/* @Override */
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
jframe.setVisible(false);
jframe.dispose();
}});
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -118,26 +118,26 @@ public class TestBug461PBufferSupersamplingSwingAWT extends UITestCase implement
Assert.assertNotNull(jframe);
jframe.setSize( 300, 300);
jframe.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
System.exit(0);
}
});
- GLProfile glp = GLProfile.get(GLProfile.GL2);
+ final GLProfile glp = GLProfile.get(GLProfile.GL2);
Assert.assertNotNull(glp);
-
- GLDrawableFactory fac = GLDrawableFactory.getFactory(glp);
+
+ final GLDrawableFactory fac = GLDrawableFactory.getFactory(glp);
Assert.assertNotNull(fac);
-
+
Assert.assertTrue( fac.canCreateGLPbuffer(GLProfile.getDefaultDevice(), glp) );
-
- GLCapabilities glCap = new GLCapabilities(glp);
+
+ final GLCapabilities glCap = new GLCapabilities(glp);
Assert.assertNotNull(glCap);
-
- // COMMENTING OUT THIS LINE FIXES THE ISSUE.
+
+ // COMMENTING OUT THIS LINE FIXES THE ISSUE.
// Setting this in JOGL1 works. Thus this is a JOGL2 issue.
glCap.setSampleBuffers(true);
-
+
// Without line below, there is an error on Windows.
glCap.setDoubleBuffered(false);
// Needed for drop shadows
@@ -146,7 +146,7 @@ public class TestBug461PBufferSupersamplingSwingAWT extends UITestCase implement
//makes a new buffer
offScreenBuffer = fac.createGLPbuffer(GLProfile.getDefaultDevice(), glCap, null, 200, 200, null);
Assert.assertNotNull(offScreenBuffer);
- offScreenBuffer.addGLEventListener(this);
+ offScreenBuffer.addGLEventListener(this);
offScreenBuffer.display();
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -155,7 +155,7 @@ public class TestBug461PBufferSupersamplingSwingAWT extends UITestCase implement
offScreenBuffer.destroy();
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestBug461PBufferSupersamplingSwingAWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug551AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug551AWT.java
index 51eb22210..8b9934310 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug551AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug551AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.awt;
import java.lang.reflect.InvocationTargetException;
@@ -61,35 +61,35 @@ public class TestBug551AWT extends UITestCase {
static void checkGraphicsEnvironment() {
Rectangle virtualBounds = new Rectangle();
- GraphicsEnvironment ge =GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice[] gs = ge.getScreenDevices();
+ final GraphicsEnvironment ge =GraphicsEnvironment.getLocalGraphicsEnvironment();
+ final GraphicsDevice[] gs = ge.getScreenDevices();
- //write graphics devices to log
+ //write graphics devices to log
System.err.println("number of graphics devices " + gs.length);
for(int i =0 ; i < gs.length; i++) {
System.err.println(gs[i].toString());
}
//check for bounds
- for (int j = 0; j < gs.length; j++) {
- GraphicsDevice gd = gs[j];
- GraphicsConfiguration[] gc = gd.getConfigurations();
+ for (int j = 0; j < gs.length; j++) {
+ final GraphicsDevice gd = gs[j];
+ final GraphicsConfiguration[] gc = gd.getConfigurations();
for (int i=0; i < gc.length; i++) {
System.err.println("graphics configuration for device " + j + " is: " + gc[i].getBounds());
virtualBounds = virtualBounds.union(gc[i].getBounds());
- }
+ }
}
}
-
+
protected void runTestGL() throws InterruptedException, InvocationTargetException {
final Window window = new JFrame(this.getSimpleTestName(" - "));
final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
-
+
// final array as mutable container hack
final GLCanvas[] glCanvas = new GLCanvas[1];
- Runnable test = new Runnable() {
+ final Runnable test = new Runnable() {
public void run() {
glCanvas[0] = new GLCanvas(caps);
glCanvas[0].addGLEventListener(new GearsES2());
@@ -106,13 +106,13 @@ public class TestBug551AWT extends UITestCase {
}
};
- Runnable cleanup = new Runnable() {
+ final Runnable cleanup = new Runnable() {
public void run() {
System.out.println("cleaning up...");
window.setVisible(false);
try {
window.removeAll();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
assumeNoException(t);
t.printStackTrace();
}
@@ -124,7 +124,7 @@ public class TestBug551AWT extends UITestCase {
// AWT / Swing on EDT..
invokeAndWait(test);
- Animator animator = new Animator(glCanvas[0]);
+ final Animator animator = new Animator(glCanvas[0]);
animator.start();
Thread.sleep(1000);
animator.stop();
@@ -144,7 +144,7 @@ public class TestBug551AWT extends UITestCase {
runTestGL();
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestBug551AWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug572AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug572AWT.java
index 234336016..5fb4433c9 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug572AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug572AWT.java
@@ -58,7 +58,7 @@ public class TestBug572AWT extends UITestCase {
static class Cleanup implements Runnable {
Window window;
- public Cleanup(Window w) {
+ public Cleanup(final Window w) {
window = w;
}
@@ -67,7 +67,7 @@ public class TestBug572AWT extends UITestCase {
window.setVisible(false);
try {
window.removeAll();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
Assume.assumeNoException(t);
t.printStackTrace();
}
@@ -95,7 +95,7 @@ public class TestBug572AWT extends UITestCase {
window.setSize(512, 512);
window.validate();
} else {
- Dimension size = new Dimension(512, 512);
+ final Dimension size = new Dimension(512, 512);
glCanvas.setPreferredSize(size);
glCanvas.setMinimumSize(size);
window.pack();
@@ -164,7 +164,7 @@ public class TestBug572AWT extends UITestCase {
testRealizeGLCanvas(false, false);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestBug572AWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug611AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug611AWT.java
index d8e781d92..e64df6687 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug611AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug611AWT.java
@@ -15,25 +15,25 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
/**
* As reported in Bug 611, on Windows XP is a performance issue:
- * After JOGL initialization there seems to be a huge time lag
+ * After JOGL initialization there seems to be a huge time lag
* when trying to open the Desktop folder.
* <p>
* Test disabled since showing the Desktop folder will
- * disturb the 'desktop' .. if there is another way to show
+ * disturb the 'desktop' .. if there is another way to show
* the performance bug, pls do so.
* </p>
* <p>
* Since Windows XP is out of life .. we may not care ..
- * </p>
+ * </p>
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestBug611AWT extends UITestCase {
-
+
@Test
public void test00() {
- // make junit happy
+ // make junit happy
}
-
+
// @Test
public void test01() {
try {
@@ -46,17 +46,17 @@ public class TestBug611AWT extends UITestCase {
desktop = null;
}
if(null != desktop) {
- String home = System.getProperty("user.home");
+ final String home = System.getProperty("user.home");
File homeFolder = null;
if(null != home) {
{
- File tst = new File(home + "/Desktop");
+ final File tst = new File(home + "/Desktop");
if( tst.canRead() ) {
homeFolder = tst;
}
}
if(null == homeFolder) {
- File tst = new File(home);
+ final File tst = new File(home);
if( tst.canRead() ) {
homeFolder = tst;
}
@@ -73,12 +73,12 @@ public class TestBug611AWT extends UITestCase {
desktop.open(homeFolder);
}
}
- } catch(Exception ex) {
+ } catch(final Exception ex) {
ex.printStackTrace();
}
}
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestBug611AWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug642JSplitPaneMixHwLw01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug642JSplitPaneMixHwLw01AWT.java
index 57210a946..fffffcb96 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug642JSplitPaneMixHwLw01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug642JSplitPaneMixHwLw01AWT.java
@@ -37,7 +37,7 @@ import com.jogamp.opengl.util.FPSAnimator;
/**
* Documenting Bug 642 (related to Bug 586)
- *
+ *
* <p>
* JSplitPane cannot mix hw/lw components, only if setting property '-Dsun.awt.disableMixing=true'.
* </p>
@@ -47,62 +47,62 @@ import com.jogamp.opengl.util.FPSAnimator;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestBug642JSplitPaneMixHwLw01AWT extends UITestCase {
static long durationPerTest = 500;
-
+
static {
// too late: use at cmd-line '-Dsun.awt.disableMixing=true' works
// System.setProperty("sun.awt.disableMixing", "true");
}
/**
- * Doesn't work either ..
+ * Doesn't work either ..
*/
@SuppressWarnings("serial")
public static class TransparentJScrollPane extends JScrollPane {
- public TransparentJScrollPane(Component view) {
+ public TransparentJScrollPane(final Component view) {
super(view);
-
+
setOpaque(false);
-
+
try {
ReflectionUtil.callStaticMethod(
- "com.sun.awt.AWTUtilities", "setComponentMixingCutoutShape",
- new Class<?>[] { Component.class, Shape.class },
- new Object[] { this, new Rectangle() } ,
+ "com.sun.awt.AWTUtilities", "setComponentMixingCutoutShape",
+ new Class<?>[] { Component.class, Shape.class },
+ new Object[] { this, new Rectangle() } ,
GraphicsConfiguration.class.getClassLoader());
System.err.println("com.sun.awt.AWTUtilities.setComponentMixingCutoutShape(..) passed");
- } catch (RuntimeException re) {
+ } catch (final RuntimeException re) {
System.err.println("com.sun.awt.AWTUtilities.setComponentMixingCutoutShape(..) failed: "+re.getMessage());
}
}
-
+
@Override
- public void setOpaque(boolean isOpaque) {
+ public void setOpaque(final boolean isOpaque) {
}
}
-
- protected void runTestGL(GLCapabilities caps, boolean useGLJPanel, boolean useContainer) throws InterruptedException {
+
+ protected void runTestGL(final GLCapabilities caps, final boolean useGLJPanel, final boolean useContainer) throws InterruptedException {
final String typeS = useGLJPanel ? "LW" : "HW";
final JFrame frame = new JFrame("Mix Hw/Lw Swing - Canvas "+typeS);
Assert.assertNotNull(frame);
-
+
final Dimension f_sz = new Dimension(824,568);
// final Dimension f_sz = new Dimension(600,400);
// final Dimension glc_sz = new Dimension(500,600);
-
+
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
-
+
final Component glComp;
final GLAutoDrawable glad;
if(useGLJPanel) {
final GLJPanel glJPanel = new GLJPanel(new GLCapabilities(GLProfile.getDefault()));
- Assert.assertNotNull(glJPanel);
+ Assert.assertNotNull(glJPanel);
glJPanel.addGLEventListener(new GearsES2());
glComp = glJPanel;
glad = glJPanel;
} else {
final GLCanvas glCanvas = new GLCanvas(new GLCapabilities(GLProfile.getDefault()));
- Assert.assertNotNull(glCanvas);
+ Assert.assertNotNull(glCanvas);
glCanvas.addGLEventListener(new GearsES2());
if( useContainer ) {
final Container cont = new Container();
@@ -114,20 +114,20 @@ public class TestBug642JSplitPaneMixHwLw01AWT extends UITestCase {
}
glad = glCanvas;
}
-
+
final Container contentPane = frame.getContentPane();
-
- JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
+
+ final JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
splitPane.setResizeWeight(0.5d);
splitPane.setLeftComponent(glComp);
// splitPane.setLeftComponent(new JPanel());
// splitPane.setLeftComponent(new Canvas());
splitPane.setRightComponent(new JPanel());
- contentPane.add(splitPane, BorderLayout.CENTER);
+ contentPane.add(splitPane, BorderLayout.CENTER);
final GLAnimatorControl animator = useGLJPanel ? new FPSAnimator(glad, 60) : new Animator(glad);
animator.start();
-
+
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -137,7 +137,7 @@ public class TestBug642JSplitPaneMixHwLw01AWT extends UITestCase {
frame.setVisible(true);
// however, Hw/Lw mixing is still a problem ..
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
@@ -146,14 +146,14 @@ public class TestBug642JSplitPaneMixHwLw01AWT extends UITestCase {
Thread.sleep(durationPerTest);
animator.stop();
-
+
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setVisible(false);
frame.dispose();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
@@ -161,26 +161,26 @@ public class TestBug642JSplitPaneMixHwLw01AWT extends UITestCase {
@Test
public void test01JSplitPaneWithHwGLCanvasPlain() throws InterruptedException {
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, false, false);
}
@Test
public void test02JSplitPaneWithHwGLCanvasContainer() throws InterruptedException {
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, false, true);
}
-
+
@Test
public void test03JSplitPaneWithLwGLJPanel() throws InterruptedException {
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, true, false);
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
@@ -189,11 +189,11 @@ public class TestBug642JSplitPaneMixHwLw01AWT extends UITestCase {
/**
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
- System.err.println(stdin.readLine());
+ System.err.println(stdin.readLine());
*/
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestBug642JSplitPaneMixHwLw01AWT.class.getName();
+ final String tstname = TestBug642JSplitPaneMixHwLw01AWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
-
+
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java
index 2a0bbfeb8..36c1e11b2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java
@@ -44,6 +44,7 @@ import javax.media.opengl.awt.GLCanvas;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
import jogamp.nativewindow.jawt.JAWTUtil;
@@ -95,7 +96,7 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
final JFrame jFrame1 = new JFrame("JFrame #"+num);
// jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+ jFrame1.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
jFrame1.getContentPane().add(jPanel[0]);
jFrame1.setSize(width, height);
@@ -147,33 +148,33 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
private volatile int frameCount = 0;
- protected void runTestGL(boolean onscreen, GLCapabilities caps)
+ protected void runTestGL(final boolean onscreen, final GLCapabilities caps)
throws AWTException, InterruptedException, InvocationTargetException
{
for(int i=0; i<1; i++) {
- Animator anim = new Animator();
+ final Animator anim = new Animator();
final GLCanvas glc = new GLCanvas(caps);
Assert.assertNotNull(glc);
anim.add(glc);
if( !onscreen ) {
glc.setShallUseOffscreenLayer(true);
}
- Dimension glc_sz = new Dimension(width, height);
+ final Dimension glc_sz = new Dimension(width, height);
glc.setMinimumSize(glc_sz);
glc.setPreferredSize(glc_sz);
glc.setSize(glc_sz);
glc.addGLEventListener(new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {}
+ public void init(final GLAutoDrawable drawable) {}
@Override
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
frameCount++;
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
});
final GearsES2 gears = new GearsES2(1);
gears.setVerbose(false);
@@ -235,7 +236,7 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
System.err.println("Offscreen test requested or platform requires it.");
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
if(shallUseOffscreenPBufferLayer) {
caps.setPBuffer(true);
caps.setOnscreen(true); // simulate normal behavior ..
@@ -251,7 +252,7 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
System.err.println("Platform doesn't support offscreen test.");
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
if(shallUseOffscreenPBufferLayer) {
caps.setPBuffer(true);
caps.setOnscreen(true); // simulate normal behavior ..
@@ -259,13 +260,13 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
runTestGL(false, caps);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
durationPerTest = Long.parseLong(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-layeredFBO")) {
shallUseOffscreenFBOLayer = true;
} else if(args[i].equals("-layeredPBuffer")) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug675BeansInDesignTimeAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug675BeansInDesignTimeAWT.java
index 3363fdd52..12ebe88d3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug675BeansInDesignTimeAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug675BeansInDesignTimeAWT.java
@@ -97,7 +97,7 @@ public class TestBug675BeansInDesignTimeAWT extends UITestCase {
} );
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816GLCanvasFrameHoppingB849B889AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816GLCanvasFrameHoppingB849B889AWT.java
index 913dad8d0..f169a27a9 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816GLCanvasFrameHoppingB849B889AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816GLCanvasFrameHoppingB849B889AWT.java
@@ -95,17 +95,17 @@ public class TestBug816GLCanvasFrameHoppingB849B889AWT extends UITestCase {
frame2.setSize(640, 480);
frame2.setLocation(800, 64);
- GLProfile profile = GLProfile.get(GLProfile.GL2ES2);
- GLCapabilities glCapabilities = new GLCapabilities(profile);
+ final GLProfile profile = GLProfile.get(GLProfile.GL2ES2);
+ final GLCapabilities glCapabilities = new GLCapabilities(profile);
final GLCanvas glCanvas = new GLCanvas(glCapabilities);
glCanvas.setSize(new java.awt.Dimension(640, 480));
glCanvas.addGLEventListener(new GearsES2(1));
panel1.add(glCanvas, BorderLayout.CENTER);
- JButton bMoveP1toP2 = new JButton("Move to Panel2");
+ final JButton bMoveP1toP2 = new JButton("Move to Panel2");
bMoveP1toP2.addActionListener(new ActionListener() {
@Override
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ public void actionPerformed(final java.awt.event.ActionEvent evt) {
System.err.println("XXXX Move P1 -> P2 - START");
dumpGLCanvasStats(glCanvas);
panel2.add(glCanvas, BorderLayout.CENTER);
@@ -123,10 +123,10 @@ public class TestBug816GLCanvasFrameHoppingB849B889AWT extends UITestCase {
});
panel1.add(bMoveP1toP2, BorderLayout.NORTH);
- JButton bMoveP2toP1 = new JButton("Move to Panel1");
+ final JButton bMoveP2toP1 = new JButton("Move to Panel1");
bMoveP2toP1.addActionListener(new ActionListener() {
@Override
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
System.err.println("XXXX Move P2 -> P1 - START");
dumpGLCanvasStats(glCanvas);
panel1.add(glCanvas, BorderLayout.CENTER);
@@ -241,14 +241,14 @@ public class TestBug816GLCanvasFrameHoppingB849B889AWT extends UITestCase {
} });
}
- private static String id(Object obj) { return "0x"+Integer.toHexString(obj.hashCode()); }
+ private static String id(final Object obj) { return "0x"+Integer.toHexString(obj.hashCode()); }
- static void dumpGLCanvasStats(GLCanvas glCanvas) {
+ static void dumpGLCanvasStats(final GLCanvas glCanvas) {
System.err.println("XXXX GLCanvas: comp "+glCanvas+", visible "+glCanvas.isVisible()+", showing "+glCanvas.isShowing()+
", displayable "+glCanvas.isDisplayable()+", "+glCanvas.getSurfaceWidth()+"x"+glCanvas.getSurfaceHeight());
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java
index 091dc5378..efb7119e4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java
@@ -78,8 +78,8 @@ public class TestBug816JTabbedPanelVisibilityB849B878AWT extends UITestCase {
panel1.setLayout(new BorderLayout());
panel2.setLayout(new BorderLayout());
- GLProfile profile = GLProfile.get(GLProfile.GL2ES2);
- GLCapabilities glCapabilities = new GLCapabilities(profile);
+ final GLProfile profile = GLProfile.get(GLProfile.GL2ES2);
+ final GLCapabilities glCapabilities = new GLCapabilities(profile);
final GLCanvas glCanvas = new GLCanvas(glCapabilities);
glCanvas.setSize(new java.awt.Dimension(640, 480));
glCanvas.addGLEventListener(new GearsES2(1));
@@ -93,7 +93,7 @@ public class TestBug816JTabbedPanelVisibilityB849B878AWT extends UITestCase {
tabbedPanel.addChangeListener(new javax.swing.event.ChangeListener() {
@Override
- public void stateChanged(javax.swing.event.ChangeEvent evt) {
+ public void stateChanged(final javax.swing.event.ChangeEvent evt) {
if (tabbedPanel.getSelectedIndex() == 0) {
System.err.println("XXXX Add GLCanvas Panel2("+id(panel2)+" -> Panel1("+id(panel1)+") START");
dumpGLCanvasStats(glCanvas);
@@ -174,14 +174,14 @@ public class TestBug816JTabbedPanelVisibilityB849B878AWT extends UITestCase {
} });
}
- private static String id(Object obj) { return "0x"+Integer.toHexString(obj.hashCode()); }
+ private static String id(final Object obj) { return "0x"+Integer.toHexString(obj.hashCode()); }
- static void dumpGLCanvasStats(GLCanvas glCanvas) {
+ static void dumpGLCanvasStats(final GLCanvas glCanvas) {
System.err.println("XXXX GLCanvas: comp "+glCanvas+", visible "+glCanvas.isVisible()+", showing "+glCanvas.isShowing()+
", displayable "+glCanvas.isDisplayable()+", "+glCanvas.getSurfaceWidth()+"x"+glCanvas.getSurfaceHeight());
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos01AWT.java
index 28e00dfe2..83cde8f2a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos01AWT.java
@@ -101,7 +101,7 @@ public class TestBug816OSXCALayerPos01AWT extends UITestCase {
frame.pack();
}
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -115,13 +115,13 @@ public class TestBug816OSXCALayerPos01AWT extends UITestCase {
frame.validate();
}
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
}
- protected void runTestGL(GLCapabilities caps, FrameLayout frameLayout, final boolean twoCanvas, final boolean resizeByComp) throws InterruptedException, InvocationTargetException {
+ protected void runTestGL(final GLCapabilities caps, final FrameLayout frameLayout, final boolean twoCanvas, final boolean resizeByComp) throws InterruptedException, InvocationTargetException {
final JFrame frame = new JFrame("Bug816: "+this.getTestMethodName());
Assert.assertNotNull(frame);
final Container framePane = frame.getContentPane();
@@ -191,33 +191,33 @@ public class TestBug816OSXCALayerPos01AWT extends UITestCase {
}
break;
case Split: {
- Dimension sbDim = new Dimension(16, 16);
- JScrollPane vsp = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+ final Dimension sbDim = new Dimension(16, 16);
+ final JScrollPane vsp = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
{
- JScrollBar vsb = vsp.getVerticalScrollBar();
+ final JScrollBar vsb = vsp.getVerticalScrollBar();
vsb.setPreferredSize(sbDim);
- BoundedRangeModel model = vsb.getModel();
+ final BoundedRangeModel model = vsb.getModel();
model.setMinimum(0);
model.setMaximum(100);
model.setValue(50);
model.setExtent(1);
vsb.setEnabled(true);
}
- JScrollPane hsp = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+ final JScrollPane hsp = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
{
- JScrollBar hsb = hsp.getHorizontalScrollBar();
+ final JScrollBar hsb = hsp.getHorizontalScrollBar();
hsb.setPreferredSize(sbDim);
- BoundedRangeModel model = hsb.getModel();
+ final BoundedRangeModel model = hsb.getModel();
model.setMinimum(0);
model.setMaximum(100);
model.setValue(50);
model.setExtent(1);
hsb.setEnabled(true);
}
- JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true,
+ final JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true,
twoCanvas ? glCanvas2 : vsp, glCanvas1 );
horizontalSplitPane.setResizeWeight(0.5);
- JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
+ final JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
true, horizontalSplitPane, hsp);
verticalSplitPane.setResizeWeight(0.5);
framePane.add(verticalSplitPane);
@@ -445,7 +445,7 @@ public class TestBug816OSXCALayerPos01AWT extends UITestCase {
static int testNum = -1;
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos02AWT.java
index 5f1b43a61..fa9ea7198 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos02AWT.java
@@ -86,13 +86,13 @@ public class TestBug816OSXCALayerPos02AWT extends UITestCase {
// Build a GUI where the canvas 3D is located at top right of the frame
// and can be resized with split panes dividers
- JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
+ final JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
true, new JScrollPane(), glCanvas1);
verticalSplitPane.setResizeWeight(0.5);
- JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
+ final JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
true, new JScrollPane(), verticalSplitPane);
horizontalSplitPane.setResizeWeight(0.5);
- JRootPane intermediateRootPane = new JRootPane();
+ final JRootPane intermediateRootPane = new JRootPane();
intermediateRootPane.setContentPane(horizontalSplitPane);
frame.add(intermediateRootPane);
@@ -139,7 +139,7 @@ public class TestBug816OSXCALayerPos02AWT extends UITestCase {
return GLProfile.getMaxProgrammableCore(true);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java
index f37cdf332..74d18ce9b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java
@@ -94,7 +94,7 @@ public class TestBug816OSXCALayerPos03aB729AWT extends UITestCase {
// Create a check box that hides / shows canvas
final Checkbox checkbox = new Checkbox("Visible canvas", true);
checkbox.addItemListener(new ItemListener() {
- public void itemStateChanged(ItemEvent ev) {
+ public void itemStateChanged(final ItemEvent ev) {
final boolean visible = checkbox.getState();
System.err.println("XXXX Canvas setVisible "+visible);
glCanvas1.setVisible(visible);
@@ -153,7 +153,7 @@ public class TestBug816OSXCALayerPos03aB729AWT extends UITestCase {
return GLProfile.getMaxProgrammableCore(true);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java
index acdd40764..9a9a7fce7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java
@@ -100,7 +100,7 @@ public class TestBug816OSXCALayerPos03bB849AWT extends UITestCase {
// Create a check box that hides / shows canvas
final Checkbox checkbox = new Checkbox("Visible canvas", true);
checkbox.addItemListener(new ItemListener() {
- public void itemStateChanged(ItemEvent ev) {
+ public void itemStateChanged(final ItemEvent ev) {
final boolean visible = checkbox.getState();
System.err.println("XXXX Panel setVisible "+visible);
panel.setVisible(visible);
@@ -159,7 +159,7 @@ public class TestBug816OSXCALayerPos03bB849AWT extends UITestCase {
return GLProfile.getMaxProgrammableCore(true);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java
index 52480b89b..afdf6fbcb 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java
@@ -102,7 +102,7 @@ public class TestBug816OSXCALayerPos03cB849AWT extends UITestCase {
// Create a check box that hides / shows canvas
final JCheckBox checkbox = new JCheckBox("Visible canvas", true);
checkbox.addItemListener(new ItemListener() {
- public void itemStateChanged(ItemEvent ev) {
+ public void itemStateChanged(final ItemEvent ev) {
final boolean visible = checkbox.getSelectedObjects()!=null;
System.err.println("XXXX Panel setVisible "+visible);
panel.setVisible(visible);
@@ -161,7 +161,7 @@ public class TestBug816OSXCALayerPos03cB849AWT extends UITestCase {
return GLProfile.getMaxProgrammableCore(true);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04aAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04aAWT.java
index 246c5cdb5..78fcbfed3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04aAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04aAWT.java
@@ -139,7 +139,7 @@ public class TestBug816OSXCALayerPos04aAWT extends UITestCase {
return GLProfile.getMaxProgrammableCore(true);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04bAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04bAWT.java
index 186191b19..8f1917e3a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04bAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04bAWT.java
@@ -139,7 +139,7 @@ public class TestBug816OSXCALayerPos04bAWT extends UITestCase {
return GLProfile.getMaxProgrammableCore(true);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock00AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock00AWT.java
index 46230465f..edb489a4a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock00AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock00AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.awt;
import javax.media.opengl.GLAutoDrawable;
@@ -59,100 +59,100 @@ public class TestGLCanvasAWTActionDeadlock00AWT extends UITestCase {
GLEventListener gle1 = null;
GLEventListener gle2 = null;
-
+
@Test
public void test01Animator() throws InterruptedException {
testImpl(new Animator(), 0, false);
}
-
+
@Test
public void test02FPSAnimator() throws InterruptedException {
testImpl(new FPSAnimator(30), 0, false);
}
-
+
@Test
public void test02FPSAnimator_RestartOnAWTEDT() throws InterruptedException {
testImpl(new FPSAnimator(30), 100, false);
}
-
+
/** May crash due to invalid thread usage, i.e. non AWT-EDT
@Test
public void test02FPSAnimator_RestartOnCurrentThread() throws InterruptedException {
testImpl(new FPSAnimator(30), 100, true);
} */
-
- void testImpl(final AnimatorBase animator, int restartPeriod, boolean restartOnCurrentThread) throws InterruptedException {
+
+ void testImpl(final AnimatorBase animator, final int restartPeriod, final boolean restartOnCurrentThread) throws InterruptedException {
final Frame frame1 = new Frame("Frame 1");
gle1 = new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
frame1.setTitle("f "+frameCount+", fps "+animator.getLastFPS());
frameCount++;
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
- }
- };
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ }
+ };
gle2 = new GearsES2();
Assert.assertNotNull(frame1);
{
- Insets insets = frame1.getInsets();
- int w = width + insets.left + insets.right;
- int h = height + insets.top + insets.bottom;
+ final Insets insets = frame1.getInsets();
+ final int w = width + insets.left + insets.right;
+ final int h = height + insets.top + insets.bottom;
frame1.setSize(w, h);
}
frame1.setLocation(0, 0);
frame1.setTitle("Generic Title");
-
+
GLCanvas glCanvas = createGLCanvas();
glCanvas.addGLEventListener(gle1);
glCanvas.addGLEventListener(gle2);
-
+
animator.setUpdateFPSFrames(60, System.err);
animator.add(glCanvas);
animator.start();
attachGLCanvas(frame1, glCanvas, false);
-
+
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame1.setVisible(true);
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
-
+
final long sleep = 0 < restartPeriod ? restartPeriod : 100;
long togo = durationPerTest;
while( 0 < togo ) {
if(0 < restartPeriod) {
glCanvas = restart(frame1, glCanvas, restartOnCurrentThread);
}
-
+
Thread.sleep(sleep);
-
+
togo -= sleep;
}
-
+
dispose(frame1, glCanvas);
animator.stop();
-
- gle1 = null;
+
+ gle1 = null;
gle2 = null;
}
-
+
void dispose(final Frame frame, final GLCanvas glCanvas) {
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -160,32 +160,32 @@ public class TestGLCanvasAWTActionDeadlock00AWT extends UITestCase {
glCanvas.destroy();
frame.dispose();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
}
-
- GLCanvas restart(final Frame frame, GLCanvas glCanvas, boolean restartOnCurrentThread) throws InterruptedException {
+
+ GLCanvas restart(final Frame frame, GLCanvas glCanvas, final boolean restartOnCurrentThread) throws InterruptedException {
glCanvas.disposeGLEventListener(gle1, true);
glCanvas.disposeGLEventListener(gle2, true);
detachGLCanvas(frame, glCanvas, restartOnCurrentThread);
-
+
glCanvas = createGLCanvas();
-
+
attachGLCanvas(frame, glCanvas, restartOnCurrentThread);
glCanvas.addGLEventListener(gle1);
glCanvas.addGLEventListener(gle2);
-
+
return glCanvas;
}
-
- void attachGLCanvas(final Frame frame, final GLCanvas glCanvas, boolean restartOnCurrentThread) {
+
+ void attachGLCanvas(final Frame frame, final GLCanvas glCanvas, final boolean restartOnCurrentThread) {
System.err.println("*** attachGLCanvas.0 on-current-thread "+restartOnCurrentThread+", currentThread "+Thread.currentThread().getName());
if( restartOnCurrentThread ) {
frame.setLayout(new BorderLayout());
frame.add(glCanvas, BorderLayout.CENTER);
- frame.validate();
+ frame.validate();
} else {
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -194,19 +194,19 @@ public class TestGLCanvasAWTActionDeadlock00AWT extends UITestCase {
frame.add(glCanvas, BorderLayout.CENTER);
frame.validate();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
}
System.err.println("*** attachGLCanvas.X");
}
-
- void detachGLCanvas(final Frame frame, final GLCanvas glCanvas, boolean restartOnCurrentThread) {
+
+ void detachGLCanvas(final Frame frame, final GLCanvas glCanvas, final boolean restartOnCurrentThread) {
System.err.println("*** detachGLCanvas.0 on-current-thread "+restartOnCurrentThread+", currentThread "+Thread.currentThread().getName());
if( restartOnCurrentThread ) {
frame.remove(glCanvas);
- frame.validate();
+ frame.validate();
} else {
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -214,26 +214,26 @@ public class TestGLCanvasAWTActionDeadlock00AWT extends UITestCase {
frame.remove(glCanvas);
frame.validate();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
}
System.err.println("*** detachGLCanvas.X");
}
-
+
int frameCount = 0;
-
+
GLCanvas createGLCanvas() {
System.err.println("*** createGLCanvas.0");
final GLCanvas glCanvas = new GLCanvas();
glCanvas.setBounds(0, 0, width, height);
Assert.assertNotNull(glCanvas);
System.err.println("*** createGLCanvas.X");
- return glCanvas;
+ return glCanvas;
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java
index ba06f91a3..5b605ff33 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.awt;
import javax.media.opengl.GLAutoDrawable;
@@ -61,9 +61,9 @@ import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
/**
- * BUG on OSX/CALayer w/ Java6:
+ * BUG on OSX/CALayer w/ Java6:
* If frame.setTitle() is issued right after initialization the call hangs in
- * <pre>
+ * <pre>
* at apple.awt.CWindow._setTitle(Native Method)
* at apple.awt.CWindow.setTitle(CWindow.java:765) [1.6.0_37, build 1.6.0_37-b06-434-11M3909]
* </pre>
@@ -75,7 +75,7 @@ import org.junit.runners.MethodSorters;
* e.g. setResizable*().
* </p>
* <p>
- * Users shall make sure all mutable AWT calls are performed on the EDT, even before 1st setVisible(true) !
+ * Users shall make sure all mutable AWT calls are performed on the EDT, even before 1st setVisible(true) !
* </p>
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@@ -86,30 +86,30 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
GLEventListener gle1 = null;
GLEventListener gle2 = null;
-
+
@Test
public void test00NoAnimator() throws InterruptedException, InvocationTargetException {
testImpl(null, 0, false);
}
-
+
@Test
public void test01Animator() throws InterruptedException, InvocationTargetException {
testImpl(new Animator(), 0, false);
}
-
+
@Test
public void test02FPSAnimator() throws InterruptedException, InvocationTargetException {
testImpl(new FPSAnimator(30), 0, false);
}
-
+
@Test
public void test02FPSAnimator_RestartOnAWTEDT() throws InterruptedException, InvocationTargetException {
testImpl(new FPSAnimator(30), 200, false);
}
-
+
/** May crash due to invalid thread usage, i.e. non AWT-EDT
- * @throws InvocationTargetException
- * @throws InterruptedException
+ * @throws InvocationTargetException
+ * @throws InterruptedException
@Test
public void test02FPSAnimator_RestartOnCurrentThread() throws InterruptedException {
testImpl(new FPSAnimator(30), 200, true);
@@ -125,50 +125,50 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
frame.setTitle(msg);
} } );
}
-
- void testImpl(final AnimatorBase animator, int restartPeriod, boolean restartOnCurrentThread) throws InterruptedException, InvocationTargetException {
+
+ void testImpl(final AnimatorBase animator, final int restartPeriod, final boolean restartOnCurrentThread) throws InterruptedException, InvocationTargetException {
final Frame frame1 = new Frame("Frame 1");
final Applet applet1 = new Applet() {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
};
-
+
final VersionNumber version170 = new VersionNumber(1, 7, 0);
- final boolean osxCALayerAWTModBug = Platform.OSType.MACOS == Platform.getOSType() &&
+ final boolean osxCALayerAWTModBug = Platform.OSType.MACOS == Platform.getOSType() &&
0 > Platform.getJavaVersionNumber().compareTo(version170);
System.err.println("OSX CALayer AWT-Mod Bug "+osxCALayerAWTModBug);
System.err.println("OSType "+Platform.getOSType());
System.err.println("Java Version "+Platform.getJavaVersionNumber());
-
+
Assert.assertNotNull(frame1);
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame1.setLayout(null);
frame1.pack();
{
- Insets insets = frame1.getInsets();
- int w = width + insets.left + insets.right;
- int h = height + insets.top + insets.bottom;
+ final Insets insets = frame1.getInsets();
+ final int w = width + insets.left + insets.right;
+ final int h = height + insets.top + insets.bottom;
frame1.setSize(w, h);
-
- int usableH = h - insets.top - insets.bottom;
- applet1.setBounds((w - width)/2, insets.top + (usableH - height)/2, width, height);
+
+ final int usableH = h - insets.top - insets.bottom;
+ applet1.setBounds((w - width)/2, insets.top + (usableH - height)/2, width, height);
}
frame1.setLocation(0, 0);
frame1.setTitle("Generic Title");
frame1.add(applet1);
}});
-
+
frame1.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
dispose(frame1, applet1);
}
- });
-
+ });
+
gle1 = new GLEventListener() {
boolean justInitialized = true;
-
+
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
justInitialized = true;
if( !osxCALayerAWTModBug ) {
System.err.println("*Init*: CT "+Thread.currentThread().getName());
@@ -178,13 +178,13 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
System.err.println("*Dispose*: CT "+Thread.currentThread().getName());
setFrameTitle(frame1, "DISPOSE");
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
if( !osxCALayerAWTModBug || !justInitialized ) {
System.err.println("*Display*: CT "+Thread.currentThread().getName());
setFrameTitle(frame1, "f "+frameCount+", fps "+( null != animator ? animator.getLastFPS() : 0));
@@ -195,19 +195,19 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
if( !osxCALayerAWTModBug || !justInitialized ) {
System.err.println("*Reshape*: CT "+Thread.currentThread().getName());
setFrameTitle(frame1, "RESHAPE");
}
- }
- };
+ }
+ };
gle2 = new GearsES2();
GLCanvas glCanvas = createGLCanvas();
glCanvas.addGLEventListener(gle1);
glCanvas.addGLEventListener(gle2);
-
+
if(null != animator) {
System.err.println("About to start Animator: CT "+Thread.currentThread().getName());
animator.setUpdateFPSFrames(60, System.err);
@@ -216,7 +216,7 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
}
attachGLCanvas(applet1, glCanvas, false);
-
+
System.err.println("About to setVisible.0 CT "+Thread.currentThread().getName());
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -225,12 +225,12 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
frame1.setVisible(true);
System.err.println("About to setVisible.1.X CT "+Thread.currentThread().getName());
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
System.err.println("About to setVisible.X CT "+Thread.currentThread().getName());
-
+
final long sleep = 0 < restartPeriod ? restartPeriod : 100;
long togo = durationPerTest;
while( 0 < togo ) {
@@ -240,23 +240,23 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
if(0 < restartPeriod) {
glCanvas = restart(applet1, glCanvas, restartOnCurrentThread);
}
-
+
Thread.sleep(sleep);
-
+
togo -= sleep;
}
-
+
dispose(frame1, applet1);
if(null != animator) {
animator.stop();
}
-
- gle1 = null;
+
+ gle1 = null;
gle2 = null;
}
-
+
int frameCount = 0;
-
+
GLCanvas createGLCanvas() {
System.err.println("*** createGLCanvas.0");
final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
@@ -268,7 +268,7 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
Assert.assertNotNull(glCanvas);
System.err.println("*** createGLCanvas.X");
frameCount = 0;
- return glCanvas;
+ return glCanvas;
}
void dispose(final Frame frame, final Applet applet) {
@@ -278,27 +278,27 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
frame.remove(applet);
frame.dispose();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
}
-
- GLCanvas restart(final Applet applet, GLCanvas glCanvas, boolean restartOnCurrentThread) throws InterruptedException {
+
+ GLCanvas restart(final Applet applet, GLCanvas glCanvas, final boolean restartOnCurrentThread) throws InterruptedException {
glCanvas.disposeGLEventListener(gle1, true);
glCanvas.disposeGLEventListener(gle2, true);
detachGLCanvas(applet, glCanvas, restartOnCurrentThread);
-
+
glCanvas = createGLCanvas();
-
+
attachGLCanvas(applet, glCanvas, restartOnCurrentThread);
glCanvas.addGLEventListener(gle1);
glCanvas.addGLEventListener(gle2);
-
+
return glCanvas;
}
-
- void attachGLCanvas(final Applet applet, final GLCanvas glCanvas, boolean restartOnCurrentThread) {
+
+ void attachGLCanvas(final Applet applet, final GLCanvas glCanvas, final boolean restartOnCurrentThread) {
System.err.println("*** attachGLCanvas.0 on-current-thread "+restartOnCurrentThread+", currentThread "+Thread.currentThread().getName());
if( restartOnCurrentThread ) {
applet.setLayout(new BorderLayout());
@@ -312,15 +312,15 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
applet.add(glCanvas, BorderLayout.CENTER);
applet.validate();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
}
System.err.println("*** attachGLCanvas.X");
}
-
- void detachGLCanvas(final Applet applet, final GLCanvas glCanvas, boolean restartOnCurrentThread) {
+
+ void detachGLCanvas(final Applet applet, final GLCanvas glCanvas, final boolean restartOnCurrentThread) {
System.err.println("*** detachGLCanvas.0 on-current-thread "+restartOnCurrentThread+", currentThread "+Thread.currentThread().getName());
if( restartOnCurrentThread ) {
applet.remove(glCanvas);
@@ -329,18 +329,18 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- applet.remove(glCanvas);
+ applet.remove(glCanvas);
applet.validate();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
}
System.err.println("*** detachGLCanvas.X");
}
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java
index 605f97fe3..89b2880c2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java
@@ -202,14 +202,14 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
height = 300;
final MiniPApplet applet = this;
- GraphicsEnvironment environment =
+ final GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
+ final GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
frame = new Frame(displayDevice.getDefaultConfiguration());
final Rectangle fullScreenRect;
if (fullScreen) {
- DisplayMode mode = displayDevice.getDisplayMode();
+ final DisplayMode mode = displayDevice.getDisplayMode();
fullScreenRect = new Rectangle(0, 0, mode.getWidth(), mode.getHeight());
} else {
fullScreenRect = null;
@@ -228,7 +228,7 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
frame.setBounds(fullScreenRect);
frame.setVisible(true);
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
@@ -251,21 +251,21 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
(fullScreenRect.height - applet.height) / 2,
applet.width, applet.height);
} else {
- Insets insets = frame.getInsets();
+ final Insets insets = frame.getInsets();
- int windowW = applet.width + insets.left + insets.right;
- int windowH = applet.height + insets.top + insets.bottom;
- int locationX = 100;
- int locationY = 100;
+ final int windowW = applet.width + insets.left + insets.right;
+ final int windowH = applet.height + insets.top + insets.bottom;
+ final int locationX = 100;
+ final int locationY = 100;
frame.setSize(windowW, windowH);
frame.setLocation(locationX, locationY);
- int usableWindowH = windowH - insets.top - insets.bottom;
+ final int usableWindowH = windowH - insets.top - insets.bottom;
applet.setBounds((windowW - width)/2, insets.top + (usableWindowH - height)/2, width, height);
}
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
@@ -273,10 +273,10 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
frame.add(this);
frame.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
try {
dispose();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
Assume.assumeNoException(ex);
}
}
@@ -388,7 +388,7 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
}
}
- void draw(GL2 gl) {
+ void draw(final GL2 gl) {
if( !osxCALayerAWTModBug || !justInitialized ) {
AWTEDTExecutor.singleton.invoke(true, new Runnable() {
public void run() {
@@ -408,8 +408,8 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
System.out.println(OPENGL_VERSION);
System.out.println(OPENGL_EXTENSIONS);
- int[] temp = { 0 };
- gl.glGetIntegerv(GL2.GL_MAX_SAMPLES, temp, 0);
+ final int[] temp = { 0 };
+ gl.glGetIntegerv(GL2ES3.GL_MAX_SAMPLES, temp, 0);
System.out.println("Maximum number of samples supported by the hardware: " + temp[0]);
System.out.println("Frame: "+frame);
System.out.println("Applet: "+MiniPApplet.this);
@@ -418,7 +418,7 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
}
if (currentSamples == -1) {
- int[] temp = { 0 };
+ final int[] temp = { 0 };
gl.glGetIntegerv(GL.GL_SAMPLES, temp, 0);
currentSamples = temp[0];
if (numSamples != currentSamples) {
@@ -439,7 +439,7 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
}
if (restarted) {
- int[] temp = { 0 };
+ final int[] temp = { 0 };
gl.glGetIntegerv(GL.GL_SAMPLES, temp, 0);
if (numSamples != temp[0]) {
System.err.println("Multisampling level requested " + numSamples + " not supported. Using " + temp[0] + "samples instead.");
@@ -465,7 +465,7 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
gl.glFlush();
fcount += 1;
- int m = (int) (System.currentTimeMillis() - millisOffset);
+ final int m = (int) (System.currentTimeMillis() - millisOffset);
if (m - lastm > 1000 * fint) {
frate = (float)(fcount) / fint;
fcount = 0;
@@ -475,14 +475,14 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
}
void clock() {
- long afterTime = System.nanoTime();
- long timeDiff = afterTime - beforeTime;
- long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;
+ final long afterTime = System.nanoTime();
+ final long timeDiff = afterTime - beforeTime;
+ final long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;
if (sleepTime > 0) { // some time left in this cycle
try {
Thread.sleep(sleepTime / 1000000L, (int) (sleepTime % 1000000L));
- } catch (InterruptedException ex) { }
+ } catch (final InterruptedException ex) { }
overSleepTime = (System.nanoTime() - afterTime) - sleepTime;
@@ -495,48 +495,48 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
class SimpleListener implements GLEventListener {
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
draw(drawable.getGL().getGL2());
justInitialized = false;
}
@Override
- public void dispose(GLAutoDrawable drawable) { }
+ public void dispose(final GLAutoDrawable drawable) { }
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
justInitialized = true;
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int w, final int h) { }
}
- public void mouseDragged(MouseEvent ev) {
+ public void mouseDragged(final MouseEvent ev) {
if (printEventInfo) {
System.err.println("Mouse dragged event: " + ev);
}
}
- public void mouseMoved(MouseEvent ev) {
+ public void mouseMoved(final MouseEvent ev) {
if (printEventInfo) {
System.err.println("Mouse moved event: " + ev);
}
}
- public void keyPressed(KeyEvent ev) {
+ public void keyPressed(final KeyEvent ev) {
if (printEventInfo) {
System.err.println("Key pressed event: " + ev);
}
}
- public void keyReleased(KeyEvent ev) {
+ public void keyReleased(final KeyEvent ev) {
if (printEventInfo) {
System.err.println("Key released event: " + ev);
}
}
- public void keyTyped(KeyEvent ev) {
+ public void keyTyped(final KeyEvent ev) {
if (printEventInfo) {
System.err.println("Key typed event: " + ev);
}
@@ -550,13 +550,13 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
private TimerTask task = null;
private volatile boolean shouldRun;
- protected String getBaseName(String prefix) {
+ protected String getBaseName(final String prefix) {
return "Custom" + prefix + "Animator" ;
}
/** Creates an CustomAnimator with an initial drawable to
* animate. */
- public CustomAnimator(GLAutoDrawable drawable) {
+ public CustomAnimator(final GLAutoDrawable drawable) {
if (drawable != null) {
add(drawable);
}
@@ -630,7 +630,7 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
animThread = null;
try {
Thread.sleep(20); // ~ 1/60 hz wait, since we can't ctrl stopped threads
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
return true;
}
@@ -644,21 +644,21 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
public void test00() {
TestGLCanvasAWTActionDeadlock02AWT.MiniPApplet mini;
try {
- Class<?> c = Thread.currentThread().getContextClassLoader().loadClass(TestGLCanvasAWTActionDeadlock02AWT.MiniPApplet.class.getName());
+ final Class<?> c = Thread.currentThread().getContextClassLoader().loadClass(TestGLCanvasAWTActionDeadlock02AWT.MiniPApplet.class.getName());
mini = (TestGLCanvasAWTActionDeadlock02AWT.MiniPApplet) c.newInstance();
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException(e);
}
if (mini != null) {
try {
mini.run();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
Assume.assumeNoException(ex);
}
}
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-frames")) {
framesPerTest = MiscUtils.atoi(args[++i], framesPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelResize01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelResize01AWT.java
index 2133d62a2..cc2c9ef57 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelResize01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelResize01AWT.java
@@ -133,13 +133,13 @@ public class TestGLJPanelResize01AWT extends UITestCase {
// frame[0].pack();
frame[0].setVisible(true);
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
try {
Thread.sleep(duration);
- } catch (InterruptedException e1) {
+ } catch (final InterruptedException e1) {
e1.printStackTrace();
}
try {
@@ -147,7 +147,7 @@ public class TestGLJPanelResize01AWT extends UITestCase {
public void run() {
frame[0].dispose();
} } );
- } catch (Exception e1) {
+ } catch (final Exception e1) {
e1.printStackTrace();
}
}
@@ -184,7 +184,7 @@ public class TestGLJPanelResize01AWT extends UITestCase {
static long duration = 600; // ms
- public static void main(String[] args) {
+ public static void main(final String[] args) {
boolean useSwingDoubleBuffer=false, manual=false;
for(int i=0; i<args.length; i++) {
@@ -199,7 +199,7 @@ public class TestGLJPanelResize01AWT extends UITestCase {
}
if( manual ) {
GLProfile.initSingleton();
- TestGLJPanelResize01AWT demo = new TestGLJPanelResize01AWT();
+ final TestGLJPanelResize01AWT demo = new TestGLJPanelResize01AWT();
demo.test(new GLCapabilities(null), esize01, useSwingDoubleBuffer);
} else {
org.junit.runner.JUnitCore.main(TestGLJPanelResize01AWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelTextureStateAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelTextureStateAWT.java
index 5a5747a59..8cf4b6899 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelTextureStateAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelTextureStateAWT.java
@@ -81,7 +81,7 @@ public class TestGLJPanelTextureStateAWT extends UITestCase {
frame.validate();
}
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -135,7 +135,7 @@ public class TestGLJPanelTextureStateAWT extends UITestCase {
int tX, tY, tW, tH;
int shot = 0;
- void setupTex(GL gl) {
+ void setupTex(final GL gl) {
// Note: FBObject uses diff defaults, i.e.: GL_NEAREST and GL_CLAMP_TO_EDGE
if( keepTextureBound ) {
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
@@ -146,9 +146,9 @@ public class TestGLJPanelTextureStateAWT extends UITestCase {
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
// Initialize w/ arbitrary values !
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glActiveTexture(GL.GL_TEXTURE0 + 1);
gl.glBindTexture(GL.GL_TEXTURE_2D, 0);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
@@ -168,13 +168,13 @@ public class TestGLJPanelTextureStateAWT extends UITestCase {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
gle0.dispose(drawable);
gle1.dispose(drawable);
}
@Override
- public void display(GLAutoDrawable drawable) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
@@ -218,7 +218,7 @@ public class TestGLJPanelTextureStateAWT extends UITestCase {
}
final int border = 5;
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
gle0X = x + border;
gle0Y = y;
gle0W = width/2 - 2*border;
@@ -237,7 +237,7 @@ public class TestGLJPanelTextureStateAWT extends UITestCase {
tH = height;
// System.err.println("Total "+tX+"/"+tY+" "+tW+"x"+tH);
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glViewport(gle0X, gle0Y, gle0W, gle0H);
gle0.reshape(drawable, 0, 0, gle0W, gle0H); // don't 'skip' about gle0X/gle0Y
@@ -259,7 +259,7 @@ public class TestGLJPanelTextureStateAWT extends UITestCase {
frame.pack();
frame.setVisible(true);
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -283,7 +283,7 @@ public class TestGLJPanelTextureStateAWT extends UITestCase {
frame.remove(glc);
frame.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -303,7 +303,7 @@ public class TestGLJPanelTextureStateAWT extends UITestCase {
testImpl(true /* keepTextureBound */, 1 /* texUnit */);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestIsRealizedConcurrency01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestIsRealizedConcurrency01AWT.java
index 3f8b76a17..d75ff6659 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestIsRealizedConcurrency01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestIsRealizedConcurrency01AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.awt;
import javax.media.opengl.awt.GLCanvas;
@@ -49,22 +49,22 @@ import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestIsRealizedConcurrency01AWT extends UITestCase {
static long durationPerTest = 500; // ms
-
+
@Test
public void testAddRemove() throws InterruptedException, InvocationTargetException {
final Dimension f_sz = new Dimension(512, 512);
-
+
final GLCanvas glCanvas = new GLCanvas();
Assert.assertNotNull(glCanvas);
glCanvas.addGLEventListener(new GearsES2());
final Animator animator = new Animator(glCanvas);
animator.start();
-
+
final Frame frame = new Frame("Frame");
- Assert.assertNotNull(frame);
+ Assert.assertNotNull(frame);
frame.add(glCanvas);
-
+
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setLocation(0, 0);
@@ -83,17 +83,17 @@ public class TestIsRealizedConcurrency01AWT extends UITestCase {
frame.validate();
}});
Thread.sleep(durationPerTest/2);
-
+
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
glCanvas.destroy();
frame.dispose();
}});
-
+
animator.stop();
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java
index 28fb79cea..ec9cece53 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java
@@ -32,7 +32,7 @@ import com.jogamp.opengl.util.Animator;
/**
* Documenting Bug 586
- *
+ *
* <p>
* JScrollPane cannot mix hw/lw components, only if setting property '-Dsun.awt.disableMixing=true'.
* </p>
@@ -45,65 +45,65 @@ import com.jogamp.opengl.util.Animator;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestJScrollPaneMixHwLw01AWT extends UITestCase {
static long durationPerTest = 500;
-
+
static {
// too late: use at cmd-line '-Dsun.awt.disableMixing=true' works
// System.setProperty("sun.awt.disableMixing", "true");
}
/**
- * Doesn't work either ..
+ * Doesn't work either ..
*/
@SuppressWarnings("serial")
public static class TransparentJScrollPane extends JScrollPane {
- public TransparentJScrollPane(Component view) {
+ public TransparentJScrollPane(final Component view) {
super(view);
-
+
setOpaque(false);
-
+
try {
ReflectionUtil.callStaticMethod(
- "com.sun.awt.AWTUtilities", "setComponentMixingCutoutShape",
- new Class<?>[] { Component.class, Shape.class },
- new Object[] { this, new Rectangle() } ,
+ "com.sun.awt.AWTUtilities", "setComponentMixingCutoutShape",
+ new Class<?>[] { Component.class, Shape.class },
+ new Object[] { this, new Rectangle() } ,
GraphicsConfiguration.class.getClassLoader());
System.err.println("com.sun.awt.AWTUtilities.setComponentMixingCutoutShape(..) passed");
- } catch (RuntimeException re) {
+ } catch (final RuntimeException re) {
System.err.println("com.sun.awt.AWTUtilities.setComponentMixingCutoutShape(..) failed: "+re.getMessage());
}
}
-
+
@Override
- public void setOpaque(boolean isOpaque) {
+ public void setOpaque(final boolean isOpaque) {
}
}
-
- protected void runTestGL(GLCapabilities caps, boolean useJScroll) throws InterruptedException {
+
+ protected void runTestGL(final GLCapabilities caps, final boolean useJScroll) throws InterruptedException {
final String typeS = useJScroll ? "LW" : "HW";
final JFrame frame = new JFrame("Mix Hw/Lw Swing - ScrollPane "+typeS);
Assert.assertNotNull(frame);
-
+
final Dimension f_sz = new Dimension(600,400);
final Dimension glc_sz = new Dimension(500,600);
-
+
final GLCanvas glCanvas = new GLCanvas(caps);
- Assert.assertNotNull(glCanvas);
+ Assert.assertNotNull(glCanvas);
glCanvas.addGLEventListener(new GearsES2());
glCanvas.setPreferredSize(glc_sz);
-
- JPanel panel = new JPanel(new BorderLayout());
+
+ final JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(false);
if(useJScroll) {
- final JScrollPane scrollPane = new TransparentJScrollPane(glCanvas);
+ final JScrollPane scrollPane = new TransparentJScrollPane(glCanvas);
panel.add(scrollPane, BorderLayout.CENTER);
} else {
- ScrollPane scrollPane = new ScrollPane();
+ final ScrollPane scrollPane = new ScrollPane();
scrollPane.add(glCanvas);
panel.add(scrollPane, BorderLayout.CENTER);
}
-
- JTextArea textArea = new JTextArea();
+
+ final JTextArea textArea = new JTextArea();
textArea.setText("Test\nTest\nTest\nTest\n");
panel.add(textArea, BorderLayout.NORTH);
@@ -119,25 +119,25 @@ public class TestJScrollPaneMixHwLw01AWT extends UITestCase {
frame.setSize(f_sz);
frame.setVisible(true);
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
- Animator animator = new Animator(glCanvas);
+ final Animator animator = new Animator(glCanvas);
animator.start();
Thread.sleep(durationPerTest);
animator.stop();
-
+
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setVisible(false);
frame.dispose();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
@@ -145,19 +145,19 @@ public class TestJScrollPaneMixHwLw01AWT extends UITestCase {
// @Test doesn't work
public void test01JScrollPane() throws InterruptedException {
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, true);
}
@Test
public void test01ScrollPane() throws InterruptedException {
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, false);
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
@@ -166,11 +166,11 @@ public class TestJScrollPaneMixHwLw01AWT extends UITestCase {
/**
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
- System.err.println(stdin.readLine());
+ System.err.println(stdin.readLine());
*/
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestJScrollPaneMixHwLw01AWT.class.getName();
+ final String tstname = TestJScrollPaneMixHwLw01AWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
-
+
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java
index ccdaf6edc..d24101270 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.awt;
import java.lang.reflect.InvocationTargetException;
@@ -83,7 +83,7 @@ public class TestSwingAWT01GLn extends UITestCase {
// final array as mutable container hack
final GLCanvas[] glCanvas = new GLCanvas[1];
- Runnable test = new Runnable() {
+ final Runnable test = new Runnable() {
public void run() {
glCanvas[0] = new GLCanvas(caps);
glCanvas[0].addGLEventListener(new GearsES2());
@@ -100,13 +100,13 @@ public class TestSwingAWT01GLn extends UITestCase {
}
};
- Runnable cleanup = new Runnable() {
+ final Runnable cleanup = new Runnable() {
public void run() {
System.out.println("cleaning up...");
window.setVisible(false);
try {
window.removeAll();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
assumeNoException(t);
t.printStackTrace();
}
@@ -118,7 +118,7 @@ public class TestSwingAWT01GLn extends UITestCase {
// AWT / Swing on EDT..
invokeAndWait(test);
- Animator animator = new Animator(glCanvas[0]);
+ final Animator animator = new Animator(glCanvas[0]);
animator.start();
Thread.sleep(1000);
animator.stop();
@@ -130,10 +130,10 @@ public class TestSwingAWT01GLn extends UITestCase {
@Test
public void test01GLDefault() throws InterruptedException, InvocationTargetException {
- GLProfile glp = GLProfile.getDefault();
+ final GLProfile glp = GLProfile.getDefault();
System.out.println("GLProfile Default: "+glp);
if(glp.isGL2ES2()) {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps);
} else {
System.out.println("not a GL2ES2 profile");
@@ -143,16 +143,16 @@ public class TestSwingAWT01GLn extends UITestCase {
@Test
public void test02GL2() throws InterruptedException, InvocationTargetException {
if(GLProfile.isAvailable(GLProfile.GL2)) {
- GLProfile glprofile = GLProfile.get(GLProfile.GL2);
+ final GLProfile glprofile = GLProfile.get(GLProfile.GL2);
System.out.println( "GLProfile GL2: " + glprofile );
- GLCapabilities caps = new GLCapabilities(glprofile);
+ final GLCapabilities caps = new GLCapabilities(glprofile);
runTestGL(caps);
} else {
System.out.println("GL2 n/a");
}
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestSwingAWT01GLn.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java
index 066e5fe0d..4b1da1e2e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.awt.text;
import javax.media.opengl.GLProfile;
@@ -49,15 +49,15 @@ import org.junit.runners.MethodSorters;
/*
* Unit tests for Bug464
- * Some ATI-Drivers crash the JVM if VBO-related glFunctions are called. This test checks
+ * Some ATI-Drivers crash the JVM if VBO-related glFunctions are called. This test checks
* if TextRenderer calls any of these functions while it's useVertexArray variable is set
* to false.
- * 2D- and 3D-TextRendering is tested by creating a GLCanvas showing a simple line of text
+ * 2D- and 3D-TextRendering is tested by creating a GLCanvas showing a simple line of text
* while filtering all glFunction calls by using a modified version of TraceGL2.
* VBO-related function are logged to the disallowedMethodCalls String of the GLEventListener
- * instead of being executed (to prevent JVM crashes). Therefore, if the
+ * instead of being executed (to prevent JVM crashes). Therefore, if the
* disallowedMethodCalls isn't an empty String after the test, the test fails.
- *
+ *
* Other classes related to this test:
* TestTextRendererGLEventListener01
* TestTextRendererTraceGL2Mock01
@@ -67,7 +67,7 @@ import org.junit.runners.MethodSorters;
public class TestAWTTextRendererUseVertexArrayBug464 extends UITestCase {
static GLProfile glp;
static GLCapabilities caps;
-
+
private GLCanvas glCanvas;
private Frame frame;
@@ -92,7 +92,7 @@ public class TestAWTTextRendererUseVertexArrayBug464 extends UITestCase {
frame.setSize(512, 512);
frame.setVisible(true);
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -107,10 +107,10 @@ public class TestAWTTextRendererUseVertexArrayBug464 extends UITestCase {
frame.remove(glCanvas);
frame.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
- }
+ }
glCanvas=null;
frame=null;
}
@@ -118,45 +118,45 @@ public class TestAWTTextRendererUseVertexArrayBug464 extends UITestCase {
@Test
public void testTextRendererDraw2D() throws InterruptedException {
- TextRendererGLEventListener01 listener = new TextRendererGLEventListener01(1);
+ final TextRendererGLEventListener01 listener = new TextRendererGLEventListener01(1);
Assert.assertNotNull(listener);
glCanvas.addGLEventListener(listener);
- Animator animator = new Animator(glCanvas);
+ final Animator animator = new Animator(glCanvas);
animator.start();
-
+
Thread.sleep(500); // 500 ms
-
+
animator.stop();
-
- String disallowedMethods = listener.getDisallowedMethodCalls();
+
+ final String disallowedMethods = listener.getDisallowedMethodCalls();
if (!disallowedMethods.equals("")) {
Assert.fail("Following VBO-related glMethods have been called: "+ disallowedMethods);
}
}
-
+
@Test
public void testTextRendererDraw3D() throws InterruptedException {
- TextRendererGLEventListener01 listener = new TextRendererGLEventListener01(2);
+ final TextRendererGLEventListener01 listener = new TextRendererGLEventListener01(2);
Assert.assertNotNull(listener);
glCanvas.addGLEventListener(listener);
- Animator animator = new Animator(glCanvas);
+ final Animator animator = new Animator(glCanvas);
animator.start();
-
+
Thread.sleep(500); // 500 ms
-
+
animator.stop();
-
- String disallowedMethods = listener.getDisallowedMethodCalls();
+
+ final String disallowedMethods = listener.getDisallowedMethodCalls();
if (!disallowedMethods.equals("")) {
Assert.fail("Following VBO-related glMethods have been called: "+ disallowedMethods);
}
}
- public static void main(String args[]) throws IOException {
- String tstname = TestAWTTextRendererUseVertexArrayBug464.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestAWTTextRendererUseVertexArrayBug464.class.getName();
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
"filtertrace=true",
@@ -168,5 +168,5 @@ public class TestAWTTextRendererUseVertexArrayBug464 extends UITestCase {
"logtestlistenerevents=true",
"formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
"formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java
index 3a9f643dc..44089ff67 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.awt.text;
import java.awt.Font;
@@ -33,10 +33,12 @@ import java.io.OutputStream;
import java.io.PrintStream;
import com.jogamp.opengl.util.awt.TextRenderer;
+
import javax.media.opengl.GL2ES1;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import javax.media.opengl.glu.GLU;
import org.junit.Assert;
@@ -45,55 +47,55 @@ import org.junit.Assert;
* Unit tests for Bug464
* GLEventListener for unit test TestAWTTextRendererUseVertexArrayBug464. The display
* method renders the String "ABC123#+?" to the lower left corner of the canvas.
- *
+ *
* The testNumber variable is used to switch between 2D- and 3D-textrendering in the display
* method.
* The disallowedMethodCalls variable is used to log VBO-related glFunction calls during
* the execution of the test.
- *
+ *
* Other classes related to this test:
* TestAWTTextRendererUseVertexArrayBug464
* TextRendererTraceGL2Mock01
*/
public class TextRendererGLEventListener01 implements GLEventListener {
- private GLU glu = new GLU();
+ private final GLU glu = new GLU();
private TextRenderer renderer;
private String text;
private String disallowedMethodCalls;
- private int testNumber;
-
- public TextRendererGLEventListener01(int testNumber) {
+ private final int testNumber;
+
+ public TextRendererGLEventListener01(final int testNumber) {
this.disallowedMethodCalls = "";
this.testNumber = testNumber;
}
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
renderer = new TextRenderer(new Font("SansSerif", Font.BOLD, 36));
renderer.setUseVertexArrays(false);
Assert.assertNotNull(renderer);
Assert.assertFalse(renderer.getUseVertexArrays());
-
+
text = "ABC123#+?";
-
- PrintStream nullStream = new PrintStream(new OutputStream(){ public void write(int b){}});
+
+ final PrintStream nullStream = new PrintStream(new OutputStream(){ public void write(final int b){}});
drawable.setGL(new TextRendererTraceGL2Mock01(drawable.getGL().getGL2(), nullStream, this));
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
- GL2 gl = drawable.getGL().getGL2();
- gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ final GL2 gl = drawable.getGL().getGL2();
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
glu.gluOrtho2D(0, 1, 0, 1);
- gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
renderer.dispose();
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
if (disallowedMethodCalls.equals("")) {
if (testNumber == 1) {
renderer.beginRendering(drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
@@ -109,14 +111,14 @@ public class TextRendererGLEventListener01 implements GLEventListener {
}
}
}
-
- public void disallowedMethodCalled (String method) {
+
+ public void disallowedMethodCalled (final String method) {
if (!disallowedMethodCalls.equals("")) {
disallowedMethodCalls += ", ";
}
disallowedMethodCalls += method;
}
-
+
public String getDisallowedMethodCalls() {
return this.disallowedMethodCalls;
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererTraceGL2Mock01.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererTraceGL2Mock01.java
index 86714fcc5..3adcf9823 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererTraceGL2Mock01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererTraceGL2Mock01.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -40,8 +40,8 @@ import com.jogamp.common.nio.Buffers;
/*
* Unit tests for Bug464
- * Modified Version of TraceGL2 for unit test TestAWTTextRendererUseVertexArrayBug464.
- * This class overrides all glFunctions related to VBO's according to
+ * Modified Version of TraceGL2 for unit test TestAWTTextRendererUseVertexArrayBug464.
+ * This class overrides all glFunctions related to VBO's according to
* http://code.google.com/p/glextensions/wiki/GL_ARB_vertex_buffer_object:
* glBindBuffer (glBindBufferARB)
* glDeleteBuffers (glDeleteBuffersARB)
@@ -56,81 +56,81 @@ import com.jogamp.common.nio.Buffers;
* glGetBufferPointerv (glGetBufferPointervARB)
* Calls to the overridden methods are logged to the disallowedMethodCalls variable of
* the GLEventListener instead of being passed to the downstreamGL object.
- *
+ *
* Other classes related to this test:
* TestAWTTextRendererUseVertexArrayBug464
* TextRendererGLEventListener01
*/
public class TextRendererTraceGL2Mock01 extends TraceGL2 {
-
+
TextRendererGLEventListener01 listener;
- public TextRendererTraceGL2Mock01(GL2 downstreamGL2, PrintStream stream, TextRendererGLEventListener01 listener) {
+ public TextRendererTraceGL2Mock01(final GL2 downstreamGL2, final PrintStream stream, final TextRendererGLEventListener01 listener) {
super(downstreamGL2, stream);
this.listener = listener;
- }
+ }
@Override
- public void glGetBufferSubData(int arg0, long arg1, long arg2, Buffer arg3) {
+ public void glGetBufferSubData(final int arg0, final long arg1, final long arg2, final Buffer arg3) {
listener.disallowedMethodCalled("glGetBufferSubData");
}
@Override
- public ByteBuffer glMapBuffer(int arg0, int arg1) {
+ public ByteBuffer glMapBuffer(final int arg0, final int arg1) {
listener.disallowedMethodCalled("glMapBuffer");
return Buffers.newDirectByteBuffer(0);
}
@Override
- public void glGetBufferParameteriv(int arg0, int arg1, IntBuffer arg2) {
+ public void glGetBufferParameteriv(final int arg0, final int arg1, final IntBuffer arg2) {
listener.disallowedMethodCalled("glGetBufferParameteriv");
}
@Override
- public boolean glUnmapBuffer(int arg0) {
+ public boolean glUnmapBuffer(final int arg0) {
listener.disallowedMethodCalled("glUnmapBuffer");
return false;
}
-
+
@Override
- public void glGenBuffers(int arg0, IntBuffer arg1) {
+ public void glGenBuffers(final int arg0, final IntBuffer arg1) {
listener.disallowedMethodCalled("glGenBuffers");
}
@Override
- public void glGenBuffers(int arg0, int[] arg1, int arg2) {
+ public void glGenBuffers(final int arg0, final int[] arg1, final int arg2) {
listener.disallowedMethodCalled("glGenBuffers");
}
@Override
- public boolean glIsBuffer(int arg0) {
+ public boolean glIsBuffer(final int arg0) {
listener.disallowedMethodCalled("glIsBuffer");
return false;
}
@Override
- public void glBindBuffer(int arg0, int arg1) {
+ public void glBindBuffer(final int arg0, final int arg1) {
listener.disallowedMethodCalled("glBindBuffer");
}
@Override
- public void glDeleteBuffers(int arg0, int[] arg1, int arg2) {
+ public void glDeleteBuffers(final int arg0, final int[] arg1, final int arg2) {
listener.disallowedMethodCalled("glDeleteBuffers");
}
@Override
- public void glBufferSubData(int arg0, long arg1, long arg2, Buffer arg3) {
+ public void glBufferSubData(final int arg0, final long arg1, final long arg2, final Buffer arg3) {
listener.disallowedMethodCalled("glBufferSubData");
}
@Override
- public void glGetBufferParameteriv(int arg0, int arg1, int[] arg2, int arg3) {
+ public void glGetBufferParameteriv(final int arg0, final int arg1, final int[] arg2, final int arg3) {
listener.disallowedMethodCalled("glGetBufferParameteriv");
}
@Override
- public void glBufferData(int arg0, long arg1, Buffer arg2, int arg3) {
+ public void glBufferData(final int arg0, final long arg1, final Buffer arg2, final int arg3) {
listener.disallowedMethodCalled("glBufferData");
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java
index efdd2e16d..02265ad0b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java
@@ -48,22 +48,22 @@ import javax.media.opengl.GLCapabilitiesImmutable;
class MultisampleChooser01 extends DefaultGLCapabilitiesChooser {
@Override
- public int chooseCapabilities(final CapabilitiesImmutable desired,
- final List<? extends CapabilitiesImmutable> available,
+ public int chooseCapabilities(final CapabilitiesImmutable desired,
+ final List<? extends CapabilitiesImmutable> available,
final int windowSystemRecommendedChoice) {
boolean anyHaveSampleBuffers = false;
for (int i = 0; i < available.size(); i++) {
- GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) available.get(i);
+ final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) available.get(i);
if ( caps.getSampleBuffers() ) {
anyHaveSampleBuffers = true;
break;
}
}
- int selection = super.chooseCapabilities(desired, available, windowSystemRecommendedChoice);
+ final int selection = super.chooseCapabilities(desired, available, windowSystemRecommendedChoice);
if (!anyHaveSampleBuffers) {
System.err.println("WARNING: antialiasing will be disabled because none of the available pixel formats had it to offer");
} else {
- GLCapabilitiesImmutable selected = (GLCapabilitiesImmutable) available.get(selection);
+ final GLCapabilitiesImmutable selected = (GLCapabilitiesImmutable) available.get(selection);
if (!selected.getSampleBuffers()) {
System.err.println("WARNING: antialiasing will be disabled because the DefaultGLCapabilitiesChooser didn't supply it");
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageAWT.java
index 25883f641..a42564dbc 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageAWT.java
@@ -39,6 +39,7 @@ import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLException;
import javax.media.opengl.GLProfile;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.opengl.util.awt.Screenshot;
import com.jogamp.opengl.util.texture.TextureIO;
@@ -55,15 +56,15 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestBug605FlippedImageAWT extends UITestCase {
class FlippedImageTest implements GLEventListener {
- public void display(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT | GL2.GL_ACCUM_BUFFER_BIT );
- gl.glMatrixMode(GL2.GL_PROJECTION);
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
- gl.glMatrixMode(GL2.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
// red below
@@ -88,28 +89,28 @@ public class TestBug605FlippedImageAWT extends UITestCase {
final String fname = getSnapshotFilename(0, null, caps, width, height, false, TextureIO.PNG, null);
try {
Screenshot.writeToFile(new File(fname), width, height, false);
- } catch (GLException e) {
+ } catch (final GLException e) {
throw e;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new GLException(e);
}
testFlipped(width, height);
}
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
final GL gl = drawable.getGL();
System.err.println("GL_RENDERER: "+gl.glGetString(GL.GL_RENDERER));
System.err.println("GL_VERSION: "+gl.glGetString(GL.GL_VERSION));
}
- public void reshape(GLAutoDrawable glDrawable, int x, int y, int w, int h) {}
- public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
- public void dispose(GLAutoDrawable drawable) {}
+ public void reshape(final GLAutoDrawable glDrawable, final int x, final int y, final int w, final int h) {}
+ public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {}
+ public void dispose(final GLAutoDrawable drawable) {}
}
static final int green = 0x0000ff00; // above
static final int red = 0x00ff0000; // below
- private void testFlipped(int width, int height) {
+ private void testFlipped(final int width, final int height) {
// Default origin 0/0 is lower left corner, so is the memory layout
// However AWT origin 0/0 is upper left corner
final BufferedImage image = Screenshot.readToBufferedImage(width, height);
@@ -129,7 +130,7 @@ public class TestBug605FlippedImageAWT extends UITestCase {
}
}
- private void test(GLCapabilitiesImmutable caps) {
+ private void test(final GLCapabilitiesImmutable caps) {
final GLDrawableFactory glFactory = GLDrawableFactory.getFactory(caps.getGLProfile());
final GLAutoDrawable glad = glFactory.createOffscreenAutoDrawable(null, caps, null, 256, 256);
@@ -181,7 +182,7 @@ public class TestBug605FlippedImageAWT extends UITestCase {
test(caps);
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
org.junit.runner.JUnitCore.main(TestBug605FlippedImageAWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageNEWT.java
index ed4e702f4..2d879a6be 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageNEWT.java
@@ -37,6 +37,7 @@ import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import org.junit.Assert;
import org.junit.Test;
@@ -49,15 +50,15 @@ import com.jogamp.opengl.util.GLReadBufferUtil;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestBug605FlippedImageNEWT extends UITestCase {
static class FlippedImageTest implements GLEventListener {
- public void display(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT | GL2.GL_ACCUM_BUFFER_BIT );
- gl.glMatrixMode(GL2.GL_PROJECTION);
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
- gl.glMatrixMode(GL2.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
// red below
@@ -77,26 +78,26 @@ public class TestBug605FlippedImageNEWT extends UITestCase {
gl.glFinish();
}
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
final GL gl = drawable.getGL();
System.err.println("GL_RENDERER: "+gl.glGetString(GL.GL_RENDERER));
System.err.println("GL_VERSION: "+gl.glGetString(GL.GL_VERSION));
}
- public void reshape(GLAutoDrawable glDrawable, int x, int y, int w, int h) {}
- public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
- public void dispose(GLAutoDrawable drawable) {}
+ public void reshape(final GLAutoDrawable glDrawable, final int x, final int y, final int w, final int h) {}
+ public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {}
+ public void dispose(final GLAutoDrawable drawable) {}
}
static final int green = 0x0000ff00; // above
static final int red = 0x00ff0000; // below
- private int getRGB(ByteBuffer bb, int o) {
+ private int getRGB(final ByteBuffer bb, final int o) {
return ( bb.get(o+0) & 0x000000ff ) << 16 |
( bb.get(o+1) & 0x000000ff ) << 8 |
( bb.get(o+2) & 0x000000ff );
}
- private void testFlipped(ByteBuffer bb, int width, int height, int comp) {
+ private void testFlipped(final ByteBuffer bb, final int width, final int height, final int comp) {
// Default origin 0/0 is lower left corner, so is the memory layout
// x=0, y=0: RGB -> _RGB [high-byte .. low-byte]
@@ -116,7 +117,7 @@ public class TestBug605FlippedImageNEWT extends UITestCase {
}
}
- private void test(GLCapabilitiesImmutable caps) {
+ private void test(final GLCapabilitiesImmutable caps) {
final GLReadBufferUtil rbu = new GLReadBufferUtil(false, false);
final GLDrawableFactory glFactory = GLDrawableFactory.getFactory(caps.getGLProfile());
final GLAutoDrawable glad = glFactory.createOffscreenAutoDrawable(null, caps, null, 256, 256);
@@ -172,7 +173,7 @@ public class TestBug605FlippedImageNEWT extends UITestCase {
test(caps);
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
org.junit.runner.JUnitCore.main(TestBug605FlippedImageNEWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java
index ba93dcdcd..7ae9e859a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java
@@ -67,14 +67,14 @@ public class TestMultisampleES1AWT extends UITestCase {
static long durationPerTest = 60; // ms
private GLCanvas canvas;
- public static void main(String[] args) {
+ public static void main(final String[] args) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], 500);
}
}
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestMultisampleES1AWT.class.getName();
+ final String tstname = TestMultisampleES1AWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
@@ -93,11 +93,11 @@ public class TestMultisampleES1AWT extends UITestCase {
testMultiSampleAAImpl(8);
}
- private void testMultiSampleAAImpl(int reqSamples) throws InterruptedException, InvocationTargetException {
+ private void testMultiSampleAAImpl(final int reqSamples) throws InterruptedException, InvocationTargetException {
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
- GLProfile glp = GLProfile.getMaxFixedFunc(true);
- GLCapabilities caps = new GLCapabilities(glp);
- GLCapabilitiesChooser chooser = new MultisampleChooser01();
+ final GLProfile glp = GLProfile.getMaxFixedFunc(true);
+ final GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilitiesChooser chooser = new MultisampleChooser01();
if(reqSamples>0) {
caps.setSampleBuffers(true);
@@ -108,12 +108,12 @@ public class TestMultisampleES1AWT extends UITestCase {
canvas.addGLEventListener(new MultisampleDemoES1(reqSamples>0?true:false));
canvas.addGLEventListener(new GLEventListener() {
int displayCount = 0;
- public void init(GLAutoDrawable drawable) {}
- public void dispose(GLAutoDrawable drawable) {}
- public void display(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {
snapshot(displayCount++, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
final Frame frame = new Frame("Multi Samples "+reqSamples);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1NEWT.java
index cf30c50bd..4996f786d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1NEWT.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -62,14 +62,14 @@ public class TestMultisampleES1NEWT extends UITestCase {
static long durationPerTest = 60; // ms
private GLWindow window;
- public static void main(String[] args) {
+ public static void main(final String[] args) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], 500);
}
}
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestMultisampleES1NEWT.class.getName();
+ final String tstname = TestMultisampleES1NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
@@ -113,16 +113,16 @@ public class TestMultisampleES1NEWT extends UITestCase {
testMultiSampleAAImpl(true, false, 8);
}
- private void testMultiSampleAAImpl(boolean useFBO, boolean usePBuffer, int reqSamples) throws InterruptedException {
+ private void testMultiSampleAAImpl(final boolean useFBO, final boolean usePBuffer, final int reqSamples) throws InterruptedException {
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
- GLProfile glp = GLProfile.getMaxFixedFunc(true);
- GLCapabilities caps = new GLCapabilities(glp);
- GLCapabilitiesChooser chooser = new MultisampleChooser01();
+ final GLProfile glp = GLProfile.getMaxFixedFunc(true);
+ final GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilitiesChooser chooser = new MultisampleChooser01();
caps.setAlphaBits(1);
caps.setFBO(useFBO);
caps.setPBuffer(usePBuffer);
-
+
if(reqSamples>0) {
caps.setSampleBuffers(true);
caps.setNumSamples(reqSamples);
@@ -133,12 +133,12 @@ public class TestMultisampleES1NEWT extends UITestCase {
window.addGLEventListener(new MultisampleDemoES1(reqSamples>0?true:false));
window.addGLEventListener(new GLEventListener() {
int displayCount = 0;
- public void init(GLAutoDrawable drawable) {}
- public void dispose(GLAutoDrawable drawable) {}
- public void display(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {
snapshot(displayCount++, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
window.setSize(512, 512);
window.setVisible(true);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES2NEWT.java
index 008568f68..daac8ad5a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES2NEWT.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -61,14 +61,14 @@ import com.jogamp.opengl.util.texture.TextureIO;
public class TestMultisampleES2NEWT extends UITestCase {
static long durationPerTest = 60; // ms
- public static void main(String[] args) {
+ public static void main(final String[] args) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], 500);
}
}
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestMultisampleES2NEWT.class.getName();
+ final String tstname = TestMultisampleES2NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
@@ -102,16 +102,16 @@ public class TestMultisampleES2NEWT extends UITestCase {
testMultiSampleAAImpl(true, false, 8);
}
- private void testMultiSampleAAImpl(boolean useFBO, boolean usePBuffer, int reqSamples) throws InterruptedException {
+ private void testMultiSampleAAImpl(final boolean useFBO, final boolean usePBuffer, final int reqSamples) throws InterruptedException {
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
- GLCapabilitiesChooser chooser = new MultisampleChooser01();
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilitiesChooser chooser = new MultisampleChooser01();
caps.setAlphaBits(1);
caps.setFBO(useFBO);
caps.setPBuffer(usePBuffer);
-
+
if(reqSamples>0) {
caps.setSampleBuffers(true);
caps.setNumSamples(reqSamples);
@@ -122,12 +122,12 @@ public class TestMultisampleES2NEWT extends UITestCase {
window.addGLEventListener(new MultisampleDemoES2(reqSamples>0?true:false));
window.addGLEventListener(new GLEventListener() {
int displayCount = 0;
- public void init(GLAutoDrawable drawable) {}
- public void dispose(GLAutoDrawable drawable) {}
- public void display(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {
snapshot(displayCount++, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
window.setSize(512, 512);
window.setVisible(true);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java
index 7ba6b0947..521d9c2fe 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.caps;
import java.awt.BorderLayout;
@@ -73,23 +73,23 @@ public class TestTranslucencyAWT extends UITestCase {
static Frame getTranslucentFrame() {
GraphicsConfiguration gc=null;
- GraphicsDevice[] devices= GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
+ final GraphicsDevice[] devices= GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
for (int i = 0; i < devices.length ; i++)
{
- GraphicsConfiguration[] configs = devices[i].getConfigurations();
+ final GraphicsConfiguration[] configs = devices[i].getConfigurations();
for (int j = 0; j < configs.length ; j++) {
- GraphicsConfiguration config = configs[j];
- ColorModel tcm = config.getColorModel(Transparency.TRANSLUCENT);
- boolean capable1 = ( null != tcm ) ? tcm.getTransparency() == Transparency.TRANSLUCENT : false;
+ final GraphicsConfiguration config = configs[j];
+ final ColorModel tcm = config.getColorModel(Transparency.TRANSLUCENT);
+ final boolean capable1 = ( null != tcm ) ? tcm.getTransparency() == Transparency.TRANSLUCENT : false;
boolean capable2 = false;
try {
capable2 = ((Boolean)ReflectionUtil.callStaticMethod(
- "com.sun.awt.AWTUtilities", "isTranslucencyCapable",
- new Class<?>[] { GraphicsConfiguration.class },
- new Object[] { config } ,
+ "com.sun.awt.AWTUtilities", "isTranslucencyCapable",
+ new Class<?>[] { GraphicsConfiguration.class },
+ new Object[] { config } ,
GraphicsConfiguration.class.getClassLoader())).booleanValue();
System.err.println("com.sun.awt.AWTUtilities.isTranslucencyCapable(config) passed: "+capable2);
- } catch (RuntimeException re) {
+ } catch (final RuntimeException re) {
System.err.println("com.sun.awt.AWTUtilities.isTranslucencyCapable(config) failed: "+re.getMessage());
}
System.err.println(i+":"+j+" "+config+", "+tcm+", capable "+capable1+"/"+capable2);
@@ -108,18 +108,18 @@ public class TestTranslucencyAWT extends UITestCase {
frame.setTitle("AWT Parent Frame (opaque: "+(null==gc)+")");
return frame;
}
-
+
@Test
public void test() throws InterruptedException, InvocationTargetException {
final Frame frame1 = getTranslucentFrame();
final GLCanvas glCanvas= new GLCanvas(glCaps);
-
+
glCanvas.setPreferredSize(size);
- GLEventListener demo1 = new GearsES2(1);
+ final GLEventListener demo1 = new GearsES2(1);
// setDemoFields(demo1, glCanvas, false);
glCanvas.addGLEventListener(demo1);
- GLAnimatorControl animator1 = new Animator(glCanvas);
+ final GLAnimatorControl animator1 = new Animator(glCanvas);
animator1.start();
final Container cont1 = new Container();
@@ -155,21 +155,21 @@ public class TestTranslucencyAWT extends UITestCase {
frame1.dispose();
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
- String tstname = TestTranslucencyAWT.class.getName();
+ final String tstname = TestTranslucencyAWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyNEWT.java
index 8d65fdef3..8f23b57a0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.caps;
import com.jogamp.newt.event.KeyAdapter;
@@ -60,7 +60,7 @@ public class TestTranslucencyNEWT extends UITestCase {
glp = GLProfile.get(GLProfile.getDefaultEGLDevice(), GLProfile.GLES2);
} else */ {
// default device, somehow ES2 compatible
- glp = GLProfile.getGL2ES2();
+ glp = GLProfile.getGL2ES2();
}
Assert.assertNotNull(glp);
width = 512;
@@ -71,15 +71,15 @@ public class TestTranslucencyNEWT extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps, boolean undecorated) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+ protected void runTestGL(final GLCapabilities caps, final boolean undecorated) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle("Gears NEWT Test (translucent "+!caps.isBackgroundOpaque()+")");
glWindow.setUndecorated(undecorated);
glWindow.addGLEventListener(new GearsES2());
- Animator animator = new Animator(glWindow);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final Animator animator = new Animator(glWindow);
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -88,10 +88,10 @@ public class TestTranslucencyNEWT extends UITestCase {
final GLWindow f_glWindow = glWindow;
glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
- }
+ }
if(e.getKeyChar()=='f') {
new Thread() {
public void run() {
@@ -121,38 +121,38 @@ public class TestTranslucencyNEWT extends UITestCase {
@Test
public void test01OpaqueDecorated() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBackgroundOpaque(true); // default
runTestGL(caps, false);
}
@Test
public void test01TransparentDecorated() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBackgroundOpaque(false);
// This is done implicit now ..
- // caps.setAlphaBits(1);
+ // caps.setAlphaBits(1);
runTestGL(caps, false);
}
@Test
public void test01TransparentUndecorated() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBackgroundOpaque(false);
// This is done implicit now ..
- // caps.setAlphaBits(1);
+ // caps.setAlphaBits(1);
runTestGL(caps, true);
}
-
+
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestTranslucencyNEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java
index 00d360f6e..01cc4b7f2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java
@@ -51,18 +51,18 @@ public abstract class GearsObject {
public abstract void addInterleavedVertexAndNormalArrays(GLArrayDataServer array, int components);
public abstract void draw(GL gl, float x, float y, float angle);
- private GLArrayDataServer createInterleavedClone(GLArrayDataServer ads) {
+ private GLArrayDataServer createInterleavedClone(final GLArrayDataServer ads) {
final GLArrayDataServer n = new GLArrayDataServer(ads);
n.setInterleavedOffset(0);
return n;
}
- private void init(GL gl, GLArrayDataServer array) {
+ private void init(final GL gl, final GLArrayDataServer array) {
array.enableBuffer(gl, true);
array.enableBuffer(gl, false);
}
- public void destroy(GL gl) {
+ public void destroy(final GL gl) {
if(!isShared) {
// could be already destroyed by shared configuration
if(null != frontFace) {
@@ -93,7 +93,7 @@ public abstract class GearsObject {
isShared = false;
}
- public GearsObject ( GearsObject shared ) {
+ public GearsObject ( final GearsObject shared ) {
isShared = true;
validateBuffers = shared.validateBuffers;
frontFace = createInterleavedClone(shared.frontFace);
@@ -112,21 +112,21 @@ public abstract class GearsObject {
}
public GearsObject (
- GL gl,
- boolean useMappedBuffers,
- FloatBuffer gearColor,
- float inner_radius,
- float outer_radius,
- float width, int teeth, float tooth_depth, boolean validateBuffers)
+ final GL gl,
+ final boolean useMappedBuffers,
+ final FloatBuffer gearColor,
+ final float inner_radius,
+ final float outer_radius,
+ final float width, final int teeth, final float tooth_depth, final boolean validateBuffers)
{
final float dz = width * 0.5f;
int i;
float r0, r1, r2;
float angle, da;
float u, v, len;
- float s[] = new float[5];
- float c[] = new float[5];
- float normal[] = new float[3];
+ final float s[] = new float[5];
+ final float c[] = new float[5];
+ final float normal[] = new float[3];
// final int tris_per_tooth = 32;
this.validateBuffers = validateBuffers;
@@ -320,7 +320,7 @@ public abstract class GearsObject {
return "GearsObj[0x"+Integer.toHexString(hashCode())+", vbo ff "+ffVBO+", fs "+fsVBO+", bf "+bfVBO+", bs "+bsVBO+"]";
}
- static void vert(GLArrayDataServer array, float x, float y, float z, float n[]) {
+ static void vert(final GLArrayDataServer array, final float x, final float y, final float z, final float n[]) {
array.putf(x);
array.putf(y);
array.putf(z);
@@ -329,7 +329,7 @@ public abstract class GearsObject {
array.putf(n[2]);
}
- static void sincos(float x, float sin[], int sinIdx, float cos[], int cosIdx) {
+ static void sincos(final float x, final float sin[], final int sinIdx, final float cos[], final int cosIdx) {
sin[sinIdx] = (float) Math.sin(x);
cos[cosIdx] = (float) Math.cos(x);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/PointsDemo.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/PointsDemo.java
index 4f2e4153e..f394ab31e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/PointsDemo.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/PointsDemo.java
@@ -32,17 +32,17 @@ import javax.media.opengl.GLEventListener;
public abstract class PointsDemo implements GLEventListener {
int swapInterval = 0;
final int edge = 8; // 8*8
-
- public PointsDemo(int swapInterval) {
+
+ public PointsDemo(final int swapInterval) {
this.swapInterval = swapInterval;
}
public PointsDemo() {
this.swapInterval = 1;
}
-
+
public abstract void setSmoothPoints(boolean v);
-
- public abstract void setPointParams(float minSize, float maxSize, float distAttenConst, float distAttenLinear, float distAttenQuadratic, float fadeThreshold);
-
+
+ public abstract void setPointParams(float minSize, float maxSize, float distAttenConst, float distAttenLinear, float distAttenQuadratic, float fadeThreshold);
+
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureDraw01Accessor.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureDraw01Accessor.java
index 7283a204e..a508751c4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureDraw01Accessor.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureDraw01Accessor.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,17 +20,17 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.demos;
import com.jogamp.opengl.util.texture.Texture;
public interface TextureDraw01Accessor {
- public void setKeepTextureBound(boolean v);
+ public void setKeepTextureBound(boolean v);
public Texture getTexture();
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java
index b750c54dd..b1df926dc 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java
@@ -31,6 +31,8 @@ import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLPipelineFactory;
import javax.media.opengl.GLProfile;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.newt.Window;
import com.jogamp.newt.event.KeyAdapter;
@@ -73,7 +75,7 @@ public class GearsES1 implements GLEventListener {
private int prevMouseX, prevMouseY;
- public GearsES1(int swapInterval) {
+ public GearsES1(final int swapInterval) {
this.swapInterval = swapInterval;
}
@@ -81,20 +83,20 @@ public class GearsES1 implements GLEventListener {
this.swapInterval = 1;
}
- public void setForceFFPEmu(boolean forceFFPEmu, boolean verboseFFPEmu, boolean debugFFPEmu, boolean traceFFPEmu) {
+ public void setForceFFPEmu(final boolean forceFFPEmu, final boolean verboseFFPEmu, final boolean debugFFPEmu, final boolean traceFFPEmu) {
this.forceFFPEmu = forceFFPEmu;
this.verboseFFPEmu = verboseFFPEmu;
this.debugFFPEmu = debugFFPEmu;
this.traceFFPEmu = traceFFPEmu;
}
- public void setGearsColors(FloatBuffer gear1Color, FloatBuffer gear2Color, FloatBuffer gear3Color) {
+ public void setGearsColors(final FloatBuffer gear1Color, final FloatBuffer gear2Color, final FloatBuffer gear3Color) {
this.gear1Color = gear1Color;
this.gear2Color = gear2Color;
this.gear3Color = gear3Color;
}
- public void setSharedGearsObjects(GearsObject g1, GearsObject g2, GearsObject g3) {
+ public void setSharedGearsObjects(final GearsObject g1, final GearsObject g2, final GearsObject g3) {
gear1 = g1;
gear2 = g2;
gear3 = g3;
@@ -117,10 +119,10 @@ public class GearsES1 implements GLEventListener {
public boolean usesSharedGears() { return usesSharedGears; }
- public void setUseMappedBuffers(boolean v) { useMappedBuffers = v; }
- public void setValidateBuffers(boolean v) { validateBuffers = v; }
+ public void setUseMappedBuffers(final boolean v) { useMappedBuffers = v; }
+ public void setValidateBuffers(final boolean v) { validateBuffers = v; }
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
System.err.println(Thread.currentThread()+" GearsES1.init ...");
// Use debug pipeline
@@ -144,13 +146,13 @@ public class GearsES1 implements GLEventListener {
try {
// Debug ..
gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", GL2ES1.class, gl, null) );
- } catch (Exception e) {e.printStackTrace();}
+ } catch (final Exception e) {e.printStackTrace();}
}
if(trace) {
try {
// Trace ..
gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES1.class, gl, new Object[] { System.err } ) );
- } catch (Exception e) {e.printStackTrace();}
+ } catch (final Exception e) {e.printStackTrace();}
}
System.err.println("GearsES1 init on "+Thread.currentThread());
@@ -158,11 +160,11 @@ public class GearsES1 implements GLEventListener {
System.err.println("INIT GL IS: " + gl.getClass().getName());
System.err.println(JoglVersion.getGLStrings(gl, null, false).toString());
- gl.glLightfv(GL2ES1.GL_LIGHT0, GL2ES1.GL_POSITION, pos, 0);
+ gl.glLightfv(GLLightingFunc.GL_LIGHT0, GLLightingFunc.GL_POSITION, pos, 0);
gl.glEnable(GL.GL_CULL_FACE);
- gl.glEnable(GL2ES1.GL_LIGHTING);
- gl.glEnable(GL2ES1.GL_LIGHT0);
- gl.glEnable(GL2ES1.GL_DEPTH_TEST);
+ gl.glEnable(GLLightingFunc.GL_LIGHTING);
+ gl.glEnable(GLLightingFunc.GL_LIGHT0);
+ gl.glEnable(GL.GL_DEPTH_TEST);
/* make the gears */
if(null == gear1) {
@@ -189,7 +191,7 @@ public class GearsES1 implements GLEventListener {
System.err.println("gear3 reused: "+gear3);
}
- gl.glEnable(GL2ES1.GL_NORMALIZE);
+ gl.glEnable(GLLightingFunc.GL_NORMALIZE);
final Object upstreamWidget = drawable.getUpstreamWidget();
if (upstreamWidget instanceof Window) {
@@ -204,29 +206,29 @@ public class GearsES1 implements GLEventListener {
System.err.println(Thread.currentThread()+" GearsES1.init FIN");
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
System.err.println(Thread.currentThread()+" GearsES1.reshape "+x+"/"+y+" "+width+"x"+height+", swapInterval "+swapInterval);
- GL2ES1 gl = drawable.getGL().getGL2ES1();
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
gl.setSwapInterval(swapInterval);
- gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
if(height>width) {
- float h = (float)height / (float)width;
+ final float h = (float)height / (float)width;
gl.glFrustumf(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
} else {
- float h = (float)width / (float)height;
+ final float h = (float)width / (float)height;
gl.glFrustumf(-h, h, -1.0f, 1.0f, 5.0f, 60.0f);
}
- gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
gl.glTranslatef(0.0f, 0.0f, -40.0f);
System.err.println(Thread.currentThread()+" GearsES1.reshape FIN");
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
System.err.println(Thread.currentThread()+" GearsES1.dispose ... ");
final Object upstreamWidget = drawable.getUpstreamWidget();
if (upstreamWidget instanceof Window) {
@@ -234,7 +236,7 @@ public class GearsES1 implements GLEventListener {
window.removeMouseListener(gearsMouse);
window.removeKeyListener(gearsKeys);
}
- GL gl = drawable.getGL();
+ final GL gl = drawable.getGL();
gear1.destroy(gl);
gear1 = null;
gear2.destroy(gl);
@@ -244,12 +246,12 @@ public class GearsES1 implements GLEventListener {
System.err.println(Thread.currentThread()+" GearsES1.dispose FIN");
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
// Turn the gears' teeth
angle += 2.0f;
// Get the GL corresponding to the drawable we are animating
- GL2ES1 gl = drawable.getGL().getGL2ES1();
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
final boolean hasFocus;
final Object upstreamWidget = drawable.getUpstreamWidget();
@@ -295,8 +297,8 @@ public class GearsES1 implements GLEventListener {
class GearsKeyAdapter extends KeyAdapter {
- public void keyPressed(KeyEvent e) {
- int kc = e.getKeyCode();
+ public void keyPressed(final KeyEvent e) {
+ final int kc = e.getKeyCode();
if(KeyEvent.VK_LEFT == kc) {
view_roty -= 1;
} else if(KeyEvent.VK_RIGHT == kc) {
@@ -310,36 +312,36 @@ public class GearsES1 implements GLEventListener {
}
class GearsMouseAdapter extends MouseAdapter {
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
prevMouseX = e.getX();
prevMouseY = e.getY();
}
- public void mouseReleased(MouseEvent e) {
+ public void mouseReleased(final MouseEvent e) {
}
- public void mouseDragged(MouseEvent e) {
- int x = e.getX();
- int y = e.getY();
+ public void mouseDragged(final MouseEvent e) {
+ final int x = e.getX();
+ final int y = e.getY();
int width=0, height=0;
- Object source = e.getSource();
+ final Object source = e.getSource();
if(source instanceof Window) {
- Window window = (Window) source;
+ final Window window = (Window) source;
width=window.getSurfaceWidth();
height=window.getSurfaceHeight();
} else if (source instanceof GLAutoDrawable) {
- GLAutoDrawable glad = (GLAutoDrawable) source;
+ final GLAutoDrawable glad = (GLAutoDrawable) source;
width = glad.getSurfaceWidth();
height = glad.getSurfaceHeight();
} else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) {
- java.awt.Component comp = (java.awt.Component) source;
+ final java.awt.Component comp = (java.awt.Component) source;
width=comp.getWidth(); // FIXME HiDPI: May need to convert window units -> pixel units!
height=comp.getHeight();
} else {
throw new RuntimeException("Event source neither Window nor Component: "+source);
}
- float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width);
- float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height);
+ final float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width);
+ final float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height);
prevMouseX = x;
prevMouseY = y;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java
index 777fb04ae..bd487eae2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java
@@ -26,6 +26,7 @@ import javax.media.opengl.GL;
import javax.media.opengl.GL2ES1;
import javax.media.opengl.GLBufferStorage;
import javax.media.opengl.GLException;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
import javax.media.opengl.fixedfunc.GLPointerFunc;
import com.jogamp.opengl.test.junit.jogl.demos.GearsObject;
@@ -37,13 +38,13 @@ import com.jogamp.opengl.util.GLArrayDataServer;
*/
public class GearsObjectES1 extends GearsObject {
- public GearsObjectES1(GL gl, boolean useMappedBuffers, FloatBuffer gearColor, float inner_radius,
- float outer_radius, float width, int teeth, float tooth_depth, boolean validateBuffers) {
+ public GearsObjectES1(final GL gl, final boolean useMappedBuffers, final FloatBuffer gearColor, final float inner_radius,
+ final float outer_radius, final float width, final int teeth, final float tooth_depth, final boolean validateBuffers) {
super(gl, useMappedBuffers, gearColor, inner_radius, outer_radius, width, teeth, tooth_depth, validateBuffers);
}
@Override
- public GLArrayDataServer createInterleaved(boolean useMappedBuffers, int comps, int dataType, boolean normalized, int initialSize, int vboUsage) {
+ public GLArrayDataServer createInterleaved(final boolean useMappedBuffers, final int comps, final int dataType, final boolean normalized, final int initialSize, final int vboUsage) {
if( useMappedBuffers ) {
return GLArrayDataServer.createFixedInterleavedMapped(comps, dataType, normalized, initialSize, vboUsage);
} else {
@@ -52,12 +53,12 @@ public class GearsObjectES1 extends GearsObject {
}
@Override
- public void addInterleavedVertexAndNormalArrays(GLArrayDataServer array, int components) {
+ public void addInterleavedVertexAndNormalArrays(final GLArrayDataServer array, final int components) {
array.addFixedSubArray(GLPointerFunc.GL_VERTEX_ARRAY, components, GL.GL_ARRAY_BUFFER);
array.addFixedSubArray(GLPointerFunc.GL_NORMAL_ARRAY, components, GL.GL_ARRAY_BUFFER);
}
- private void draw(GL2ES1 gl, GLArrayDataServer array, int mode) {
+ private void draw(final GL2ES1 gl, final GLArrayDataServer array, final int mode) {
if( !isShared || gl.glIsBuffer(array.getVBOName()) ) {
array.enableBuffer(gl, true);
if( validateBuffers ) {
@@ -80,20 +81,20 @@ public class GearsObjectES1 extends GearsObject {
}
@Override
- public void draw(GL _gl, float x, float y, float angle) {
- GL2ES1 gl = _gl.getGL2ES1();
+ public void draw(final GL _gl, final float x, final float y, final float angle) {
+ final GL2ES1 gl = _gl.getGL2ES1();
gl.glPushMatrix();
gl.glTranslatef(x, y, 0f);
gl.glRotatef(angle, 0f, 0f, 1f);
- gl.glMaterialfv(GL2ES1.GL_FRONT_AND_BACK, GL2ES1.GL_AMBIENT_AND_DIFFUSE, gearColor);
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GLLightingFunc.GL_AMBIENT_AND_DIFFUSE, gearColor);
- gl.glShadeModel(GL2ES1.GL_FLAT);
+ gl.glShadeModel(GLLightingFunc.GL_FLAT);
draw(gl, frontFace, GL.GL_TRIANGLE_STRIP);
draw(gl, frontSide, GL.GL_TRIANGLES);
draw(gl, backFace, GL.GL_TRIANGLE_STRIP);
draw(gl, backSide, GL.GL_TRIANGLES);
draw(gl, outwardFace, GL.GL_TRIANGLE_STRIP);
- gl.glShadeModel(GL2ES1.GL_SMOOTH);
+ gl.glShadeModel(GLLightingFunc.GL_SMOOTH);
draw(gl, insideRadiusCyl, GL.GL_TRIANGLE_STRIP);
gl.glPopMatrix();
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/MultisampleDemoES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/MultisampleDemoES1.java
index 4b4c7f2d8..681628a69 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/MultisampleDemoES1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/MultisampleDemoES1.java
@@ -44,6 +44,7 @@ import javax.media.opengl.GL;
import javax.media.opengl.GL2ES1;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.opengl.util.ImmModeSink;
@@ -52,59 +53,59 @@ public class MultisampleDemoES1 implements GLEventListener {
boolean multisample;
ImmModeSink immModeSink;
- public MultisampleDemoES1(boolean multisample) {
+ public MultisampleDemoES1(final boolean multisample) {
this.multisample = multisample;
}
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
System.err.println();
System.err.println("Requested: " + drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities());
System.err.println();
System.err.println("Chosen : " + drawable.getChosenGLCapabilities());
System.err.println();
- GL2ES1 gl = drawable.getGL().getGL2ES1();
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
if (multisample) {
gl.glEnable(GL.GL_MULTISAMPLE);
}
gl.glClearColor(0, 0, 0, 0);
// gl.glEnable(GL.GL_DEPTH_TEST);
// gl.glDepthFunc(GL.GL_LESS);
- gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
- gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(-1, 1, -1, 1, -1, 1);
if (multisample) {
gl.glDisable(GL.GL_MULTISAMPLE);
}
- immModeSink = ImmModeSink.createFixed(40,
+ immModeSink = ImmModeSink.createFixed(40,
3, GL.GL_FLOAT, // vertex
0, GL.GL_FLOAT, // color
0, GL.GL_FLOAT, // normal
- 0, GL.GL_FLOAT, // texCoords
+ 0, GL.GL_FLOAT, // texCoords
GL.GL_STATIC_DRAW);
final int numSteps = 20;
final double increment = Math.PI / numSteps;
final double radius = 1;
immModeSink.glBegin(GL.GL_LINES);
for (int i = numSteps - 1; i >= 0; i--) {
- immModeSink.glVertex3f((float) (radius * Math.cos(i * increment)),
- (float) (radius * Math.sin(i * increment)),
+ immModeSink.glVertex3f((float) (radius * Math.cos(i * increment)),
+ (float) (radius * Math.sin(i * increment)),
0f);
- immModeSink.glVertex3f((float) (-1.0 * radius * Math.cos(i * increment)),
- (float) (-1.0 * radius * Math.sin(i * increment)),
+ immModeSink.glVertex3f((float) (-1.0 * radius * Math.cos(i * increment)),
+ (float) (-1.0 * radius * Math.sin(i * increment)),
0f);
}
immModeSink.glEnd(gl, false);
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
immModeSink.destroy(drawable.getGL());
immModeSink = null;
}
- public void display(GLAutoDrawable drawable) {
- GL2ES1 gl = drawable.getGL().getGL2ES1();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
if (multisample) {
gl.glEnable(GL.GL_MULTISAMPLE);
}
@@ -116,9 +117,9 @@ public class MultisampleDemoES1 implements GLEventListener {
}
// Unused routines
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
- public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
+ public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OlympicES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OlympicES1.java
index 3395ca51f..eae4d41e3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OlympicES1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OlympicES1.java
@@ -10,6 +10,8 @@ import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLPipelineFactory;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.gl2es1.GLUgl2es1;
@@ -78,18 +80,18 @@ public class OlympicES1 implements GLEventListener
swapInterval = 1;
}
- public OlympicES1(int swapInterval) {
+ public OlympicES1(final int swapInterval) {
this.swapInterval = swapInterval;
}
- public void setForceFFPEmu(boolean forceFFPEmu, boolean verboseFFPEmu, boolean debugFFPEmu, boolean traceFFPEmu) {
+ public void setForceFFPEmu(final boolean forceFFPEmu, final boolean verboseFFPEmu, final boolean debugFFPEmu, final boolean traceFFPEmu) {
this.forceFFPEmu = forceFFPEmu;
this.verboseFFPEmu = verboseFFPEmu;
this.debugFFPEmu = debugFFPEmu;
this.traceFFPEmu = traceFFPEmu;
}
- public void init(GLAutoDrawable drawable)
+ public void init(final GLAutoDrawable drawable)
{
GL _gl = drawable.getGL();
@@ -109,13 +111,13 @@ public class OlympicES1 implements GLEventListener
try {
// Debug ..
gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", GL2ES1.class, gl, null) );
- } catch (Exception e) {e.printStackTrace();}
+ } catch (final Exception e) {e.printStackTrace();}
}
if(trace) {
try {
// Trace ..
gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES1.class, gl, new Object[] { System.err } ) );
- } catch (Exception e) {e.printStackTrace();}
+ } catch (final Exception e) {e.printStackTrace();}
}
System.err.println("OlympicES1 init on "+Thread.currentThread());
@@ -129,7 +131,7 @@ public class OlympicES1 implements GLEventListener
System.err.println("GL Profile: "+gl.getGLProfile());
System.err.println("GL:" + gl + ", " + gl.getContext().getGLVersion());
- glu = GLUgl2es1.createGLU(gl);
+ glu = GLU.createGLU(gl);
System.err.println("GLU:" + glu.getClass().getName());
rgb_colors=new byte[RINGS][3];
@@ -141,11 +143,11 @@ public class OlympicES1 implements GLEventListener
iters=new int[RINGS];
int i;
- float top_y = 1.0f;
- float bottom_y = 0.0f;
- float top_z = 0.15f;
- float bottom_z = 0.69f;
- float spacing = 2.5f;
+ final float top_y = 1.0f;
+ final float bottom_y = 0.0f;
+ final float top_z = 0.15f;
+ final float bottom_z = 0.69f;
+ final float spacing = 2.5f;
for (i = 0; i < RINGS; i++) {
rgb_colors[i][0] = rgb_colors[i][1] = rgb_colors[i][2] = (byte)0;
@@ -194,27 +196,27 @@ public class OlympicES1 implements GLEventListener
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glClearDepth(1.0);
- gl.glLightfv(GL2ES1.GL_LIGHT0, GL2ES1.GL_AMBIENT, light0_ambient, 0);
- gl.glLightfv(GL2ES1.GL_LIGHT0, GL2ES1.GL_DIFFUSE, light0_diffuse, 0);
- gl.glLightfv(GL2ES1.GL_LIGHT0, GL2ES1.GL_SPECULAR, light0_specular, 0);
- gl.glLightfv(GL2ES1.GL_LIGHT0, GL2ES1.GL_POSITION, light0_position, 0);
- gl.glEnable(GL2ES1.GL_LIGHT0);
+ gl.glLightfv(GLLightingFunc.GL_LIGHT0, GLLightingFunc.GL_AMBIENT, light0_ambient, 0);
+ gl.glLightfv(GLLightingFunc.GL_LIGHT0, GLLightingFunc.GL_DIFFUSE, light0_diffuse, 0);
+ gl.glLightfv(GLLightingFunc.GL_LIGHT0, GLLightingFunc.GL_SPECULAR, light0_specular, 0);
+ gl.glLightfv(GLLightingFunc.GL_LIGHT0, GLLightingFunc.GL_POSITION, light0_position, 0);
+ gl.glEnable(GLLightingFunc.GL_LIGHT0);
// gl.glLightModelfv(GL2.GL_LIGHT_MODEL_LOCAL_VIEWER, lmodel_local, 0);
gl.glLightModelfv(GL2ES1.GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside, 0);
gl.glLightModelfv(GL2ES1.GL_LIGHT_MODEL_AMBIENT, lmodel_ambient, 0);
- gl.glEnable(GL2ES1.GL_LIGHTING);
+ gl.glEnable(GLLightingFunc.GL_LIGHTING);
gl.glClearColor(0.5f, 0.5f, 0.5f, 0.0f);
- gl.glMaterialfv(GL.GL_FRONT, GL2ES1.GL_AMBIENT, bevel_mat_ambient, 0);
- gl.glMaterialfv(GL.GL_FRONT, GL2ES1.GL_SHININESS, bevel_mat_shininess, 0);
- gl.glMaterialfv(GL.GL_FRONT, GL2ES1.GL_SPECULAR, bevel_mat_specular, 0);
- gl.glMaterialfv(GL.GL_FRONT, GL2ES1.GL_DIFFUSE, bevel_mat_diffuse, 0);
+ gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_AMBIENT, bevel_mat_ambient, 0);
+ gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_SHININESS, bevel_mat_shininess, 0);
+ gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_SPECULAR, bevel_mat_specular, 0);
+ gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_DIFFUSE, bevel_mat_diffuse, 0);
// gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2ES1.GL_DIFFUSE);
- gl.glEnable(GL2ES1.GL_COLOR_MATERIAL);
- gl.glShadeModel(GL2ES1.GL_SMOOTH);
+ gl.glEnable(GLLightingFunc.GL_COLOR_MATERIAL);
+ gl.glShadeModel(GLLightingFunc.GL_SMOOTH);
ReInit();
t0 = System.currentTimeMillis();
@@ -223,7 +225,7 @@ public class OlympicES1 implements GLEventListener
@Override
- public void dispose(GLAutoDrawable glad) {
+ public void dispose(final GLAutoDrawable glad) {
glu = null;
theTorus.destroy(glad.getGL());
theTorus = null;
@@ -231,20 +233,20 @@ public class OlympicES1 implements GLEventListener
@Override
- public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
final GL2ES1 gl = glad.getGL().getGL2ES1();
gl.setSwapInterval(swapInterval);
- gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
glu.gluPerspective(45f, (float) width / (float) height, 0.1f, 100.0f);
- gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
glu.gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);
}
@Override
- public void display(GLAutoDrawable glad) {
+ public void display(final GLAutoDrawable glad) {
final GL2ES1 gl = glad.getGL().getGL2ES1();
int i;
@@ -271,7 +273,7 @@ public class OlympicES1 implements GLEventListener
{
int i, j;
- long t1 = System.currentTimeMillis();
+ final long t1 = System.currentTimeMillis();
if( t1 - tL < 50 ) {
return;
}
@@ -311,7 +313,7 @@ public class OlympicES1 implements GLEventListener
}
}
- protected static void FillTorus(GL gl, ImmModeSink immModeSink, float rc, int numc, float rt, int numt)
+ protected static void FillTorus(final GL gl, final ImmModeSink immModeSink, final float rc, final int numc, final float rt, final int numt)
{
int i, j, k;
double s, t;
@@ -339,7 +341,7 @@ public class OlympicES1 implements GLEventListener
}
}
- protected float Clamp(int iters_left, float t)
+ protected float Clamp(final int iters_left, final float t)
{
if (iters_left < 3) {
return 0.0f;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OneTriangle.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OneTriangle.java
index 4b05f1a42..80f58d74a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OneTriangle.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OneTriangle.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -30,6 +30,7 @@ package com.jogamp.opengl.test.junit.jogl.demos.es1;
import javax.media.opengl.GL;
import javax.media.opengl.GL2ES1;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.gl2es1.GLUgl2es1;
@@ -41,31 +42,31 @@ import com.jogamp.opengl.util.ImmModeSink;
*/
public class OneTriangle {
- public static void setup( GL2ES1 gl, int width, int height ) {
- gl.glMatrixMode( GL2ES1.GL_PROJECTION );
+ public static void setup( final GL2ES1 gl, final int width, final int height ) {
+ gl.glMatrixMode( GLMatrixFunc.GL_PROJECTION );
gl.glLoadIdentity();
// coordinate system origin at lower left with width and height same as the window
- GLU glu = new GLUgl2es1();
+ final GLU glu = new GLUgl2es1();
glu.gluOrtho2D( 0.0f, width, 0.0f, height );
- gl.glMatrixMode( GL2ES1.GL_MODELVIEW );
+ gl.glMatrixMode( GLMatrixFunc.GL_MODELVIEW );
gl.glLoadIdentity();
- gl.glViewport( 0, 0, width, height );
+ gl.glViewport( 0, 0, width, height );
}
- public static void render( GL2ES1 gl, int width, int height) {
+ public static void render( final GL2ES1 gl, final int width, final int height) {
gl.glClear( GL.GL_COLOR_BUFFER_BIT );
// draw a triangle filling the window
gl.glLoadIdentity();
-
- ImmModeSink immModeSink = ImmModeSink.createFixed(3*3,
+
+ final ImmModeSink immModeSink = ImmModeSink.createFixed(3*3,
3, GL.GL_FLOAT, // vertex
3, GL.GL_FLOAT, // color
0, GL.GL_FLOAT, // normal
- 0, GL.GL_FLOAT, // texCoords
+ 0, GL.GL_FLOAT, // texCoords
GL.GL_STATIC_DRAW);
immModeSink.glBegin(GL.GL_TRIANGLES);
immModeSink.glColor3f( 1, 0, 0 );
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/PointsDemoES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/PointsDemoES1.java
index 5f0c99a3d..3aced12ed 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/PointsDemoES1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/PointsDemoES1.java
@@ -41,6 +41,8 @@ import javax.media.opengl.GL2ES1;
import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLPipelineFactory;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+import javax.media.opengl.fixedfunc.GLPointerFunc;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.gl2es1.GLUgl2es1;
@@ -58,24 +60,24 @@ public class PointsDemoES1 extends PointsDemo {
final int edge = 8; // 8*8
boolean smooth = false;
- public PointsDemoES1(int swapInterval) {
+ public PointsDemoES1(final int swapInterval) {
this.swapInterval = swapInterval;
}
public PointsDemoES1() {
this.swapInterval = 1;
}
-
- public void setForceFFPEmu(boolean forceFFPEmu, boolean verboseFFPEmu, boolean debugFFPEmu, boolean traceFFPEmu) {
+
+ public void setForceFFPEmu(final boolean forceFFPEmu, final boolean verboseFFPEmu, final boolean debugFFPEmu, final boolean traceFFPEmu) {
this.forceFFPEmu = forceFFPEmu;
this.verboseFFPEmu = verboseFFPEmu;
this.debugFFPEmu = debugFFPEmu;
this.traceFFPEmu = traceFFPEmu;
}
-
- public void setSmoothPoints(boolean v) { smooth = v; }
-
- public void init(GLAutoDrawable glad) {
+
+ public void setSmoothPoints(final boolean v) { smooth = v; }
+
+ public void init(final GLAutoDrawable glad) {
GL _gl = glad.getGL();
if(debugFFPEmu) {
@@ -89,27 +91,27 @@ public class PointsDemoES1 extends PointsDemo {
trace = false;
}
GL2ES1 gl = FixedFuncUtil.wrapFixedFuncEmul(_gl, ShaderSelectionMode.AUTO, null, forceFFPEmu, verboseFFPEmu);
-
+
if(debug) {
try {
// Debug ..
gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", GL2ES1.class, gl, null) );
- } catch (Exception e) {e.printStackTrace();}
+ } catch (final Exception e) {e.printStackTrace();}
}
if(trace) {
try {
// Trace ..
gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES1.class, gl, new Object[] { System.err } ) );
- } catch (Exception e) {e.printStackTrace();}
- }
-
+ } catch (final Exception e) {e.printStackTrace();}
+ }
+
System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));
System.err.println("GL Profile: "+gl.getGLProfile());
-
+
// Allocate Vertex Array
- vertices = GLArrayDataServer.createFixed(GL2ES1.GL_VERTEX_ARRAY, 3, GL.GL_FLOAT, false, edge*edge, GL.GL_STATIC_DRAW);
+ vertices = GLArrayDataServer.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, 3, GL.GL_FLOAT, false, edge*edge, GL.GL_STATIC_DRAW);
pointSizes = new float[edge*edge];
for(int i=0; i<edge; i++) {
for(int j=0; j<edge; j++) {
@@ -125,10 +127,10 @@ public class PointsDemoES1 extends PointsDemo {
vertices.enableBuffer(gl, false);
// OpenGL Render Settings
- gl.glEnable(GL2ES1.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
}
- public void setPointParams(float minSize, float maxSize, float distAttenConst, float distAttenLinear, float distAttenQuadratic, float fadeThreshold) {
+ public void setPointParams(final float minSize, final float maxSize, final float distAttenConst, final float distAttenLinear, final float distAttenQuadratic, final float fadeThreshold) {
pointMinSize = minSize;
pointMaxSize = maxSize;
pointFadeThreshold = fadeThreshold;
@@ -136,25 +138,25 @@ public class PointsDemoES1 extends PointsDemo {
pointDistAtten.put(1, distAttenLinear);
pointDistAtten.put(2, distAttenQuadratic);
}
-
+
/** default values */
private float pointMinSize = 0.0f;
private float pointMaxSize = 4096.0f;
private float pointFadeThreshold = 1.0f;
private final FloatBuffer pointDistAtten = Buffers.newDirectFloatBuffer(new float[] { 1.0f, 0.0f, 0.0f });
- public void display(GLAutoDrawable glad) {
- GL2ES1 gl = glad.getGL().getGL2ES1();
+ public void display(final GLAutoDrawable glad) {
+ final GL2ES1 gl = glad.getGL().getGL2ES1();
gl.glClearColor(0f, 0f, 0f, 0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
- gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
gl.glTranslatef(0, 0, -10);
gl.glColor4f(1.0f, 1.0f, 1.0f, 1.0f );
-
+
vertices.enableBuffer(gl, true);
-
+
gl.glEnable ( GL.GL_BLEND );
gl.glBlendFunc ( GL.GL_SRC_ALPHA, GL.GL_ONE );
if(smooth) {
@@ -164,35 +166,35 @@ public class PointsDemoES1 extends PointsDemo {
}
gl.glPointParameterf(GL2ES1.GL_POINT_SIZE_MIN, pointMinSize );
gl.glPointParameterf(GL2ES1.GL_POINT_SIZE_MAX, pointMaxSize );
- gl.glPointParameterf(GL2ES1.GL_POINT_FADE_THRESHOLD_SIZE, pointFadeThreshold);
+ gl.glPointParameterf(GL.GL_POINT_FADE_THRESHOLD_SIZE, pointFadeThreshold);
gl.glPointParameterfv(GL2ES1.GL_POINT_DISTANCE_ATTENUATION, pointDistAtten );
-
+
for(int i=edge*edge-1; i>=0; i--) {
gl.glPointSize(pointSizes[i]);
- gl.glDrawArrays(GL.GL_POINTS, i, 1);
- }
-
+ gl.glDrawArrays(GL.GL_POINTS, i, 1);
+ }
+
vertices.enableBuffer(gl, false);
}
- public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
// Thread.dumpStack();
- GL2ES1 gl = glad.getGL().getGL2ES1();
-
- if(-1 != swapInterval) {
+ final GL2ES1 gl = glad.getGL().getGL2ES1();
+
+ if(-1 != swapInterval) {
gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
}
-
+
// Set location in front of camera
- gl.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
glu.gluPerspective(45.0F, ( (float) width / (float) height ) / 1.0f, 1.0F, 100.0F);
//gl.glOrthof(-4.0f, 4.0f, -4.0f, 4.0f, 1.0f, 100.0f);
}
- public void dispose(GLAutoDrawable glad) {
- GL2ES1 gl = glad.getGL().getGL2ES1();
+ public void dispose(final GLAutoDrawable glad) {
+ final GL2ES1 gl = glad.getGL().getGL2ES1();
vertices.destroy(gl);
vertices = null;
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/RedSquareES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/RedSquareES1.java
index 5891bce0d..1f81261b8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/RedSquareES1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/RedSquareES1.java
@@ -32,7 +32,7 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
long startTime = 0;
long curTime = 0;
- public RedSquareES1(int swapInterval) {
+ public RedSquareES1(final int swapInterval) {
this.swapInterval = swapInterval;
}
@@ -41,33 +41,33 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
}
@Override
- public void addTileRendererNotify(TileRendererBase tr) {
+ public void addTileRendererNotify(final TileRendererBase tr) {
tileRendererInUse = tr;
doRotateBeforePrinting = doRotate;
setDoRotation(false);
}
@Override
- public void removeTileRendererNotify(TileRendererBase tr) {
+ public void removeTileRendererNotify(final TileRendererBase tr) {
tileRendererInUse = null;
setDoRotation(doRotateBeforePrinting);
}
@Override
- public void startTileRendering(TileRendererBase tr) {
+ public void startTileRendering(final TileRendererBase tr) {
System.err.println("RedSquareES1.startTileRendering: "+tr);
}
@Override
- public void endTileRendering(TileRendererBase tr) {
+ public void endTileRendering(final TileRendererBase tr) {
System.err.println("RedSquareES1.endTileRendering: "+tr);
}
- public void setDoRotation(boolean rotate) { this.doRotate = rotate; }
- public void setForceFFPEmu(boolean forceFFPEmu, boolean verboseFFPEmu, boolean debugFFPEmu, boolean traceFFPEmu) {
+ public void setDoRotation(final boolean rotate) { this.doRotate = rotate; }
+ public void setForceFFPEmu(final boolean forceFFPEmu, final boolean verboseFFPEmu, final boolean debugFFPEmu, final boolean traceFFPEmu) {
this.forceFFPEmu = forceFFPEmu;
this.verboseFFPEmu = verboseFFPEmu;
this.debugFFPEmu = debugFFPEmu;
this.traceFFPEmu = traceFFPEmu;
}
- public void setFlipVerticalInGLOrientation(boolean v) { flipVerticalInGLOrientation=v; }
+ public void setFlipVerticalInGLOrientation(final boolean v) { flipVerticalInGLOrientation=v; }
// FIXME: we must add storage of the pointers in the GL state to
// the GLImpl classes. The need for this can be seen by making
@@ -80,7 +80,7 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
private FloatBuffer vertices;
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
System.err.println(Thread.currentThread()+" RedSquareES1.init ...");
GL _gl = drawable.getGL();
@@ -100,13 +100,13 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
try {
// Debug ..
gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", GL2ES1.class, gl, null) );
- } catch (Exception e) {e.printStackTrace();}
+ } catch (final Exception e) {e.printStackTrace();}
}
if(trace) {
try {
// Trace ..
gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES1.class, gl, new Object[] { System.err } ) );
- } catch (Exception e) {e.printStackTrace();}
+ } catch (final Exception e) {e.printStackTrace();}
}
System.err.println("RedSquareES1 init on "+Thread.currentThread());
@@ -139,7 +139,7 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
}
@Override
- public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
final GL2ES1 gl = glad.getGL().getGL2ES1();
if(-1 != swapInterval) {
gl.setSwapInterval(swapInterval);
@@ -148,15 +148,15 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
}
@Override
- public void reshapeTile(TileRendererBase tr,
- int tileX, int tileY, int tileWidth, int tileHeight,
- int imageWidth, int imageHeight) {
+ public void reshapeTile(final TileRendererBase tr,
+ final int tileX, final int tileY, final int tileWidth, final int tileHeight,
+ final int imageWidth, final int imageHeight) {
final GL2ES1 gl = tr.getAttachedDrawable().getGL().getGL2ES1();
gl.setSwapInterval(0);
reshapeImpl(gl, tileX, tileY, tileWidth, tileHeight, imageWidth, imageHeight);
}
- void reshapeImpl(GL2ES1 gl, int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight) {
+ void reshapeImpl(final GL2ES1 gl, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight) {
System.err.println(Thread.currentThread()+" RedSquareES1.reshape "+tileX+"/"+tileY+" "+tileWidth+"x"+tileHeight+" of "+imageWidth+"x"+imageHeight+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(gl.getContext().getGLDrawable().getHandle())+", tileRendererInUse "+tileRendererInUse);
// Set location in front of camera
@@ -196,9 +196,9 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
curTime = System.currentTimeMillis();
- GL2ES1 gl = drawable.getGL().getGL2ES1();
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
if( null != tileRendererInUse ) {
gl.glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
} else {
@@ -210,7 +210,7 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
gl.glTranslatef(0, 0, -10);
- float ang = doRotate ? ((curTime - startTime) * 360.0f) / 4000.0f : 1f;
+ final float ang = doRotate ? ((curTime - startTime) * 360.0f) / 4000.0f : 1f;
gl.glRotatef(ang, 0, 0, 1);
gl.glRotatef(ang, 0, 1, 0);
@@ -223,9 +223,9 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
System.err.println(Thread.currentThread()+" RedSquareES1.dispose ... ");
- GL2ES1 gl = drawable.getGL().getGL2ES1();
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
gl.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
gl.glDisableClientState(GLPointerFunc.GL_COLOR_ARRAY);
colors.clear();
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestGearsES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestGearsES1NEWT.java
index 8abb0cc0e..a093cc07f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestGearsES1NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestGearsES1NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.demos.es1.newt;
import com.jogamp.newt.event.KeyAdapter;
@@ -66,8 +66,8 @@ public class TestGearsES1NEWT extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps, boolean forceFFPEmu) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+ protected void runTestGL(final GLCapabilities caps, final boolean forceFFPEmu) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle("Gears NEWT Test");
@@ -77,8 +77,8 @@ public class TestGearsES1NEWT extends UITestCase {
final SnapshotGLEventListener snap = new SnapshotGLEventListener();
glWindow.addGLEventListener(snap);
- Animator animator = new Animator(glWindow);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final Animator animator = new Animator(glWindow);
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -87,10 +87,10 @@ public class TestGearsES1NEWT extends UITestCase {
final GLWindow f_glWindow = glWindow;
glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
- }
+ }
if(e.getKeyChar()=='f') {
new Thread() {
public void run() {
@@ -121,19 +121,19 @@ public class TestGearsES1NEWT extends UITestCase {
@Test
public void test00() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES1());
+ final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES1());
runTestGL(caps, forceFFPEmu);
}
-
+
static long duration = 500; // ms
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-vsync")) {
i++;
swapInterval = MiscUtils.atoi(args[i], swapInterval);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestOlympicES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestOlympicES1NEWT.java
index c12ef9525..a29e9a3a6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestOlympicES1NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestOlympicES1NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.demos.es1.newt;
import com.jogamp.newt.opengl.GLWindow;
@@ -33,8 +33,8 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
import com.jogamp.opengl.test.junit.jogl.demos.es1.OlympicES1;
-
import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;
@@ -65,34 +65,34 @@ public class TestOlympicES1NEWT extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+ protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle("Olympic NEWT Test");
- OlympicES1 demo = new OlympicES1( swapInterval );
- demo.setForceFFPEmu(forceFFPEmu, verboseFFPEmu, false, false);
- glWindow.addGLEventListener(demo);
+ final OlympicES1 demo = new OlympicES1( swapInterval );
+ demo.setForceFFPEmu(forceFFPEmu, verboseFFPEmu, false, false);
+ glWindow.addGLEventListener(demo);
final SnapshotGLEventListener snap = new SnapshotGLEventListener();
glWindow.addGLEventListener(snap);
- Animator animator = new Animator();
- animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+ final Animator animator = new Animator();
+ animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
animator.setExclusiveContext(exclusiveContext);
-
- QuitAdapter quitAdapter = new QuitAdapter();
+
+ final QuitAdapter quitAdapter = new QuitAdapter();
glWindow.addKeyListener(quitAdapter);
glWindow.addWindowListener(quitAdapter);
glWindow.setSize(width, height);
glWindow.setVisible(true);
-
+
animator.add(glWindow);
animator.start();
animator.setUpdateFPSFrames(60, System.err);
Assert.assertTrue(animator.isStarted());
Assert.assertTrue(animator.isAnimating());
Assert.assertEquals(exclusiveContext ? animator.getThread() : null, glWindow.getExclusiveContextThread());
-
+
snap.setMakeSnapshot();
while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
@@ -109,19 +109,19 @@ public class TestOlympicES1NEWT extends UITestCase {
@Test
public void test00() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES1());
+ final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES1());
runTestGL(caps);
}
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-vsync")) {
i++;
swapInterval = MiscUtils.atoi(args[i], swapInterval);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestRedSquareES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestRedSquareES1NEWT.java
index 200936f34..c164990a4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestRedSquareES1NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestRedSquareES1NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.demos.es1.newt;
import com.jogamp.newt.event.KeyAdapter;
@@ -64,8 +64,8 @@ public class TestRedSquareES1NEWT extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps, boolean forceFFPEmu) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+ protected void runTestGL(final GLCapabilities caps, final boolean forceFFPEmu) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle("Gears NEWT Test");
@@ -75,8 +75,8 @@ public class TestRedSquareES1NEWT extends UITestCase {
final SnapshotGLEventListener snap = new SnapshotGLEventListener();
glWindow.addGLEventListener(snap);
- Animator animator = new Animator(glWindow);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final Animator animator = new Animator(glWindow);
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -85,10 +85,10 @@ public class TestRedSquareES1NEWT extends UITestCase {
final GLWindow f_glWindow = glWindow;
glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
- }
+ }
if(e.getKeyChar()=='f') {
new Thread() {
public void run() {
@@ -119,19 +119,19 @@ public class TestRedSquareES1NEWT extends UITestCase {
@Test
public void test00() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES1());
+ final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES1());
runTestGL(caps, forceFFPEmu);
}
-
+
static long duration = 1000; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-es2")) {
forceES2 = true;
} else if(args[i].equals("-ffpemu")) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/ElektronenMultiplizierer.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/ElektronenMultiplizierer.java
index 6080ed2c2..c54dad458 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/ElektronenMultiplizierer.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/ElektronenMultiplizierer.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -40,6 +40,7 @@ import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.common.nio.Buffers;
import com.jogamp.newt.event.KeyAdapter;
@@ -54,36 +55,36 @@ import com.jogamp.opengl.util.glsl.ShaderState;
/**
* <pre>
* __ __|_ ___________________________________________________________________________ ___|__ __
- * // /\ _ /\ \\
- * //____/ \__ __ _____ _____ _____ _____ _____ | | __ _____ _____ __ __/ \____\\
- * \ \ / / __| | | __| _ | | _ | | | __| | | __| | /\ \ / /
- * \____\/_/ | | | | | | | | | | | __| | | | | | | | | | |__ " \_\/____/
- * /\ \ |_____|_____|_____|__|__|_|_|_|__| | | |_____|_____|_____|_____| _ / /\
- * / \____\ http://jogamp.org |_| /____/ \
- * \ / "' _________________________________________________________________________ `" \ /
+ * // /\ _ /\ \\
+ * //____/ \__ __ _____ _____ _____ _____ _____ | | __ _____ _____ __ __/ \____\\
+ * \ \ / / __| | | __| _ | | _ | | | __| | | __| | /\ \ / /
+ * \____\/_/ | | | | | | | | | | | __| | | | | | | | | | |__ " \_\/____/
+ * /\ \ |_____|_____|_____|__|__|_|_|_|__| | | |_____|_____|_____|_____| _ / /\
+ * / \____\ http://jogamp.org |_| /____/ \
+ * \ / "' _________________________________________________________________________ `" \ /
* \/____. .____\/
- * </pre>
+ * </pre>
*
* <p>
- * JOGL2 port of my PC 4k intro competition entry for Revision 2011. Sure it got a little bigger
+ * JOGL2 port of my PC 4k intro competition entry for Revision 2011. Sure it got a little bigger
* while porting but the shader and control code remained more or less untouched. The intro renders
- * a fullscreen billboard using a single fragment shader. The shader encapsulates basically two
+ * a fullscreen billboard using a single fragment shader. The shader encapsulates basically two
* different routines: A sphere-tracing based raymarcher for a single fractal formula and a bitmap
* orbit trap julia+mandelbrot fractal renderer. Additionally an inline-processing analog-distortion
* filter is applied to all rendered fragments to make the overall look more interesting.
* </p>
*
* <p>
- * The different intro parts are all parameter variations of the two routines in the fragment shader
+ * The different intro parts are all parameter variations of the two routines in the fragment shader
* synched to the music: Parts 3+5 are obviously the mandelbrot and julia bitmap orbit traps, and parts
* 1,2,4 and 6 are pure fractal sphere tracing.
* </p>
*
* <p>
* During the development of the intro it turned out that perfectly raymarching every pixel of the orbit
- * trapped julia+mandelbrot fractal was way to slow even on highend hardware. So I inserted a lowres
+ * trapped julia+mandelbrot fractal was way to slow even on highend hardware. So I inserted a lowres
* intermediate FBO to be used by the bitmap based orbit trap routine wich was ofcourse way faster, but
- * had the obvious upscaling artefacts. Maybe I'll produce a perfect quality version for very patient
+ * had the obvious upscaling artefacts. Maybe I'll produce a perfect quality version for very patient
* people with insane hardware :)
* </p>
*
@@ -119,21 +120,21 @@ public class ElektronenMultiplizierer implements GLEventListener {
//BEGIN --- BaseGlobalEnvironment replacement ---
- private final GLCapabilities mCaps;
+ private final GLCapabilities mCaps;
// private final GLU mGlu;
- private String mCommandLineParameter_BaseRoutineClassName;
- private boolean mCommandLineParameter_MultiSampling;
- private int mCommandLineParameter_NumberOfSampleBuffers;
- private boolean mCommandLineParameter_AnisotropicFiltering;
- private float mCommandLineParameter_AnisotropyLevel;
- private boolean mCommandLineParameter_FrameCapture;
- private boolean mCommandLineParameter_FrameSkip;
+ private final String mCommandLineParameter_BaseRoutineClassName;
+ private final boolean mCommandLineParameter_MultiSampling;
+ private final int mCommandLineParameter_NumberOfSampleBuffers;
+ private final boolean mCommandLineParameter_AnisotropicFiltering;
+ private final float mCommandLineParameter_AnisotropyLevel;
+ private final boolean mCommandLineParameter_FrameCapture;
+ private final boolean mCommandLineParameter_FrameSkip;
private boolean mUsesFullScreenMode;
private int mFrameCounter;
- private int mCommandLineParameter_FrameRate;
+ private final int mCommandLineParameter_FrameRate;
private long mFrameSkipAverageFramerateTimeStart;
- private long mFrameSkipAverageFramerateTimeEnd;
+ private long mFrameSkipAverageFramerateTimeEnd;
private boolean mFrameSkipManual;
// private int mSkippedFramesCounter;
// private BaseMusic mBaseMusic;
@@ -145,7 +146,7 @@ public class ElektronenMultiplizierer implements GLEventListener {
private GLUniformData mScreenDimensionUniform;
private GLArrayDataServer vertices0;
// private GLArrayDataServer texCoords0;
-
+
public String getBaseRoutineClassName() { return mCommandLineParameter_BaseRoutineClassName; }
public boolean preferMultiSampling() { return mCommandLineParameter_MultiSampling; }
public int getNumberOfSamplingBuffers() { return mCommandLineParameter_NumberOfSampleBuffers; }
@@ -157,24 +158,24 @@ public class ElektronenMultiplizierer implements GLEventListener {
public boolean usesFullScreenMode() { return mUsesFullScreenMode; }
class TimeShiftKeys extends KeyAdapter {
- public void keyPressed(KeyEvent e) {
+ public void keyPressed(final KeyEvent e) {
if(KeyEvent.VK_RIGHT == e.getKeyCode()) {
skipFrames(120);
} else if(KeyEvent.VK_LEFT == e.getKeyCode()) {
skipFrames(-120);
- }
- }
+ }
+ }
}
TimeShiftKeys timeShiftKeys;
-
+
public ElektronenMultiplizierer (
- String inBaseRoutineClassName,
- boolean inMultiSampling,
- int inNumberOfSampleBuffers,
- boolean inAnisotropicFiltering,
- float inAnisotropyLevel,
- boolean inFrameCapture,
- boolean inFrameSkip, int desiredFrameRate, int startFrame
+ final String inBaseRoutineClassName,
+ final boolean inMultiSampling,
+ final int inNumberOfSampleBuffers,
+ final boolean inAnisotropicFiltering,
+ final float inAnisotropyLevel,
+ final boolean inFrameCapture,
+ final boolean inFrameSkip, final int desiredFrameRate, final int startFrame
) {
// mGlu = new GLU();
mCommandLineParameter_BaseRoutineClassName = inBaseRoutineClassName;
@@ -195,42 +196,42 @@ public class ElektronenMultiplizierer implements GLEventListener {
mCaps.setAccumGreenBits(1);
mCaps.setAccumRedBits(1);
// turns out we need to have alpha, otherwise no AA will be visible
- mCaps.setAlphaBits(1);
+ mCaps.setAlphaBits(1);
}
-
+
mFrameSkipAverageFramerateTimeStart = 0;
- mFrameCounter = 0;
+ mFrameCounter = 0;
skipFrames(startFrame);
timeShiftKeys = new TimeShiftKeys();
}
-
+
public ElektronenMultiplizierer() {
- this(null, false, -1, false, -1.0f, false, true, 30, 0);
+ this(null, false, -1, false, -1.0f, false, true, 30, 0);
}
-
+
/**
* skip frames by turning back start time
- * @param frames positive or negative values
+ * @param frames positive or negative values
*/
- public void skipFrames(int frames) {
+ public void skipFrames(final int frames) {
final long dft = 1000000000/mCommandLineParameter_FrameRate;
mFrameSkipAverageFramerateTimeStart -= frames * dft ;
mFrameSkipManual = true;
}
-
+
public GLCapabilitiesImmutable getGLCapabilities() {
return mCaps;
}
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
if(drawable instanceof GLWindow) {
final GLWindow glw = (GLWindow) drawable;
glw.addKeyListener(0, timeShiftKeys);
}
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.setSwapInterval(1);
- st = new ShaderState();
+ st = new ShaderState();
final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(), "shader",
"shader/bin", "default", true);
final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(), "shader",
@@ -238,48 +239,48 @@ public class ElektronenMultiplizierer implements GLEventListener {
// "shader", "shader/bin", "elektronenmultiplizierer_port", true);
vp0.defaultShaderCustomization(gl, true, true);
fp0.defaultShaderCustomization(gl, true, true);
-
+
final ShaderProgram sp0 = new ShaderProgram();
sp0.add(gl, vp0, System.err);
- sp0.add(gl, fp0, System.err);
+ sp0.add(gl, fp0, System.err);
st.attachShaderProgram(gl, sp0, true);
-
- final float XRESf = (float) drawable.getSurfaceWidth();
- final float YRESf = (float) drawable.getSurfaceHeight();
+
+ final float XRESf = drawable.getSurfaceWidth();
+ final float YRESf = drawable.getSurfaceHeight();
mScreenDimensionUniform = new GLUniformData("resolution", 2, Buffers.newDirectFloatBuffer(2));
final FloatBuffer mScreenDimensionV = (FloatBuffer) mScreenDimensionUniform.getBuffer();
mScreenDimensionV.put(0, XRESf);
mScreenDimensionV.put(1, YRESf);
- st.ownUniform(mScreenDimensionUniform);
- st.uniform(gl, mScreenDimensionUniform);
-
+ st.ownUniform(mScreenDimensionUniform);
+ st.uniform(gl, mScreenDimensionUniform);
+
pmvMatrix = new PMVMatrix();
pmvMatrixUniform = new GLUniformData("gcu_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
st.ownUniform(pmvMatrixUniform);
st.uniform(gl, pmvMatrixUniform);
-
+
vertices0 = GLArrayDataServer.createGLSL("gca_Vertices", 2, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
vertices0.putf(0); vertices0.putf(YRESf);
vertices0.putf(XRESf); vertices0.putf(YRESf);
vertices0.putf(0); vertices0.putf(0);
vertices0.putf(XRESf); vertices0.putf(0);
- vertices0.seal(gl, true);
+ vertices0.seal(gl, true);
st.ownAttribute(vertices0, true);
vertices0.enableBuffer(gl, false);
-
+
/**
texCoords0 = GLArrayDataServer.createGLSL("gca_TexCoords", 2, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
texCoords0.putf(0f); texCoords0.putf(1f);
texCoords0.putf(1f); texCoords0.putf(1f);
- texCoords0.putf(0f); texCoords0.putf(0f);
+ texCoords0.putf(0f); texCoords0.putf(0f);
texCoords0.putf(1f); texCoords0.putf(0f);
texCoords0.seal(gl, true);
st.ownAttribute(texCoords0, true);
texCoords0.enableBuffer(gl, false); */
//generate framebufferobject
- int[] result = new int[1];
+ final int[] result = new int[1];
gl.glGenTextures(1, result, 0);
mFrameBufferTextureID = result[0];
gl.glBindTexture(GL_TEXTURE_2D, mFrameBufferTextureID);
@@ -308,20 +309,20 @@ public class ElektronenMultiplizierer implements GLEventListener {
// if NO music is used sync to mainloop start ...
// (add up current time due to possible turned back start time by skip frames)
mFrameSkipAverageFramerateTimeStart += System.nanoTime();
-
+
// mBaseMusic = new BaseMusic(BaseGlobalEnvironment.getInstance().getMusicFileName());
// mBaseMusic.init();
// mBaseMusic.play();
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
if (wantsFrameSkip()) {
mFrameSkipAverageFramerateTimeEnd = System.nanoTime();
- double tDesiredFrameRate = (float)getDesiredFramerate();
- double tSingleFrameTime = 1000000000.0f/tDesiredFrameRate;
- double tElapsedTime = mFrameSkipAverageFramerateTimeEnd - mFrameSkipAverageFramerateTimeStart;
- double mFrameCounterTargetValue = tElapsedTime/tSingleFrameTime;
- double mFrameCounterDifference = mFrameCounterTargetValue-mFrameCounter;
+ final double tDesiredFrameRate = getDesiredFramerate();
+ final double tSingleFrameTime = 1000000000.0f/tDesiredFrameRate;
+ final double tElapsedTime = mFrameSkipAverageFramerateTimeEnd - mFrameSkipAverageFramerateTimeStart;
+ final double mFrameCounterTargetValue = tElapsedTime/tSingleFrameTime;
+ final double mFrameCounterDifference = mFrameCounterTargetValue-mFrameCounter;
if (mFrameSkipManual || mFrameCounterDifference>2) {
mFrameCounter+=mFrameCounterDifference;
// mSkippedFramesCounter+=mFrameCounterDifference;
@@ -331,9 +332,9 @@ public class ElektronenMultiplizierer implements GLEventListener {
}
mFrameSkipManual = false;
}
-
- GL2ES2 gl = drawable.getGL().getGL2ES2();
-
+
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
final int XRES = drawable.getSurfaceWidth();
final int YRES = drawable.getSurfaceHeight();
@@ -349,7 +350,7 @@ public class ElektronenMultiplizierer implements GLEventListener {
// mBaseMusic.synchonizeMusic();
//use this for offline rendering/capture ...
- int MMTime_u_ms = (int)((((float)mFrameCounter)*44100.0f)/60.0f);
+ int MMTime_u_ms = (int)(((mFrameCounter)*44100.0f)/60.0f);
//use this for music synched rendering ...
//int MMTime_u_ms = (int)(BaseRoutineRuntime.getInstance().getBaseMusic().getPositionInMilliseconds()*(44100.0f/1000.0f));
//dedicated sync variable for each event ... kinda lame but who cares X-)
@@ -362,7 +363,7 @@ public class ElektronenMultiplizierer implements GLEventListener {
if (MMTime_u_ms>=4438408 && !mSyncEvent_07) { mSyncEvent_07 = true; handleSyncEvent(MMTime_u_ms); }
if (MMTime_u_ms>=5482831 && !mSyncEvent_08) { mSyncEvent_08 = true; handleSyncEvent(MMTime_u_ms); }
//calculate current time based on 60fps reference framerate ...
- MMTime_u_ms = (int)((((float)mFrameCounter)*44100.0f)/60.0f);
+ MMTime_u_ms = (int)(((mFrameCounter)*44100.0f)/60.0f);
gl.glDisable(GL_CULL_FACE);
gl.glDisable(GL_DEPTH_TEST);
@@ -371,13 +372,13 @@ public class ElektronenMultiplizierer implements GLEventListener {
vertices0.enableBuffer(gl, true);
// texCoords0.enableBuffer(gl, true);
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
pmvMatrix.glOrthof(0f, XRES, YRES, 0f, -1f, 1f);
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
st.uniform(gl, pmvMatrixUniform);
-
+
gl.glActiveTexture(GL_TEXTURE0);
//gogogo! O-)
@@ -385,8 +386,8 @@ public class ElektronenMultiplizierer implements GLEventListener {
if (tBrightnessSync<1) {
tBrightnessSync=1;
}
- mEffectTime = (float)((MMTime_u_ms-mEffectSyncTime)/100000.0f);
-
+ mEffectTime = (MMTime_u_ms-mEffectSyncTime)/100000.0f;
+
if (mSyncEventNumber==0 && mEffectTime<4.0f) {
//fadein and fullscreen rotate
tBrightnessSync = mEffectTime/4.0f;
@@ -394,12 +395,12 @@ public class ElektronenMultiplizierer implements GLEventListener {
//fullscrenn mushroom transform
tBrightnessSync = 1.0f-((mEffectTime-12.0f)/3.5f);
}
-
+
if (mSyncEventNumber==0 || mSyncEventNumber==1) {
//zoomin from fog
mEffectNumber = 3;
mEffectTime *= 1.75;
- float tEffectTimeMax = 9.3f;
+ final float tEffectTimeMax = 9.3f;
if (mEffectTime>=tEffectTimeMax) {
mEffectTime=tEffectTimeMax;
}
@@ -424,10 +425,10 @@ public class ElektronenMultiplizierer implements GLEventListener {
mEffectNumber = 6;
mEffectTime *= 0.364f;
}
-
+
gl.glBindFramebuffer(GL_FRAMEBUFFER, mFrameBufferObjectID);
- // gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
- GLUniformData en = st.getUniform("en");
+ // gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
+ final GLUniformData en = st.getUniform("en");
if(mSyncEventNumber==7) {
en.setData(2);
}
@@ -437,8 +438,8 @@ public class ElektronenMultiplizierer implements GLEventListener {
en.setData(0);
}
st.uniform(gl, en);
-
- GLUniformData et = st.getUniform("et");
+
+ final GLUniformData et = st.getUniform("et");
st.uniform(gl, et.setData(9.1f));
st.uniform(gl, st.getUniform("tm").setData(MMTime_u_ms/40000.0f));
@@ -447,7 +448,7 @@ public class ElektronenMultiplizierer implements GLEventListener {
if(mSyncEventNumber==4 || mSyncEventNumber==7) {
//render to fbo only when using julia/mandel orbittrap ...
// gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
+ gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
}
gl.glBindFramebuffer(GL_FRAMEBUFFER, 0);
st.uniform(gl, en.setData(mEffectNumber));
@@ -459,19 +460,19 @@ public class ElektronenMultiplizierer implements GLEventListener {
gl.glBindTexture(GL_TEXTURE_2D, mFrameBufferTextureID);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
- gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
+ gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
vertices0.enableBuffer(gl, false);
- // texCoords0.enableBuffer(gl, false);
+ // texCoords0.enableBuffer(gl, false);
st.useProgram(gl, false);
//---
mFrameCounter++;
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
-
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
st.useProgram(gl, true);
vertices0.seal(false);
vertices0.rewind();
@@ -479,34 +480,34 @@ public class ElektronenMultiplizierer implements GLEventListener {
vertices0.putf(width); vertices0.putf(height);
vertices0.putf(0); vertices0.putf(0);
vertices0.putf(width); vertices0.putf(0);
- vertices0.seal(gl, true);
+ vertices0.seal(gl, true);
st.ownAttribute(vertices0, true);
vertices0.enableBuffer(gl, false);
-
+
final FloatBuffer mScreenDimensionV = (FloatBuffer) mScreenDimensionUniform.getBuffer();
- mScreenDimensionV.put(0, (float) width);
- mScreenDimensionV.put(1, (float) height);
+ mScreenDimensionV.put(0, width);
+ mScreenDimensionV.put(1, height);
st.uniform(gl, mScreenDimensionUniform);
st.useProgram(gl, false);
- gl.glViewport(0, 0, width, height);
+ gl.glViewport(0, 0, width, height);
}
- public void dispose(GLAutoDrawable drawable) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ public void dispose(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glDeleteFramebuffers(1, new int[] { mFrameBufferObjectID }, 0);
gl.glDeleteTextures(1, new int[] { mFrameBufferTextureID }, 0);
st.destroy(gl);
if(drawable instanceof GLWindow) {
final GLWindow glw = (GLWindow) drawable;
glw.removeKeyListener(timeShiftKeys);
- }
+ }
}
// public BaseMusic getBaseMusic() {
// return mBaseMusic;
// }
-
+
public void resetFrameCounter() {
mFrameCounter = 0;
}
@@ -530,7 +531,7 @@ public class ElektronenMultiplizierer implements GLEventListener {
protected boolean mSyncEvent_07;
protected boolean mSyncEvent_08;
- public void handleSyncEvent(int inMMTime_u_ms) {
+ public void handleSyncEvent(final int inMMTime_u_ms) {
mSyncTime = inMMTime_u_ms;
mSyncEventNumber++;
System.out.println("NEW SYNC EVENT! tSyncEventNumber="+mSyncEventNumber+" tSyncTime="+mSyncTime);
@@ -538,5 +539,5 @@ public class ElektronenMultiplizierer implements GLEventListener {
mEffectSyncTime = inMMTime_u_ms;
}
}
-
+
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java
index 1a30d1868..f00053989 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java
@@ -152,7 +152,7 @@ public class FBOMix2DemosES2 implements GLEventListener {
System.err.println("**** Init");
initFBOs(gl, drawable);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
}
private void initFBOs(final GL gl, final GLAutoDrawable drawable) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
index d1a5f888e..2709aa608 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
@@ -54,6 +54,7 @@ import javax.media.opengl.GLAnimatorControl;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
/**
* GearsES2.java <BR>
@@ -395,14 +396,14 @@ public class GearsES2 implements StereoRendererListener, TileRendererBase.TileRe
System.err.println(">> GearsES2 "+sid()+", angle "+angle+", [l "+left+", r "+right+", b "+bottom+", t "+top+"] "+w+"x"+h+" -> [l "+l+", r "+r+", b "+b+", t "+t+"] "+_w+"x"+_h+", v-flip "+flipVerticalInGLOrientation);
}
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
if( flipVerticalInGLOrientation && gl.getContext().getGLDrawable().isGLOriented() ) {
pmvMatrix.glScalef(1f, -1f, 1f);
}
pmvMatrix.glFrustumf(l, r, b, t, zNear, zFar);
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrix.glTranslatef(0.0f, 0.0f, -zViewDist);
st.useProgram(gl, true);
@@ -421,7 +422,7 @@ public class GearsES2 implements StereoRendererListener, TileRendererBase.TileRe
public void reshapeEye(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height,
final EyeParameter eyeParam, final EyePose eyePose) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
final float[] mat4Projection = FloatUtil.makePerspective(mat4Tmp1, 0, true, eyeParam.fovhv, zNear, zFar);
if( flipVerticalInGLOrientation && gl.getContext().getGLDrawable().isGLOriented() ) {
pmvMatrix.glLoadIdentity();
@@ -431,7 +432,7 @@ public class GearsES2 implements StereoRendererListener, TileRendererBase.TileRe
pmvMatrix.glLoadMatrixf(mat4Projection, 0);
}
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
final Quaternion rollPitchYaw = new Quaternion();
// private final float eyeYaw = FloatUtil.PI; // 180 degrees in radians
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java
index 4cef6394e..7088eb757 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java
@@ -43,11 +43,11 @@ public class GearsObjectES2 extends GearsObject {
final GLUniformData colorUniform;
final ShaderState st;
- public GearsObjectES2(GL gl, boolean useMappedBuffers, ShaderState st, FloatBuffer gearColor,
- float inner_radius, float outer_radius,
- float width,
- int teeth,
- float tooth_depth, PMVMatrix pmvMatrix, GLUniformData pmvMatrixUniform, GLUniformData colorUniform, boolean validateBuffers)
+ public GearsObjectES2(final GL gl, final boolean useMappedBuffers, final ShaderState st, final FloatBuffer gearColor,
+ final float inner_radius, final float outer_radius,
+ final float width,
+ final int teeth,
+ final float tooth_depth, final PMVMatrix pmvMatrix, final GLUniformData pmvMatrixUniform, final GLUniformData colorUniform, final boolean validateBuffers)
{
super(gl, useMappedBuffers, gearColor, inner_radius, outer_radius, width, teeth, tooth_depth, validateBuffers);
this.pmvMatrix = pmvMatrix;
@@ -57,10 +57,10 @@ public class GearsObjectES2 extends GearsObject {
associate(st);
}
- public GearsObjectES2(GearsObjectES2 shared,
- ShaderState st,
- PMVMatrix pmvMatrix,
- GLUniformData pmvMatrixUniform, GLUniformData colorUniform)
+ public GearsObjectES2(final GearsObjectES2 shared,
+ final ShaderState st,
+ final PMVMatrix pmvMatrix,
+ final GLUniformData pmvMatrixUniform, final GLUniformData colorUniform)
{
super(shared);
this.pmvMatrix = pmvMatrix;
@@ -70,7 +70,7 @@ public class GearsObjectES2 extends GearsObject {
associate(st);
}
- private void associate(ShaderState st) {
+ private void associate(final ShaderState st) {
frontFace.associate(st, true);
frontSide.associate(st, true);
backFace.associate(st, true);
@@ -80,7 +80,7 @@ public class GearsObjectES2 extends GearsObject {
}
@Override
- public GLArrayDataServer createInterleaved(boolean useMappedBuffers, int comps, int dataType, boolean normalized, int initialSize, int vboUsage) {
+ public GLArrayDataServer createInterleaved(final boolean useMappedBuffers, final int comps, final int dataType, final boolean normalized, final int initialSize, final int vboUsage) {
if( useMappedBuffers ) {
return GLArrayDataServer.createGLSLInterleavedMapped(comps, dataType, normalized, initialSize, vboUsage);
} else {
@@ -89,12 +89,12 @@ public class GearsObjectES2 extends GearsObject {
}
@Override
- public void addInterleavedVertexAndNormalArrays(GLArrayDataServer array, int components) {
+ public void addInterleavedVertexAndNormalArrays(final GLArrayDataServer array, final int components) {
array.addGLSLSubArray("vertices", components, GL.GL_ARRAY_BUFFER);
array.addGLSLSubArray("normals", components, GL.GL_ARRAY_BUFFER);
}
- private void draw(GL2ES2 gl, GLArrayDataServer array, int mode, int face) {
+ private void draw(final GL2ES2 gl, final GLArrayDataServer array, final int mode, final int face) {
if( !isShared || gl.glIsBuffer(array.getVBOName()) ) {
if( validateBuffers ) {
array.bindBuffer(gl, true);
@@ -119,7 +119,7 @@ public class GearsObjectES2 extends GearsObject {
}
@Override
- public void draw(GL _gl, float x, float y, float angle) {
+ public void draw(final GL _gl, final float x, final float y, final float angle) {
final GL2ES2 gl = _gl.getGL2ES2();
pmvMatrix.glPushMatrix();
pmvMatrix.glTranslatef(x, y, 0f);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/LandscapeES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/LandscapeES2.java
index 04af59628..c341c6de6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/LandscapeES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/LandscapeES2.java
@@ -162,7 +162,7 @@ public class LandscapeES2 implements GLEventListener {
timeUni.setData((System.currentTimeMillis() - millisOffset) / 1000.0f);
shaderState.uniform(gl, timeUni);
vertices.enableBuffer(gl, true);
- gl.glDrawArrays(GL2ES2.GL_TRIANGLE_STRIP, 0, 4);
+ gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
vertices.enableBuffer(gl, false);
shaderState.useProgram(gl, false);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/MultisampleDemoES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/MultisampleDemoES2.java
index 430ea45c0..d2f0d89eb 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/MultisampleDemoES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/MultisampleDemoES2.java
@@ -62,16 +62,16 @@ public class MultisampleDemoES2 implements GLEventListener {
private GLUniformData pmvMatrixUniform;
private ImmModeSink immModeSink;
- public MultisampleDemoES2(boolean multisample) {
+ public MultisampleDemoES2(final boolean multisample) {
this.multisample = multisample;
st = new ShaderState();
- st.setVerbose(true);
- pmvMatrix = new PMVMatrix();
+ st.setVerbose(true);
+ pmvMatrix = new PMVMatrix();
}
- public void init(GLAutoDrawable glad) {
+ public void init(final GLAutoDrawable glad) {
final GL2ES2 gl = glad.getGL().getGL2ES2();
-
+
System.err.println();
System.err.println("req. msaa: "+multisample);
System.err.println("Requested: " + glad.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities());
@@ -79,26 +79,26 @@ public class MultisampleDemoES2 implements GLEventListener {
System.err.println("Chosen : " + glad.getChosenGLCapabilities());
System.err.println("has msaa: "+multisample);
System.err.println();
-
+
final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MultisampleDemoES2.class, "shader",
"shader/bin", "mgl_default_xxx", true);
final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, MultisampleDemoES2.class, "shader",
"shader/bin", "mgl_default_xxx", true);
vp0.defaultShaderCustomization(gl, true, true);
fp0.defaultShaderCustomization(gl, true, true);
-
+
sp0 = new ShaderProgram();
sp0.add(gl, vp0, System.err);
- sp0.add(gl, fp0, System.err);
+ sp0.add(gl, fp0, System.err);
st.attachShaderProgram(gl, sp0, true);
-
+
pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
- st.ownUniform(pmvMatrixUniform);
+ st.ownUniform(pmvMatrixUniform);
st.uniform(gl, pmvMatrixUniform);
-
- // Using predef array names, see
+
+ // Using predef array names, see
// GLPointerFuncUtil.getPredefinedArrayIndexName(glArrayIndex);
- immModeSink = ImmModeSink.createGLSL(40,
+ immModeSink = ImmModeSink.createGLSL(40,
3, GL.GL_FLOAT, // vertex
4, GL.GL_FLOAT, // color
0, GL.GL_FLOAT, // normal
@@ -109,28 +109,28 @@ public class MultisampleDemoES2 implements GLEventListener {
final double radius = 1;
immModeSink.glBegin(GL.GL_LINES);
for (int i = numSteps - 1; i >= 0; i--) {
- immModeSink.glVertex3f((float) (radius * Math.cos(i * increment)),
- (float) (radius * Math.sin(i * increment)),
+ immModeSink.glVertex3f((float) (radius * Math.cos(i * increment)),
+ (float) (radius * Math.sin(i * increment)),
0f);
- immModeSink.glColor4f( 1f, 1f, 1f, 1f );
- immModeSink.glVertex3f((float) (-1.0 * radius * Math.cos(i * increment)),
- (float) (-1.0 * radius * Math.sin(i * increment)),
+ immModeSink.glColor4f( 1f, 1f, 1f, 1f );
+ immModeSink.glVertex3f((float) (-1.0 * radius * Math.cos(i * increment)),
+ (float) (-1.0 * radius * Math.sin(i * increment)),
0f);
- immModeSink.glColor4f( 1f, 1f, 1f, 1f );
+ immModeSink.glColor4f( 1f, 1f, 1f, 1f );
}
immModeSink.glEnd(gl, false);
-
+
st.useProgram(gl, false);
}
- public void dispose(GLAutoDrawable glad) {
+ public void dispose(final GLAutoDrawable glad) {
final GL2ES2 gl = glad.getGL().getGL2ES2();
immModeSink.destroy(gl);
immModeSink = null;
st.destroy(gl);
}
- public void display(GLAutoDrawable glad) {
+ public void display(final GLAutoDrawable glad) {
final GL2ES2 gl = glad.getGL().getGL2ES2();
if (multisample) {
gl.glEnable(GL.GL_MULTISAMPLE);
@@ -139,16 +139,16 @@ public class MultisampleDemoES2 implements GLEventListener {
// gl.glEnable(GL.GL_DEPTH_TEST);
// gl.glDepthFunc(GL.GL_LESS);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-
+
st.useProgram(gl, true);
-
+
immModeSink.draw(gl, true);
-
+
st.useProgram(gl, false);
}
// Unused routines
- public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
System.err.println("reshape ..");
final GL2ES2 gl = glad.getGL().getGL2ES2();
pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
@@ -157,12 +157,12 @@ public class MultisampleDemoES2 implements GLEventListener {
pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 10.0f);
pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
-
+
st.useProgram(gl, true);
st.uniform(gl, pmvMatrixUniform);
st.useProgram(gl, false);
}
- public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
+ public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/PointsDemoES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/PointsDemoES2.java
index 573c91636..8a99a4d55 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/PointsDemoES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/PointsDemoES2.java
@@ -43,6 +43,7 @@ import javax.media.opengl.GL2ES2;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
public class PointsDemoES2 extends PointsDemo {
ShaderState st;
@@ -58,7 +59,7 @@ public class PointsDemoES2 extends PointsDemo {
/** ( pointSize, pointSmooth, attn. pointMinSize, attn. pointMaxSize ) , ( attenuation coefficients 1f 0f 0f, attenuation fade theshold 1f ) */
private final FloatBuffer pointParams = Buffers.newDirectFloatBuffer(new float[] { 1.0f, 0.0f, 0.0f, 4096.0f, 1.0f, 0.0f, 0.0f, 1.0f });
- public PointsDemoES2(int swapInterval) {
+ public PointsDemoES2(final int swapInterval) {
this.swapInterval = swapInterval;
}
@@ -66,11 +67,11 @@ public class PointsDemoES2 extends PointsDemo {
this.swapInterval = 1;
}
- public void setSmoothPoints(boolean v) {
+ public void setSmoothPoints(final boolean v) {
pointParams.put(1, v ? 1.0f : 0.0f);
}
- public void setPointParams(float minSize, float maxSize, float distAttenConst, float distAttenLinear, float distAttenQuadratic, float fadeThreshold) {
+ public void setPointParams(final float minSize, final float maxSize, final float distAttenConst, final float distAttenLinear, final float distAttenQuadratic, final float fadeThreshold) {
pointParams.put(2, minSize);
pointParams.put(3, maxSize);
pointParams.put(4+0, distAttenConst);
@@ -79,8 +80,8 @@ public class PointsDemoES2 extends PointsDemo {
pointParams.put(4+3, fadeThreshold);
}
- public void init(GLAutoDrawable glad) {
- GL2ES2 gl = glad.getGL().getGL2ES2();
+ public void init(final GLAutoDrawable glad) {
+ final GL2ES2 gl = glad.getGL().getGL2ES2();
System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
@@ -103,9 +104,9 @@ public class PointsDemoES2 extends PointsDemo {
// setup mgl_PMVMatrix
pmvMatrix = new PMVMatrix();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
st.ownUniform(pmvMatrixUniform);
@@ -138,21 +139,21 @@ public class PointsDemoES2 extends PointsDemo {
pointSizes.enableBuffer(gl, false);
// OpenGL Render Settings
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
st.useProgram(gl, false);
}
- public void display(GLAutoDrawable glad) {
- GL2ES2 gl = glad.getGL().getGL2ES2();
+ public void display(final GLAutoDrawable glad) {
+ final GL2ES2 gl = glad.getGL().getGL2ES2();
gl.glClearColor(0f, 0f, 0f, 0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
st.useProgram(gl, true);
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrix.glTranslatef(0, 0, -10);
st.uniform(gl, pmvMatrixUniform);
- GLUniformData ud = st.getUniform(mgl_PointParams);
+ final GLUniformData ud = st.getUniform(mgl_PointParams);
if(null!=ud) {
// same data object
st.uniform(gl, ud);
@@ -181,9 +182,9 @@ public class PointsDemoES2 extends PointsDemo {
st.useProgram(gl, false);
}
- public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
// Thread.dumpStack();
- GL2ES2 gl = glad.getGL().getGL2ES2();
+ final GL2ES2 gl = glad.getGL().getGL2ES2();
if(-1 != swapInterval) {
gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
@@ -191,7 +192,7 @@ public class PointsDemoES2 extends PointsDemo {
st.useProgram(gl, true);
// Set location in front of camera
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
pmvMatrix.gluPerspective(45.0F, ( (float) width / (float) height ) / 1.0f, 1.0F, 100.0F);
//pmvMatrix.glOrthof(-4.0f, 4.0f, -4.0f, 4.0f, 1.0f, 100.0f);
@@ -199,8 +200,8 @@ public class PointsDemoES2 extends PointsDemo {
st.useProgram(gl, false);
}
- public void dispose(GLAutoDrawable glad) {
- GL2ES2 gl = glad.getGL().getGL2ES2();
+ public void dispose(final GLAutoDrawable glad) {
+ final GL2ES2 gl = glad.getGL().getGL2ES2();
st.destroy(gl);
st = null;
pmvMatrix = null;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java
index 9f850c35b..8058d1b7d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java
@@ -40,6 +40,7 @@ import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRendererListener {
private ShaderState st;
@@ -55,7 +56,7 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
private TileRendererBase tileRendererInUse = null;
private boolean doRotateBeforePrinting;
- public RedSquareES2(int swapInterval) {
+ public RedSquareES2(final int swapInterval) {
this.swapInterval = swapInterval;
}
@@ -64,31 +65,31 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
}
@Override
- public void addTileRendererNotify(TileRendererBase tr) {
+ public void addTileRendererNotify(final TileRendererBase tr) {
tileRendererInUse = tr;
doRotateBeforePrinting = doRotate;
setDoRotation(false);
}
@Override
- public void removeTileRendererNotify(TileRendererBase tr) {
+ public void removeTileRendererNotify(final TileRendererBase tr) {
tileRendererInUse = null;
setDoRotation(doRotateBeforePrinting);
}
@Override
- public void startTileRendering(TileRendererBase tr) {
+ public void startTileRendering(final TileRendererBase tr) {
System.err.println("RedSquareES2.startTileRendering: "+tr);
}
@Override
- public void endTileRendering(TileRendererBase tr) {
+ public void endTileRendering(final TileRendererBase tr) {
System.err.println("RedSquareES2.endTileRendering: "+tr);
}
- public void setAspect(float aspect) { this.aspect = aspect; }
- public void setDoRotation(boolean rotate) { this.doRotate = rotate; }
- public void setClearBuffers(boolean v) { clearBuffers = v; }
+ public void setAspect(final float aspect) { this.aspect = aspect; }
+ public void setDoRotation(final boolean rotate) { this.doRotate = rotate; }
+ public void setClearBuffers(final boolean v) { clearBuffers = v; }
@Override
- public void init(GLAutoDrawable glad) {
+ public void init(final GLAutoDrawable glad) {
System.err.println(Thread.currentThread()+" RedSquareES2.init: tileRendererInUse "+tileRendererInUse);
final GL2ES2 gl = glad.getGL().getGL2ES2();
@@ -115,9 +116,9 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
// setup mgl_PMVMatrix
pmvMatrix = new PMVMatrix();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
st.ownUniform(pmvMatrixUniform);
@@ -144,7 +145,7 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
colors.enableBuffer(gl, false);
// OpenGL Render Settings
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
st.useProgram(gl, false);
t0 = System.currentTimeMillis();
@@ -152,8 +153,8 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
}
@Override
- public void display(GLAutoDrawable glad) {
- long t1 = System.currentTimeMillis();
+ public void display(final GLAutoDrawable glad) {
+ final long t1 = System.currentTimeMillis();
final GL2ES2 gl = glad.getGL().getGL2ES2();
if( clearBuffers ) {
@@ -169,11 +170,11 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
}
st.useProgram(gl, true);
// One rotation every four seconds
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrix.glTranslatef(0, 0, -10);
if(doRotate) {
- float ang = ((t1 - t0) * 360.0F) / 4000.0F;
+ final float ang = ((t1 - t0) * 360.0F) / 4000.0F;
pmvMatrix.glRotatef(ang, 0, 0, 1);
pmvMatrix.glRotatef(ang, 0, 1, 0);
}
@@ -189,7 +190,7 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
}
@Override
- public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
final GL2ES2 gl = glad.getGL().getGL2ES2();
if(-1 != swapInterval) {
gl.setSwapInterval(swapInterval);
@@ -198,15 +199,15 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
}
@Override
- public void reshapeTile(TileRendererBase tr,
- int tileX, int tileY, int tileWidth, int tileHeight,
- int imageWidth, int imageHeight) {
+ public void reshapeTile(final TileRendererBase tr,
+ final int tileX, final int tileY, final int tileWidth, final int tileHeight,
+ final int imageWidth, final int imageHeight) {
final GL2ES2 gl = tr.getAttachedDrawable().getGL().getGL2ES2();
gl.setSwapInterval(0);
reshapeImpl(gl, tileX, tileY, tileWidth, tileHeight, imageWidth, imageHeight);
}
- void reshapeImpl(GL2ES2 gl, int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight) {
+ void reshapeImpl(final GL2ES2 gl, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight) {
System.err.println(Thread.currentThread()+" RedSquareES2.reshape "+tileX+"/"+tileY+" "+tileWidth+"x"+tileHeight+" of "+imageWidth+"x"+imageHeight+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(gl.getContext().getGLDrawable().getHandle())+", tileRendererInUse "+tileRendererInUse);
// Thread.dumpStack();
if( !gl.hasGLSL() ) {
@@ -215,7 +216,7 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
st.useProgram(gl, true);
// Set location in front of camera
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
// compute projection parameters 'normal' perspective
@@ -247,7 +248,7 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
}
@Override
- public void dispose(GLAutoDrawable glad) {
+ public void dispose(final GLAutoDrawable glad) {
System.err.println(Thread.currentThread()+" RedSquareES2.dispose: tileRendererInUse "+tileRendererInUse);
final GL2ES2 gl = glad.getGL().getGL2ES2();
if( !gl.hasGLSL() ) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareMappedES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareMappedES2.java
index 113cbee26..35449b3bf 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareMappedES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareMappedES2.java
@@ -43,6 +43,7 @@ import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLBufferStorage;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.TileRendererListener {
private ShaderState st;
@@ -58,7 +59,7 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
private TileRendererBase tileRendererInUse = null;
private boolean doRotateBeforePrinting;
- public RedSquareMappedES2(int swapInterval) {
+ public RedSquareMappedES2(final int swapInterval) {
this.swapInterval = swapInterval;
}
@@ -67,31 +68,31 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
}
@Override
- public void addTileRendererNotify(TileRendererBase tr) {
+ public void addTileRendererNotify(final TileRendererBase tr) {
tileRendererInUse = tr;
doRotateBeforePrinting = doRotate;
setDoRotation(false);
}
@Override
- public void removeTileRendererNotify(TileRendererBase tr) {
+ public void removeTileRendererNotify(final TileRendererBase tr) {
tileRendererInUse = null;
setDoRotation(doRotateBeforePrinting);
}
@Override
- public void startTileRendering(TileRendererBase tr) {
+ public void startTileRendering(final TileRendererBase tr) {
System.err.println("RedSquareES2.startTileRendering: "+tr);
}
@Override
- public void endTileRendering(TileRendererBase tr) {
+ public void endTileRendering(final TileRendererBase tr) {
System.err.println("RedSquareES2.endTileRendering: "+tr);
}
- public void setAspect(float aspect) { this.aspect = aspect; }
- public void setDoRotation(boolean rotate) { this.doRotate = rotate; }
- public void setClearBuffers(boolean v) { clearBuffers = v; }
+ public void setAspect(final float aspect) { this.aspect = aspect; }
+ public void setDoRotation(final boolean rotate) { this.doRotate = rotate; }
+ public void setClearBuffers(final boolean v) { clearBuffers = v; }
@Override
- public void init(GLAutoDrawable glad) {
+ public void init(final GLAutoDrawable glad) {
System.err.println(Thread.currentThread()+" RedSquareES2.init: tileRendererInUse "+tileRendererInUse);
final GL2ES2 gl = glad.getGL().getGL2ES2();
@@ -118,9 +119,9 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
// setup mgl_PMVMatrix
pmvMatrix = new PMVMatrix();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
st.ownUniform(pmvMatrixUniform);
@@ -163,7 +164,7 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
colors.enableBuffer(gl, false);
// OpenGL Render Settings
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
st.useProgram(gl, false);
t0 = System.currentTimeMillis();
@@ -171,8 +172,8 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
}
@Override
- public void display(GLAutoDrawable glad) {
- long t1 = System.currentTimeMillis();
+ public void display(final GLAutoDrawable glad) {
+ final long t1 = System.currentTimeMillis();
final GL2ES2 gl = glad.getGL().getGL2ES2();
if( clearBuffers ) {
@@ -188,11 +189,11 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
}
st.useProgram(gl, true);
// One rotation every four seconds
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrix.glTranslatef(0, 0, -10);
if(doRotate) {
- float ang = ((t1 - t0) * 360.0F) / 4000.0F;
+ final float ang = ((t1 - t0) * 360.0F) / 4000.0F;
pmvMatrix.glRotatef(ang, 0, 0, 1);
pmvMatrix.glRotatef(ang, 0, 1, 0);
}
@@ -208,7 +209,7 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
}
@Override
- public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
final GL2ES2 gl = glad.getGL().getGL2ES2();
if(-1 != swapInterval) {
gl.setSwapInterval(swapInterval);
@@ -217,15 +218,15 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
}
@Override
- public void reshapeTile(TileRendererBase tr,
- int tileX, int tileY, int tileWidth, int tileHeight,
- int imageWidth, int imageHeight) {
+ public void reshapeTile(final TileRendererBase tr,
+ final int tileX, final int tileY, final int tileWidth, final int tileHeight,
+ final int imageWidth, final int imageHeight) {
final GL2ES2 gl = tr.getAttachedDrawable().getGL().getGL2ES2();
gl.setSwapInterval(0);
reshapeImpl(gl, tileX, tileY, tileWidth, tileHeight, imageWidth, imageHeight);
}
- void reshapeImpl(GL2ES2 gl, int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight) {
+ void reshapeImpl(final GL2ES2 gl, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight) {
System.err.println(Thread.currentThread()+" RedSquareES2.reshape "+tileX+"/"+tileY+" "+tileWidth+"x"+tileHeight+" of "+imageWidth+"x"+imageHeight+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(gl.getContext().getGLDrawable().getHandle())+", tileRendererInUse "+tileRendererInUse);
// Thread.dumpStack();
if( !gl.hasGLSL() ) {
@@ -234,7 +235,7 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
st.useProgram(gl, true);
// Set location in front of camera
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
// compute projection parameters 'normal' perspective
@@ -266,7 +267,7 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
}
@Override
- public void dispose(GLAutoDrawable glad) {
+ public void dispose(final GLAutoDrawable glad) {
System.err.println(Thread.currentThread()+" RedSquareES2.dispose: tileRendererInUse "+tileRendererInUse);
final GL2ES2 gl = glad.getGL().getGL2ES2();
if( !gl.hasGLSL() ) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java
index fb30ef6b5..9e643ded6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java
@@ -65,18 +65,18 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
* @param td
* @param textureUnit of range [0..]
*/
- public TextureDraw01ES2Listener(TextureData td, int textureUnit) {
+ public TextureDraw01ES2Listener(final TextureData td, final int textureUnit) {
this.textureData = td;
this.textureUnit = textureUnit;
this.keepTextureBound = false;
}
- public void setClearColor(float[] clearColor) {
+ public void setClearColor(final float[] clearColor) {
this.clearColor = clearColor;
}
@Override
- public void setKeepTextureBound(boolean v) {
+ public void setKeepTextureBound(final boolean v) {
this.keepTextureBound = v;
}
@Override
@@ -101,17 +101,17 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
static final String shaderBasename = "texture01_xxx";
- private void initShader(GL2ES2 gl, boolean use_program) {
+ private void initShader(final GL2ES2 gl, final boolean use_program) {
// Create & Compile the shader objects
- ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
+ final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
"shader", "shader/bin", shaderBasename, true);
- ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
+ final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
"shader", "shader/bin", shaderBasename, true);
rsVp.defaultShaderCustomization(gl, true, true);
rsFp.defaultShaderCustomization(gl, true, true);
// Create & Link the shader program
- ShaderProgram sp = new ShaderProgram();
+ final ShaderProgram sp = new ShaderProgram();
sp.add(rsVp);
sp.add(rsFp);
if(!sp.link(gl, System.err)) {
@@ -124,19 +124,19 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
}
@Override
- public void init(GLAutoDrawable glad) {
+ public void init(final GLAutoDrawable glad) {
if(null!=textureData) {
this.texture = TextureIO.newTexture(glad.getGL(), textureData);
}
- GL2ES2 gl = glad.getGL().getGL2ES2();
+ final GL2ES2 gl = glad.getGL().getGL2ES2();
initShader(gl, true);
// setup mgl_PMVMatrix
pmvMatrix = new PMVMatrix();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
@@ -158,7 +158,7 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
//interleavedVBO.addGLSLSubArray("mgl_Normal", 3, GL.GL_ARRAY_BUFFER);
interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
- FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
+ final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
for(int i=0; i<4; i++) {
ib.put(s_quadVertices, i*3, 3);
@@ -173,7 +173,7 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
// OpenGL Render Settings
gl.glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
if( keepTextureBound && null != texture ) {
gl.glActiveTexture(GL.GL_TEXTURE0 + textureUnit);
@@ -184,8 +184,8 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
// Clear background to white
gl.glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
@@ -204,8 +204,8 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
}
@Override
- public void dispose(GLAutoDrawable drawable) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ public void dispose(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
if(null!=texture) {
texture.disable(gl);
texture.destroy(gl);
@@ -221,8 +221,8 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
}
@Override
- public void display(GLAutoDrawable drawable) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java
index da9281207..18cb35929 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java
@@ -138,7 +138,7 @@ public class TextureDraw02ES2ListenerFBO implements GLEventListener {
st.useProgram(gl, false);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
}
private void initFBOs(final GL gl, final int width, final int height) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
index b86dbb603..b49fa182a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
@@ -57,7 +57,7 @@ import com.jogamp.opengl.util.texture.TextureSequence;
import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
public class TextureSequenceCubeES2 implements GLEventListener {
- public TextureSequenceCubeES2 (TextureSequence texSource, boolean innerCube, float zoom0, float rotx, float roty) {
+ public TextureSequenceCubeES2 (final TextureSequence texSource, final boolean innerCube, final float zoom0, final float rotx, final float roty) {
this.texSeq = texSource;
this.innerCube = innerCube;
this.zoom = zoom0;
@@ -84,26 +84,26 @@ public class TextureSequenceCubeES2 implements GLEventListener {
int ly = 0;
boolean first = false;
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
first = true;
}
- public void mouseMoved(MouseEvent e) {
+ public void mouseMoved(final MouseEvent e) {
first = false;
}
- public void mouseDragged(MouseEvent e) {
+ public void mouseDragged(final MouseEvent e) {
int width, height;
- Object source = e.getSource();
+ final Object source = e.getSource();
Window window = null;
if(source instanceof Window) {
window = (Window) source;
width=window.getSurfaceWidth();
height=window.getSurfaceHeight();
} else if (source instanceof GLAutoDrawable) {
- GLAutoDrawable glad = (GLAutoDrawable) source;
+ final GLAutoDrawable glad = (GLAutoDrawable) source;
width = glad.getSurfaceWidth();
height = glad.getSurfaceHeight();
} else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) {
- java.awt.Component comp = (java.awt.Component) source;
+ final java.awt.Component comp = (java.awt.Component) source;
width=comp.getWidth(); // FIXME HiDPI: May need to convert window units -> pixel units!
height=comp.getHeight();
} else {
@@ -116,8 +116,8 @@ public class TextureSequenceCubeES2 implements GLEventListener {
first=false;
return;
}
- int nv = Math.abs(e.getY(0)-e.getY(1));
- int dy = nv - lx;
+ final int nv = Math.abs(e.getY(0)-e.getY(1));
+ final int dy = nv - lx;
{
final float o = zoom;
@@ -135,15 +135,15 @@ public class TextureSequenceCubeES2 implements GLEventListener {
first=false;
return;
}
- int nx = e.getX();
- int ny = e.getY();
+ final int nx = e.getX();
+ final int ny = e.getY();
view_roty += 360f * ( (float)( nx - lx ) / (float)width );
view_rotx += 360f * ( (float)( ny - ly ) / (float)height );
lx = nx;
ly = ny;
}
}
- public void mouseWheelMoved(MouseEvent e) {
+ public void mouseWheelMoved(final MouseEvent e) {
// System.err.println("XXX "+e);
if( !e.isShiftDown() ) {
final float o = zoom;
@@ -157,11 +157,11 @@ public class TextureSequenceCubeES2 implements GLEventListener {
static final String shaderBasename = "texsequence_xxx";
static final String myTextureLookupName = "myTexture2D";
- private void initShader(GL2ES2 gl) {
+ private void initShader(final GL2ES2 gl) {
// Create & Compile the shader objects
- ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
+ final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
"shader", "shader/bin", shaderBasename, true);
- ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
+ final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
"shader", "shader/bin", shaderBasename, true);
boolean preludeGLSLVersion = true;
@@ -192,7 +192,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
rsFp.insertShaderSource(0, "TEXTURE-SEQUENCE-CODE-BEGIN", 0, sFpIns);
// Create & Link the shader program
- ShaderProgram sp = new ShaderProgram();
+ final ShaderProgram sp = new ShaderProgram();
sp.add(rsVp);
sp.add(rsFp);
if(!sp.link(gl, System.err)) {
@@ -206,8 +206,8 @@ public class TextureSequenceCubeES2 implements GLEventListener {
GLArrayDataServer interleavedVBO, cubeIndicesVBO;
- public void init(GLAutoDrawable drawable) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ public void init(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
System.err.println(JoglVersion.getGLInfo(gl, null));
final TextureFrame frame = texSeq.getLastTexture();
if( null == frame ) {
@@ -232,7 +232,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
// calculate centered tex coords w/ aspect ratio
- float[] fixedCubeTexCoords = new float[s_cubeTexCoords.length];
+ final float[] fixedCubeTexCoords = new float[s_cubeTexCoords.length];
{
final float aspect = tex.getAspectRatio();
final TextureCoords tc = tex.getImageTexCoords();
@@ -264,7 +264,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
//interleavedVBO.addGLSLSubArray("mgl_Normal", 3, GL.GL_ARRAY_BUFFER);
interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
- FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
+ final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
for(int i=0; i<6*4; i++) {
ib.put(s_cubeVertices, i*3, 3);
@@ -286,7 +286,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
st.ownAttribute(cubeIndicesVBO, true);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
st.useProgram(gl, false);
@@ -304,8 +304,8 @@ public class TextureSequenceCubeES2 implements GLEventListener {
System.out.println(st);
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.glViewport(0, 0, width, height);
@@ -326,7 +326,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
}
- private void reshapePMV(int width, int height) {
+ private void reshapePMV(final int width, final int height) {
if(null != pmvMatrix) {
pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
@@ -347,8 +347,8 @@ public class TextureSequenceCubeES2 implements GLEventListener {
@Override
- public void dispose(GLAutoDrawable drawable) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ public void dispose(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
texSeq = null;
pmvMatrixUniform = null;
@@ -360,8 +360,8 @@ public class TextureSequenceCubeES2 implements GLEventListener {
}
@Override
- public void display(GLAutoDrawable drawable) {
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
if(innerCube) {
// Clear background to white
@@ -397,7 +397,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
}
}
cubeIndicesVBO.bindBuffer(gl, true); // keeps VBO binding
- gl.glDrawElements(GL2ES2.GL_TRIANGLES, cubeIndicesVBO.getElementCount() * cubeIndicesVBO.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+ gl.glDrawElements(GL.GL_TRIANGLES, cubeIndicesVBO.getElementCount() * cubeIndicesVBO.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
cubeIndicesVBO.bindBuffer(gl, false);
if(null != tex) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/CrossFadePlayer.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/CrossFadePlayer.java
index 02f62c415..e5e752d96 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/CrossFadePlayer.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/CrossFadePlayer.java
@@ -47,7 +47,7 @@ public class CrossFadePlayer
static GLMediaPlayer[] player;
static volatile boolean stop = false;
- public static void main(String[] args)
+ public static void main(final String[] args)
{
if(args.length==0) {
@@ -57,13 +57,13 @@ public class CrossFadePlayer
"and i will try CrossFade-play them all in parallel!");
}
- GLMediaEventListener mediaEventListener = new GLMediaEventListener()
+ final GLMediaEventListener mediaEventListener = new GLMediaEventListener()
{
@Override
- public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
+ public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) { }
@Override
- public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when)
+ public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when)
{
System.out.println("\n***\nEvent mask changed: " + event_mask);
System.out.println("Timestamp: "+ when);
@@ -80,7 +80,7 @@ public class CrossFadePlayer
if ( GLMediaPlayer.State.Paused == mp.getState() ) { // init OK
mp.play();
}
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@@ -126,7 +126,7 @@ public class CrossFadePlayer
// Initialize media players
player = new GLMediaPlayer[args.length];
int i=0;
- for( String arg: args ) {
+ for( final String arg: args ) {
player[i] = GLMediaPlayerFactory.createDefault();
if(player[i]!=null){
System.out.println("Created CrossFade player: "+ i + " " + player[i].getClass().getName());
@@ -137,18 +137,18 @@ public class CrossFadePlayer
System.out.println("No file selected: arg " + i +" = "+ filename);
player[i]=null;
} else {
- File file = new File(filename);
+ final File file = new File(filename);
if(!file.exists()){
System.out.println("File do not exist");
} else {
- URI uri = file.toURI();
+ final URI uri = file.toURI();
System.out.println("State of player "+ i +": " + player[i].getState().toString());
System.out.println("...initializing stream "+ i +"...");
player[i].initStream(uri, GLMediaPlayer.STREAM_ID_NONE, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.TEXTURE_COUNT_DEFAULT);
}
}
- } catch (Exception e1) {
+ } catch (final Exception e1) {
e1.printStackTrace();
}
} else {
@@ -159,17 +159,17 @@ public class CrossFadePlayer
// Main thread CrossFade until playback is done
- long startTime = com.jogamp.common.os.Platform.currentTimeMillis();
- double piPlayers = Math.PI*2.0f/args.length;
+ final long startTime = com.jogamp.common.os.Platform.currentTimeMillis();
+ final double piPlayers = Math.PI*2.0f/args.length;
StreamException se = null;
while( null == se && stop == false ) {
try {
Thread.sleep(100);
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
// Find out the longest duration...
float maxDuration = 1000.0f ;
- for(GLMediaPlayer p: player) {
+ for(final GLMediaPlayer p: player) {
if(p!=null){
if( p.getDuration() > maxDuration) {
maxDuration = p.getDuration();
@@ -178,15 +178,15 @@ public class CrossFadePlayer
}
// tune the volume on players to crossfade!
- float progress = (com.jogamp.common.os.Platform.currentTimeMillis()-startTime)/maxDuration;
+ final float progress = (com.jogamp.common.os.Platform.currentTimeMillis()-startTime)/maxDuration;
i = 0;
- for(GLMediaPlayer p: player){
+ for(final GLMediaPlayer p: player){
if(p!=null){
- AudioSink sink = p.getAudioSink();
+ final AudioSink sink = p.getAudioSink();
if(sink != null){
- float volume = (float) (0.5f+(0.5f*(Math.cos(40.0f*progress+(piPlayers*i)))));
- float playbacktime = com.jogamp.common.os.Platform.currentTimeMillis()-startTime;
+ final float volume = (float) (0.5f+(0.5f*(Math.cos(40.0f*progress+(piPlayers*i)))));
+ final float playbacktime = com.jogamp.common.os.Platform.currentTimeMillis()-startTime;
// System.out.println("player: "+ i +" volume = " + volume +" progress = "+ progress +" time = "+ playbacktime + " / duration = " + maxDuration);
sink.setVolume(volume);
}
@@ -202,7 +202,7 @@ public class CrossFadePlayer
}
}
- for(GLMediaPlayer p: player) {
+ for(final GLMediaPlayer p: player) {
if(p!=null)
p.destroy(null);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index 42c1234da..607bfd1b0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -88,7 +88,7 @@ public class MovieCube implements GLEventListener {
// Blender's Big Buck Bunny Trailer: 24f 640p VP8, Vorbis 44100Hz mono, WebM/Matroska Stream.
// _defURI = new URI("http://video.webmfiles.org/big-buck-bunny_trailer.webm");
_defURI = new URI("http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
- } catch (URISyntaxException e) {
+ } catch (final URISyntaxException e) {
e.printStackTrace();
}
defURI = _defURI;
@@ -107,10 +107,10 @@ public class MovieCube implements GLEventListener {
mPlayer.addEventListener(new GLMediaEventListener() {
@Override
- public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
+ public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) { }
@Override
- public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+ public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
System.err.println("MovieCube AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
System.err.println("MovieCube State: "+mp);
if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) ) {
@@ -131,7 +131,7 @@ public class MovieCube implements GLEventListener {
while( null == se && GLMediaPlayer.State.Initialized != mPlayer.getState() ) {
try {
Thread.sleep(16);
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
se = mPlayer.getStreamException();
}
if( null != se ) {
@@ -143,7 +143,7 @@ public class MovieCube implements GLEventListener {
/**
* Custom constructor, user needs to issue {@link #initStream(URI, int, int, int)} afterwards.
*/
- public MovieCube(float zoom0, float rotx, float roty, boolean showText) throws IOException {
+ public MovieCube(final float zoom0, final float rotx, final float roty, final boolean showText) throws IOException {
this.zoom0 = zoom0;
this.rotx = rotx;
this.roty = roty;
@@ -151,12 +151,12 @@ public class MovieCube implements GLEventListener {
mPlayer = GLMediaPlayerFactory.createDefault();
}
- public void initStream(URI streamLoc, int vid, int aid, int textureCount) {
+ public void initStream(final URI streamLoc, final int vid, final int aid, final int textureCount) {
mPlayer.initStream(streamLoc, vid, aid, textureCount);
System.out.println("pC.1b "+mPlayer);
}
- public void setSwapInterval(int v) { this.swapInterval = v; }
+ public void setSwapInterval(final int v) { this.swapInterval = v; }
public GLMediaPlayer getGLMediaPlayer() { return mPlayer; }
@@ -191,7 +191,7 @@ public class MovieCube implements GLEventListener {
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
// non-exclusive mode!
this.setSharedPMVMatrix(cube.pmvMatrix);
super.init(drawable);
@@ -208,7 +208,7 @@ public class MovieCube implements GLEventListener {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
if( null != regionFPS ) {
regionFPS.destroy(drawable.getGL().getGL2ES2());
}
@@ -216,7 +216,7 @@ public class MovieCube implements GLEventListener {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GLAnimatorControl anim = drawable.getAnimator();
final float lfps = null != anim ? anim.getLastFPS() : 0f;
final float tfps = null != anim ? anim.getTotalFPS() : 0f;
@@ -270,7 +270,7 @@ public class MovieCube implements GLEventListener {
private boolean displayOSD = true;
private final KeyListener keyAction = new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( e.isAutoRepeat() ) {
return;
}
@@ -345,7 +345,7 @@ public class MovieCube implements GLEventListener {
};
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
if(null == mPlayer) {
throw new InternalError("mPlayer null");
}
@@ -357,7 +357,7 @@ public class MovieCube implements GLEventListener {
}
resetGLState = false;
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
System.err.println(JoglVersion.getGLInfo(gl, null));
cube = new TextureSequenceCubeES2(mPlayer, false, zoom0, rotx, roty);
@@ -369,7 +369,7 @@ public class MovieCube implements GLEventListener {
if( GLMediaPlayer.State.Initialized == mPlayer.getState() ) {
try {
mPlayer.initGL(gl);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
if(null != mPlayer) {
mPlayer.destroy(gl);
@@ -400,13 +400,13 @@ public class MovieCube implements GLEventListener {
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
if(null == mPlayer) { return; }
cube.reshape(drawable, x, y, width, height);
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
System.err.println(Thread.currentThread()+" MovieCube.dispose ... ");
if( null != textRendererGLEL ) {
drawable.disposeGLEventListener(textRendererGLEL, true);
@@ -415,7 +415,7 @@ public class MovieCube implements GLEventListener {
disposeImpl(drawable, true);
}
- private void disposeImpl(GLAutoDrawable drawable, boolean disposePlayer) {
+ private void disposeImpl(final GLAutoDrawable drawable, final boolean disposePlayer) {
if(null == mPlayer) { return; }
final Object upstreamWidget = drawable.getUpstreamWidget();
if (upstreamWidget instanceof Window) {
@@ -433,7 +433,7 @@ public class MovieCube implements GLEventListener {
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
if(-1 != swapInterval) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
@@ -459,7 +459,7 @@ public class MovieCube implements GLEventListener {
cube.display(drawable);
}
- public static void main(String[] args) throws IOException, InterruptedException, URISyntaxException {
+ public static void main(final String[] args) throws IOException, InterruptedException, URISyntaxException {
int swapInterval = 1;
int width = 800;
int height = 600;
@@ -557,7 +557,7 @@ public class MovieCube implements GLEventListener {
final GLWindow window = GLWindow.create(caps);
final Animator anim = new Animator(window);
window.addWindowListener(new WindowAdapter() {
- public void windowDestroyed(WindowEvent e) {
+ public void windowDestroyed(final WindowEvent e) {
anim.stop();
}
});
@@ -568,11 +568,11 @@ public class MovieCube implements GLEventListener {
mc.mPlayer.addEventListener(new GLMediaEventListener() {
@Override
- public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
+ public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) {
}
@Override
- public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+ public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
System.err.println("MovieCube AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
System.err.println("MovieCube State: "+mp);
if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) ) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index 7b6dd162a..8760cd2c3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -129,7 +129,7 @@ public class MovieSimple implements GLEventListener {
// Blender's Big Buck Bunny Trailer: 24f 640p VP8, Vorbis 44100Hz mono, WebM/Matroska Stream.
// _defURI = new URI("http://video.webmfiles.org/big-buck-bunny_trailer.webm");
_defURI = new URI("http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
- } catch (URISyntaxException e) {
+ } catch (final URISyntaxException e) {
e.printStackTrace();
}
defURI = _defURI;
@@ -159,12 +159,12 @@ public class MovieSimple implements GLEventListener {
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
super.init(drawable);
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
if( null != regionFPS ) {
regionFPS.destroy(drawable.getGL().getGL2ES2());
}
@@ -172,7 +172,7 @@ public class MovieSimple implements GLEventListener {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GLAnimatorControl anim = drawable.getAnimator();
final float lfps = null != anim ? anim.getLastFPS() : 0f;
final float tfps = null != anim ? anim.getTotalFPS() : 0f;
@@ -212,7 +212,7 @@ public class MovieSimple implements GLEventListener {
private boolean displayOSD = true;
private final MouseListener mouseAction = new MouseAdapter() {
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
if(e.getY()<=surfHeight/2 && null!=mPlayer && 1 == e.getClickCount()) {
if(GLMediaPlayer.State.Playing == mPlayer.getState()) {
mPlayer.pause(false);
@@ -221,20 +221,20 @@ public class MovieSimple implements GLEventListener {
}
}
}
- public void mouseReleased(MouseEvent e) {
+ public void mouseReleased(final MouseEvent e) {
if(e.getY()<=surfHeight/2) {
rotate = -1;
zoom = zoom0;
System.err.println("zoom: "+zoom);
}
}
- public void mouseMoved(MouseEvent e) {
+ public void mouseMoved(final MouseEvent e) {
prevMouseX = e.getX();
// prevMouseY = e.getY();
}
- public void mouseDragged(MouseEvent e) {
- int x = e.getX();
- int y = e.getY();
+ public void mouseDragged(final MouseEvent e) {
+ final int x = e.getX();
+ final int y = e.getY();
if(y>surfHeight/2) {
final float dp = (float)(x-prevMouseX)/(float)surfWidth;
@@ -249,7 +249,7 @@ public class MovieSimple implements GLEventListener {
prevMouseX = x;
// prevMouseY = y;
}
- public void mouseWheelMoved(MouseEvent e) {
+ public void mouseWheelMoved(final MouseEvent e) {
if( !e.isShiftDown() ) {
zoom += e.getRotation()[1]/10f; // vertical: wheel
System.err.println("zoom: "+zoom);
@@ -257,7 +257,7 @@ public class MovieSimple implements GLEventListener {
} };
private final KeyListener keyAction = new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( e.isAutoRepeat() ) {
return;
}
@@ -343,10 +343,10 @@ public class MovieSimple implements GLEventListener {
mPlayer.addEventListener(new GLMediaEventListener() {
@Override
- public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
+ public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) { }
@Override
- public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+ public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
System.err.println("MovieCube AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
System.err.println("MovieCube State: "+mp);
if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) ) {
@@ -367,7 +367,7 @@ public class MovieSimple implements GLEventListener {
while( null == se && GLMediaPlayer.State.Initialized != mPlayer.getState() ) {
try {
Thread.sleep(16);
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
se = mPlayer.getStreamException();
}
if( null != se ) {
@@ -377,7 +377,7 @@ public class MovieSimple implements GLEventListener {
}
/** Custom constructor, user needs to issue {@link #initStream(URI, int, int, int)} afterwards. */
- public MovieSimple(GLMediaPlayer sharedMediaPlayer) throws IllegalStateException {
+ public MovieSimple(final GLMediaPlayer sharedMediaPlayer) throws IllegalStateException {
mPlayer = sharedMediaPlayer;
mPlayerScaleOrig = false;
mPlayerShared = null != mPlayer;
@@ -388,26 +388,26 @@ public class MovieSimple implements GLEventListener {
System.out.println("pC.1a shared "+mPlayerShared+", "+mPlayer);
}
- public void initStream(URI streamLoc, int vid, int aid, int textureCount) {
+ public void initStream(final URI streamLoc, final int vid, final int aid, final int textureCount) {
mPlayer.initStream(streamLoc, vid, aid, textureCount);
System.out.println("pC.1b "+mPlayer);
}
- public void setSwapInterval(int v) { this.swapInterval = v; }
+ public void setSwapInterval(final int v) { this.swapInterval = v; }
public GLMediaPlayer getGLMediaPlayer() { return mPlayer; }
- public void setScaleOrig(boolean v) {
+ public void setScaleOrig(final boolean v) {
mPlayerScaleOrig = v;
}
/** defaults to true */
- public void setOrthoProjection(boolean v) { orthoProjection=v; }
+ public void setOrthoProjection(final boolean v) { orthoProjection=v; }
public boolean getOrthoProjection() { return orthoProjection; }
- public boolean hasEffect(int e) { return 0 != ( effects & e ) ; }
- public void setEffects(int e) { effects = e; };
- public void setTransparency(float alpha) {
+ public boolean hasEffect(final int e) { return 0 != ( effects & e ) ; }
+ public void setEffects(final int e) { effects = e; };
+ public void setTransparency(final float alpha) {
this.effects |= EFFECT_TRANSPARENT;
this.alpha = alpha;
}
@@ -416,11 +416,11 @@ public class MovieSimple implements GLEventListener {
resetGLState = true;
}
- private void initShader(GL2ES2 gl) {
+ private void initShader(final GL2ES2 gl) {
// Create & Compile the shader objects
- ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MovieSimple.class,
+ final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MovieSimple.class,
"../shader", "../shader/bin", shaderBasename, true);
- ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, MovieSimple.class,
+ final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, MovieSimple.class,
"../shader", "../shader/bin", shaderBasename, true);
boolean preludeGLSLVersion = true;
@@ -451,7 +451,7 @@ public class MovieSimple implements GLEventListener {
rsFp.insertShaderSource(0, "TEXTURE-SEQUENCE-CODE-BEGIN", 0, sFpIns);
// Create & Link the shader program
- ShaderProgram sp = new ShaderProgram();
+ final ShaderProgram sp = new ShaderProgram();
sp.add(rsVp);
sp.add(rsFp);
if(!sp.link(gl, System.err)) {
@@ -464,7 +464,7 @@ public class MovieSimple implements GLEventListener {
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
if(null == mPlayer) {
throw new InternalError("mPlayer null");
}
@@ -478,7 +478,7 @@ public class MovieSimple implements GLEventListener {
zoom1 = orthoProjection ? 0f : -5f;
zoom = zoom0;
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
System.err.println(JoglVersion.getGLInfo(gl, null));
System.err.println("Alpha: "+alpha+", opaque "+drawable.getChosenGLCapabilities().isBackgroundOpaque()+
", "+drawable.getClass().getName()+", "+drawable);
@@ -511,7 +511,7 @@ public class MovieSimple implements GLEventListener {
if(!mPlayerShared) {
mPlayer.setTextureMinMagFilter( new int[] { GL.GL_NEAREST, GL.GL_LINEAR } );
}
- } catch (Exception glex) {
+ } catch (final Exception glex) {
glex.printStackTrace();
if(!mPlayerShared && null != mPlayer) {
mPlayer.destroy(gl);
@@ -526,7 +526,7 @@ public class MovieSimple implements GLEventListener {
// Push the 1st uniform down the path
st.useProgram(gl, true);
- int[] viewPort = new int[] { 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight()};
+ final int[] viewPort = new int[] { 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight()};
pmvMatrix = new PMVMatrix();
reshapePMV(viewPort[2], viewPort[3]);
pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
@@ -537,11 +537,11 @@ public class MovieSimple implements GLEventListener {
throw new GLException("Error setting mgl_ActiveTexture in shader: "+st);
}
- float dWidth = drawable.getSurfaceWidth();
- float dHeight = drawable.getSurfaceHeight();
- float mWidth = mPlayer.getWidth();
- float mHeight = mPlayer.getHeight();
- float mAspect = mWidth/mHeight;
+ final float dWidth = drawable.getSurfaceWidth();
+ final float dHeight = drawable.getSurfaceHeight();
+ final float mWidth = mPlayer.getWidth();
+ final float mHeight = mPlayer.getHeight();
+ final float mAspect = mWidth/mHeight;
System.err.println("XXX0: mov aspect: "+mAspect);
float xs, ys;
if(orthoProjection) {
@@ -563,8 +563,8 @@ public class MovieSimple implements GLEventListener {
{
System.err.println("XXX0: pixel LB: "+verts[0]+", "+verts[1]+", "+verts[2]);
System.err.println("XXX0: pixel RT: "+verts[3]+", "+verts[4]+", "+verts[5]);
- float[] winLB = new float[3];
- float[] winRT = new float[3];
+ final float[] winLB = new float[3];
+ final float[] winRT = new float[3];
pmvMatrix.gluProject(verts[0], verts[1], verts[2], viewPort, 0, winLB, 0);
pmvMatrix.gluProject(verts[3], verts[4], verts[5], viewPort, 0, winRT, 0);
System.err.println("XXX0: win LB: "+winLB[0]+", "+winLB[1]+", "+winLB[2]);
@@ -582,7 +582,7 @@ public class MovieSimple implements GLEventListener {
st.ownAttribute(interleavedVBO, true);
gl.glClearColor(0.3f, 0.3f, 0.3f, 0.3f);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
st.useProgram(gl, false);
@@ -611,7 +611,7 @@ public class MovieSimple implements GLEventListener {
drawable.addGLEventListener(textRendererGLEL);
}
- protected void updateInterleavedVBO(GL gl, Texture tex) {
+ protected void updateInterleavedVBO(final GL gl, final Texture tex) {
final float ss = 1f, ts = 1f; // scale tex-coord
final boolean wasEnabled = interleavedVBO.enabled();
interleavedVBO.seal(gl, false);
@@ -666,7 +666,7 @@ public class MovieSimple implements GLEventListener {
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
if(null == mPlayer) { return; }
surfWidth = width;
@@ -682,7 +682,7 @@ public class MovieSimple implements GLEventListener {
System.out.println("pR "+mPlayer);
}
- private void reshapePMV(int width, int height) {
+ private void reshapePMV(final int width, final int height) {
pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
if(orthoProjection) {
@@ -702,13 +702,13 @@ public class MovieSimple implements GLEventListener {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
drawable.disposeGLEventListener(textRendererGLEL, true);
textRendererGLEL = null;
disposeImpl(drawable, true);
}
- private void disposeImpl(GLAutoDrawable drawable, boolean disposePlayer) {
+ private void disposeImpl(final GLAutoDrawable drawable, final boolean disposePlayer) {
if(null == mPlayer) { return; }
final Object upstreamWidget = drawable.getUpstreamWidget();
@@ -719,7 +719,7 @@ public class MovieSimple implements GLEventListener {
}
System.out.println("pD.1 "+mPlayer+", disposePlayer "+disposePlayer);
- GL2ES2 gl = drawable.getGL().getGL2ES2();
+ final GL2ES2 gl = drawable.getGL().getGL2ES2();
if( disposePlayer ) {
if(!mPlayerShared) {
mPlayer.destroy(gl);
@@ -740,7 +740,7 @@ public class MovieSimple implements GLEventListener {
long lastPerfPos = 0;
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
if(-1 != swapInterval) {
gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
@@ -815,11 +815,11 @@ public class MovieSimple implements GLEventListener {
}
@Override
- public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
+ public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) {
}
@Override
- public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+ public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
System.err.println("MovieSimple AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
System.err.println("MovieSimple State: "+mp);
final GLWindow window = (GLWindow) mp.getAttachedObject(WINDOW_KEY);
@@ -908,7 +908,7 @@ public class MovieSimple implements GLEventListener {
static boolean loopEOS = false;
static boolean origSize;
- public static void main(String[] args) throws IOException, URISyntaxException {
+ public static void main(final String[] args) throws IOException, URISyntaxException {
int swapInterval = 1;
int width = 800;
int height = 600;
@@ -934,7 +934,7 @@ public class MovieSimple implements GLEventListener {
}
windowCount = _windowCount;
}
- String[] urls_s = new String[windowCount];
+ final String[] urls_s = new String[windowCount];
String file_s1=null, file_s2=null;
{
boolean _origSize = false;
@@ -997,7 +997,7 @@ public class MovieSimple implements GLEventListener {
if( null != urls_s[0] ) {
streamLoc0 = new URI(urls_s[0]);
} else if( null != file_s1 ) {
- File movieFile = new File(file_s1);
+ final File movieFile = new File(file_s1);
streamLoc0 = movieFile.toURI();
} else if( null != file_s2 ) {
streamLoc0 = IOUtil.toURISimple(new File(file_s2));
@@ -1038,7 +1038,7 @@ public class MovieSimple implements GLEventListener {
anim.start();
windows[i] = GLWindow.create(caps);
windows[i].addWindowListener(new WindowAdapter() {
- public void windowDestroyed(WindowEvent e) {
+ public void windowDestroyed(final WindowEvent e) {
anim.stop();
}
});
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas01.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas01.java
index 4cecd90a1..9866e769c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas01.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -61,7 +61,7 @@ public class Bug816AppletGLCanvas01 extends Applet implements GLEventListener {
public static JPanel appletHolder;
public static boolean isApplet = true;
- static public void main(String args[]) {
+ static public void main(final String args[]) {
Applet myApplet = null;
isApplet = false;
@@ -69,7 +69,7 @@ public class Bug816AppletGLCanvas01 extends Applet implements GLEventListener {
appletStarter(myApplet, "Bug861AppletGLCanvasTest01", 800, 600);
}
- static public void appletStarter(final Applet des, String frameName, int width, int height) {
+ static public void appletStarter(final Applet des, final String frameName, final int width, final int height) {
appletHolder = new JPanel();
if (frame != null) {
frame.dispose();
@@ -84,16 +84,16 @@ public class Bug816AppletGLCanvas01 extends Applet implements GLEventListener {
appletHolder.add(des);
frame.setVisible(true);
- int frameBorderSize = appletHolder.getLocationOnScreen().x - frame.getLocationOnScreen().x;
- int titleBarHeight = appletHolder.getLocationOnScreen().y - frame.getLocationOnScreen().y;
- int frameWidth = width + 2 * frameBorderSize;
- int frameHeight = height + titleBarHeight + frameBorderSize;
+ final int frameBorderSize = appletHolder.getLocationOnScreen().x - frame.getLocationOnScreen().x;
+ final int titleBarHeight = appletHolder.getLocationOnScreen().y - frame.getLocationOnScreen().y;
+ final int frameWidth = width + 2 * frameBorderSize;
+ final int frameHeight = height + titleBarHeight + frameBorderSize;
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(frameWidth, frameHeight);
frame.setVisible(true);
des.init();
frame.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
System.exit(0);
}
});
@@ -107,28 +107,28 @@ public class Bug816AppletGLCanvas01 extends Applet implements GLEventListener {
setBackground(Color.gray);
setLayout(null);
- GLProfile glp = GLProfile.getDefault();
- GLCapabilities caps = new GLCapabilities(glp);
- GLCanvas canvas = new GLCanvas((GLCapabilitiesImmutable) caps);
+ final GLProfile glp = GLProfile.getDefault();
+ final GLCapabilities caps = new GLCapabilities(glp);
+ final GLCanvas canvas = new GLCanvas(caps);
canvas.setBounds(50, 50, 200, 450);
canvas.addGLEventListener(this);
add(canvas);
}
- public void init(GLAutoDrawable gLAutoDrawable) {
- GL gl = gLAutoDrawable.getGL();
+ public void init(final GLAutoDrawable gLAutoDrawable) {
+ final GL gl = gLAutoDrawable.getGL();
gl.glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT);
gLAutoDrawable.swapBuffers();
}
- public void dispose(GLAutoDrawable glad) {
+ public void dispose(final GLAutoDrawable glad) {
}
- public void display(GLAutoDrawable glad) {
+ public void display(final GLAutoDrawable glad) {
}
- public void reshape(GLAutoDrawable glad, int i, int i1, int i2, int i3) {
+ public void reshape(final GLAutoDrawable glad, final int i, final int i1, final int i2, final int i3) {
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02a.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02a.java
index 3bbb423fd..6218edd50 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02a.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02a.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -62,7 +62,7 @@ public class Bug816AppletGLCanvas02a extends Applet {
}
private GLCanvas createCanvas() {
- GLCanvas canvas = new GLCanvas();
+ final GLCanvas canvas = new GLCanvas();
canvas.addGLEventListener(new GearsES2(1));
canvas.setSize(300, 300);
animator.add(canvas);
@@ -72,7 +72,7 @@ public class Bug816AppletGLCanvas02a extends Applet {
String currentThreadName() {
return Thread.currentThread().getName();
}
-
+
@Override
public void start() {
System.err.println("GearsApplet: start() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02b.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02b.java
index 87a7ea4f5..62eb8ea18 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02b.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02b.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -62,7 +62,7 @@ public class Bug816AppletGLCanvas02b extends Applet {
}
private GLCanvas createCanvas() {
- GLCanvas canvas = new GLCanvas();
+ final GLCanvas canvas = new GLCanvas();
canvas.addGLEventListener(new GearsES2(1));
canvas.setSize(300, 300);
animator.add(canvas);
@@ -72,7 +72,7 @@ public class Bug816AppletGLCanvas02b extends Applet {
String currentThreadName() {
return Thread.currentThread().getName();
}
-
+
@Override
public void start() {
System.err.println("GearsApplet: start() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java
index a0ce938fe..32122937e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -59,24 +59,24 @@ public class Bug816AppletOSXCALayerPos03a extends Applet {
@Override
public void init() {
System.err.println("GearsApplet: init() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
- GLProfile glp = GLProfile.getDefault();
+ final GLProfile glp = GLProfile.getDefault();
final GLCapabilities caps = new GLCapabilities(glp);
final GLCanvas glCanvas1 = new GLCanvas(caps);
glCanvas1.addGLEventListener(new GearsES2(1));
-
+
animator = new Animator();
animator.add(glCanvas1);
setLayout(new BorderLayout());
-
- // Build a GUI where the canvas 3D is located at top right of the frame
+
+ // Build a GUI where the canvas 3D is located at top right of the frame
// and can be resized with split panes dividers
- JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
- true, new JScrollPane(), glCanvas1);
+ final JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
+ true, new JScrollPane(), glCanvas1);
verticalSplitPane.setResizeWeight(0.5);
- JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
+ final JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
true, new JScrollPane(), verticalSplitPane);
horizontalSplitPane.setResizeWeight(0.5);
- JRootPane intermediateRootPane = new JRootPane();
+ final JRootPane intermediateRootPane = new JRootPane();
intermediateRootPane.setContentPane(horizontalSplitPane);
add(intermediateRootPane, BorderLayout.CENTER);
System.err.println("GearsApplet: init() - end [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
@@ -85,7 +85,7 @@ public class Bug816AppletOSXCALayerPos03a extends Applet {
String currentThreadName() {
return Thread.currentThread().getName();
}
-
+
@Override
public void start() {
System.err.println("GearsApplet: start() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03b.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03b.java
index 48dac25e8..491bc5fbc 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03b.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03b.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -57,24 +57,24 @@ public class Bug816AppletOSXCALayerPos03b extends JApplet {
@Override
public void init() {
System.err.println("GearsApplet: init() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
- GLProfile glp = GLProfile.getDefault();
+ final GLProfile glp = GLProfile.getDefault();
final GLCapabilities caps = new GLCapabilities(glp);
final GLCanvas glCanvas1 = new GLCanvas(caps);
glCanvas1.addGLEventListener(new GearsES2(1));
-
+
animator = new Animator();
animator.add(glCanvas1);
setSize(640, 480);
-
- // Build a GUI where the canvas 3D is located at top right of the frame
+
+ // Build a GUI where the canvas 3D is located at top right of the frame
// and can be resized with split panes dividers
- JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
- true, new JScrollPane(), glCanvas1);
+ final JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
+ true, new JScrollPane(), glCanvas1);
verticalSplitPane.setResizeWeight(0.5);
- JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
+ final JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
true, new JScrollPane(), verticalSplitPane);
horizontalSplitPane.setResizeWeight(0.5);
- JRootPane intermediateRootPane = new JRootPane();
+ final JRootPane intermediateRootPane = new JRootPane();
intermediateRootPane.setContentPane(horizontalSplitPane);
intermediateRootPane.setSize(640, 480);
this.add(intermediateRootPane);
@@ -84,7 +84,7 @@ public class Bug816AppletOSXCALayerPos03b extends JApplet {
String currentThreadName() {
return Thread.currentThread().getName();
}
-
+
@Override
public void start() {
System.err.println("GearsApplet: start() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java
index c3d40b71d..e85e84cf3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java
@@ -62,8 +62,8 @@ public class Bug848AppletGLCanvas01 extends Applet {
System.err.println("GearsApplet: init() - end [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
}
- private GLCanvas createCanvas(int vsyncI) {
- GLCanvas canvas = new GLCanvas();
+ private GLCanvas createCanvas(final int vsyncI) {
+ final GLCanvas canvas = new GLCanvas();
canvas.addGLEventListener(new GearsES2(vsyncI));
canvas.setSize(300, 300);
animators.add(new Animator(canvas));
@@ -77,7 +77,7 @@ public class Bug848AppletGLCanvas01 extends Applet {
@Override
public void start() {
System.err.println("GearsApplet: start() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
- for (GLAnimatorControl control : animators) {
+ for (final GLAnimatorControl control : animators) {
control.start();
control.setUpdateFPSFrames(60, System.err);
}
@@ -87,7 +87,7 @@ public class Bug848AppletGLCanvas01 extends Applet {
@Override
public void stop() {
System.err.println("GearsApplet: stop() - [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
- for (GLAnimatorControl control : animators) {
+ for (final GLAnimatorControl control : animators) {
control.stop();
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java
index 6fb972bb5..d8c4341a8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java
@@ -105,7 +105,7 @@ public class TestGearsES2AWT extends UITestCase {
public void run() {
awtEDT = Thread.currentThread();
} } );
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
Assert.assertNull(e);
}
@@ -126,7 +126,7 @@ public class TestGearsES2AWT extends UITestCase {
frame.pack();
}
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -140,7 +140,7 @@ public class TestGearsES2AWT extends UITestCase {
frame.validate();
}
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -163,7 +163,7 @@ public class TestGearsES2AWT extends UITestCase {
frame.setTitle("GLCanvas["+capsA+"], swapI "+swapInterval+", win: ["+b.x+"/"+b.y+" "+b.width+"x"+b.height+"], pix: "+glc.getSurfaceWidth()+"x"+glc.getSurfaceHeight());
}
- protected void runTestGL(final GLCapabilities caps, final ResizeBy resizeBy, FrameLayout frameLayout) throws InterruptedException, InvocationTargetException {
+ protected void runTestGL(final GLCapabilities caps, final ResizeBy resizeBy, final FrameLayout frameLayout) throws InterruptedException, InvocationTargetException {
final Frame frame = new Frame("GearsES2 AWT Test");
Assert.assertNotNull(frame);
@@ -197,7 +197,7 @@ public class TestGearsES2AWT extends UITestCase {
frame.add(glCanvas, BorderLayout.CENTER);
break;
case DoubleBorderCenterSurrounded:
- Container c = new Container();
+ final Container c = new Container();
c.setLayout(new BorderLayout());
c.add(new Button("north"), BorderLayout.NORTH);
c.add(new Button("south"), BorderLayout.SOUTH);
@@ -217,20 +217,20 @@ public class TestGearsES2AWT extends UITestCase {
frame.addComponentListener(new ComponentListener() {
@Override
- public void componentResized(ComponentEvent e) {
+ public void componentResized(final ComponentEvent e) {
setTitle(frame, glCanvas, caps);
}
@Override
- public void componentMoved(ComponentEvent e) {
+ public void componentMoved(final ComponentEvent e) {
setTitle(frame, glCanvas, caps);
}
@Override
- public void componentShown(ComponentEvent e) { }
+ public void componentShown(final ComponentEvent e) { }
@Override
- public void componentHidden(ComponentEvent e) { }
+ public void componentHidden(final ComponentEvent e) { }
});
final GearsES2 demo = new GearsES2(swapInterval);
@@ -414,11 +414,11 @@ public class TestGearsES2AWT extends UITestCase {
reqSurfacePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
reqSurfacePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
- GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
runTestGL(caps, resizeBy, frameLayout);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
boolean waitForKey = false;
int rw=-1, rh=-1;
@@ -507,11 +507,11 @@ public class TestGearsES2AWT extends UITestCase {
System.err.println("shallUseOffscreenPBufferLayer "+shallUseOffscreenPBufferLayer);
if(waitForKey) {
- BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
try {
System.err.println(stdin.readLine());
- } catch (IOException e) { }
+ } catch (final IOException e) { }
}
org.junit.runner.JUnitCore.main(TestGearsES2AWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java
index 551b27c3e..dd16b88cc 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java
@@ -100,7 +100,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
frame.validate();
}
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -142,20 +142,20 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
frame.addComponentListener(new ComponentListener() {
@Override
- public void componentResized(ComponentEvent e) {
+ public void componentResized(final ComponentEvent e) {
setTitle(frame, glJPanel, caps);
}
@Override
- public void componentMoved(ComponentEvent e) {
+ public void componentMoved(final ComponentEvent e) {
setTitle(frame, glJPanel, caps);
}
@Override
- public void componentShown(ComponentEvent e) { }
+ public void componentShown(final ComponentEvent e) { }
@Override
- public void componentHidden(ComponentEvent e) { }
+ public void componentHidden(final ComponentEvent e) { }
});
final FPSAnimator animator = useAnimator ? new FPSAnimator(glJPanel, 60) : null;
@@ -275,7 +275,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
} else {
glp = GLProfile.getGL2ES2();
}
- GLCapabilities caps = new GLCapabilities( glp );
+ final GLCapabilities caps = new GLCapabilities( glp );
if(useMSAA) {
caps.setNumSamples(4);
caps.setSampleBuffers(true);
@@ -296,7 +296,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setNumSamples(4);
caps.setSampleBuffers(true);
runTestGL(caps);
@@ -309,7 +309,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setPBuffer(true);
runTestGL(caps);
}
@@ -321,7 +321,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setNumSamples(4);
caps.setSampleBuffers(true);
caps.setPBuffer(true);
@@ -335,7 +335,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setBitmap(true);
runTestGL(caps);
}
@@ -347,7 +347,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setNumSamples(4);
caps.setSampleBuffers(true);
caps.setBitmap(true);
@@ -398,13 +398,13 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
reqSurfacePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
reqSurfacePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
runTestGL(caps);
}
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
int w=640, h=480, rw=-1, rh=-1;
for(int i=0; i<args.length; i++) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelsAWT.java
index e48fc783e..11d9da780 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelsAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelsAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.demos.es2.awt;
import java.awt.AWTException;
@@ -69,7 +69,7 @@ import com.jogamp.opengl.util.awt.AWTGLPixelBuffer.SingleAWTGLPixelBufferProvide
public class TestGearsES2GLJPanelsAWT extends UITestCase {
static int demoCount = 4;
static boolean jOpaque = false; // flicker-less w/o opaque, opaque leads to overdraw w/ mixed clipRects -> flicker - due to JComponent _paintImmediately(..) (?)
- static boolean glOpaque = true; // can be either ..
+ static boolean glOpaque = true; // can be either ..
static float glAlpha = 0.3f;
static boolean jZOrder = false;
static GLProfile glp;
@@ -81,13 +81,13 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
static boolean manualTest = false;
static boolean initSingleBuffer = false;
- /**
- * Even though GLJPanel uses a SingleAWTGLPixelBufferProvider per default,
- * we like to initialize it's size to a common maximum to ensure
+ /**
+ * Even though GLJPanel uses a SingleAWTGLPixelBufferProvider per default,
+ * we like to initialize it's size to a common maximum to ensure
* only one {@link AWTGLPixelBuffer} gets allocated.
*/
static SingleAWTGLPixelBufferProvider singleAWTGLPixelBufferProvider;
-
+
@BeforeClass
public static void initClass() {
if(GLProfile.isAvailable(GLProfile.GL2)) {
@@ -96,7 +96,7 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
} else {
setTestSupported(false);
}
-
+
if( initSingleBuffer ) {
singleAWTGLPixelBufferProvider = new SingleAWTGLPixelBufferProvider( glp.isGL2ES3() /* allowRowStride */);
singleAWTGLPixelBufferProvider.initSingleton(4, 600, 600, 1, true);
@@ -108,12 +108,12 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
@AfterClass
public static void releaseClass() {
}
-
+
final static boolean useInterPanel = true;
-
+
/** Adds new JPanel to frame's content pane at index 0 */
- private JComponent addPanel(GLCapabilitiesImmutable caps, GLAnimatorControl anim, final JFrame frame, boolean opaque, int x, int y, int w, int h, FloatBuffer color, float[] clearColor)
- throws InterruptedException, InvocationTargetException
+ private JComponent addPanel(final GLCapabilitiesImmutable caps, final GLAnimatorControl anim, final JFrame frame, final boolean opaque, final int x, final int y, final int w, final int h, final FloatBuffer color, final float[] clearColor)
+ throws InterruptedException, InvocationTargetException
{
final GLJPanel canvas = new GLJPanel(caps);
if( initSingleBuffer ) {
@@ -127,7 +127,7 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
if( caps.isBitmap() ) {
demo = new Gears(swapInterval);
} else {
- GearsES2 gdemo = new GearsES2(swapInterval);
+ final GearsES2 gdemo = new GearsES2(swapInterval);
gdemo.setIgnoreFocus(true);
gdemo.setGearsColors(color, color, color);
gdemo.setClearColor(clearColor);
@@ -145,12 +145,12 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
panel.setBounds(x, y, w, h);
panel.setOpaque(opaque);
text = new JTextField(x+"/"+y+" "+w+"x"+h);
- text.setOpaque(true);
+ text.setOpaque(true);
} else {
panel = null;
text = null;
}
-
+
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
if ( useInterPanel ) {
@@ -164,7 +164,7 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
return useInterPanel ? panel : canvas;
}
- public static final FloatBuffer red = Buffers.newDirectFloatBuffer( new float[] { 1.0f, 0.0f, 0.0f, 1.0f } );
+ public static final FloatBuffer red = Buffers.newDirectFloatBuffer( new float[] { 1.0f, 0.0f, 0.0f, 1.0f } );
public static final FloatBuffer green = Buffers.newDirectFloatBuffer( new float[] { 0.0f, 1.0f, 0.0f, 1.0f } );
public static final FloatBuffer blue = Buffers.newDirectFloatBuffer( new float[] { 0.0f, 0.0f, 1.0f, 1.0f } );
public static final FloatBuffer yellow = Buffers.newDirectFloatBuffer( new float[] { 1.0f, 1.0f, 0.0f, 1.0f } );
@@ -175,43 +175,43 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
public static final float[] blueish = new float[] { 0.0f, 0.0f, grayf, glAlpha };
public static final float[] yellowish = new float[] { grayf, grayf, 0.0f, glAlpha };
public static final float[] greyish = new float[] { grayf, grayf, grayf, glAlpha };
-
- protected void relayout(Container cont, float oW, float oH) {
+
+ protected void relayout(final Container cont, final float oW, final float oH) {
final int count = cont.getComponentCount();
final int nW = cont.getWidth();
final int nH = cont.getHeight();
for(int i = 0 ; i < count; i++ ) {
final Component comp = cont.getComponent(i);
- float fx = comp.getX() / oW;
- float fy = comp.getY() / oH;
- float fw = comp.getWidth() / oW;
- float fh = comp.getHeight() / oH;
+ final float fx = comp.getX() / oW;
+ final float fy = comp.getY() / oH;
+ final float fw = comp.getWidth() / oW;
+ final float fh = comp.getHeight() / oH;
comp.setBounds( (int)(fx * nW), (int)(fy * nH), (int)(fw * nW), (int)(fh * nH) );
}
}
-
- protected void runTestGL(GLCapabilities caps)
+
+ protected void runTestGL(final GLCapabilities caps)
throws AWTException, InterruptedException, InvocationTargetException
{
if( !glOpaque ) {
caps.setAlphaBits(caps.getRedBits());
}
-
+
final JFrame frame = new JFrame("Swing GLJPanel");
Assert.assertNotNull(frame);
-
+
final FPSAnimator animator = useAnimator ? new FPSAnimator(60) : null;
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.getContentPane().setLayout(null);
} } );
-
+
final float[] oldSize = new float[] { 600f, 600f };
-
+
frame.addComponentListener(new ComponentAdapter() {
@Override
- public void componentResized(ComponentEvent e) {
+ public void componentResized(final ComponentEvent e) {
final int count = frame.getComponentCount();
for(int i = 0 ; i < count; i++ ) {
relayout(frame.getContentPane(), oldSize[0], oldSize[1]);
@@ -243,7 +243,7 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
cont.setComponentZOrder(cont.getComponent(i), count - 1 - i);
}
}
-
+
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setSize((int)oldSize[0], (int)oldSize[1]);
@@ -258,7 +258,7 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
Assert.assertEquals(true, animator.isAnimating());
}
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
final long t0 = System.currentTimeMillis();
long t1 = t0;
@@ -287,7 +287,7 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
public void test01_DefaultNorm()
throws AWTException, InterruptedException, InvocationTargetException
{
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
if(useMSAA) {
caps.setNumSamples(4);
caps.setSampleBuffers(true);
@@ -308,12 +308,12 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setNumSamples(4);
caps.setSampleBuffers(true);
runTestGL(caps);
}
-
+
@Test
public void test03_PbufferNorm()
throws AWTException, InterruptedException, InvocationTargetException
@@ -321,11 +321,11 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setPBuffer(true);
runTestGL(caps);
}
-
+
@Test
public void test04_PbufferMsaa()
throws AWTException, InterruptedException, InvocationTargetException
@@ -333,13 +333,13 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setNumSamples(4);
caps.setSampleBuffers(true);
caps.setPBuffer(true);
runTestGL(caps);
}
-
+
@Test
public void test05_BitmapNorm()
throws AWTException, InterruptedException, InvocationTargetException
@@ -347,11 +347,11 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setBitmap(true);
runTestGL(caps);
}
-
+
@Test
public void test06_BitmapMsaa()
throws AWTException, InterruptedException, InvocationTargetException
@@ -359,16 +359,16 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setNumSamples(4);
caps.setSampleBuffers(true);
caps.setBitmap(true);
runTestGL(caps);
}
-
+
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
@@ -415,8 +415,8 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
System.err.println("shallUsePBuffer "+shallUsePBuffer);
System.err.println("shallUseBitmap "+shallUseBitmap);
System.err.println("manualTest "+manualTest);
- System.err.println("useSingleBuffer "+initSingleBuffer);
-
+ System.err.println("useSingleBuffer "+initSingleBuffer);
+
org.junit.runner.JUnitCore.main(TestGearsES2GLJPanelsAWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestElektronenMultipliziererNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestElektronenMultipliziererNEWT.java
index 6c4885308..2d334e837 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestElektronenMultipliziererNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestElektronenMultipliziererNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.demos.es2.newt;
import com.jogamp.newt.event.KeyAdapter;
@@ -66,17 +66,17 @@ public class TestElektronenMultipliziererNEWT extends UITestCase {
static final int desiredFrameRate = 30;
static int startFrame = 1700;
static long duration = 5000; // ms
-
+
@BeforeClass
public static void initClass() {
- GLProfile glp = GLProfile.getDefault();
+ final GLProfile glp = GLProfile.getDefault();
if( ! ( glp.isHardwareRasterizer() && glp.isGL2ES3() ) ) {
// Sorry .. mobile ES2 is too slow for this one.
setTestSupported(false);
return;
}
}
-
+
protected void run() throws InterruptedException {
final ElektronenMultiplizierer demo = new ElektronenMultiplizierer(
tRoutineClassName,
@@ -85,17 +85,17 @@ public class TestElektronenMultipliziererNEWT extends UITestCase {
tFrameCapture,
tFrameSkip, desiredFrameRate, startFrame
);
- GLCapabilitiesImmutable caps = demo.getGLCapabilities();
-
- GLWindow glWindow = GLWindow.create(caps);
+ final GLCapabilitiesImmutable caps = demo.getGLCapabilities();
+
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setSize(width, height);
glWindow.setTitle("ElektronenMultiplizierer (GL2ES2/NEWT)");
glWindow.addGLEventListener(demo);
- Animator animator = new Animator(glWindow);
+ final Animator animator = new Animator(glWindow);
animator.setUpdateFPSFrames(60, System.err);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -104,10 +104,10 @@ public class TestElektronenMultipliziererNEWT extends UITestCase {
final GLWindow f_glWindow = glWindow;
glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
- }
+ }
if(e.getKeyChar()=='f') {
new Thread() {
public void run() {
@@ -137,19 +137,19 @@ public class TestElektronenMultipliziererNEWT extends UITestCase {
run();
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
if(args[i].equals("-sframe")) {
i++;
try {
startFrame = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestElektronenMultipliziererNEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java
index 578a887d9..cd5e20c40 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java
@@ -51,6 +51,7 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
import com.jogamp.opengl.util.PNGPixelRect;
import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
@@ -127,10 +128,10 @@ public class TestGearsES2NEWT extends UITestCase {
sDPI[1] *= 25.4f;
win.setTitle("GLWindow["+capsA+"], swapI "+swapInterval+", win: "+win.getBounds()+", pix: "+win.getSurfaceWidth()+"x"+win.getSurfaceHeight()+", sDPI "+sDPI[0]+" x "+sDPI[1]);
}
- protected void runTestGL(final GLCapabilitiesImmutable caps, boolean undecorated) throws InterruptedException {
+ protected void runTestGL(final GLCapabilitiesImmutable caps, final boolean undecorated) throws InterruptedException {
System.err.println("requested: vsync "+swapInterval+", "+caps);
- Display dpy = NewtFactory.createDisplay(null);
- Screen screen = NewtFactory.createScreen(dpy, screenIdx);
+ final Display dpy = NewtFactory.createDisplay(null);
+ final Screen screen = NewtFactory.createScreen(dpy, screenIdx);
final GLWindow glWindow = GLWindow.create(screen, caps);
Assert.assertNotNull(glWindow);
glWindow.setSurfaceScale(reqSurfacePixelScale);
@@ -154,24 +155,24 @@ public class TestGearsES2NEWT extends UITestCase {
glWindow.addGLEventListener(snap);
if(waitForKey) {
glWindow.addGLEventListener(new GLEventListener() {
- public void init(GLAutoDrawable drawable) { }
- public void dispose(GLAutoDrawable drawable) { }
- public void display(GLAutoDrawable drawable) {
- GLAnimatorControl actrl = drawable.getAnimator();
+ public void init(final GLAutoDrawable drawable) { }
+ public void dispose(final GLAutoDrawable drawable) { }
+ public void display(final GLAutoDrawable drawable) {
+ final GLAnimatorControl actrl = drawable.getAnimator();
if(waitForKey && actrl.getTotalFPSFrames() == 60*3) {
UITestCase.waitForKey("3s mark");
actrl.resetFPSCounter();
waitForKey = false;
}
}
- public void reshape(GLAutoDrawable drawable, int x, int y,
- int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y,
+ final int width, final int height) { }
});
}
final Animator animator = useAnimator ? new Animator() : null;
if( useAnimator ) {
- animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+ animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
animator.setExclusiveContext(exclusiveContext);
}
@@ -182,11 +183,11 @@ public class TestGearsES2NEWT extends UITestCase {
glWindow.addWindowListener(quitAdapter);
glWindow.addWindowListener(new WindowAdapter() {
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
setTitle(glWindow, caps);
}
- public void windowMoved(WindowEvent e) {
+ public void windowMoved(final WindowEvent e) {
System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
setTitle(glWindow, caps);
}
@@ -202,7 +203,7 @@ public class TestGearsES2NEWT extends UITestCase {
try {
_pointerIcon = disp.createPointerIcon(res, 8, 8);
System.err.println("Create PointerIcon #01: "+_pointerIcon);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
pointerIcons[0] = _pointerIcon;
@@ -213,7 +214,7 @@ public class TestGearsES2NEWT extends UITestCase {
try {
_pointerIcon = disp.createPointerIcon(res, 0, 0);
System.err.println("Create PointerIcon #02: "+_pointerIcon);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
pointerIcons[1] = _pointerIcon;
@@ -227,7 +228,7 @@ public class TestGearsES2NEWT extends UITestCase {
System.err.println("Create PointerIcon #03: "+image);
_pointerIcon = disp.createPointerIcon(image, 32, 0);
System.err.println("Create PointerIcon #03: "+_pointerIcon);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
pointerIcons[2] = _pointerIcon;
@@ -371,7 +372,7 @@ public class TestGearsES2NEWT extends UITestCase {
}
});
glWindow.addMouseListener(new MouseAdapter() {
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
if(e.getClickCount() == 2 && e.getPointerCount() == 1) {
glWindow.setFullscreen(!glWindow.isFullscreen());
System.err.println("setFullscreen: "+glWindow.isFullscreen());
@@ -390,11 +391,11 @@ public class TestGearsES2NEWT extends UITestCase {
if( SysExit.displayError == sysExit || SysExit.displayExit == sysExit || SysExit.displayEDTError == sysExit ) {
glWindow.addGLEventListener(new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {}
+ public void init(final GLAutoDrawable drawable) {}
@Override
- public void dispose(GLAutoDrawable drawable) { }
+ public void dispose(final GLAutoDrawable drawable) { }
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GLAnimatorControl anim = drawable.getAnimator();
if( null != anim && anim.isAnimating() ) {
final long ms = anim.getTotalFPSDuration();
@@ -426,7 +427,7 @@ public class TestGearsES2NEWT extends UITestCase {
}
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
}
@@ -560,11 +561,11 @@ public class TestGearsES2NEWT extends UITestCase {
reqSurfacePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
reqSurfacePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
- GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
runTestGL(caps, undecorated);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
int x=0, y=0, w=640, h=480, rw=-1, rh=-1;
boolean usePos = false;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java
index e4ba5f855..2dca3ad5e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java
@@ -54,6 +54,7 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import com.jogamp.opengl.test.junit.newt.parenting.NewtAWTReparentingKeyAdapter;
@@ -122,7 +123,7 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
frame.pack();
} } );
}
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -131,7 +132,7 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
+ final java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
comp.setMinimumSize(d);
comp.setPreferredSize(d);
comp.setSize(d);
@@ -139,7 +140,7 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
frame.pack();
}
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -148,13 +149,13 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
+ final java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
frame.setSize(d);
if( frameLayout ) {
frame.validate();
}
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -189,8 +190,8 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
// public enum ResizeBy { GLWindow, Component, Frame };
protected void runTestGL(final GLCapabilitiesImmutable caps, final ResizeBy resizeBy, final FrameLayout frameLayout) throws InterruptedException, InvocationTargetException {
System.err.println("requested: vsync "+swapInterval+", "+caps);
- Display dpy = NewtFactory.createDisplay(null);
- Screen screen = NewtFactory.createScreen(dpy, screenIdx);
+ final Display dpy = NewtFactory.createDisplay(null);
+ final Screen screen = NewtFactory.createScreen(dpy, screenIdx);
final GLWindow glWindow = GLWindow.create(screen, caps);
Assert.assertNotNull(glWindow);
glWindow.setSurfaceScale(reqSurfacePixelScale);
@@ -241,7 +242,7 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
frame.add(newtCanvasAWT, BorderLayout.CENTER);
break;
case DoubleBorderCenterSurrounded:
- Container c = new Container();
+ final Container c = new Container();
c.setLayout(new BorderLayout());
c.add(new Button("north"), BorderLayout.NORTH);
c.add(new Button("south"), BorderLayout.SOUTH);
@@ -263,25 +264,25 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
frame.addComponentListener(new ComponentListener() {
@Override
- public void componentResized(ComponentEvent e) {
+ public void componentResized(final ComponentEvent e) {
setTitle(frame, newtCanvasAWT, glWindow, caps);
}
@Override
- public void componentMoved(ComponentEvent e) {
+ public void componentMoved(final ComponentEvent e) {
setTitle(frame, newtCanvasAWT, glWindow, caps);
}
@Override
- public void componentShown(ComponentEvent e) { }
+ public void componentShown(final ComponentEvent e) { }
@Override
- public void componentHidden(ComponentEvent e) { }
+ public void componentHidden(final ComponentEvent e) { }
});
final Animator animator = useAnimator ? new Animator() : null;
if( useAnimator ) {
- animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+ animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
animator.setExclusiveContext(exclusiveContext);
}
@@ -292,10 +293,10 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
glWindow.addWindowListener(quitAdapter);
glWindow.addWindowListener(new WindowAdapter() {
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
- public void windowMoved(WindowEvent e) {
+ public void windowMoved(final WindowEvent e) {
System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
});
@@ -439,11 +440,11 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
reqSurfacePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
reqSurfacePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
- GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
runTestGL(caps, resizeBy, frameLayout);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
int x=0, y=0, w=640, h=480;
int rw=-1, rh=-1;
boolean usePos = false;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java
index c667adaba..c3c7d68b3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java
@@ -43,16 +43,14 @@ import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
-
import com.jogamp.opengl.util.Animator;
-
+import com.jogamp.opengl.util.AnimatorBase;
import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import javax.media.nativewindow.util.Dimension;
import javax.media.nativewindow.util.Point;
import javax.media.nativewindow.util.PointImmutable;
import javax.media.nativewindow.util.DimensionImmutable;
-
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLProfile;
@@ -142,7 +140,7 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
display.dispose();
}});
}
- catch( Throwable throwable ) {
+ catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -152,36 +150,36 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
composite = null;
}
- protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
+ protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
System.err.println("requested: vsync "+swapInterval+", "+caps);
- com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, screenIdx);
+ final com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, screenIdx);
final GLWindow glWindow = GLWindow.create(screen, caps);
Assert.assertNotNull(glWindow);
final GearsES2 demo = new GearsES2(swapInterval);
glWindow.addGLEventListener(demo);
- Animator animator = new Animator();
- animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+ final Animator animator = new Animator();
+ animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
animator.setExclusiveContext(exclusiveContext);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
glWindow.addKeyListener(quitAdapter);
glWindow.addWindowListener(quitAdapter);
glWindow.addWindowListener(new WindowAdapter() {
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
- public void windowMoved(WindowEvent e) {
+ public void windowMoved(final WindowEvent e) {
System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
});
glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
}
@@ -294,7 +292,7 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
runTestGL(caps);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
mainRun = true;
int x=0, y=0, w=640, h=480, rw=-1, rh=-1;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NEWT.java
index 5b31fdb5e..d7926833c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.demos.es2.newt;
import com.jogamp.newt.event.KeyAdapter;
@@ -34,9 +34,8 @@ import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
-
import com.jogamp.opengl.util.Animator;
-
+import com.jogamp.opengl.util.AnimatorBase;
import com.jogamp.opengl.test.junit.jogl.demos.es2.LandscapeES2;
import javax.media.opengl.GLCapabilities;
@@ -56,7 +55,7 @@ public class TestLandscapeES2NEWT extends UITestCase {
static boolean exclusiveContext = false;
static boolean useAnimator = true;
- protected void runTestGL(GLCapabilities caps) throws InterruptedException {
+ protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
System.err.println("requested: swapInterval "+swapInterval+", "+caps);
final GLWindow glWindow = GLWindow.create(caps);
glWindow.setTitle(getSimpleTestName("."));
@@ -68,14 +67,14 @@ public class TestLandscapeES2NEWT extends UITestCase {
final SnapshotGLEventListener snap = new SnapshotGLEventListener();
snap.setPostSNDetail(demo.getClass().getSimpleName());
glWindow.addGLEventListener(snap);
-
+
final Animator animator = useAnimator ? new Animator() : null;
if( useAnimator ) {
- animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+ animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
animator.setExclusiveContext(exclusiveContext);
}
-
- QuitAdapter quitAdapter = new QuitAdapter();
+
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -83,10 +82,10 @@ public class TestLandscapeES2NEWT extends UITestCase {
glWindow.addWindowListener(quitAdapter);
glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
- }
+ }
if(e.getKeyChar()=='f') {
new Thread() {
public void run() {
@@ -113,9 +112,9 @@ public class TestLandscapeES2NEWT extends UITestCase {
System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
-
+
snap.setMakeSnapshot();
-
+
while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
Thread.sleep(100);
}
@@ -139,11 +138,11 @@ public class TestLandscapeES2NEWT extends UITestCase {
final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps);
}
-
+
@Test
public void test02GL3() throws InterruptedException {
if(mainRun) return;
-
+
if( !GLProfile.isAvailable(GLProfile.GL3) ) {
System.err.println("GL3 n/a");
return;
@@ -151,11 +150,11 @@ public class TestLandscapeES2NEWT extends UITestCase {
final GLProfile glp = GLProfile.get(GLProfile.GL3);
final GLCapabilities caps = new GLCapabilities( glp );
runTestGL(caps);
- }
+ }
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
mainRun = true;
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NewtCanvasAWT.java
index d1139152d..0f55813f8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NewtCanvasAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.demos.es2.newt;
import java.awt.Frame;
@@ -43,6 +43,7 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
import com.jogamp.opengl.test.junit.jogl.demos.es2.LandscapeES2;
import com.jogamp.opengl.test.junit.newt.parenting.NewtAWTReparentingKeyAdapter;
@@ -58,9 +59,9 @@ import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
+public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
static DimensionImmutable wsize = new Dimension(500, 290);
-
+
static long duration = 500; // ms
static int swapInterval = 1;
static boolean shallUseOffscreenFBOLayer = false;
@@ -69,36 +70,36 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
static boolean mainRun = false;
static boolean exclusiveContext = false;
static boolean useAnimator = true;
-
+
// public enum ResizeBy { GLWindow, Component, Frame };
protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
System.err.println("requested: vsync "+swapInterval+", "+caps);
- Display dpy = NewtFactory.createDisplay(null);
- Screen screen = NewtFactory.createScreen(dpy, 0);
+ final Display dpy = NewtFactory.createDisplay(null);
+ final Screen screen = NewtFactory.createScreen(dpy, 0);
final GLWindow glWindow = GLWindow.create(screen, caps);
-
+
final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
if ( shallUseOffscreenFBOLayer ) {
newtCanvasAWT.setShallUseOffscreenLayer(true);
}
-
+
final Frame frame = new Frame("AWT Parent Frame");
{
- java.awt.Dimension d = new java.awt.Dimension(wsize.getWidth(), wsize.getHeight());
+ final java.awt.Dimension d = new java.awt.Dimension(wsize.getWidth(), wsize.getHeight());
frame.setSize(d);
}
frame.add(newtCanvasAWT);
frame.setTitle("Gears NewtCanvasAWT Test (translucent "+!caps.isBackgroundOpaque()+"), swapInterval "+swapInterval+", size "+wsize);
-
+
final LandscapeES2 demo = new LandscapeES2(swapInterval);
glWindow.addGLEventListener(demo);
-
+
final Animator animator = useAnimator ? new Animator() : null;
if( useAnimator ) {
- animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+ animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
animator.setExclusiveContext(exclusiveContext);
}
-
+
final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -106,16 +107,16 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
glWindow.addWindowListener(quitAdapter);
glWindow.addWindowListener(new WindowAdapter() {
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
- public void windowMoved(WindowEvent e) {
+ public void windowMoved(final WindowEvent e) {
System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
- }
+ }
});
-
+
glWindow.addKeyListener(new NewtAWTReparentingKeyAdapter(frame, newtCanvasAWT, glWindow, quitAdapter));
-
+
if( useAnimator ) {
animator.add(glWindow);
animator.start();
@@ -124,18 +125,18 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.validate();
- frame.setVisible(true);
+ frame.setVisible(true);
}
- });
-
+ });
+
if( useAnimator ) {
animator.setUpdateFPSFrames(60, System.err);
}
-
+
System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
-
+
final long t0 = System.currentTimeMillis();
long t1 = t0;
while(!quitAdapter.shouldQuit() && t1-t0<duration) {
@@ -147,8 +148,8 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
animator.stop();
}
SwingUtilities.invokeAndWait(new Runnable() {
- public void run() {
- frame.dispose();
+ public void run() {
+ frame.dispose();
}
});
glWindow.destroy();
@@ -171,7 +172,7 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
@Test
public void test02GL3() throws InterruptedException, InvocationTargetException {
if(mainRun) return;
-
+
if( !GLProfile.isAvailable(GLProfile.GL3) ) {
System.err.println("GL3 n/a");
return;
@@ -180,10 +181,10 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
final GLCapabilities caps = new GLCapabilities( glp );
runTestGL(caps);
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
mainRun = true;
-
+
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
@@ -203,7 +204,7 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
forceGL3 = true;
}
}
-
+
System.err.println("size "+wsize);
System.err.println("shallUseOffscreenFBOLayer "+shallUseOffscreenFBOLayer);
System.err.println("forceES2 "+forceES2);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java
index de824571e..52f4473c3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java
@@ -73,7 +73,7 @@ public class TestRedSquareES2NEWT extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps) throws InterruptedException {
+ protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
System.err.println("requested: vsync "+vsync+", "+caps);
final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
@@ -96,8 +96,8 @@ public class TestRedSquareES2NEWT extends UITestCase {
snap.setPostSNDetail(demo.getClass().getSimpleName());
glWindow.addGLEventListener(snap);
- Animator animator = new Animator(glWindow);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final Animator animator = new Animator(glWindow);
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -105,7 +105,7 @@ public class TestRedSquareES2NEWT extends UITestCase {
glWindow.addWindowListener(quitAdapter);
glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
}
@@ -182,7 +182,7 @@ public class TestRedSquareES2NEWT extends UITestCase {
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
mainRun = true;
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java
index 07f3a97cb..178887059 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java
@@ -38,7 +38,7 @@ public class RedSquareShader {
"#if __VERSION__ >= 130\n" +
" #define attribute in\n" +
" #define varying out\n" +
- "#endif\n"+
+ "#endif\n"+
"\n" +
"uniform mat4 mgl_PMVMatrix[2];\n" +
"attribute vec4 mgl_Vertex;\n" +
@@ -61,7 +61,7 @@ public class RedSquareShader {
" #define varying in\n" +
" out vec4 mgl_FragColor;\n" +
"#else\n" +
- " #define mgl_FragColor gl_FragColor\n" +
+ " #define mgl_FragColor gl_FragColor\n" +
"#endif\n" +
"\n" +
"varying vec4 frontColor;\n" +
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/swt/TestGearsES2SWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/swt/TestGearsES2SWT.java
index b1a4793ff..7ecb63938 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/swt/TestGearsES2SWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/swt/TestGearsES2SWT.java
@@ -35,16 +35,14 @@ import com.jogamp.nativewindow.swt.SWTAccessor;
import com.jogamp.opengl.swt.GLCanvas;
import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.UITestCase;
-
import com.jogamp.opengl.util.Animator;
-
+import com.jogamp.opengl.util.AnimatorBase;
import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import javax.media.nativewindow.util.Dimension;
import javax.media.nativewindow.util.Point;
import javax.media.nativewindow.util.PointImmutable;
import javax.media.nativewindow.util.DimensionImmutable;
-
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLProfile;
@@ -132,7 +130,7 @@ public class TestGearsES2SWT extends UITestCase {
display.dispose();
}});
}
- catch( Throwable throwable ) {
+ catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -141,7 +139,7 @@ public class TestGearsES2SWT extends UITestCase {
composite = null;
}
- protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
+ protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
System.err.println("requested: vsync "+swapInterval+", "+caps);
final GLCanvas canvas = GLCanvas.create( composite, 0, caps, null);
@@ -150,8 +148,8 @@ public class TestGearsES2SWT extends UITestCase {
final GearsES2 demo = new GearsES2(swapInterval);
canvas.addGLEventListener(demo);
- Animator animator = new Animator();
- animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+ final Animator animator = new Animator();
+ animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
animator.setExclusiveContext(exclusiveContext);
animator.add(canvas);
@@ -254,7 +252,7 @@ public class TestGearsES2SWT extends UITestCase {
runTestGL(caps);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
mainRun = true;
int x=0, y=0, w=640, h=480, rw=-1, rh=-1;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java
index 881625ee4..dbc760d15 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java
@@ -3,9 +3,12 @@ package com.jogamp.opengl.test.junit.jogl.demos.gl2;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
+import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.newt.Window;
import com.jogamp.newt.event.InputEvent;
@@ -43,7 +46,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
// private boolean mouseRButtonDown = false;
private int prevMouseX, prevMouseY;
- public Gears(int swapInterval) {
+ public Gears(final int swapInterval) {
this.swapInterval = swapInterval;
}
@@ -52,30 +55,30 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
}
@Override
- public void addTileRendererNotify(TileRendererBase tr) {
+ public void addTileRendererNotify(final TileRendererBase tr) {
tileRendererInUse = tr;
doRotateBeforePrinting = doRotate;
setDoRotation(false);
}
@Override
- public void removeTileRendererNotify(TileRendererBase tr) {
+ public void removeTileRendererNotify(final TileRendererBase tr) {
tileRendererInUse = null;
setDoRotation(doRotateBeforePrinting);
}
@Override
- public void startTileRendering(TileRendererBase tr) {
+ public void startTileRendering(final TileRendererBase tr) {
System.err.println("Gears.startTileRendering: "+tr);
}
@Override
- public void endTileRendering(TileRendererBase tr) {
+ public void endTileRendering(final TileRendererBase tr) {
System.err.println("Gears.endTileRendering: "+tr);
}
- public void setDoRotation(boolean rotate) { doRotate = rotate; }
- public void setVerbose(boolean v) { verbose = v; }
- public void setFlipVerticalInGLOrientation(boolean v) { flipVerticalInGLOrientation=v; }
+ public void setDoRotation(final boolean rotate) { doRotate = rotate; }
+ public void setVerbose(final boolean v) { verbose = v; }
+ public void setFlipVerticalInGLOrientation(final boolean v) { flipVerticalInGLOrientation=v; }
- public void setGears(int g1, int g2, int g3) {
+ public void setGears(final int g1, final int g2, final int g3) {
gear1 = g1;
gear2 = g2;
gear3 = g3;
@@ -97,8 +100,8 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
public int getGear3() { return gear3; }
@Override
- public void init(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+ public void init(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
init(gl);
@@ -114,7 +117,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
}
}
- public void init(GL2 gl) {
+ public void init(final GL2 gl) {
final float lightPos[] = { 5.0f, 5.0f, 10.0f, 0.0f };
final float red[] = { 0.8f, 0.1f, 0.0f, 0.7f };
final float green[] = { 0.0f, 0.8f, 0.2f, 0.7f };
@@ -128,20 +131,20 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
System.err.println(JoglVersion.getGLStrings(gl, null, false).toString());
}
- gl.glLightfv(GL2.GL_LIGHT0, GL2.GL_POSITION, lightPos, 0);
+ gl.glLightfv(GLLightingFunc.GL_LIGHT0, GLLightingFunc.GL_POSITION, lightPos, 0);
if( ! ( flipVerticalInGLOrientation && gl.getContext().getGLDrawable().isGLOriented() ) ) {
// Only possible if we do not flip the projection matrix
- gl.glEnable(GL2.GL_CULL_FACE);
+ gl.glEnable(GL.GL_CULL_FACE);
}
- gl.glEnable(GL2.GL_LIGHTING);
- gl.glEnable(GL2.GL_LIGHT0);
- gl.glEnable(GL2.GL_DEPTH_TEST);
+ gl.glEnable(GLLightingFunc.GL_LIGHTING);
+ gl.glEnable(GLLightingFunc.GL_LIGHT0);
+ gl.glEnable(GL.GL_DEPTH_TEST);
/* make the gears */
if(0>=gear1) {
gear1 = gl.glGenLists(1);
gl.glNewList(gear1, GL2.GL_COMPILE);
- gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, red, 0);
+ gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_AMBIENT_AND_DIFFUSE, red, 0);
gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
gl.glEndList();
System.err.println("gear1 list created: "+gear1);
@@ -152,7 +155,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
if(0>=gear2) {
gear2 = gl.glGenLists(1);
gl.glNewList(gear2, GL2.GL_COMPILE);
- gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, green, 0);
+ gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_AMBIENT_AND_DIFFUSE, green, 0);
gear(gl, 0.5f, 2.0f, 2.0f, 10, 0.7f);
gl.glEndList();
System.err.println("gear2 list created: "+gear2);
@@ -163,7 +166,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
if(0>=gear3) {
gear3 = gl.glGenLists(1);
gl.glNewList(gear3, GL2.GL_COMPILE);
- gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, blue, 0);
+ gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_AMBIENT_AND_DIFFUSE, blue, 0);
gear(gl, 1.3f, 2.0f, 0.5f, 10, 0.7f);
gl.glEndList();
System.err.println("gear3 list created: "+gear3);
@@ -171,11 +174,11 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
System.err.println("gear3 list reused: "+gear3);
}
- gl.glEnable(GL2.GL_NORMALIZE);
+ gl.glEnable(GLLightingFunc.GL_NORMALIZE);
}
@Override
- public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
final GL2 gl = glad.getGL().getGL2();
if(-1 != swapInterval) {
gl.setSwapInterval(swapInterval);
@@ -184,15 +187,15 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
}
@Override
- public void reshapeTile(TileRendererBase tr,
- int tileX, int tileY, int tileWidth, int tileHeight,
- int imageWidth, int imageHeight) {
+ public void reshapeTile(final TileRendererBase tr,
+ final int tileX, final int tileY, final int tileWidth, final int tileHeight,
+ final int imageWidth, final int imageHeight) {
final GL2 gl = tr.getAttachedDrawable().getGL().getGL2();
gl.setSwapInterval(0);
reshape(gl, tileX, tileY, tileWidth, tileHeight, imageWidth, imageHeight);
}
- public void reshape(GL2 gl, int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight) {
+ public void reshape(final GL2 gl, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight) {
final boolean msaa = gl.getContext().getGLDrawable().getChosenGLCapabilities().getSampleBuffers();
System.err.println(Thread.currentThread()+" Gears.reshape "+tileX+"/"+tileY+" "+tileWidth+"x"+tileHeight+" of "+imageWidth+"x"+imageHeight+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(gl.getContext().getGLDrawable().getHandle())+", msaa "+msaa+", tileRendererInUse "+tileRendererInUse);
@@ -203,13 +206,13 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
// compute projection parameters 'normal'
float left, right, bottom, top;
if( imageHeight > imageWidth ) {
- float a = (float)imageHeight / (float)imageWidth;
+ final float a = (float)imageHeight / (float)imageWidth;
left = -1.0f;
right = 1.0f;
bottom = -a;
top = a;
} else {
- float a = (float)imageWidth / (float)imageHeight;
+ final float a = (float)imageWidth / (float)imageHeight;
left = -a;
right = a;
bottom = -1.0f;
@@ -231,14 +234,14 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
System.err.println(">> Gears angle "+angle+", [l "+left+", r "+right+", b "+bottom+", t "+top+"] "+w+"x"+h+" -> [l "+l+", r "+r+", b "+b+", t "+t+"] "+_w+"x"+_h+", v-flip "+flipVerticalInGLOrientation);
}
- gl.glMatrixMode(GL2.GL_PROJECTION);
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
if( flipVerticalInGLOrientation && gl.getContext().getGLDrawable().isGLOriented() ) {
gl.glScalef(1f, -1f, 1f);
}
gl.glFrustum(l, r, b, t, 5.0f, 60.0f);
- gl.glMatrixMode(GL2.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
gl.glTranslatef(0.0f, 0.0f, -40.0f);
@@ -248,7 +251,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
System.err.println(Thread.currentThread()+" Gears.dispose: tileRendererInUse "+tileRendererInUse);
try {
final Object upstreamWidget = drawable.getUpstreamWidget();
@@ -257,14 +260,14 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
window.removeMouseListener(gearsMouse);
window.removeKeyListener(gearsKeys);
}
- } catch (Exception e) { System.err.println("Caught: "); e.printStackTrace(); }
+ } catch (final Exception e) { System.err.println("Caught: "); e.printStackTrace(); }
setGears(0, 0, 0);
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
// Get the GL corresponding to the drawable we are animating
- GL2 gl = drawable.getGL().getGL2();
+ final GL2 gl = drawable.getGL().getGL2();
final boolean msaa = gl.getContext().getGLDrawable().getChosenGLCapabilities().getSampleBuffers();
if( msaa ) {
@@ -283,16 +286,16 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
(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);
+ gl.glClear(GL.GL_DEPTH_BUFFER_BIT);
} else {
- gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
}
displayImpl(gl);
if( msaa ) {
gl.glDisable(GL.GL_MULTISAMPLE);
}
}
- public void display(GL2 gl) {
+ public void display(final GL2 gl) {
final boolean msaa = gl.getContext().getGLDrawable().getChosenGLCapabilities().getSampleBuffers();
if( msaa ) {
gl.glEnable(GL.GL_MULTISAMPLE);
@@ -302,13 +305,13 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
} else {
gl.glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
}
- gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
displayImpl(gl);
if( msaa ) {
gl.glDisable(GL.GL_MULTISAMPLE);
}
}
- private void displayImpl(GL2 gl) {
+ private void displayImpl(final GL2 gl) {
if( doRotate ) {
// Turn the gears' teeth
angle += 2.0f;
@@ -346,12 +349,12 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
gl.glPopMatrix();
}
- public static void gear(GL2 gl,
- float inner_radius,
- float outer_radius,
- float width,
- int teeth,
- float tooth_depth)
+ public static void gear(final GL2 gl,
+ final float inner_radius,
+ final float outer_radius,
+ final float width,
+ final int teeth,
+ final float tooth_depth)
{
int i;
float r0, r1, r2;
@@ -364,7 +367,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
da = 2.0f * (float) Math.PI / teeth / 4.0f;
- gl.glShadeModel(GL2.GL_FLAT);
+ gl.glShadeModel(GLLightingFunc.GL_FLAT);
gl.glNormal3f(0.0f, 0.0f, 1.0f);
@@ -384,7 +387,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
gl.glEnd();
/* draw front sides of teeth */
- gl.glBegin(GL2.GL_QUADS);
+ gl.glBegin(GL2GL3.GL_QUADS);
for (i = 0; i < teeth; i++)
{
angle = i * 2.0f * (float) Math.PI / teeth;
@@ -408,7 +411,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
gl.glEnd();
/* draw back sides of teeth */
- gl.glBegin(GL2.GL_QUADS);
+ gl.glBegin(GL2GL3.GL_QUADS);
for (i = 0; i < teeth; i++)
{
angle = i * 2.0f * (float) Math.PI / teeth;
@@ -448,7 +451,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
gl.glVertex3f(r1 * (float)Math.cos(0), r1 * (float)Math.sin(0), -width * 0.5f);
gl.glEnd();
- gl.glShadeModel(GL2.GL_SMOOTH);
+ gl.glShadeModel(GLLightingFunc.GL_SMOOTH);
/* draw inside radius cylinder */
gl.glBegin(GL2.GL_QUAD_STRIP);
@@ -463,8 +466,8 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
}
class GearsKeyAdapter extends KeyAdapter {
- public void keyPressed(KeyEvent e) {
- int kc = e.getKeyCode();
+ public void keyPressed(final KeyEvent e) {
+ final int kc = e.getKeyCode();
if(KeyEvent.VK_LEFT == kc) {
view_roty -= 1;
} else if(KeyEvent.VK_RIGHT == kc) {
@@ -478,7 +481,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
}
class GearsMouseAdapter extends MouseAdapter {
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
prevMouseX = e.getX();
prevMouseY = e.getY();
if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0) {
@@ -486,34 +489,34 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
}
}
- public void mouseReleased(MouseEvent e) {
+ public void mouseReleased(final MouseEvent e) {
if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0) {
// mouseRButtonDown = false;
}
}
- public void mouseDragged(MouseEvent e) {
- int x = e.getX();
- int y = e.getY();
+ public void mouseDragged(final MouseEvent e) {
+ final int x = e.getX();
+ final int y = e.getY();
int width=0, height=0;
- Object source = e.getSource();
+ final Object source = e.getSource();
if(source instanceof Window) {
- Window window = (Window) source;
+ final Window window = (Window) source;
width=window.getSurfaceWidth();
height=window.getSurfaceHeight();
} else if (source instanceof GLAutoDrawable) {
- GLAutoDrawable glad = (GLAutoDrawable) source;
+ final GLAutoDrawable glad = (GLAutoDrawable) source;
width = glad.getSurfaceWidth();
height = glad.getSurfaceHeight();
} else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) {
- java.awt.Component comp = (java.awt.Component) source;
+ final java.awt.Component comp = (java.awt.Component) source;
width=comp.getWidth(); // FIXME HiDPI: May need to convert window units -> pixel units!
height=comp.getHeight();
} else {
throw new RuntimeException("Event source neither Window nor Component: "+source);
}
- float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width);
- float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height);
+ final float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width);
+ final float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height);
prevMouseX = x;
prevMouseY = y;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Teapot.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Teapot.java
index 64e4472c0..d29688b96 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Teapot.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Teapot.java
@@ -6,6 +6,8 @@ import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.common.util.IOUtil;
import com.jogamp.opengl.test.junit.jogl.util.texture.PNGTstFiles;
@@ -27,16 +29,16 @@ public class Teapot implements GLEventListener {
private Texture tex = null;
@Override
- public void init(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+ public void init(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
glut = new GLUT();
gl.glClearColor(0.5f, 0.5f, 0.5f, 0.0f);
try {
- URLConnection urlConn = IOUtil.getResource(PNGTstFiles.class, "test-ntscP_3-01-160x90.png");
+ final URLConnection urlConn = IOUtil.getResource(PNGTstFiles.class, "test-ntscP_3-01-160x90.png");
tex = TextureIO.newTexture(gl, TextureIO.newTextureData(gl.getGLProfile(), urlConn.getInputStream(), false, TextureIO.PNG));
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
tex.bind(gl);
@@ -55,7 +57,7 @@ public class Teapot implements GLEventListener {
// gl.glTexImage1D(GL2.GL_TEXTURE_1D, 0, 3, stripeImageWidth, 0,
// GL.GL_RGB, GL.GL_UNSIGNED_BYTE, stripeImageBuf);
- gl.glTexParameterf(GL2.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_REPEAT);
+ gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_REPEAT);
// gl.glTexGeni(GL2.GL_S, GL2.GL_TEXTURE_GEN_MODE, GL2.GL_OBJECT_LINEAR);
// gl.glTexGenfv(GL2.GL_S, GL2.GL_OBJECT_PLANE, sgenparams, 0);
@@ -64,15 +66,15 @@ public class Teapot implements GLEventListener {
gl.glDepthFunc(GL.GL_LESS);
// gl.glEnable(GL2.GL_TEXTURE_GEN_S);
// gl.glEnable(GL2.GL_TEXTURE_1D);
- gl.glEnable(GL2.GL_TEXTURE_2D);
- gl.glEnable(GL2.GL_CULL_FACE);
- gl.glEnable(GL2.GL_LIGHTING);
- gl.glEnable(GL2.GL_LIGHT0);
+ gl.glEnable(GL.GL_TEXTURE_2D);
+ gl.glEnable(GL.GL_CULL_FACE);
+ gl.glEnable(GLLightingFunc.GL_LIGHTING);
+ gl.glEnable(GLLightingFunc.GL_LIGHT0);
gl.glEnable(GL2.GL_AUTO_NORMAL);
- gl.glEnable(GL2.GL_NORMALIZE);
+ gl.glEnable(GLLightingFunc.GL_NORMALIZE);
gl.glFrontFace(GL.GL_CW);
gl.glCullFace(GL.GL_BACK);
- gl.glMaterialf(GL.GL_FRONT, GL2.GL_SHININESS, 64.0f);
+ gl.glMaterialf(GL.GL_FRONT, GLLightingFunc.GL_SHININESS, 64.0f);
}
float angleZ = 0.0f;
@@ -80,11 +82,11 @@ public class Teapot implements GLEventListener {
public float rotIncr = 0.4f;
@Override
- public void display(GLAutoDrawable gLDrawable) {
+ public void display(final GLAutoDrawable gLDrawable) {
final GL2 gl = gLDrawable.getGL().getGL2();
tex.bind(gl);
- gl.glEnable(GL2.GL_TEXTURE_2D);
+ gl.glEnable(GL.GL_TEXTURE_2D);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glPushMatrix();
@@ -102,11 +104,11 @@ public class Teapot implements GLEventListener {
}
@Override
- public void reshape(GLAutoDrawable gLDrawable, int x, int y, int w, int h) {
- GL2 gl = gLDrawable.getGL().getGL2();
+ public void reshape(final GLAutoDrawable gLDrawable, final int x, final int y, final int w, final int h) {
+ final GL2 gl = gLDrawable.getGL().getGL2();
gl.glViewport(0, 0, w, h);
- gl.glMatrixMode(GL2.GL_PROJECTION);
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
if (w <= h) {
gl.glOrtho(-3.5, 3.5, -3.5 * h / w,
@@ -115,11 +117,11 @@ public class Teapot implements GLEventListener {
gl.glOrtho(-3.5 * w / h,
3.5 * w / h, -3.5, 3.5, -3.5, 3.5);
}
- gl.glMatrixMode(GL2.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
}
@Override
- public void dispose(GLAutoDrawable gLDrawable) {
+ public void dispose(final GLAutoDrawable gLDrawable) {
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/TextureDraw01GL2Listener.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/TextureDraw01GL2Listener.java
index fb8e6bfa3..786229360 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/TextureDraw01GL2Listener.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/TextureDraw01GL2Listener.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.demos.gl2;
import com.jogamp.opengl.test.junit.jogl.demos.TextureDraw01Accessor;
@@ -33,35 +33,39 @@ import com.jogamp.opengl.util.texture.Texture;
import com.jogamp.opengl.util.texture.TextureCoords;
import com.jogamp.opengl.util.texture.TextureData;
import com.jogamp.opengl.util.texture.TextureIO;
+
+import javax.media.opengl.GL;
import javax.media.opengl.GL2ES1;
import javax.media.opengl.GL2;
+import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import javax.media.opengl.glu.GLU;
public class TextureDraw01GL2Listener implements GLEventListener, TextureDraw01Accessor {
- private GLU glu = new GLU();
- private TextureData textureData;
+ private final GLU glu = new GLU();
+ private final TextureData textureData;
private Texture texture;
boolean keepTextureBound;
-
- public TextureDraw01GL2Listener(TextureData td) {
+
+ public TextureDraw01GL2Listener(final TextureData td) {
this.textureData = td;
this.keepTextureBound = false;
}
@Override
- public void setKeepTextureBound(boolean v) {
+ public void setKeepTextureBound(final boolean v) {
this.keepTextureBound = v;
}
@Override
public Texture getTexture( ) {
return this.texture;
}
-
+
@Override
- public void init(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+ public void init(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
if(null!=textureData) {
this.texture = TextureIO.newTexture(drawable.getGL(), textureData);
if( keepTextureBound ) {
@@ -72,18 +76,18 @@ public class TextureDraw01GL2Listener implements GLEventListener, TextureDraw01A
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
- GL2 gl = drawable.getGL().getGL2();
- gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ final GL2 gl = drawable.getGL().getGL2();
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
glu.gluOrtho2D(0, 1, 0, 1);
- gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
}
@Override
- public void dispose(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+ public void dispose(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
if(null!=texture) {
texture.disable(gl);
texture.destroy(gl);
@@ -94,8 +98,8 @@ public class TextureDraw01GL2Listener implements GLEventListener, TextureDraw01A
}
@Override
- public void display(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2 gl = drawable.getGL().getGL2();
// draw one quad with the texture
if(null!=texture) {
@@ -103,9 +107,9 @@ public class TextureDraw01GL2Listener implements GLEventListener, TextureDraw01A
texture.enable(gl);
texture.bind(gl);
}
- gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_REPLACE);
- TextureCoords coords = texture.getImageTexCoords();
- gl.glBegin(GL2.GL_QUADS);
+ gl.glTexEnvi(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
+ final TextureCoords coords = texture.getImageTexCoords();
+ gl.glBegin(GL2GL3.GL_QUADS);
gl.glTexCoord2f(coords.left(), coords.bottom());
gl.glVertex3f(0, 0, 0);
gl.glTexCoord2f(coords.right(), coords.bottom());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/Bug818GLJPanelApplet.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/Bug818GLJPanelApplet.java
index 7e3d78b92..8280919e6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/Bug818GLJPanelApplet.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/Bug818GLJPanelApplet.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -38,12 +38,14 @@ import java.nio.FloatBuffer;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GL2ES1;
+import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.awt.GLCanvas;
import javax.media.opengl.awt.GLJPanel;
import javax.media.opengl.fixedfunc.GLLightingFunc;
import javax.media.opengl.fixedfunc.GLMatrixFunc;
+import javax.media.opengl.fixedfunc.GLPointerFunc;
import javax.swing.JApplet;
import javax.swing.JPanel;
import javax.swing.JFrame;
@@ -76,7 +78,7 @@ public class Bug818GLJPanelApplet extends JApplet {
public static JPanel appletHolder;
public static boolean isApplet = true;
- static public void main(String args[]) {
+ static public void main(final String args[]) {
isApplet = false;
final JApplet myApplet = new Bug818GLJPanelApplet();
@@ -88,7 +90,7 @@ public class Bug818GLJPanelApplet extends JApplet {
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
+ public void windowClosing(final WindowEvent e) {
System.exit(0);
}
});
@@ -101,7 +103,7 @@ public class Bug818GLJPanelApplet extends JApplet {
frame.pack();
frame.setVisible(true);
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
}
@@ -151,97 +153,97 @@ public class Bug818GLJPanelApplet extends JApplet {
* Self-contained example (within a single class only to keep it simple) displaying a rotating quad
*/
static class JOGLQuad implements GLEventListener {
-
+
private static final float[] VERTEX_DATA = {
-1.0f, 1.0f, 0.0f, // Top Left
1.0f, 1.0f, 0.0f, // Top Right
1.0f, -1.0f, 0.0f, // Bottom Right
-1.0f, -1.0f, 0.0f // Bottom Left
};
-
+
private static final float[] TEXCOORD_DATA = {
0.0f, 1.0f, // Top Left
1.0f, 1.0f, // Top Right
1.0f, 0.0f, // Bottom Right
0.0f, 0.0f // Bottom Left
};
-
- private FloatBuffer vertexBuf;
-
- private FloatBuffer texCoordBuf;
-
+
+ private final FloatBuffer vertexBuf;
+
+ private final FloatBuffer texCoordBuf;
+
private int vertexVBO;
-
+
private int texCoordVBO;
-
+
private float rotateT = 0.0f;
-
- private boolean canvas;
-
+
+ private final boolean canvas;
+
private Texture texture;
-
- JOGLQuad(boolean canvas) {
-
+
+ JOGLQuad(final boolean canvas) {
+
this.canvas = canvas;
-
+
ByteBuffer bb = ByteBuffer.allocateDirect(VERTEX_DATA.length * 4);
bb.order(ByteOrder.nativeOrder());
vertexBuf = bb.asFloatBuffer();
vertexBuf.put(VERTEX_DATA);
vertexBuf.rewind();
-
+
bb = ByteBuffer.allocateDirect(TEXCOORD_DATA.length * 4);
bb.order(ByteOrder.nativeOrder());
texCoordBuf = bb.asFloatBuffer();
texCoordBuf.put(TEXCOORD_DATA);
texCoordBuf.rewind();
}
-
+
@Override
- public void init(GLAutoDrawable glDrawable) {
-
+ public void init(final GLAutoDrawable glDrawable) {
+
final GL2 gl = glDrawable.getGL().getGL2();
-
+
System.err.println(VersionUtil.getPlatformInfo());
System.err.println(JoglVersion.getGLInfo(gl, null, false /* withCapabilitiesAndExtensionInfo */).toString());
-
+
gl.glShadeModel(GLLightingFunc.GL_SMOOTH);
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
gl.glClearDepth(1.0f);
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glDepthFunc(GL.GL_LEQUAL);
gl.glHint(GL2ES1.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
-
- int[] tmp = new int[2];
+
+ final int[] tmp = new int[2];
gl.glGenBuffers(tmp.length, tmp, 0);
vertexVBO = tmp[0];
texCoordVBO = tmp[1];
-
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, vertexVBO);
- gl.glBufferData(GL2.GL_ARRAY_BUFFER, VERTEX_DATA.length * 4, vertexBuf, GL2.GL_STATIC_DRAW);
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, texCoordVBO);
- gl.glBufferData(GL2.GL_ARRAY_BUFFER, TEXCOORD_DATA.length * 4, texCoordBuf, GL2.GL_STATIC_DRAW);
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
-
+
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vertexVBO);
+ gl.glBufferData(GL.GL_ARRAY_BUFFER, VERTEX_DATA.length * 4, vertexBuf, GL.GL_STATIC_DRAW);
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, texCoordVBO);
+ gl.glBufferData(GL.GL_ARRAY_BUFFER, TEXCOORD_DATA.length * 4, texCoordBuf, GL.GL_STATIC_DRAW);
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+
try {
- InputStream stream = getClass().getClassLoader().getResourceAsStream("com/jogamp/opengl/test/junit/jogl/util/texture/test-ntscN_3-01-160x90-90pct-yuv444-base.jpg");
+ final InputStream stream = getClass().getClassLoader().getResourceAsStream("com/jogamp/opengl/test/junit/jogl/util/texture/test-ntscN_3-01-160x90-90pct-yuv444-base.jpg");
texture = TextureIO.newTexture(stream, true, TextureIO.JPG);
- } catch (Exception exc) {
+ } catch (final Exception exc) {
exc.printStackTrace(System.err);
}
}
-
+
@Override
- public void dispose(GLAutoDrawable drawable) {
-
+ public void dispose(final GLAutoDrawable drawable) {
+
final GL2 gl = drawable.getGL().getGL2();
- int[] tmp = new int[] {vertexVBO, texCoordVBO};
+ final int[] tmp = new int[] {vertexVBO, texCoordVBO};
gl.glGenBuffers(tmp.length, tmp, 0);
}
-
+
@Override
- public void reshape(GLAutoDrawable gLDrawable, int x, int y, int width, int height) {
-
+ public void reshape(final GLAutoDrawable gLDrawable, final int x, final int y, final int width, final int height) {
+
final GL2 gl = gLDrawable.getGL().getGL2();
final float aspect = (float) width / (float) height;
gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
@@ -252,55 +254,55 @@ public class Bug818GLJPanelApplet extends JApplet {
gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
}
-
+
@Override
- public void display(GLAutoDrawable gLDrawable) {
-
+ public void display(final GLAutoDrawable gLDrawable) {
+
final GL2 gl = gLDrawable.getGL().getGL2();
-
+
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glLoadIdentity();
gl.glTranslatef(0.0f, 0.0f, -5.0f);
-
+
// rotate about the three axes
gl.glRotatef(rotateT, 1.0f, 0.0f, 0.0f);
gl.glRotatef(rotateT, 0.0f, 1.0f, 0.0f);
gl.glRotatef(rotateT, 0.0f, 0.0f, 1.0f);
-
+
// set the color of the quad
if (canvas) {
gl.glColor3f(0.2f, 1.0f, 1.0f);
} else {
gl.glColor3f(1.0f, 0.2f, 0.2f);
}
-
+
if (texture != null) {
texture.bind(gl);
texture.enable(gl);
} else {
System.err.println("no texture");
}
-
+
// Draw A Quad
- gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
- gl.glEnableClientState(GL2.GL_TEXTURE_COORD_ARRAY);
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, vertexVBO);
- gl.glVertexPointer(3, GL2.GL_FLOAT, 0, 0);
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, texCoordVBO);
- gl.glTexCoordPointer(2, GL2.GL_FLOAT, 0, 0);
- gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
- gl.glDrawArrays(GL2.GL_QUADS, 0, 4);
- gl.glDisableClientState(GL2.GL_TEXTURE_COORD_ARRAY);
- gl.glDisableClientState(GL2.GL_VERTEX_ARRAY);
-
+ gl.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
+ gl.glEnableClientState(GLPointerFunc.GL_TEXTURE_COORD_ARRAY);
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vertexVBO);
+ gl.glVertexPointer(3, GL.GL_FLOAT, 0, 0);
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, texCoordVBO);
+ gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, 0);
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+ gl.glDrawArrays(GL2GL3.GL_QUADS, 0, 4);
+ gl.glDisableClientState(GLPointerFunc.GL_TEXTURE_COORD_ARRAY);
+ gl.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
+
if (texture != null) {
texture.disable(gl);
}
-
+
// increasing rotation for the next iteration
rotateT += 0.2f;
}
-
+
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java
index 0a8c406fb..ee5149b1c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -38,6 +38,7 @@ import javax.media.opengl.glu.gl2.GLUgl2;
import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
import com.jogamp.opengl.test.junit.util.UITestCase;
+
import java.awt.AWTException;
import java.awt.BorderLayout;
import java.lang.reflect.InvocationTargetException;
@@ -56,7 +57,7 @@ import org.junit.runners.MethodSorters;
/**
* Test for bug 450, which causes the right part of the frame to be black
* for all x >= height.
- *
+ *
* Draws the Gears demo in a window that's twice as wide than it is tall,
* and checks to see if a particular pixel in the right half of the frame
* is colored.
@@ -86,7 +87,7 @@ public class TestGLJPanelAWTBug450 extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps)
+ protected void runTestGL(final GLCapabilities caps)
throws AWTException, InterruptedException, InvocationTargetException
{
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
@@ -95,26 +96,26 @@ public class TestGLJPanelAWTBug450 extends UITestCase {
final GLJPanel glJPanel = new GLJPanel(caps);
Assert.assertNotNull(glJPanel);
- RedSquareES2 demo = new RedSquareES2();
+ final RedSquareES2 demo = new RedSquareES2();
demo.setAspect((float)width/(float)height);
demo.setDoRotation(false);
glJPanel.addGLEventListener(demo);
glJPanel.addGLEventListener(new GLEventListener() {
int f = 0;
@Override
- public void init(GLAutoDrawable drawable) {
- // drawable.getGL().glClearColor(0, 0, 1, 1);
+ public void init(final GLAutoDrawable drawable) {
+ // drawable.getGL().glClearColor(0, 0, 1, 1);
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
// look at one pixel at the bottom of the frame, just right of
// the center line, and make sure it's not black
- GL2 gl = GLUgl2.getCurrentGL2();
- ByteBuffer bytebuffer = ByteBuffer.allocateDirect( 3 );
- gl.glReadPixels( r_x, r_y, 1, 1, GL2.GL_BGR, GL2.GL_UNSIGNED_BYTE, bytebuffer );
- byte byte0 = bytebuffer.get( 0 );
- byte byte1 = bytebuffer.get( 1 );
- byte byte2 = bytebuffer.get( 2 );
+ final GL2 gl = GLUgl2.getCurrentGL2();
+ final ByteBuffer bytebuffer = ByteBuffer.allocateDirect( 3 );
+ gl.glReadPixels( r_x, r_y, 1, 1, GL2GL3.GL_BGR, GL.GL_UNSIGNED_BYTE, bytebuffer );
+ final byte byte0 = bytebuffer.get( 0 );
+ final byte byte1 = bytebuffer.get( 1 );
+ final byte byte2 = bytebuffer.get( 2 );
if( (byte0 == 0) && (byte1 == 0) && (byte2 == 0) ) {
failed = true;
}
@@ -125,12 +126,12 @@ public class TestGLJPanelAWTBug450 extends UITestCase {
f++;
}
@Override
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
- FPSAnimator animator = new FPSAnimator(glJPanel, 60);
+ final FPSAnimator animator = new FPSAnimator(glJPanel, 60);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -139,7 +140,7 @@ public class TestGLJPanelAWTBug450 extends UITestCase {
frame.setVisible(true);
} } ) ;
- animator.setUpdateFPSFrames(1, null);
+ animator.setUpdateFPSFrames(1, null);
animator.start();
Assert.assertEquals(true, animator.isAnimating());
@@ -169,19 +170,19 @@ public class TestGLJPanelAWTBug450 extends UITestCase {
public void test01()
throws AWTException, InterruptedException, InvocationTargetException
{
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
runTestGL(caps);
}
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestGLJPanelAWTBug450.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java
index 1b83904a9..8e2b02fb2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java
@@ -81,13 +81,13 @@ public class TestGearsAWT extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps) throws InterruptedException, InvocationTargetException {
+ protected void runTestGL(final GLCapabilities caps) throws InterruptedException, InvocationTargetException {
final Frame frame = new Frame("Gears AWT Test");
Assert.assertNotNull(frame);
final GLCanvas glCanvas = new GLCanvas(caps);
Assert.assertNotNull(glCanvas);
- Dimension glc_sz = new Dimension(width, height);
+ final Dimension glc_sz = new Dimension(width, height);
glCanvas.setMinimumSize(glc_sz);
glCanvas.setPreferredSize(glc_sz);
glCanvas.setSize(glc_sz);
@@ -133,7 +133,7 @@ public class TestGearsAWT extends UITestCase {
@Test
public void test01() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
if( msaaCount > 0 ) {
caps.setSampleBuffers(true);
caps.setNumSamples(msaaCount);
@@ -143,28 +143,28 @@ public class TestGearsAWT extends UITestCase {
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-msaa")) {
i++;
try {
msaaCount = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-wait")) {
waitForKey = true;
}
}
if(waitForKey) {
- BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
try {
System.err.println(stdin.readLine());
- } catch (IOException e) { }
+ } catch (final IOException e) { }
}
org.junit.runner.JUnitCore.main(TestGearsAWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java
index 2c3b3d472..751bd4488 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java
@@ -81,28 +81,28 @@ public class TestGearsAWTAnalyzeBug455 extends UITestCase {
}
static class Swapper implements GLEventListener {
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
System.err.println("auto-swap: "+drawable.getAutoSwapBufferMode());
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
if(!drawable.getAutoSwapBufferMode()) {
- GL2 gl = drawable.getGL().getGL2();
+ final GL2 gl = drawable.getGL().getGL2();
// copy the colored content of the back buffer into the front buffer
// gl.glPushAttrib(GL.GL_COLOR_BUFFER_BIT);
gl.glReadBuffer(GL.GL_BACK); // def. in dbl buff mode: GL_BACK
gl.glDrawBuffer(GL.GL_FRONT); // def. in dbl buff mode: GL_BACK
- gl.glCopyPixels(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), GL2.GL_COLOR);
+ gl.glCopyPixels(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), GL2ES3.GL_COLOR);
// gl.glPopAttrib();
gl.glDrawBuffer(GL.GL_BACK); // def. in dbl buff mode: GL_BACK
}
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width,
- int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width,
+ final int height) {
}
}
- protected void runTestGL(GLCapabilities caps) throws InterruptedException, InvocationTargetException {
+ protected void runTestGL(final GLCapabilities caps) throws InterruptedException, InvocationTargetException {
final Frame frame = new Frame("Gears AWT Test");
Assert.assertNotNull(frame);
@@ -152,18 +152,18 @@ public class TestGearsAWTAnalyzeBug455 extends UITestCase {
@Test
public void test01() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setDoubleBuffered(true); // code assumes dbl buffer setup
runTestGL(caps);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-wait")) {
waitForKey = true;
} else if(args[i].equals("-autoswap")) {
@@ -172,11 +172,11 @@ public class TestGearsAWTAnalyzeBug455 extends UITestCase {
}
System.err.println("altSwap "+altSwap);
if(waitForKey) {
- BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
try {
System.err.println(stdin.readLine());
- } catch (IOException e) { }
+ } catch (final IOException e) { }
}
org.junit.runner.JUnitCore.main(TestGearsAWTAnalyzeBug455.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java
index d6cc712ee..3650e4955 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java
@@ -85,7 +85,7 @@ public class TestGearsGLJPanelAWT extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps)
+ protected void runTestGL(final GLCapabilities caps)
throws AWTException, InterruptedException, InvocationTargetException
{
final JFrame frame = new JFrame("Swing GLJPanel");
@@ -93,7 +93,7 @@ public class TestGearsGLJPanelAWT extends UITestCase {
final GLJPanel glJPanel = new GLJPanel(caps);
Assert.assertNotNull(glJPanel);
- Dimension glc_sz = new Dimension(width, height);
+ final Dimension glc_sz = new Dimension(width, height);
glJPanel.setMinimumSize(glc_sz);
glJPanel.setPreferredSize(glc_sz);
glJPanel.setSize(glc_sz);
@@ -157,7 +157,7 @@ public class TestGearsGLJPanelAWT extends UITestCase {
public void test01_DefaultNorm()
throws AWTException, InterruptedException, InvocationTargetException
{
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
if(useMSAA) {
caps.setNumSamples(4);
caps.setSampleBuffers(true);
@@ -178,7 +178,7 @@ public class TestGearsGLJPanelAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setNumSamples(4);
caps.setSampleBuffers(true);
runTestGL(caps);
@@ -191,7 +191,7 @@ public class TestGearsGLJPanelAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setPBuffer(true);
runTestGL(caps);
}
@@ -203,7 +203,7 @@ public class TestGearsGLJPanelAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setNumSamples(4);
caps.setSampleBuffers(true);
caps.setPBuffer(true);
@@ -217,7 +217,7 @@ public class TestGearsGLJPanelAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setBitmap(true);
runTestGL(caps);
}
@@ -229,7 +229,7 @@ public class TestGearsGLJPanelAWT extends UITestCase {
if( manualTest ) {
return;
}
- GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
caps.setNumSamples(4);
caps.setSampleBuffers(true);
caps.setBitmap(true);
@@ -238,7 +238,7 @@ public class TestGearsGLJPanelAWT extends UITestCase {
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java
index a5134254b..4cefd95c0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.demos.gl2.newt;
import com.jogamp.newt.event.KeyAdapter;
@@ -69,15 +69,15 @@ public class TestGearsNEWT extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+ protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle("Gears NEWT Test");
glWindow.addGLEventListener(new Gears());
- Animator animator = new Animator(glWindow);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final Animator animator = new Animator(glWindow);
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -86,10 +86,10 @@ public class TestGearsNEWT extends UITestCase {
final GLWindow f_glWindow = glWindow;
glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
- }
+ }
if(e.getKeyChar()=='f') {
new Thread() {
public void run() {
@@ -119,19 +119,19 @@ public class TestGearsNEWT extends UITestCase {
@Test
public void test01() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps);
}
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestGearsNEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java
index 50e128b21..beee5ffde 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java
@@ -69,19 +69,19 @@ public class TestGearsNewtAWTWrapper extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException {
- Display nDisplay = NewtFactory.createDisplay(NativeWindowFactory.TYPE_AWT, null, false); // local display
- Screen nScreen = NewtFactory.createScreen(nDisplay, 0); // screen 0
- Window nWindow = NewtFactory.createWindow(nScreen, caps);
+ protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException {
+ final Display nDisplay = NewtFactory.createDisplay(NativeWindowFactory.TYPE_AWT, null, false); // local display
+ final Screen nScreen = NewtFactory.createScreen(nDisplay, 0); // screen 0
+ final Window nWindow = NewtFactory.createWindow(nScreen, caps);
- GLWindow glWindow = GLWindow.create(nWindow);
+ final GLWindow glWindow = GLWindow.create(nWindow);
Assert.assertNotNull(glWindow);
glWindow.setTitle("Gears NewtAWTWrapper Test");
glWindow.addGLEventListener(new GearsES2(1));
- Animator animator = useAnimator ? new Animator(glWindow) : null;
- QuitAdapter quitAdapter = new QuitAdapter();
+ final Animator animator = useAnimator ? new Animator(glWindow) : null;
+ final QuitAdapter quitAdapter = new QuitAdapter();
glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -136,11 +136,11 @@ public class TestGearsNewtAWTWrapper extends UITestCase {
@Test
public void test01() throws InterruptedException {
- GLCapabilitiesImmutable caps = new GLCapabilities(glp);
+ final GLCapabilitiesImmutable caps = new GLCapabilities(glp);
runTestGL(caps);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestTeapotNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestTeapotNEWT.java
index 5a22fc7b1..975d35ad2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestTeapotNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestTeapotNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.demos.gl2.newt;
import com.jogamp.newt.opengl.GLWindow;
@@ -67,11 +67,11 @@ public class TestTeapotNEWT extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps, boolean withAnimator) throws InterruptedException {
+ protected void runTestGL(final GLCapabilities caps, final boolean withAnimator) throws InterruptedException {
final GLWindow glWindow = GLWindow.create(caps);
-
+
glWindow.setTitle("Teapot NEWT Test");
- Teapot demo = new Teapot();
+ final Teapot demo = new Teapot();
if( !withAnimator ) {
demo.rotIncr *= 10f;
}
@@ -119,13 +119,13 @@ public class TestTeapotNEWT extends UITestCase {
final GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
runTestGL(caps, true);
}
-
+
@Test
public void test02_DefCaps_NoAnim() throws InterruptedException {
final GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
runTestGL(caps, false);
}
-
+
@Test
public void test12_FBOCaps_NoAnim() throws InterruptedException {
final GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
@@ -148,13 +148,13 @@ public class TestTeapotNEWT extends UITestCase {
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestTeapotNEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/GeomShader01TextureGL3.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/GeomShader01TextureGL3.java
index 13f299aeb..30840c1b7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/GeomShader01TextureGL3.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/GeomShader01TextureGL3.java
@@ -78,12 +78,12 @@ public class GeomShader01TextureGL3 implements GLEventListener {
static final String shaderBasename = "texture01_xxx";
static final String[] geomShaderBaseNames = new String[] { "passthrough01_xxx", "flipXYZ01_xxx" };
- public GeomShader01TextureGL3(int geomShader) {
+ public GeomShader01TextureGL3(final int geomShader) {
this.geomShader = geomShader;
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
{
final GL gl = drawable.getGL();
System.err.println("Init - START - useGeomShader "+geomShader+" -> "+geomShaderBaseNames[geomShader]);
@@ -130,9 +130,9 @@ public class GeomShader01TextureGL3 implements GLEventListener {
// setup mgl_PMVMatrix
pmvMatrix = new PMVMatrix();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
st.ownUniform(pmvMatrixUniform);
@@ -148,7 +148,7 @@ public class GeomShader01TextureGL3 implements GLEventListener {
try {
texture = createTestTexture(gl);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new RuntimeException(e);
}
if(null == texture) {
@@ -160,7 +160,7 @@ public class GeomShader01TextureGL3 implements GLEventListener {
// TL, TR, BR
{
int i=0;
- TextureCoords tc = texture.getImageTexCoords();
+ final TextureCoords tc = texture.getImageTexCoords();
s_triTexCoords[i++] = tc.left(); s_triTexCoords[i++] = tc.top();
s_triTexCoords[i++] = tc.left(); s_triTexCoords[i++] = tc.bottom();
s_triTexCoords[i++] = tc.right(); s_triTexCoords[i++] = tc.bottom();
@@ -175,7 +175,7 @@ public class GeomShader01TextureGL3 implements GLEventListener {
interleavedVBO.addGLSLSubArray("mgl_Color", 4, GL.GL_ARRAY_BUFFER);
interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
- FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
+ final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
for(int i=0; i<6; i++) {
ib.put(s_triVertices, i*2, 2);
@@ -192,7 +192,7 @@ public class GeomShader01TextureGL3 implements GLEventListener {
st.useProgram(gl, false);
}
- private Texture createTestTexture(GL3 gl) throws IOException {
+ private Texture createTestTexture(final GL3 gl) throws IOException {
final URLConnection urlConn = IOUtil.getResource(this.getClass(), "../../util/texture/test-ntscN_3-01-160x90.png");
if(null == urlConn) { return null; }
final InputStream istream = urlConn.getInputStream();
@@ -204,7 +204,7 @@ public class GeomShader01TextureGL3 implements GLEventListener {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
final GL3 gl = drawable.getGL().getGL3();
if(null!=texture) {
texture.disable(gl);
@@ -220,8 +220,8 @@ public class GeomShader01TextureGL3 implements GLEventListener {
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
- GL3 gl = drawable.getGL().getGL3();
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ final GL3 gl = drawable.getGL().getGL3();
gl.setSwapInterval(1);
@@ -243,7 +243,7 @@ public class GeomShader01TextureGL3 implements GLEventListener {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GL3 gl = drawable.getGL().getGL3();
gl.glClear(GL.GL_DEPTH_BUFFER_BIT | GL.GL_COLOR_BUFFER_BIT);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/newt/TestGeomShader01TextureGL3NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/newt/TestGeomShader01TextureGL3NEWT.java
index 8e582bd3b..583334e1f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/newt/TestGeomShader01TextureGL3NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/newt/TestGeomShader01TextureGL3NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -51,73 +51,73 @@ import com.jogamp.opengl.util.Animator;
public class TestGeomShader01TextureGL3NEWT extends UITestCase {
static long duration = 500; // ms
- static GLCapabilities getCaps(String profile) {
+ static GLCapabilities getCaps(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
}
return new GLCapabilities(GLProfile.get(profile));
}
-
+
@Test
public void test01_GL3Core_Passthrough() throws InterruptedException {
- GLCapabilities caps = getCaps(GLProfile.GL3);
+ final GLCapabilities caps = getCaps(GLProfile.GL3);
if( null == caps ) { return; }
testImpl(caps, 0);
}
-
+
@Test
public void test02_GL3Core_FlipXYZ() throws InterruptedException {
- GLCapabilities caps = getCaps(GLProfile.GL3);
+ final GLCapabilities caps = getCaps(GLProfile.GL3);
if( null == caps ) { return; }
testImpl(caps, 1);
}
-
+
@Test
public void test11_GL3Compat_Passthrough() throws InterruptedException {
- GLCapabilities caps = getCaps(GLProfile.GL3bc);
+ final GLCapabilities caps = getCaps(GLProfile.GL3bc);
if( null == caps ) { return; }
testImpl(caps, 0);
}
-
+
@Test
public void test12_GL3Compat_FlipXYZ() throws InterruptedException {
- GLCapabilities caps = getCaps(GLProfile.GL3bc);
+ final GLCapabilities caps = getCaps(GLProfile.GL3bc);
if( null == caps ) { return; }
testImpl(caps, 1);
}
-
- private void testImpl(GLCapabilities caps, int geomShader) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+
+ private void testImpl(final GLCapabilities caps, final int geomShader) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setSize(800, 600);
glWindow.setVisible(true);
glWindow.setTitle("JOGL Geometry Shader Banana Test");
Assert.assertTrue(glWindow.isNativeValid());
-
- QuitAdapter quitAdapter = new QuitAdapter();
+
+ final QuitAdapter quitAdapter = new QuitAdapter();
glWindow.addKeyListener(quitAdapter);
glWindow.addWindowListener(quitAdapter);
glWindow.addGLEventListener( new GeomShader01TextureGL3(geomShader) );
-
+
final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
glWindow.addGLEventListener(snapshotGLEventListener);
-
+
final Animator animator = new Animator(glWindow);
animator.start();
-
+
animator.setUpdateFPSFrames(60, System.err);
snapshotGLEventListener.setMakeSnapshot();
-
+
while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
Thread.sleep(100);
}
-
+
animator.stop();
glWindow.destroy();
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java
index f55e331a7..fa8406fa2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java
@@ -39,33 +39,33 @@ import org.junit.Assert;
public class GLSLMiscHelper {
public static final int frames_perftest = 600; // frames
public static final int frames_warmup = 100; // frames
-
- public static void validateGLArrayDataServerState(GL2ES2 gl, ShaderState st, GLArrayDataServer data) {
- int[] qi = new int[1];
- if(null != st) {
- Assert.assertEquals(data, st.getAttribute(data.getName()));
+
+ public static void validateGLArrayDataServerState(final GL2ES2 gl, final ShaderState st, final GLArrayDataServer data) {
+ final int[] qi = new int[1];
+ if(null != st) {
+ Assert.assertEquals(data, st.getAttribute(data.getName()));
if(st.shaderProgram().linked()) {
Assert.assertEquals(data.getLocation(), st.getCachedAttribLocation(data.getName()));
Assert.assertEquals(data.getLocation(), st.getAttribLocation(gl, data));
Assert.assertEquals(data.getLocation(), st.getAttribLocation(gl, data.getName()));
- Assert.assertEquals(data.getLocation(), gl.glGetAttribLocation(st.shaderProgram().program(), data.getName()));
+ Assert.assertEquals(data.getLocation(), gl.glGetAttribLocation(st.shaderProgram().program(), data.getName()));
}
}
gl.glGetVertexAttribiv(data.getLocation(), GL2ES2.GL_VERTEX_ATTRIB_ARRAY_ENABLED, qi, 0);
Assert.assertEquals(data.enabled()?GL.GL_TRUE:GL.GL_FALSE, qi[0]);
gl.glGetVertexAttribiv(data.getLocation(), GL2ES2.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, qi, 0);
- Assert.assertEquals(data.getVBOName(), qi[0]);
- Assert.assertEquals(data.getSizeInBytes(), gl.glGetBufferSize(data.getVBOName()));
+ Assert.assertEquals(data.getVBOName(), qi[0]);
+ Assert.assertEquals(data.getSizeInBytes(), gl.glGetBufferSize(data.getVBOName()));
}
- public static void pause(long ms) throws InterruptedException {
- long t0 = System.currentTimeMillis();
+ public static void pause(final long ms) throws InterruptedException {
+ final long t0 = System.currentTimeMillis();
while( System.currentTimeMillis() - t0 < ms) {
Thread.sleep(ms);
- }
+ }
}
-
- public static void displayVCArrays(GLDrawable drawable, GL2ES2 gl, ShaderState st, boolean preEnable, GLArrayDataServer vertices, GLArrayDataServer colors, boolean postDisable, int num, long postDelay) throws InterruptedException {
+
+ public static void displayVCArrays(final GLDrawable drawable, final GL2ES2 gl, final ShaderState st, final boolean preEnable, final GLArrayDataServer vertices, final GLArrayDataServer colors, final boolean postDisable, final int num, final long postDelay) throws InterruptedException {
System.err.println("screen #"+num);
if(preEnable) {
vertices.enableBuffer(gl, true);
@@ -79,11 +79,11 @@ public class GLSLMiscHelper {
}
Assert.assertTrue(vertices.enabled());
Assert.assertTrue(colors.enabled());
-
+
validateGLArrayDataServerState(gl, st, vertices);
validateGLArrayDataServerState(gl, st, colors);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
- gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
+ gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
if(postDisable) {
vertices.enableBuffer(gl, false);
@@ -93,24 +93,24 @@ public class GLSLMiscHelper {
}
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
drawable.swapBuffers();
- if(postDelay>0) { pause(postDelay); }
+ if(postDelay>0) { pause(postDelay); }
}
-
- public static void displayVCArraysNoChecks(GLDrawable drawable, GL2ES2 gl, boolean preEnable, GLArrayDataServer vertices, GLArrayDataServer colors, boolean postDisable) throws InterruptedException {
+
+ public static void displayVCArraysNoChecks(final GLDrawable drawable, final GL2ES2 gl, final boolean preEnable, final GLArrayDataServer vertices, final GLArrayDataServer colors, final boolean postDisable) throws InterruptedException {
if(preEnable) {
vertices.enableBuffer(gl, true);
colors.enableBuffer(gl, true);
}
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
- gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
+ gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
if(postDisable) {
vertices.enableBuffer(gl, false);
colors.enableBuffer(gl, false);
}
drawable.swapBuffers();
}
-
- public static GLArrayDataServer createVertices(GL2ES2 gl, ShaderState st, int shaderProgram, int location, float[] vertices) {
+
+ public static GLArrayDataServer createVertices(final GL2ES2 gl, final ShaderState st, final int shaderProgram, final int location, final float[] vertices) {
if(null != st && 0 != shaderProgram) {
throw new InternalError("Use either ShaderState _or_ shader-program, not both");
}
@@ -118,7 +118,7 @@ public class GLSLMiscHelper {
throw new InternalError("Pass a valid ShaderState _xor_ shader-program, not none");
}
// Allocate Vertex Array0
- GLArrayDataServer vDataArray = GLArrayDataServer.createGLSL("mgl_Vertex", 3, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
+ final GLArrayDataServer vDataArray = GLArrayDataServer.createGLSL("mgl_Vertex", 3, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
if(null != st) {
st.ownAttribute(vDataArray, true);
if(0<=location) {
@@ -144,7 +144,7 @@ public class GLSLMiscHelper {
Assert.assertTrue(vDataArray.isVBOWritten());
Assert.assertTrue(vDataArray.sealed());
Assert.assertEquals(4, vDataArray.getElementCount());
- Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+ Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
Assert.assertEquals(0, gl.getBoundBuffer(GL.GL_ARRAY_BUFFER)); // should be cleared ASAP
validateGLArrayDataServerState(gl, st, vDataArray);
return vDataArray;
@@ -153,20 +153,20 @@ public class GLSLMiscHelper {
2f, 2f, 0f,
-2f, -2f, 0f,
2f, -2f, 0f };
-
+
public static float[] vertices1 = new float[] { -2f, 1f, 0f,
2f, 1f, 0f,
-2f, -1f, 0f,
2f, -1f, 0f };
-
- public static GLArrayDataServer createColors(GL2ES2 gl, ShaderState st, int shaderProgram, int location, float[] colors) {
+
+ public static GLArrayDataServer createColors(final GL2ES2 gl, final ShaderState st, final int shaderProgram, final int location, final float[] colors) {
if(null != st && 0 != shaderProgram) {
throw new InternalError("Use either ShaderState _or_ shader-program, not both");
}
if(null == st && 0 == shaderProgram) {
throw new InternalError("Pass a valid ShaderState _xor_ shader-program, not none");
}
- GLArrayDataServer cDataArray = GLArrayDataServer.createGLSL("mgl_Color", 4, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
+ final GLArrayDataServer cDataArray = GLArrayDataServer.createGLSL("mgl_Color", 4, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
if(null != st) {
st.ownAttribute(cDataArray, true);
if(0<=location) {
@@ -198,10 +198,10 @@ public class GLSLMiscHelper {
0f, 0f, 1f, 1f,
1f, 0f, 0f, 1f,
1f, 0f, 1f, 1f };
-
+
public static float[] colors1 = new float[] { 1f, 0f, 1f, 1f,
0f, 1f, 0f, 1f,
1f, 0f, 1f, 1f,
1f, 0f, 1f, 1f };
-
+
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java
index 99d2dd683..b3e01ac0f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java
@@ -38,12 +38,14 @@ import com.jogamp.opengl.test.junit.util.NEWTGLContext;
import com.jogamp.opengl.test.junit.util.UITestCase;
import java.io.IOException;
+
import javax.media.opengl.GL;
import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLDrawable;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import org.junit.Assert;
import org.junit.Test;
@@ -61,7 +63,7 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
static final int vertices0_loc = 0; // FIXME: AMD needs this to be location 0 ? hu ?
static final int colors0_loc = 1;
-
+
@Test
public void test00NoShaderState_Validation() throws InterruptedException {
// preset ..
@@ -72,109 +74,109 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
System.err.println(winctx.context);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
- // test code ..
- final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class,
+
+ // test code ..
+ final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class,
"shader", "shader/bin", "RedSquareShader", true);
- final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class,
+ final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class,
"shader", "shader/bin", "RedSquareShader", true);
rsVp.defaultShaderCustomization(gl, true, true);
rsFp.defaultShaderCustomization(gl, true, true);
final ShaderProgram sp = new ShaderProgram();
Assert.assertTrue(0 == sp.program());
-
+
sp.add(gl, rsVp, System.err);
sp.add(gl, rsFp, System.err);
-
- Assert.assertTrue(0 != sp.program());
+
+ Assert.assertTrue(0 != sp.program());
Assert.assertTrue(!sp.inUse());
Assert.assertTrue(!sp.linked());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
Assert.assertTrue( sp.link(gl, System.err) );
sp.useProgram(gl, true);
-
+
// Allocate Vertex Array0
final GLArrayDataServer vertices0 = GLSLMiscHelper.createVertices(gl, null, sp.program(), vertices0_loc, GLSLMiscHelper.vertices0);
- System.err.println("vertices0: " + vertices0);
+ System.err.println("vertices0: " + vertices0);
vertices0.enableBuffer(gl, false);
Assert.assertEquals(vertices0_loc, vertices0.getLocation());
-
+
// Allocate Color Array0
final GLArrayDataServer colors0 = GLSLMiscHelper.createColors(gl, null, sp.program(), colors0_loc, GLSLMiscHelper.colors0);
System.err.println("colors0: " + colors0);
colors0.enableBuffer(gl, false);
Assert.assertEquals(colors0_loc, colors0.getLocation());
-
+
Assert.assertTrue(sp.link(gl, System.err));
Assert.assertTrue(sp.linked());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
Assert.assertEquals(vertices0_loc, vertices0.getLocation());
GLSLMiscHelper.validateGLArrayDataServerState(gl, null, vertices0);
-
+
Assert.assertEquals(colors0_loc, colors0.getLocation());
GLSLMiscHelper.validateGLArrayDataServerState(gl, null, colors0);
-
+
sp.useProgram(gl, true);
Assert.assertTrue(sp.inUse());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
// setup mgl_PMVMatrix
final PMVMatrix pmvMatrix = new PMVMatrix();
final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
pmvMatrixUniform.setLocation(gl, sp.program());
gl.glUniform(pmvMatrixUniform);
-
+
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
// Allocate Vertex Array1
final GLArrayDataServer vertices1 = GLSLMiscHelper.createVertices(gl, null, sp.program(), -1, GLSLMiscHelper.vertices1);
System.err.println("vertices1: " + vertices1);
vertices1.enableBuffer(gl, false);
GLSLMiscHelper.validateGLArrayDataServerState(gl, null, vertices1);
-
+
// Allocate Color Array1
final GLArrayDataServer colors1 = GLSLMiscHelper.createColors(gl, null, sp.program(), -1, GLSLMiscHelper.colors1);
System.err.println("colors1: " + colors1);
colors1.enableBuffer(gl, false);
GLSLMiscHelper.validateGLArrayDataServerState(gl, null, colors1);
-
+
// misc GL setup
gl.glClearColor(0, 0, 0, 1);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
// reshape
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
pmvMatrix.gluPerspective(45.0F, (float) drawable.getSurfaceWidth() / (float) drawable.getSurfaceHeight(), 1.0F, 100.0F);
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrix.glTranslatef(0, 0, -10);
gl.glUniform(pmvMatrixUniform);
-
- gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+
+ gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
// display #1 vertices0 / colors0 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, null, true, vertices0, colors0, true, 1, durationPerTest);
// display #2 #1 vertices1 / colors1 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, null, true, vertices1, colors1, true, 2, durationPerTest);
-
+
// display #3 vertices0 / colors0 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, null, true, vertices0, colors0, true, 3, durationPerTest);
-
+
// cleanup
sp.useProgram(gl, false);
sp.destroy(gl);
vertices1.destroy(gl);
colors0.destroy(gl);
colors1.destroy(gl);
-
+
NEWTGLContext.destroyWindow(winctx);
}
@@ -188,10 +190,10 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
System.err.println(winctx.context);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
- // test code ..
+
+ // test code ..
final ShaderState st = new ShaderState();
-
+
final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
"shader/bin", "RedSquareShader", true);
final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -201,95 +203,95 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
final ShaderProgram sp = new ShaderProgram();
Assert.assertTrue(0 == sp.program());
-
+
sp.add(gl, rsVp, System.err);
sp.add(gl, rsFp, System.err);
-
- Assert.assertTrue(0 != sp.program());
+
+ Assert.assertTrue(0 != sp.program());
Assert.assertTrue(!sp.inUse());
Assert.assertTrue(!sp.linked());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
st.attachShaderProgram(gl, sp, false);
Assert.assertTrue(!sp.inUse());
Assert.assertTrue(!sp.linked());
-
+
// Allocate Vertex Array0
final GLArrayDataServer vertices0 = GLSLMiscHelper.createVertices(gl, st, 0, vertices0_loc, GLSLMiscHelper.vertices0);
- System.err.println("vertices0: " + vertices0);
+ System.err.println("vertices0: " + vertices0);
vertices0.enableBuffer(gl, false);
Assert.assertEquals(vertices0_loc, vertices0.getLocation());
-
+
// Allocate Color Array0
final GLArrayDataServer colors0 = GLSLMiscHelper.createColors(gl, st, 0, colors0_loc, GLSLMiscHelper.colors0);
System.err.println("colors0: " + colors0);
colors0.enableBuffer(gl, false);
Assert.assertEquals(colors0_loc, colors0.getLocation());
-
+
Assert.assertTrue(sp.link(gl, System.err));
Assert.assertTrue(sp.linked());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
Assert.assertEquals(vertices0_loc, vertices0.getLocation());
GLSLMiscHelper.validateGLArrayDataServerState(gl, st, vertices0);
-
+
Assert.assertEquals(colors0_loc, colors0.getLocation());
GLSLMiscHelper.validateGLArrayDataServerState(gl, st, colors0);
-
+
st.useProgram(gl, true);
Assert.assertTrue(sp.inUse());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
// setup mgl_PMVMatrix
final PMVMatrix pmvMatrix = new PMVMatrix();
final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
st.ownUniform(pmvMatrixUniform);
-
+
st.uniform(gl, pmvMatrixUniform);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
Assert.assertEquals(pmvMatrixUniform, st.getUniform("mgl_PMVMatrix"));
-
+
// Allocate Vertex Array1
final GLArrayDataServer vertices1 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices1);
System.err.println("vertices1: " + vertices1);
vertices1.enableBuffer(gl, false);
GLSLMiscHelper.validateGLArrayDataServerState(gl, st, vertices1);
-
+
// Allocate Color Array1
final GLArrayDataServer colors1 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors1);
System.err.println("colors1: " + colors1);
colors1.enableBuffer(gl, false);
GLSLMiscHelper.validateGLArrayDataServerState(gl, st, colors1);
-
+
// misc GL setup
gl.glClearColor(0, 0, 0, 1);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
// reshape
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
pmvMatrix.gluPerspective(45.0F, (float) drawable.getSurfaceWidth() / (float) drawable.getSurfaceHeight(), 1.0F, 100.0F);
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrix.glTranslatef(0, 0, -10);
st.uniform(gl, pmvMatrixUniform);
- gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+ gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
// display #1 vertices0 / colors0 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, durationPerTest);
// display #2 #1 vertices1 / colors1 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 2, durationPerTest);
-
+
// display #3 vertices0 / colors0 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 3, durationPerTest);
-
+
// cleanup
st.destroy(gl);
-
+
NEWTGLContext.destroyWindow(winctx);
}
@@ -301,8 +303,8 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
public void test03ShaderState_PerformanceSingleToggleEnable() throws InterruptedException {
testShaderState_PerformanceSingleImpl(true);
}
-
- private void testShaderState_PerformanceSingleImpl(boolean toggleEnable) throws InterruptedException {
+
+ private void testShaderState_PerformanceSingleImpl(final boolean toggleEnable) throws InterruptedException {
// preset ..
final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(
new GLCapabilities(GLProfile.getGL2ES2()), 480, 480, false);
@@ -310,12 +312,12 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
final GL2ES2 gl = winctx.context.getGL().getGL2ES2();
System.err.println(winctx.context);
gl.setSwapInterval(0);
-
+
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
- // test code ..
+
+ // test code ..
final ShaderState st = new ShaderState();
-
+
final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
"shader/bin", "RedSquareShader", true);
final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -326,70 +328,70 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
final ShaderProgram sp = new ShaderProgram();
sp.add(rsVp);
sp.add(rsFp);
-
+
sp.init(gl);
Assert.assertTrue(sp.link(gl, System.err));
-
- st.attachShaderProgram(gl, sp, true);
-
+
+ st.attachShaderProgram(gl, sp, true);
+
// setup mgl_PMVMatrix
final PMVMatrix pmvMatrix = new PMVMatrix();
- final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
+ final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
st.ownUniform(pmvMatrixUniform);
st.uniform(gl, pmvMatrixUniform);
-
+
// Allocate Vertex Array0
final GLArrayDataServer vertices0 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices0);
vertices0.enableBuffer(gl, toggleEnable ? false : true);
-
+
// Allocate Color Array0
final GLArrayDataServer colors0 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors0);
colors0.enableBuffer(gl, toggleEnable ? false : true);
-
+
// misc GL setup
gl.glClearColor(0, 0, 0, 1);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
// reshape
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
pmvMatrix.gluPerspective(45.0F, (float) drawable.getSurfaceWidth() / (float) drawable.getSurfaceHeight(), 1.0F, 100.0F);
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrix.glTranslatef(0, 0, -10);
st.uniform(gl, pmvMatrixUniform);
- gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+ gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
gl.setSwapInterval(0);
-
+
// validation ..
GLSLMiscHelper.displayVCArrays(drawable, gl, st, toggleEnable, vertices0, colors0, toggleEnable, 1, 0);
-
+
// warmup ..
for(int frames=0; frames<GLSLMiscHelper.frames_warmup; frames++) {
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, toggleEnable, vertices0, colors0, toggleEnable);
}
-
+
// measure ..
- long t0 = System.currentTimeMillis();
+ final long t0 = System.currentTimeMillis();
int frames;
-
+
for(frames=0; frames<GLSLMiscHelper.frames_perftest; frames++) {
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, toggleEnable, vertices0, colors0, toggleEnable);
- }
+ }
final long t1 = System.currentTimeMillis();
- final long dt = t1 - t0;
- final double fps = ( frames * 1000.0 ) / (double) dt;
- final String fpsS = String.valueOf(fps);
- final int fpsSp = fpsS.indexOf('.');
- System.err.println("testShaderState00PerformanceSingle toggleEnable "+toggleEnable+": "+dt/1000.0 +"s: "+ frames + "f, " + fpsS.substring(0, fpsSp+2) + " fps, "+dt/frames+" ms/f");
-
+ final long dt = t1 - t0;
+ final double fps = ( frames * 1000.0 ) / dt;
+ final String fpsS = String.valueOf(fps);
+ final int fpsSp = fpsS.indexOf('.');
+ System.err.println("testShaderState00PerformanceSingle toggleEnable "+toggleEnable+": "+dt/1000.0 +"s: "+ frames + "f, " + fpsS.substring(0, fpsSp+2) + " fps, "+dt/frames+" ms/f");
+
// cleanup
st.destroy(gl);
-
- NEWTGLContext.destroyWindow(winctx);
+
+ NEWTGLContext.destroyWindow(winctx);
}
-
+
@Test(timeout=240000)
public void test04ShaderState_PerformanceDouble() throws InterruptedException {
// preset ..
@@ -399,12 +401,12 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
final GL2ES2 gl = winctx.context.getGL().getGL2ES2();
System.err.println(winctx.context);
gl.setSwapInterval(0);
-
+
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
- // test code ..
+
+ // test code ..
final ShaderState st = new ShaderState();
-
+
final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
"shader/bin", "RedSquareShader", true);
final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -415,82 +417,82 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
final ShaderProgram sp = new ShaderProgram();
sp.add(rsVp);
sp.add(rsFp);
-
+
sp.init(gl);
Assert.assertTrue(sp.link(gl, System.err));
-
- st.attachShaderProgram(gl, sp, true);
-
+
+ st.attachShaderProgram(gl, sp, true);
+
// setup mgl_PMVMatrix
final PMVMatrix pmvMatrix = new PMVMatrix();
final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
st.ownUniform(pmvMatrixUniform);
st.uniform(gl, pmvMatrixUniform);
-
+
// Allocate Vertex Array0
final GLArrayDataServer vertices0 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices0);
vertices0.enableBuffer(gl, false);
-
+
// Allocate Vertex Array1
final GLArrayDataServer vertices1 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices1);
vertices1.enableBuffer(gl, false);
-
+
// Allocate Color Array0
final GLArrayDataServer colors0 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors0);
colors0.enableBuffer(gl, false);
-
+
// Allocate Color Array1
final GLArrayDataServer colors1 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors1);
colors1.enableBuffer(gl, false);
-
+
// misc GL setup
gl.glClearColor(0, 0, 0, 1);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
// reshape
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
pmvMatrix.gluPerspective(45.0F, (float) drawable.getSurfaceWidth() / (float) drawable.getSurfaceHeight(), 1.0F, 100.0F);
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrix.glTranslatef(0, 0, -10);
st.uniform(gl, pmvMatrixUniform);
- gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+ gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
gl.setSwapInterval(0);
-
+
// validation ..
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, 0);
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 2, 0);
-
+
// warmup ..
for(int frames=0; frames<GLSLMiscHelper.frames_warmup; frames+=2) {
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices0, colors0, true);
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices1, colors1, true);
}
-
+
// measure ..
- long t0 = System.currentTimeMillis();
+ final long t0 = System.currentTimeMillis();
int frames;
-
+
for(frames=0; frames<GLSLMiscHelper.frames_perftest; frames+=2) {
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices0, colors0, true);
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices1, colors1, true);
- }
+ }
final long t1 = System.currentTimeMillis();
- final long dt = t1 - t0;
- final double fps = ( frames * 1000.0 ) / (double) dt;
- final String fpsS = String.valueOf(fps);
- final int fpsSp = fpsS.indexOf('.');
- System.err.println("testShaderState01PerformanceDouble: "+dt/1000.0 +"s: "+ frames + "f, " + fpsS.substring(0, fpsSp+2) + " fps, "+dt/frames+" ms/f");
-
+ final long dt = t1 - t0;
+ final double fps = ( frames * 1000.0 ) / dt;
+ final String fpsS = String.valueOf(fps);
+ final int fpsSp = fpsS.indexOf('.');
+ System.err.println("testShaderState01PerformanceDouble: "+dt/1000.0 +"s: "+ frames + "f, " + fpsS.substring(0, fpsSp+2) + " fps, "+dt/frames+" ms/f");
+
// cleanup
st.destroy(gl);
-
+
NEWTGLContext.destroyWindow(winctx);
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
System.err.println("main - start");
boolean wait = false;
for(int i=0; i<args.length; i++) {
@@ -504,16 +506,16 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
}
if(wait) {
while(-1 == System.in.read()) ;
- TestGLSLShaderState01NEWT tst = new TestGLSLShaderState01NEWT();
+ final TestGLSLShaderState01NEWT tst = new TestGLSLShaderState01NEWT();
try {
tst.test04ShaderState_PerformanceDouble();
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
} else {
- String tstname = TestGLSLShaderState01NEWT.class.getName();
+ final String tstname = TestGLSLShaderState01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
System.err.println("main - end");
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java
index 6279684d3..21d945470 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java
@@ -38,12 +38,14 @@ import com.jogamp.opengl.test.junit.util.NEWTGLContext;
import com.jogamp.opengl.test.junit.util.UITestCase;
import java.io.IOException;
+
import javax.media.opengl.GL;
import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLDrawable;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import org.junit.Assert;
import org.junit.Test;
@@ -60,7 +62,7 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
static final int vertices0_loc = 0; // FIXME: AMD needs this to be location 0 ? hu ?
static final int colors0_loc = 5;
-
+
@Test
public void testShaderState01ValidationSP1Linked() throws InterruptedException {
testShaderState01Validation(true);
@@ -69,20 +71,20 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
public void testShaderState01ValidationSP1Unlinked() throws InterruptedException {
testShaderState01Validation(false);
}
-
- private void testShaderState01Validation(boolean linkSP1) throws InterruptedException {
+
+ private void testShaderState01Validation(final boolean linkSP1) throws InterruptedException {
// preset ..
final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(
new GLCapabilities(GLProfile.getGL2ES2()), 480, 480, true);
final GLDrawable drawable = winctx.context.getGLDrawable();
final GL2ES2 gl = winctx.context.getGL().getGL2ES2();
System.err.println(winctx.context);
-
+
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
- // test code ..
+
+ // test code ..
final ShaderState st = new ShaderState();
-
+
final ShaderCode rsVp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
"shader/bin", "RedSquareShader", true);
final ShaderCode rsFp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -97,9 +99,9 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
sp1.add(rsVp0);
sp1.add(rsFp1);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- Assert.assertTrue(0 == sp1.program());
+ Assert.assertTrue(0 == sp1.program());
Assert.assertTrue(sp1.init(gl));
- Assert.assertTrue(0 != sp1.program());
+ Assert.assertTrue(0 != sp1.program());
Assert.assertTrue(!sp1.inUse());
Assert.assertTrue(!sp1.linked());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
@@ -108,134 +110,134 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
Assert.assertTrue(sp1.linked());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
}
-
- final ShaderProgram sp0 = new ShaderProgram();
+
+ final ShaderProgram sp0 = new ShaderProgram();
sp0.add(rsVp0);
sp0.add(rsFp0);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
- Assert.assertTrue(0 == sp0.program());
+
+ Assert.assertTrue(0 == sp0.program());
Assert.assertTrue(sp0.init(gl));
- Assert.assertTrue(0 != sp0.program());
+ Assert.assertTrue(0 != sp0.program());
Assert.assertTrue(!sp0.inUse());
Assert.assertTrue(!sp0.linked());
- Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+ Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
st.attachShaderProgram(gl, sp0, false);
Assert.assertTrue(!sp0.inUse());
Assert.assertTrue(!sp0.linked());
-
+
// Allocate Vertex Array0
final GLArrayDataServer vertices0 = GLSLMiscHelper.createVertices(gl, st, 0, vertices0_loc, GLSLMiscHelper.vertices0);
- System.err.println("vertices0: " + vertices0);
+ System.err.println("vertices0: " + vertices0);
vertices0.enableBuffer(gl, false);
Assert.assertEquals(vertices0_loc, vertices0.getLocation());
-
+
// Allocate Color Array0
final GLArrayDataServer colors0 = GLSLMiscHelper.createColors(gl, st, 0, colors0_loc, GLSLMiscHelper.colors0);
System.err.println("colors0: " + colors0);
colors0.enableBuffer(gl, false);
Assert.assertEquals(colors0_loc, colors0.getLocation());
-
+
Assert.assertTrue(sp0.link(gl, System.err));
Assert.assertTrue(sp0.linked());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
Assert.assertEquals(vertices0_loc, vertices0.getLocation());
Assert.assertEquals(vertices0_loc, st.getAttribLocation(gl, vertices0.getName()));
Assert.assertEquals(vertices0_loc, gl.glGetAttribLocation(st.shaderProgram().program(), vertices0.getName()));
-
+
Assert.assertEquals(colors0_loc, colors0.getLocation());
Assert.assertEquals(colors0_loc, st.getAttribLocation(gl, colors0.getName()));
Assert.assertEquals(colors0_loc, gl.glGetAttribLocation(st.shaderProgram().program(), colors0.getName()));
-
+
st.useProgram(gl, true);
Assert.assertTrue(sp0.inUse());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
// setup mgl_PMVMatrix
final PMVMatrix pmvMatrix = new PMVMatrix();
final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
st.ownUniform(pmvMatrixUniform);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
st.uniform(gl, pmvMatrixUniform);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
Assert.assertEquals(pmvMatrixUniform, st.getUniform("mgl_PMVMatrix"));
-
+
// Allocate Vertex Array1
final GLArrayDataServer vertices1 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices1);
System.err.println("vertices1: " + vertices1);
vertices1.enableBuffer(gl, false);
-
+
// Allocate Color Array1
final GLArrayDataServer colors1 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors1);
System.err.println("colors1: " + colors1);
colors1.enableBuffer(gl, false);
-
+
// misc GL setup
gl.glClearColor(0, 0, 0, 1);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
// reshape
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
pmvMatrix.gluPerspective(45.0F, (float) drawable.getSurfaceWidth() / (float) drawable.getSurfaceHeight(), 1.0F, 100.0F);
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrix.glTranslatef(0, 0, -10);
st.uniform(gl, pmvMatrixUniform);
gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
// display #1 vertices0 / colors0 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, durationPerTest);
// display #2 vertices1 / colors1 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 2, durationPerTest);
-
+
// display #3 vertices0 / colors0 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 3, durationPerTest);
// display #4 vertices1 / colors1 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 4, durationPerTest);
-
+
// SP1
- st.attachShaderProgram(gl, sp1, true);
+ st.attachShaderProgram(gl, sp1, true);
Assert.assertTrue(sp1.inUse());
Assert.assertTrue(sp1.linked());
-
+
if(!linkSP1) {
// all attribute locations shall be same now, due to impl. glBindAttributeLocation
Assert.assertEquals(vertices0_loc, vertices0.getLocation());
Assert.assertEquals(vertices0_loc, st.getAttribLocation(gl, vertices0.getName()));
Assert.assertEquals(vertices0_loc, gl.glGetAttribLocation(st.shaderProgram().program(), vertices0.getName()));
-
+
Assert.assertEquals(colors0_loc, colors0.getLocation());
Assert.assertEquals(colors0_loc, st.getAttribLocation(gl, colors0.getName()));
Assert.assertEquals(colors0_loc, gl.glGetAttribLocation(st.shaderProgram().program(), colors0.getName()));
}
-
+
// display #1 vertices0 / colors0 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 10, durationPerTest);
// display #2 vertices1 / colors1 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 20, durationPerTest);
-
+
// display #3 vertices0 / colors0 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 30, durationPerTest);
-
+
// display #4 vertices1 / colors1 (post-disable)
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 40, durationPerTest);
-
+
// cleanup
st.destroy(gl);
-
+
NEWTGLContext.destroyWindow(winctx);
}
- @Test(timeout=240000)
+ @Test(timeout=240000)
public void testShaderState01PerformanceDouble() throws InterruptedException {
// preset ..
final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(
@@ -244,12 +246,12 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
final GL2ES2 gl = winctx.context.getGL().getGL2ES2();
System.err.println(winctx.context);
gl.setSwapInterval(0);
-
+
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
- // test code ..
+
+ // test code ..
final ShaderState st = new ShaderState();
-
+
final ShaderCode rsVp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
"shader/bin", "RedSquareShader", true);
final ShaderCode rsFp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -264,58 +266,58 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
sp1.add(rsVp0);
sp1.add(rsFp1);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- Assert.assertTrue(0 == sp1.program());
+ Assert.assertTrue(0 == sp1.program());
Assert.assertTrue(sp1.init(gl));
Assert.assertTrue(0 != sp1.program());
Assert.assertTrue(sp1.link(gl, System.err));
-
+
final ShaderProgram sp0 = new ShaderProgram();
sp0.add(rsVp0);
sp0.add(rsFp0);
-
+
Assert.assertTrue(sp0.init(gl));
Assert.assertTrue(sp0.link(gl, System.err));
-
- st.attachShaderProgram(gl, sp0, true);
-
+
+ st.attachShaderProgram(gl, sp0, true);
+
// setup mgl_PMVMatrix
final PMVMatrix pmvMatrix = new PMVMatrix();
final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
st.ownUniform(pmvMatrixUniform);
st.uniform(gl, pmvMatrixUniform);
-
+
// Allocate Vertex Array0
final GLArrayDataServer vertices0 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices0);
vertices0.enableBuffer(gl, false);
-
+
// Allocate Vertex Array1
final GLArrayDataServer vertices1 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices1);
vertices1.enableBuffer(gl, false);
-
+
// Allocate Color Array0
final GLArrayDataServer colors0 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors0);
colors0.enableBuffer(gl, false);
-
+
// Allocate Color Array1
final GLArrayDataServer colors1 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors1);
colors1.enableBuffer(gl, false);
-
+
// misc GL setup
gl.glClearColor(0, 0, 0, 1);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
// reshape
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
pmvMatrix.gluPerspective(45.0F, (float) drawable.getSurfaceWidth() / (float) drawable.getSurfaceHeight(), 1.0F, 100.0F);
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrix.glTranslatef(0, 0, -10);
st.uniform(gl, pmvMatrixUniform);
gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
gl.setSwapInterval(0);
-
+
// validation ..
st.attachShaderProgram(gl, sp0, true);
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, 0);
@@ -323,8 +325,8 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
st.attachShaderProgram(gl, sp1, true);
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, 0);
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 2, 0);
-
- // warmup ..
+
+ // warmup ..
for(int frames=0; frames<GLSLMiscHelper.frames_warmup; frames+=2) {
// SP0
st.attachShaderProgram(gl, sp0, true);
@@ -333,11 +335,11 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
st.attachShaderProgram(gl, sp1, true);
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices1, colors1, true);
}
-
+
// measure ..
- long t0 = System.currentTimeMillis();
+ final long t0 = System.currentTimeMillis();
int frames;
-
+
for(frames=0; frames<GLSLMiscHelper.frames_perftest; frames+=4) {
// SP0
st.attachShaderProgram(gl, sp0, true);
@@ -348,20 +350,20 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices0, colors0, true);
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices1, colors1, true);
}
-
+
final long t1 = System.currentTimeMillis();
- final long dt = t1 - t0;
- final double fps = ( frames * 1000.0 ) / (double) dt;
- final String fpsS = String.valueOf(fps);
- final int fpsSp = fpsS.indexOf('.');
- System.err.println("testShaderState01PerformanceDouble: "+dt/1000.0 +"s: "+ frames + "f, " + fpsS.substring(0, fpsSp+2) + " fps, "+dt/frames+" ms/f");
-
+ final long dt = t1 - t0;
+ final double fps = ( frames * 1000.0 ) / dt;
+ final String fpsS = String.valueOf(fps);
+ final int fpsSp = fpsS.indexOf('.');
+ System.err.println("testShaderState01PerformanceDouble: "+dt/1000.0 +"s: "+ frames + "f, " + fpsS.substring(0, fpsSp+2) + " fps, "+dt/frames+" ms/f");
+
// cleanup
st.destroy(gl);
NEWTGLContext.destroyWindow(winctx);
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
System.err.println("main - start");
boolean wait = false;
for(int i=0; i<args.length; i++) {
@@ -374,16 +376,16 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
}
if(wait) {
while(-1 == System.in.read()) ;
- TestGLSLShaderState02NEWT tst = new TestGLSLShaderState02NEWT();
+ final TestGLSLShaderState02NEWT tst = new TestGLSLShaderState02NEWT();
try {
tst.testShaderState01PerformanceDouble();
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
- }
+ }
} else {
- String tstname = TestGLSLShaderState02NEWT.class.getName();
+ final String tstname = TestGLSLShaderState02NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
System.err.println("main - end");
}
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java
index 9a70a0859..b478fcdb6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java
@@ -56,19 +56,19 @@ public class TestGLSLSimple01NEWT extends UITestCase {
@Test(timeout=60000)
public void testGLSLCompilation01() {
- GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+ final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
Assert.assertNotNull(glp);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- GLWindow window = GLWindow.create(caps);
+ final GLWindow window = GLWindow.create(caps);
Assert.assertNotNull(window);
window.setSize(800, 600);
window.setVisible(true);
Assert.assertTrue(window.isNativeValid());
- GLContext context = window.getContext();
-
+ final GLContext context = window.getContext();
+
// trigger native creation of drawable/context
window.display();
Assert.assertTrue(window.isRealized());
@@ -78,8 +78,8 @@ public class TestGLSLSimple01NEWT extends UITestCase {
// given
- GL2ES2 gl = context.getGL().getGL2ES2();
- GLSLSimpleProgram myShader = GLSLSimpleProgram.create(gl,
+ final GL2ES2 gl = context.getGL().getGL2ES2();
+ final GLSLSimpleProgram myShader = GLSLSimpleProgram.create(gl,
RedSquareShader.VERTEX_SHADER_TEXT,
RedSquareShader.FRAGMENT_SHADER_TEXT,
true);
@@ -91,20 +91,20 @@ public class TestGLSLSimple01NEWT extends UITestCase {
@Test(timeout=60000)
public void testGLSLUse01() throws InterruptedException {
- GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+ final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
Assert.assertNotNull(glp);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- GLWindow window = GLWindow.create(caps);
+ final GLWindow window = GLWindow.create(caps);
Assert.assertNotNull(window);
window.setSize(800, 600);
window.setVisible(true);
Assert.assertTrue(window.isNativeValid());
window.addGLEventListener(new RedSquareES2());
-
- Animator animator = new Animator(window);
- animator.setUpdateFPSFrames(1, null);
+
+ final Animator animator = new Animator(window);
+ animator.setUpdateFPSFrames(1, null);
animator.start();
Assert.assertEquals(true, animator.isAnimating());
while(animator.isAnimating() && animator.getTotalFPSDuration()<durationPerTest) {
@@ -116,14 +116,14 @@ public class TestGLSLSimple01NEWT extends UITestCase {
animator.stop();
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
System.err.println("main - start");
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
}
}
- String tstname = TestGLSLSimple01NEWT.class.getName();
+ final String tstname = TestGLSLSimple01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
System.err.println("main - end");
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java
index b9d77ac0c..e20bbef2d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java
@@ -53,6 +53,7 @@ import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import org.junit.Assert;
import org.junit.Test;
@@ -87,7 +88,7 @@ public class TestRulerNEWT01 extends UITestCase {
final GLUniformData rulerPixFreq = new GLUniformData("gcu_RulerPixFreq", 2, Buffers.newDirectFloatBuffer(2));
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
@@ -134,16 +135,16 @@ public class TestRulerNEWT01 extends UITestCase {
// misc GL setup
gl.glClearColor(1, 1, 1, 1);
- gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+ gl.glEnable(GL.GL_DEPTH_TEST);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
vertices0.enableBuffer(gl, true);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
@@ -152,13 +153,13 @@ public class TestRulerNEWT01 extends UITestCase {
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
pmvMatrix.glOrthof(0f, 1f, 0f, 1f, -10f, 10f);
// pmvMatrix.gluPerspective(45.0F, (float) drawable.getWidth() / (float) drawable.getHeight(), 1.0F, 100.0F);
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
// pmvMatrix.glTranslatef(0, 0, -6);
// pmvMatrix.glRotatef(45f, 1f, 0f, 0f);
@@ -235,7 +236,7 @@ public class TestRulerNEWT01 extends UITestCase {
runTestGL();
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
System.err.println("main - start");
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
@@ -249,7 +250,7 @@ public class TestRulerNEWT01 extends UITestCase {
manualTest = true;
}
}
- String tstname = TestRulerNEWT01.class.getName();
+ final String tstname = TestRulerNEWT01.class.getName();
org.junit.runner.JUnitCore.main(tstname);
System.err.println("main - end");
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java
index f26927a5c..e5b2dd2da 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -30,6 +30,8 @@ package com.jogamp.opengl.test.junit.jogl.glsl;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.util.Animator;
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
@@ -37,6 +39,7 @@ import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLException;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
+
import java.awt.Frame;
import org.junit.Assert;
@@ -70,13 +73,13 @@ public class TestShaderCompilationBug459AWT extends UITestCase {
@Test
public void compileShader() throws InterruptedException {
- GLProfile glp = GLProfile.get(GLProfile.GL2GL3);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.get(GLProfile.GL2GL3);
+ final GLCapabilities caps = new GLCapabilities(glp);
// commenting out this line makes it work
caps.setStencilBits(8);
// commenting in this line also makes it work
- //caps.setSampleBuffers(true);
+ //caps.setSampleBuffers(true);
final Frame frame = new Frame("Bug 459 shader compilation test");
Assert.assertNotNull(frame);
@@ -87,62 +90,62 @@ public class TestShaderCompilationBug459AWT extends UITestCase {
glCanvas.addGLEventListener(new GLEventListener() {
/* @Override */
- public void init(GLAutoDrawable drawable) {
- String code = "void main(void){gl_Position = vec4(0,0,0,1);}";
+ public void init(final GLAutoDrawable drawable) {
+ final String code = "void main(void){gl_Position = vec4(0,0,0,1);}";
- GL2GL3 gl = drawable.getGL().getGL2GL3();
- int id = gl.glCreateShader(GL2GL3.GL_VERTEX_SHADER);
+ final GL2GL3 gl = drawable.getGL().getGL2GL3();
+ final int id = gl.glCreateShader(GL2ES2.GL_VERTEX_SHADER);
try {
- gl.glShaderSource(id, 1, new String[] { code }, (int[])null, 0);
- gl.glCompileShader(id);
-
- int[] compiled = new int[1];
- gl.glGetShaderiv(id, GL2GL3.GL_COMPILE_STATUS, compiled, 0);
- if (compiled[0] == GL2GL3.GL_FALSE) {
- int[] logLength = new int[1];
- gl.glGetShaderiv(id, GL2GL3.GL_INFO_LOG_LENGTH, logLength, 0);
-
- byte[] log = new byte[logLength[0]];
- gl.glGetShaderInfoLog(id, logLength[0], (int[])null, 0, log, 0);
-
- System.err.println("Error compiling the shader: " + new String(log));
-
- gl.glDeleteShader(id);
- }
+ gl.glShaderSource(id, 1, new String[] { code }, (int[])null, 0);
+ gl.glCompileShader(id);
+
+ final int[] compiled = new int[1];
+ gl.glGetShaderiv(id, GL2ES2.GL_COMPILE_STATUS, compiled, 0);
+ if (compiled[0] == GL.GL_FALSE) {
+ final int[] logLength = new int[1];
+ gl.glGetShaderiv(id, GL2ES2.GL_INFO_LOG_LENGTH, logLength, 0);
+
+ final byte[] log = new byte[logLength[0]];
+ gl.glGetShaderInfoLog(id, logLength[0], (int[])null, 0, log, 0);
+
+ System.err.println("Error compiling the shader: " + new String(log));
+
+ gl.glDeleteShader(id);
+ }
else {
- System.out.println("Shader compiled: id=" + id);
+ System.out.println("Shader compiled: id=" + id);
}
}
- catch( GLException e ) {
+ catch( final GLException e ) {
glexception = e;
}
}
/* @Override */
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
/* @Override */
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
}
/* @Override */
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
});
- Animator animator = new Animator(glCanvas);
+ final Animator animator = new Animator(glCanvas);
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setSize(512, 512);
frame.setVisible(true);
} } );
- } catch(Exception ex) {
+ } catch(final Exception ex) {
throw new RuntimeException(ex);
}
- animator.setUpdateFPSFrames(1, null);
+ animator.setUpdateFPSFrames(1, null);
animator.start();
while(animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
@@ -163,13 +166,13 @@ public class TestShaderCompilationBug459AWT extends UITestCase {
frame.remove(glCanvas);
frame.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
- }
+ }
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestShaderCompilationBug459AWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java
index bbfe1dd1a..03e03fce8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java
@@ -8,6 +8,7 @@ import java.io.PrintStream;
import javax.media.opengl.GL;
import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL2ES3;
import javax.media.opengl.GL3;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLException;
@@ -30,7 +31,7 @@ import java.io.IOException;
public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
private static final boolean debugGL = true;
-
+
private static final String VERTEX_SHADER_TEXT =
"#version 150 \n"
+ " \n"
@@ -44,22 +45,22 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
int shaderProgram;
int vertShader;
- MyShader(int shaderProgram, int vertShader) {
+ MyShader(final int shaderProgram, final int vertShader) {
this.shaderProgram = shaderProgram;
this.vertShader = vertShader;
}
}
- private MyShader attachShader(GL3 gl, String text, int type) {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream pbaos = new PrintStream(baos);
+ private MyShader attachShader(final GL3 gl, final String text, final int type) {
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final PrintStream pbaos = new PrintStream(baos);
- int shaderProgram = gl.glCreateProgram();
+ final int shaderProgram = gl.glCreateProgram();
- int vertShader = gl.glCreateShader(type);
+ final int vertShader = gl.glCreateShader(type);
- String[] lines = new String[]{text};
- int[] lengths = new int[]{lines[0].length()};
+ final String[] lines = new String[]{text};
+ final int[] lengths = new int[]{lines[0].length()};
gl.glShaderSource(vertShader, lines.length, lines, lengths, 0);
gl.glCompileShader(vertShader);
@@ -75,7 +76,7 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
return new MyShader(shaderProgram, vertShader);
}
- private void releaseShader(GL3 gl, MyShader myShader) {
+ private void releaseShader(final GL3 gl, final MyShader myShader) {
if(null!=myShader) {
gl.glDetachShader(myShader.shaderProgram, myShader.vertShader);
gl.glDeleteShader(myShader.vertShader);
@@ -85,7 +86,7 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
}
final static String glps = GLProfile.GL3;
-
+
private NEWTGLContext.WindowContext prepareTest() throws GLException, InterruptedException {
final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(
new GLCapabilities(GLProfile.getMaxProgrammable(true)), 480, 480, debugGL);
@@ -94,11 +95,11 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
cleanupTest(winctx);
return null;
}
- Assert.assertEquals(GL.GL_NO_ERROR, winctx.context.getGL().glGetError());
+ Assert.assertEquals(GL.GL_NO_ERROR, winctx.context.getGL().glGetError());
return winctx;
}
- private void cleanupTest(NEWTGLContext.WindowContext winctx) {
+ private void cleanupTest(final NEWTGLContext.WindowContext winctx) {
if(null!=winctx) {
NEWTGLContext.destroyWindow(winctx);
}
@@ -106,27 +107,27 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
@Test(timeout=60000)
public void testGlTransformFeedbackVaryings_WhenVarNameOK() throws GLException, InterruptedException {
- NEWTGLContext.WindowContext winctx = prepareTest();
+ final NEWTGLContext.WindowContext winctx = prepareTest();
if(null == winctx) {
return;
}
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream pbaos = new PrintStream(baos);
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final PrintStream pbaos = new PrintStream(baos);
// given
final GL3 gl = winctx.context.getGL().getGL3();
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
- MyShader myShader = attachShader(gl, VERTEX_SHADER_TEXT, GL3.GL_VERTEX_SHADER);
- String[] vars = new String[]{"Position"};
+
+ final MyShader myShader = attachShader(gl, VERTEX_SHADER_TEXT, GL2ES2.GL_VERTEX_SHADER);
+ final String[] vars = new String[]{"Position"};
// when
- gl.glTransformFeedbackVaryings(myShader.shaderProgram, 1, vars, GL3.GL_SEPARATE_ATTRIBS);
+ gl.glTransformFeedbackVaryings(myShader.shaderProgram, 1, vars, GL2ES3.GL_SEPARATE_ATTRIBS);
gl.glLinkProgram(myShader.shaderProgram);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
+
// then
boolean error = false;
@@ -136,33 +137,33 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
error = true;
}
pbaos.flush(); baos.reset();
- Assert.assertEquals(GL3.GL_NO_ERROR, gl.glGetError());
+ Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- releaseShader(gl, myShader);
+ releaseShader(gl, myShader);
cleanupTest(winctx);
Assert.assertFalse(error);
}
@Test(timeout=60000)
public void testGlTransformFeedbackVaryings_WhenVarNameWrong() throws GLException, InterruptedException {
- NEWTGLContext.WindowContext winctx = prepareTest();
+ final NEWTGLContext.WindowContext winctx = prepareTest();
if(null == winctx) {
return;
}
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream pbaos = new PrintStream(baos);
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final PrintStream pbaos = new PrintStream(baos);
// given
final GL3 gl = winctx.context.getGL().getGL3();
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- MyShader myShader = attachShader(gl, VERTEX_SHADER_TEXT, GL3.GL_VERTEX_SHADER);
- String[] vars = new String[]{"PPPosition"};
+ final MyShader myShader = attachShader(gl, VERTEX_SHADER_TEXT, GL2ES2.GL_VERTEX_SHADER);
+ final String[] vars = new String[]{"PPPosition"};
// when
- gl.glTransformFeedbackVaryings(myShader.shaderProgram, 1, vars, GL3.GL_SEPARATE_ATTRIBS);
+ gl.glTransformFeedbackVaryings(myShader.shaderProgram, 1, vars, GL2ES3.GL_SEPARATE_ATTRIBS);
gl.glLinkProgram(myShader.shaderProgram);
// then
@@ -173,21 +174,21 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
System.out.println("GOOD (expected link error) - testGlTransformFeedbackVaryings_WhenVarNameWrong:postLink: "+baos.toString());
// should be invalid, due to wrong var name
} else {
- // oops
+ // oops
System.out.println("Error (unexpected link success) - testGlTransformFeedbackVaryings_WhenVarNameWrong link worked, but it should not");
error = true;
}
pbaos.flush(); baos.reset();
- Assert.assertEquals(GL3.GL_NO_ERROR, gl.glGetError());
-
+ Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
releaseShader(gl, myShader);
cleanupTest(winctx);
Assert.assertFalse(error);
}
- public static void main(String args[]) throws IOException {
- String tstname = TestTransformFeedbackVaryingsBug407NEWT.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestTransformFeedbackVaryingsBug407NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug365TextureGenerateMipMaps.java b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug365TextureGenerateMipMaps.java
index b9e64e1da..dfa26a049 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug365TextureGenerateMipMaps.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug365TextureGenerateMipMaps.java
@@ -2,7 +2,9 @@ package com.jogamp.opengl.test.junit.jogl.glu;
import java.nio.ByteBuffer;
+import javax.media.opengl.GL;
import javax.media.opengl.GL2;
+import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLContext;
import javax.media.opengl.GLDrawableFactory;
@@ -57,7 +59,7 @@ public class TestBug365TextureGenerateMipMaps extends UITestCase {
System.setProperty("jogl.texture.nonpot", "true");
try {
setUpOffscreenAutoDrawable();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw t;
}
}
@@ -68,18 +70,18 @@ public class TestBug365TextureGenerateMipMaps extends UITestCase {
}
private static void setUpOffscreenAutoDrawable() throws Throwable {
- GLProfile glp = GLProfile.getDefault();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getDefault();
+ final GLCapabilities caps = new GLCapabilities(glp);
- GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
+ final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
// Make a drawable to get an offscreen context
drawable = factory.createOffscreenAutoDrawable(null, caps, null, 2, 2);
drawable.display(); // trigger context creation
- GLContext glContext = drawable.getContext();
+ final GLContext glContext = drawable.getContext();
try {
Assert.assertTrue("Could not make context current", GLContext.CONTEXT_NOT_CURRENT < glContext.makeCurrent());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
tearDownOffscreenAutoDrawable();
throw t;
}
@@ -93,17 +95,17 @@ public class TestBug365TextureGenerateMipMaps extends UITestCase {
}
}
- private static void testTextureMipMapGeneration(int width, int height, int pixelFormat, int pixelType) {
- int internalFormat = pixelFormat;
- int border = 0;
- boolean mipmap = true;
- boolean dataIsCompressed = false;
- boolean mustFlipVertically = false;
+ private static void testTextureMipMapGeneration(final int width, final int height, final int pixelFormat, final int pixelType) {
+ final int internalFormat = pixelFormat;
+ final int border = 0;
+ final boolean mipmap = true;
+ final boolean dataIsCompressed = false;
+ final boolean mustFlipVertically = false;
- int memReq = Mipmap.image_size( width, height, pixelFormat, pixelType );
+ final int memReq = Mipmap.image_size( width, height, pixelFormat, pixelType );
ByteBuffer buffer = Buffers.newDirectByteBuffer( memReq );
- TextureData data = new TextureData(drawable.getGLProfile(),
+ final TextureData data = new TextureData(drawable.getGLProfile(),
internalFormat,
width,
height,
@@ -116,7 +118,7 @@ public class TestBug365TextureGenerateMipMaps extends UITestCase {
buffer,
null);
- Texture texture = TextureIO.newTexture(drawable.getGL(), data);
+ final Texture texture = TextureIO.newTexture(drawable.getGL(), data);
// Cleanup
texture.destroy(drawable.getGL());
data.destroy();
@@ -126,145 +128,145 @@ public class TestBug365TextureGenerateMipMaps extends UITestCase {
@Test
public void test00_MipMap_ScaleInternal_RGB_UBYTE () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGB;
- int pixelType = GL2.GL_UNSIGNED_BYTE;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGB;
+ final int pixelType = GL.GL_UNSIGNED_BYTE;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
@Test
public void test01_MipMap_ScaleInternal_RGBA_UBYTE () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGBA;
- int pixelType = GL2.GL_UNSIGNED_BYTE;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGBA;
+ final int pixelType = GL.GL_UNSIGNED_BYTE;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
@Test
public void test02_MipMap_ScaleInternal_RGB_BYTE () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGB;
- int pixelType = GL2.GL_BYTE;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGB;
+ final int pixelType = GL.GL_BYTE;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
@Test
public void test03_MipMap_ScaleInternal_RGBA_BYTE () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGBA;
- int pixelType = GL2.GL_BYTE;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGBA;
+ final int pixelType = GL.GL_BYTE;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
@Test
public void test04_MipMap_ScaleInternal_RGB_USHORT () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGB;
- int pixelType = GL2.GL_UNSIGNED_SHORT;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGB;
+ final int pixelType = GL.GL_UNSIGNED_SHORT;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
@Test
public void test05_MipMap_ScaleInternal_RGBA_USHORT () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGBA;
- int pixelType = GL2.GL_UNSIGNED_SHORT;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGBA;
+ final int pixelType = GL.GL_UNSIGNED_SHORT;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
@Test
public void test06_MipMap_ScaleInternal_RGB_SHORT () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGB;
- int pixelType = GL2.GL_SHORT;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGB;
+ final int pixelType = GL.GL_SHORT;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
@Test
public void test07_MipMap_ScaleInternal_RGBA_SHORT () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGBA;
- int pixelType = GL2.GL_SHORT;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGBA;
+ final int pixelType = GL.GL_SHORT;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
@Test
public void test08_MipMap_ScaleInternal_RGB_UINT () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGB;
- int pixelType = GL2.GL_UNSIGNED_INT;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGB;
+ final int pixelType = GL.GL_UNSIGNED_INT;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
@Test
public void test09_MipMap_ScaleInternal_RGBA_UINT () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGBA;
- int pixelType = GL2.GL_UNSIGNED_INT;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGBA;
+ final int pixelType = GL.GL_UNSIGNED_INT;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
@Test
public void test10_MipMap_ScaleInternal_RGB_INT () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGB;
- int pixelType = GL2.GL_INT;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGB;
+ final int pixelType = GL2ES2.GL_INT;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
@Test
public void test11_MipMap_ScaleInternal_RGBA_INT () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGBA;
- int pixelType = GL2.GL_INT;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGBA;
+ final int pixelType = GL2ES2.GL_INT;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
@Test
public void test12_MipMap_ScaleInternal_RGB_FLOAT () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGB;
- int pixelType = GL2.GL_FLOAT;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGB;
+ final int pixelType = GL.GL_FLOAT;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
@Test
public void test13_MipMap_ScaleInternal_RGBA_FLOAT () {
- int width = 1;
- int height = 7;
- int pixelFormat = GL2.GL_RGBA;
- int pixelType = GL2.GL_FLOAT;
+ final int width = 1;
+ final int height = 7;
+ final int pixelFormat = GL.GL_RGBA;
+ final int pixelType = GL.GL_FLOAT;
testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
org.junit.runner.JUnitCore.main(TestBug365TextureGenerateMipMaps.class.getName());
}
} \ No newline at end of file
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug463ScaleImageMemoryAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug463ScaleImageMemoryAWT.java
index e5690a0b0..5c63b2e1d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug463ScaleImageMemoryAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug463ScaleImageMemoryAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.glu;
import java.awt.Frame;
@@ -51,33 +51,33 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
* 4-byte direct buffer objects inside the tight loops of Image.fill_image() and Image.empty_image(). Since
* the JVM apparently can only allocate direct buffer in 4MB chunks, each 4-byte buffer cost us a million times
* the memory it should have. Changing the constructor of Type_Widget.java back to non-direct buffer (like it
- * was in JOGL 1) solves the problem.
+ * was in JOGL 1) solves the problem.
* @author Wade Walker
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestBug463ScaleImageMemoryAWT extends UITestCase implements GLEventListener {
/* @Override */
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
}
/* @Override */
- public void display(GLAutoDrawable drawable) {
- int widthin = 559;
- int heightin = 425;
-
- int widthout = 1024;
- int heightout = 512;
-
- int textureInLength = widthin * heightin * 4;
- int textureOutLength = widthout * heightout * 4;
-
- byte[] datain = new byte[textureInLength];
- byte[] dataout = new byte[textureOutLength];
-
- ByteBuffer bufferIn = ByteBuffer.wrap(datain);
- ByteBuffer bufferOut = ByteBuffer.wrap(dataout);
- GLUgl2es1 glu = new GLUgl2es1();
+ public void display(final GLAutoDrawable drawable) {
+ final int widthin = 559;
+ final int heightin = 425;
+
+ final int widthout = 1024;
+ final int heightout = 512;
+
+ final int textureInLength = widthin * heightin * 4;
+ final int textureOutLength = widthout * heightout * 4;
+
+ final byte[] datain = new byte[textureInLength];
+ final byte[] dataout = new byte[textureOutLength];
+
+ final ByteBuffer bufferIn = ByteBuffer.wrap(datain);
+ final ByteBuffer bufferOut = ByteBuffer.wrap(dataout);
+ final GLUgl2es1 glu = new GLUgl2es1();
// in the failing case, the system would run out of memory in here
glu.gluScaleImage( GL.GL_RGBA,
widthin, heightin, GL.GL_UNSIGNED_BYTE, bufferIn,
@@ -85,24 +85,24 @@ public class TestBug463ScaleImageMemoryAWT extends UITestCase implements GLEvent
}
/* @Override */
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
/* @Override */
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
@Test
public void test01() throws InterruptedException {
- GLProfile glprofile = GLProfile.getGL2ES1();
- GLCapabilities glCapabilities = new GLCapabilities(glprofile);
+ final GLProfile glprofile = GLProfile.getGL2ES1();
+ final GLCapabilities glCapabilities = new GLCapabilities(glprofile);
final GLCanvas canvas = new GLCanvas(glCapabilities);
canvas.addGLEventListener( this );
-
+
final Frame frame = new Frame("Test");
frame.add(canvas);
- frame.setSize(256, 256);
+ frame.setSize(256, 256);
frame.validate();
try {
@@ -110,15 +110,15 @@ public class TestBug463ScaleImageMemoryAWT extends UITestCase implements GLEvent
public void run() {
frame.setVisible(true);
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
-
+
canvas.display();
Thread.sleep(200);
-
+
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -126,13 +126,13 @@ public class TestBug463ScaleImageMemoryAWT extends UITestCase implements GLEvent
frame.remove(canvas);
frame.dispose();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
- }
+ }
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestBug463ScaleImageMemoryAWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug694ScaleImageUnpackBufferSizeAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug694ScaleImageUnpackBufferSizeAWT.java
index 4f87bd7cf..184dea8ba 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug694ScaleImageUnpackBufferSizeAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug694ScaleImageUnpackBufferSizeAWT.java
@@ -57,11 +57,11 @@ import com.jogamp.opengl.util.GLPixelStorageModes;
public class TestBug694ScaleImageUnpackBufferSizeAWT extends UITestCase implements GLEventListener {
/* @Override */
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
}
/* @Override */
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
if( !testDone ) {
testDone = true;
@@ -76,7 +76,7 @@ public class TestBug694ScaleImageUnpackBufferSizeAWT extends UITestCase implemen
boolean testDone = false;
- private void testGLUScaleImage(GL gl, GLU glu, int unpackAlignment) {
+ private void testGLUScaleImage(final GL gl, final GLU glu, final int unpackAlignment) {
final GLPixelStorageModes psm = new GLPixelStorageModes();
if(0 < unpackAlignment) {
psm.setUnpackAlignment(gl, unpackAlignment);
@@ -98,8 +98,8 @@ public class TestBug694ScaleImageUnpackBufferSizeAWT extends UITestCase implemen
System.err.println("Unpack-Alignment "+unpackAlignment+": in-size "+unpackSizeInLen);
System.err.println("Unpack-Alignment "+unpackAlignment+": out-size "+unpackSizeOutLen);
- ByteBuffer bufferIn = Buffers.newDirectByteBuffer(unpackSizeInLen);
- ByteBuffer bufferOut = Buffers.newDirectByteBuffer(unpackSizeOutLen);
+ final ByteBuffer bufferIn = Buffers.newDirectByteBuffer(unpackSizeInLen);
+ final ByteBuffer bufferOut = Buffers.newDirectByteBuffer(unpackSizeOutLen);
glu.gluScaleImage( GL.GL_LUMINANCE,
widthin, heightin, GL.GL_UNSIGNED_BYTE, bufferIn,
@@ -111,18 +111,18 @@ public class TestBug694ScaleImageUnpackBufferSizeAWT extends UITestCase implemen
}
/* @Override */
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
/* @Override */
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
@Test
public void test01() throws InterruptedException {
- GLProfile glprofile = GLProfile.getDefault();
- GLCapabilities glCapabilities = new GLCapabilities(glprofile);
+ final GLProfile glprofile = GLProfile.getDefault();
+ final GLCapabilities glCapabilities = new GLCapabilities(glprofile);
final GLCanvas canvas = new GLCanvas(glCapabilities);
canvas.addGLEventListener( this );
@@ -136,7 +136,7 @@ public class TestBug694ScaleImageUnpackBufferSizeAWT extends UITestCase implemen
public void run() {
frame.setVisible(true);
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
@@ -152,13 +152,13 @@ public class TestBug694ScaleImageUnpackBufferSizeAWT extends UITestCase implemen
frame.remove(canvas);
frame.dispose();
}});
- } catch (Throwable t) {
+ } catch (final Throwable t) {
t.printStackTrace();
Assume.assumeNoException(t);
}
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestBug694ScaleImageUnpackBufferSizeAWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestBinary16NOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestBinary16NOUI.java
index 8f56c133e..5e4166a49 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestBinary16NOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestBinary16NOUI.java
@@ -701,7 +701,7 @@ public final class TestBinary16NOUI extends UITestCase /* due to hardship on ma
Assert.assertEquals(r, -1.0, 0.0);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-stepping")) {
stepping = MiscUtils.atoi(args[++i], stepping);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil01NOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil01NOUI.java
index aeceff981..0d156c42c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil01NOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil01NOUI.java
@@ -62,14 +62,14 @@ public class TestFloatUtil01NOUI {
System.err.println("deltaFixedEpsMin "+deltaFixedEpsMin+", deltaFixedEpsLEQEpsilon "+deltaFixedEpsLEQEpsilon);
}
- private void dumpTestWE(int tstNum, int expWE, final float a, final float b, final float EPSILON) {
+ private void dumpTestWE(final int tstNum, final int expWE, final float a, final float b, final float EPSILON) {
final float delta = a-b;
final boolean equalWE = FloatUtil.isEqual(a, b, EPSILON);
final int compWE = FloatUtil.compare(a, b, EPSILON);
final String msgWE = ( expWE != compWE ) ? "**** mismatch ****" : " OK";
System.err.println("Print.WE."+tstNum+": a: "+a+", b: "+b+" -> d "+delta+", exp "+expWE+", equal "+equalWE+", comp "+compWE+" - "+msgWE+", epsilon "+EPSILON);
}
- private void dumpTestNE(int tstNum, int exp, final float a, final float b) {
+ private void dumpTestNE(final int tstNum, final int exp, final float a, final float b) {
final float delta = a-b;
final boolean equal = FloatUtil.isEqual(a, b);
final int comp = FloatUtil.compare(a, b);
@@ -102,7 +102,7 @@ public class TestFloatUtil01NOUI {
dumpTestWE(i++, 1, 0f, 0f+EPSILON-Float.MIN_VALUE, EPSILON);
dumpTestWE(i++, 1, 0f, 0f-EPSILON+Float.MIN_VALUE, EPSILON);
}
- private void testZeroWithEpsilon(int tstNum, boolean exp, final float a, final float EPSILON) {
+ private void testZeroWithEpsilon(final int tstNum, final boolean exp, final float a, final float EPSILON) {
final boolean zero = FloatUtil.isZero(a, EPSILON);
final float delta = a-0f;
System.err.println("Zero."+tstNum+": a: "+a+", -> d "+delta+", exp "+exp+", zero "+zero+", epsilon "+EPSILON);
@@ -134,7 +134,7 @@ public class TestFloatUtil01NOUI {
dumpTestNE(i++, 0, 1f, 1f+Float.MIN_VALUE);
dumpTestNE(i++, 0, 0f, 0f+Float.MIN_VALUE);
}
- private void testEqualsNoEpsilon(int tstNum, boolean exp, final float a, final float b) {
+ private void testEqualsNoEpsilon(final int tstNum, final boolean exp, final float a, final float b) {
final boolean equal = FloatUtil.isEqual(a, b);
final int comp = FloatUtil.compare(a, b);
final float delta = a-b;
@@ -174,7 +174,7 @@ public class TestFloatUtil01NOUI {
dumpTestWE(i++, 1, 1f, 1f+EPSILON-Float.MIN_VALUE, EPSILON);
dumpTestWE(i++, 1, 1f, 1f-EPSILON+Float.MIN_VALUE, EPSILON);
}
- private void testEqualsWithEpsilon(int tstNum, boolean exp, final float a, final float b, final float EPSILON) {
+ private void testEqualsWithEpsilon(final int tstNum, final boolean exp, final float a, final float b, final float EPSILON) {
final boolean equal = FloatUtil.isEqual(a, b, EPSILON);
final int comp = FloatUtil.compare(a, b, EPSILON);
final float delta = a-b;
@@ -221,7 +221,7 @@ public class TestFloatUtil01NOUI {
dumpTestNE(i++, 0, 1f, 1f+Float.MIN_VALUE);
dumpTestNE(i++, 0, 0f, 0f+Float.MIN_VALUE);
}
- private void testCompareNoEpsilon(int tstNum, final int exp, final float a, final float b) {
+ private void testCompareNoEpsilon(final int tstNum, final int exp, final float a, final float b) {
final boolean equal = FloatUtil.isEqual(a, b);
final int comp = FloatUtil.compare(a, b);
final float delta = a-b;
@@ -267,7 +267,7 @@ public class TestFloatUtil01NOUI {
testCompareWithEpsilon(i++, 0, -0f, 0f, EPSILON);
testCompareWithEpsilon(i++, 0, 0f, -0f, EPSILON);
}
- private void testCompareWithEpsilon(int tstNum, final int exp, final float a, final float b, float EPSILON) {
+ private void testCompareWithEpsilon(final int tstNum, final int exp, final float a, final float b, final float EPSILON) {
final boolean equal = FloatUtil.isEqual(a, b, EPSILON);
final int comp = FloatUtil.compare(a, b, EPSILON);
final float delta = a-b;
@@ -276,7 +276,7 @@ public class TestFloatUtil01NOUI {
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestFloatUtil01NOUI.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil02MatrixMatrixMultNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil02MatrixMatrixMultNOUI.java
index feb5d3245..13285ac0b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil02MatrixMatrixMultNOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil02MatrixMatrixMultNOUI.java
@@ -59,8 +59,8 @@ public class TestFloatUtil02MatrixMatrixMultNOUI {
893, 116, 116, 113,
748, 116, 120, 104,
1182, 113, 104, 131 };
-
- public static final void multMatrixf_RM(final float[] a, int a_off, final float[] b, int b_off, float[] d, int d_off) {
+
+ public static final void multMatrixf_RM(final float[] a, final int a_off, final float[] b, final int b_off, final float[] d, final int d_off) {
for (int i = 0; i < 4; i++) {
final float ai0=a[a_off+i*4+0], ai1=a[a_off+i*4+1], ai2=a[a_off+i*4+2], ai3=a[a_off+i*4+3];
d[d_off+i*4+0] = ai0 * b[b_off+0*4+0] + ai1 * b[b_off+1*4+0] + ai2 * b[b_off+2*4+0] + ai3 * b[b_off+3*4+0] ;
@@ -73,7 +73,7 @@ public class TestFloatUtil02MatrixMatrixMultNOUI {
@Test
public void testCM_m1xm2(){
- float[] r = new float[16];
+ final float[] r = new float[16];
FloatUtil.multMatrix(m1, 0, m2, 0, r, 0);
@@ -83,7 +83,7 @@ public class TestFloatUtil02MatrixMatrixMultNOUI {
@Test
public void testCM_m2xm1(){
- float[] r = new float[16];
+ final float[] r = new float[16];
FloatUtil.multMatrix(m2, 0, m1, 0, r, 0);
@@ -93,8 +93,8 @@ public class TestFloatUtil02MatrixMatrixMultNOUI {
@Test
public void testRM_m1xm2(){
- float[] r = new float[16];
-
+ final float[] r = new float[16];
+
multMatrixf_RM(m1, 0, m2, 0, r, 0);
Assert.assertArrayEquals(m1xm2_RM, r, 0f);
@@ -103,14 +103,14 @@ public class TestFloatUtil02MatrixMatrixMultNOUI {
@Test
public void testRM_m2xm1(){
- float[] r = new float[16];
-
+ final float[] r = new float[16];
+
multMatrixf_RM(m2, 0, m1, 0, r, 0);
Assert.assertArrayEquals(m2xm1_RM, r, 0f);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestFloatUtil02MatrixMatrixMultNOUI.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil03InversionNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil03InversionNOUI.java
index e9558b251..a2aa69863 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil03InversionNOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil03InversionNOUI.java
@@ -96,7 +96,7 @@ public class TestFloatUtil03InversionNOUI {
@Test
public void test02(){
- float[] p = new float[] { 2.3464675f, 0, 0, 0,
+ final float[] p = new float[] { 2.3464675f, 0, 0, 0,
0, 2.4142134f, 0, 0,
0, 0, -1.0002f, -1,
0, 0, -20.002f, 0 };
@@ -105,7 +105,7 @@ public class TestFloatUtil03InversionNOUI {
@Test
public void test03(){
- float[] mv = new float[] { 1, 0, 0, 0,
+ final float[] mv = new float[] { 1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, -200, 1 } ;
@@ -114,7 +114,7 @@ public class TestFloatUtil03InversionNOUI {
@Test
public void test04(){
- float[] p = new float[] { 2.3464675f, 0, 0, 0,
+ final float[] p = new float[] { 2.3464675f, 0, 0, 0,
0, 2.4142134f, 0, 0,
0, 0, -1.0002f, -1,
0, 0, -20.002f, 0 };
@@ -124,12 +124,12 @@ public class TestFloatUtil03InversionNOUI {
@Test
public void test05Perf(){
- float[] p1 = new float[] { 2.3464675f, 0, 0, 0,
+ final float[] p1 = new float[] { 2.3464675f, 0, 0, 0,
0, 2.4142134f, 0, 0,
0, 0, -1.0002f, -1,
0, 0, -20.002f, 0 };
- float[] p2 = new float[]{ 26, 59, 143, 71,
+ final float[] p2 = new float[]{ 26, 59, 143, 71,
59, 174, 730, 386,
143, 730, 9770, 5370,
71, 386, 5370, 2954 };
@@ -256,7 +256,7 @@ public class TestFloatUtil03InversionNOUI {
return mres;
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestFloatUtil03InversionNOUI.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectDoubleNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectDoubleNOUI.java
index db40dad15..d10a04845 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectDoubleNOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectDoubleNOUI.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.math;
import javax.media.opengl.glu.GLU;
@@ -51,10 +51,10 @@ public class TestGluUnprojectDoubleNOUI {
final int[] viewport = new int[]{0,0,800,600};
final double[] objCoords = new double[]{Double.NaN,Double.NaN,Double.NaN};
glu.gluUnProject(pickedPoint[0], pickedPoint[1], pickedPointDepth, sceneModelViewValues, 0, projectionValues, 0, viewport, 0, objCoords, 0);
- Assert.assertTrue(!Double.isNaN(objCoords[0])&&!Double.isNaN(objCoords[1])&&!Double.isNaN(objCoords[2]));
+ Assert.assertTrue(!Double.isNaN(objCoords[0])&&!Double.isNaN(objCoords[1])&&!Double.isNaN(objCoords[2]));
}
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestGluUnprojectDoubleNOUI.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectFloatNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectFloatNOUI.java
index 0f9a45fd7..278c2450a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectFloatNOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectFloatNOUI.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.math;
import javax.media.opengl.glu.GLU;
@@ -37,7 +37,7 @@ import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestGluUnprojectFloatNOUI {
-
+
@Test
public void testNaN(){
final GLU glu = new GLU();
@@ -48,59 +48,59 @@ public class TestGluUnprojectFloatNOUI {
final int[] viewport = new int[]{0,0,800,600};
final float[] objCoords = new float[]{Float.NaN,Float.NaN,Float.NaN};
glu.gluUnProject(pickedPoint[0], pickedPoint[1], pickedPointDepth, sceneModelViewValues, 0, projectionValues, 0, viewport, 0, objCoords, 0);
- Assert.assertTrue(!Double.isNaN(objCoords[0])&&!Double.isNaN(objCoords[1])&&!Double.isNaN(objCoords[2]));
+ Assert.assertTrue(!Double.isNaN(objCoords[0])&&!Double.isNaN(objCoords[1])&&!Double.isNaN(objCoords[2]));
}
-
+
@Test
public void test01(){
- float[] mv = new float[] { 1, 0, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 1, 0,
+ final float[] mv = new float[] { 1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 1, 0,
0, 0, 0, 1 };
-
- float[] p = new float[] { 2.3464675f, 0, 0, 0,
- 0, 2.4142134f, 0, 0,
- 0, 0, -1.0002f, -1,
+
+ final float[] p = new float[] { 2.3464675f, 0, 0, 0,
+ 0, 2.4142134f, 0, 0,
+ 0, 0, -1.0002f, -1,
0, 0, -20.002f, 0 };
-
- int[] v = new int[] { 0, 0, 1000, 1000 };
-
- float[] s = new float[] { 250, 250, 0.5f };
-
- float[] expected = new float[] { -4.2612f, -4.1417f, -19.9980f };
- float[] result = new float[] { 0, 0, 0 };
-
+
+ final int[] v = new int[] { 0, 0, 1000, 1000 };
+
+ final float[] s = new float[] { 250, 250, 0.5f };
+
+ final float[] expected = new float[] { -4.2612f, -4.1417f, -19.9980f };
+ final float[] result = new float[] { 0, 0, 0 };
+
final GLU glu = new GLU();
glu.gluUnProject(s[0], s[1], s[2], mv, 0, p, 0, v, 0, result, 0);
-
+
Assert.assertArrayEquals(expected, result, 0.0001f);
}
@Test
public void test02(){
- float[] mv = new float[] { 1, 0, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 1, 0,
+ final float[] mv = new float[] { 1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 1, 0,
0, 0, -200, 1 } ;
-
- float[] p = new float[] { 2.3464675f, 0, 0, 0,
- 0, 2.4142134f, 0, 0,
- 0, 0, -1.0002f, -1,
+
+ final float[] p = new float[] { 2.3464675f, 0, 0, 0,
+ 0, 2.4142134f, 0, 0,
+ 0, 0, -1.0002f, -1,
0, 0, -20.002f, 0 };
-
- int[] v = new int[] { 0, 0, 1000, 1000 };
-
- float[] s = new float[] { 250, 250, 0.5f };
- float[] expected = new float[] { -4.2612f, -4.1417f, 180.002f };
- float[] result = new float[] { 0, 0, 0 };
-
+
+ final int[] v = new int[] { 0, 0, 1000, 1000 };
+
+ final float[] s = new float[] { 250, 250, 0.5f };
+ final float[] expected = new float[] { -4.2612f, -4.1417f, 180.002f };
+ final float[] result = new float[] { 0, 0, 0 };
+
final GLU glu = new GLU();
glu.gluUnProject(s[0], s[1], s[2], mv, 0, p, 0, v, 0, result, 0);
-
+
Assert.assertArrayEquals(expected, result, 0.0001f);
}
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestGluUnprojectFloatNOUI.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix01NEWT.java
index 464a43ac8..e111887f7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix01NEWT.java
@@ -38,6 +38,8 @@ import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.GLProfile;
import javax.media.opengl.fixedfunc.GLMatrixFunc;
+import jogamp.common.os.PlatformPropsImpl;
+
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -345,7 +347,7 @@ public class TestPMVMatrix01NEWT extends UITestCase {
final FloatBuffer glMv = FloatBuffer.allocate(16);
{
- GL2ES1 gl = dc.glc.getGL().getGL2ES1();
+ final GL2ES1 gl = dc.glc.getGL().getGL2ES1();
gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
@@ -356,8 +358,8 @@ public class TestPMVMatrix01NEWT extends UITestCase {
}
// System.err.println(PMVMatrix.matrixToString(null, "%10.5f", glMv, pmvMv).toString());
- MiscUtils.assertFloatBufferEquals("Arrays not equal, expected"+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", glMv).toString()+
- ", actual"+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMv).toString(),
+ MiscUtils.assertFloatBufferEquals("Arrays not equal, expected"+PlatformPropsImpl.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", glMv).toString()+
+ ", actual"+PlatformPropsImpl.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMv).toString(),
glMv, pmvMv, epsilon);
// System.err.println("pmvMvi: "+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMvi));
@@ -384,7 +386,7 @@ public class TestPMVMatrix01NEWT extends UITestCase {
final FloatBuffer glMv = FloatBuffer.allocate(16);
{
- GL2ES1 gl = dc.glc.getGL().getGL2ES1();
+ final GL2ES1 gl = dc.glc.getGL().getGL2ES1();
gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
@@ -396,8 +398,8 @@ public class TestPMVMatrix01NEWT extends UITestCase {
}
// System.err.println(PMVMatrix.matrixToString(null, "%10.5f", glMv, pmvMv).toString());
- MiscUtils.assertFloatBufferEquals("Arrays not equal, expected"+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", glMv).toString()+
- ", actual"+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMv).toString(),
+ MiscUtils.assertFloatBufferEquals("Arrays not equal, expected"+PlatformPropsImpl.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", glMv).toString()+
+ ", actual"+PlatformPropsImpl.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMv).toString(),
glMv, pmvMv, epsilon);
// System.err.println("pmvMvi: "+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMvi));
@@ -410,7 +412,7 @@ public class TestPMVMatrix01NEWT extends UITestCase {
public static void setup() throws Throwable {
try {
dc = createOffscreenDrawableAndCurrentFFPContext();
- } catch (Throwable t) {
+ } catch (final Throwable t) {
setTestSupported(false);
throw t;
}
@@ -422,7 +424,7 @@ public class TestPMVMatrix01NEWT extends UITestCase {
}
static class DrawableContext {
- DrawableContext(GLDrawable d, GLContext glc) {
+ DrawableContext(final GLDrawable d, final GLContext glc) {
this.d = d;
this.glc = glc;
}
@@ -431,19 +433,19 @@ public class TestPMVMatrix01NEWT extends UITestCase {
}
private static DrawableContext createOffscreenDrawableAndCurrentFFPContext() throws Throwable {
- GLProfile glp = GLProfile.getMaxFixedFunc(true);
- GLCapabilities glCaps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getMaxFixedFunc(true);
+ final GLCapabilities glCaps = new GLCapabilities(glp);
glCaps.setOnscreen(false);
glCaps.setPBuffer(true);
- GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
- GLDrawable d = factory.createOffscreenDrawable(null, glCaps, null, 64, 64);
+ final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
+ final GLDrawable d = factory.createOffscreenDrawable(null, glCaps, null, 64, 64);
d.setRealized(true);
GLContext glc = null;
try {
glc = d.createContext(null);
Assert.assertTrue("Context could not be made current", GLContext.CONTEXT_NOT_CURRENT < glc.makeCurrent());
return new DrawableContext(d, glc);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
if(null != glc) {
glc.destroy();
}
@@ -452,7 +454,7 @@ public class TestPMVMatrix01NEWT extends UITestCase {
}
}
- private static void destroyDrawableContext(DrawableContext dc) {
+ private static void destroyDrawableContext(final DrawableContext dc) {
if(null != dc.glc) {
dc.glc.destroy();
dc.glc = null;
@@ -463,7 +465,7 @@ public class TestPMVMatrix01NEWT extends UITestCase {
}
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestPMVMatrix01NEWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix02NOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix02NOUI.java
index 2c3a6f36a..7250e438d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix02NOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix02NOUI.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.math;
import org.junit.Before;
@@ -62,8 +62,8 @@ public class TestPMVMatrix02NOUI {
0, 0, -1,
0, 1, 0
);
- FloatBuffer mvMatrix = fMat.glGetMvMatrixf();
- float[] mvMatrixArr = new float[16];
+ final FloatBuffer mvMatrix = fMat.glGetMvMatrixf();
+ final float[] mvMatrixArr = new float[16];
mvMatrix.asReadOnlyBuffer().get(mvMatrixArr);
assertArrayEquals(
/**
@@ -88,8 +88,8 @@ public class TestPMVMatrix02NOUI {
0, 1, 0,
0, 0, 1
);
- FloatBuffer mvMatrix = fMat.glGetMvMatrixf();
- float[] mvMatrixArr = new float[16];
+ final FloatBuffer mvMatrix = fMat.glGetMvMatrixf();
+ final float[] mvMatrixArr = new float[16];
mvMatrix.asReadOnlyBuffer().get(mvMatrixArr);
assertArrayEquals(
/**
@@ -106,7 +106,7 @@ public class TestPMVMatrix02NOUI {
);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestPMVMatrix02NOUI.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix03NOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix03NOUI.java
index d832dbadf..87e759919 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix03NOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix03NOUI.java
@@ -2,6 +2,8 @@ package com.jogamp.opengl.test.junit.jogl.math;
import java.util.Arrays;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+
import jogamp.opengl.ProjectFloat;
import com.jogamp.opengl.math.FloatUtil;
@@ -49,7 +51,7 @@ public class TestPMVMatrix03NOUI {
FloatUtil.mapObjToWinCoords(0f, 0f, 0f, mat4PMv, viewport, 0, winB01, 0, vec4Tmp1, vec4Tmp2);
System.err.println("B.0.1 - Project 0,0 -->" + Arrays.toString(winB01));
- m.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ m.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
m.glOrthof(0, 10, 0, 10, 1, -1);
System.err.println("MATRIX - Ortho 0,0,10,10 - Locate the origin in the bottom left and scale");
System.err.println(m);
@@ -74,12 +76,12 @@ public class TestPMVMatrix03NOUI {
////////////////////
/////////////////////
- float[] winC00 = new float[4];
- float[] winC01 = new float[4];
- float[] winC10 = new float[4];
- float[] winC11 = new float[4];
- float[] projMatrixC = new float[16];
- float[] modelMatrixC = new float[16];
+ final float[] winC00 = new float[4];
+ final float[] winC01 = new float[4];
+ final float[] winC10 = new float[4];
+ final float[] winC11 = new float[4];
+ final float[] projMatrixC = new float[16];
+ final float[] modelMatrixC = new float[16];
FloatUtil.makeIdentity(projMatrixC);
FloatUtil.makeIdentity(modelMatrixC);
final ProjectFloat projectFloat = new ProjectFloat();
@@ -131,7 +133,7 @@ public class TestPMVMatrix03NOUI {
final float ty=-1.0f*(top+bottom)/dy;
final float tz=-1.0f*(zFar+zNear)/dz;
- float[] matrixOrtho = new float[16];
+ final float[] matrixOrtho = new float[16];
FloatUtil.makeIdentity(matrixOrtho);
matrixOrtho[0+4*0] = 2.0f/dx;
matrixOrtho[1+4*1] = 2.0f/dy;
@@ -143,7 +145,7 @@ public class TestPMVMatrix03NOUI {
FloatUtil.multMatrix(m, 0, matrixOrtho, 0);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestPMVMatrix03NOUI.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestQuaternion01NOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestQuaternion01NOUI.java
index 6881dab8f..d6d7131fa 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestQuaternion01NOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestQuaternion01NOUI.java
@@ -248,7 +248,7 @@ public class TestQuaternion01NOUI {
final float[] vecHas = new float[3];
final float[] vecOut2 = new float[4];
float[] mat1 = new float[4*4];
- float[] mat2 = new float[4*4];
+ final float[] mat2 = new float[4*4];
final Quaternion quat = new Quaternion();
//
@@ -401,8 +401,8 @@ public class TestQuaternion01NOUI {
//
a = FloatUtil.QUARTER_PI;
- float[] vecExp = new float[3];
- float[] vecCol = new float[3];
+ final float[] vecExp = new float[3];
+ final float[] vecCol = new float[3];
mat1 = new float[] { // Column Order
FloatUtil.cos(a), FloatUtil.sin(a), 0, 0, //
-FloatUtil.sin(a), FloatUtil.cos(a), 0, 0,
@@ -811,7 +811,7 @@ public class TestQuaternion01NOUI {
Assert.assertEquals(0f, VectorUtil.distVec3(direction, vecHas), Quaternion.ALLOWED_DEVIANCE);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestQuaternion01NOUI.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java b/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
index 3bc5159a6..883bf4362 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
@@ -85,7 +85,7 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
boolean modLightBrighter = true;
- Color modLight(Color c) {
+ Color modLight(final Color c) {
Color c2;
if(modLightBrighter) {
c2 = c.brighter();
@@ -99,18 +99,18 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
}
class SwingGLAction implements GLEventListener {
- public void init(GLAutoDrawable glad) {
+ public void init(final GLAutoDrawable glad) {
}
- public void dispose(GLAutoDrawable glad) {
+ public void dispose(final GLAutoDrawable glad) {
}
- public void display(GLAutoDrawable glad) {
+ public void display(final GLAutoDrawable glad) {
colorPanel.setBackground(modLight(colorPanel.getBackground()));
colorPanel.repaint();
}
- public void reshape(GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
+ public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
}
}
@@ -127,21 +127,21 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
button = new JButton("Click me");
button.addMouseListener(new MouseAdapter() {
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
System.err.println("Test: "+e);
}
});
panel.add(button, BorderLayout.NORTH);
colorPanel = new JPanel();
- Dimension size = new Dimension(400,100);
+ final Dimension size = new Dimension(400,100);
colorPanel.setPreferredSize(size);
colorPanel.setBorder(border);
panel.add(colorPanel, BorderLayout.SOUTH);
frame = new JFrame("PRE JOGL");
frame.addWindowListener( new WindowAdapter() {
- public void windowClosing(WindowEvent ev) {
+ public void windowClosing(final WindowEvent ev) {
windowClosing=true;
}
});
@@ -199,10 +199,10 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.release(): End");
}
- protected void runTestGL(final Canvas canvas, GLAutoDrawable drawable)
+ protected void runTestGL(final Canvas canvas, final GLAutoDrawable drawable)
throws AWTException, InterruptedException, InvocationTargetException {
- Dimension size = new Dimension(400,400);
+ final Dimension size = new Dimension(400,400);
canvas.setPreferredSize(size);
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -232,7 +232,7 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
colorPanel.setBackground(Color.blue);
drawable.addGLEventListener(new SwingGLAction());
- Point p0 = canvas.getLocationOnScreen();
+ final Point p0 = canvas.getLocationOnScreen();
p0.translate(10,10);
robot.mouseMove( (int) ( p0.getX() + .5 ) ,
(int) ( p0.getY() + .5 ) );
@@ -262,23 +262,23 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
public void test01NewtCanvasAWT() throws AWTException, InterruptedException, InvocationTargetException {
System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test01NewtCanvasAWT(): Start");
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
- GLWindow win0 = GLWindow.create(caps);
+ final GLWindow win0 = GLWindow.create(caps);
win0.setSize(100,100);
win0.setVisible(true);
Assert.assertEquals(true, AWTRobotUtil.waitForRealized(win0, true));
- Screen screen = win0.getScreen();
+ final Screen screen = win0.getScreen();
final RectangleImmutable screenBoundsInWinU = screen.getViewportInWindowUnits();
win0.setPosition(screenBoundsInWinU.getX()-150, 0);
win0.addGLEventListener(new GearsES2());
- Animator anim = new Animator(win0);
+ final Animator anim = new Animator(win0);
anim.start();
- GLWindow win1 = GLWindow.create(caps);
- NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(win1);
+ final GLWindow win1 = GLWindow.create(caps);
+ final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(win1);
anim.add(win1);
runTestGL(newtCanvasAWT, win1);
@@ -301,10 +301,10 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
@Test
public void test02GLCanvas() throws AWTException, InterruptedException, InvocationTargetException {
System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test02GLCanvas(): Start");
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
- Animator anim = new Animator();
+ final Animator anim = new Animator();
anim.start();
/**
@@ -320,7 +320,7 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
anim.add(win0);
*/
- GLCanvas glCanvas = new GLCanvas(caps);
+ final GLCanvas glCanvas = new GLCanvas(caps);
anim.add(glCanvas);
runTestGL(glCanvas, glCanvas);
@@ -335,15 +335,15 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test02GLCanvas(): End");
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2File.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2File.java
index 9506d00e5..989bd5e3a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2File.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2File.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.offscreen;
import java.io.IOException;
@@ -35,12 +35,12 @@ import java.io.File;
public class ReadBuffer2File extends ReadBufferBase {
- public ReadBuffer2File(GLDrawable externalRead) {
+ public ReadBuffer2File(final GLDrawable externalRead) {
super(externalRead, false);
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
super.dispose(drawable);
}
int shotNum = 0;
@@ -50,18 +50,18 @@ public class ReadBuffer2File extends ReadBufferBase {
return;
}
- File file = File.createTempFile("shot" + shotNum + "-", ".png");
+ final File file = File.createTempFile("shot" + shotNum + "-", ".png");
readBufferUtil.write(file);
System.out.println("Wrote: " + file.getAbsolutePath() + ", ...");
shotNum++;
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
super.display(drawable);
try {
copyTextureData2File();
- } catch (IOException ex) {
+ } catch (final IOException ex) {
throw new RuntimeException("can not read buffer to file", ex);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java
index 5bdef2869..3f9a64f5b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,21 +20,23 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.offscreen;
import java.nio.*;
+
import javax.media.opengl.*;
import javax.media.opengl.fixedfunc.*;
import com.jogamp.opengl.util.*;
import javax.media.opengl.fixedfunc.GLPointerFunc;
+
import com.jogamp.opengl.util.texture.TextureCoords;
import com.jogamp.opengl.util.GLArrayDataClient;
import com.jogamp.opengl.util.GLArrayDataServer;
@@ -46,28 +48,28 @@ public class ReadBuffer2Screen extends ReadBufferBase {
boolean enableBufferAlways = false; // FIXME
boolean enableBufferVBO = true; // FIXME
- public ReadBuffer2Screen (GLDrawable externalRead) {
+ public ReadBuffer2Screen (final GLDrawable externalRead) {
super(externalRead, true);
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
super.init(drawable);
- GL gl = drawable.getGL();
+ final GL gl = drawable.getGL();
pmvMatrix = new PMVMatrix();
- float f_edge = 1f;
+ final float f_edge = 1f;
if(null==readTextureVertices) {
- //readTextureVertices = GLArrayDataClient.createFixed(gl, GLPointerFunc.GL_VERTEX_ARRAY, "mgl_Vertex",
+ //readTextureVertices = GLArrayDataClient.createFixed(gl, GLPointerFunc.GL_VERTEX_ARRAY, "mgl_Vertex",
// 2, GL.GL_FLOAT, true, 4);
- readTextureVertices = GLArrayDataServer.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, 2,
+ readTextureVertices = GLArrayDataServer.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, 2,
GL.GL_FLOAT, true, 4, GL.GL_STATIC_DRAW);
readTextureVertices.setEnableAlways(enableBufferAlways);
readTextureVertices.setVBOEnabled(enableBufferVBO);
{
- FloatBuffer vb = (FloatBuffer)readTextureVertices.getBuffer();
+ final FloatBuffer vb = (FloatBuffer)readTextureVertices.getBuffer();
vb.put(-f_edge); vb.put(-f_edge);
vb.put( f_edge); vb.put(-f_edge);
vb.put(-f_edge); vb.put( f_edge);
@@ -82,10 +84,10 @@ public class ReadBuffer2Screen extends ReadBufferBase {
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
super.reshape(drawable, x, y, width, height);
- GL gl = drawable.getGL();
+ final GL gl = drawable.getGL();
gl.glViewport(0, 0, width, height);
@@ -101,30 +103,30 @@ public class ReadBuffer2Screen extends ReadBufferBase {
}
// Identity ..
- pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
pmvMatrix.glTranslatef(0, 0, -2.5f);
if(null!=glM) {
- glM.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+ glM.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
glM.glLoadMatrixf(pmvMatrix.glGetMvMatrixf());
}
// Set location in front of camera
- pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
pmvMatrix.gluPerspective(45.0f, (float)width / (float)height, 1.0f, 100.0f);
if(null!=glM) {
- glM.glMatrixMode(PMVMatrix.GL_PROJECTION);
+ glM.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
glM.glLoadMatrixf(pmvMatrix.glGetPMatrixf());
}
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
super.dispose(drawable);
}
- void renderOffscreenTexture(GL gl) {
+ void renderOffscreenTexture(final GL gl) {
if(!readBufferUtil.isValid()) return;
// Now draw one quad with the texture
@@ -152,15 +154,15 @@ public class ReadBuffer2Screen extends ReadBufferBase {
readBufferUtil.getTexture().disable(gl);
}
- void updateTextureCoords(GL gl, boolean force) {
+ void updateTextureCoords(final GL gl, final boolean force) {
if(force || null==readTextureCoords) {
- readTextureCoords = GLArrayDataServer.createFixed(GLPointerFunc.GL_TEXTURE_COORD_ARRAY, 2,
+ readTextureCoords = GLArrayDataServer.createFixed(GLPointerFunc.GL_TEXTURE_COORD_ARRAY, 2,
GL.GL_FLOAT, true, 4, GL.GL_STATIC_DRAW);
readTextureCoords.setEnableAlways(enableBufferAlways);
readTextureCoords.setVBOEnabled(enableBufferVBO);
{
- TextureCoords coords = readBufferUtil.getTexture().getImageTexCoords();
- FloatBuffer cb = (FloatBuffer)readTextureCoords.getBuffer();
+ final TextureCoords coords = readBufferUtil.getTexture().getImageTexCoords();
+ final FloatBuffer cb = (FloatBuffer)readTextureCoords.getBuffer();
cb.put(coords.left()); cb.put(coords.bottom());
cb.put(coords.right()); cb.put(coords.bottom());
cb.put(coords.left()); cb.put(coords.top());
@@ -172,12 +174,12 @@ public class ReadBuffer2Screen extends ReadBufferBase {
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
super.display(drawable);
- GL gl = drawable.getGL();
+ final GL gl = drawable.getGL();
- gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
if(gl instanceof GLLightingFunc) {
((GLLightingFunc)gl).glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferBase.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferBase.java
index f8e064a4e..e834775fc 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferBase.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferBase.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.offscreen;
import javax.media.opengl.*;
@@ -40,12 +40,12 @@ public class ReadBufferBase implements GLEventListener {
GLReadBufferUtil readBufferUtil;
- public ReadBufferBase (GLDrawable externalRead, boolean write2Texture) {
+ public ReadBufferBase (final GLDrawable externalRead, final boolean write2Texture) {
this.externalRead = externalRead ;
this.readBufferUtil = new GLReadBufferUtil(false, write2Texture);
}
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
GL _gl = drawable.getGL();
_gl.glGetError(); // flush error ..
@@ -53,7 +53,7 @@ public class ReadBufferBase implements GLEventListener {
if(glDebug) {
try {
_gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", null, _gl, null) );
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException("can not set debug pipeline", e);
}
}
@@ -61,7 +61,7 @@ public class ReadBufferBase implements GLEventListener {
if(glTrace) {
try {
_gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, _gl, new Object[] { System.err } ) );
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException("can not set trace pipeline", e);
}
}
@@ -77,14 +77,14 @@ public class ReadBufferBase implements GLEventListener {
System.out.println("---------------------------");
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
readBufferUtil.dispose(drawable.getGL());
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
readBufferUtil.readPixels(drawable.getGL(), false);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/Surface2File.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/Surface2File.java
index 974e32289..5c2e80170 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/Surface2File.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/Surface2File.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.offscreen;
import javax.media.opengl.*;
@@ -46,29 +46,29 @@ public class Surface2File implements SurfaceUpdatedListener {
final GLReadBufferUtil readBufferUtil;
int shotNum = 0;
- public Surface2File(String filename, boolean alpha) {
+ public Surface2File(final String filename, final boolean alpha) {
this.filename = filename;
- this.alpha = alpha;
+ this.alpha = alpha;
this.readBufferUtil = new GLReadBufferUtil(alpha, false);
}
-
- public void dispose(GL gl) {
+
+ public void dispose(final GL gl) {
readBufferUtil.dispose(gl);
}
- public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+ public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
if (updater instanceof GLDrawable) {
- GLDrawable drawable = (GLDrawable) updater;
- GLContext ctx = GLContext.getCurrent();
+ final GLDrawable drawable = (GLDrawable) updater;
+ final GLContext ctx = GLContext.getCurrent();
if (null != ctx && ctx.getGLDrawable() == drawable) {
- GL gl = ctx.getGL();
+ final GL gl = ctx.getGL();
// FIXME glFinish() is an expensive paranoia sync, should not be necessary due to spec
gl.glFinish();
if(readBufferUtil.readPixels(gl, false)) {
gl.glFinish();
try {
surface2File();
- } catch (IOException ex) {
+ } catch (final IOException ex) {
throw new RuntimeException("can not write survace to file", ex);
}
}
@@ -85,7 +85,7 @@ public class Surface2File implements SurfaceUpdatedListener {
final String pfmt = alpha ? "rgba" : "rgb_" ;
new PrintWriter(sw).printf("%s-I_%s-%04d.png", filename, pfmt, shotNum);
}
- File file = new File(sw.toString());
+ final File file = new File(sw.toString());
readBufferUtil.write(file);
shotNum++;
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen01GLPBufferNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen01GLPBufferNEWT.java
index 3f0dae6b0..78224de49 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen01GLPBufferNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen01GLPBufferNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.offscreen;
import com.jogamp.newt.Display;
@@ -72,22 +72,22 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
public void init() {
capsDefault = new GLCapabilities(glpDefault);
Assert.assertNotNull(capsDefault);
- capsDefault.setAlphaBits(1); // req. alpha channel
+ capsDefault.setAlphaBits(1); // req. alpha channel
}
- private void do01OffscreenWindowPBuffer(GLCapabilities caps) {
- Display display = NewtFactory.createDisplay(null); // local display
+ private void do01OffscreenWindowPBuffer(final GLCapabilities caps) {
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
- Window window = NewtFactory.createWindow(screen, caps);
+ final Window window = NewtFactory.createWindow(screen, caps);
Assert.assertNotNull(window);
window.setSize(width, height);
- GLWindow glWindow = GLWindow.create(window);
+ final GLWindow glWindow = GLWindow.create(window);
Assert.assertNotNull(glWindow);
glWindow.setVisible(true);
- GLEventListener demo = new RedSquareES2();
+ final GLEventListener demo = new RedSquareES2();
WindowUtilNEWT.setDemoFields(demo, window, glWindow, false);
glWindow.addGLEventListener(demo);
@@ -115,7 +115,7 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
return;
}
- GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+ final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
do01OffscreenWindowPBuffer(caps2);
}
@@ -125,7 +125,7 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
return;
}
- GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+ final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
caps2.setStencilBits(8);
do01OffscreenWindowPBuffer(caps2);
}
@@ -136,7 +136,7 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
return;
}
- GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+ final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
caps2.setStencilBits(8);
caps2.setAlphaBits(8);
do01OffscreenWindowPBuffer(caps2);
@@ -148,7 +148,7 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
return;
}
- GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+ final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
caps2.setRedBits(5);
caps2.setGreenBits(5);
caps2.setBlueBits(5);
@@ -161,15 +161,16 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
return;
}
- GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
- int winnum = 3, i;
- Window windows[] = new Window[winnum];
- GLWindow glWindows[] = new GLWindow[winnum];
- GLEventListener demos[] = new GLEventListener[winnum];
+ final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+ final int winnum = 3;
+ int i;
+ final Window windows[] = new Window[winnum];
+ final GLWindow glWindows[] = new GLWindow[winnum];
+ final GLEventListener demos[] = new GLEventListener[winnum];
- Display display = NewtFactory.createDisplay(null); // local display
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
for(i=0; i<winnum; i++) {
@@ -214,13 +215,14 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
return;
}
- GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
- int winnum = 3, i;
- Display displays[] = new Display[winnum];
- Screen screens[] = new Screen[winnum];
- Window windows[] = new Window[winnum];
- GLWindow glWindows[] = new GLWindow[winnum];
- GLEventListener demos[] = new GLEventListener[winnum];
+ final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+ final int winnum = 3;
+ int i;
+ final Display displays[] = new Display[winnum];
+ final Screen screens[] = new Screen[winnum];
+ final Window windows[] = new Window[winnum];
+ final GLWindow glWindows[] = new GLWindow[winnum];
+ final GLEventListener demos[] = new GLEventListener[winnum];
for(i=0; i<winnum; i++) {
System.out.println("Create Window "+i);
@@ -267,21 +269,21 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
return;
}
- GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+ final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
System.out.println("Create Window 1");
- Display display = NewtFactory.createDisplay(null); // local display
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
- Window window = NewtFactory.createWindow(screen, caps2);
+ final Window window = NewtFactory.createWindow(screen, caps2);
Assert.assertNotNull(window);
window.setSize(width, height);
- GLWindow glWindow = GLWindow.create(window);
+ final GLWindow glWindow = GLWindow.create(window);
Assert.assertNotNull(glWindow);
glWindow.setVisible(true);
- WindowUtilNEWT.run(getSimpleTestName("."), glWindow, new RedSquareES2(), null, null, null, null,
+ WindowUtilNEWT.run(getSimpleTestName("."), glWindow, new RedSquareES2(), null, null, null, null,
2 /* frames */, true /*snapshot*/, false /*debug*/);
if(null!=glWindow) {
@@ -298,8 +300,8 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
}
}
- public static void main(String args[]) throws IOException {
- String tstname = TestOffscreen01GLPBufferNEWT.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestOffscreen01GLPBufferNEWT.class.getName();
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
"filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen02BitmapNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen02BitmapNEWT.java
index 72cb7a512..2202b754c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen02BitmapNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen02BitmapNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.offscreen;
@@ -46,8 +46,8 @@ import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquareES1;
import java.io.IOException;
/**
- * Using ES1 GL demo, since pixmap might not be hw accelerated,
- * hence it is possible to not have GLSL.
+ * Using ES1 GL demo, since pixmap might not be hw accelerated,
+ * hence it is possible to not have GLSL.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestOffscreen02BitmapNEWT extends UITestCase {
@@ -55,27 +55,27 @@ public class TestOffscreen02BitmapNEWT extends UITestCase {
@Test
public void test11OffscreenWindowPixmap() {
- // we need to stay w/ generic profile GL2ES1
- // since software rasterizer might be required (pixmap/bitmap)
- GLProfile glp = GLProfile.get(GLProfile.GL2ES1);
+ // we need to stay w/ generic profile GL2ES1
+ // since software rasterizer might be required (pixmap/bitmap)
+ final GLProfile glp = GLProfile.get(GLProfile.GL2ES1);
Assert.assertNotNull(glp);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, false, false);
+ final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, false, false);
- Display display = NewtFactory.createDisplay(null); // local display
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
- Window window = NewtFactory.createWindow(screen, caps2);
+ final Window window = NewtFactory.createWindow(screen, caps2);
Assert.assertNotNull(window);
window.setSize(width, height);
- GLWindow glWindow = GLWindow.create(window);
+ final GLWindow glWindow = GLWindow.create(window);
Assert.assertNotNull(glWindow);
glWindow.setVisible(true);
- GLEventListener demo = new RedSquareES1();
+ final GLEventListener demo = new RedSquareES1();
WindowUtilNEWT.setDemoFields(demo, window, glWindow, false);
glWindow.addGLEventListener(demo);
@@ -99,27 +99,27 @@ public class TestOffscreen02BitmapNEWT extends UITestCase {
@Test
public void test14OffscreenSnapshotWithDemoPixmap() {
- // we need to stay w/ generic profile GL2ES1
- // since software rasterizer might be required (pixmap/bitmap)
- GLProfile glp = GLProfile.get(GLProfile.GL2ES1);
+ // we need to stay w/ generic profile GL2ES1
+ // since software rasterizer might be required (pixmap/bitmap)
+ final GLProfile glp = GLProfile.get(GLProfile.GL2ES1);
Assert.assertNotNull(glp);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, false, false);
+ final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, false, false);
- Display display = NewtFactory.createDisplay(null); // local display
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
- Window window = NewtFactory.createWindow(screen, caps2);
+ final Window window = NewtFactory.createWindow(screen, caps2);
Assert.assertNotNull(window);
window.setSize(width, height);
- GLWindow glWindow = GLWindow.create(window);
+ final GLWindow glWindow = GLWindow.create(window);
Assert.assertNotNull(glWindow);
glWindow.setVisible(true);
- WindowUtilNEWT.run(getSimpleTestName("."), glWindow, new RedSquareES1(), null, null, null, null,
+ WindowUtilNEWT.run(getSimpleTestName("."), glWindow, new RedSquareES1(), null, null, null, null,
2 /* frames */, true /*snapshot*/, false /*debug*/);
if(null!=glWindow) {
@@ -135,8 +135,8 @@ public class TestOffscreen02BitmapNEWT extends UITestCase {
display.destroy();
}
}
- public static void main(String args[]) throws IOException {
- String tstname = TestOffscreen02BitmapNEWT.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestOffscreen02BitmapNEWT.class.getName();
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
"filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/WindowUtilNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/WindowUtilNEWT.java
index efca752a1..9e66a614e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/WindowUtilNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/WindowUtilNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.offscreen;
import com.jogamp.opengl.test.junit.util.*;
@@ -40,15 +40,15 @@ import com.jogamp.newt.opengl.*;
public class WindowUtilNEWT {
- public static GLCapabilities fixCaps(GLCapabilities caps, boolean onscreen, boolean pbuffer, boolean undecorated) {
- GLCapabilities caps2 = (GLCapabilities) caps.cloneMutable();
+ public static GLCapabilities fixCaps(final GLCapabilities caps, final boolean onscreen, final boolean pbuffer, final boolean undecorated) {
+ final GLCapabilities caps2 = (GLCapabilities) caps.cloneMutable();
caps2.setOnscreen(onscreen);
caps2.setPBuffer(!onscreen && pbuffer);
caps2.setDoubleBuffered(!onscreen);
return caps2;
}
- public static void setDemoFields(GLEventListener demo, Window window, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final Window window, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(window);
if(debug) {
@@ -60,9 +60,9 @@ public class WindowUtilNEWT {
}
}
- public static void run(String testName, GLWindow windowOffScreen, GLEventListener demo,
- GLWindow windowOnScreenBlit, WindowListener wl, MouseListener ml,
- SurfaceUpdatedListener ul, int frames, boolean snapshot, boolean debug) {
+ public static void run(final String testName, final GLWindow windowOffScreen, final GLEventListener demo,
+ final GLWindow windowOnScreenBlit, final WindowListener wl, final MouseListener ml,
+ final SurfaceUpdatedListener ul, final int frames, final boolean snapshot, final boolean debug) {
Assert.assertNotNull(windowOffScreen);
Assert.assertNotNull(demo);
@@ -79,14 +79,14 @@ public class WindowUtilNEWT {
windowOnScreenBlit.setVisible(true);
}
- GLDrawable readDrawable = windowOffScreen.getContext().getGLDrawable() ;
+ final GLDrawable readDrawable = windowOffScreen.getContext().getGLDrawable() ;
if ( null != windowOnScreenBlit ) {
- ReadBuffer2Screen readDemo = new ReadBuffer2Screen( readDrawable ) ;
+ final ReadBuffer2Screen readDemo = new ReadBuffer2Screen( readDrawable ) ;
windowOnScreenBlit.addGLEventListener(readDemo);
}
if(snapshot) {
final boolean alpha = windowOffScreen.getChosenGLCapabilities().getAlphaBits()>0;
- Surface2File s2f = new Surface2File(testName, alpha);
+ final Surface2File s2f = new Surface2File(testName, alpha);
windowOffScreen.addSurfaceUpdatedListener(s2f);
}
if(null!=ul) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java
index 0ca84e4c3..33c918b66 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java
@@ -96,15 +96,15 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
final GLAutoDrawable glad = useGLJPanel ? createGLJPanel(caps, useGears, animator, eSize) : createGLCanvas(caps, useGears, animator, eSize);
glad.addGLEventListener(new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
initCount++;
}
@Override
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
});
panel.add((Component)glad);
}
@@ -116,7 +116,7 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
frame.setVisible(true);
t[2] = Platform.currentTimeMillis();
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -126,7 +126,7 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
try {
Thread.sleep(100);
System.err.println("Sleep initialized: "+initCount+"/"+panelCount);
- } catch (InterruptedException e1) {
+ } catch (final InterruptedException e1) {
e1.printStackTrace();
}
t1 = System.currentTimeMillis();
@@ -145,7 +145,7 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
}
try {
Thread.sleep(duration);
- } catch (InterruptedException e1) {
+ } catch (final InterruptedException e1) {
e1.printStackTrace();
}
t[4] = Platform.currentTimeMillis();
@@ -154,7 +154,7 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
public void run() {
frame.dispose();
} } );
- } catch (Exception e1) {
+ } catch (final Exception e1) {
e1.printStackTrace();
}
final long ti_net = (t[4]-t[0])-duration;
@@ -165,8 +165,8 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
System.err.println("Total: "+(t[4]-t[0]));
}
- private GLAutoDrawable createGLCanvas(GLCapabilitiesImmutable caps, boolean useGears, GLAnimatorControl anim, Dimension size) {
- GLCanvas canvas = new GLCanvas(caps);
+ private GLAutoDrawable createGLCanvas(final GLCapabilitiesImmutable caps, final boolean useGears, final GLAnimatorControl anim, final Dimension size) {
+ final GLCanvas canvas = new GLCanvas(caps);
canvas.setSize(size);
canvas.setPreferredSize(size);
if( useGears ) {
@@ -177,8 +177,8 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
}
return canvas;
}
- private GLAutoDrawable createGLJPanel(GLCapabilitiesImmutable caps, boolean useGears, GLAnimatorControl anim, Dimension size) {
- GLJPanel canvas = new GLJPanel(caps);
+ private GLAutoDrawable createGLJPanel(final GLCapabilitiesImmutable caps, final boolean useGears, final GLAnimatorControl anim, final Dimension size) {
+ final GLJPanel canvas = new GLJPanel(caps);
canvas.setSize(size);
canvas.setPreferredSize(size);
if( useGears ) {
@@ -197,7 +197,7 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
@Test
public void test02NopGLJPanelBitmap() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(null);
+ final GLCapabilities caps = new GLCapabilities(null);
caps.setBitmap(true);
test(caps, false /*useGears*/, width, height, rows, cols, true /* useGLJPanel */, false /*useAnim*/);
}
@@ -213,7 +213,7 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
volatile int initCount = 0;
- public static void main(String[] args) {
+ public static void main(final String[] args) {
boolean useGLJPanel = true, useGears = false, manual=false;
boolean waitMain = false;
@@ -248,7 +248,7 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
}
if( manual ) {
GLProfile.initSingleton();
- TestPerf001GLJPanelInit01AWT demo = new TestPerf001GLJPanelInit01AWT();
+ final TestPerf001GLJPanelInit01AWT demo = new TestPerf001GLJPanelInit01AWT();
demo.test(null, useGears, width, height, rows, cols, useGLJPanel, false /*useAnim*/);
} else {
org.junit.runner.JUnitCore.main(TestPerf001GLJPanelInit01AWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java
index 2b1dc411f..0cbcd5e2f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java
@@ -120,15 +120,15 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
if( null != glad ) {
glad.addGLEventListener(new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
initCount++;
}
@Override
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
});
panel.add((Component)glad);
} else {
@@ -143,7 +143,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
}
@SuppressWarnings("deprecation")
@Override
- public void reshape(int x, int y, int width, int height) {
+ public void reshape(final int x, final int y, final int width, final int height) {
super.reshape(x, y, width, height);
reshapeWidth = width; reshapeHeight = height;
}
@@ -172,7 +172,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
}
t[2] = Platform.currentTimeMillis();
} } );
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -182,7 +182,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
try {
Thread.sleep(100);
System.err.println("Sleep initialized: "+initCount+"/"+frameCount);
- } catch (InterruptedException e1) {
+ } catch (final InterruptedException e1) {
e1.printStackTrace();
}
t1 = System.currentTimeMillis();
@@ -202,7 +202,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
}
try {
Thread.sleep(duration);
- } catch (InterruptedException e1) {
+ } catch (final InterruptedException e1) {
e1.printStackTrace();
}
t[4] = Platform.currentTimeMillis();
@@ -213,7 +213,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
frame[i].dispose();
}
} } );
- } catch (Exception e1) {
+ } catch (final Exception e1) {
e1.printStackTrace();
}
@@ -225,8 +225,8 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
System.err.println("Total: "+(t[4]-t[0]));
}
- private GLAutoDrawable createGLCanvas(GLCapabilitiesImmutable caps, boolean useGears, GLAnimatorControl anim, Dimension size) {
- GLCanvas canvas = new GLCanvas(caps);
+ private GLAutoDrawable createGLCanvas(final GLCapabilitiesImmutable caps, final boolean useGears, final GLAnimatorControl anim, final Dimension size) {
+ final GLCanvas canvas = new GLCanvas(caps);
canvas.setSize(size);
canvas.setPreferredSize(size);
if( useGears ) {
@@ -239,8 +239,8 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
}
return canvas;
}
- private GLAutoDrawable createGLJPanel(boolean initMT, boolean useSwingDoubleBuffer, GLCapabilitiesImmutable caps, boolean useGears, boolean skipGLOrientationVerticalFlip, GLAnimatorControl anim, Dimension size) {
- GLJPanel canvas = new GLJPanel(caps);
+ private GLAutoDrawable createGLJPanel(final boolean initMT, final boolean useSwingDoubleBuffer, final GLCapabilitiesImmutable caps, final boolean useGears, final boolean skipGLOrientationVerticalFlip, final GLAnimatorControl anim, final Dimension size) {
+ final GLJPanel canvas = new GLJPanel(caps);
canvas.setSize(size);
canvas.setPreferredSize(size);
canvas.setDoubleBuffered(useSwingDoubleBuffer);
@@ -370,7 +370,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
// @Test
public void testXXNopGLJPanelBitmapGridSingle() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(null);
+ final GLCapabilities caps = new GLCapabilities(null);
caps.setBitmap(true);
test(caps, false /*useGears*/, false /*skipGLOrientationVerticalFlip*/, width , height, frameCount, false /* initMT */,
true /* useGLJPanel */, false /*useSwingDoubleBuffer*/, false /* useGLCanvas */, false /*useAnim*/, false);
@@ -382,7 +382,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
volatile int initCount = 0;
- public static void main(String[] args) {
+ public static void main(final String[] args) {
boolean manual=false;
boolean waitMain = false;
boolean useGLJPanel = true, initMT = false, useGLCanvas = false, useSwingDoubleBuffer=false;
@@ -435,7 +435,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
}
if( manual ) {
GLProfile.initSingleton();
- TestPerf001GLJPanelInit02AWT demo = new TestPerf001GLJPanelInit02AWT();
+ final TestPerf001GLJPanelInit02AWT demo = new TestPerf001GLJPanelInit02AWT();
demo.test(null, useGears, skipGLOrientationVerticalFlip, width, height, frameCount,
initMT, useGLJPanel, useSwingDoubleBuffer, useGLCanvas, useAnim, overlap);
} else {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java
index 18b3d5454..d3dddc56f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java
@@ -60,7 +60,7 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase {
GLProfile.initSingleton();
}
- public void test(final GLCapabilitiesImmutable caps, final boolean useGears, final int width, final int height, final int frameCount, boolean reuseDevice) {
+ public void test(final GLCapabilitiesImmutable caps, final boolean useGears, final int width, final int height, final int frameCount, final boolean reuseDevice) {
final int cols = (int)Math.round(Math.sqrt(frameCount));
final int rows = frameCount / cols;
final int eWidth = width/cols;
@@ -92,15 +92,15 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase {
}
frame[i].addGLEventListener(new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
initCount++;
}
@Override
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
});
}
t[1] = Platform.currentTimeMillis();
@@ -115,7 +115,7 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase {
try {
Thread.sleep(100);
System.err.println("Sleep initialized: "+initCount+"/"+frameCount);
- } catch (InterruptedException e1) {
+ } catch (final InterruptedException e1) {
e1.printStackTrace();
}
t1 = System.currentTimeMillis();
@@ -134,7 +134,7 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase {
}
try {
Thread.sleep(duration);
- } catch (InterruptedException e1) {
+ } catch (final InterruptedException e1) {
e1.printStackTrace();
}
t[4] = Platform.currentTimeMillis();
@@ -171,7 +171,7 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase {
volatile int initCount = 0;
- public static void main(String[] args) {
+ public static void main(final String[] args) {
mainRun = true;
boolean useGears = false, manual=false;
boolean waitMain = false;
@@ -203,7 +203,7 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase {
}
if( manual ) {
GLProfile.initSingleton();
- TestPerf001GLWindowInit03NEWT demo = new TestPerf001GLWindowInit03NEWT();
+ final TestPerf001GLWindowInit03NEWT demo = new TestPerf001GLWindowInit03NEWT();
demo.test(null, useGears, width, height, frameCount, false /* reuseDevice */);
} else {
org.junit.runner.JUnitCore.main(TestPerf001GLWindowInit03NEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java
index 6f7d9329b..f8b15a843 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java
@@ -207,7 +207,7 @@ public class TestPerf001RawInit00NEWT extends UITestCase {
static int manualTest = 0;
static int width = 800, height = 600, count = 50;
- public static void main(String[] args) {
+ public static void main(final String[] args) {
boolean waitMain = false;
for(int i=0; i<args.length; i++) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/stereo/ovr/OVRDemo01.java b/src/test/com/jogamp/opengl/test/junit/jogl/stereo/ovr/OVRDemo01.java
index bfd660556..1cc07ec22 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/stereo/ovr/OVRDemo01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/stereo/ovr/OVRDemo01.java
@@ -49,6 +49,7 @@ import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
/**
* All distortions, no multisampling, bilinear filtering, manual-swap and using two FBOs (default, good)
@@ -177,7 +178,7 @@ public class OVRDemo01 {
final Animator animator = useAnimator ? new Animator() : null;
if( useAnimator ) {
- animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+ animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
animator.setExclusiveContext(exclusiveContext);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashForm.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashForm.java
index 36c672179..e6cb48764 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashForm.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashForm.java
@@ -44,6 +44,7 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import javax.media.nativewindow.util.Dimension;
@@ -136,7 +137,7 @@ public class TestBug672NewtCanvasSWTSashForm extends UITestCase {
display.dispose();
}});
}
- catch( Throwable throwable ) {
+ catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -150,7 +151,7 @@ public class TestBug672NewtCanvasSWTSashForm extends UITestCase {
class WaitAction implements Runnable {
private final long sleepMS;
- WaitAction(long sleepMS) {
+ WaitAction(final long sleepMS) {
this.sleepMS = sleepMS;
}
public void run() {
@@ -158,41 +159,41 @@ public class TestBug672NewtCanvasSWTSashForm extends UITestCase {
// blocks on linux .. display.sleep();
try {
Thread.sleep(sleepMS);
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
}
}
}
final WaitAction awtRobotWaitAction = new WaitAction(AWTRobotUtil.TIME_SLICE);
final WaitAction generalWaitAction = new WaitAction(10);
- protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
- com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, screenIdx);
+ protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
+ final com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, screenIdx);
final GLWindow glWindow = GLWindow.create(screen, caps);
Assert.assertNotNull(glWindow);
final GearsES2 demo = new GearsES2(1);
glWindow.addGLEventListener(demo);
- Animator animator = new Animator();
- animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+ final Animator animator = new Animator();
+ animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
glWindow.addKeyListener(quitAdapter);
glWindow.addWindowListener(quitAdapter);
glWindow.addWindowListener(new WindowAdapter() {
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
- public void windowMoved(WindowEvent e) {
+ public void windowMoved(final WindowEvent e) {
System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
});
glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
}
@@ -281,7 +282,7 @@ public class TestBug672NewtCanvasSWTSashForm extends UITestCase {
runTestGL(caps);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
int x=0, y=0, w=640, h=480, rw=-1, rh=-1;
boolean usePos = false;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashFormComposite.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashFormComposite.java
index 9ad6e1f5c..944fa1071 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashFormComposite.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashFormComposite.java
@@ -44,6 +44,7 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import javax.media.nativewindow.util.Dimension;
@@ -142,7 +143,7 @@ public class TestBug672NewtCanvasSWTSashFormComposite extends UITestCase {
display.dispose();
}});
}
- catch( Throwable throwable ) {
+ catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -157,7 +158,7 @@ public class TestBug672NewtCanvasSWTSashFormComposite extends UITestCase {
class WaitAction implements Runnable {
private final long sleepMS;
- WaitAction(long sleepMS) {
+ WaitAction(final long sleepMS) {
this.sleepMS = sleepMS;
}
public void run() {
@@ -165,41 +166,41 @@ public class TestBug672NewtCanvasSWTSashFormComposite extends UITestCase {
// blocks on linux .. display.sleep();
try {
Thread.sleep(sleepMS);
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
}
}
}
final WaitAction awtRobotWaitAction = new WaitAction(AWTRobotUtil.TIME_SLICE);
final WaitAction generalWaitAction = new WaitAction(10);
- protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
- com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, screenIdx);
+ protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
+ final com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, screenIdx);
final GLWindow glWindow = GLWindow.create(screen, caps);
Assert.assertNotNull(glWindow);
final GearsES2 demo = new GearsES2(1);
glWindow.addGLEventListener(demo);
- Animator animator = new Animator();
- animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+ final Animator animator = new Animator();
+ animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
//glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
//glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
glWindow.addKeyListener(quitAdapter);
glWindow.addWindowListener(quitAdapter);
glWindow.addWindowListener(new WindowAdapter() {
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
- public void windowMoved(WindowEvent e) {
+ public void windowMoved(final WindowEvent e) {
System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
}
});
glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
}
@@ -288,7 +289,7 @@ public class TestBug672NewtCanvasSWTSashFormComposite extends UITestCase {
runTestGL(caps);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
int x=0, y=0, w=640, h=480, rw=-1, rh=-1;
boolean usePos = false;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTBug628ResizeDeadlockAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTBug628ResizeDeadlockAWT.java
index be3a11bfc..fb563f955 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTBug628ResizeDeadlockAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTBug628ResizeDeadlockAWT.java
@@ -49,6 +49,7 @@ import javax.media.opengl.GLAutoDrawable ;
import javax.media.opengl.GLCapabilities ;
import javax.media.opengl.GLEventListener ;
import javax.media.opengl.GLProfile;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.nativewindow.swt.SWTAccessor;
import com.jogamp.newt.NewtFactory;
@@ -72,9 +73,9 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
{
float r = 0f, g = 0f, b = 0f;
- public void init( GLAutoDrawable drawable )
+ public void init( final GLAutoDrawable drawable )
{
- GL2 gl = drawable.getGL().getGL2() ;
+ final GL2 gl = drawable.getGL().getGL2() ;
gl.glClearColor( 0.0f, 0.0f, 0.0f, 1.0f ) ;
@@ -83,32 +84,32 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
gl.glBlendFunc( GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA ) ;
}
- public void reshape( GLAutoDrawable drawable, int x, int y, int width, int height )
+ public void reshape( final GLAutoDrawable drawable, final int x, final int y, final int width, final int height )
{
// System.err.println( ">>>>>>>> reshape " + x + ", " + y + ", " + width + ", " +height ) ;
- GL2 gl = drawable.getGL().getGL2() ;
+ final GL2 gl = drawable.getGL().getGL2() ;
gl.glViewport( 0, 0, width, height ) ;
- gl.glMatrixMode( GL2.GL_PROJECTION ) ;
+ gl.glMatrixMode( GLMatrixFunc.GL_PROJECTION ) ;
gl.glLoadIdentity() ;
gl.glOrtho( -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 ) ;
- gl.glMatrixMode( GL2.GL_MODELVIEW ) ;
+ gl.glMatrixMode( GLMatrixFunc.GL_MODELVIEW ) ;
gl.glLoadIdentity() ;
}
- public void display( GLAutoDrawable drawable )
+ public void display( final GLAutoDrawable drawable )
{
// System.err.println( ">>>> display" ) ;
- GL2 gl = drawable.getGL().getGL2() ;
+ final GL2 gl = drawable.getGL().getGL2() ;
// Sven: I could have been seeing things, but it seemed that if this
// glClear is in here twice it seems aggravates the problem. Not
// sure why other than it just takes longer, but this is pretty
// fast operation.
- gl.glClear( GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT ) ;
- gl.glClear( GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT ) ;
+ gl.glClear( GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT ) ;
+ gl.glClear( GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT ) ;
gl.glColor4f( r, g, b, 1.0f ) ;
@@ -135,7 +136,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
}
}
- public void dispose( GLAutoDrawable drawable )
+ public void dispose( final GLAutoDrawable drawable )
{
}
}
@@ -147,7 +148,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
private final Shell _shell ;
private int _n ;
- public ResizeThread( Shell shell )
+ public ResizeThread( final Shell shell )
{
super();
_shell = shell ;
@@ -166,7 +167,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
} else {
_shell.setSize( 400, 450 ) ;
}
- } catch (Exception e0) {
+ } catch (final Exception e0) {
e0.printStackTrace();
Assert.assertTrue("Deadlock @ setSize: "+e0, false);
}
@@ -196,7 +197,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
display.wake();
Thread.sleep( 50L ) ;
- } catch( InterruptedException e ) {
+ } catch( final InterruptedException e ) {
break ;
}
}
@@ -213,7 +214,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
Robot _robot;
int _n = 0;
- public KeyfireThread(Robot robot, Display display)
+ public KeyfireThread(final Robot robot, final Display display)
{
_robot = robot;
_display = display;
@@ -235,7 +236,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
if(!_display.isDisposed()) {
_display.wake();
}
- } catch( InterruptedException e ) {
+ } catch( final InterruptedException e ) {
break ;
}
}
@@ -287,7 +288,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
display.dispose();
}});
}
- catch( Throwable throwable ) {
+ catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -299,7 +300,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
class WaitAction implements Runnable {
private final long sleepMS;
- WaitAction(long sleepMS) {
+ WaitAction(final long sleepMS) {
this.sleepMS = sleepMS;
}
public void run() {
@@ -307,7 +308,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
// blocks on linux .. display.sleep();
try {
Thread.sleep(sleepMS);
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
}
}
}
@@ -325,12 +326,12 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
{
final GLProfile gl2Profile = GLProfile.get( GLProfile.GL2 ) ;
final GLCapabilities caps = new GLCapabilities( gl2Profile ) ;
- com.jogamp.newt.Screen screen = NewtFactory.createScreen(dsc.swtNewtDisplay, 0);
+ final com.jogamp.newt.Screen screen = NewtFactory.createScreen(dsc.swtNewtDisplay, 0);
glWindow = GLWindow.create( screen, caps ) ;
glWindow.addGLEventListener( new BigFlashingX() ) ;
glWindow.addKeyListener(new KeyAdapter() {
@Override
- public void keyReleased(com.jogamp.newt.event.KeyEvent e) {
+ public void keyReleased(final com.jogamp.newt.event.KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
}
@@ -372,17 +373,17 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
public void run() {
try {
Thread.sleep(duration);
- } catch (InterruptedException e) {}
+ } catch (final InterruptedException e) {}
resizer.shallStop = true;
keyfire.shallStop = true;
try
{
resizer.join();
- } catch( InterruptedException e ) { }
+ } catch( final InterruptedException e ) { }
try
{
keyfire.join();
- } catch( InterruptedException e ) { }
+ } catch( final InterruptedException e ) { }
shallStop = true;
if( null != dsc.display && !dsc.display.isDisposed() ) {
dsc.display.wake();
@@ -400,11 +401,11 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
// blocks on linux .. dsc.display.sleep();
try {
Thread.sleep(10);
- } catch (InterruptedException ie) { ie.printStackTrace(); }
+ } catch (final InterruptedException ie) { ie.printStackTrace(); }
}
} } );
}
- } catch (Exception e0) {
+ } catch (final Exception e0) {
e0.printStackTrace();
Assert.assertTrue("Deadlock @ dispatch: "+e0, false);
}
@@ -414,7 +415,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
dsc.dispose();
}
- public static void main( String[] args ) {
+ public static void main( final String[] args ) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
duration = MiscUtils.atoi(args[++i], duration);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTGLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTGLn.java
index 5426ab7af..380bd3f7d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTGLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTGLn.java
@@ -128,7 +128,7 @@ public class TestNewtCanvasSWTGLn extends UITestCase {
display.dispose();
}});
}
- catch( Throwable throwable ) {
+ catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -141,7 +141,7 @@ public class TestNewtCanvasSWTGLn extends UITestCase {
class WaitAction implements Runnable {
private final long sleepMS;
- WaitAction(long sleepMS) {
+ WaitAction(final long sleepMS) {
this.sleepMS = sleepMS;
}
public void run() {
@@ -149,15 +149,15 @@ public class TestNewtCanvasSWTGLn extends UITestCase {
// blocks on linux .. display.sleep();
try {
Thread.sleep(sleepMS);
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
}
}
}
final WaitAction awtRobotWaitAction = new WaitAction(AWTRobotUtil.TIME_SLICE);
final WaitAction generalWaitAction = new WaitAction(10);
- protected void runTestAGL( GLCapabilitiesImmutable caps, GLEventListener demo,
- boolean postAttach, boolean useAnimator ) throws InterruptedException {
+ protected void runTestAGL( final GLCapabilitiesImmutable caps, final GLEventListener demo,
+ final boolean postAttach, final boolean useAnimator ) throws InterruptedException {
final GLReadBufferUtil screenshot = new GLReadBufferUtil(false, false);
final Screen screen = NewtFactory.createScreen(swtNewtDisplay, 0);
@@ -209,13 +209,13 @@ public class TestNewtCanvasSWTGLn extends UITestCase {
anim = null;
}
- long lStartTime = System.currentTimeMillis();
- long lEndTime = lStartTime + duration;
+ final long lStartTime = System.currentTimeMillis();
+ final long lEndTime = lStartTime + duration;
try {
while( (System.currentTimeMillis() < lEndTime) && !canvas1.isDisposed() ) {
generalWaitAction.run();
}
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -243,13 +243,13 @@ public class TestNewtCanvasSWTGLn extends UITestCase {
@Test
public void test_MultisampleAndAlpha() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
caps.setSampleBuffers(true);
caps.setNumSamples(2);
runTestAGL( caps, new MultisampleDemoES2(true), false /* postAttach */, false /* animator */);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
duration = MiscUtils.atoi(args[++i], duration);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java
index 906dbc879..f18e10bb1 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -85,7 +85,7 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
UITestCase.setTestSupported(false);
return;
}
- System.out.println( "GLProfile " + GLProfile.glAvailabilityToString() );
+ System.out.println( "GLProfile " + GLProfile.glAvailabilityToString() );
final Frame f0 = new Frame("Test - AWT 1st");
f0.add(new java.awt.Label("AWT was here 1st"));
try {
@@ -94,7 +94,7 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
f0.pack();
f0.setVisible(true);
}});
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new RuntimeException(e);
}
if(!GLProfile.isAvailable(GLProfile.GL2)) {
@@ -104,7 +104,7 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
protected void init() throws InterruptedException, InvocationTargetException {
SWTAccessor.invoke(true, new Runnable() {
- public void run() {
+ public void run() {
display = new Display();
Assert.assertNotNull( display );
shell = new Shell( display );
@@ -135,7 +135,7 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
// Deadlocks Java7 on Windows
// javax.swing.SwingUtilities.invokeAndWait( releaseAWT );
releaseAWT.run();
-
+
SWTAccessor.invoke(true, new Runnable() {
public void run() {
composite.dispose();
@@ -148,47 +148,47 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
}});
}
- protected void runTestGL( GLProfile glprofile ) throws InterruptedException, InvocationTargetException {
+ protected void runTestGL( final GLProfile glprofile ) throws InterruptedException, InvocationTargetException {
init();
try {
- GLCapabilities glcapabilities = new GLCapabilities( glprofile );
+ final GLCapabilities glcapabilities = new GLCapabilities( glprofile );
glcanvas = new GLCanvas( glcapabilities );
Assert.assertNotNull( glcanvas );
frame.add( glcanvas );
-
+
glcanvas.addGLEventListener( new GLEventListener() {
/* @Override */
- public void init( GLAutoDrawable glautodrawable ) {
+ public void init( final GLAutoDrawable glautodrawable ) {
}
-
+
/* @Override */
- public void dispose( GLAutoDrawable glautodrawable ) {
+ public void dispose( final GLAutoDrawable glautodrawable ) {
}
-
+
/* @Override */
- public void display( GLAutoDrawable glautodrawable ) {
- Rectangle rectangle = new Rectangle( 0, 0, glautodrawable.getSurfaceWidth(), glautodrawable.getSurfaceHeight() );
- GL2ES1 gl = glautodrawable.getGL().getGL2ES1();
+ public void display( final GLAutoDrawable glautodrawable ) {
+ final Rectangle rectangle = new Rectangle( 0, 0, glautodrawable.getSurfaceWidth(), glautodrawable.getSurfaceHeight() );
+ final GL2ES1 gl = glautodrawable.getGL().getGL2ES1();
OneTriangle.render( gl, rectangle.width, rectangle.height );
}
-
+
/* @Override */
- public void reshape( GLAutoDrawable glautodrawable, int x, int y, int width, int height ) {
- Rectangle rectangle = new Rectangle( 0, 0, glautodrawable.getSurfaceWidth(), glautodrawable.getSurfaceHeight() );
- GL2ES1 gl = glautodrawable.getGL().getGL2ES1();
+ public void reshape( final GLAutoDrawable glautodrawable, final int x, final int y, final int width, final int height ) {
+ final Rectangle rectangle = new Rectangle( 0, 0, glautodrawable.getSurfaceWidth(), glautodrawable.getSurfaceHeight() );
+ final GL2ES1 gl = glautodrawable.getGL().getGL2ES1();
OneTriangle.setup( gl, rectangle.width, rectangle.height );
}
});
-
+
SWTAccessor.invoke(true, new Runnable() {
public void run() {
shell.setText( getClass().getName() );
shell.setSize( 640, 480 );
shell.open();
}});
-
- long lStartTime = System.currentTimeMillis();
- long lEndTime = lStartTime + duration;
+
+ final long lStartTime = System.currentTimeMillis();
+ final long lEndTime = lStartTime + duration;
try {
while( (System.currentTimeMillis() < lEndTime) && !composite.isDisposed() ) {
SWTAccessor.invoke(true, new Runnable() {
@@ -197,12 +197,12 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
// blocks on linux .. display.sleep();
try {
Thread.sleep(10);
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
}
}});
}
}
- catch( Throwable throwable ) {
+ catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -213,11 +213,11 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
@Test
public void test() throws InterruptedException, InvocationTargetException {
- GLProfile glprofile = GLProfile.getGL2ES1();
+ final GLProfile glprofile = GLProfile.getGL2ES1();
runTestGL( glprofile );
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
duration = MiscUtils.atoi(args[++i], duration);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTBug643AsyncExec.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTBug643AsyncExec.java
index fd6d370ac..7b64838cc 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTBug643AsyncExec.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTBug643AsyncExec.java
@@ -116,7 +116,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
private final jogamp.newt.DisplayImpl newtDisplay;
private int swtN, newtN ;
- public AsyncExecEDTFeederThread( Display swtDisplay, com.jogamp.newt.Display newtDisplay )
+ public AsyncExecEDTFeederThread( final Display swtDisplay, final com.jogamp.newt.Display newtDisplay )
{
super();
this.swtDisplay = swtDisplay ;
@@ -153,7 +153,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
newtDisplay.runOnEDTIfAvail(false, newtAsyncAction);
}
Thread.sleep( 50L ) ;
- } catch( InterruptedException e ) {
+ } catch( final InterruptedException e ) {
break ;
}
}
@@ -203,7 +203,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
display.dispose();
}});
}
- catch( Throwable throwable ) {
+ catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -213,7 +213,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
}
}
- private void testImpl(boolean useJOGLGLCanvas, boolean useNewtCanvasSWT, boolean glWindowPreVisible) throws InterruptedException, InvocationTargetException {
+ private void testImpl(final boolean useJOGLGLCanvas, final boolean useNewtCanvasSWT, final boolean glWindowPreVisible) throws InterruptedException, InvocationTargetException {
resetSWTAndNEWTEDTCounter();
final SWT_DSC dsc = new SWT_DSC();
@@ -235,7 +235,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
newtDisplay = null;
} else if( useNewtCanvasSWT ) {
newtDisplay = NewtFactory.createDisplay(null, false); // no-reuse
- com.jogamp.newt.Screen screen = NewtFactory.createScreen(newtDisplay, 0);
+ final com.jogamp.newt.Screen screen = NewtFactory.createScreen(newtDisplay, 0);
final GLWindow glWindow = GLWindow.create( screen, caps ) ;
glWindow.addGLEventListener( new GearsES2() ) ;
if( glWindowPreVisible ) {
@@ -250,7 +250,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
throw new InternalError("XXX");
}
if(useAnimator) {
- Animator animator = new Animator(glad);
+ final Animator animator = new Animator(glad);
animator.start();
}
}
@@ -280,7 +280,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
public void run() {
try {
Thread.sleep(duration);
- } catch (InterruptedException e) {}
+ } catch (final InterruptedException e) {}
counterBeforeExit[0] = getSWTCount();
counterBeforeExit[1] = getNEWTCount();
@@ -288,7 +288,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
try
{
asyncExecFeeder.join();
- } catch( InterruptedException e ) { }
+ } catch( final InterruptedException e ) { }
shallStop = true;
dsc.display.wake();
} } );
@@ -304,7 +304,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
Thread.sleep(10);
}
}
- } catch (Exception e0) {
+ } catch (final Exception e0) {
e0.printStackTrace();
Assert.assertTrue("Deadlock @ dispatch: "+e0, false);
}
@@ -335,7 +335,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
testImpl(false /* useJOGLGLCanvas */, true /* useNewtCanvasSWT */, true /* glWindowPreVisible */);
}
- public static void main( String[] args ) {
+ public static void main( final String[] args ) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
duration = MiscUtils.atoi(args[++i], duration);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTEclipseGLCanvas01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTEclipseGLCanvas01GLn.java
index b0acbedc2..69911c599 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTEclipseGLCanvas01GLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTEclipseGLCanvas01GLn.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.swt;
import javax.media.opengl.GL2ES1;
@@ -61,7 +61,7 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
/**
* Tests that a basic SWT app can open without crashing under different GL profiles.
- * <p>
+ * <p>
* Uses the SWT GLCanvas <code>org.eclipse.swt.opengl.GLCanvas</code>.
* </p>
* @author Wade Walker, et.al.
@@ -86,7 +86,7 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
@Before
public void init() {
SWTAccessor.invoke(true, new Runnable() {
- public void run() {
+ public void run() {
display = new Display();
Assert.assertNotNull( display );
shell = new Shell( display );
@@ -111,7 +111,7 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
display.dispose();
}});
}
- catch( Throwable throwable ) {
+ catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -120,8 +120,8 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
composite = null;
}
- protected void runTestAGL( GLProfile glprofile ) throws InterruptedException {
- GLData gldata = new GLData();
+ protected void runTestAGL( final GLProfile glprofile ) throws InterruptedException {
+ final GLData gldata = new GLData();
gldata.doubleBuffer = true;
// need SWT.NO_BACKGROUND to prevent SWT from clearing the window
// at the wrong times (we use glClear for this instead)
@@ -133,11 +133,11 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
// fix the viewport when the user resizes the window
glcanvas.addListener( SWT.Resize, new Listener() {
- public void handleEvent( Event event ) {
- Rectangle rectangle = glcanvas.getClientArea();
+ public void handleEvent( final Event event ) {
+ final Rectangle rectangle = glcanvas.getClientArea();
glcanvas.setCurrent();
glcontext.makeCurrent();
- GL2ES1 gl = glcontext.getGL().getGL2ES1();
+ final GL2ES1 gl = glcontext.getGL().getGL2ES1();
OneTriangle.setup( gl, rectangle.width, rectangle.height );
glcontext.release();
System.err.println("resize");
@@ -146,24 +146,24 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
// draw the triangle when the OS tells us that any part of the window needs drawing
glcanvas.addPaintListener( new PaintListener() {
- public void paintControl( PaintEvent paintevent ) {
- Rectangle rectangle = glcanvas.getClientArea();
+ public void paintControl( final PaintEvent paintevent ) {
+ final Rectangle rectangle = glcanvas.getClientArea();
glcanvas.setCurrent();
glcontext.makeCurrent();
- GL2ES1 gl = glcontext.getGL().getGL2ES1();
+ final GL2ES1 gl = glcontext.getGL().getGL2ES1();
OneTriangle.render( gl, rectangle.width, rectangle.height );
glcanvas.swapBuffers();
glcontext.release();
System.err.println("paint");
}
});
-
+
shell.setText( getClass().getName() );
shell.setSize( 640, 480 );
shell.open();
- long lStartTime = System.currentTimeMillis();
- long lEndTime = lStartTime + duration;
+ final long lStartTime = System.currentTimeMillis();
+ final long lEndTime = lStartTime + duration;
try {
while( (System.currentTimeMillis() < lEndTime) && !glcanvas.isDisposed() ) {
if( !display.readAndDispatch() ) {
@@ -171,7 +171,7 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
Thread.sleep(10);
}
}
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -180,19 +180,19 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
@Test
public void test() throws InterruptedException {
- GLProfile glprofile = GLProfile.getGL2ES1();
+ final GLProfile glprofile = GLProfile.getGL2ES1();
runTestAGL( glprofile );
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
duration = atoi(args[++i]);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTJOGLGLCanvas01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTJOGLGLCanvas01GLn.java
index b38bf0c2c..04ffdcb1c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTJOGLGLCanvas01GLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTJOGLGLCanvas01GLn.java
@@ -123,7 +123,7 @@ public class TestSWTJOGLGLCanvas01GLn extends UITestCase {
display.dispose();
}});
}
- catch( Throwable throwable ) {
+ catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -132,7 +132,7 @@ public class TestSWTJOGLGLCanvas01GLn extends UITestCase {
composite = null;
}
- protected void runTestAGL( GLCapabilitiesImmutable caps, GLEventListener demo ) throws InterruptedException {
+ protected void runTestAGL( final GLCapabilitiesImmutable caps, final GLEventListener demo ) throws InterruptedException {
final GLReadBufferUtil screenshot = new GLReadBufferUtil(false, false);
final GLCanvas canvas = GLCanvas.create( composite, 0, caps, null);
@@ -158,14 +158,14 @@ public class TestSWTJOGLGLCanvas01GLn extends UITestCase {
shell.open();
} } );
- Animator anim = new Animator();
+ final Animator anim = new Animator();
if(doAnimation) {
anim.add(canvas);
anim.start();
}
- long lStartTime = System.currentTimeMillis();
- long lEndTime = lStartTime + duration;
+ final long lStartTime = System.currentTimeMillis();
+ final long lEndTime = lStartTime + duration;
try {
while( (System.currentTimeMillis() < lEndTime) && !canvas.isDisposed() ) {
if( !display.readAndDispatch() ) {
@@ -173,7 +173,7 @@ public class TestSWTJOGLGLCanvas01GLn extends UITestCase {
Thread.sleep(10);
}
}
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -193,21 +193,21 @@ public class TestSWTJOGLGLCanvas01GLn extends UITestCase {
@Test
public void test_MultisampleAndAlpha() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
+ final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
caps.setSampleBuffers(true);
caps.setNumSamples(2);
runTestAGL( caps, new MultisampleDemoES2(true) );
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
duration = atoi(args[++i]);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/OffscreenPrintable.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/OffscreenPrintable.java
index 78fdde3ee..a59662bd2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/OffscreenPrintable.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/OffscreenPrintable.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -50,7 +50,7 @@ import com.jogamp.opengl.util.TileRenderer;
/**
* {@link Printable} implementation using NIO {@link DirectDataBufferInt} {@link BufferedImage}
* for offscreen rendered printing.
- *
+ *
* @see OnscreenPrintable
* @see PrintableBase
*/
@@ -58,30 +58,30 @@ public class OffscreenPrintable extends PrintableBase implements Printable {
public final int imageType;
public final String pngFilename;
-
+
/**
- *
+ *
* @param job
* @param printContainer
* @param printDPI
* @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
* @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
* @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
- * @param imageType AWT BufferedImage type (must be one of the integer types)
+ * @param imageType AWT BufferedImage type (must be one of the integer types)
* @param pngFilename TODO
*/
- public OffscreenPrintable(PrinterJob job, Container printContainer, int printDPI, int numSamples, int tileWidth, int tileHeight, int imageType, String pngFilename) {
+ public OffscreenPrintable(final PrinterJob job, final Container printContainer, final int printDPI, final int numSamples, final int tileWidth, final int tileHeight, final int imageType, final String pngFilename) {
super(job, printContainer, printDPI, numSamples, tileWidth, tileHeight);
this.imageType = imageType;
this.pngFilename = pngFilename;
}
-
+
@Override
- public int print(Graphics g, PageFormat pf, int page) throws PrinterException {
+ public int print(final Graphics g, final PageFormat pf, final int page) throws PrinterException {
if (page > 0) { // We have only one page, and 'page' is zero-based
return NO_SUCH_PAGE;
}
-
+
lockPrinting.lock();
try {
final Paper paper = pf.getPaper();
@@ -93,58 +93,58 @@ public class OffscreenPrintable extends PrintableBase implements Printable {
final double paperWHeightMM = paperWHeightInch * MM_PER_INCH;
final double paperIWidthMM = paperIWidthInch * MM_PER_INCH;
final double paperIHeightMM = paperIHeightInch * MM_PER_INCH;
-
- final double pfWWidthInch = pf.getWidth() / 72.0;
+
+ final double pfWWidthInch = pf.getWidth() / 72.0;
final double pfWHeightInch = pf.getHeight() / 72.0;
- final double pfIWidthInch = pf.getImageableWidth() / 72.0;
+ final double pfIWidthInch = pf.getImageableWidth() / 72.0;
final double pfIHeightInch = pf.getImageableHeight() / 72.0;
- final double pfWWidthMM = pfWWidthInch * MM_PER_INCH;
+ final double pfWWidthMM = pfWWidthInch * MM_PER_INCH;
final double pfWHeightMM = pfWHeightInch * MM_PER_INCH;
- final double pfIWidthMM = pfIWidthInch * MM_PER_INCH;
+ final double pfIWidthMM = pfIWidthInch * MM_PER_INCH;
final double pfIHeightMM = pfIHeightInch * MM_PER_INCH;
-
+
System.err.println("PF: Paper whole size "+
Math.round(paperWWidthMM)+" x "+Math.round(paperWHeightMM)+" mm, "+
Math.round(paperWWidthInch)+" x "+Math.round(paperWHeightInch)+" inch");
-
+
System.err.println("PF: Paper image size "+paper.getImageableX()+" / "+paper.getImageableY()+" "+
Math.round(paperIWidthMM)+" x "+Math.round(paperIHeightMM)+" mm, "+
Math.round(paperIWidthInch)+" x "+Math.round(paperIHeightInch)+" inch, "+
Math.round(paper.getImageableWidth())+"x"+Math.round(paper.getImageableHeight())+" 72dpi dots");
-
+
System.err.println("PF: Page whole size "+
Math.round(pfWWidthMM)+" x "+Math.round(pfWHeightMM)+" mm, "+
Math.round(pfWWidthInch)+" x "+Math.round(pfWHeightInch)+" inch");
-
+
System.err.println("PF: Page image size "+pf.getImageableX()+" / "+pf.getImageableY()+" "+
Math.round(pfIWidthMM)+" x "+Math.round(pfIHeightMM)+" mm, "+
Math.round(pfIWidthInch)+" x "+Math.round(pfIHeightInch)+" inch, "+
Math.round(pf.getImageableWidth())+"x"+Math.round(pf.getImageableHeight())+" 72dpi dots");
-
+
System.err.println("PF: Page orientation "+pf.getOrientation());
-
+
/**
* See: 'Scaling of Frame and GL content' in Class description!
* Note: Frame size contains the frame border (i.e. insets)!
- */
+ */
final Insets frameInsets = cont.getInsets();
final int frameWidth = cont.getWidth();
final int frameHeight= cont.getHeight();
final double scaleGraphics = dpi / 72.0;
- final int frameSWidth = (int) ( frameWidth * scaleGraphics );
+ final int frameSWidth = (int) ( frameWidth * scaleGraphics );
final int frameSHeight = (int) ( frameHeight * scaleGraphics );
final double scaleComp72;
{
- final double sx = pf.getImageableWidth() / (double)frameSWidth;
- final double sy = pf.getImageableHeight() / (double)frameSHeight;
+ final double sx = pf.getImageableWidth() / frameSWidth;
+ final double sy = pf.getImageableHeight() / frameSHeight;
scaleComp72 = Math.min(sx, sy);
}
-
+
System.err.println("PRINT.offscrn thread "+Thread.currentThread().getName());
System.err.println("PRINT.offscrn DPI: scaleGraphics "+scaleGraphics+", scaleComp72 "+scaleComp72);
System.err.println("PRINT.offscrn DPI: frame: border "+frameInsets+", size "+frameWidth+"x"+frameHeight+
" -> scaled "+frameSWidth+ "x" + frameSHeight);
-
+
final BufferedImage image = DirectDataBufferInt.createBufferedImage(frameSWidth, frameSHeight, imageType, null /* location */, null /* properties */);
{
System.err.println("PRINT.offscrn image "+image);
@@ -163,16 +163,16 @@ public class OffscreenPrintable extends PrintableBase implements Printable {
final File fout = new File(pngFilename);
try {
ImageIO.write(image, "png", fout);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
}
-
+
final Graphics2D g2d = (Graphics2D)g;
g2d.translate(pf.getImageableX(), pf.getImageableY());
g2d.scale(scaleComp72, scaleComp72);
g2d.drawImage(image, 0, 0, image.getWidth(), image.getHeight(), null); // Null ImageObserver since image data is ready.
-
+
/* tell the caller that this page is part of the printed document */
return PAGE_EXISTS;
} finally {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/OnscreenPrintable.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/OnscreenPrintable.java
index 6f73ef2b4..228fa81e2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/OnscreenPrintable.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/OnscreenPrintable.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -62,25 +62,25 @@ import com.jogamp.opengl.util.TileRenderer;
public class OnscreenPrintable extends PrintableBase implements Printable {
/**
- *
+ *
* @param job
* @param printContainer
* @param printDPI
- * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
+ * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
* @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
* @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
*/
- public OnscreenPrintable(PrinterJob job, Container printContainer, int printDPI, int numSamples, int tileWidth, int tileHeight) {
+ public OnscreenPrintable(final PrinterJob job, final Container printContainer, final int printDPI, final int numSamples, final int tileWidth, final int tileHeight) {
super(job, printContainer, printDPI, numSamples, tileWidth, tileHeight);
}
-
-
+
+
@Override
- public int print(Graphics g, PageFormat pf, int page) throws PrinterException {
+ public int print(final Graphics g, final PageFormat pf, final int page) throws PrinterException {
if (page > 0) { // We have only one page, and 'page' is zero-based
return NO_SUCH_PAGE;
}
-
+
lockPrinting.lock();
try {
final Paper paper = pf.getPaper();
@@ -92,70 +92,70 @@ public class OnscreenPrintable extends PrintableBase implements Printable {
final double paperWHeightMM = paperWHeightInch * MM_PER_INCH;
final double paperIWidthMM = paperIWidthInch * MM_PER_INCH;
final double paperIHeightMM = paperIHeightInch * MM_PER_INCH;
-
- final double pfWWidthInch = pf.getWidth() / 72.0;
+
+ final double pfWWidthInch = pf.getWidth() / 72.0;
final double pfWHeightInch = pf.getHeight() / 72.0;
- final double pfIWidthInch = pf.getImageableWidth() / 72.0;
+ final double pfIWidthInch = pf.getImageableWidth() / 72.0;
final double pfIHeightInch = pf.getImageableHeight() / 72.0;
- final double pfWWidthMM = pfWWidthInch * MM_PER_INCH;
+ final double pfWWidthMM = pfWWidthInch * MM_PER_INCH;
final double pfWHeightMM = pfWHeightInch * MM_PER_INCH;
- final double pfIWidthMM = pfIWidthInch * MM_PER_INCH;
+ final double pfIWidthMM = pfIWidthInch * MM_PER_INCH;
final double pfIHeightMM = pfIHeightInch * MM_PER_INCH;
-
+
System.err.println("PF: Paper whole size "+
Math.round(paperWWidthMM)+" x "+Math.round(paperWHeightMM)+" mm, "+
Math.round(paperWWidthInch)+" x "+Math.round(paperWHeightInch)+" inch");
-
+
System.err.println("PF: Paper image size "+paper.getImageableX()+" / "+paper.getImageableY()+" "+
Math.round(paperIWidthMM)+" x "+Math.round(paperIHeightMM)+" mm, "+
Math.round(paperIWidthInch)+" x "+Math.round(paperIHeightInch)+" inch, "+
Math.round(paper.getImageableWidth())+"x"+Math.round(paper.getImageableHeight())+" 72dpi dots");
-
+
System.err.println("PF: Page whole size "+
Math.round(pfWWidthMM)+" x "+Math.round(pfWHeightMM)+" mm, "+
Math.round(pfWWidthInch)+" x "+Math.round(pfWHeightInch)+" inch");
-
+
System.err.println("PF: Page image size "+pf.getImageableX()+" / "+pf.getImageableY()+" "+
Math.round(pfIWidthMM)+" x "+Math.round(pfIHeightMM)+" mm, "+
Math.round(pfIWidthInch)+" x "+Math.round(pfIHeightInch)+" inch, "+
Math.round(pf.getImageableWidth())+"x"+Math.round(pf.getImageableHeight())+" 72dpi dots");
-
+
System.err.println("PF: Page orientation "+pf.getOrientation());
-
+
/**
* See: 'Scaling of Frame and GL content' in Class description!
* Note: Frame size contains the frame border (i.e. insets)!
- */
+ */
final Insets frameInsets = cont.getInsets();
final int frameWidth = cont.getWidth();
final int frameHeight= cont.getHeight();
final double scaleGraphics = dpi / 72.0;
- final int frameSWidth = (int) ( frameWidth * scaleGraphics );
+ final int frameSWidth = (int) ( frameWidth * scaleGraphics );
final int frameSHeight = (int) ( frameHeight * scaleGraphics );
final double scaleComp72;
{
- final double sx = pf.getImageableWidth() / (double)frameWidth;
- final double sy = pf.getImageableHeight() / (double)frameHeight;
+ final double sx = pf.getImageableWidth() / frameWidth;
+ final double sy = pf.getImageableHeight() / frameHeight;
scaleComp72 = Math.min(sx, sy);
- }
+ }
System.err.println("PRINT.onscrn thread "+Thread.currentThread().getName());
System.err.println("PRINT.onscrn DPI: scaleGraphics "+scaleGraphics+", scaleComp72 "+scaleComp72);
System.err.println("PRINT.onscrn DPI: frame: border "+frameInsets+", size "+frameWidth+"x"+frameHeight+
" -> scaled "+frameSWidth+ "x" + frameSHeight);
-
+
final Graphics2D g2d = (Graphics2D)g;
System.err.println("PRINT at.pre: "+g2d.getTransform());
g2d.translate(pf.getImageableX(), pf.getImageableY());
g2d.scale(scaleComp72, scaleComp72); // WARNING: Produces rounding artifacts due to diff scale-factor of AWT/GL comps !!!
// g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
-
+
AWTEDTExecutor.singleton.invoke(true, new Runnable() {
public void run() {
cont.printAll(g2d);
}
});
-
+
/* tell the caller that this page is part of the printed document */
return PAGE_EXISTS;
} finally {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/PrintableBase.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/PrintableBase.java
index dd9de60c3..39cc4fbd2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/PrintableBase.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/PrintableBase.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -37,7 +37,7 @@ import com.jogamp.opengl.util.TileRenderer;
/**
* Base {@link Printable} implementation class.
- *
+ *
* <h5>Virtual printer driver</h5>
* <p>
* Note, on OSX you might need to setup a dummy printer, i.e. <i>print to file</i>.<br>
@@ -54,7 +54,7 @@ import com.jogamp.opengl.util.TileRenderer;
public abstract class PrintableBase implements Printable {
public static final double MM_PER_INCH = 25.4;
-
+
public final PrinterJob job;
public final Container cont;
public final int dpi;
@@ -63,15 +63,15 @@ public abstract class PrintableBase implements Printable {
protected final RecursiveLock lockPrinting = LockFactory.createRecursiveLock();
/**
- *
+ *
* @param job
* @param printContainer
* @param printDPI
- * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
+ * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
* @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
* @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
*/
- public PrintableBase(PrinterJob job, Container printContainer, int printDPI, int numSamples, int tileWidth, int tileHeight) {
+ public PrintableBase(final PrinterJob job, final Container printContainer, final int printDPI, final int numSamples, final int tileWidth, final int tileHeight) {
this.job = job;
this.cont = printContainer;
this.dpi = printDPI;
@@ -79,10 +79,10 @@ public abstract class PrintableBase implements Printable {
this.tileWidth = tileWidth;
this.tileHeight = tileHeight;
}
-
+
/** Wait for idle .. simply acquiring all locks and releasing them. */
public void waitUntilIdle() {
lockPrinting.lock();
lockPrinting.unlock();
- }
+ }
} \ No newline at end of file
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering2GL2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering2GL2NEWT.java
index 9783b9205..546420057 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering2GL2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering2GL2NEWT.java
@@ -83,7 +83,7 @@ public class TestRandomTiledRendering2GL2NEWT extends UITestCase {
doTest(8);
}
- void doTest(int msaaCount) throws IOException, InterruptedException, InvocationTargetException {
+ void doTest(final int msaaCount) throws IOException, InterruptedException, InvocationTargetException {
final GLCapabilities caps = new GLCapabilities(null);
caps.setDoubleBuffered(true);
if( msaaCount > 0 ) {
@@ -115,10 +115,10 @@ public class TestRandomTiledRendering2GL2NEWT extends UITestCase {
final GLEventListener preTileGLEL = new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
final GL gl = drawable.getGL();
- GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
- GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
+ final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
+ final GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
renderer.setImageBuffer(pixelBuffer);
if( drawable.isGLOriented() ) {
flipVertically[0] = false;
@@ -127,11 +127,11 @@ public class TestRandomTiledRendering2GL2NEWT extends UITestCase {
}
}
@Override
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
};
renderer.setGLEventListener(preTileGLEL, null);
@@ -152,7 +152,7 @@ public class TestRandomTiledRendering2GL2NEWT extends UITestCase {
// .. even though we close the demo, this is for documentation!
glad.invoke(true, new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
drawable.getGL().glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
gears.reshape(drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
return false;
@@ -179,13 +179,13 @@ public class TestRandomTiledRendering2GL2NEWT extends UITestCase {
TextureIO.write(textureData, file);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestRandomTiledRendering2GL2NEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering3GL2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering3GL2AWT.java
index 74ef0713a..b128f8691 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering3GL2AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering3GL2AWT.java
@@ -92,7 +92,7 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
doTest(8);
}
- void doTest(int msaaCount) throws IOException, InterruptedException, InvocationTargetException {
+ void doTest(final int msaaCount) throws IOException, InterruptedException, InvocationTargetException {
final GLCapabilities caps = new GLCapabilities(null);
if( msaaCount > 0 ) {
caps.setSampleBuffers(true);
@@ -104,7 +104,7 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
final GLCanvas glad = new GLCanvas(caps);
Assert.assertNotNull(glad);
- Dimension glc_sz = new Dimension(width, height);
+ final Dimension glc_sz = new Dimension(width, height);
glad.setMinimumSize(glc_sz);
glad.setPreferredSize(glc_sz);
glad.setSize(glc_sz);
@@ -134,10 +134,10 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
int dx = 0, dy = 0;
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
final GL gl = drawable.getGL();
- GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
- GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
+ final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
+ final GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
renderer.setImageBuffer(pixelBuffer);
if( drawable.isGLOriented() ) {
flipVertically[0] = false;
@@ -147,9 +147,9 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
System.err.println("XXX pre-init: "+renderer);
}
@Override
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
if( dx+w <= imageWidth && dy+h <= imageHeight ) {
renderer.setTileRect(dx, dy, w, h);
dx+=w+w/2;
@@ -163,15 +163,15 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
System.err.println("XXX pre-display: "+renderer);
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
};
final GLEventListener postTileGLEL = new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {}
+ public void init(final GLAutoDrawable drawable) {}
@Override
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
if( !rendererActive[0] ) {
final GLPixelBuffer imageBuffer = renderer.getImageBuffer();
imageBuffer.clear(); // full size available
@@ -191,7 +191,7 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
final String filename = getSnapshotFilename(0, "-tile", glad.getChosenGLCapabilities(), imageWidth, imageHeight, false, TextureIO.PNG, null);
final File file = new File(filename);
TextureIO.write(textureData, file);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
renderer.detachAutoDrawable();
@@ -201,7 +201,7 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
}
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
};
renderer.setGLEventListener(preTileGLEL, postTileGLEL);
@@ -247,13 +247,13 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
}});
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestRandomTiledRendering3GL2AWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsAWT.java
index dd8a306cc..87f1f3e7d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsAWT.java
@@ -91,7 +91,7 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps) throws InterruptedException, InvocationTargetException {
+ protected void runTestGL(final GLCapabilities caps) throws InterruptedException, InvocationTargetException {
final Dimension glc_sz = new Dimension(width/2, height);
final GLCanvas glCanvas1 = new GLCanvas(caps);
Assert.assertNotNull(glCanvas1);
@@ -115,15 +115,15 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase {
Assert.assertNotNull(frame);
final ActionListener print72DPIAction = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doPrintManual(frame, 72, 0, -1, -1);
} };
final ActionListener print300DPIAction = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doPrintManual(frame, 300, -1, -1, -1);
} };
final ActionListener print600DPIAction = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doPrintManual(frame, 600, -1, -1, -1);
} };
final Button print72DPIButton = new Button("72dpi");
@@ -134,15 +134,15 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase {
print600DPIButton.addActionListener(print600DPIAction);
frame.setLayout(new BorderLayout());
- Panel printPanel = new Panel();
+ final Panel printPanel = new Panel();
printPanel.add(print72DPIButton);
printPanel.add(print300DPIButton);
printPanel.add(print600DPIButton);
- Panel southPanel = new Panel();
+ final Panel southPanel = new Panel();
southPanel.add(new Label("South"));
- Panel eastPanel = new Panel();
+ final Panel eastPanel = new Panel();
eastPanel.add(new Label("East"));
- Panel westPanel = new Panel();
+ final Panel westPanel = new Panel();
westPanel.add(new Label("West"));
frame.add(printPanel, BorderLayout.NORTH);
frame.add(demoPanel, BorderLayout.CENTER);
@@ -151,7 +151,7 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase {
frame.add(westPanel, BorderLayout.WEST);
frame.setTitle("Tiles AWT Print Test");
- Animator animator = new Animator();
+ final Animator animator = new Animator();
animator.add(glCanvas1);
animator.add(glCanvas2);
@@ -240,13 +240,13 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase {
@Test
public void test01_aa0() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps);
}
@Test
public void test02_aa8() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setSampleBuffers(true);
caps.setNumSamples(8);
runTestGL(caps);
@@ -254,13 +254,13 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase {
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-600dpi")) {
allow600dpi = true;
} else if(args[i].equals("-wait")) {
@@ -268,11 +268,11 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase {
}
}
if(waitForKey) {
- BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
try {
System.err.println(stdin.readLine());
- } catch (IOException e) { }
+ } catch (final IOException e) { }
}
org.junit.runner.JUnitCore.main(TestTiledPrintingGearsAWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsNewtAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsNewtAWT.java
index d3abcd01a..274b1eef3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsNewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsNewtAWT.java
@@ -92,7 +92,7 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps) throws InterruptedException, InvocationTargetException {
+ protected void runTestGL(final GLCapabilities caps) throws InterruptedException, InvocationTargetException {
final Dimension glc_sz = new Dimension(width/2, height);
final GLWindow glad1 = GLWindow.create(caps);
Assert.assertNotNull(glad1);
@@ -120,15 +120,15 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase {
Assert.assertNotNull(frame);
final ActionListener print72DPIAction = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doPrintManual(frame, 72, 0, -1, -1);
} };
final ActionListener print300DPIAction = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doPrintManual(frame, 300, -1, -1, -1);
} };
final ActionListener print600DPIAction = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doPrintManual(frame, 600, -1, -1, -1);
} };
final Button print72DPIButton = new Button("72dpi");
@@ -139,15 +139,15 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase {
print600DPIButton.addActionListener(print600DPIAction);
frame.setLayout(new BorderLayout());
- Panel printPanel = new Panel();
+ final Panel printPanel = new Panel();
printPanel.add(print72DPIButton);
printPanel.add(print300DPIButton);
printPanel.add(print600DPIButton);
- Panel southPanel = new Panel();
+ final Panel southPanel = new Panel();
southPanel.add(new Label("South"));
- Panel eastPanel = new Panel();
+ final Panel eastPanel = new Panel();
eastPanel.add(new Label("East"));
- Panel westPanel = new Panel();
+ final Panel westPanel = new Panel();
westPanel.add(new Label("West"));
frame.add(printPanel, BorderLayout.NORTH);
frame.add(demoPanel, BorderLayout.CENTER);
@@ -156,7 +156,7 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase {
frame.add(westPanel, BorderLayout.WEST);
frame.setTitle("Tiles Newt/AWT Print Test");
- Animator animator = new Animator();
+ final Animator animator = new Animator();
animator.add(glad1);
animator.add(glad2);
@@ -247,13 +247,13 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase {
@Test
public void test01_aa0() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps);
}
@Test
public void test02_aa8() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setSampleBuffers(true);
caps.setNumSamples(8);
runTestGL(caps);
@@ -261,13 +261,13 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase {
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-600dpi")) {
allow600dpi = true;
} else if(args[i].equals("-wait")) {
@@ -275,11 +275,11 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase {
}
}
if(waitForKey) {
- BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
try {
System.err.println(stdin.readLine());
- } catch (IOException e) { }
+ } catch (final IOException e) { }
}
org.junit.runner.JUnitCore.main(TestTiledPrintingGearsNewtAWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
index 34e1b60e9..7c8d65c19 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
@@ -100,7 +100,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps, boolean layered, boolean skipGLOrientationVerticalFlip) throws InterruptedException, InvocationTargetException {
+ protected void runTestGL(final GLCapabilities caps, final boolean layered, final boolean skipGLOrientationVerticalFlip) throws InterruptedException, InvocationTargetException {
final int layerStepX = width/6, layerStepY = height/6;
final Dimension glc_sz = new Dimension(layered ? width - 2*layerStepX : width/2, layered ? height - 2*layerStepY : height);
final GLJPanel glJPanel1 = new GLJPanel(caps);
@@ -160,15 +160,15 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
Assert.assertNotNull(frame);
final ActionListener print72DPIAction = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doPrintManual(frame, 72, 0, -1, -1);
} };
final ActionListener print300DPIAction = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doPrintManual(frame, 300, -1, -1, -1);
} };
final ActionListener print600DPIAction = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doPrintManual(frame, 600, -1, -1, -1);
} };
final Button print72DPIButton = new Button("72dpi");
@@ -189,7 +189,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
final JPanel westPanel = new JPanel();
westPanel.add(new Label("West"));
- Animator animator = new Animator();
+ final Animator animator = new Animator();
animator.add(glJPanel1);
animator.add(glJPanel2);
final QuitAdapter quitAdapter = new QuitAdapter();
@@ -302,13 +302,13 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
@Test
public void test01_flip1_aa0() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, false, false);
}
@Test
public void test01_flip1_aa0_layered() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(8);
runTestGL(caps, true, false);
}
@@ -316,7 +316,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
@Test
public void test01_flip1_aa0_bitmap() throws InterruptedException, InvocationTargetException {
if( Platform.OSType.WINDOWS == Platform.getOSType() ) {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBitmap(true);
runTestGL(caps, false, false);
} // issues w/ AMD catalyst driver and pixmap surface ..
@@ -325,7 +325,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
@Test
public void test01_flip1_aa0_bitmap_layered() throws InterruptedException, InvocationTargetException {
if( Platform.OSType.WINDOWS == Platform.getOSType() ) {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBitmap(true);
caps.setAlphaBits(8);
runTestGL(caps, true, false);
@@ -334,7 +334,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
@Test
public void test02_flip1_aa8() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setSampleBuffers(true);
caps.setNumSamples(8);
runTestGL(caps, false, false);
@@ -342,13 +342,13 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
@Test
public void test11_flip0_aa0() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, false, true);
}
@Test
public void test11_flip0_aa0_layered() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(8);
runTestGL(caps, true, true);
}
@@ -356,7 +356,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
@Test
public void test11_flip0_aa0_bitmap() throws InterruptedException, InvocationTargetException {
if( Platform.OSType.WINDOWS == Platform.getOSType() ) {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBitmap(true);
runTestGL(caps, false, true);
} // issues w/ AMD catalyst driver and pixmap surface ..
@@ -365,7 +365,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
@Test
public void test11_flip0_aa0_bitmap_layered() throws InterruptedException, InvocationTargetException {
if( Platform.OSType.WINDOWS == Platform.getOSType() ) {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBitmap(true);
caps.setAlphaBits(8);
runTestGL(caps, true, true);
@@ -374,7 +374,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
@Test
public void test12_flip0_aa8() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setSampleBuffers(true);
caps.setNumSamples(8);
runTestGL(caps, false, true);
@@ -382,7 +382,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
@@ -400,11 +400,11 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase {
}
}
if(waitForKey) {
- BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
try {
System.err.println(stdin.readLine());
- } catch (IOException e) { }
+ } catch (final IOException e) { }
}
org.junit.runner.JUnitCore.main(TestTiledPrintingGearsSwingAWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT2.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT2.java
index 8cf1421ae..060b85a34 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT2.java
@@ -96,7 +96,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase {
public static void releaseClass() {
}
- protected void runTestGL(GLCapabilities caps, final boolean addLayout, boolean layered, boolean skipGLOrientationVerticalFlip, boolean useAnim) throws InterruptedException, InvocationTargetException {
+ protected void runTestGL(final GLCapabilities caps, final boolean addLayout, final boolean layered, final boolean skipGLOrientationVerticalFlip, final boolean useAnim) throws InterruptedException, InvocationTargetException {
final Dimension glc_sz = new Dimension(width, height);
final GLJPanel glJPanel1 = new GLJPanel(caps);
Assert.assertNotNull(glJPanel1);
@@ -146,15 +146,15 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase {
Assert.assertNotNull(frame);
final ActionListener print72DPIAction = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doPrintManual(frame, 72, 0, -1, -1);
} };
final ActionListener print150DPIAction = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doPrintManual(frame, 150, -1, -1, -1);
} };
final ActionListener print300DPIAction = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doPrintManual(frame, 300, -1, -1, -1);
} };
final Button print72DPIButton = new Button("72dpi");
@@ -253,25 +253,25 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase {
@Test
public void test001_flip1_norm_layout0_layered0() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, false /* addLayout */, false /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@Test
public void test002_flip1_norm_layout1_layered0() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, true /* addLayout */, false /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@Test
public void test003_flip1_norm_layout0_layered1() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, false /* addLayout */, true /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@Test
public void test004_flip1_norm_layout1_layered1() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, true /* addLayout */, true /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@@ -280,7 +280,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase {
if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
return;
}
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBitmap(true);
runTestGL(caps, false /* addLayout */, false /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@@ -290,7 +290,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase {
if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
return;
}
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBitmap(true);
runTestGL(caps, true /* addLayout */, false /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@@ -300,7 +300,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase {
if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
return;
}
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBitmap(true);
runTestGL(caps, false /* addLayout */, true /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@@ -310,32 +310,32 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase {
if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
return;
}
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBitmap(true);
runTestGL(caps, true /* addLayout */, true /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@Test
public void test101_flip1_norm_layout0_layered0() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, false /* addLayout */, false /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@Test
public void test102_flip1_norm_layout1_layered0() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, true /* addLayout */, false /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@Test
public void test103_flip1_norm_layout0_layered1() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, false /* addLayout */, true /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@Test
public void test104_flip1_norm_layout1_layered1() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, true /* addLayout */, true /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@@ -344,7 +344,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase {
if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
return;
}
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBitmap(true);
runTestGL(caps, false /* addLayout */, false /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@@ -354,7 +354,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase {
if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
return;
}
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBitmap(true);
runTestGL(caps, true /* addLayout */, false /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@@ -364,7 +364,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase {
if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
return;
}
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBitmap(true);
runTestGL(caps, false /* addLayout */, true /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
@@ -374,14 +374,14 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase {
if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
return;
}
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setBitmap(true);
runTestGL(caps, true /* addLayout */, true /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
}
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
@@ -397,11 +397,11 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase {
}
}
if(waitForKey) {
- BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
try {
System.err.println(stdin.readLine());
- } catch (IOException e) { }
+ } catch (final IOException e) { }
}
org.junit.runner.JUnitCore.main(TestTiledPrintingGearsSwingAWT2.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingNIOImageSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingNIOImageSwingAWT.java
index b51bfae87..85edcda6c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingNIOImageSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingNIOImageSwingAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.tile;
import java.awt.BorderLayout;
@@ -80,7 +80,7 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase {
static boolean allow600dpi = false;
static GLProfile glp;
static int width, height;
-
+
@BeforeClass
public static void initClass() {
if(GLProfile.isAvailable(GLProfile.GL2)) {
@@ -98,7 +98,7 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase {
@AfterClass
public static void releaseClass() {
}
-
+
protected void printOffscreenToFile(final BufferedImage image, final Frame frame, final GLCapabilities caps, final int num, final String detail) {
final Insets frameInsets = frame.getInsets();
final int frameWidth = frame.getWidth();
@@ -108,17 +108,17 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase {
final double scaleComp72;
// Note: Frame size contains the frame border (i.e. insets)!
{
- final double sx = (double)imageWidth / frameWidth;
+ final double sx = (double)imageWidth / frameWidth;
final double sy = (double)imageHeight / frameHeight;
scaleComp72 = Math.min(sx, sy);
}
System.err.println("PRINT DPI: scaleComp72 "+scaleComp72+", image-size "+imageWidth+"x"+imageHeight+", frame[border "+frameInsets+", size "+frameWidth+"x"+frameHeight+"]");
-
+
System.err.println("XXX: image "+image);
System.err.println("XXX: cm "+image.getColorModel());
System.err.println("XXX: raster "+image.getRaster());
System.err.println("XXX: dataBuffer "+image.getRaster().getDataBuffer());
-
+
AWTEDTExecutor.singleton.invoke(true, new Runnable() {
public void run() {
final Graphics2D g2d = (Graphics2D) image.getGraphics();
@@ -126,7 +126,7 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase {
g2d.scale(scaleComp72, scaleComp72);
// g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
-
+
// frame.paintAll(g2d);
final AWTPrintLifecycle.Context ctx = AWTPrintLifecycle.Context.setupPrint(frame, 1.0/scaleComp72, 1.0/scaleComp72, 0, -1, -1);
try {
@@ -137,20 +137,20 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase {
// to file
final String fname = getSnapshotFilename(num, detail, caps, image.getWidth(), image.getHeight(), false, TextureIO.PNG, null);
System.err.println("XXX file "+fname);
- final File fout = new File(fname);
+ final File fout = new File(fname);
try {
ImageIO.write(image, "png", fout);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
} });
}
-
+
protected void runTestGL(final GLCapabilities caps, final boolean layered) throws InterruptedException, InvocationTargetException {
final int layerStepX = width/6, layerStepY = height/6;
final Dimension glc_sz = new Dimension(layered ? width - 2*layerStepX : width/2, layered ? height - 2*layerStepY : height);
final GLJPanel glJPanel1 = new GLJPanel(caps);
- Assert.assertNotNull(glJPanel1);
+ Assert.assertNotNull(glJPanel1);
glJPanel1.setMinimumSize(glc_sz);
glJPanel1.setPreferredSize(glc_sz);
if( layered ) {
@@ -159,9 +159,9 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase {
glJPanel1.setBounds(0, 0, glc_sz.width, glc_sz.height);
}
glJPanel1.addGLEventListener(new Gears());
-
+
final GLJPanel glJPanel2 = new GLJPanel(caps);
- Assert.assertNotNull(glJPanel2);
+ Assert.assertNotNull(glJPanel2);
glJPanel2.setMinimumSize(glc_sz);
glJPanel2.setPreferredSize(glc_sz);
if( layered ) {
@@ -171,7 +171,7 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase {
}
glJPanel2.addGLEventListener(new RedSquareES2());
// glJPanel2.addGLEventListener(new Gears());
-
+
final JComponent demoPanel;
if( layered ) {
glJPanel1.setOpaque(true);
@@ -192,14 +192,14 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase {
demoPanel.add(glJPanel1);
demoPanel.add(glJPanel2);
}
-
+
final JFrame frame = new JFrame("Swing Print");
Assert.assertNotNull(frame);
-
+
final Button print72DPIButton = new Button("72dpi"); // dummy
final Button print300DPIButton = new Button("300dpi"); // dummy
final Button print600DPIButton = new Button("600dpi"); // dummy
-
+
final JPanel printPanel = new JPanel();
printPanel.add(print72DPIButton);
printPanel.add(print300DPIButton);
@@ -210,7 +210,7 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase {
eastPanel.add(new Label("East"));
final JPanel westPanel = new JPanel();
westPanel.add(new Label("West"));
-
+
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
final Container fcont = frame.getContentPane();
@@ -224,11 +224,11 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase {
frame.pack();
frame.setVisible(true);
} } ) ;
-
+
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true));
Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glJPanel1, true));
Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glJPanel2, true));
-
+
// paint offscreen: array 72dpi ARGB
{
final BufferedImage image = new BufferedImage(frame.getWidth(), frame.getHeight(), BufferedImage.TYPE_INT_ARGB);
@@ -241,29 +241,29 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase {
}
// paint offscreen: NIO 150dpi ARGB
{
- final int scale = (int) ( 150.0 / 72.0 + 0.5 );
+ final int scale = (int) ( 150.0 / 72.0 + 0.5 );
final BufferedImage image = DirectDataBufferInt.createBufferedImage(frame.getWidth()*scale, frame.getHeight()*scale, BufferedImage.TYPE_INT_ARGB, null /* location */, null /* properties */);
printOffscreenToFile(image, frame, caps, 2, "newio_150dpi_argb");
}
// paint offscreen: NIO 150dpi ARGB_PRE
{
- final int scale = (int) ( 150.0 / 72.0 + 0.5 );
+ final int scale = (int) ( 150.0 / 72.0 + 0.5 );
final BufferedImage image = DirectDataBufferInt.createBufferedImage(frame.getWidth()*scale, frame.getHeight()*scale, BufferedImage.TYPE_INT_ARGB_PRE, null /* location */, null /* properties */);
printOffscreenToFile(image, frame, caps, 2, "newio_150dpi_argbp");
}
// paint offscreen: NIO 150dpi RGB
{
- final int scale = (int) ( 150.0 / 72.0 + 0.5 );
+ final int scale = (int) ( 150.0 / 72.0 + 0.5 );
final BufferedImage image = DirectDataBufferInt.createBufferedImage(frame.getWidth()*scale, frame.getHeight()*scale, BufferedImage.TYPE_INT_RGB, null /* location */, null /* properties */);
printOffscreenToFile(image, frame, caps, 2, "newio_150dpi_rgb");
}
// paint offscreen: NIO 150dpi BGR
{
- final int scale = (int) ( 150.0 / 72.0 + 0.5 );
+ final int scale = (int) ( 150.0 / 72.0 + 0.5 );
final BufferedImage image = DirectDataBufferInt.createBufferedImage(frame.getWidth()*scale, frame.getHeight()*scale, BufferedImage.TYPE_INT_BGR, null /* location */, null /* properties */);
printOffscreenToFile(image, frame, caps, 2, "newio_150dpi_bgr");
}
-
+
Assert.assertNotNull(frame);
Assert.assertNotNull(glJPanel1);
Assert.assertNotNull(glJPanel2);
@@ -283,25 +283,25 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase {
@Test
public void test01_Offscreen_aa0() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, false);
}
-
+
@Test
public void test01_Offscreen_aa0_layered() throws InterruptedException, InvocationTargetException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
runTestGL(caps, true);
}
-
+
static long duration = 500; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(args[i].equals("-600dpi")) {
allow600dpi = true;
} else if(args[i].equals("-wait")) {
@@ -309,11 +309,11 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase {
}
}
if(waitForKey) {
- BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
try {
System.err.println(stdin.readLine());
- } catch (IOException e) { }
+ } catch (final IOException e) { }
}
org.junit.runner.JUnitCore.main(TestTiledPrintingNIOImageSwingAWT.class.getName());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering1GL2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering1GL2NEWT.java
index 59bc27c07..9dee67e5e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering1GL2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering1GL2NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -57,9 +57,9 @@ import org.junit.runners.MethodSorters;
* Demos offscreen {@link GLDrawable} being used for
* {@link TileRenderer} rendering to produce a PNG file.
* <p>
- * All {@link TileRenderer} operations are
+ * All {@link TileRenderer} operations are
* being performed from the main thread sequentially
- * without {@link GLAutoDrawable} or {@link GLEventListener}.
+ * without {@link GLAutoDrawable} or {@link GLEventListener}.
* </p>
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@@ -67,25 +67,25 @@ public class TestTiledRendering1GL2NEWT extends UITestCase {
static long duration = 500; // ms
static class DrawableContext {
- DrawableContext(GLDrawable d, GLContext glc) {
+ DrawableContext(final GLDrawable d, final GLContext glc) {
this.d = d;
this.glc = glc;
}
GLDrawable d;
GLContext glc;
}
-
- private static DrawableContext createDrawableAndCurrentCtx(GLCapabilities glCaps, int width, int height) {
- GLDrawableFactory factory = GLDrawableFactory.getFactory(glCaps.getGLProfile());
- GLDrawable d = factory.createOffscreenDrawable(null, glCaps, null, width, height);
+
+ private static DrawableContext createDrawableAndCurrentCtx(final GLCapabilities glCaps, final int width, final int height) {
+ final GLDrawableFactory factory = GLDrawableFactory.getFactory(glCaps.getGLProfile());
+ final GLDrawable d = factory.createOffscreenDrawable(null, glCaps, null, width, height);
d.setRealized(true);
GLContext glc = null;
glc = d.createContext(null);
Assert.assertTrue("Context could not be made current", GLContext.CONTEXT_NOT_CURRENT < glc.makeCurrent());
return new DrawableContext(d, glc);
}
-
- private static void destroyDrawableContext(DrawableContext dc) {
+
+ private static void destroyDrawableContext(final DrawableContext dc) {
if(null != dc.glc) {
dc.glc.destroy();
dc.glc = null;
@@ -95,43 +95,43 @@ public class TestTiledRendering1GL2NEWT extends UITestCase {
dc.d = null;
}
}
-
+
@Test
public void test01() throws IOException {
- GLProfile glp = GLProfile.getMaxFixedFunc(true);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getMaxFixedFunc(true);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setOnscreen(false);
-
+
final int maxTileSize = 256;
- DrawableContext dc = createDrawableAndCurrentCtx(caps, maxTileSize, maxTileSize);
+ final DrawableContext dc = createDrawableAndCurrentCtx(caps, maxTileSize, maxTileSize);
final GL2 gl = dc.glc.getGL().getGL2();
-
+
// Fix the image size for now
final int imageWidth = dc.d.getSurfaceWidth() * 6;
final int imageHeight = dc.d.getSurfaceHeight() * 4;
-
+
final String filename = this.getSnapshotFilename(0, "-tile", dc.d.getChosenGLCapabilities(), imageWidth, imageHeight, false, TextureIO.PNG, null);
final File file = new File(filename);
-
+
// Initialize the tile rendering library
- final TileRenderer renderer = new com.jogamp.opengl.util.TileRenderer();
+ final TileRenderer renderer = new com.jogamp.opengl.util.TileRenderer();
renderer.setTileSize(dc.d.getSurfaceWidth(), dc.d.getSurfaceHeight(), 0);
renderer.setImageSize(imageWidth, imageHeight);
-
+
final GLPixelBuffer.GLPixelBufferProvider pixelBufferProvider = GLPixelBuffer.defaultProviderWithRowStride;
final boolean[] flipVertically = { false };
-
- GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
- GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
+
+ final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
+ final GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
renderer.setImageBuffer(pixelBuffer);
flipVertically[0] = false;
-
+
final Gears gears = new Gears();
gears.setVerbose(false);
gears.init(gl);
gears.addTileRendererNotify(renderer);
- while( !renderer.eot() ) {
+ while( !renderer.eot() ) {
renderer.beginTile(gl);
gears.reshape(gl,
renderer.getParam(TileRendererBase.TR_CURRENT_TILE_X_POS), renderer.getParam(TileRendererBase.TR_CURRENT_TILE_Y_POS),
@@ -143,69 +143,69 @@ public class TestTiledRendering1GL2NEWT extends UITestCase {
gears.removeTileRendererNotify(renderer);
destroyDrawableContext(dc);
-
+
final GLPixelBuffer imageBuffer = renderer.getImageBuffer();
final TextureData textureData = new TextureData(
caps.getGLProfile(),
0 /* internalFormat */,
imageWidth, imageHeight,
- 0,
+ 0,
imageBuffer.pixelAttributes,
- false, false,
+ false, false,
flipVertically[0],
imageBuffer.buffer,
null /* Flusher */);
-
+
TextureIO.write(textureData, file);
}
-
+
@Test
public void test02_EOT_01() throws IOException {
- GLProfile glp = GLProfile.getMaxFixedFunc(true);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getMaxFixedFunc(true);
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setOnscreen(false);
-
+
final int maxTileSize = 256;
- DrawableContext dc = createDrawableAndCurrentCtx(caps, maxTileSize, maxTileSize);
+ final DrawableContext dc = createDrawableAndCurrentCtx(caps, maxTileSize, maxTileSize);
final GL2 gl = dc.glc.getGL().getGL2();
-
+
// Fix the image size for now
final int imageWidth = dc.d.getSurfaceWidth() * 6;
final int imageHeight = dc.d.getSurfaceHeight() * 4;
-
+
// Initialize the tile rendering library
final TileRenderer renderer = new com.jogamp.opengl.util.TileRenderer();
renderer.setTileSize(dc.d.getSurfaceWidth(), dc.d.getSurfaceHeight(), 0);
-
+
IllegalStateException ise = null;
try {
renderer.beginTile(gl); // Image size has not been set
- } catch (IllegalStateException _ise) {
+ } catch (final IllegalStateException _ise) {
ise = _ise;
System.err.println("Expected "+ise.getClass().getSimpleName()+": "+ise.getMessage());
}
Assert.assertNotNull("TileRenderer.beginTile: Image-size exception missing", ise);
-
+
renderer.setImageSize(imageWidth, imageHeight);
-
+
renderer.clipImageSize(0, 0);
try {
renderer.beginTile(gl); // EOT reached (1)
- } catch (IllegalStateException _ise) {
+ } catch (final IllegalStateException _ise) {
ise = _ise;
System.err.println("Expected "+ise.getClass().getSimpleName()+": "+ise.getMessage());
}
Assert.assertNotNull("TileRenderer.beginTile: EOT (1) exception missing", ise);
-
+
renderer.clipImageSize(imageWidth, imageHeight); // back to full size
-
+
final Gears gears = new Gears();
gears.setVerbose(false);
gears.init(gl);
gears.addTileRendererNotify(renderer);
int numTiles = 0;
- while( !renderer.eot() ) {
+ while( !renderer.eot() ) {
renderer.beginTile(gl);
gears.reshape(gl,
renderer.getParam(TileRendererBase.TR_CURRENT_TILE_X_POS), renderer.getParam(TileRendererBase.TR_CURRENT_TILE_Y_POS),
@@ -217,27 +217,27 @@ public class TestTiledRendering1GL2NEWT extends UITestCase {
}
try {
renderer.beginTile(gl); // EOT reached (2)
- } catch (IllegalStateException _ise) {
+ } catch (final IllegalStateException _ise) {
ise = _ise;
System.err.println("Expected "+ise.getClass().getSimpleName()+": "+ise.getMessage());
}
Assert.assertNotNull("TileRenderer.beginTile: EOT (2) exception missing", ise);
gears.removeTileRendererNotify(renderer);
-
+
Assert.assertTrue("TileRenderer not rendered more than one tile but "+numTiles, numTiles > 1);
destroyDrawableContext(dc);
}
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestTiledRendering1GL2NEWT.class.getName());
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java
index cf83d524d..e979ac966 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java
@@ -74,7 +74,7 @@ import org.junit.runners.MethodSorters;
public class TestTiledRendering2NEWT extends UITestCase {
static long duration = 500; // ms
- static GLProfile getGLProfile(String profile) {
+ static GLProfile getGLProfile(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
@@ -92,7 +92,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
@Test
public void test001_off_gl2___aa0() throws IOException {
- GLProfile glp = getGLProfile(GLProfile.GL2);
+ final GLProfile glp = getGLProfile(GLProfile.GL2);
if( null == glp ) {
return;
}
@@ -100,7 +100,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
}
@Test
public void test002_off_gl2___aa8() throws IOException {
- GLProfile glp = getGLProfile(GLProfile.GL2);
+ final GLProfile glp = getGLProfile(GLProfile.GL2);
if( null == glp ) {
return;
}
@@ -108,7 +108,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
}
@Test
public void test011_off_gl2es3_aa0() throws IOException {
- GLProfile glp = getGL2ES3();
+ final GLProfile glp = getGL2ES3();
if( null == glp ) {
return;
}
@@ -116,7 +116,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
}
@Test
public void test012_off_gl2es3_aa8() throws IOException {
- GLProfile glp = getGL2ES3();
+ final GLProfile glp = getGL2ES3();
if( null == glp ) {
return;
}
@@ -124,7 +124,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
}
@Test
public void test101_on__gl2___aa0() throws IOException {
- GLProfile glp = getGLProfile(GLProfile.GL2);
+ final GLProfile glp = getGLProfile(GLProfile.GL2);
if( null == glp ) {
return;
}
@@ -132,7 +132,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
}
@Test
public void test102_on__gl2___aa8() throws IOException {
- GLProfile glp = getGLProfile(GLProfile.GL2);
+ final GLProfile glp = getGLProfile(GLProfile.GL2);
if( null == glp ) {
return;
}
@@ -140,7 +140,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
}
@Test
public void test111_on__gl2es3_aa0() throws IOException {
- GLProfile glp = getGL2ES3();
+ final GLProfile glp = getGL2ES3();
if( null == glp ) {
return;
}
@@ -148,15 +148,15 @@ public class TestTiledRendering2NEWT extends UITestCase {
}
@Test
public void test112_on__gl2es3_aa8() throws IOException {
- GLProfile glp = getGL2ES3();
+ final GLProfile glp = getGL2ES3();
if( null == glp ) {
return;
}
doTest(true, new GearsES2(), glp, 8);
}
- void doTest(boolean onscreen, final GLEventListener demo, GLProfile glp, final int msaaCount) throws IOException {
- GLCapabilities caps = new GLCapabilities(glp);
+ void doTest(final boolean onscreen, final GLEventListener demo, final GLProfile glp, final int msaaCount) throws IOException {
+ final GLCapabilities caps = new GLCapabilities(glp);
caps.setDoubleBuffered(onscreen);
if( msaaCount > 0 ) {
caps.setSampleBuffers(true);
@@ -195,10 +195,10 @@ public class TestTiledRendering2NEWT extends UITestCase {
final GLEventListener preTileGLEL = new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
final GL gl = drawable.getGL();
- GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
- GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
+ final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
+ final GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
renderer.setImageBuffer(pixelBuffer);
if( drawable.isGLOriented() ) {
flipVertically[0] = false;
@@ -207,11 +207,11 @@ public class TestTiledRendering2NEWT extends UITestCase {
}
}
@Override
- public void dispose(GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
};
renderer.setGLEventListener(preTileGLEL, null);
@@ -225,7 +225,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
// .. even though we close the demo, this is for documentation!
glad.invoke(true, new GLRunnable() {
@Override
- public boolean run(GLAutoDrawable drawable) {
+ public boolean run(final GLAutoDrawable drawable) {
drawable.getGL().glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
demo.reshape(drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
return false;
@@ -249,13 +249,13 @@ public class TestTiledRendering2NEWT extends UITestCase {
glad.destroy();
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestTiledRendering2NEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TiledPrintingAWTBase.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TiledPrintingAWTBase.java
index 4e9d4bdbe..e84bb4d74 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TiledPrintingAWTBase.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TiledPrintingAWTBase.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -60,13 +60,13 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.util.TileRenderer;
/**
- * Base unit test class implementing
+ * Base unit test class implementing
* issuing {@link PrinterJob#print()} on a {@link Printable} implementation,
* i.e. {@link OnscreenPrintable} or {@link OffscreenPrintable}.
*/
public abstract class TiledPrintingAWTBase extends UITestCase {
-
- private RecursiveLock lock = LockFactory.createRecursiveLock();
+
+ private final RecursiveLock lock = LockFactory.createRecursiveLock();
private int printCount = 0;
public TiledPrintingAWTBase() {
@@ -74,19 +74,19 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
}
/**
- *
+ *
* @param cont
* @param pOrientation
* @param paper
* @param offscrnImageType if < 0 onscreen, otherwise integer BufferedImage type
* @param dpi
- * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
+ * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
* @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
* @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
* @param resizeWithinPrintTest TODO
*/
- public PrintableBase doPrintAuto(Container cont, int pOrientation, Paper paper,
- int offscrnImageType, int dpi, int numSamples, int tileWidth, int tileHeight, boolean resizeWithinPrintTest) {
+ public PrintableBase doPrintAuto(final Container cont, final int pOrientation, final Paper paper,
+ final int offscrnImageType, final int dpi, final int numSamples, final int tileWidth, final int tileHeight, final boolean resizeWithinPrintTest) {
lock.lock();
try {
final PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
@@ -94,13 +94,13 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
aset.add(MediaSizeName.ISO_A2); // 420 × 594 mm
aset.add(MediaSizeName.ISO_A3); // 297 × 420 mm
aset.add(MediaSizeName.ISO_A4); // 210 × 297 mm
-
+
printCount++;
-
+
final String psMimeType = "application/postscript";
final String pdfMimeType = "application/pdf";
final PrinterJob pj = PrinterJob.getPrinterJob();
-
+
StreamPrintServiceFactory[] factories = PrinterJob.lookupStreamPrintServices(pdfMimeType);
if (factories.length > 0) {
final String fname = getPrintFilename(offscrnImageType, dpi, numSamples, tileWidth, tileHeight, "pdf", resizeWithinPrintTest);
@@ -108,14 +108,14 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
FileOutputStream outstream;
try {
outstream = new FileOutputStream(fname);
- return doPrintAutoImpl(cont, pj, factories[0].getPrintService(outstream), pOrientation, paper,
+ return doPrintAutoImpl(cont, pj, factories[0].getPrintService(outstream), pOrientation, paper,
offscrnImageType, dpi, numSamples, tileWidth, tileHeight, resizeWithinPrintTest);
- } catch (FileNotFoundException e) {
+ } catch (final FileNotFoundException e) {
Assert.assertNull("Unexpected exception", e);
}
- }
+ }
System.err.println("No PDF");
-
+
factories = PrinterJob.lookupStreamPrintServices(psMimeType);
if (factories.length > 0) {
final String fname = getPrintFilename(offscrnImageType, dpi, numSamples, tileWidth, tileHeight, "ps", resizeWithinPrintTest);
@@ -124,29 +124,29 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
try {
outstream = new FileOutputStream(fname);
return doPrintAutoImpl(cont, pj, factories[0].getPrintService(outstream), pOrientation, paper, offscrnImageType, dpi, numSamples, tileWidth, tileHeight, resizeWithinPrintTest);
- } catch (FileNotFoundException e) {
+ } catch (final FileNotFoundException e) {
Assert.assertNull("Unexpected exception", e);
}
- }
+ }
System.err.println("No PS");
return null;
} finally {
lock.unlock();
}
}
- private String getPrintFilename(int offscrnImageType, int dpi, int numSamples, int tileWidth, int tileHeight, String suffix, boolean resizeWithinPrintTest) {
+ private String getPrintFilename(final int offscrnImageType, final int dpi, final int numSamples, final int tileWidth, final int tileHeight, final String suffix, final boolean resizeWithinPrintTest) {
final int maxSimpleTestNameLen = getMaxTestNameLen()+getClass().getSimpleName().length()+1;
final String simpleTestName = getSimpleTestName(".");
final String onoffscrn = 0 > offscrnImageType ? "on_screen" : "offscrn_"+offscrnImageType;
final String aa = 0 <= numSamples ? "aa"+numSamples : "aaN";
- return String.format("%-"+maxSimpleTestNameLen+"s-n%04d-%s-dpi%03d-%s-tSz%04dx%04d-resize%d.%s",
+ return String.format("%-"+maxSimpleTestNameLen+"s-n%04d-%s-dpi%03d-%s-tSz%04dx%04d-resize%d.%s",
simpleTestName, printCount, onoffscrn, dpi, aa, tileWidth, tileHeight, resizeWithinPrintTest?1:0, suffix).replace(' ', '_');
}
- private PrintableBase doPrintAutoImpl(Container cont, PrinterJob job,
- StreamPrintService ps, int pOrientation, Paper paper,
- int offscrnImageType, int dpi, int numSamples, int tileWidth, int tileHeight, boolean resizeWithinPrintTest) {
- try {
- PageFormat pageFormat = job.defaultPage();
+ private PrintableBase doPrintAutoImpl(final Container cont, final PrinterJob job,
+ final StreamPrintService ps, final int pOrientation, final Paper paper,
+ final int offscrnImageType, final int dpi, final int numSamples, final int tileWidth, final int tileHeight, final boolean resizeWithinPrintTest) {
+ try {
+ final PageFormat pageFormat = job.defaultPage();
if( null != paper ) {
/**
Paper paper = new Paper();
@@ -165,25 +165,25 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
printable.job.setPrintable(printable, pageFormat);
doPrintImpl(printable, resizeWithinPrintTest);
return printable;
- } catch (PrinterException pe) {
+ } catch (final PrinterException pe) {
pe.printStackTrace();
return null;
- }
+ }
}
/**
* @param cont
* @param dpi
- * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
+ * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
* @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
* @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
*/
- public PrintableBase doPrintManual(Container cont, int dpi, int numSamples, int tileWidth, int tileHeight) {
+ public PrintableBase doPrintManual(final Container cont, final int dpi, final int numSamples, final int tileWidth, final int tileHeight) {
lock.lock();
try {
final OnscreenPrintable printable = new OnscreenPrintable(PrinterJob.getPrinterJob(), cont, dpi, numSamples, tileWidth, tileHeight);
printable.job.setPrintable(printable);
- boolean ok = printable.job.printDialog();
+ final boolean ok = printable.job.printDialog();
if (ok) {
doPrintImpl(printable, false);
}
@@ -192,10 +192,10 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
lock.unlock();
}
}
-
+
private final AWTMisc.ComponentAction resizePlusAction = new AWTMisc.ComponentAction() {
@Override
- public void run(Component c) {
+ public void run(final Component c) {
final Rectangle r = c.getBounds();
r.width += 64;
r.height += 64;
@@ -203,19 +203,19 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
} };
private final AWTMisc.ComponentAction resizeMinusAction = new AWTMisc.ComponentAction() {
@Override
- public void run(Component c) {
+ public void run(final Component c) {
final Rectangle r = c.getBounds();
r.width -= 64;
r.height -= 64;
c.setBounds(r);
} };
-
+
private void doPrintImpl(final PrintableBase printable, final boolean resizeWithinPrintTest) {
final double scaleGLMatXY = 72.0 / printable.dpi;
System.err.println("PRINTable: "+printable.getClass().getSimpleName());
System.err.println("PRINT DPI: "+printable.dpi+", AA "+printable.numSamples+", scaleGL "+scaleGLMatXY);
- final AWTPrintLifecycle.Context ctx =
- AWTPrintLifecycle.Context.setupPrint(printable.cont, scaleGLMatXY, scaleGLMatXY,
+ final AWTPrintLifecycle.Context ctx =
+ AWTPrintLifecycle.Context.setupPrint(printable.cont, scaleGLMatXY, scaleGLMatXY,
printable.numSamples, printable.tileWidth, printable.tileHeight);
System.err.println("PRINT AWTPrintLifecycle.setup.count "+ctx.getCount());
final int w = printable.cont.getWidth();
@@ -227,14 +227,14 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
try {
if( resizeWithinPrintTest ) {
System.err.println("PRINT resizeWithinPrint size+ "+(w+64)+"x"+(h+64));
- AWTMisc.performAction(printable.cont, GLAutoDrawable.class, resizePlusAction);
+ AWTMisc.performAction(printable.cont, GLAutoDrawable.class, resizePlusAction);
printable.cont.validate();
if( printable.cont instanceof Window ) {
((Window)printable.cont).pack();
}
}
printable.job.print();
- } catch (PrinterException ex) {
+ } catch (final PrinterException ex) {
ex.printStackTrace();
}
} });
@@ -248,7 +248,7 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
System.err.println("PRINT resizeWithinPrint repaint");
printable.cont.repaint();
System.err.println("PRINT resizeWithinPrint size- "+w+"x"+h);
- AWTMisc.performAction(printable.cont, GLAutoDrawable.class, resizeMinusAction);
+ AWTMisc.performAction(printable.cont, GLAutoDrawable.class, resizeMinusAction);
printable.cont.validate();
if( printable.cont instanceof Window ) {
((Window)printable.cont).pack();
@@ -260,7 +260,7 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
}
/** Wait for idle .. simply acquiring all locks and releasing them. */
- public void waitUntilPrintJobsIdle(PrintableBase p) {
+ public void waitUntilPrintJobsIdle(final PrintableBase p) {
lock.lock();
try {
if( null != p ) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TransparentPanel.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TransparentPanel.java
index d68f878fa..9fc790a77 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TransparentPanel.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TransparentPanel.java
@@ -11,7 +11,7 @@ public class TransparentPanel extends JPanel {
}
@Override
- public void setOpaque(boolean isOpaque) {
+ public void setOpaque(final boolean isOpaque) {
// Don't let this panel become opaque
}
@@ -31,18 +31,18 @@ public class TransparentPanel extends JPanel {
* @param c The Component on which to set the cut out shape.
* @param s The shape to cut out of the given Component.
*/
- public void setMixingCutoutShape(Shape s)
+ public void setMixingCutoutShape(final Shape s)
{
// Get the cut out shape method
if (mSetComponentMixing == null) {
try {
- Class<?> awtUtilitiesClass =
+ final Class<?> awtUtilitiesClass =
Class.forName("com.sun.awt.AWTUtilities");
- mSetComponentMixing =
+ mSetComponentMixing =
awtUtilitiesClass.getMethod(
- "setComponentMixingCutoutShape",
+ "setComponentMixingCutoutShape",
Component.class, Shape.class);
- } catch (Exception ex) {
+ } catch (final Exception ex) {
ex.printStackTrace();
}
}
@@ -51,7 +51,7 @@ public class TransparentPanel extends JPanel {
if (mSetComponentMixing != null) {
try {
mSetComponentMixing.invoke( null, this, s );
- } catch (Exception ex) {
+ } catch (final Exception ex) {
ex.printStackTrace();
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1ImmModeSink.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1ImmModeSink.java
index d6c0908f7..ec3049364 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1ImmModeSink.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1ImmModeSink.java
@@ -33,6 +33,7 @@ import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLPipelineFactory;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.gl2es1.GLUgl2es1;
@@ -47,18 +48,18 @@ class DemoGL2ES1ImmModeSink implements GLEventListener {
private boolean forceFFPEmu = false;
final ImmModeSink ims;
final GLU glu;
-
- DemoGL2ES1ImmModeSink(boolean useVBO) {
- ims = ImmModeSink.createFixed(3*3,
+
+ DemoGL2ES1ImmModeSink(final boolean useVBO) {
+ ims = ImmModeSink.createFixed(3*3,
3, GL.GL_FLOAT, // vertex
3, GL.GL_FLOAT, // color
0, GL.GL_FLOAT, // normal
- 0, GL.GL_FLOAT, // texCoords
+ 0, GL.GL_FLOAT, // texCoords
useVBO ? GL.GL_STATIC_DRAW : 0);
glu = new GLUgl2es1();
}
-
- public void setForceFFPEmu(boolean forceFFPEmu, boolean verboseFFPEmu, boolean debugFFPEmu, boolean traceFFPEmu) {
+
+ public void setForceFFPEmu(final boolean forceFFPEmu, final boolean verboseFFPEmu, final boolean debugFFPEmu, final boolean traceFFPEmu) {
this.forceFFPEmu = forceFFPEmu;
this.verboseFFPEmu = verboseFFPEmu;
this.debugFFPEmu = debugFFPEmu;
@@ -66,7 +67,7 @@ class DemoGL2ES1ImmModeSink implements GLEventListener {
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
GL _gl = drawable.getGL();
if(debugFFPEmu) {
// Debug ..
@@ -76,31 +77,31 @@ class DemoGL2ES1ImmModeSink implements GLEventListener {
// Trace ..
_gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES2.class, _gl, new Object[] { System.err } ) );
}
- GL2ES1 gl = FixedFuncUtil.wrapFixedFuncEmul(_gl, ShaderSelectionMode.AUTO, null, forceFFPEmu, verboseFFPEmu);
-
+ final GL2ES1 gl = FixedFuncUtil.wrapFixedFuncEmul(_gl, ShaderSelectionMode.AUTO, null, forceFFPEmu, verboseFFPEmu);
+
System.err.println("GL_VENDOR "+gl.glGetString(GL.GL_VENDOR));
System.err.println("GL_RENDERER "+gl.glGetString(GL.GL_RENDERER));
System.err.println("GL_VERSION "+gl.glGetString(GL.GL_VERSION));
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
- GL2ES1 gl = drawable.getGL().getGL2ES1();
-
- gl.glMatrixMode( GL2ES1.GL_PROJECTION );
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
+
+ gl.glMatrixMode( GLMatrixFunc.GL_PROJECTION );
gl.glLoadIdentity();
// coordinate system origin at lower left with width and height same as the window
glu.gluOrtho2D( 0.0f, width, 0.0f, height );
- gl.glMatrixMode( GL2ES1.GL_MODELVIEW );
+ gl.glMatrixMode( GLMatrixFunc.GL_MODELVIEW );
gl.glLoadIdentity();
}
-
+
@Override
- public void display(GLAutoDrawable drawable) {
- GL2ES1 gl = drawable.getGL().getGL2ES1();
-
+ public void display(final GLAutoDrawable drawable) {
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
+
gl.glClear( GL.GL_COLOR_BUFFER_BIT );
// draw a triangle filling the window
@@ -115,6 +116,6 @@ class DemoGL2ES1ImmModeSink implements GLEventListener {
}
@Override
- public void dispose(GLAutoDrawable drawable) {
- }
+ public void dispose(final GLAutoDrawable drawable) {
+ }
} \ No newline at end of file
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1Plain.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1Plain.java
index 0df368615..c1dd7fb58 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1Plain.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1Plain.java
@@ -35,6 +35,7 @@ import javax.media.opengl.GL2ES1;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLException;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import javax.media.opengl.fixedfunc.GLPointerFunc;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.gl2es1.GLUgl2es1;
@@ -47,58 +48,58 @@ class DemoGL2ES1Plain implements GLEventListener {
final boolean useArrayData;
final boolean useVBO;
final GLU glu;
-
+
final float[] vertices = new float[] { 0, 0, 0,
TestImmModeSinkES1NEWT.iWidth, 0, 0,
TestImmModeSinkES1NEWT.iWidth / 2, TestImmModeSinkES1NEWT.iHeight, 0 };
-
- final float[] colors = new float[] { 1, 0, 0,
- 0, 1, 0,
+
+ final float[] colors = new float[] { 1, 0, 0,
+ 0, 1, 0,
0, 0, 1 };
-
+
final ByteBuffer bufferAll;
final int bufferVOffset, bufferCOffset;
final int bufferVSize, bufferCSize;
final FloatBuffer bufferC, bufferV;
final int[] vboName = new int[] { 0 };
final GLArrayDataWrapper arrayC, arrayV;
-
- DemoGL2ES1Plain(boolean useArrayData, boolean useVBO) {
+
+ DemoGL2ES1Plain(final boolean useArrayData, final boolean useVBO) {
this.useArrayData = useArrayData;
- this.useVBO = useVBO;
+ this.useVBO = useVBO;
this.glu = new GLUgl2es1();
-
+
bufferAll = Buffers.newDirectByteBuffer( ( colors.length + vertices.length ) * Buffers.SIZEOF_FLOAT );
-
+
bufferVOffset = 0;
bufferVSize = 3*3*GLBuffers.sizeOfGLType(GL.GL_FLOAT);
bufferCOffset = bufferVSize;
bufferCSize = 3*3*GLBuffers.sizeOfGLType(GL.GL_FLOAT);
-
+
bufferV = (FloatBuffer) GLBuffers.sliceGLBuffer(bufferAll, bufferVOffset, bufferVSize, GL.GL_FLOAT);
bufferV.put(vertices, 0, vertices.length).rewind();
bufferC = (FloatBuffer) GLBuffers.sliceGLBuffer(bufferAll, bufferCOffset, bufferCSize, GL.GL_FLOAT);
bufferC.put(colors, 0, colors.length).rewind();
-
+
System.err.println("bufferAll: "+bufferAll+", byteOffset "+Buffers.getDirectBufferByteOffset(bufferAll));
System.err.println("bufferV: off "+bufferVOffset+", size "+bufferVSize+": "+bufferV+", byteOffset "+Buffers.getDirectBufferByteOffset(bufferV));
System.err.println("bufferC: off "+bufferCOffset+", size "+bufferCSize+": "+bufferC+", byteOffset "+Buffers.getDirectBufferByteOffset(bufferC));
-
- if(useArrayData) {
+
+ if(useArrayData) {
arrayV = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, 3, GL.GL_FLOAT, false, 0,
bufferV, 0, bufferVOffset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER);
-
+
arrayC = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_COLOR_ARRAY, 3, GL.GL_FLOAT, false, 0,
bufferC, 0, bufferCOffset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER);
} else {
arrayV = null;
- arrayC = null;
+ arrayC = null;
}
}
-
+
@Override
- public void init(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
+ public void init(final GLAutoDrawable drawable) {
+ final GL gl = drawable.getGL();
System.err.println("GL_VENDOR "+gl.glGetString(GL.GL_VENDOR));
System.err.println("GL_RENDERER "+gl.glGetString(GL.GL_RENDERER));
System.err.println("GL_VERSION "+gl.glGetString(GL.GL_VERSION));
@@ -111,25 +112,25 @@ class DemoGL2ES1Plain implements GLEventListener {
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
- GL2ES1 gl = drawable.getGL().getGL2ES1();
-
- gl.glMatrixMode( GL2ES1.GL_PROJECTION );
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
+
+ gl.glMatrixMode( GLMatrixFunc.GL_PROJECTION );
gl.glLoadIdentity();
// coordinate system origin at lower left with width and height same as the window
glu.gluOrtho2D( 0.0f, width, 0.0f, height );
- gl.glMatrixMode( GL2ES1.GL_MODELVIEW );
+ gl.glMatrixMode( GLMatrixFunc.GL_MODELVIEW );
gl.glLoadIdentity();
- gl.glViewport( 0, 0, width, height );
+ gl.glViewport( 0, 0, width, height );
}
-
+
@Override
- public void display(GLAutoDrawable drawable) {
- GL2ES1 gl = drawable.getGL().getGL2ES1();
-
+ public void display(final GLAutoDrawable drawable) {
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
+
gl.glClear( GL.GL_COLOR_BUFFER_BIT );
// draw a triangle filling the window
@@ -143,46 +144,46 @@ class DemoGL2ES1Plain implements GLEventListener {
arrayC.setVBOName(vboName[0]);
}
}
-
+
gl.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
if(useArrayData) {
gl.glVertexPointer(arrayV);
} else {
- if(useVBO) {
+ if(useVBO) {
gl.glVertexPointer(3, GL.GL_FLOAT, 0, bufferVOffset);
} else {
gl.glVertexPointer(3, GL.GL_FLOAT, 0, bufferV);
}
}
-
- gl.glEnableClientState(GLPointerFunc.GL_COLOR_ARRAY);
+
+ gl.glEnableClientState(GLPointerFunc.GL_COLOR_ARRAY);
if(useArrayData) {
gl.glColorPointer(arrayC);
} else {
- if(useVBO) {
+ if(useVBO) {
gl.glColorPointer(3, GL.GL_FLOAT, 0, bufferCOffset);
} else {
gl.glColorPointer(3, GL.GL_FLOAT, 0, bufferC);
}
}
-
+
if(useVBO) {
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
}
-
+
gl.glDrawArrays(GL.GL_TRIANGLES, 0, 3);
gl.glFlush();
-
+
gl.glDisableClientState(GLPointerFunc.GL_COLOR_ARRAY);
gl.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
}
@Override
- public void dispose(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
+ public void dispose(final GLAutoDrawable drawable) {
+ final GL gl = drawable.getGL();
if(0 != vboName[0]) {
gl.glDeleteBuffers(1, vboName, 0);
vboName[0] = 0;
}
- }
+ }
} \ No newline at end of file
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1TextureImmModeSink.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1TextureImmModeSink.java
index 81fa5ded3..d186643b7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1TextureImmModeSink.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1TextureImmModeSink.java
@@ -48,6 +48,7 @@ import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLPipelineFactory;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
import javax.media.opengl.glu.GLU;
public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDraw01Accessor {
@@ -66,7 +67,7 @@ public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDra
this.keepTextureBound = false;
}
- public void setForceFFPEmu(boolean forceFFPEmu, boolean verboseFFPEmu, boolean debugFFPEmu, boolean traceFFPEmu) {
+ public void setForceFFPEmu(final boolean forceFFPEmu, final boolean verboseFFPEmu, final boolean debugFFPEmu, final boolean traceFFPEmu) {
this.forceFFPEmu = forceFFPEmu;
this.verboseFFPEmu = verboseFFPEmu;
this.debugFFPEmu = debugFFPEmu;
@@ -75,7 +76,7 @@ public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDra
@Override
- public void setKeepTextureBound(boolean v) {
+ public void setKeepTextureBound(final boolean v) {
this.keepTextureBound = v;
}
@Override
@@ -84,7 +85,7 @@ public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDra
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
GL _gl = drawable.getGL();
if(debugFFPEmu) {
// Debug ..
@@ -94,35 +95,35 @@ public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDra
// Trace ..
_gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES2.class, _gl, new Object[] { System.err } ) );
}
- GL2ES1 gl = FixedFuncUtil.wrapFixedFuncEmul(_gl, ShaderSelectionMode.AUTO, null, forceFFPEmu, verboseFFPEmu);
+ final GL2ES1 gl = FixedFuncUtil.wrapFixedFuncEmul(_gl, ShaderSelectionMode.AUTO, null, forceFFPEmu, verboseFFPEmu);
- URLConnection testTextureUrlConn = IOUtil.getResource(PNGTstFiles.class, "test-ntscP_3-01-160x90.png");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(PNGTstFiles.class, "test-ntscP_3-01-160x90.png");
try {
- InputStream testTextureStream = testTextureUrlConn.getInputStream();
+ final InputStream testTextureStream = testTextureUrlConn.getInputStream();
textureData = TextureIO.newTextureData(gl.getGLProfile(), testTextureStream , false /* mipmap */, TextureIO.PNG);
texture = TextureIO.newTexture(gl, textureData);
if( keepTextureBound && null != texture ) {
texture.enable(gl);
texture.bind(gl);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
- GL2ES1 gl = drawable.getGL().getGL2ES1();
- gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
+ gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
gl.glLoadIdentity();
glu.gluOrtho2D(0, 1, 0, 1);
- gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+ gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
gl.glLoadIdentity();
}
@Override
- public void dispose(GLAutoDrawable drawable) {
- GL2ES1 gl = drawable.getGL().getGL2ES1();
+ public void dispose(final GLAutoDrawable drawable) {
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
if(null!=texture) {
texture.disable(gl);
texture.destroy(gl);
@@ -133,8 +134,8 @@ public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDra
}
@Override
- public void display(GLAutoDrawable drawable) {
- GL2ES1 gl = drawable.getGL().getGL2ES1();
+ public void display(final GLAutoDrawable drawable) {
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
// draw one quad with the texture
if(null!=texture) {
@@ -143,7 +144,7 @@ public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDra
texture.bind(gl);
}
// gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_REPLACE);
- TextureCoords coords = texture.getImageTexCoords();
+ final TextureCoords coords = texture.getImageTexCoords();
ims.glBegin(ImmModeSink.GL_QUADS);
ims.glTexCoord2f(coords.left(), coords.bottom());
ims.glVertex3f(0, 0, 0);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES2ImmModeSink.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES2ImmModeSink.java
index 9d18f21e0..f2616d987 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES2ImmModeSink.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES2ImmModeSink.java
@@ -46,12 +46,12 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
private final ShaderState st;
private final PMVMatrix pmvMatrix;
- private int glBufferUsage;
+ private final int glBufferUsage;
private ShaderProgram sp;
private GLUniformData pmvMatrixUniform;
private ImmModeSink ims;
- public DemoGL2ES2ImmModeSink(boolean useVBO, boolean useShaderState) {
+ public DemoGL2ES2ImmModeSink(final boolean useVBO, final boolean useShaderState) {
if(useShaderState) {
st = new ShaderState();
st.setVerbose(true);
@@ -59,23 +59,23 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
st = null;
}
glBufferUsage = useVBO ? GL.GL_STATIC_DRAW : 0;
- pmvMatrix = new PMVMatrix();
+ pmvMatrix = new PMVMatrix();
}
- public void init(GLAutoDrawable glad) {
+ public void init(final GLAutoDrawable glad) {
final GL2ES2 gl = glad.getGL().getGL2ES2();
-
+
System.err.println("GL_VENDOR "+gl.glGetString(GL.GL_VENDOR));
System.err.println("GL_RENDERER "+gl.glGetString(GL.GL_RENDERER));
System.err.println("GL_VERSION "+gl.glGetString(GL.GL_VERSION));
-
- final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, DemoGL2ES2ImmModeSink.class,
+
+ final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, DemoGL2ES2ImmModeSink.class,
"../demos/es2/shader", "../demos/es2/shader/bin", "mgl_default_xxx", true);
- final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, DemoGL2ES2ImmModeSink.class,
+ final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, DemoGL2ES2ImmModeSink.class,
"../demos/es2/shader", "../demos/es2/shader/bin", "mgl_default_xxx", true);
vp0.defaultShaderCustomization(gl, true, true);
fp0.defaultShaderCustomization(gl, true, true);
-
+
sp = new ShaderProgram();
sp.add(gl, vp0, System.err);
sp.add(gl, fp0, System.err);
@@ -87,10 +87,10 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
}
sp.useProgram(gl, true);
}
-
+
pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
if(null != st) {
- st.ownUniform(pmvMatrixUniform);
+ st.ownUniform(pmvMatrixUniform);
st.uniform(gl, pmvMatrixUniform);
} else {
if( pmvMatrixUniform.setLocation(gl, sp.program()) < 0 ) {
@@ -98,8 +98,8 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
}
gl.glUniform(pmvMatrixUniform);
}
-
- // Using predef array names, see
+
+ // Using predef array names, see
// GLPointerFuncUtil.getPredefinedArrayIndexName(glArrayIndex);
if( null != st ) {
ims = ImmModeSink.createGLSL(40,
@@ -114,24 +114,24 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
4, GL.GL_FLOAT, // color
0, GL.GL_FLOAT, // normal
0, GL.GL_FLOAT, // texCoords
- glBufferUsage, sp.program());
+ glBufferUsage, sp.program());
}
final int numSteps = 20;
final double increment = Math.PI / numSteps;
final double radius = 1;
ims.glBegin(GL.GL_LINES);
for (int i = numSteps - 1; i >= 0; i--) {
- ims.glVertex3f((float) (radius * Math.cos(i * increment)),
- (float) (radius * Math.sin(i * increment)),
+ ims.glVertex3f((float) (radius * Math.cos(i * increment)),
+ (float) (radius * Math.sin(i * increment)),
0f);
- ims.glColor4f( 1f, 1f, 1f, 1f );
- ims.glVertex3f((float) (-1.0 * radius * Math.cos(i * increment)),
- (float) (-1.0 * radius * Math.sin(i * increment)),
+ ims.glColor4f( 1f, 1f, 1f, 1f );
+ ims.glVertex3f((float) (-1.0 * radius * Math.cos(i * increment)),
+ (float) (-1.0 * radius * Math.sin(i * increment)),
0f);
- ims.glColor4f( 1f, 1f, 1f, 1f );
+ ims.glColor4f( 1f, 1f, 1f, 1f );
}
ims.glEnd(gl, false);
-
+
if(null != st) {
st.useProgram(gl, false);
} else {
@@ -139,7 +139,7 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
}
}
- public void dispose(GLAutoDrawable glad) {
+ public void dispose(final GLAutoDrawable glad) {
final GL2ES2 gl = glad.getGL().getGL2ES2();
ims.destroy(gl);
ims = null;
@@ -148,12 +148,12 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
}
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final GL2ES2 gl = drawable.getGL().getGL2ES2();
-
+
gl.glClear( GL.GL_COLOR_BUFFER_BIT );
- // draw a triangle filling the window
+ // draw a triangle filling the window
ims.glBegin(GL.GL_TRIANGLES);
ims.glColor3f( 1, 0, 0 );
ims.glVertex2f( 0, 0 );
@@ -161,22 +161,22 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
ims.glVertex2f( drawable.getSurfaceWidth(), 0 );
ims.glColor3f( 0, 0, 1 );
ims.glVertex2f( drawable.getSurfaceWidth() / 2, drawable.getSurfaceHeight() );
- ims.glEnd(gl, true);
+ ims.glEnd(gl, true);
}
// Unused routines
- public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
System.err.println("reshape ..");
final GL2ES2 gl = glad.getGL().getGL2ES2();
pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
-
+
// coordinate system origin at lower left with width and height same as the window
pmvMatrix.glOrthof( 0.0f, width, 0.0f, height, -1, 1 );
pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pmvMatrix.glLoadIdentity();
-
+
if(null != st) {
st.useProgram(gl, true);
st.uniform(gl, pmvMatrixUniform);
@@ -188,6 +188,6 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
}
}
- public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
+ public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/TestES1FixedFunctionPipelineNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/TestES1FixedFunctionPipelineNEWT.java
index e8e3b12d9..979c4873e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/TestES1FixedFunctionPipelineNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/TestES1FixedFunctionPipelineNEWT.java
@@ -62,8 +62,8 @@ public class TestES1FixedFunctionPipelineNEWT extends UITestCase {
public static void releaseClass() {
}
- protected void runTestGL0(GLCapabilities caps, GLEventListener demo) throws InterruptedException {
- GLWindow glWindow = GLWindow.create(caps);
+ protected void runTestGL0(final GLCapabilities caps, final GLEventListener demo) throws InterruptedException {
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle(getSimpleTestName("."));
@@ -72,8 +72,8 @@ public class TestES1FixedFunctionPipelineNEWT extends UITestCase {
snap.setPostSNDetail(demo.getClass().getSimpleName());
glWindow.addGLEventListener(snap);
- Animator animator = new Animator(glWindow);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final Animator animator = new Animator(glWindow);
+ final QuitAdapter quitAdapter = new QuitAdapter();
glWindow.addKeyListener(quitAdapter);
glWindow.addWindowListener(quitAdapter);
@@ -92,7 +92,7 @@ public class TestES1FixedFunctionPipelineNEWT extends UITestCase {
glWindow.destroy();
}
- protected void runTestGL(GLCapabilities caps, boolean forceFFPEmu) throws InterruptedException {
+ protected void runTestGL(final GLCapabilities caps, final boolean forceFFPEmu) throws InterruptedException {
final RedSquareES1 demo01 = new RedSquareES1();
demo01.setForceFFPEmu(forceFFPEmu, false, false, false);
runTestGL0(caps, demo01);
@@ -113,40 +113,40 @@ public class TestES1FixedFunctionPipelineNEWT extends UITestCase {
@Test
public void test01GL2Normal() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GL2)) { System.err.println("GL2 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
runTestGL(caps, false);
}
@Test
public void test02GL2FFPEmu() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GL2)) { System.err.println("GL2 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
runTestGL(caps, true);
}
@Test
public void test03GL2ES1Normal() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GL2ES1)) { System.err.println("GL2ES1 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES1));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES1));
runTestGL(caps, false);
}
@Test
public void test04ES2FFPEmu() throws InterruptedException {
if(!GLProfile.isAvailable(GLProfile.GLES2)) { System.err.println("GLES2 n/a"); return; }
- GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
+ final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
runTestGL(caps, false); // should be FFPEmu implicit
}
static long duration = 1000; // ms
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
try {
duration = Integer.parseInt(args[i]);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
org.junit.runner.JUnitCore.main(TestES1FixedFunctionPipelineNEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES1NEWT.java
index 0ac01bc31..790f965b6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES1NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES1NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.util;
import java.io.IOException;
@@ -52,86 +52,86 @@ public class TestImmModeSinkES1NEWT extends UITestCase {
static final int iWidth = 400;
static final int iHeight = 400;
- static GLCapabilities getCaps(String profile) {
+ static GLCapabilities getCaps(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
}
return new GLCapabilities(GLProfile.get(profile));
}
-
- void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+
+ void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
System.out.println("Requested GL Caps: "+reqGLCaps);
-
+
//
// Create native windowing resources .. X11/Win/OSX
- //
+ //
final GLWindow glad = GLWindow.create(reqGLCaps);
glad.addGLEventListener(demo);
-
+
final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
glad.addGLEventListener(snapshotGLEventListener);
glad.setSize(iWidth, iHeight);
glad.setVisible(true);
-
+
snapshotGLEventListener.setMakeSnapshot();
glad.display(); // initial resize/display
-
+
Thread.sleep(duration);
-
+
glad.destroy();
}
-
+
@Test
public void test01Plain__GL2ES1_VBOOffUsePlain() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
if(null == reqGLCaps) return;
doTest(reqGLCaps, new DemoGL2ES1Plain(false, false));
}
-
+
@Test
public void test02Plain__GL2ES1_VBOOffUseArrayData() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
if(null == reqGLCaps) return;
doTest(reqGLCaps, new DemoGL2ES1Plain(true, false));
}
-
+
@Test
public void test03Plain__GL2ES1_VBOOnUsePlain() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
if(null == reqGLCaps) return;
doTest(reqGLCaps, new DemoGL2ES1Plain(false, true));
}
-
+
@Test
public void test04Plain__GL2ES1_VBOOnUseArrayData() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
if(null == reqGLCaps) return;
doTest(reqGLCaps, new DemoGL2ES1Plain(true, true));
}
-
+
@Test
public void test05ImmSinkGL2ES1_VBOOff() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
if(null == reqGLCaps) return;
doTest(reqGLCaps, new DemoGL2ES1ImmModeSink(false));
}
-
+
@Test
public void test06ImmSinkGL2ES1_VBOOn() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
if(null == reqGLCaps) return;
doTest(reqGLCaps, new DemoGL2ES1ImmModeSink(true));
}
-
+
@Test
public void test07ImmSinkGL2ES1_VBOOnTexture() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
if(null == reqGLCaps) return;
doTest(reqGLCaps, new DemoGL2ES1TextureImmModeSink());
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
duration = MiscUtils.atoi(args[++i], duration);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES2NEWT.java
index de6aef55e..9cf39a040 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES2NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.util;
import java.io.IOException;
@@ -52,63 +52,63 @@ public class TestImmModeSinkES2NEWT extends UITestCase {
static final int iWidth = 400;
static final int iHeight = 400;
- static GLCapabilities getCaps(String profile) {
+ static GLCapabilities getCaps(final String profile) {
if( !GLProfile.isAvailable(profile) ) {
System.err.println("Profile "+profile+" n/a");
return null;
}
return new GLCapabilities(GLProfile.get(profile));
}
-
- void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+
+ void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
System.out.println("Requested GL Caps: "+reqGLCaps);
-
+
//
// Create native windowing resources .. X11/Win/OSX
- //
+ //
final GLWindow glad = GLWindow.create(reqGLCaps);
glad.addGLEventListener(demo);
-
+
final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
glad.addGLEventListener(snapshotGLEventListener);
glad.setSize(iWidth, iHeight);
glad.setVisible(true);
-
+
snapshotGLEventListener.setMakeSnapshot();
glad.display(); // initial resize/display
-
+
Thread.sleep(duration);
-
+
glad.destroy();
}
-
+
@Test
public void test05ImmSinkGL2ES2_VBOOff_Direct() throws InterruptedException {
final GLCapabilities reqGLCaps = new GLCapabilities( GLProfile.getMaxFixedFunc(true) );
doTest(reqGLCaps, new DemoGL2ES2ImmModeSink(false, false));
}
-
+
@Test
public void test05ImmSinkGL2ES2_VBOOff_ShaderState() throws InterruptedException {
final GLCapabilities reqGLCaps = new GLCapabilities( GLProfile.getMaxFixedFunc(true) );
doTest(reqGLCaps, new DemoGL2ES2ImmModeSink(false, true));
}
-
+
@Test
public void test06ImmSinkGL2ES2_VBOOn_Direct() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
if(null == reqGLCaps) return;
doTest(reqGLCaps, new DemoGL2ES2ImmModeSink(true, false));
}
-
+
@Test
public void test06ImmSinkGL2ES2_VBOOn_ShaderState() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
if(null == reqGLCaps) return;
doTest(reqGLCaps, new DemoGL2ES2ImmModeSink(true, true));
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
duration = MiscUtils.atoi(args[++i], duration);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug362DDSImageCreateFromData.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug362DDSImageCreateFromData.java
index 4212abae7..a585e9eaf 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug362DDSImageCreateFromData.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug362DDSImageCreateFromData.java
@@ -17,13 +17,13 @@ import com.jogamp.opengl.util.texture.spi.DDSImage;
import com.jogamp.opengl.util.texture.spi.DDSImage.ImageInfo;
/**
- * This test uses the DDSImage class to read a dds image from file, extract the data,
+ * This test uses the DDSImage class to read a dds image from file, extract the data,
* and use the class to create a new DDSImage from the extracted data
* <br></br>
* Bug Reference: https://jogamp.org/bugzilla/show_bug.cgi?id=362
* <br></br>
- * The bug pertains to incorrect size calculation for checking validity of data. Compressed DXT1 has min of 8 bytes, DXT5 has min of 16 bytes.
- * It exists in {@link DDSImage#createFromData(int, int, int, ByteBuffer[])}
+ * The bug pertains to incorrect size calculation for checking validity of data. Compressed DXT1 has min of 8 bytes, DXT5 has min of 16 bytes.
+ * It exists in {@link DDSImage#createFromData(int, int, int, ByteBuffer[])}
* where an {@link IllegalArgumentException} is thrown for Mipmap level size mismatch.
* <br></br>
* <ul>The following cases are tested:
@@ -31,68 +31,68 @@ import com.jogamp.opengl.util.texture.spi.DDSImage.ImageInfo;
* <li>DXT1 compressed 64x32 RGB DDS Image with all mipmap levels (64x32 --> 1x1)</li>
* <li>DXT5 compressed 64x32 RGB DDS Image with all mipmap levels (64x32 --> 1x1)</li>
* </ul>
- *
+ *
* @author Michael Esemplare
*
*/
public class TestBug362DDSImageCreateFromData {
-
+
File testDDSImage01Uncompressed;
File testDDSImage02DXT1;
File testDDSImage03DXT5;
-
+
@Before
public void setup() throws Throwable {
testDDSImage01Uncompressed = initFile("test-64x32_uncompressed.dds");
testDDSImage02DXT1 = initFile("test-64x32_DXT1.dds");
testDDSImage03DXT5 = initFile("test-64x32_DXT5.dds");
}
-
+
@After
public void teardown() {
testDDSImage01Uncompressed = null;
testDDSImage02DXT1 = null;
testDDSImage03DXT5 = null;
}
-
- private File initFile(String filename) throws URISyntaxException {
- URLConnection connection = IOUtil.getResource(getClass(), filename);
+
+ private File initFile(final String filename) throws URISyntaxException {
+ final URLConnection connection = IOUtil.getResource(getClass(), filename);
Assert.assertNotNull(connection);
- URL url = connection.getURL();
- File file = new File(url.toURI());
+ final URL url = connection.getURL();
+ final File file = new File(url.toURI());
Assert.assertTrue(file.exists());
return file;
}
-
- private void testImpl(File file) throws IOException {
- DDSImage ddsImage = DDSImage.read(file);
+
+ private void testImpl(final File file) throws IOException {
+ final DDSImage ddsImage = DDSImage.read(file);
Assert.assertNotNull(ddsImage);
- int numMipMaps = ddsImage.getNumMipMaps();
- ByteBuffer[] mipMapArray = new ByteBuffer[numMipMaps];
+ final int numMipMaps = ddsImage.getNumMipMaps();
+ final ByteBuffer[] mipMapArray = new ByteBuffer[numMipMaps];
for (int i=0;i<numMipMaps;i++){
- ImageInfo info = ddsImage.getMipMap(i);
+ final ImageInfo info = ddsImage.getMipMap(i);
mipMapArray[i] = info.getData();
}
- DDSImage newImage = DDSImage.createFromData(ddsImage.getPixelFormat(), ddsImage.getWidth(), ddsImage.getHeight(), mipMapArray);
+ final DDSImage newImage = DDSImage.createFromData(ddsImage.getPixelFormat(), ddsImage.getWidth(), ddsImage.getHeight(), mipMapArray);
Assert.assertNotNull(newImage);
}
-
+
@Test
public void test00_DDSImage_CreateFromData_Uncompressed_RGB () throws IOException {
testImpl(testDDSImage01Uncompressed);
}
-
+
@Test
public void test01_DDSImage_CreateFromData_DXT1_RGB () throws IOException {
testImpl(testDDSImage02DXT1);
}
-
+
@Test
public void test02_DDSImage_CreateFromData_DXT5_RGB () throws IOException {
testImpl(testDDSImage03DXT5);
}
-
- public static void main(String[] args) {
+
+ public static void main(final String[] args) {
org.junit.runner.JUnitCore.main(TestBug362DDSImageCreateFromData.class.getName());
}
} \ No newline at end of file
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.java
index 679f0692b..2eb8b45c3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -50,14 +50,14 @@ import com.jogamp.opengl.util.texture.TextureIO;
public class TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT extends UITestCase {
static long durationPerTest = 60; // ms
- public static void main(String[] args) {
+ public static void main(final String[] args) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atoi(args[++i], 500);
}
}
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.class.getName();
+ final String tstname = TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
@@ -95,28 +95,28 @@ public class TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT extends UITestC
testImpl(true, true, false, true);
}
- private void testImpl(final boolean alphaCaps, final boolean readAlpha, boolean pbuffer, boolean fbo) throws InterruptedException {
+ private void testImpl(final boolean alphaCaps, final boolean readAlpha, final boolean pbuffer, final boolean fbo) throws InterruptedException {
final GLReadBufferUtil screenshot = new GLReadBufferUtil(readAlpha ? true : false, false);
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
- caps.setAlphaBits( alphaCaps ? 1 : 0 );
+ caps.setAlphaBits( alphaCaps ? 1 : 0 );
caps.setPBuffer( pbuffer );
caps.setFBO( fbo);
-
+
final GLWindow window = GLWindow.create(caps);
window.addGLEventListener(new GearsES2());
window.addGLEventListener(new GLEventListener() {
int displayCount = 0;
- public void init(GLAutoDrawable drawable) {}
- public void dispose(GLAutoDrawable drawable) {}
- public void display(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {
final GLPixelBufferProvider pixelBufferProvider = screenshot.getPixelBufferProvider();
final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(drawable.getGL(), readAlpha ? 4 : 3);
System.err.println("GLPixelAttributes: "+pixelAttribs);
snapshot(displayCount++, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
window.setSize(512, 512);
window.setVisible(true);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01AWT.java
index 21987c504..e3be8ce33 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.util.texture;
import java.awt.Dimension;
@@ -71,10 +71,10 @@ public class TestGLReadBufferUtilTextureIOWrite01AWT extends UITestCase {
height = 256;
}
- protected void testWritePNG_Impl(boolean offscreenLayer) throws InterruptedException {
+ protected void testWritePNG_Impl(final boolean offscreenLayer) throws InterruptedException {
final GLReadBufferUtil screenshotRGB = new GLReadBufferUtil(false, false);
final GLReadBufferUtil screenshotRGBA = new GLReadBufferUtil(true, false);
-
+
if(!offscreenLayer && JAWTUtil.isOffscreenLayerRequired()) {
System.err.println("onscreen layer n/a");
return;
@@ -82,40 +82,40 @@ public class TestGLReadBufferUtilTextureIOWrite01AWT extends UITestCase {
if(offscreenLayer && !JAWTUtil.isOffscreenLayerSupported()) {
System.err.println("offscreen layer n/a");
return;
- }
+ }
final GLCanvas glc = new GLCanvas(caps);
glc.setShallUseOffscreenLayer(offscreenLayer); // trigger offscreen layer - if supported
- Dimension glc_sz = new Dimension(width, height);
+ final Dimension glc_sz = new Dimension(width, height);
glc.setMinimumSize(glc_sz);
glc.setPreferredSize(glc_sz);
final Frame frame = new Frame(getSimpleTestName("."));
Assert.assertNotNull(frame);
frame.add(glc);
-
+
glc.setSize(width, height);
glc.addGLEventListener(new GearsES2(1));
glc.addGLEventListener(new GLEventListener() {
int f = 0;
- public void init(GLAutoDrawable drawable) {}
- public void dispose(GLAutoDrawable drawable) {}
- public void display(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {
snapshot(f, null, drawable.getGL(), screenshotRGBA, TextureIO.PNG, null);
snapshot(f, null, drawable.getGL(), screenshotRGB, TextureIO.PNG, null);
f++;
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
-
- Animator animator = new Animator(glc);
+
+ final Animator animator = new Animator(glc);
animator.setUpdateFPSFrames(60, null);
-
+
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.pack();
frame.setVisible(true);
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -128,7 +128,7 @@ public class TestGLReadBufferUtilTextureIOWrite01AWT extends UITestCase {
while(animator.getTotalFPSFrames() < 2) {
Thread.sleep(60);
}
-
+
animator.stop();
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -137,23 +137,23 @@ public class TestGLReadBufferUtilTextureIOWrite01AWT extends UITestCase {
frame.remove(glc);
frame.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
- }
+ }
}
@Test
public void testOnscreenWritePNG() throws InterruptedException {
testWritePNG_Impl(false);
}
-
+
@Test
public void testOffscreenWritePNG() throws InterruptedException {
testWritePNG_Impl(true);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestGLReadBufferUtilTextureIOWrite01AWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01NEWT.java
index 521e89a8b..a10870635 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.util.texture;
import com.jogamp.newt.opengl.GLWindow;
@@ -68,56 +68,56 @@ public class TestGLReadBufferUtilTextureIOWrite01NEWT extends UITestCase {
public void testOnscreenWritePNG_TGA_PAM() throws InterruptedException {
final GLReadBufferUtil screenshotRGB = new GLReadBufferUtil(false, false);
final GLReadBufferUtil screenshotRGBA = new GLReadBufferUtil(true, false);
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle("Shared Gears NEWT Test");
glWindow.setSize(width, height);
glWindow.addGLEventListener(new GearsES2(1));
glWindow.addGLEventListener(new GLEventListener() {
int f = 0;
- public void init(GLAutoDrawable drawable) {}
- public void dispose(GLAutoDrawable drawable) {}
- public void display(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {
snapshot(f++, null, drawable.getGL(), screenshotRGBA, TextureIO.PNG, null);
- snapshot(f++, null, drawable.getGL(), screenshotRGB, TextureIO.PNG, null);
+ snapshot(f++, null, drawable.getGL(), screenshotRGB, TextureIO.PNG, null);
snapshot(f++, null, drawable.getGL(), screenshotRGBA, TextureIO.TGA, null);
- snapshot(f++, null, drawable.getGL(), screenshotRGB, TextureIO.TGA, null);
+ snapshot(f++, null, drawable.getGL(), screenshotRGB, TextureIO.TGA, null);
snapshot(f++, null, drawable.getGL(), screenshotRGBA, TextureIO.PAM, null);
- snapshot(f++, null, drawable.getGL(), screenshotRGB, TextureIO.PAM, null);
+ snapshot(f++, null, drawable.getGL(), screenshotRGB, TextureIO.PAM, null);
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
glWindow.setVisible(true);
Thread.sleep(60);
- glWindow.destroy();
+ glWindow.destroy();
}
@Test
public void testOffscreenWritePNG() throws InterruptedException {
final GLReadBufferUtil screenshotRGB = new GLReadBufferUtil(false, false);
final GLReadBufferUtil screenshotRGBA = new GLReadBufferUtil(true, false);
- final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, true, false);
- GLWindow glWindow = GLWindow.create(caps2);
+ final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, true, false);
+ final GLWindow glWindow = GLWindow.create(caps2);
Assert.assertNotNull(glWindow);
glWindow.setSize(width, height);
glWindow.addGLEventListener(new GearsES2(1));
glWindow.addGLEventListener(new GLEventListener() {
int f = 0;
- public void init(GLAutoDrawable drawable) {}
- public void dispose(GLAutoDrawable drawable) {}
- public void display(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {
snapshot(f, null, drawable.getGL(), screenshotRGBA, TextureIO.PNG, null);
snapshot(f, null, drawable.getGL(), screenshotRGB, TextureIO.PNG, null);
f++;
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
glWindow.setVisible(true);
Thread.sleep(60);
- glWindow.destroy();
+ glWindow.destroy();
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestGLReadBufferUtilTextureIOWrite01NEWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02AWT.java
index 712748d49..8be3fb24b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.util.texture;
import java.awt.Dimension;
@@ -72,7 +72,7 @@ public class TestGLReadBufferUtilTextureIOWrite02AWT extends UITestCase {
height = 64;
}
- protected void testWritePNGWithResizeImpl(boolean offscreenLayer) throws InterruptedException {
+ protected void testWritePNGWithResizeImpl(final boolean offscreenLayer) throws InterruptedException {
if(!offscreenLayer && JAWTUtil.isOffscreenLayerRequired()) {
System.err.println("onscreen layer n/a");
return;
@@ -80,24 +80,24 @@ public class TestGLReadBufferUtilTextureIOWrite02AWT extends UITestCase {
if(offscreenLayer && !JAWTUtil.isOffscreenLayerSupported()) {
System.err.println("offscreen layer n/a");
return;
- }
+ }
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
final GLCanvas glc = new GLCanvas(caps);
glc.setShallUseOffscreenLayer(offscreenLayer); // trigger offscreen layer - if supported
- Dimension glc_sz = new Dimension(width, height);
+ final Dimension glc_sz = new Dimension(width, height);
glc.setMinimumSize(glc_sz);
glc.setPreferredSize(glc_sz);
glc.setSize(glc_sz);
final Frame frame = new Frame(getSimpleTestName("."));
Assert.assertNotNull(frame);
frame.add(glc);
-
+
glc.addGLEventListener(new GearsES2(1));
glc.addGLEventListener(new GLEventListener() {
int i=0, fw_old=0, dw_old=0, c=0;
- public void init(GLAutoDrawable drawable) {}
- public void dispose(GLAutoDrawable drawable) {}
- public void display(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {
final int fw = frame.getWidth();
final int fh = frame.getHeight();
final int dw = drawable.getSurfaceWidth();
@@ -110,7 +110,7 @@ public class TestGLReadBufferUtilTextureIOWrite02AWT extends UITestCase {
} else {
snap = false;
}
-
+
if(snap) {
System.err.println("XXX: ["+fw_old+", "+dw_old+"], "+fw+"x"+fh+", "+dw+"x"+dh+", sz_changed "+sz_changed+", snap "+snap);
c=0;
@@ -128,19 +128,19 @@ public class TestGLReadBufferUtilTextureIOWrite02AWT extends UITestCase {
} }, glc.getTreeLock());
}
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
-
- Animator animator = new Animator(glc);
+
+ final Animator animator = new Animator(glc);
animator.setUpdateFPSFrames(60, null);
-
+
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.pack();
frame.setVisible(true);
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -153,7 +153,7 @@ public class TestGLReadBufferUtilTextureIOWrite02AWT extends UITestCase {
while(animator.getTotalFPSFrames() < 30) {
Thread.sleep(60);
}
-
+
animator.stop();
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -162,23 +162,23 @@ public class TestGLReadBufferUtilTextureIOWrite02AWT extends UITestCase {
frame.remove(glc);
frame.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
- }
+ }
}
@Test
public void testOnscreenWritePNGWithResize() throws InterruptedException {
testWritePNGWithResizeImpl(false);
}
-
+
@Test
public void testOffscreenWritePNGWithResize() throws InterruptedException {
testWritePNGWithResizeImpl(true);
}
-
- public static void main(String args[]) {
+
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestGLReadBufferUtilTextureIOWrite02AWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02NEWT.java
index c52680dc3..cfae6f0df 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.util.texture;
import com.jogamp.newt.opengl.GLWindow;
@@ -66,7 +66,7 @@ public class TestGLReadBufferUtilTextureIOWrite02NEWT extends UITestCase {
height = 64;
}
- private void testWritePNGWithResizeImpl(boolean offscreen) throws InterruptedException {
+ private void testWritePNGWithResizeImpl(final boolean offscreen) throws InterruptedException {
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
final GLCapabilities caps2 = offscreen ? WindowUtilNEWT.fixCaps(caps, false, true, false) : caps;
final GLWindow glWindow = GLWindow.create(caps2);
@@ -76,13 +76,13 @@ public class TestGLReadBufferUtilTextureIOWrite02NEWT extends UITestCase {
glWindow.addGLEventListener(new GearsES2(1));
glWindow.addGLEventListener(new GLEventListener() {
int i=0, dw_old=0, c=0;
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
System.err.println("XXX: init");
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
System.err.println("XXX: dispose");
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
final int dw = drawable.getSurfaceWidth();
final int dh = drawable.getSurfaceHeight();
final boolean sz_changed = dw_old != dw && dw <= 512;
@@ -93,35 +93,35 @@ public class TestGLReadBufferUtilTextureIOWrite02NEWT extends UITestCase {
} else {
snap = false;
}
-
+
if(snap) {
System.err.println("XXX: ["+dw_old+"], "+dw+"x"+dh+", sz_changed "+sz_changed+", snap "+snap);
c=0;
snapshot(i++, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
dw_old = dw;
- new Thread() {
+ new Thread() {
@Override
public void run() {
- glWindow.setSize(2*dw, 2*dh);
+ glWindow.setSize(2*dw, 2*dh);
} }.start();
}
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
- Animator animator = new Animator(glWindow);
+ final Animator animator = new Animator(glWindow);
animator.setUpdateFPSFrames(60, null);
-
+
glWindow.setVisible(true);
animator.start();
-
+
while(animator.getTotalFPSFrames() < 50) {
Thread.sleep(60);
}
-
+
animator.stop();
- glWindow.destroy();
+ glWindow.destroy();
}
-
+
@Test
public void testOnscreenWritePNGWithResize() throws InterruptedException {
testWritePNGWithResizeImpl(false);
@@ -132,7 +132,7 @@ public class TestGLReadBufferUtilTextureIOWrite02NEWT extends UITestCase {
testWritePNGWithResizeImpl(true);
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestGLReadBufferUtilTextureIOWrite02NEWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGImage01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGImage01NEWT.java
index c92174a77..156ca20a1 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGImage01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGImage01NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -65,29 +65,29 @@ import javax.media.opengl.GL;
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestJPEGImage01NEWT extends UITestCase {
-
+
static boolean showFPS = false;
static long duration = 100; // ms
-
+
public void testImpl(final InputStream istream) throws InterruptedException, IOException {
final JPEGImage image = JPEGImage.read(istream);
Assert.assertNotNull(image);
final boolean hasAlpha = 4 == image.getBytesPerPixel();
System.err.println("JPEGImage: "+image+", hasAlpha "+hasAlpha);
-
+
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
final GLProfile glp = GLProfile.getGL2ES2();
final GLCapabilities caps = new GLCapabilities(glp);
if( hasAlpha ) {
caps.setAlphaBits(1);
}
-
+
final int internalFormat;
if(glp.isGL2ES3()) {
internalFormat = hasAlpha ? GL.GL_RGBA8 : GL.GL_RGB8;
} else {
internalFormat = hasAlpha ? GL.GL_RGBA : GL.GL_RGB;
- }
+ }
final TextureData texData = new TextureData(glp, internalFormat,
image.getWidth(),
image.getHeight(),
@@ -99,37 +99,37 @@ public class TestJPEGImage01NEWT extends UITestCase {
image.getData(),
null);
// final TextureData texData = TextureIO.newTextureData(glp, istream, false /* mipmap */, TextureIO.JPG);
- System.err.println("TextureData: "+texData);
-
+ System.err.println("TextureData: "+texData);
+
final GLWindow glad = GLWindow.create(caps);
glad.setTitle("TestJPEGImage01NEWT");
// Size OpenGL to Video Surface
glad.setSize(texData.getWidth(), texData.getHeight());
-
+
// load texture from file inside current GL context to match the way
// the bug submitter was doing it
final GLEventListener gle = new TextureDraw01ES2Listener( texData, 0 ) ;
glad.addGLEventListener(gle);
- glad.addGLEventListener(new GLEventListener() {
+ glad.addGLEventListener(new GLEventListener() {
boolean shot = false;
-
- @Override public void init(GLAutoDrawable drawable) {}
-
- public void display(GLAutoDrawable drawable) {
+
+ @Override public void init(final GLAutoDrawable drawable) {}
+
+ public void display(final GLAutoDrawable drawable) {
// 1 snapshot
if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
shot = true;
snapshot(0, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
}
}
-
- @Override public void dispose(GLAutoDrawable drawable) { }
- @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+
+ @Override public void dispose(final GLAutoDrawable drawable) { }
+ @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
- Animator animator = new Animator(glad);
+ final Animator animator = new Animator(glad);
animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
glad.addKeyListener(quitAdapter);
glad.addWindowListener(quitAdapter);
glad.setVisible(true);
@@ -138,11 +138,11 @@ public class TestJPEGImage01NEWT extends UITestCase {
while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
Thread.sleep(100);
}
-
+
animator.stop();
glad.destroy();
}
-
+
@Test
public void testReadES2_RGBn() throws InterruptedException, IOException, MalformedURLException {
final String fname = null == _fname ? "test-ntscN_3-01-160x90-90pct-yuv444-base.jpg" : _fname;
@@ -151,7 +151,7 @@ public class TestJPEGImage01NEWT extends UITestCase {
}
static String _fname = null;
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTBenchmarkNewtAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTBenchmarkNewtAWT.java
index bd2488e26..7c11d7275 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTBenchmarkNewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTBenchmarkNewtAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.util.texture;
@@ -60,7 +60,7 @@ public class TestJPEGJoglAWTBenchmarkNewtAWT extends UITestCase {
public void benchmark() throws IOException {
benchmarkImpl(100, fname);
}
- void benchmarkImpl(int loops, String fname) throws IOException {
+ void benchmarkImpl(final int loops, final String fname) throws IOException {
{
final long t0 = System.currentTimeMillis();
for(int i = 0; i< loops; i++ ) {
@@ -124,15 +124,15 @@ public class TestJPEGJoglAWTBenchmarkNewtAWT extends UITestCase {
final InputStream istream = urlConn.getInputStream();
Buffer data = null;
try {
- BufferedImage img = ImageIO.read(istream);
- AWTTextureData texData = new AWTTextureData(GLProfile.getGL2ES2(), 0, 0, false, img);
+ final BufferedImage img = ImageIO.read(istream);
+ final AWTTextureData texData = new AWTTextureData(GLProfile.getGL2ES2(), 0, 0, false, img);
data = texData.getBuffer(); // completes data conversion !!!
if(0==i || loops-1==i) {
System.err.println(i+": "+texData+", buffer "+data);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
System.err.println("AWT ImageIO failure w/ file "+fname+": "+e.getMessage());
- }
+ }
istream.close();
}
final long t1 = System.currentTimeMillis();
@@ -141,14 +141,14 @@ public class TestJPEGJoglAWTBenchmarkNewtAWT extends UITestCase {
System.err.println("AWT..... Loops "+loops+", dt "+dt+" ms, "+msPl+" ms/l");
}
}
-
- public static void main(String args[]) throws IOException {
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-file")) {
i++;
fname = args[i];
}
}
- org.junit.runner.JUnitCore.main(TestJPEGJoglAWTBenchmarkNewtAWT.class.getName());
+ org.junit.runner.JUnitCore.main(TestJPEGJoglAWTBenchmarkNewtAWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTCompareNewtAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTCompareNewtAWT.java
index 7079e07bf..067ee9d67 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTCompareNewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTCompareNewtAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.util.texture;
@@ -66,7 +66,7 @@ import org.junit.runners.MethodSorters;
public class TestJPEGJoglAWTCompareNewtAWT extends UITestCase {
static boolean showFPS = false;
static long duration = 100; // ms
-
+
String[] files = { "test-ntscN_3-01-160x90-90pct-yuv444-base.jpg", // 0
"test-ntscN_3-01-160x90-90pct-yuv444-prog.jpg", // 1
"test-ntscN_3-01-160x90-60pct-yuv422h-base.jpg", // 2
@@ -79,14 +79,14 @@ public class TestJPEGJoglAWTCompareNewtAWT extends UITestCase {
void testImpl(final String fname) throws InterruptedException, IOException {
final Animator animator = new Animator();
-
+
final GLWindow w1 = testJOGLJpeg(fname);
final GLWindow w2 = testAWTJpeg(fname, w1.getSurfaceWidth() + 50);
-
+
animator.add(w1);
animator.add(w2);
animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
w1.setVisible(true);
w2.setVisible(true);
animator.start();
@@ -94,23 +94,23 @@ public class TestJPEGJoglAWTCompareNewtAWT extends UITestCase {
while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
Thread.sleep(100);
}
-
+
animator.stop();
w1.destroy();
- w2.destroy();
+ w2.destroy();
}
-
+
GLWindow testJOGLJpeg(final String fname) throws InterruptedException, IOException {
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), fname);
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), fname);
Assert.assertNotNull(testTextureUrlConn);
- InputStream istream = testTextureUrlConn.getInputStream();
+ final InputStream istream = testTextureUrlConn.getInputStream();
Assert.assertNotNull(istream);
-
+
final JPEGImage image = JPEGImage.read(istream);
Assert.assertNotNull(image);
System.err.println("JPEGImage: "+image);
-
- GLProfile glp = GLProfile.getGL2ES2();
+
+ final GLProfile glp = GLProfile.getGL2ES2();
final int internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA:GL.GL_RGB;
final TextureData texData = new TextureData(glp, internalFormat,
image.getWidth(),
@@ -124,71 +124,71 @@ public class TestJPEGJoglAWTCompareNewtAWT extends UITestCase {
null);
// final TextureData texData = TextureIO.newTextureData(glp, istream, false /* mipmap */, TextureIO.JPG);
System.err.println("TextureData: "+texData);
-
+
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(1);
-
+
final GLWindow glad1 = GLWindow.create(caps);
glad1.setTitle("JPEG JOGL");
// Size OpenGL to Video Surface
glad1.setSize(texData.getWidth(), texData.getHeight());
glad1.setPosition(0, 0);
-
+
// load texture from file inside current GL context to match the way
// the bug submitter was doing it
final GLEventListener gle = new TextureDraw01ES2Listener( texData, 0 ) ;
glad1.addGLEventListener(gle);
- glad1.addGLEventListener(new GLEventListener() {
+ glad1.addGLEventListener(new GLEventListener() {
boolean shot = false;
-
- @Override public void init(GLAutoDrawable drawable) {}
-
- public void display(GLAutoDrawable drawable) {
+
+ @Override public void init(final GLAutoDrawable drawable) {}
+
+ public void display(final GLAutoDrawable drawable) {
// 1 snapshot
if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
shot = true;
snapshot(0, "JoglJPEG", drawable.getGL(), screenshot, TextureIO.PNG, null);
}
}
-
- @Override public void dispose(GLAutoDrawable drawable) { }
- @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+
+ @Override public void dispose(final GLAutoDrawable drawable) { }
+ @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
return glad1;
}
-
- GLWindow testAWTJpeg(final String fname, int xpos) throws InterruptedException, IOException {
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), fname);
+
+ GLWindow testAWTJpeg(final String fname, final int xpos) throws InterruptedException, IOException {
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), fname);
Assert.assertNotNull(testTextureUrlConn);
- InputStream istream = testTextureUrlConn.getInputStream();
+ final InputStream istream = testTextureUrlConn.getInputStream();
Assert.assertNotNull(istream);
-
- GLProfile glp = GLProfile.getGL2ES2();
+
+ final GLProfile glp = GLProfile.getGL2ES2();
TextureData texData = null;
int w = 300, h = 300;
try {
- BufferedImage img = ImageIO.read(istream);
+ final BufferedImage img = ImageIO.read(istream);
texData = new AWTTextureData(glp, 0, 0, false, img);
System.err.println("TextureData: "+texData);
w = texData.getWidth();
h = texData.getHeight();
- } catch (Exception e) {
+ } catch (final Exception e) {
System.err.println("AWT ImageIO failure w/ file "+fname+": "+e.getMessage());
// e.printStackTrace(); // : CMYK, YCCK -> com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown Source)
- }
-
+ }
+
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(1);
-
+
final GLWindow glad1 = GLWindow.create(caps);
glad1.setTitle("JPEG AWT");
// Size OpenGL to Video Surface
glad1.setSize(w, h);
glad1.setPosition(xpos, 0);
-
+
// load texture from file inside current GL context to match the way
// the bug submitter was doing it
final GLEventListener gle;
@@ -198,73 +198,73 @@ public class TestJPEGJoglAWTCompareNewtAWT extends UITestCase {
} else {
gle = null;
}
- glad1.addGLEventListener(new GLEventListener() {
+ glad1.addGLEventListener(new GLEventListener() {
boolean shot = false;
-
- @Override public void init(GLAutoDrawable drawable) {}
-
- public void display(GLAutoDrawable drawable) {
+
+ @Override public void init(final GLAutoDrawable drawable) {}
+
+ public void display(final GLAutoDrawable drawable) {
// 1 snapshot
if( null!=gle && null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
shot = true;
snapshot(0, "AWTJPEG", drawable.getGL(), screenshot, TextureIO.PNG, null);
}
}
-
- @Override public void dispose(GLAutoDrawable drawable) { }
- @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+
+ @Override public void dispose(final GLAutoDrawable drawable) { }
+ @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
return glad1;
}
-
+
@Test
public void test01YUV444Base__ES2() throws InterruptedException, IOException {
- testImpl(files[0]);
- }
+ testImpl(files[0]);
+ }
@Test
public void test01YUV444Prog__ES2() throws InterruptedException, IOException {
- testImpl(files[1]);
- }
-
+ testImpl(files[1]);
+ }
+
@Test
public void test01YUV422hBase__ES2() throws InterruptedException, IOException {
- testImpl(files[2]);
- }
+ testImpl(files[2]);
+ }
@Test
public void test01YUV422hProg_ES2() throws InterruptedException, IOException {
- testImpl(files[3]);
- }
-
+ testImpl(files[3]);
+ }
+
@Test
public void test02YUV420Base__ES2() throws InterruptedException, IOException {
- testImpl(files[4]);
- }
+ testImpl(files[4]);
+ }
@Test
public void test02YUV420Prog_ES2() throws InterruptedException, IOException {
- testImpl(files[5]);
- }
+ testImpl(files[5]);
+ }
@Test
public void test02YUV420BaseGray_ES2() throws InterruptedException, IOException {
- testImpl(files[6]);
- }
+ testImpl(files[6]);
+ }
@Test
public void test03CMYK_01_ES2() throws InterruptedException, IOException {
- testImpl(files[7]);
- }
+ testImpl(files[7]);
+ }
@Test
public void test03YCCK_01_ES2() throws InterruptedException, IOException {
- testImpl(files[8]);
- }
-
- public static void main(String args[]) throws IOException {
+ testImpl(files[8]);
+ }
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
duration = MiscUtils.atol(args[i], duration);
}
}
- org.junit.runner.JUnitCore.main(TestJPEGJoglAWTCompareNewtAWT.class.getName());
+ org.junit.runner.JUnitCore.main(TestJPEGJoglAWTCompareNewtAWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGTextureFromFileNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGTextureFromFileNEWT.java
index 60855e5be..565434e2e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGTextureFromFileNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGTextureFromFileNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.util.texture;
@@ -63,87 +63,87 @@ import org.junit.runners.MethodSorters;
public class TestJPEGTextureFromFileNEWT extends UITestCase {
static boolean showFPS = false;
static long duration = 100; // ms
-
+
InputStream testTextureStream01YUV444_Base;
InputStream testTextureStream01YUV444_Prog;
-
+
InputStream testTextureStream01YUV422h_Base;
InputStream testTextureStream01YUV422h_Prog;
-
+
InputStream testTextureStream02YUV420_Base;
InputStream testTextureStream02YUV420_Prog;
InputStream testTextureStream02YUV420_BaseGray;
-
+
InputStream testTextureStream03CMYK_01;
InputStream testTextureStream03YCCK_01;
-
+
InputStream testTextureStream04QTTDefPostFrame;
-
+
@Before
public void initTest() throws IOException {
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-90pct-yuv444-base.jpg");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-90pct-yuv444-base.jpg");
Assert.assertNotNull(testTextureUrlConn);
testTextureStream01YUV444_Base = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStream01YUV444_Base);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-90pct-yuv444-prog.jpg");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-90pct-yuv444-prog.jpg");
Assert.assertNotNull(testTextureUrlConn);
testTextureStream01YUV444_Prog = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStream01YUV444_Prog);
- }
+ }
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-60pct-yuv422h-base.jpg");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-60pct-yuv422h-base.jpg");
Assert.assertNotNull(testTextureUrlConn);
testTextureStream01YUV422h_Base = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStream01YUV422h_Base);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-60pct-yuv422h-prog.jpg");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-60pct-yuv422h-prog.jpg");
Assert.assertNotNull(testTextureUrlConn);
testTextureStream01YUV422h_Prog = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStream01YUV422h_Prog);
}
-
+
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "j1-baseline.jpg");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "j1-baseline.jpg");
Assert.assertNotNull(testTextureUrlConn);
testTextureStream02YUV420_Base = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStream02YUV420_Base);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "j2-progressive.jpg");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "j2-progressive.jpg");
Assert.assertNotNull(testTextureUrlConn);
testTextureStream02YUV420_Prog = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStream02YUV420_Prog);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "j3-baseline_gray.jpg");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "j3-baseline_gray.jpg");
Assert.assertNotNull(testTextureUrlConn);
testTextureStream02YUV420_BaseGray = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStream02YUV420_BaseGray);
}
-
+
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-cmyk-01.jpg");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-cmyk-01.jpg");
Assert.assertNotNull(testTextureUrlConn);
testTextureStream03CMYK_01 = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStream03CMYK_01);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ycck-01.jpg");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ycck-01.jpg");
Assert.assertNotNull(testTextureUrlConn);
testTextureStream03YCCK_01 = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStream03YCCK_01);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "bug745_qttdef_post_frame.jpg");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "bug745_qttdef_post_frame.jpg");
Assert.assertNotNull(testTextureUrlConn);
testTextureStream04QTTDefPostFrame = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStream04QTTDefPostFrame);
}
-
+
}
@After
@@ -156,11 +156,11 @@ public class TestJPEGTextureFromFileNEWT extends UITestCase {
testTextureStream02YUV420_Prog = null;
testTextureStream02YUV420_BaseGray = null;
testTextureStream03CMYK_01 = null;
- testTextureStream03YCCK_01 = null;
+ testTextureStream03YCCK_01 = null;
testTextureStream04QTTDefPostFrame = null;
}
- public void testImpl(boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
+ public void testImpl(final boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
GLProfile glp;
if(useFFP && GLProfile.isAvailable(GLProfile.GL2)) {
@@ -173,39 +173,39 @@ public class TestJPEGTextureFromFileNEWT extends UITestCase {
}
final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(1);
-
+
final TextureData texData = TextureIO.newTextureData(glp, istream, false /* mipmap */, TextureIO.JPG);
- System.err.println("TextureData: "+texData);
-
+ System.err.println("TextureData: "+texData);
+
final GLWindow glad = GLWindow.create(caps);
glad.setTitle("TestPNGTextureGL2FromFileNEWT");
// Size OpenGL to Video Surface
glad.setSize(texData.getWidth(), texData.getHeight());
-
+
// load texture from file inside current GL context to match the way
// the bug submitter was doing it
final GLEventListener gle = useFFP ? new TextureDraw01GL2Listener( texData ) : new TextureDraw01ES2Listener( texData, 0 ) ;
glad.addGLEventListener(gle);
- glad.addGLEventListener(new GLEventListener() {
+ glad.addGLEventListener(new GLEventListener() {
boolean shot = false;
-
- @Override public void init(GLAutoDrawable drawable) {}
-
- public void display(GLAutoDrawable drawable) {
+
+ @Override public void init(final GLAutoDrawable drawable) {}
+
+ public void display(final GLAutoDrawable drawable) {
// 1 snapshot
if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
shot = true;
snapshot(0, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
}
}
-
- @Override public void dispose(GLAutoDrawable drawable) { }
- @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+
+ @Override public void dispose(final GLAutoDrawable drawable) { }
+ @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
- Animator animator = new Animator(glad);
+ final Animator animator = new Animator(glad);
animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
glad.addKeyListener(quitAdapter);
glad.addWindowListener(quitAdapter);
glad.setVisible(true);
@@ -214,71 +214,71 @@ public class TestJPEGTextureFromFileNEWT extends UITestCase {
while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
Thread.sleep(100);
}
-
+
animator.stop();
glad.destroy();
}
-
+
@Test
public void test01YUV444Base__GL2() throws InterruptedException, IOException {
- testImpl(true, testTextureStream01YUV444_Base);
- }
+ testImpl(true, testTextureStream01YUV444_Base);
+ }
@Test
public void test01YUV444Base__ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStream01YUV444_Base);
- }
+ testImpl(false, testTextureStream01YUV444_Base);
+ }
@Test
public void test01YUV444Prog__GL2() throws InterruptedException, IOException {
- testImpl(true, testTextureStream01YUV444_Prog);
- }
+ testImpl(true, testTextureStream01YUV444_Prog);
+ }
@Test
public void test01YUV444Prog__ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStream01YUV444_Prog);
- }
-
+ testImpl(false, testTextureStream01YUV444_Prog);
+ }
+
@Test
public void test01YUV422hBase__ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStream01YUV422h_Base);
- }
+ testImpl(false, testTextureStream01YUV422h_Base);
+ }
@Test
public void test01YUV422hProg_ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStream01YUV422h_Prog);
- }
-
+ testImpl(false, testTextureStream01YUV422h_Prog);
+ }
+
@Test
public void test02YUV420Base__ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStream02YUV420_Base);
- }
+ testImpl(false, testTextureStream02YUV420_Base);
+ }
@Test
public void test02YUV420Prog_ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStream02YUV420_Prog);
- }
+ testImpl(false, testTextureStream02YUV420_Prog);
+ }
@Test
public void test02YUV420BaseGray_ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStream02YUV420_BaseGray);
+ testImpl(false, testTextureStream02YUV420_BaseGray);
}
@Test
public void test03CMYK_01_ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStream03CMYK_01);
- }
+ testImpl(false, testTextureStream03CMYK_01);
+ }
@Test
public void test03YCCK_01_ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStream03YCCK_01);
- }
+ testImpl(false, testTextureStream03YCCK_01);
+ }
@Test
public void test04QTTDefPostFrame_ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStream04QTTDefPostFrame);
- }
-
- public static void main(String args[]) throws IOException {
+ testImpl(false, testTextureStream04QTTDefPostFrame);
+ }
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
duration = MiscUtils.atol(args[i], duration);
}
}
- org.junit.runner.JUnitCore.main(TestJPEGTextureFromFileNEWT.class.getName());
+ org.junit.runner.JUnitCore.main(TestJPEGTextureFromFileNEWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect00NEWT.java
index c2b39f0f3..8f63a4f4c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect00NEWT.java
@@ -128,7 +128,7 @@ public class TestPNGPixelRect00NEWT extends UITestCase {
final File out2F_f=new File(getSimpleTestName(".")+"-02-"+basename+"-flipped.png");
final File out2R_f=new File(getSimpleTestName(".")+"-03-"+basename+"-reversed.png");
final File out2RF_f=new File(getSimpleTestName(".")+"-04-"+basename+"-reversed_flipped.png");
- URLConnection urlConn = IOUtil.getResource(this.getClass(), pathname+basename+".png");
+ final URLConnection urlConn = IOUtil.getResource(this.getClass(), pathname+basename+".png");
if( null == urlConn ) {
throw new IOException("Cannot find "+pathname+basename+".png");
}
@@ -205,7 +205,7 @@ public class TestPNGPixelRect00NEWT extends UITestCase {
System.err.println("Test02: "+pathname+basename+".png, destFmt "+destFmt+", destMinStrideInBytes "+destMinStrideInBytes+", destIsGLOriented "+destIsGLOriented);
final File out1_f=new File(getSimpleTestName(".")+"-"+basename+"-orig.png");
- URLConnection urlConn = IOUtil.getResource(this.getClass(), pathname+basename+".png");
+ final URLConnection urlConn = IOUtil.getResource(this.getClass(), pathname+basename+".png");
final PNGPixelRect image1 = PNGPixelRect.read(urlConn.getInputStream(), destFmt, false /* directBuffer */, destMinStrideInBytes, destIsGLOriented);
System.err.println("PNGPixelRect - Orig: "+image1);
@@ -220,7 +220,7 @@ public class TestPNGPixelRect00NEWT extends UITestCase {
}
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestPNGPixelRect00NEWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect01NEWT.java
index 3b1d9fbb0..4a324f594 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect01NEWT.java
@@ -117,12 +117,12 @@ public class TestPNGPixelRect01NEWT extends UITestCase {
glad.addGLEventListener(new GLEventListener() {
boolean shot = false;
- @Override public void init(GLAutoDrawable drawable) {
+ @Override public void init(final GLAutoDrawable drawable) {
System.err.println("Chosen Caps: " + drawable.getChosenGLCapabilities());
System.err.println("GL ctx: " + drawable.getGL().getContext());
}
- @Override public void display(GLAutoDrawable drawable) {
+ @Override public void display(final GLAutoDrawable drawable) {
// 1 snapshot
if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
shot = true;
@@ -130,13 +130,13 @@ public class TestPNGPixelRect01NEWT extends UITestCase {
}
}
- @Override public void dispose(GLAutoDrawable drawable) { }
- @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ @Override public void dispose(final GLAutoDrawable drawable) { }
+ @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
- Animator animator = new Animator(glad);
+ final Animator animator = new Animator(glad);
animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
glad.addKeyListener(quitAdapter);
glad.addWindowListener(quitAdapter);
glad.setVisible(true);
@@ -192,7 +192,7 @@ public class TestPNGPixelRect01NEWT extends UITestCase {
}
static String _fname = null;
- public static void main(String args[]) {
+ public static void main(final String args[]) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileAWT.java
index 7ea053a86..bbcd04454 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileAWT.java
@@ -86,7 +86,7 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
grayTextureStream = TestPNGTextureFromFileAWT.class.getResourceAsStream( "grayscale_texture.png" );
Assert.assertNotNull(grayTextureStream);
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90.png");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
testTextureStream = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStream);
@@ -99,7 +99,7 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
testTextureStream = null;
}
- public void testImpl(boolean useFFP, final InputStream istream, final boolean useAWTIIOP)
+ public void testImpl(final boolean useFFP, final InputStream istream, final boolean useAWTIIOP)
throws InterruptedException, IOException
{
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
@@ -123,7 +123,7 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
System.err.println("TextureData: "+texData);
final GLCanvas glc = new GLCanvas(caps);
- Dimension glc_sz = new Dimension(texData.getWidth(), texData.getHeight());
+ final Dimension glc_sz = new Dimension(texData.getWidth(), texData.getHeight());
glc.setMinimumSize(glc_sz);
glc.setPreferredSize(glc_sz);
final Frame frame = new Frame("TestPNGTextureGL2FromFileAWT");
@@ -137,10 +137,10 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
glc.addGLEventListener(new GLEventListener() {
boolean shot = false;
- @Override public void init(GLAutoDrawable drawable) {}
+ @Override public void init(final GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
// 1 snapshot
if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
shot = true;
@@ -148,8 +148,8 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
}
}
- @Override public void dispose(GLAutoDrawable drawable) { }
- @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ @Override public void dispose(final GLAutoDrawable drawable) { }
+ @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
final QuitAdapter quitAdapter = new QuitAdapter();
@@ -162,12 +162,12 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
frame.pack();
frame.setVisible(true);
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
- Animator animator = new Animator(glc);
+ final Animator animator = new Animator(glc);
animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
animator.start();
@@ -183,7 +183,7 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
frame.remove(glc);
frame.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -225,7 +225,7 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
testImpl(false, testTextureStream, false);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java
index ce363b612..bbfc2907f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.util.texture;
@@ -64,16 +64,16 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
static boolean showFPS = false;
static long duration = 100; // ms
InputStream grayTextureStream;
-
+
InputStream testTextureStreamN_3;
InputStream testTextureStreamN_4;
InputStream testTextureStreamNG4;
-
+
InputStream testTextureStreamI_3;
InputStream testTextureStreamIG3;
InputStream testTextureStreamI_4;
InputStream testTextureStreamIG4;
-
+
InputStream testTextureStreamP_3;
InputStream testTextureStreamP_4;
@@ -82,58 +82,58 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
grayTextureStream = TestPNGTextureFromFileNEWT.class.getResourceAsStream( "grayscale_texture.png" );
Assert.assertNotNull(grayTextureStream);
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90.png");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
testTextureStreamN_3 = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStreamN_3);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_4-01-160x90.png");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_4-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
testTextureStreamN_4 = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStreamN_4);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscNG4-01-160x90.png");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscNG4-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
testTextureStreamNG4 = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStreamNG4);
}
-
+
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscI_3-01-160x90.png");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscI_3-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
testTextureStreamI_3 = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStreamI_3);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscIG3-01-160x90.png");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscIG3-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
testTextureStreamIG3 = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStreamIG3);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscI_4-01-160x90.png");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscI_4-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
testTextureStreamI_4 = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStreamI_4);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscIG4-01-160x90.png");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscIG4-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
testTextureStreamIG4 = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStreamIG4);
}
-
-
+
+
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP_3-01-160x90.png");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP_3-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
testTextureStreamP_3 = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStreamP_3);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP_4-01-160x90.png");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP_4-01-160x90.png");
Assert.assertNotNull(testTextureUrlConn);
testTextureStreamP_4 = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStreamP_4);
@@ -150,7 +150,7 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
testTextureStreamP_4 = null;
}
- public void testImpl(boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
+ public void testImpl(final boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
GLProfile glp;
if(useFFP && GLProfile.isAvailable(GLProfile.GL2)) {
@@ -163,39 +163,39 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
}
final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(1);
-
+
final TextureData texData = TextureIO.newTextureData(glp, istream, false /* mipmap */, TextureIO.PNG);
- System.err.println("TextureData: "+texData);
-
+ System.err.println("TextureData: "+texData);
+
final GLWindow glad = GLWindow.create(caps);
glad.setTitle("TestPNGTextureGL2FromFileNEWT");
// Size OpenGL to Video Surface
glad.setSize(texData.getWidth(), texData.getHeight());
-
+
// load texture from file inside current GL context to match the way
// the bug submitter was doing it
final GLEventListener gle = useFFP ? new TextureDraw01GL2Listener( texData ) : new TextureDraw01ES2Listener( texData, 0 ) ;
glad.addGLEventListener(gle);
- glad.addGLEventListener(new GLEventListener() {
+ glad.addGLEventListener(new GLEventListener() {
boolean shot = false;
-
- @Override public void init(GLAutoDrawable drawable) {}
-
- public void display(GLAutoDrawable drawable) {
+
+ @Override public void init(final GLAutoDrawable drawable) {}
+
+ public void display(final GLAutoDrawable drawable) {
// 1 snapshot
if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
shot = true;
snapshot(0, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
}
}
-
- @Override public void dispose(GLAutoDrawable drawable) { }
- @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+
+ @Override public void dispose(final GLAutoDrawable drawable) { }
+ @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
- Animator animator = new Animator(glad);
+ final Animator animator = new Animator(glad);
animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
glad.addKeyListener(quitAdapter);
glad.addWindowListener(quitAdapter);
glad.setVisible(true);
@@ -204,74 +204,74 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
Thread.sleep(100);
}
-
+
animator.stop();
glad.destroy();
}
-
+
@Test
public void testGray__GL2() throws InterruptedException, IOException {
- testImpl(true, grayTextureStream);
- }
+ testImpl(true, grayTextureStream);
+ }
@Test
public void testGray__ES2() throws InterruptedException, IOException {
- testImpl(false, grayTextureStream);
+ testImpl(false, grayTextureStream);
}
-
+
@Test
public void testRGB3__GL2() throws InterruptedException, IOException {
- testImpl(true, testTextureStreamN_3);
- }
+ testImpl(true, testTextureStreamN_3);
+ }
@Test
public void testRGB3__ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamN_3);
- }
+ testImpl(false, testTextureStreamN_3);
+ }
@Test
public void testRGB4__GL2() throws InterruptedException, IOException {
- testImpl(true, testTextureStreamN_4);
- }
+ testImpl(true, testTextureStreamN_4);
+ }
@Test
public void testRGB4__ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamN_4);
- }
+ testImpl(false, testTextureStreamN_4);
+ }
@Test
public void testRGB4G_ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamNG4);
+ testImpl(false, testTextureStreamNG4);
}
-
+
@Test
public void testInterl3__ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamI_3);
- }
+ testImpl(false, testTextureStreamI_3);
+ }
@Test
public void testInterl4__ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamI_4);
+ testImpl(false, testTextureStreamI_4);
}
@Test
public void testInterl3G_ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamIG3);
- }
+ testImpl(false, testTextureStreamIG3);
+ }
@Test
public void testInterl4G_ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamIG4);
+ testImpl(false, testTextureStreamIG4);
}
-
+
@Test
public void testPalette3__ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamP_3);
- }
+ testImpl(false, testTextureStreamP_3);
+ }
@Test
public void testPalette4__ES2() throws InterruptedException, IOException {
- testImpl(false, testTextureStreamP_4);
- }
-
- public static void main(String args[]) throws IOException {
+ testImpl(false, testTextureStreamP_4);
+ }
+
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
duration = MiscUtils.atol(args[i], duration);
}
}
- org.junit.runner.JUnitCore.main(TestPNGTextureFromFileNEWT.class.getName());
+ org.junit.runner.JUnitCore.main(TestPNGTextureFromFileNEWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil00NEWT.java
index bfcf9c2d7..90b8504d9 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil00NEWT.java
@@ -271,7 +271,7 @@ public class TestPixelFormatUtil00NEWT extends UITestCase {
}
}
}
- private void dumpComponents(PixelRectangle image, int x1, int y1, int w, int h) {
+ private void dumpComponents(final PixelRectangle image, int x1, int y1, final int w, final int h) {
if( x1 + w >= image.getSize().getWidth() ) {
x1 = image.getSize().getWidth() - w;
}
@@ -311,7 +311,7 @@ public class TestPixelFormatUtil00NEWT extends UITestCase {
}
System.err.println();
}
- private void testComponents(PixelRectangle image, int x, int y, byte[] components) {
+ private void testComponents(final PixelRectangle image, final int x, final int y, final byte[] components) {
dumpComponents(image, x, y, 3, 3);
final ByteBuffer bb = image.getPixels();
final int bpp = image.getPixelformat().bytesPerPixel();
@@ -358,7 +358,7 @@ public class TestPixelFormatUtil00NEWT extends UITestCase {
}
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestPixelFormatUtil00NEWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil01NEWT.java
index f54861371..eba920032 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil01NEWT.java
@@ -82,7 +82,7 @@ public class TestPixelFormatUtil01NEWT extends UITestCase {
{
System.err.println("Test01: "+pathname+basename+".png, srcFmt "+srcFmt+", destMinStrideInBytes "+destMinStrideInBytes+", destIsGLOriented "+destIsGLOriented);
- URLConnection urlConn = IOUtil.getResource(this.getClass(), pathname+basename+".png");
+ final URLConnection urlConn = IOUtil.getResource(this.getClass(), pathname+basename+".png");
final PNGPixelRect image1 = PNGPixelRect.read(urlConn.getInputStream(), srcFmt, false /* directBuffer */, destMinStrideInBytes, false /* isGLOriented */);
System.err.println("PNGPixelRect - Orig: "+image1);
@@ -99,7 +99,7 @@ public class TestPixelFormatUtil01NEWT extends UITestCase {
}
}
- public static void main(String args[]) {
+ public static void main(final String args[]) {
org.junit.runner.JUnitCore.main(TestPixelFormatUtil01NEWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTGATextureFromFileNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTGATextureFromFileNEWT.java
index 859e4e4b5..4f6705330 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTGATextureFromFileNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTGATextureFromFileNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -61,27 +61,27 @@ import com.jogamp.opengl.util.texture.TextureIO;
public class TestTGATextureFromFileNEWT extends UITestCase {
static boolean showFPS = false;
static long duration = 100; // ms
-
+
InputStream testTextureStream01U32;
InputStream testTextureStream02RLE32;
-
+
@Before
public void initTest() throws IOException {
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-u32.tga");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-u32.tga");
Assert.assertNotNull(testTextureUrlConn);
testTextureStream01U32 = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStream01U32);
}
{
- URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "bug744-rle32.tga");
+ final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "bug744-rle32.tga");
Assert.assertNotNull(testTextureUrlConn);
testTextureStream02RLE32 = testTextureUrlConn.getInputStream();
Assert.assertNotNull(testTextureStream02RLE32);
}
}
-
- public void testImpl(boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
+
+ public void testImpl(final boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
GLProfile glp;
if(useFFP && GLProfile.isAvailable(GLProfile.GL2)) {
@@ -94,39 +94,39 @@ public class TestTGATextureFromFileNEWT extends UITestCase {
}
final GLCapabilities caps = new GLCapabilities(glp);
caps.setAlphaBits(1);
-
+
final TextureData texData = TextureIO.newTextureData(glp, istream, false /* mipmap */, TextureIO.TGA);
- System.err.println("TextureData: "+texData);
-
+ System.err.println("TextureData: "+texData);
+
final GLWindow glad = GLWindow.create(caps);
glad.setTitle("TestTGATextureGL2FromFileNEWT");
// Size OpenGL to Video Surface
glad.setSize(texData.getWidth(), texData.getHeight());
-
+
// load texture from file inside current GL context to match the way
// the bug submitter was doing it
final GLEventListener gle = useFFP ? new TextureDraw01GL2Listener( texData ) : new TextureDraw01ES2Listener( texData, 0 ) ;
glad.addGLEventListener(gle);
- glad.addGLEventListener(new GLEventListener() {
+ glad.addGLEventListener(new GLEventListener() {
boolean shot = false;
-
- @Override public void init(GLAutoDrawable drawable) {}
-
- public void display(GLAutoDrawable drawable) {
+
+ @Override public void init(final GLAutoDrawable drawable) {}
+
+ public void display(final GLAutoDrawable drawable) {
// 1 snapshot
if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
shot = true;
snapshot(0, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
}
}
-
- @Override public void dispose(GLAutoDrawable drawable) { }
- @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+
+ @Override public void dispose(final GLAutoDrawable drawable) { }
+ @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
- Animator animator = new Animator(glad);
+ final Animator animator = new Animator(glad);
animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
glad.addKeyListener(quitAdapter);
glad.addWindowListener(quitAdapter);
glad.setVisible(true);
@@ -135,34 +135,34 @@ public class TestTGATextureFromFileNEWT extends UITestCase {
while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
Thread.sleep(100);
}
-
+
animator.stop();
glad.destroy();
}
-
+
@Test
public void test01U32__GL2() throws InterruptedException, IOException {
- testImpl(true, testTextureStream01U32);
+ testImpl(true, testTextureStream01U32);
}
-
+
@Test
public void test02RLE32__GL2() throws InterruptedException, IOException {
- testImpl(true, testTextureStream02RLE32);
+ testImpl(true, testTextureStream02RLE32);
}
-
+
@After
public void cleanupTest() {
testTextureStream01U32 = null;
testTextureStream02RLE32 = null;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
duration = MiscUtils.atol(args[i], duration);
}
}
- org.junit.runner.JUnitCore.main(TestTGATextureFromFileNEWT.class.getName());
+ org.junit.runner.JUnitCore.main(TestTGATextureFromFileNEWT.class.getName());
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java
index 855529f9c..5a51473b4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.util.texture;
@@ -67,8 +67,8 @@ import org.junit.runners.MethodSorters;
/**
* Demonstrates TextureData w/ AWT usage in both directions,
* i.e. generating a texture based on an AWT BufferedImage data
- * as well as reading out GL framebuffer and displaying it
- * as an BufferedImage.
+ * as well as reading out GL framebuffer and displaying it
+ * as an BufferedImage.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestTexture01AWT extends UITestCase {
@@ -102,7 +102,7 @@ public class TestTexture01AWT extends UITestCase {
g.dispose();
// create texture image
- int imageType = BufferedImage.TYPE_3BYTE_BGR;
+ final int imageType = BufferedImage.TYPE_3BYTE_BGR;
textureImage = new BufferedImage(baseImage.getWidth(),
baseImage.getHeight(),
imageType);
@@ -129,26 +129,26 @@ public class TestTexture01AWT extends UITestCase {
final Frame frame0 = new Frame("GL -> AWT");
final Canvas canvas = new Canvas();
frame0.add(canvas);
-
+
final GLCanvas glCanvas = new GLCanvas(caps);
final Frame frame1 = new Frame("AWT -> Texture");
Assert.assertNotNull(frame1);
frame1.add(glCanvas);
- // create texture
- TextureData textureData = AWTTextureIO.newTextureData(caps.getGLProfile(), textureImage, false);
+ // create texture
+ final TextureData textureData = AWTTextureIO.newTextureData(caps.getGLProfile(), textureImage, false);
glCanvas.addGLEventListener(new TextureDraw01GL2Listener(textureData));
glCanvas.addGLEventListener(new GLEventListener() {
-
+
@Override
- public void init(GLAutoDrawable drawable) { }
+ public void init(final GLAutoDrawable drawable) { }
@Override
- public void dispose(GLAutoDrawable drawable) { }
+ public void dispose(final GLAutoDrawable drawable) { }
@Override
- public void display(GLAutoDrawable drawable) {
- BufferedImage outputImage = awtGLReadBufferUtil.readPixelsToBufferedImage(drawable.getGL(), true /* awtOrientation */);
- ImageIcon imageIcon = new ImageIcon(outputImage);
- final JLabel imageLabel = new JLabel(imageIcon);
+ public void display(final GLAutoDrawable drawable) {
+ final BufferedImage outputImage = awtGLReadBufferUtil.readPixelsToBufferedImage(drawable.getGL(), true /* awtOrientation */);
+ final ImageIcon imageIcon = new ImageIcon(outputImage);
+ final JLabel imageLabel = new JLabel(imageIcon);
try {
AWTEDTExecutor.singleton.invoke(true, new Runnable() {
public void run() {
@@ -156,17 +156,17 @@ public class TestTexture01AWT extends UITestCase {
frame0.add(imageLabel);
frame0.validate();
}});
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
- }
+ }
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
frame0.setSize(frame1.getWidth(), frame1.getHeight());
frame0.setLocation(frame1.getX()+frame1.getWidth()+32, frame0.getY());
frame0.validate();
- }
+ }
});
try {
@@ -179,11 +179,11 @@ public class TestTexture01AWT extends UITestCase {
frame0.setLocation(frame1.getX()+frame1.getWidth()+32, frame0.getY());
frame0.setVisible(true);
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
- }
-
+ }
+
Thread.sleep(durationPerTest);
try {
@@ -194,19 +194,19 @@ public class TestTexture01AWT extends UITestCase {
frame1.setVisible(false);
frame1.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
- }
+ }
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
}
}
- String tstname = TestTexture01AWT.class.getName();
+ final String tstname = TestTexture01AWT.class.getName();
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
"filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture02AWT.java
index 566ce0f18..c54b9b3e7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture02AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.jogl.util.texture;
@@ -57,8 +57,8 @@ import org.junit.runners.MethodSorters;
/**
* Demonstrates TextureData w/ AWT usage,
- * i.e. reading out an animated GL framebuffer and displaying it
- * as an BufferedImage.
+ * i.e. reading out an animated GL framebuffer and displaying it
+ * as an BufferedImage.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestTexture02AWT extends UITestCase {
@@ -85,31 +85,31 @@ public class TestTexture02AWT extends UITestCase {
final ImageIcon imageIcon = new ImageIcon();
final JLabel imageLabel = new JLabel(imageIcon);
frame0.add(imageLabel);
-
+
final GLCanvas glCanvas = new GLCanvas(caps);
final Frame frame1 = new Frame("GearsES2");
Assert.assertNotNull(frame1);
frame1.add(glCanvas);
glCanvas.addGLEventListener(new GearsES2(1));
- glCanvas.addGLEventListener(new GLEventListener() {
+ glCanvas.addGLEventListener(new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) { }
+ public void init(final GLAutoDrawable drawable) { }
@Override
- public void dispose(GLAutoDrawable drawable) { }
+ public void dispose(final GLAutoDrawable drawable) { }
@Override
- public void display(GLAutoDrawable drawable) {
- BufferedImage outputImage = awtGLReadBufferUtil.readPixelsToBufferedImage(drawable.getGL(), true /* awtOrientation */);
+ public void display(final GLAutoDrawable drawable) {
+ final BufferedImage outputImage = awtGLReadBufferUtil.readPixelsToBufferedImage(drawable.getGL(), true /* awtOrientation */);
imageIcon.setImage(outputImage);
imageLabel.repaint();
}
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
frame0.setSize(frame1.getWidth(), frame1.getHeight());
frame0.setLocation(frame1.getX()+frame1.getWidth()+32, frame0.getY());
frame0.validate();
- }
+ }
});
try {
@@ -122,13 +122,13 @@ public class TestTexture02AWT extends UITestCase {
frame0.setLocation(frame1.getX()+frame1.getWidth()+32, frame0.getY());
frame0.setVisible(true);
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
- }
- FPSAnimator animator = new FPSAnimator(glCanvas, 15); // 15fps
+ }
+ final FPSAnimator animator = new FPSAnimator(glCanvas, 15); // 15fps
animator.start();
-
+
Thread.sleep(durationPerTest);
animator.stop();
@@ -140,19 +140,19 @@ public class TestTexture02AWT extends UITestCase {
frame1.setVisible(false);
frame1.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
- }
+ }
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
}
}
- String tstname = TestTexture02AWT.class.getName();
+ final String tstname = TestTexture02AWT.class.getName();
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
"filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java
index 5549254c4..5a294eee9 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java
@@ -51,19 +51,19 @@ public class TestTextureSequence01AWT extends UITestCase {
final ImageSequence texSource = new ImageSequence(0, useBuildInTexLookup);
glc.addGLEventListener(new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
try {
texSource.addFrame(drawable.getGL(), TestTextureSequence01AWT.class, "test-ntscP_3-01-160x90.png", TextureIO.PNG);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
}
@Override
- public void dispose(GLAutoDrawable drawable) { }
+ public void dispose(final GLAutoDrawable drawable) { }
@Override
- public void display(GLAutoDrawable drawable) { }
+ public void display(final GLAutoDrawable drawable) { }
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
glc.addGLEventListener(new TextureSequenceCubeES2(texSource, false, -2.3f, 0f, 0f));
@@ -77,7 +77,7 @@ public class TestTextureSequence01AWT extends UITestCase {
frame.setSize(width, height);
frame.setVisible(true);
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -100,7 +100,7 @@ public class TestTextureSequence01AWT extends UITestCase {
frame.remove(glc);
frame.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -111,7 +111,7 @@ public class TestTextureSequence01AWT extends UITestCase {
testImpl();
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01NEWT.java
index c365b78d6..47b594e9d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01NEWT.java
@@ -48,24 +48,24 @@ public class TestTextureSequence01NEWT extends UITestCase {
final ImageSequence texSource = new ImageSequence(0, useBuildInTexLookup);
window.addGLEventListener(new GLEventListener() {
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
try {
texSource.addFrame(drawable.getGL(), TestTextureSequence01NEWT.class, "test-ntscP_3-01-160x90.png", TextureIO.PNG);
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
}
@Override
- public void dispose(GLAutoDrawable drawable) { }
+ public void dispose(final GLAutoDrawable drawable) { }
@Override
- public void display(GLAutoDrawable drawable) { }
+ public void display(final GLAutoDrawable drawable) { }
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
});
window.addGLEventListener(new TextureSequenceCubeES2(texSource, false, -2.3f, 0f, 0f));
final Animator animator = new Animator(window);
animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
- QuitAdapter quitAdapter = new QuitAdapter();
+ final QuitAdapter quitAdapter = new QuitAdapter();
window.addKeyListener(quitAdapter);
window.addWindowListener(quitAdapter);
animator.start();
@@ -86,7 +86,7 @@ public class TestTextureSequence01NEWT extends UITestCase {
testImpl();
}
- public static void main(String[] args) {
+ public static void main(final String[] args) {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/DemoCreateAndDisposeOnCloseNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/DemoCreateAndDisposeOnCloseNEWT.java
index e82204fd0..9ab81ef82 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/DemoCreateAndDisposeOnCloseNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/DemoCreateAndDisposeOnCloseNEWT.java
@@ -50,7 +50,7 @@ import com.jogamp.opengl.util.Animator;
*
*/
public class DemoCreateAndDisposeOnCloseNEWT {
- public static void main(String[] args) {
+ public static void main(final String[] args) {
int closeMode = 0; // 0 - none, 1 - window, animator, 2 - animator, window, 3 - System.exit
for(int i=0; i<args.length; i++) {
@@ -65,26 +65,26 @@ public class DemoCreateAndDisposeOnCloseNEWT {
caps.setDoubleBuffered(true);
caps.setDepthBits(16);
final Animator animator = new Animator();
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
animator.add(glWindow);
glWindow.addGLEventListener(new GLEventListener() {
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
System.out.println("GLEventListener.reshape");
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
System.out.println("GLEventListener.init");
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
System.out.println("GLEventListener.dispose");
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
}
});
glWindow.setTitle("Test");
@@ -96,12 +96,12 @@ public class DemoCreateAndDisposeOnCloseNEWT {
glWindow.setDefaultCloseOperation(WindowClosingProtocol.WindowClosingMode.DISPOSE_ON_CLOSE);
glWindow.addWindowListener(new WindowAdapter() {
@Override
- public void windowDestroyNotify(WindowEvent e) {
+ public void windowDestroyNotify(final WindowEvent e) {
System.out.println("GLWindow.destroyNotify");
}
@Override
- public void windowDestroyed(WindowEvent e) {
+ public void windowDestroyed(final WindowEvent e) {
System.out.println("GLWindow.destroyed");
animator.stop();
}
@@ -132,7 +132,7 @@ public class DemoCreateAndDisposeOnCloseNEWT {
static void sleep1s() {
try {
Thread.sleep(1000);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java
index 817f4140e..f9216f082 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -34,9 +34,10 @@ import org.junit.runners.MethodSorters;
import org.junit.Assert;
import java.lang.reflect.InvocationTargetException;
+
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
-
+import javax.swing.WindowConstants;
import javax.media.nativewindow.NativeWindow;
import javax.media.nativewindow.util.Point;
import javax.media.opengl.GLCapabilities;
@@ -58,7 +59,7 @@ public class TestCloseNewtAWT extends UITestCase {
@SuppressWarnings("serial")
class MyCanvas extends NewtCanvasAWT {
- public MyCanvas(Window window) {
+ public MyCanvas(final Window window) {
super(window);
}
@@ -79,10 +80,10 @@ public class TestCloseNewtAWT extends UITestCase {
", holds AWTTreeLock: "+Thread.holdsLock(MyCanvas.this.getTreeLock()));
// Critical: Within NEWT EDT, while AWT is locked
- NativeWindow nw = MyCanvas.this.getNativeWindow();
+ final NativeWindow nw = MyCanvas.this.getNativeWindow();
if(null != nw) {
- Point p = nw.getLocationOnScreen(null);
- System.err.println("MyCanvas On NEWT-EDT: position: "+p);
+ final Point p = nw.getLocationOnScreen(null);
+ System.err.println("MyCanvas On NEWT-EDT: position: "+p);
} else {
System.err.println("MyCanvas On NEWT-EDT: position n/a, null NativeWindow");
}
@@ -104,7 +105,7 @@ public class TestCloseNewtAWT extends UITestCase {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame = new JFrame("NEWT Close Test");
- frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+ frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.getContentPane().add(newtCanvas);
frame.pack();
frame.setSize(800, 600);
@@ -118,8 +119,8 @@ public class TestCloseNewtAWT extends UITestCase {
Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, true, closingListener));
}
- public static void main(String[] args) {
- String tstname = TestCloseNewtAWT.class.getName();
+ public static void main(final String[] args) {
+ final String tstname = TestCloseNewtAWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java
index 8989f3a89..c3345708f 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java
@@ -62,7 +62,7 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
caps = new GLCapabilities(glp);
}
- static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height)
+ static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final int width, final int height)
throws InterruptedException
{
Assert.assertNotNull(caps);
@@ -72,7 +72,7 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
//
GLWindow glWindow;
if(null!=screen) {
- Window window = NewtFactory.createWindow(screen, caps);
+ final Window window = NewtFactory.createWindow(screen, caps);
Assert.assertNotNull(window);
glWindow = GLWindow.create(window);
} else {
@@ -80,7 +80,7 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
}
glWindow.setUpdateFPSFrames(1, null);
- GLEventListener demo = new GearsES2();
+ final GLEventListener demo = new GearsES2();
setDemoFields(demo, glWindow);
glWindow.addGLEventListener(demo);
glWindow.addWindowListener(new TraceWindowAdapter());
@@ -88,7 +88,7 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
return glWindow;
}
- private void testDisplayCreate01(Display display, Screen screen) throws InterruptedException {
+ private void testDisplayCreate01(final Display display, final Screen screen) throws InterruptedException {
// start-state == end-state
Assert.assertEquals(0,Display.getActiveDisplayNumber());
Assert.assertEquals(0,display.getReferenceCount());
@@ -99,7 +99,7 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
Assert.assertEquals(false,screen.isNativeValid());
// Create Window, pending lazy native creation
- GLWindow window = createWindow(screen, caps, width, height);
+ final GLWindow window = createWindow(screen, caps, width, height);
Assert.assertEquals(screen,window.getScreen());
Assert.assertEquals(0,Display.getActiveDisplayNumber());
Assert.assertEquals(0,display.getReferenceCount());
@@ -229,15 +229,15 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
Assert.assertEquals(0,Display.getActiveDisplayNumber());
// Create Display/Screen, pending lazy native creation
- Display display = NewtFactory.createDisplay(null);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Display display = NewtFactory.createDisplay(null);
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
testDisplayCreate01(display, screen);
testDisplayCreate01(display, screen);
Assert.assertEquals(0,Display.getActiveDisplayNumber());
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
@@ -245,22 +245,22 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
System.err.println("durationPerTest: "+durationPerTest);
- String tstname = TestDisplayLifecycle01NEWT.class.getName();
+ final String tstname = TestDisplayLifecycle01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java
index 0679563b8..17a66691a 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java
@@ -63,7 +63,7 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
caps = new GLCapabilities(glp);
}
- static GLWindow createWindow(GLCapabilities caps, int width, int height)
+ static GLWindow createWindow(final GLCapabilities caps, final int width, final int height)
throws InterruptedException
{
Assert.assertNotNull(caps);
@@ -71,10 +71,10 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
//
// Create native windowing resources .. X11/Win/OSX
//
- GLWindow glWindow = GLWindow.create(caps);
+ final GLWindow glWindow = GLWindow.create(caps);
glWindow.setUpdateFPSFrames(1, null);
- GLEventListener demo = new GearsES2();
+ final GLEventListener demo = new GearsES2();
setDemoFields(demo, glWindow);
glWindow.addGLEventListener(demo);
glWindow.addWindowListener(new TraceWindowAdapter());
@@ -87,9 +87,9 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
Assert.assertEquals(0,Display.getActiveDisplayNumber());
// Create Window, pending lazy native creation
- GLWindow window = createWindow(caps, width, height);
- Screen screen = window.getScreen();
- Display display = screen.getDisplay();
+ final GLWindow window = createWindow(caps, width, height);
+ final Screen screen = window.getScreen();
+ final Display display = screen.getDisplay();
Assert.assertEquals(screen,window.getScreen());
Assert.assertEquals(0,Display.getActiveDisplayNumber());
@@ -233,12 +233,12 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
Assert.assertEquals(0,Display.getActiveDisplayNumber());
// Create Window, pending lazy native creation
- GLWindow window1 = createWindow(caps, width, height);
+ final GLWindow window1 = createWindow(caps, width, height);
window1.setPosition(0, 0);
- Screen screen = window1.getScreen();
- Display display = screen.getDisplay();
+ final Screen screen = window1.getScreen();
+ final Display display = screen.getDisplay();
- GLWindow window2 = createWindow(caps, width, height);
+ final GLWindow window2 = createWindow(caps, width, height);
Assert.assertSame(screen, window2.getScreen());
Assert.assertSame(display, window2.getScreen().getDisplay());
final RectangleImmutable screenBoundsInWinU = screen.getViewportInWindowUnits();
@@ -359,7 +359,7 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
Assert.assertEquals(0,Display.getActiveDisplayNumber());
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
@@ -367,22 +367,22 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
System.err.println("durationPerTest: "+durationPerTest);
- String tstname = TestDisplayLifecycle02NEWT.class.getName();
+ final String tstname = TestDisplayLifecycle02NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java b/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java
index a2100cfc5..eaafd190f 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt;
import org.junit.BeforeClass;
@@ -59,7 +59,7 @@ public class TestEventSourceNotAWTBug extends UITestCase {
@Test
public void testEventSourceNotNewtBug() throws InterruptedException, InvocationTargetException {
- JFrame jf = new JFrame();
+ final JFrame jf = new JFrame();
jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
@@ -90,8 +90,8 @@ public class TestEventSourceNotAWTBug extends UITestCase {
glWindow.destroy();
}
- public static void main(String args[]) throws IOException {
- String tstname = TestEventSourceNotAWTBug.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestEventSourceNotAWTBug.class.getName();
/*
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowInvisiblePointer01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowInvisiblePointer01NEWT.java
index 75a9e87af..546b35503 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowInvisiblePointer01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowInvisiblePointer01NEWT.java
@@ -33,13 +33,13 @@ public class TestGLWindowInvisiblePointer01NEWT extends UITestCase {
glp = GLProfile.getDefault();
}
- static GLWindow createWindow(Screen screen, GLCapabilitiesImmutable caps)
+ static GLWindow createWindow(final Screen screen, final GLCapabilitiesImmutable caps)
throws InterruptedException
{
Assert.assertNotNull(caps);
//
// Create native windowing resources .. X11/Win/OSX
- //
+ //
GLWindow glWindow;
if(null!=screen) {
glWindow = GLWindow.create(screen, caps);
@@ -48,9 +48,9 @@ public class TestGLWindowInvisiblePointer01NEWT extends UITestCase {
glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
}
- glWindow.setUpdateFPSFrames(1, null);
+ glWindow.setUpdateFPSFrames(1, null);
- GLEventListener demo = new GearsES1();
+ final GLEventListener demo = new GearsES1();
glWindow.addGLEventListener(demo);
glWindow.setSize(512, 512);
@@ -61,7 +61,7 @@ public class TestGLWindowInvisiblePointer01NEWT extends UITestCase {
return glWindow;
}
- static void destroyWindow(GLWindow glWindow) {
+ static void destroyWindow(final GLWindow glWindow) {
if(null!=glWindow) {
glWindow.destroy();
Assert.assertEquals(false,glWindow.isNativeValid());
@@ -70,23 +70,23 @@ public class TestGLWindowInvisiblePointer01NEWT extends UITestCase {
@Test
public void testWindow00() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- GLWindow window1 = createWindow(null, caps); // local
+ final GLWindow window1 = createWindow(null, caps); // local
Assert.assertEquals(true,window1.isNativeValid());
Assert.assertEquals(true,window1.isVisible());
- Animator animator = new Animator();
+ final Animator animator = new Animator();
animator.setUpdateFPSFrames(1, null);
animator.add(window1);
animator.start();
- AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
+ final AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
-
+
window1.warpPointer(width / 2, height / 2);
window1.requestFocus();
while(animator.isAnimating() && animator.getTotalFPSDuration()<durationPerTest) {
- boolean pointerVisibleNewVal = (animator.getTotalFPSDuration()/100)%2==0;
+ final boolean pointerVisibleNewVal = (animator.getTotalFPSDuration()/100)%2==0;
window1.setPointerVisible(pointerVisibleNewVal);
Assert.assertEquals(pointerVisibleNewVal,window1.isPointerVisible());
Thread.sleep(100);
@@ -95,22 +95,22 @@ public class TestGLWindowInvisiblePointer01NEWT extends UITestCase {
destroyWindow(window1);
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestGLWindowInvisiblePointer01NEWT.class.getName();
+ final String tstname = TestGLWindowInvisiblePointer01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowWarpPointer01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowWarpPointer01NEWT.java
index 818133945..04a27dcc9 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowWarpPointer01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowWarpPointer01NEWT.java
@@ -37,13 +37,13 @@ public class TestGLWindowWarpPointer01NEWT extends UITestCase {
glp = GLProfile.getDefault();
}
- static GLWindow createWindow(Screen screen, GLCapabilitiesImmutable caps)
+ static GLWindow createWindow(final Screen screen, final GLCapabilitiesImmutable caps)
throws InterruptedException
{
Assert.assertNotNull(caps);
//
// Create native windowing resources .. X11/Win/OSX
- //
+ //
GLWindow glWindow;
if(null!=screen) {
glWindow = GLWindow.create(screen, caps);
@@ -52,9 +52,9 @@ public class TestGLWindowWarpPointer01NEWT extends UITestCase {
glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
}
- glWindow.setUpdateFPSFrames(1, null);
+ glWindow.setUpdateFPSFrames(1, null);
- GLEventListener demo = new GearsES2();
+ final GLEventListener demo = new GearsES2();
glWindow.addGLEventListener(demo);
glWindow.setSize(512, 512);
@@ -65,7 +65,7 @@ public class TestGLWindowWarpPointer01NEWT extends UITestCase {
return glWindow;
}
- static void destroyWindow(GLWindow glWindow) {
+ static void destroyWindow(final GLWindow glWindow) {
if(null!=glWindow) {
glWindow.destroy();
Assert.assertEquals(false,glWindow.isNativeValid());
@@ -76,75 +76,75 @@ public class TestGLWindowWarpPointer01NEWT extends UITestCase {
public void testWarp01Center() throws InterruptedException {
testWarpImpl(false);
}
-
+
@Test
public void testWarp02Random() throws InterruptedException {
testWarpImpl(true);
}
-
+
void testWarpImpl(final boolean random) throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
final GLWindow window1 = createWindow(null, caps); // local
Assert.assertEquals(true,window1.isNativeValid());
Assert.assertEquals(true,window1.isVisible());
- Animator animator = new Animator();
+ final Animator animator = new Animator();
animator.setUpdateFPSFrames(1, null);
animator.add(window1);
animator.start();
- AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
+ final AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
-
+
window1.warpPointer(width / 2, height / 2);
window1.requestFocus();
-
+
window1.addMouseListener(new MouseAdapter() {
void warpCenter() {
window1.warpPointer(width / 2, height / 2);
}
-
+
@Override
- public void mouseEntered(MouseEvent e) {
+ public void mouseEntered(final MouseEvent e) {
}
@Override
- public void mouseExited(MouseEvent e) {
+ public void mouseExited(final MouseEvent e) {
warpCenter();
}
@Override
- public void mouseMoved(MouseEvent e) {
+ public void mouseMoved(final MouseEvent e) {
}
});
-
+
if( random ) {
window1.addGLEventListener(new GLEventListener() {
final Random r = new Random();
-
- void warpRandom(int width, int height) {
- int x = r.nextInt(width);
- int y = r.nextInt(height);
+
+ void warpRandom(final int width, final int height) {
+ final int x = r.nextInt(width);
+ final int y = r.nextInt(height);
window1.warpPointer(x, y);
}
-
+
@Override
- public void init(GLAutoDrawable drawable) {}
-
+ public void init(final GLAutoDrawable drawable) {}
+
@Override
- public void dispose(GLAutoDrawable drawable) {}
-
+ public void dispose(final GLAutoDrawable drawable) {}
+
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
warpRandom(drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
}
-
+
@Override
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
-
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
+
});
}
-
+
while(animator.isAnimating() && animator.getTotalFPSDuration()<durationPerTest) {
Thread.sleep(100);
}
@@ -152,22 +152,22 @@ public class TestGLWindowWarpPointer01NEWT extends UITestCase {
destroyWindow(window1);
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestGLWindowWarpPointer01NEWT.class.getName();
+ final String tstname = TestGLWindowWarpPointer01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java
index 384b6806a..bd84341b8 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt;
import org.junit.Assert;
@@ -58,13 +58,13 @@ public class TestGLWindows00NEWT extends UITestCase {
glp = GLProfile.getDefault();
}
- static GLWindow createWindow(Screen screen, GLCapabilitiesImmutable caps)
+ static GLWindow createWindow(final Screen screen, final GLCapabilitiesImmutable caps)
throws InterruptedException
{
Assert.assertNotNull(caps);
//
// Create native windowing resources .. X11/Win/OSX
- //
+ //
GLWindow glWindow;
if(null!=screen) {
glWindow = GLWindow.create(screen, caps);
@@ -73,9 +73,9 @@ public class TestGLWindows00NEWT extends UITestCase {
glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
}
- glWindow.setUpdateFPSFrames(1, null);
+ glWindow.setUpdateFPSFrames(1, null);
- GLEventListener demo = new GearsES2();
+ final GLEventListener demo = new GearsES2();
glWindow.addGLEventListener(demo);
glWindow.setSize(512, 512);
@@ -86,7 +86,7 @@ public class TestGLWindows00NEWT extends UITestCase {
return glWindow;
}
- static void destroyWindow(GLWindow glWindow) {
+ static void destroyWindow(final GLWindow glWindow) {
if(null!=glWindow) {
glWindow.destroy();
Assert.assertEquals(false,glWindow.isNativeValid());
@@ -95,12 +95,12 @@ public class TestGLWindows00NEWT extends UITestCase {
@Test
public void testWindow00() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- GLWindow window1 = createWindow(null, caps); // local
+ final GLWindow window1 = createWindow(null, caps); // local
Assert.assertEquals(true,window1.isNativeValid());
Assert.assertEquals(true,window1.isVisible());
- AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
+ final AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
@@ -111,22 +111,22 @@ public class TestGLWindows00NEWT extends UITestCase {
destroyWindow(window1);
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestGLWindows00NEWT.class.getName();
+ final String tstname = TestGLWindows00NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows01NEWT.java
index 2b3e448db..ea3e96a47 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows01NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt;
import org.junit.Assert;
@@ -58,9 +58,9 @@ public class TestGLWindows01NEWT extends UITestCase {
glp = GLProfile.getDefault();
}
- static GLWindow createWindow(Screen screen, GLCapabilities caps,
- int width, int height, boolean onscreen, boolean undecorated,
- boolean addGLEventListenerAfterVisible)
+ static GLWindow createWindow(final Screen screen, final GLCapabilities caps,
+ final int width, final int height, final boolean onscreen, final boolean undecorated,
+ final boolean addGLEventListenerAfterVisible)
throws InterruptedException
{
Assert.assertNotNull(caps);
@@ -69,7 +69,7 @@ public class TestGLWindows01NEWT extends UITestCase {
//
// Create native windowing resources .. X11/Win/OSX
- //
+ //
GLWindow glWindow;
if(null!=screen) {
glWindow = GLWindow.create(screen, caps);
@@ -83,7 +83,7 @@ public class TestGLWindows01NEWT extends UITestCase {
Assert.assertEquals(false,glWindow.isVisible());
Assert.assertEquals(false,glWindow.isNativeValid());
- GLEventListener demo = new GearsES2();
+ final GLEventListener demo = new GearsES2();
setDemoFields(demo, glWindow);
if(!addGLEventListenerAfterVisible) {
glWindow.addGLEventListener(demo);
@@ -100,10 +100,10 @@ public class TestGLWindows01NEWT extends UITestCase {
Assert.assertTrue(0 < glWindow.getTotalFPSFrames());
//
- // Create native OpenGL resources .. XGL/WGL/CGL ..
+ // Create native OpenGL resources .. XGL/WGL/CGL ..
// equivalent to GLAutoDrawable methods: setVisible(true)
- //
- GLCapabilitiesImmutable caps2 = glWindow.getChosenGLCapabilities();
+ //
+ final GLCapabilitiesImmutable caps2 = glWindow.getChosenGLCapabilities();
Assert.assertNotNull(caps2);
Assert.assertTrue(caps2.getGreenBits()>=5);
Assert.assertTrue(caps2.getBlueBits()>=5);
@@ -118,7 +118,7 @@ public class TestGLWindows01NEWT extends UITestCase {
return glWindow;
}
- static void destroyWindow(GLWindow glWindow) {
+ static void destroyWindow(final GLWindow glWindow) {
if(null!=glWindow) {
glWindow.destroy();
Assert.assertEquals(false,glWindow.isNativeValid());
@@ -127,10 +127,10 @@ public class TestGLWindows01NEWT extends UITestCase {
@Test
public void testWindowNativeRecreate01aSimple() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- GLWindow window = createWindow(null, caps, width, height,
- true /* onscreen */, false /* undecorated */,
+ final GLWindow window = createWindow(null, caps, width, height,
+ true /* onscreen */, false /* undecorated */,
false /*addGLEventListenerAfterVisible*/);
Assert.assertEquals(true,window.isNativeValid());
@@ -156,10 +156,10 @@ public class TestGLWindows01NEWT extends UITestCase {
@Test
public void testWindowNativeRecreate01bSimple() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- GLWindow window = createWindow(null, caps, width, height,
- true /* onscreen */, false /* undecorated */,
+ final GLWindow window = createWindow(null, caps, width, height,
+ true /* onscreen */, false /* undecorated */,
true /*addGLEventListenerAfterVisible*/);
Assert.assertEquals(true,window.isNativeValid());
@@ -185,10 +185,10 @@ public class TestGLWindows01NEWT extends UITestCase {
@Test
public void testWindowDecor01aSimple() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- GLWindow window = createWindow(null, caps, width, height,
- true /* onscreen */, false /* undecorated */,
+ final GLWindow window = createWindow(null, caps, width, height,
+ true /* onscreen */, false /* undecorated */,
false /*addGLEventListenerAfterVisible*/);
System.out.println("Created: "+window);
int state;
@@ -201,10 +201,10 @@ public class TestGLWindows01NEWT extends UITestCase {
@Test
public void testWindowDecor01bSimple() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- GLWindow window = createWindow(null, caps, width, height,
- true /* onscreen */, false /* undecorated */,
+ final GLWindow window = createWindow(null, caps, width, height,
+ true /* onscreen */, false /* undecorated */,
true /*addGLEventListenerAfterVisible*/);
System.out.println("Created: "+window);
int state;
@@ -217,10 +217,10 @@ public class TestGLWindows01NEWT extends UITestCase {
@Test
public void testWindowDecor02DestroyWinTwiceA() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- GLWindow window = createWindow(null, caps, width, height,
- true /* onscreen */, false /* undecorated */,
+ final GLWindow window = createWindow(null, caps, width, height,
+ true /* onscreen */, false /* undecorated */,
false /*addGLEventListenerAfterVisible*/);
int state;
for(state=0; state*100<durationPerTest; state++) {
@@ -232,21 +232,21 @@ public class TestGLWindows01NEWT extends UITestCase {
@Test
public void testWindowDecor03TwoWinOneDisplay() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- Display display = NewtFactory.createDisplay(null); // local display
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
- GLWindow window1 = createWindow(screen, caps, width, height,
- true /* onscreen */, false /* undecorated */,
+ final GLWindow window1 = createWindow(screen, caps, width, height,
+ true /* onscreen */, false /* undecorated */,
false /*addGLEventListenerAfterVisible*/);
Assert.assertNotNull(window1);
- GLWindow window2 = createWindow(screen, caps, width, height,
- true /* onscreen */, false /* undecorated */,
+ final GLWindow window2 = createWindow(screen, caps, width, height,
+ true /* onscreen */, false /* undecorated */,
false /*addGLEventListenerAfterVisible*/);
Assert.assertNotNull(window2);
@@ -282,26 +282,26 @@ public class TestGLWindows01NEWT extends UITestCase {
@Test
public void testWindowDecor03TwoWinTwoDisplays() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- Display display1 = NewtFactory.createDisplay(null, false); // local display
+ final Display display1 = NewtFactory.createDisplay(null, false); // local display
Assert.assertNotNull(display1);
- Display display2 = NewtFactory.createDisplay(null, false); // local display
+ final Display display2 = NewtFactory.createDisplay(null, false); // local display
Assert.assertNotNull(display2);
Assert.assertNotSame(display1, display2);
- Screen screen1 = NewtFactory.createScreen(display1, 0); // screen 0
+ final Screen screen1 = NewtFactory.createScreen(display1, 0); // screen 0
Assert.assertNotNull(screen1);
- GLWindow window1 = createWindow(screen1, caps, width, height,
- true /* onscreen */, false /* undecorated */,
+ final GLWindow window1 = createWindow(screen1, caps, width, height,
+ true /* onscreen */, false /* undecorated */,
false /*addGLEventListenerAfterVisible*/);
Assert.assertNotNull(window1);
- Screen screen2 = NewtFactory.createScreen(display2, 0); // screen 0
+ final Screen screen2 = NewtFactory.createScreen(display2, 0); // screen 0
Assert.assertNotNull(screen2);
- GLWindow window2 = createWindow(screen2, caps, width, height,
- true /* onscreen */, false /* undecorated */,
+ final GLWindow window2 = createWindow(screen2, caps, width, height,
+ true /* onscreen */, false /* undecorated */,
false /*addGLEventListenerAfterVisible*/);
Assert.assertNotNull(window2);
@@ -351,10 +351,10 @@ public class TestGLWindows01NEWT extends UITestCase {
Assert.assertNotNull(display2.getEDTUtil());
Assert.assertEquals(false,display2.getEDTUtil().isRunning());
Assert.assertEquals(0,screen2.getReferenceCount());
- Assert.assertEquals(false,screen2.isNativeValid());
+ Assert.assertEquals(false,screen2.isNativeValid());
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
@@ -362,22 +362,22 @@ public class TestGLWindows01NEWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestGLWindows01NEWT.class.getName();
+ final String tstname = TestGLWindows01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java
index 2987fd389..4969c3b77 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java
@@ -63,7 +63,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
glp = GLProfile.getDefault();
}
- static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated, boolean vsync) {
+ static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final int width, final int height, final boolean onscreen, final boolean undecorated, final boolean vsync) {
Assert.assertNotNull(caps);
caps.setOnscreen(onscreen);
// System.out.println("Requested: "+caps);
@@ -73,7 +73,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
//
GLWindow glWindow;
if(null!=screen) {
- Window window = NewtFactory.createWindow(screen, caps);
+ final Window window = NewtFactory.createWindow(screen, caps);
Assert.assertNotNull(window);
glWindow = GLWindow.create(window);
} else {
@@ -83,7 +83,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
Assert.assertNotNull(glWindow);
glWindow.setUndecorated(onscreen && undecorated);
- GLEventListener demo = new GearsES2(vsync ? 1 : 0);
+ final GLEventListener demo = new GearsES2(vsync ? 1 : 0);
setDemoFields(demo, glWindow);
glWindow.addGLEventListener(demo);
glWindow.addWindowListener(new TraceWindowAdapter());
@@ -102,7 +102,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
// Create native OpenGL resources .. XGL/WGL/CGL ..
// equivalent to GLAutoDrawable methods: setVisible(true)
//
- GLCapabilitiesImmutable caps2 = glWindow.getChosenGLCapabilities();
+ final GLCapabilitiesImmutable caps2 = glWindow.getChosenGLCapabilities();
Assert.assertNotNull(caps2);
Assert.assertTrue(caps2.getGreenBits()>=5);
Assert.assertTrue(caps2.getBlueBits()>=5);
@@ -112,7 +112,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
return glWindow;
}
- static void destroyWindow(GLWindow glWindow) {
+ static void destroyWindow(final GLWindow glWindow) {
if(null!=glWindow) {
glWindow.destroy();
}
@@ -120,10 +120,10 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
@Test
public void testWindowDecor01Simple() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */, true /* vsync */);
- Animator animator = new Animator(window);
+ final GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */, true /* vsync */);
+ final Animator animator = new Animator(window);
animator.setUpdateFPSFrames(1, null);
Assert.assertTrue(animator.start());
while(animator.isAnimating() && animator.getTotalFPSDuration()<durationPerTest) {
@@ -146,10 +146,10 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
@Test
public void testWindowDecor02DestroyWinTwiceA() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */, true /* vsync */);
- Animator animator = new Animator();
+ final GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */, true /* vsync */);
+ final Animator animator = new Animator();
animator.setUpdateFPSFrames(1, null);
Assert.assertTrue(animator.start());
Thread.sleep(250); // give animator a chance to become paused
@@ -174,24 +174,24 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
@Test
public void testWindowDecor03TwoWinOneDisplay() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- Display display = NewtFactory.createDisplay(null); // local display
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
- GLWindow window1 = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */, false /* vsync */);
+ final GLWindow window1 = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */, false /* vsync */);
Assert.assertNotNull(window1);
window1.setPosition(0, 0);
- GLWindow window2 = createWindow(screen, caps, width-10, height-10, true /* onscreen */, false /* undecorated */, true /* vsync */);
+ final GLWindow window2 = createWindow(screen, caps, width-10, height-10, true /* onscreen */, false /* undecorated */, true /* vsync */);
Assert.assertNotNull(window2);
final RectangleImmutable screenBoundsInWinU = screen.getViewportInWindowUnits();
window2.setPosition(screenBoundsInWinU.getWidth()-width, 0);
- Animator animator = new Animator();
+ final Animator animator = new Animator();
animator.setUpdateFPSFrames(1, null);
Assert.assertEquals(false, animator.isStarted());
Assert.assertEquals(false, animator.isAnimating()); // zero drawables
@@ -236,29 +236,29 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
@Test
public void testWindowDecor03TwoWinTwoDisplays() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- Display display1 = NewtFactory.createDisplay(null, false); // local display
+ final Display display1 = NewtFactory.createDisplay(null, false); // local display
Assert.assertNotNull(display1);
- Display display2 = NewtFactory.createDisplay(null, false); // local display
+ final Display display2 = NewtFactory.createDisplay(null, false); // local display
Assert.assertNotNull(display2);
Assert.assertNotSame(display1, display2);
- Screen screen1 = NewtFactory.createScreen(display1, 0); // screen 0
+ final Screen screen1 = NewtFactory.createScreen(display1, 0); // screen 0
Assert.assertNotNull(screen1);
- GLWindow window1 = createWindow(screen1, caps, width, height, true /* onscreen */, false /* undecorated */, false /* vsync */);
+ final GLWindow window1 = createWindow(screen1, caps, width, height, true /* onscreen */, false /* undecorated */, false /* vsync */);
Assert.assertNotNull(window1);
window1.setPosition(0, 0);
- Screen screen2 = NewtFactory.createScreen(display2, 0); // screen 0
+ final Screen screen2 = NewtFactory.createScreen(display2, 0); // screen 0
Assert.assertNotNull(screen2);
- GLWindow window2 = createWindow(screen2, caps, width-10, height-10, true /* onscreen */, false /* undecorated */, true /* vsync */);
+ final GLWindow window2 = createWindow(screen2, caps, width-10, height-10, true /* onscreen */, false /* undecorated */, true /* vsync */);
Assert.assertNotNull(window2);
final RectangleImmutable screen2BoundsInWinU = screen2.getViewportInWindowUnits();
window2.setPosition(screen2BoundsInWinU.getWidth()-width, 0);
- Animator animator = new Animator();
+ final Animator animator = new Animator();
animator.setUpdateFPSFrames(1, null);
Assert.assertEquals(false, animator.isStarted());
Assert.assertEquals(false, animator.isAnimating());
@@ -322,7 +322,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
Assert.assertEquals(false, animator.isPaused());
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
@@ -330,21 +330,21 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
- String tstname = TestGLWindows02NEWTAnimated.class.getName();
+ final String tstname = TestGLWindows02NEWTAnimated.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows03NEWTAnimResize.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows03NEWTAnimResize.java
index 026656607..f7a45c1b0 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows03NEWTAnimResize.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows03NEWTAnimResize.java
@@ -63,7 +63,7 @@ public class TestGLWindows03NEWTAnimResize extends UITestCase {
glp = GLProfile.getDefault();
}
- static void test(GLCapabilitiesImmutable caps, boolean undecorated) throws InterruptedException {
+ static void test(final GLCapabilitiesImmutable caps, final boolean undecorated) throws InterruptedException {
Assert.assertNotNull(caps);
//
@@ -75,7 +75,7 @@ public class TestGLWindows03NEWTAnimResize extends UITestCase {
Assert.assertNotNull(glWindow);
glWindow.setUndecorated(undecorated);
- GLEventListener demo = new GearsES2(1);
+ final GLEventListener demo = new GearsES2(1);
glWindow.addGLEventListener(demo);
glWindow.addWindowListener(new TraceWindowAdapter());
Assert.assertEquals(false,glWindow.isNativeValid());
@@ -94,7 +94,7 @@ public class TestGLWindows03NEWTAnimResize extends UITestCase {
int step_i = 0;
for(int i=0; i<durationPerTest; i+=50) {
Thread.sleep(50);
- int j = (int) ( i / (durationPerTest/step) ) + 1;
+ final int j = (int) ( i / (durationPerTest/step) ) + 1;
if(j>step_i) {
final int w = width/step * j;
final int h = height/step * j;
@@ -113,25 +113,25 @@ public class TestGLWindows03NEWTAnimResize extends UITestCase {
@Test
public void test01WindowDecor() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
test(caps, false /* undecorated */);
}
@Test
public void test02WindowUndecor() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
test(caps, true /* undecorated */);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
}
}
- String tstname = TestGLWindows03NEWTAnimResize.class.getName();
+ final String tstname = TestGLWindows03NEWTAnimResize.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java
index 91937c8c8..588e3cc0f 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt;
import org.junit.Assert;
@@ -64,19 +64,19 @@ public class TestListenerCom01AWT extends UITestCase {
@Test
public void testListenerStringPassingAndOrder() throws InterruptedException, InvocationTargetException {
// setup NEWT GLWindow ..
- GLWindow glWindow = GLWindow.create(new GLCapabilities(null));
+ final GLWindow glWindow = GLWindow.create(new GLCapabilities(null));
Assert.assertNotNull(glWindow);
glWindow.setTitle("NEWT - CHILD");
System.out.println("durationPerTest "+durationPerTest);
- GLEventListener demo = new GearsES2();
+ final GLEventListener demo = new GearsES2();
setDemoFields(demo, glWindow, false);
glWindow.addGLEventListener(demo);
- WindowEventCom1 wl1 = new WindowEventCom1();
- WindowEventCom2 wl2 = new WindowEventCom2();
- WindowEventCom3 wl3 = new WindowEventCom3();
+ final WindowEventCom1 wl1 = new WindowEventCom1();
+ final WindowEventCom2 wl2 = new WindowEventCom2();
+ final WindowEventCom3 wl3 = new WindowEventCom3();
// TraceWindowAdapter wlT = new TraceWindowAdapter();
// glWindow.addWindowListener(0, wlT);
@@ -91,7 +91,7 @@ public class TestListenerCom01AWT extends UITestCase {
Assert.assertEquals(wl3, glWindow.getWindowListener(2));
// attach NEWT GLWindow to AWT Canvas
- NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
+ final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
final Frame frame = new Frame("AWT Parent Frame");
frame.add(newtCanvasAWT);
frame.setSize(width, height);
@@ -100,8 +100,8 @@ public class TestListenerCom01AWT extends UITestCase {
frame.setVisible(true);
}});
- Animator animator1 = new Animator(glWindow);
- animator1.setUpdateFPSFrames(1, null);
+ final Animator animator1 = new Animator(glWindow);
+ animator1.setUpdateFPSFrames(1, null);
animator1.start();
while(animator1.isAnimating() && animator1.getTotalFPSDuration()<durationPerTest) {
Thread.sleep(100);
@@ -118,10 +118,10 @@ public class TestListenerCom01AWT extends UITestCase {
glWindow.destroy();
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
- Window window = glWindow.getDelegatedWindow();
+ final Window window = glWindow.getDelegatedWindow();
if(debug) {
MiscUtils.setFieldIfExists(demo, "glDebug", true);
MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -131,22 +131,22 @@ public class TestListenerCom01AWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
verbose = true;
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
- String tstname = TestListenerCom01AWT.class.getName();
+ final String tstname = TestListenerCom01AWT.class.getName();
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
"filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteGLWindows01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteGLWindows01NEWT.java
index d4e8e7eac..4d662c47f 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteGLWindows01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteGLWindows01NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt;
import org.junit.Assert;
@@ -54,13 +54,13 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
static long durationPerTest = 100; // ms
static String remoteDisplay = "localhost:0.0";
- static GLWindow createWindow(Screen screen, GLCapabilities caps, GLEventListener demo)
+ static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final GLEventListener demo)
throws InterruptedException
{
Assert.assertNotNull(caps);
//
// Create native windowing resources .. X11/Win/OSX
- //
+ //
GLWindow glWindow;
if(null!=screen) {
glWindow = GLWindow.create(screen, caps);
@@ -69,7 +69,7 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
}
-
+
glWindow.addGLEventListener(demo);
glWindow.setSize(512, 512);
@@ -80,7 +80,7 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
return glWindow;
}
- static void destroyWindow(GLWindow glWindow) {
+ static void destroyWindow(final GLWindow glWindow) {
if(null!=glWindow) {
glWindow.destroy();
Assert.assertEquals(false,glWindow.isNativeValid());
@@ -89,16 +89,16 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
@Test
public void testRemoteWindow01() throws InterruptedException {
- Animator animator = new Animator();
- GLProfile glpLocal = GLProfile.getGL2ES1();
+ final Animator animator = new Animator();
+ final GLProfile glpLocal = GLProfile.getGL2ES1();
Assert.assertNotNull(glpLocal);
- GLCapabilities capsLocal = new GLCapabilities(glpLocal);
+ final GLCapabilities capsLocal = new GLCapabilities(glpLocal);
Assert.assertNotNull(capsLocal);
- GearsES1 demoLocal = new GearsES1(1);
- GLWindow windowLocal = createWindow(null, capsLocal, demoLocal); // local with vsync
+ final GearsES1 demoLocal = new GearsES1(1);
+ final GLWindow windowLocal = createWindow(null, capsLocal, demoLocal); // local with vsync
Assert.assertEquals(true,windowLocal.isNativeValid());
Assert.assertEquals(true,windowLocal.isVisible());
- AbstractGraphicsDevice device1 = windowLocal.getScreen().getDisplay().getGraphicsDevice();
+ final AbstractGraphicsDevice device1 = windowLocal.getScreen().getDisplay().getGraphicsDevice();
System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
@@ -120,14 +120,14 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
GLProfile.initProfiles(deviceRemote); // just to make sure
System.err.println();
System.err.println("GLProfiles window2: "+deviceRemote.getConnection()+": "+GLProfile.glAvailabilityToString(deviceRemote));
- GLProfile glpRemote = GLProfile.get(deviceRemote, GLProfile.GL2ES1);
+ final GLProfile glpRemote = GLProfile.get(deviceRemote, GLProfile.GL2ES1);
Assert.assertNotNull(glpRemote);
- GLCapabilities capsRemote = new GLCapabilities(glpRemote);
+ final GLCapabilities capsRemote = new GLCapabilities(glpRemote);
Assert.assertNotNull(capsRemote);
screenRemote = NewtFactory.createScreen(displayRemote, 0); // screen 0
demoRemote = new GearsES1(0);
windowRemote = createWindow(screenRemote, capsRemote, demoRemote); // remote, no vsync
- } catch (NativeWindowException nwe) {
+ } catch (final NativeWindowException nwe) {
System.err.println(nwe);
Assume.assumeNoException(nwe);
destroyWindow(windowLocal);
@@ -138,7 +138,7 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
Assert.assertEquals(true,windowRemote.isVisible());
animator.add(windowRemote);
- animator.setUpdateFPSFrames(1, null);
+ animator.setUpdateFPSFrames(1, null);
animator.start();
while(animator.getTotalFPSDuration()<durationPerTest) {
@@ -153,15 +153,15 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
destroyWindow(windowRemote);
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
@@ -171,7 +171,7 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
}
System.out.println("durationPerTest: "+durationPerTest);
System.out.println("display: "+remoteDisplay);
- String tstname = TestRemoteGLWindows01NEWT.class.getName();
+ final String tstname = TestRemoteGLWindows01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteWindow01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteWindow01NEWT.java
index a26b96e38..06e55a5eb 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteWindow01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteWindow01NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt;
@@ -55,15 +55,15 @@ public class TestRemoteWindow01NEWT extends UITestCase {
height = 480;
}
- static Window createWindow(Screen screen, Capabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
+ static Window createWindow(final Screen screen, final Capabilities caps, final int width, final int height, final boolean onscreen, final boolean undecorated) {
Assert.assertNotNull(caps);
caps.setOnscreen(onscreen);
// System.out.println("Requested: "+caps);
//
// Create native windowing resources .. X11/Win/OSX
- //
- Window window = NewtFactory.createWindow(screen, caps);
+ //
+ final Window window = NewtFactory.createWindow(screen, caps);
Assert.assertNotNull(window);
window.setUndecorated(onscreen && undecorated);
window.setSize(width, height);
@@ -77,10 +77,10 @@ public class TestRemoteWindow01NEWT extends UITestCase {
// System.out.println("Created: "+window);
//
- // Create native OpenGL resources .. XGL/WGL/CGL ..
+ // Create native OpenGL resources .. XGL/WGL/CGL ..
// equivalent to GLAutoDrawable methods: setVisible(true)
- //
- CapabilitiesImmutable chosenCapabilities = window.getGraphicsConfiguration().getChosenCapabilities();
+ //
+ final CapabilitiesImmutable chosenCapabilities = window.getGraphicsConfiguration().getChosenCapabilities();
Assert.assertNotNull(chosenCapabilities);
Assert.assertTrue(chosenCapabilities.getGreenBits()>5);
Assert.assertTrue(chosenCapabilities.getBlueBits()>5);
@@ -90,7 +90,7 @@ public class TestRemoteWindow01NEWT extends UITestCase {
return window;
}
- static void destroyWindow(Display display, Screen screen, Window window) {
+ static void destroyWindow(final Display display, final Screen screen, final Window window) {
if(null!=window) {
window.destroy();
}
@@ -104,10 +104,10 @@ public class TestRemoteWindow01NEWT extends UITestCase {
@Test
public void testRemoteWindow01() throws InterruptedException {
- Capabilities caps = new Capabilities();
- Display display1 = NewtFactory.createDisplay(null); // local display
- Screen screen1 = NewtFactory.createScreen(display1, 0); // screen 0
- Window window1 = createWindow(screen1, caps, width, height, true /* onscreen */, false /* undecorated */);
+ final Capabilities caps = new Capabilities();
+ final Display display1 = NewtFactory.createDisplay(null); // local display
+ final Screen screen1 = NewtFactory.createScreen(display1, 0); // screen 0
+ final Window window1 = createWindow(screen1, caps, width, height, true /* onscreen */, false /* undecorated */);
window1.setVisible(true);
Assert.assertEquals(true,window1.isNativeValid());
@@ -115,16 +115,16 @@ public class TestRemoteWindow01NEWT extends UITestCase {
// Remote Display/Device/Screen/Window ..
Display display2;
- AbstractGraphicsDevice device2;
+ final AbstractGraphicsDevice device2;
Screen screen2;
Window window2;
try {
display2 = NewtFactory.createDisplay(remoteDisplay);
- display2.createNative();
+ display2.createNative();
screen2 = NewtFactory.createScreen(display2, 0); // screen 0
window2 = createWindow(screen2, caps, width, height, true /* onscreen */, false /* undecorated */);
window2.setVisible(true);
- } catch (NativeWindowException nwe) {
+ } catch (final NativeWindowException nwe) {
System.err.println(nwe);
Assume.assumeNoException(nwe);
destroyWindow(display1, screen1, window1);
@@ -140,14 +140,14 @@ public class TestRemoteWindow01NEWT extends UITestCase {
destroyWindow(display2, screen2, window2);
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-display")) {
remoteDisplay = args[++i];
}
}
System.out.println("display: "+remoteDisplay);
- String tstname = TestRemoteWindow01NEWT.class.getName();
+ final String tstname = TestRemoteWindow01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java
index a88b20714..40b60ac69 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -35,17 +35,16 @@ import org.junit.Assert;
import java.lang.reflect.InvocationTargetException;
import java.awt.Frame;
+
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
-
+import javax.swing.WindowConstants;
import javax.media.nativewindow.WindowClosingProtocol.WindowClosingMode;
-
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
-
import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.test.junit.util.AWTRobotUtil.WindowClosingListener;
@@ -57,8 +56,8 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
public void testCloseFrameGLCanvas() throws InterruptedException, InvocationTargetException {
final Frame frame = new Frame("testCloseFrameGLCanvas AWT");
final WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(frame);
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
final GLCanvas glCanvas = new GLCanvas(caps);
glCanvas.addGLEventListener(new GearsES2());
SwingUtilities.invokeAndWait(new Runnable() {
@@ -93,7 +92,7 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
glCanvas.setDefaultCloseOperation(WindowClosingMode.DISPOSE_ON_CLOSE);
op = glCanvas.getDefaultCloseOperation();
Assert.assertEquals(WindowClosingMode.DISPOSE_ON_CLOSE, op);
-
+
Thread.sleep(300);
Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, closingListener)); // no frame close, but GLCanvas's GL resources will be destroyed
@@ -117,9 +116,9 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
public void testCloseJFrameGLCanvas() throws InterruptedException, InvocationTargetException {
final JFrame frame = new JFrame("testCloseJFrameGLCanvas AWT");
final WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(frame);
-
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
final GLCanvas glCanvas = new GLCanvas(caps);
glCanvas.addGLEventListener(new GearsES2());
SwingUtilities.invokeAndWait(new Runnable() {
@@ -136,12 +135,12 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
//
// close with op: DO_NOTHING_ON_CLOSE -> NOP / HIDE (default)
//
- Assert.assertEquals(JFrame.HIDE_ON_CLOSE, frame.getDefaultCloseOperation());
+ Assert.assertEquals(WindowConstants.HIDE_ON_CLOSE, frame.getDefaultCloseOperation());
WindowClosingMode op = glCanvas.getDefaultCloseOperation();
Assert.assertEquals(WindowClosingMode.DO_NOTHING_ON_CLOSE, op);
Thread.sleep(300);
-
+
Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, closingListener)); // hide
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, false)); // hide -> invisible
Assert.assertEquals(true, frame.isDisplayable());
@@ -161,8 +160,8 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
//
// close with op (JFrame): DISPOSE_ON_CLOSE -- GLCanvas --> dispose
//
- frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- Assert.assertEquals(JFrame.DISPOSE_ON_CLOSE, frame.getDefaultCloseOperation());
+ frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+ Assert.assertEquals(WindowConstants.DISPOSE_ON_CLOSE, frame.getDefaultCloseOperation());
op = glCanvas.getDefaultCloseOperation();
Assert.assertEquals(WindowClosingMode.DISPOSE_ON_CLOSE, op);
@@ -174,8 +173,8 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
Assert.assertEquals(false, glCanvas.isRealized());
}
- public static void main(String[] args) {
- String tstname = TestWindowClosingProtocol01AWT.class.getName();
+ public static void main(final String[] args) {
+ final String tstname = TestWindowClosingProtocol01AWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java
index 020581cb0..ab57065b9 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -52,8 +52,8 @@ public class TestWindowClosingProtocol02NEWT extends UITestCase {
@Test
public void testCloseGLWindow() throws InterruptedException, InvocationTargetException {
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
final GLWindow glWindow = GLWindow.create(caps);
final AWTRobotUtil.WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(glWindow);
@@ -72,7 +72,7 @@ public class TestWindowClosingProtocol02NEWT extends UITestCase {
glWindow.setDefaultCloseOperation(WindowClosingMode.DO_NOTHING_ON_CLOSE);
op = glWindow.getDefaultCloseOperation();
Assert.assertEquals(WindowClosingMode.DO_NOTHING_ON_CLOSE, op);
-
+
Thread.sleep(300);
Assert.assertEquals(true, AWTRobotUtil.closeWindow(glWindow, false, closingListener)); // nop
@@ -92,8 +92,8 @@ public class TestWindowClosingProtocol02NEWT extends UITestCase {
Assert.assertEquals(true, closingListener.isWindowClosing());
}
- public static void main(String[] args) {
- String tstname = TestWindowClosingProtocol02NEWT.class.getName();
+ public static void main(final String[] args) {
+ final String tstname = TestWindowClosingProtocol02NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
index efc833d88..e458862d0 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -30,22 +30,22 @@ package com.jogamp.opengl.test.junit.newt;
import com.jogamp.newt.awt.NewtCanvasAWT;
import com.jogamp.newt.opengl.GLWindow;
+
import org.junit.Test;
import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
import org.junit.Assert;
import java.lang.reflect.InvocationTargetException;
+
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
-
+import javax.swing.WindowConstants;
import javax.media.nativewindow.WindowClosingProtocol.WindowClosingMode;
-
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;
import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
-
import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.test.junit.util.AWTRobotUtil.WindowClosingListener;
@@ -57,9 +57,9 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
public void testCloseJFrameNewtCanvasAWT() throws InterruptedException, InvocationTargetException {
final JFrame frame = new JFrame("testCloseJFrameNewtCanvasAWT");
final WindowClosingListener awtClosingListener = AWTRobotUtil.addClosingListener(frame);
-
- GLProfile glp = GLProfile.getGL2ES2();
- GLCapabilities caps = new GLCapabilities(glp);
+
+ final GLProfile glp = GLProfile.getGL2ES2();
+ final GLCapabilities caps = new GLCapabilities(glp);
final GLWindow glWindow = GLWindow.create(caps);
final AWTRobotUtil.WindowClosingListener newtClosingListener = AWTRobotUtil.addClosingListener(glWindow);
@@ -87,15 +87,15 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
// close with op: DO_NOTHING_ON_CLOSE -> NOP / HIDE (default)
//
{
- Assert.assertEquals(JFrame.HIDE_ON_CLOSE, frame.getDefaultCloseOperation());
- WindowClosingMode op = newtCanvas.getDefaultCloseOperation();
+ Assert.assertEquals(WindowConstants.HIDE_ON_CLOSE, frame.getDefaultCloseOperation());
+ final WindowClosingMode op = newtCanvas.getDefaultCloseOperation();
Assert.assertEquals(WindowClosingMode.DO_NOTHING_ON_CLOSE, op);
}
Thread.sleep(300);
-
+
Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, awtClosingListener)); // hide
- Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, false)); // hide -> invisible
+ Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, false)); // hide -> invisible
Assert.assertEquals(true, frame.isDisplayable());
Assert.assertEquals(false, frame.isVisible());
Assert.assertEquals(true, newtCanvas.isValid());
@@ -116,17 +116,17 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, true));
Assert.assertEquals(true, frame.isDisplayable());
Assert.assertEquals(true, frame.isVisible());
-
+
//
// close with op (JFrame): DISPOSE_ON_CLOSE -- newtCanvas -- glWindow --> dispose
//
{
- frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- Assert.assertEquals(JFrame.DISPOSE_ON_CLOSE, frame.getDefaultCloseOperation());
- WindowClosingMode op = newtCanvas.getDefaultCloseOperation();
+ frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+ Assert.assertEquals(WindowConstants.DISPOSE_ON_CLOSE, frame.getDefaultCloseOperation());
+ final WindowClosingMode op = newtCanvas.getDefaultCloseOperation();
Assert.assertEquals(WindowClosingMode.DISPOSE_ON_CLOSE, op);
}
-
+
Thread.sleep(300);
Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, true, awtClosingListener));
@@ -142,8 +142,8 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
Assert.assertEquals(true, newtClosingListener.isWindowClosed());
}
- public static void main(String[] args) {
- String tstname = TestWindowClosingProtocol03NewtAWT.class.getName();
+ public static void main(final String[] args) {
+ final String tstname = TestWindowClosingProtocol03NewtAWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java
index 02ea610d8..153da2666 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java
@@ -52,7 +52,7 @@ public class TestWindows01NEWT extends UITestCase {
height = 256;
}
- static Window createWindow(Capabilities caps, int x, int y, int width, int height, boolean onscreen, boolean undecorated) throws InterruptedException {
+ static Window createWindow(final Capabilities caps, final int x, final int y, final int width, final int height, final boolean onscreen, final boolean undecorated) throws InterruptedException {
final boolean userPos = x>=0 && y>=0 ; // user has specified a position
Assert.assertNotNull(caps);
@@ -62,10 +62,10 @@ public class TestWindows01NEWT extends UITestCase {
//
// Create native windowing resources .. X11/Win/OSX
//
- Window window = NewtFactory.createWindow(caps);
+ final Window window = NewtFactory.createWindow(caps);
Assert.assertNotNull(window);
- Screen screen = window.getScreen();
- Display display = screen.getDisplay();
+ final Screen screen = window.getScreen();
+ final Display display = screen.getDisplay();
window.setUndecorated(onscreen && undecorated);
if(userPos) {
window.setPosition(x, y);
@@ -92,7 +92,7 @@ public class TestWindows01NEWT extends UITestCase {
Assert.assertEquals(y, window.getY());
} */
- CapabilitiesImmutable chosenCapabilities = window.getGraphicsConfiguration().getChosenCapabilities();
+ final CapabilitiesImmutable chosenCapabilities = window.getGraphicsConfiguration().getChosenCapabilities();
Assert.assertNotNull(chosenCapabilities);
Assert.assertTrue(chosenCapabilities.getGreenBits()>=5);
Assert.assertTrue(chosenCapabilities.getBlueBits()>=5);
@@ -102,12 +102,12 @@ public class TestWindows01NEWT extends UITestCase {
return window;
}
- static void destroyWindow(Window window, boolean last) {
+ static void destroyWindow(final Window window, final boolean last) {
if(null==window) {
return;
}
- Screen screen = window.getScreen();
- Display display = screen.getDisplay();
+ final Screen screen = window.getScreen();
+ final Display display = screen.getDisplay();
window.destroy();
// System.err.println("************* Destroyed: "+window);
if(last) {
@@ -124,29 +124,29 @@ public class TestWindows01NEWT extends UITestCase {
@Test
public void testWindowDecorSimpleWMPos() throws InterruptedException {
- Capabilities caps = new Capabilities();
+ final Capabilities caps = new Capabilities();
Assert.assertNotNull(caps);
- Window window = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
+ final Window window = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
destroyWindow(window, true);
}
@Test
public void testWindowDecorSimpleUserPos() throws InterruptedException {
- Capabilities caps = new Capabilities();
+ final Capabilities caps = new Capabilities();
Assert.assertNotNull(caps);
- Window window = createWindow(caps, 100, 100, width, height, true /* onscreen */, false /* undecorated */);
+ final Window window = createWindow(caps, 100, 100, width, height, true /* onscreen */, false /* undecorated */);
destroyWindow(window, true);
}
@Test
public void testWindowNativeRecreate01Simple() throws InterruptedException {
- Capabilities caps = new Capabilities();
+ final Capabilities caps = new Capabilities();
Assert.assertNotNull(caps);
- Window window = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
+ final Window window = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
destroyWindow(window, true);
window.setVisible(true);
@@ -160,27 +160,27 @@ public class TestWindows01NEWT extends UITestCase {
@Test
public void testWindowDecorDestroyWinTwiceA() throws InterruptedException {
- Capabilities caps = new Capabilities();
+ final Capabilities caps = new Capabilities();
Assert.assertNotNull(caps);
- Window window = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
+ final Window window = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
destroyWindow(window, true);
destroyWindow(window, true);
}
@Test
public void testWindowDecorTwoWin() throws InterruptedException {
- Capabilities caps = new Capabilities();
+ final Capabilities caps = new Capabilities();
Assert.assertNotNull(caps);
- Window window1 = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
- Window window2 = createWindow(caps, 100, 100, width, height, true /* onscreen */, false /* undecorated */);
+ final Window window1 = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
+ final Window window2 = createWindow(caps, 100, 100, width, height, true /* onscreen */, false /* undecorated */);
destroyWindow(window2, false);
destroyWindow(window1, true);
}
- public static void main(String args[]) throws IOException {
- String tstname = TestWindows01NEWT.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestWindows01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java
index 609d443aa..acc53b2f9 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,22 +20,22 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt;
import com.jogamp.newt.event.*;
class WindowEventCom1 extends WindowAdapter {
- public void windowResized(WindowEvent e) {
+ public void windowResized(final WindowEvent e) {
e.setAttachment(new String("WindowEventCom1.windowResized: "+e));
}
- public void windowMoved(WindowEvent e) {
+ public void windowMoved(final WindowEvent e) {
e.setAttachment(new String("WindowEventCom1.windowMoved: "+e));
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java
index d15a3ccd8..e563e768f 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,26 +20,26 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt;
import com.jogamp.newt.event.*;
class WindowEventCom2 extends WindowAdapter {
- public void windowResized(WindowEvent e) {
- String str = (String) e.getAttachment();
+ public void windowResized(final WindowEvent e) {
+ final String str = (String) e.getAttachment();
if(null==str) {
e.setAttachment(new String("WindowEventCom2.windowResized: "+e));
}
}
- public void windowMoved(WindowEvent e) {
- String str = (String) e.getAttachment();
+ public void windowMoved(final WindowEvent e) {
+ final String str = (String) e.getAttachment();
if(null==str) {
e.setAttachment(new String("WindowEventCom2.windowMoved: "+e));
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom3.java b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom3.java
index 87e5eccbb..d3dd6b5f9 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom3.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom3.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,24 +20,24 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt;
import com.jogamp.newt.event.*;
class WindowEventCom3 extends WindowAdapter {
- public void windowResized(WindowEvent e) {
- String str = (String) e.getAttachment();
+ public void windowResized(final WindowEvent e) {
+ final String str = (String) e.getAttachment();
System.out.println("WindowEventCom3.windowResized: "+str);
}
- public void windowMoved(WindowEvent e) {
- String str = (String) e.getAttachment();
+ public void windowMoved(final WindowEvent e) {
+ final String str = (String) e.getAttachment();
System.out.println("WindowEventCom3.windowMoved: "+str);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java b/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java
index a46e21b23..6fa070b07 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java
@@ -89,7 +89,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
private volatile int _eventCount ;
private ArrayList<String> _failures = new ArrayList<String>() ;
- public synchronized void setModifierCheckEnabled( boolean value ) {
+ public synchronized void setModifierCheckEnabled( final boolean value ) {
_modifierCheckEnabled = value ;
}
@@ -104,13 +104,13 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
* in this test code it's probably ok.
*/
- public synchronized void setExpectedModifiers( int value ) {
+ public synchronized void setExpectedModifiers( final int value ) {
_expectedModifiers = value ;
clear();
}
public synchronized ArrayList<String> clear() {
- ArrayList<String> old = _failures;
+ final ArrayList<String> old = _failures;
_eventCount = 0;
@@ -122,7 +122,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
return old;
}
- public ArrayList<String> getFailures(int waitEventCount) {
+ public ArrayList<String> getFailures(final int waitEventCount) {
int j;
for(j=0; j < 20 && _eventCount < waitEventCount; j++) { // wait until events are collected
_robot.delay(MS_ROBOT_AUTO_DELAY);
@@ -133,7 +133,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
return clear();
}
- private synchronized void _checkModifiers( com.jogamp.newt.event.MouseEvent hasEvent ) {
+ private synchronized void _checkModifiers( final com.jogamp.newt.event.MouseEvent hasEvent ) {
if( _modifierCheckEnabled ) {
final MouseEvent expEvent = new MouseEvent(hasEvent.getEventType(), hasEvent.getSource(), hasEvent.getWhen(), _expectedModifiers,
@@ -152,7 +152,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
}
}
- private synchronized void _checkModifierMask( com.jogamp.newt.event.MouseEvent expEvent, com.jogamp.newt.event.MouseEvent hasEvent, int mask, String maskS ) {
+ private synchronized void _checkModifierMask( final com.jogamp.newt.event.MouseEvent expEvent, final com.jogamp.newt.event.MouseEvent hasEvent, final int mask, final String maskS ) {
// If the "no event delivery" failure is still in the list then
// get rid of it since that obviously isn't true anymore. We
@@ -164,7 +164,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
}
if( ( hasEvent.getModifiers() & mask ) != ( expEvent.getModifiers() & mask ) ) {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append( com.jogamp.newt.event.MouseEvent.getEventTypeString( hasEvent.getEventType() ) ).append(": mask ").append(maskS).append(" 0x").append(Integer.toHexString(mask));
sb.append(", eventCount ").append(_eventCount).append(", expected:");
expEvent.getModifiersString(sb);
@@ -176,7 +176,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
}
}
- public synchronized void mousePressed( com.jogamp.newt.event.MouseEvent event ) {
+ public synchronized void mousePressed( final com.jogamp.newt.event.MouseEvent event ) {
_eventCount++;
if( _debug ) {
_debugPrintStream.println( "MousePressed "+_eventCount+": "+event);
@@ -184,7 +184,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
_checkModifiers( event ) ;
}
- public synchronized void mouseReleased( com.jogamp.newt.event.MouseEvent event ) {
+ public synchronized void mouseReleased( final com.jogamp.newt.event.MouseEvent event ) {
_eventCount++;
if( _debug ) {
_debugPrintStream.println( "MouseReleased "+_eventCount+": "+event);
@@ -192,7 +192,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
_checkModifiers( event ) ;
}
- public synchronized void mouseDragged( com.jogamp.newt.event.MouseEvent event ) {
+ public synchronized void mouseDragged( final com.jogamp.newt.event.MouseEvent event ) {
_eventCount++;
if( _debug ) {
_debugPrintStream.println( "MouseDragged "+_eventCount+": "+event);
@@ -204,7 +204,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
// IGNORED
//
- public synchronized void mouseMoved( com.jogamp.newt.event.MouseEvent event ) {
+ public synchronized void mouseMoved( final com.jogamp.newt.event.MouseEvent event ) {
// Ignored, since mouse MOVE doesn't hold mouse button, we look for DRAGGED!
// _eventCount++;
if( _debug ) {
@@ -213,7 +213,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
// _checkModifiers( event ) ;
}
- public synchronized void mouseClicked( com.jogamp.newt.event.MouseEvent event ) {
+ public synchronized void mouseClicked( final com.jogamp.newt.event.MouseEvent event ) {
// Ignored, since we look for PRESS/RELEASE only!
// _eventCount++;
if( _debug ) {
@@ -222,7 +222,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
// _checkModifiers( event ) ;
}
- public synchronized void mouseWheelMoved( com.jogamp.newt.event.MouseEvent event ) {
+ public synchronized void mouseWheelMoved( final com.jogamp.newt.event.MouseEvent event ) {
// _eventCount++;
if( _debug ) {
_debugPrintStream.println( "MouseWheeleMoved ignored: "+event);
@@ -230,7 +230,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
// _checkModifiers( event ) ;
}
- public synchronized void mouseEntered( com.jogamp.newt.event.MouseEvent event ) {
+ public synchronized void mouseEntered( final com.jogamp.newt.event.MouseEvent event ) {
// _eventCount++;
if( _debug ) {
_debugPrintStream.println( "MouseEntered ignored: "+event);
@@ -238,7 +238,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
// _checkModifiers( event ) ;
}
- public synchronized void mouseExited( com.jogamp.newt.event.MouseEvent event ) {
+ public synchronized void mouseExited( final com.jogamp.newt.event.MouseEvent event ) {
// _eventCount++;
if( _debug ) {
_debugPrintStream.println( "MouseExited ignored: "+event);
@@ -259,7 +259,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
////////////////////////////////////////////////////////////////////////////
- public static int getAWTButtonMask(int button) {
+ public static int getAWTButtonMask(final int button) {
// Java7: java.awt.event.InputEvent.getMaskForButton( n + 1 ) ; -> using InputEvent.BUTTON1_DOWN_MASK .. etc
// Java6: Only use BUTTON1_MASK, ..
int m;
@@ -331,10 +331,10 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
protected void eventDispatch() {
try {
Thread.sleep(100);
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
}
- private void execOffThreadWithOnThreadEventDispatch(Runnable testAction) throws Exception {
+ private void execOffThreadWithOnThreadEventDispatch(final Runnable testAction) throws Exception {
_testMouseListener.setModifierCheckEnabled( false ) ;
_robot.setAutoDelay( MS_ROBOT_AUTO_DELAY ) ;
{
@@ -394,7 +394,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
public void run() {
try {
_doSingleButtonPressAndRelease( 0, 0 );
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (final Exception e) { throw new RuntimeException(e); }
} } );
}
@@ -404,7 +404,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
public void run() {
try {
_doSingleButtonPressAndRelease( java.awt.event.KeyEvent.VK_SHIFT, java.awt.event.InputEvent.SHIFT_DOWN_MASK ) ;
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (final Exception e) { throw new RuntimeException(e); }
} } );
}
@@ -414,7 +414,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
public void run() {
try {
_doSingleButtonPressAndRelease( java.awt.event.KeyEvent.VK_CONTROL, java.awt.event.InputEvent.CTRL_DOWN_MASK ) ;
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (final Exception e) { throw new RuntimeException(e); }
} } );
}
@@ -467,7 +467,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
public void run() {
try {
_doHoldOneButtonAndPressAnother( 0, 0 ) ;
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (final Exception e) { throw new RuntimeException(e); }
} } );
}
@@ -477,7 +477,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
public void run() {
try {
_doPressAllButtonsInSequence( 0, 0 ) ;
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (final Exception e) { throw new RuntimeException(e); }
} } );
}
@@ -487,7 +487,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
public void run() {
try {
_doSingleButtonClickAndDrag( 0, 0 ) ;
- } catch (Exception e) { throw new RuntimeException(e); }
+ } catch (final Exception e) { throw new RuntimeException(e); }
} } );
}
@@ -501,7 +501,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
for (int n = 0 ; n < _numButtonsToTest ; ++n) {
- int awtButtonMask = _awtButtonMasks[n] ;
+ final int awtButtonMask = _awtButtonMasks[n] ;
if( _debug ) { _debugPrintStream.println( "*** pressing button " + ( n + 1 ) ) ; }
_testMouseListener.setExpectedModifiers( _getNewtModifiersForAwtExtendedModifiers( keyModifierMask | awtButtonMask ) ) ;
@@ -527,7 +527,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
for (int n = 0 ; n < _numButtonsToTest ; ++n) {
- int awtButtonMask = _awtButtonMasks[n] ;
+ final int awtButtonMask = _awtButtonMasks[n] ;
if( _debug ) { _debugPrintStream.println( "*** pressing button " + ( n + 1 ) ) ; }
_testMouseListener.setExpectedModifiers( _getNewtModifiersForAwtExtendedModifiers( keyModifierMask | awtButtonMask ) ) ;
@@ -606,7 +606,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
for (int n = 0 ; n < _numButtonsToTest ; ++n) {
- int awtButtonMask = _awtButtonMasks[n] ;
+ final int awtButtonMask = _awtButtonMasks[n] ;
if( _debug ) { _debugPrintStream.println( "*** pressing button " + ( n + 1 ) ) ; }
_testMouseListener.setExpectedModifiers( _getNewtModifiersForAwtExtendedModifiers( keyModifierMask | awtButtonMask ) ) ;
@@ -636,10 +636,10 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
////////////////////////////////////////////////////////////////////////////
- private void _doKeyPress( int keyCode ) {
+ private void _doKeyPress( final int keyCode ) {
AWTRobotUtil.validateAWTEDTIsAlive();
if( keyCode != 0 ) {
- boolean modifierCheckEnabled = _testMouseListener.modifierCheckEnabled() ;
+ final boolean modifierCheckEnabled = _testMouseListener.modifierCheckEnabled() ;
_testMouseListener.setModifierCheckEnabled( false ) ;
_robot.keyPress( keyCode ) ;
_robot.delay(MS_ROBOT_KEY_PRESS_DELAY);
@@ -649,10 +649,10 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
////////////////////////////////////////////////////////////////////////////
- private void _doKeyRelease( int keyCode ) {
+ private void _doKeyRelease( final int keyCode ) {
AWTRobotUtil.validateAWTEDTIsAlive();
if( keyCode != 0 ) {
- boolean modifierCheckEnabled = _testMouseListener.modifierCheckEnabled() ;
+ final boolean modifierCheckEnabled = _testMouseListener.modifierCheckEnabled() ;
_testMouseListener.setModifierCheckEnabled( false ) ;
_robot.keyRelease( keyCode ) ;
_robot.delay(MS_ROBOT_KEY_RELEASE_DELAY);
@@ -662,11 +662,11 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
////////////////////////////////////////////////////////////////////////////
- private void _checkFailures(String descr, int waitEventCount) {
- ArrayList<String> failures = _testMouseListener.getFailures(waitEventCount) ;
+ private void _checkFailures(final String descr, final int waitEventCount) {
+ final ArrayList<String> failures = _testMouseListener.getFailures(waitEventCount) ;
_debugPrintStream.print(getSimpleTestName(".")+" - "+descr+": ");
- int numFailures = failures.size() ;
+ final int numFailures = failures.size() ;
if( numFailures == 0 ) {
_debugPrintStream.println( " PASSED" ) ;
} else {
@@ -706,7 +706,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
_robot.setAutoDelay( MS_ROBOT_AUTO_DELAY ) ;
- boolean modifierCheckEnabled = _testMouseListener.modifierCheckEnabled() ;
+ final boolean modifierCheckEnabled = _testMouseListener.modifierCheckEnabled() ;
_testMouseListener.setModifierCheckEnabled( false ) ;
{
@@ -746,7 +746,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
* The equivalent NEWT modifiers.
*/
- private int _getNewtModifiersForAwtExtendedModifiers( int awtExtendedModifiers ) {
+ private int _getNewtModifiersForAwtExtendedModifiers( final int awtExtendedModifiers ) {
int mask = 0 ;
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java
index a459a7f1f..194edbcb5 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java
@@ -97,8 +97,8 @@ public class TestNewtEventModifiersAWTCanvas extends BaseNewtEventModifiers {
////////////////////////////////////////////////////////////////////////////
- public static void main(String args[]) throws Exception {
- String testName = TestNewtEventModifiersAWTCanvas.class.getName() ;
+ public static void main(final String args[]) throws Exception {
+ final String testName = TestNewtEventModifiersAWTCanvas.class.getName() ;
org.junit.runner.JUnitCore.main( testName ) ;
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java
index c4bd3eb71..d34c36072 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.event;
import javax.media.opengl.GLCapabilities;
@@ -60,10 +60,10 @@ public class TestNewtEventModifiersNEWTWindowAWT extends BaseNewtEventModifiers
_glWindow.setSize(TEST_FRAME_WIDTH, TEST_FRAME_HEIGHT);
_glWindow.setPosition(TEST_FRAME_X, TEST_FRAME_Y);
_glWindow.setVisible(true);
-
+
Assert.assertTrue(AWTRobotUtil.waitForVisible(_glWindow, true));
Assert.assertTrue(AWTRobotUtil.waitForRealized(_glWindow, true));
-
+
AWTRobotUtil.assertRequestFocusAndWait(null, _glWindow, _glWindow, null, null); // programmatic
Assert.assertNotNull(_robot);
AWTRobotUtil.requestFocus(_robot, _glWindow, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
@@ -78,8 +78,8 @@ public class TestNewtEventModifiersNEWTWindowAWT extends BaseNewtEventModifiers
////////////////////////////////////////////////////////////////////////////
- public static void main(String args[]) throws Exception {
- String testName = TestNewtEventModifiersNEWTWindowAWT.class.getName() ;
+ public static void main(final String args[]) throws Exception {
+ final String testName = TestNewtEventModifiersNEWTWindowAWT.class.getName() ;
org.junit.runner.JUnitCore.main( testName ) ;
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java
index 0abadb0d4..c916ddc4d 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.event ;
import java.awt.BorderLayout ;
@@ -70,27 +70,27 @@ public class TestNewtEventModifiersNewtCanvasAWT extends BaseNewtEventModifiers
_testFrame.setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE ) ;
{
- GLCapabilities caps = new GLCapabilities( GLProfile.getGL2ES2() ) ;
+ final GLCapabilities caps = new GLCapabilities( GLProfile.getGL2ES2() ) ;
_glWindow = GLWindow.create( caps ) ;
- NewtCanvasAWT canvas = new NewtCanvasAWT( _glWindow ) ;
+ final NewtCanvasAWT canvas = new NewtCanvasAWT( _glWindow ) ;
_testFrame.getContentPane().add( canvas, BorderLayout.CENTER ) ;
_glWindow.addGLEventListener( new RedSquareES2() ) ;
}
_testFrame.setBounds( TEST_FRAME_X, TEST_FRAME_Y, TEST_FRAME_WIDTH, TEST_FRAME_HEIGHT ) ;
- _testFrame.setVisible( true ) ;
+ _testFrame.setVisible( true ) ;
}
} ) ;
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(_testFrame, true));
Assert.assertTrue(AWTRobotUtil.waitForVisible(_glWindow, true));
- Assert.assertTrue(AWTRobotUtil.waitForRealized(_glWindow, true));
-
+ Assert.assertTrue(AWTRobotUtil.waitForRealized(_glWindow, true));
+
AWTRobotUtil.assertRequestFocusAndWait(null, _glWindow, _glWindow, null, null); // programmatic
Assert.assertNotNull(_robot);
AWTRobotUtil.requestFocus(_robot, _glWindow, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
-
+
_glWindow.addMouseListener( _testMouseListener ) ;
}
@@ -111,8 +111,8 @@ public class TestNewtEventModifiersNewtCanvasAWT extends BaseNewtEventModifiers
////////////////////////////////////////////////////////////////////////////
- public static void main(String args[]) throws Exception {
- String testName = TestNewtEventModifiersNewtCanvasAWT.class.getName() ;
+ public static void main(final String args[]) throws Exception {
+ final String testName = TestNewtEventModifiersNewtCanvasAWT.class.getName() ;
org.junit.runner.JUnitCore.main( testName ) ;
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWTAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWTAWT.java
index 2a6b8ba19..3e4029cf5 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWTAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWTAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.event;
import org.eclipse.swt.SWT ;
@@ -63,12 +63,12 @@ public class TestNewtEventModifiersNewtCanvasSWTAWT extends BaseNewtEventModifie
private static GLWindow _glWindow ;
////////////////////////////////////////////////////////////////////////////
-
+
protected static void eventDispatchImpl() {
final int maxEvents = 10;
try {
Thread.sleep(100);
- } catch (InterruptedException e) { }
+ } catch (final InterruptedException e) { }
final boolean[] res = { false };
int i=0;
do {
@@ -83,29 +83,29 @@ public class TestNewtEventModifiersNewtCanvasSWTAWT extends BaseNewtEventModifie
i++;
} while( i<maxEvents && res[0] );
}
-
+
@Override
protected void eventDispatch() {
eventDispatchImpl();
}
-
+
////////////////////////////////////////////////////////////////////////////
@BeforeClass
public static void beforeClass() throws Exception {
- // FIXME: Hangs .. w/ Java7 .. every now and then!
+ // FIXME: Hangs .. w/ Java7 .. every now and then!
setTestSupported(false);
-
+
/***
SWTAccessor.invoke(true, new Runnable() {
- public void run() {
+ public void run() {
_display = new Display();
}});
Assert.assertNotNull( _display );
-
+
SWTAccessor.invoke(_display, true, new Runnable() {
- public void run() {
+ public void run() {
_shell = new Shell( _display );
Assert.assertNotNull( _shell );
_shell.setText( "Event Modifier Test NewtCanvasSWT" ) ;
@@ -122,24 +122,24 @@ public class TestNewtEventModifiersNewtCanvasSWTAWT extends BaseNewtEventModifie
NewtCanvasSWT.create( _composite, SWT.NO_BACKGROUND, _glWindow ) ;
}
-
+
SWTAccessor.invoke(_display, true, new Runnable() {
public void run() {
_shell.setBounds( TEST_FRAME_X, TEST_FRAME_Y, TEST_FRAME_WIDTH, TEST_FRAME_HEIGHT ) ;
_shell.open();
}
});
-
+
// no AWT idling, may deadlock on OSX!
Assert.assertNotNull(_robot);
_robot.setAutoWaitForIdle( false ) ;
-
+
// no waiting for results ..
AWTRobotUtil.requestFocus(null, _glWindow, false); // programmatic
eventDispatchImpl();
AWTRobotUtil.requestFocus(_robot, _glWindow, INITIAL_MOUSE_X, INITIAL_MOUSE_Y);
eventDispatchImpl();
-
+
_glWindow.addMouseListener( _testMouseListener ) ;
*/
}
@@ -153,7 +153,7 @@ public class TestNewtEventModifiersNewtCanvasSWTAWT extends BaseNewtEventModifie
try {
SWTAccessor.invoke(_display, true, new Runnable() {
- public void run() {
+ public void run() {
if( null != _composite ) {
_composite.dispose();
}
@@ -173,8 +173,8 @@ public class TestNewtEventModifiersNewtCanvasSWTAWT extends BaseNewtEventModifie
////////////////////////////////////////////////////////////////////////////
- public static void main(String args[]) throws Exception {
- String testName = TestNewtEventModifiersNewtCanvasSWTAWT.class.getName() ;
+ public static void main(final String args[]) throws Exception {
+ final String testName = TestNewtEventModifiersNewtCanvasSWTAWT.class.getName() ;
org.junit.runner.JUnitCore.main( testName ) ;
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodeModifiersAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodeModifiersAWT.java
index 2516fc536..eebbe5469 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodeModifiersAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodeModifiersAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.event;
import org.junit.After;
@@ -65,7 +65,7 @@ import com.jogamp.opengl.test.junit.util.*;
/**
* Testing combinations of key code modifiers of key event.
- *
+ *
* <p>
* Due to limitation of AWT Robot, the test machine needs to have US keyboard enabled,
* even though we do unify VK codes to US keyboard across all layouts.
@@ -89,35 +89,35 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
@AfterClass
public static void release() {
}
-
+
@Before
- public void initTest() {
+ public void initTest() {
}
@After
- public void releaseTest() {
+ public void releaseTest() {
}
-
+
@Test(timeout=180000) // TO 3 min
public void test01NEWT() throws AWTException, InterruptedException, InvocationTargetException {
- GLWindow glWindow = GLWindow.create(glCaps);
+ final GLWindow glWindow = GLWindow.create(glCaps);
glWindow.setSize(width, height);
glWindow.setVisible(true);
-
+
testImpl(glWindow);
-
+
glWindow.destroy();
}
-
- private void testNewtCanvasAWT_Impl(boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
- GLWindow glWindow = GLWindow.create(glCaps);
-
+
+ private void testNewtCanvasAWT_Impl(final boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
+ final GLWindow glWindow = GLWindow.create(glCaps);
+
// Wrap the window in a canvas.
final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
if( !onscreen ) {
newtCanvasAWT.setShallUseOffscreenLayer(true);
}
-
+
// Add the canvas to a frame, and make it all visible.
final JFrame frame1 = new JFrame("Swing AWT Parent Frame: "+ glWindow.getTitle());
frame1.getContentPane().add(newtCanvasAWT, BorderLayout.CENTER);
@@ -126,24 +126,24 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
public void run() {
frame1.setVisible(true);
} } );
-
+
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame1, true));
-
+
testImpl(glWindow);
-
+
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame1.setVisible(false);
frame1.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
- }
- glWindow.destroy();
+ }
+ glWindow.destroy();
}
-
+
@Test(timeout=180000) // TO 3 min
public void test02NewtCanvasAWT_Onscreen() throws AWTException, InterruptedException, InvocationTargetException {
if( JAWTUtil.isOffscreenLayerRequired() ) {
@@ -152,7 +152,7 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
}
testNewtCanvasAWT_Impl(true);
}
-
+
@Test(timeout=180000) // TO 3 min
public void test03NewtCanvasAWT_Offsccreen() throws AWTException, InterruptedException, InvocationTargetException {
if( !JAWTUtil.isOffscreenLayerSupported() ) {
@@ -161,9 +161,9 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
}
testNewtCanvasAWT_Impl(false);
}
-
- static void testKeyCodeModifier(Robot robot, NEWTKeyAdapter keyAdapter, short modifierKey, int modifierMask, short keyCode,
- char keyCharOnly, char keyCharMod) {
+
+ static void testKeyCodeModifier(final Robot robot, final NEWTKeyAdapter keyAdapter, final short modifierKey, final int modifierMask, final short keyCode,
+ final char keyCharOnly, final char keyCharMod) {
keyAdapter.reset();
AWTRobotUtil.waitForIdle(robot);
AWTRobotUtil.newtKeyPress(0, robot, true, keyCode, 10); // press keyCode
@@ -172,107 +172,107 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
for(int j=0; j < 100 && keyAdapter.getQueueSize() < 2; j++) { // wait until events are collected
robot.delay(100);
}
-
+
AWTRobotUtil.waitForIdle(robot);
AWTRobotUtil.newtKeyPress(0, robot, true, modifierKey, 10); // press MOD
AWTRobotUtil.newtKeyPress(0, robot, true, keyCode, 10); // press keyCode
- AWTRobotUtil.newtKeyPress(0, robot, false, keyCode, 10); // release keyCode
+ AWTRobotUtil.newtKeyPress(0, robot, false, keyCode, 10); // release keyCode
AWTRobotUtil.newtKeyPress(0, robot, false, modifierKey, 100); // release MOD
AWTRobotUtil.waitForIdle(robot);
for(int j=0; j < 100 && keyAdapter.getQueueSize() < 2+4; j++) { // wait until events are collected
robot.delay(100);
}
NEWTKeyUtil.validateKeyAdapterStats(keyAdapter,
- 3 /* press-SI */, 3 /* release-SI */,
+ 3 /* press-SI */, 3 /* release-SI */,
0 /* press-AR */, 0 /* release-AR */ );
-
+
final List<EventObject> queue = keyAdapter.copyQueue();
int i=0;
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED, 0, keyCode, keyCharOnly);
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_RELEASED, 0, keyCode, keyCharOnly);
-
+
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED, modifierMask, modifierKey, KeyEvent.NULL_CHAR);
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED, modifierMask, keyCode, keyCharMod);
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_RELEASED, modifierMask, keyCode, keyCharMod);
- KeyEvent e = (KeyEvent) queue.get(i++);
+ final KeyEvent e = (KeyEvent) queue.get(i++);
NEWTKeyUtil.validateKeyEvent(e, KeyEvent.EVENT_KEY_RELEASED, modifierMask, modifierKey, KeyEvent.NULL_CHAR);
}
-
- static void testKeyCodeAllModifierV1(Robot robot, NEWTKeyAdapter keyAdapter) {
+
+ static void testKeyCodeAllModifierV1(final Robot robot, final NEWTKeyAdapter keyAdapter) {
final short m1k = KeyEvent.VK_ALT;
final int m1m = InputEvent.ALT_MASK;
final short m2k = KeyEvent.VK_CONTROL;
final int m2m = InputEvent.CTRL_MASK;
final short m3k = KeyEvent.VK_SHIFT;
final int m3m = InputEvent.SHIFT_MASK;
-
+
keyAdapter.reset();
AWTRobotUtil.waitForIdle(robot);
AWTRobotUtil.newtKeyPress(0, robot, true, m1k, 10); // press MOD1
AWTRobotUtil.newtKeyPress(0, robot, true, m2k, 10); // press MOD2
AWTRobotUtil.newtKeyPress(0, robot, true, m3k, 10); // press MOD3
AWTRobotUtil.newtKeyPress(0, robot, true, KeyEvent.VK_1, 10); // press P
-
- AWTRobotUtil.newtKeyPress(0, robot, false, KeyEvent.VK_1, 100); // release P
+
+ AWTRobotUtil.newtKeyPress(0, robot, false, KeyEvent.VK_1, 100); // release P
AWTRobotUtil.newtKeyPress(0, robot, false, m3k, 10); // release MOD
AWTRobotUtil.newtKeyPress(0, robot, false, m2k, 10); // release MOD
- AWTRobotUtil.newtKeyPress(0, robot, false, m1k, 10); // release MOD
+ AWTRobotUtil.newtKeyPress(0, robot, false, m1k, 10); // release MOD
AWTRobotUtil.waitForIdle(robot);
-
+
for(int j=0; j < 100 && keyAdapter.getQueueSize() < 4+4; j++) { // wait until events are collected
robot.delay(100);
}
- NEWTKeyUtil.validateKeyAdapterStats(keyAdapter,
- 4 /* press-SI */, 4 /* release-SI */,
+ NEWTKeyUtil.validateKeyAdapterStats(keyAdapter,
+ 4 /* press-SI */, 4 /* release-SI */,
0 /* press-AR */, 0 /* release-AR */ );
-
- final List<EventObject> queue = keyAdapter.copyQueue();
+
+ final List<EventObject> queue = keyAdapter.copyQueue();
int i=0;
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED, m1m, m1k, KeyEvent.NULL_CHAR);
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED, m1m|m2m, m2k, KeyEvent.NULL_CHAR);
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED, m1m|m2m|m3m, m3k, KeyEvent.NULL_CHAR);
-
+
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED, m1m|m2m|m3m, KeyEvent.VK_1, KeyEvent.NULL_CHAR);
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_RELEASED, m1m|m2m|m3m, KeyEvent.VK_1, KeyEvent.NULL_CHAR);
- KeyEvent e = (KeyEvent) queue.get(i++);
+ final KeyEvent e = (KeyEvent) queue.get(i++);
NEWTKeyUtil.validateKeyEvent(e, KeyEvent.EVENT_KEY_RELEASED, m1m|m2m|m3m, m3k, KeyEvent.NULL_CHAR);
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_RELEASED, m1m|m2m, m2k, KeyEvent.NULL_CHAR);
NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_RELEASED, m1m, m1k, KeyEvent.NULL_CHAR);
}
-
- void testImpl(GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
+
+ void testImpl(final GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
final Robot robot = new Robot();
robot.setAutoWaitForIdle(true);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
glWindow.addGLEventListener(demo1);
// NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
// glWindow.addWindowListener(glWindow1FA);
- NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+ final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
glWindow1KA.setVerbose(false);
glWindow.addKeyListener(glWindow1KA);
- Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, true));
+ Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, true));
// Continuous animation ..
- Animator animator = new Animator(glWindow);
+ final Animator animator = new Animator(glWindow);
animator.start();
Thread.sleep(durationPerTest); // manual testing
-
+
AWTRobotUtil.assertRequestFocusAndWait(null, glWindow, glWindow, null, null); // programmatic
AWTRobotUtil.requestFocus(robot, glWindow, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
- glWindow1KA.reset();
+ glWindow1KA.reset();
testKeyCodeModifier(robot, glWindow1KA, KeyEvent.VK_SHIFT, InputEvent.SHIFT_MASK, KeyEvent.VK_1, '1', '!');
testKeyCodeModifier(robot, glWindow1KA, KeyEvent.VK_SHIFT, InputEvent.SHIFT_MASK, KeyEvent.VK_Y, 'y', 'Y'); // US: Y, DE: Z
testKeyCodeModifier(robot, glWindow1KA, KeyEvent.VK_SHIFT, InputEvent.SHIFT_MASK, KeyEvent.VK_P, 'p', 'P');
testKeyCodeModifier(robot, glWindow1KA, KeyEvent.VK_CONTROL, InputEvent.CTRL_MASK, KeyEvent.VK_1, '1', KeyEvent.NULL_CHAR);
testKeyCodeModifier(robot, glWindow1KA, KeyEvent.VK_ALT, InputEvent.ALT_MASK, KeyEvent.VK_1, '1', KeyEvent.NULL_CHAR);
-
+
testKeyCodeAllModifierV1(robot, glWindow1KA);
-
+
// Remove listeners to avoid logging during dispose/destroy.
glWindow.removeKeyListener(glWindow1KA);
@@ -280,15 +280,15 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
animator.stop();
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
@@ -297,10 +297,10 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
/**
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
- System.err.println(stdin.readLine());
+ System.err.println(stdin.readLine());
*/
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestNewtKeyCodeModifiersAWT.class.getName();
+ final String tstname = TestNewtKeyCodeModifiersAWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java
index 71778c611..eecc35e4e 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java
@@ -95,7 +95,7 @@ public class TestNewtKeyCodesAWT extends UITestCase {
@Test(timeout=180000) // TO 3 min
public void test01NEWT() throws AWTException, InterruptedException, InvocationTargetException {
- GLWindow glWindow = GLWindow.create(glCaps);
+ final GLWindow glWindow = GLWindow.create(glCaps);
glWindow.setSize(width, height);
glWindow.setVisible(true);
@@ -104,8 +104,8 @@ public class TestNewtKeyCodesAWT extends UITestCase {
glWindow.destroy();
}
- private void testNewtCanvasAWT_Impl(boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
- GLWindow glWindow = GLWindow.create(glCaps);
+ private void testNewtCanvasAWT_Impl(final boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
+ final GLWindow glWindow = GLWindow.create(glCaps);
// Wrap the window in a canvas.
final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
@@ -132,7 +132,7 @@ public class TestNewtKeyCodesAWT extends UITestCase {
frame1.setVisible(false);
frame1.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -188,7 +188,7 @@ public class TestNewtKeyCodesAWT extends UITestCase {
// new CodeSeg(KeyEvent.VK_WINDOWS, KeyEvent.VK_HELP, "windows, meta, hlp"),
};
- static void testKeyCodes(Robot robot, Object obj, NEWTKeyAdapter keyAdapter) throws InterruptedException, InvocationTargetException {
+ static void testKeyCodes(final Robot robot, final Object obj, final NEWTKeyAdapter keyAdapter) throws InterruptedException, InvocationTargetException {
final List<List<EventObject>> cse = new ArrayList<List<EventObject>>();
keyAdapter.setVerbose(true); // FIXME
@@ -204,14 +204,14 @@ public class TestNewtKeyCodesAWT extends UITestCase {
// System.err.println("*** KeyCode 0x"+Integer.toHexString(c));
try {
AWTRobotUtil.newtKeyPress(0, robot, true, c, 10);
- } catch (Exception e) {
+ } catch (final Exception e) {
System.err.println("Exception @ AWT Robot.PRESS "+MiscUtils.toHexString(c)+" - "+e.getMessage());
break;
}
eventCount++;
try {
AWTRobotUtil.newtKeyPress(0, robot, false, c, 100);
- } catch (Exception e) {
+ } catch (final Exception e) {
System.err.println("Exception @ AWT Robot.RELEASE "+MiscUtils.toHexString(c)+" - "+e.getMessage());
break;
}
@@ -230,23 +230,23 @@ public class TestNewtKeyCodesAWT extends UITestCase {
Assert.assertEquals("KeyCode impl. incomplete", true, NEWTKeyUtil.validateKeyCodes(codeSegments, cse, true));
}
- void testImpl(GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
+ void testImpl(final GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
final Robot robot = new Robot();
robot.setAutoWaitForIdle(true);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
glWindow.addGLEventListener(demo1);
// NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
// glWindow.addWindowListener(glWindow1FA);
- NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+ final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
glWindow1KA.setVerbose(false);
glWindow.addKeyListener(glWindow1KA);
Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, true));
// Continuous animation ..
- Animator animator = new Animator(glWindow);
+ final Animator animator = new Animator(glWindow);
animator.start();
Thread.sleep(durationPerTest); // manual testing
@@ -264,15 +264,15 @@ public class TestNewtKeyCodesAWT extends UITestCase {
animator.stop();
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
@@ -284,7 +284,7 @@ public class TestNewtKeyCodesAWT extends UITestCase {
System.err.println(stdin.readLine());
*/
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestNewtKeyCodesAWT.class.getName();
+ final String tstname = TestNewtKeyCodesAWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java
index c374f1efe..5e78d908f 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java
@@ -112,7 +112,7 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
@Test(timeout=180000) // TO 3 min
public void test01NEWT() throws AWTException, InterruptedException, InvocationTargetException {
- GLWindow glWindow = GLWindow.create(glCaps);
+ final GLWindow glWindow = GLWindow.create(glCaps);
glWindow.setSize(width, height);
glWindow.setVisible(true);
@@ -123,7 +123,7 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
@Test(timeout=180000) // TO 3 min
public void test02NewtCanvasAWT() throws AWTException, InterruptedException, InvocationTargetException {
- GLWindow glWindow = GLWindow.create(glCaps);
+ final GLWindow glWindow = GLWindow.create(glCaps);
// Wrap the window in a canvas.
final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
@@ -147,17 +147,17 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
frame1.setVisible(false);
frame1.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
glWindow.destroy();
}
- static void testKeyEventAutoRepeat(Robot robot, NEWTKeyAdapter keyAdapter, int loops, int pressDurationMS) {
+ static void testKeyEventAutoRepeat(final Robot robot, final NEWTKeyAdapter keyAdapter, final int loops, final int pressDurationMS) {
System.err.println("KEY Event Auto-Repeat Test: "+loops);
- EventObject[][] first = new EventObject[loops][2];
- EventObject[][] last = new EventObject[loops][2];
+ final EventObject[][] first = new EventObject[loops][2];
+ final EventObject[][] last = new EventObject[loops][2];
keyAdapter.reset();
int firstIdx = 0;
@@ -250,21 +250,21 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
}
}
- void testImpl(GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
+ void testImpl(final GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
final Robot robot = new Robot();
robot.setAutoWaitForIdle(true);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
glWindow.addGLEventListener(demo1);
- NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+ final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
glWindow1KA.setVerbose(false);
glWindow.addKeyListener(glWindow1KA);
Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, true));
// Continuous animation ..
- Animator animator = new Animator(glWindow);
+ final Animator animator = new Animator(glWindow);
animator.start();
Thread.sleep(durationPerTest); // manual testing
@@ -291,15 +291,15 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
animator.stop();
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
@@ -311,7 +311,7 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
System.err.println(stdin.readLine());
*/
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestNewtKeyEventAutoRepeatAWT.class.getName();
+ final String tstname = TestNewtKeyEventAutoRepeatAWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventOrderAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventOrderAWT.java
index 8cc427508..3f86c186c 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventOrderAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventOrderAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.event;
import org.junit.After;
@@ -61,7 +61,7 @@ import com.jogamp.opengl.test.junit.util.*;
/**
* Testing key event order excl. auto-repeat (Bug 601)
- *
+ *
* <p>
* Note Event order:
* <ol>
@@ -88,35 +88,35 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
@AfterClass
public static void release() {
}
-
+
@Before
- public void initTest() {
+ public void initTest() {
}
@After
- public void releaseTest() {
+ public void releaseTest() {
}
-
+
@Test(timeout=180000) // TO 3 min
public void test01NEWT() throws AWTException, InterruptedException, InvocationTargetException {
- GLWindow glWindow = GLWindow.create(glCaps);
+ final GLWindow glWindow = GLWindow.create(glCaps);
glWindow.setSize(width, height);
glWindow.setVisible(true);
-
+
testImpl(glWindow);
-
+
glWindow.destroy();
}
-
- private void testNewtCanvasAWT_Impl(boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
- GLWindow glWindow = GLWindow.create(glCaps);
-
+
+ private void testNewtCanvasAWT_Impl(final boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
+ final GLWindow glWindow = GLWindow.create(glCaps);
+
// Wrap the window in a canvas.
final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
if( !onscreen ) {
newtCanvasAWT.setShallUseOffscreenLayer(true);
}
-
+
// Add the canvas to a frame, and make it all visible.
final JFrame frame1 = new JFrame("Swing AWT Parent Frame: "+ glWindow.getTitle());
frame1.getContentPane().add(newtCanvasAWT, BorderLayout.CENTER);
@@ -125,24 +125,24 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
public void run() {
frame1.setVisible(true);
} } );
-
+
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame1, true));
-
+
testImpl(glWindow);
-
+
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame1.setVisible(false);
frame1.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
- }
+ }
glWindow.destroy();
}
-
+
@Test(timeout=180000) // TO 3 min
public void test02NewtCanvasAWT_Onscreen() throws AWTException, InterruptedException, InvocationTargetException {
if( JAWTUtil.isOffscreenLayerRequired() ) {
@@ -151,7 +151,7 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
}
testNewtCanvasAWT_Impl(true);
}
-
+
@Test(timeout=180000) // TO 3 min
public void test03NewtCanvasAWT_Offsccreen() throws AWTException, InterruptedException, InvocationTargetException {
if( !JAWTUtil.isOffscreenLayerSupported() ) {
@@ -160,8 +160,8 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
}
testNewtCanvasAWT_Impl(false);
}
-
- static void testKeyEventOrder(Robot robot, NEWTKeyAdapter keyAdapter, int loops) {
+
+ static void testKeyEventOrder(final Robot robot, final NEWTKeyAdapter keyAdapter, final int loops) {
System.err.println("KEY Event Order Test: "+loops);
keyAdapter.reset();
for(int i=0; i<loops; i++) {
@@ -189,44 +189,44 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
AWTRobotUtil.waitForIdle(robot);
robot.delay(250);
// dumpKeyEvents(keyAdapter.getQueued());
-
+
NEWTKeyUtil.validateKeyEventOrder(keyAdapter.copyQueue());
-
+
final int expTotal = 6*loops; // all typed events
- NEWTKeyUtil.validateKeyAdapterStats(keyAdapter,
- expTotal /* press-SI */, expTotal /* release-SI */,
+ NEWTKeyUtil.validateKeyAdapterStats(keyAdapter,
+ expTotal /* press-SI */, expTotal /* release-SI */,
0 /* press-AR */, 0 /* release-AR */ );
-
+
}
-
- void testImpl(GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
+
+ void testImpl(final GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
final Robot robot = new Robot();
robot.setAutoWaitForIdle(true);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
glWindow.addGLEventListener(demo1);
- NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+ final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
glWindow1KA.setVerbose(false);
glWindow.addKeyListener(glWindow1KA);
- Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, true));
+ Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, true));
// Continuous animation ..
- Animator animator = new Animator(glWindow);
+ final Animator animator = new Animator(glWindow);
animator.start();
Thread.sleep(durationPerTest); // manual testing
-
+
AWTRobotUtil.assertRequestFocusAndWait(null, glWindow, glWindow, null, null); // programmatic
AWTRobotUtil.requestFocus(robot, glWindow, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
glWindow1KA.reset();
- //
+ //
// Test the key event order w/o auto-repeat
//
testKeyEventOrder(robot, glWindow1KA, 6);
-
+
// Remove listeners to avoid logging during dispose/destroy.
glWindow.removeKeyListener(glWindow1KA);
@@ -234,15 +234,15 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
animator.stop();
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
@@ -251,10 +251,10 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
/**
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
- System.err.println(stdin.readLine());
+ System.err.println(stdin.readLine());
*/
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestNewtKeyEventOrderAWT.class.getName();
+ final String tstname = TestNewtKeyEventOrderAWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyPressReleaseUnmaskRepeatAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyPressReleaseUnmaskRepeatAWT.java
index f48a07a8c..faf239910 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyPressReleaseUnmaskRepeatAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyPressReleaseUnmaskRepeatAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.event;
import org.junit.After;
@@ -83,35 +83,35 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
@AfterClass
public static void release() {
}
-
+
@Before
- public void initTest() {
+ public void initTest() {
}
@After
- public void releaseTest() {
+ public void releaseTest() {
}
-
+
@Test(timeout=180000) // TO 3 min
public void test01NEWT() throws AWTException, InterruptedException, InvocationTargetException {
- GLWindow glWindow = GLWindow.create(glCaps);
+ final GLWindow glWindow = GLWindow.create(glCaps);
glWindow.setSize(width, height);
glWindow.setVisible(true);
-
+
testImpl(glWindow);
-
+
glWindow.destroy();
}
-
- private void testNewtCanvasAWT_Impl(boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
- GLWindow glWindow = GLWindow.create(glCaps);
-
+
+ private void testNewtCanvasAWT_Impl(final boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
+ final GLWindow glWindow = GLWindow.create(glCaps);
+
// Wrap the window in a canvas.
final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
if( !onscreen ) {
newtCanvasAWT.setShallUseOffscreenLayer(true);
}
-
+
// Add the canvas to a frame, and make it all visible.
final JFrame frame1 = new JFrame("Swing AWT Parent Frame: "+ glWindow.getTitle());
frame1.getContentPane().add(newtCanvasAWT, BorderLayout.CENTER);
@@ -120,24 +120,24 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
public void run() {
frame1.setVisible(true);
} } );
-
+
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame1, true));
-
+
testImpl(glWindow);
-
+
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame1.setVisible(false);
frame1.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
- }
+ }
glWindow.destroy();
}
-
+
@Test(timeout=180000) // TO 3 min
public void test02NewtCanvasAWT_Onscreen() throws AWTException, InterruptedException, InvocationTargetException {
if( JAWTUtil.isOffscreenLayerRequired() ) {
@@ -146,7 +146,7 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
}
testNewtCanvasAWT_Impl(true);
}
-
+
@Test(timeout=180000) // TO 3 min
public void test03NewtCanvasAWT_Offsccreen() throws AWTException, InterruptedException, InvocationTargetException {
if( !JAWTUtil.isOffscreenLayerSupported() ) {
@@ -155,25 +155,25 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
}
testNewtCanvasAWT_Impl(false);
}
-
- void testImpl(GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
+
+ void testImpl(final GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
final Robot robot = new Robot();
robot.setAutoWaitForIdle(true);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
glWindow.addGLEventListener(demo1);
- SimpleKeyPressRelease simpleKeyPressRelease = new SimpleKeyPressRelease();
+ final SimpleKeyPressRelease simpleKeyPressRelease = new SimpleKeyPressRelease();
glWindow.addKeyListener(simpleKeyPressRelease);
- Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, true));
+ Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, true));
// Continuous animation ..
- Animator animator = new Animator(glWindow);
+ final Animator animator = new Animator(glWindow);
animator.start();
Thread.sleep(durationPerTest); // manual testing
-
+
AWTRobotUtil.assertRequestFocusAndWait(null, glWindow, glWindow, null, null); // programmatic
AWTRobotUtil.requestFocus(robot, glWindow, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
@@ -184,27 +184,27 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
animator.stop();
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
-
+
static class SimpleKeyPressRelease implements KeyListener {
int seq;
SimpleKeyPressRelease() {
reset();
}
-
+
public void reset() {
seq=0;
}
-
+
@Override
- public void keyPressed(KeyEvent e) {
+ public void keyPressed(final KeyEvent e) {
if( 0 == ( InputEvent.AUTOREPEAT_MASK & e.getModifiers() ) ) {
seq++;
System.err.println(seq+": "+e);
@@ -212,7 +212,7 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
}
@Override
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( 0 == ( InputEvent.AUTOREPEAT_MASK & e.getModifiers() ) ) {
seq++;
System.err.println(seq+": "+e);
@@ -220,7 +220,7 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
}
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
@@ -229,10 +229,10 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
/**
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println("Press enter to continue");
- System.err.println(stdin.readLine());
+ System.err.println(stdin.readLine());
*/
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestNewtKeyPressReleaseUnmaskRepeatAWT.class.getName();
+ final String tstname = TestNewtKeyPressReleaseUnmaskRepeatAWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java
index d3c29cfac..586c380bf 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java
@@ -93,26 +93,26 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
@Test
public void testFocus02RobotFocus() throws AWTException, InterruptedException, InvocationTargetException {
- Robot robot = new Robot();
+ final Robot robot = new Robot();
robot.setAutoWaitForIdle(true);
testFocus01ProgrFocusImpl(robot);
}
- private void testFocus01ProgrFocusImpl(Robot robot) throws AWTException,
+ private void testFocus01ProgrFocusImpl(final Robot robot) throws AWTException,
InvocationTargetException, InterruptedException {
- ArrayList<EventCountAdapter> eventCountAdapters = new ArrayList<EventCountAdapter>();
+ final ArrayList<EventCountAdapter> eventCountAdapters = new ArrayList<EventCountAdapter>();
// Create a window.
- GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
glWindow1.setTitle("testNewtChildFocus");
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
TestListenerCom01AWT.setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
- NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
+ final NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
glWindow1.addWindowListener(glWindow1FA);
// Monitor NEWT focus and keyboard events.
- NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+ final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
eventCountAdapters.add(glWindow1KA);
glWindow1.addKeyListener(glWindow1KA);
@@ -121,10 +121,10 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
// newtCanvasAWT.setShallUseOffscreenLayer(true);
// Monitor AWT focus and keyboard events.
- AWTKeyAdapter newtCanvasAWTKA = new AWTKeyAdapter("NewtCanvasAWT");
+ final AWTKeyAdapter newtCanvasAWTKA = new AWTKeyAdapter("NewtCanvasAWT");
newtCanvasAWT.addKeyListener(newtCanvasAWTKA);
eventCountAdapters.add(newtCanvasAWTKA);
- AWTFocusAdapter newtCanvasAWTFA = new AWTFocusAdapter("NewtCanvasAWT");
+ final AWTFocusAdapter newtCanvasAWTFA = new AWTFocusAdapter("NewtCanvasAWT");
newtCanvasAWT.addFocusListener(newtCanvasAWTFA);
// Add the canvas to a frame, and make it all visible.
@@ -132,12 +132,12 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
+ glWindow1.getTitle());
frame1.getContentPane().add(newtCanvasAWT, BorderLayout.CENTER);
final Button button = new Button("Click me ..");
- AWTFocusAdapter buttonFA = new AWTFocusAdapter("Button");
+ final AWTFocusAdapter buttonFA = new AWTFocusAdapter("Button");
button.addFocusListener(buttonFA);
- AWTKeyAdapter buttonKA = new AWTKeyAdapter("Button");
+ final AWTKeyAdapter buttonKA = new AWTKeyAdapter("Button");
button.addKeyListener(buttonKA);
eventCountAdapters.add(buttonKA);
- AWTMouseAdapter buttonMA = new AWTMouseAdapter("Button");
+ final AWTMouseAdapter buttonMA = new AWTMouseAdapter("Button");
button.addMouseListener(buttonMA);
eventCountAdapters.add(buttonMA);
@@ -161,7 +161,7 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
Assert.assertTrue(0 < glWindow1.getTotalFPSFrames());
// Continuous animation ..
- Animator animator = new Animator(glWindow1);
+ final Animator animator = new Animator(glWindow1);
animator.start();
// Button Focus
@@ -212,7 +212,7 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
frame1.setVisible(false);
frame1.dispose();
}});
- } catch( Throwable throwable ) {
+ } catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -220,15 +220,15 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow1, false));
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
@@ -240,7 +240,7 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
System.err.println(stdin.readLine());
*/
System.out.println("durationPerTest: "+durationPerTest);
- String tstname = TestParentingFocus01SwingAWTRobot.class.getName();
+ final String tstname = TestParentingFocus01SwingAWTRobot.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java
index edf82caa8..584344ef5 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java
@@ -42,9 +42,12 @@ import java.awt.Button;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Robot;
+
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
+
import java.util.ArrayList;
import javax.media.opengl.*;
@@ -97,41 +100,41 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase {
public static void release() {
}
- private void testFocus01ProgrFocusImpl(Robot robot)
+ private void testFocus01ProgrFocusImpl(final Robot robot)
throws AWTException, InterruptedException, InvocationTargetException {
- ArrayList<EventCountAdapter> eventCountAdapters = new ArrayList<EventCountAdapter>();
+ final ArrayList<EventCountAdapter> eventCountAdapters = new ArrayList<EventCountAdapter>();
- GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
- GLEventListener demo1 = new GearsES2();
+ final GLEventListener demo1 = new GearsES2();
glWindow1.addGLEventListener(demo1);
- NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
+ final NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
glWindow1.addWindowListener(glWindow1FA);
- NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+ final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
glWindow1.addKeyListener(glWindow1KA);
eventCountAdapters.add(glWindow1KA);
- NEWTMouseAdapter glWindow1MA = new NEWTMouseAdapter("GLWindow1");
+ final NEWTMouseAdapter glWindow1MA = new NEWTMouseAdapter("GLWindow1");
glWindow1.addMouseListener(glWindow1MA);
eventCountAdapters.add(glWindow1MA);
- NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
- AWTFocusAdapter newtCanvasAWTFA = new AWTFocusAdapter("NewtCanvasAWT");
+ final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+ final AWTFocusAdapter newtCanvasAWTFA = new AWTFocusAdapter("NewtCanvasAWT");
newtCanvasAWT.addFocusListener(newtCanvasAWTFA);
- AWTKeyAdapter newtCanvasAWTKA = new AWTKeyAdapter("NewtCanvasAWT");
+ final AWTKeyAdapter newtCanvasAWTKA = new AWTKeyAdapter("NewtCanvasAWT");
newtCanvasAWT.addKeyListener(newtCanvasAWTKA);
eventCountAdapters.add(newtCanvasAWTKA);
- AWTMouseAdapter newtCanvasAWTMA = new AWTMouseAdapter("NewtCanvasAWT");
+ final AWTMouseAdapter newtCanvasAWTMA = new AWTMouseAdapter("NewtCanvasAWT");
newtCanvasAWT.addMouseListener(newtCanvasAWTMA);
eventCountAdapters.add(newtCanvasAWTMA);
- Button buttonNorthInner = new Button("north");
- AWTFocusAdapter buttonNorthInnerFA = new AWTFocusAdapter("ButtonNorthInner");
+ final Button buttonNorthInner = new Button("north");
+ final AWTFocusAdapter buttonNorthInnerFA = new AWTFocusAdapter("ButtonNorthInner");
buttonNorthInner.addFocusListener(buttonNorthInnerFA);
- AWTKeyAdapter buttonNorthInnerKA = new AWTKeyAdapter("ButtonNorthInner");
+ final AWTKeyAdapter buttonNorthInnerKA = new AWTKeyAdapter("ButtonNorthInner");
buttonNorthInner.addKeyListener(buttonNorthInnerKA);
eventCountAdapters.add(buttonNorthInnerKA);
- AWTMouseAdapter buttonNorthInnerMA = new AWTMouseAdapter("ButtonNorthInner");
+ final AWTMouseAdapter buttonNorthInnerMA = new AWTMouseAdapter("ButtonNorthInner");
buttonNorthInner.addMouseListener(buttonNorthInnerMA);
eventCountAdapters.add(buttonNorthInnerMA);
final Container container1 = new Container();
@@ -142,13 +145,13 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase {
container1.add(new Button("west"), BorderLayout.WEST);
container1.add(newtCanvasAWT, BorderLayout.CENTER);
- Button buttonNorthOuter = new Button("north");
- AWTFocusAdapter buttonNorthOuterFA = new AWTFocusAdapter("ButtonNorthOuter");
+ final Button buttonNorthOuter = new Button("north");
+ final AWTFocusAdapter buttonNorthOuterFA = new AWTFocusAdapter("ButtonNorthOuter");
buttonNorthOuter.addFocusListener(buttonNorthOuterFA);
- AWTKeyAdapter buttonNorthOuterKA = new AWTKeyAdapter("ButtonNorthOuter");
+ final AWTKeyAdapter buttonNorthOuterKA = new AWTKeyAdapter("ButtonNorthOuter");
buttonNorthOuter.addKeyListener(buttonNorthOuterKA);
eventCountAdapters.add(buttonNorthOuterKA);
- AWTMouseAdapter buttonNorthOuterMA = new AWTMouseAdapter("ButtonNorthOuter");
+ final AWTMouseAdapter buttonNorthOuterMA = new AWTMouseAdapter("ButtonNorthOuter");
buttonNorthOuter.addMouseListener(buttonNorthOuterMA);
eventCountAdapters.add(buttonNorthOuterMA);
final JPanel jPanel1 = new JPanel();
@@ -161,7 +164,7 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase {
final JFrame jFrame1 = new JFrame("Swing Parent JFrame");
// jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+ jFrame1.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
jFrame1.setContentPane(jPanel1);
jFrame1.setSize(width, height);
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -180,7 +183,7 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase {
Assert.assertTrue(0 < glWindow1.getTotalFPSFrames());
// Continuous animation ..
- Animator animator1 = new Animator(glWindow1);
+ final Animator animator1 = new Animator(glWindow1);
animator1.start();
Thread.sleep(durationPerTest); // manual testing
@@ -287,21 +290,21 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase {
@Test
public void testFocus02RobotFocus() throws AWTException, InterruptedException, InvocationTargetException {
- Robot robot = new Robot();
+ final Robot robot = new Robot();
robot.setAutoWaitForIdle(true);
testFocus01ProgrFocusImpl(robot);
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
@SuppressWarnings("unused")
- public static void main(String args[])
+ public static void main(final String args[])
throws IOException, AWTException, InterruptedException, InvocationTargetException
{
for(int i=0; i<args.length; i++) {
@@ -310,11 +313,11 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase {
}
}
if(true) {
- String tstname = TestParentingFocus02SwingAWTRobot.class.getName();
+ final String tstname = TestParentingFocus02SwingAWTRobot.class.getName();
org.junit.runner.JUnitCore.main(tstname);
} else {
TestParentingFocus02SwingAWTRobot.initClass();
- TestParentingFocus02SwingAWTRobot test = new TestParentingFocus02SwingAWTRobot();
+ final TestParentingFocus02SwingAWTRobot test = new TestParentingFocus02SwingAWTRobot();
test.testFocus01ProgrFocus();
test.testFocus02RobotFocus();
TestParentingFocus02SwingAWTRobot.release();
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus03KeyTraversalAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus03KeyTraversalAWT.java
index 71cc3fce3..ace039688 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus03KeyTraversalAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus03KeyTraversalAWT.java
@@ -97,8 +97,8 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
testWindowParentingAWTFocusTraversal(false);
}
- public void testWindowParentingAWTFocusTraversal(boolean onscreen) throws InterruptedException, InvocationTargetException, AWTException {
- Robot robot = new Robot();
+ public void testWindowParentingAWTFocusTraversal(final boolean onscreen) throws InterruptedException, InvocationTargetException, AWTException {
+ final Robot robot = new Robot();
// Bug 4908075 - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4908075
// Bug 6463168 - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6463168
@@ -135,28 +135,28 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
newtCanvasAWT1.setFocusable(true);
// Test FocusAdapter
- NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
+ final NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
glWindow1.addWindowListener(glWindow1FA);
- AWTFocusAdapter bWestFA = new AWTFocusAdapter("WEST");
+ final AWTFocusAdapter bWestFA = new AWTFocusAdapter("WEST");
cWest.addFocusListener(bWestFA);
- AWTFocusAdapter bEastFA = new AWTFocusAdapter("EAST");
+ final AWTFocusAdapter bEastFA = new AWTFocusAdapter("EAST");
cEast.addFocusListener(bEastFA);
// Test KeyAdapter
- NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+ final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
glWindow1.addKeyListener(glWindow1KA);
- AWTKeyAdapter bWestKA = new AWTKeyAdapter("West");
+ final AWTKeyAdapter bWestKA = new AWTKeyAdapter("West");
cWest.addKeyListener(bWestKA);
- AWTKeyAdapter bEastKA = new AWTKeyAdapter("East");
+ final AWTKeyAdapter bEastKA = new AWTKeyAdapter("East");
cEast.addKeyListener(bEastKA);
// demo ..
- GLEventListener demo1 = new GearsES2(1);
+ final GLEventListener demo1 = new GearsES2(1);
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
glWindow1.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT1, glWindow1, null));
glWindow1.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
}
@@ -173,7 +173,7 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
cEast.requestFocusInWindow();
}
});
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
} else if(e.getKeyChar()=='w') {
System.err.println("Focus West");
try {
@@ -182,11 +182,11 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
cWest.requestFocusInWindow();
}
});
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
}
}
});
- GLAnimatorControl animator1 = new Animator(glWindow1);
+ final GLAnimatorControl animator1 = new Animator(glWindow1);
animator1.start();
// make frame
@@ -263,7 +263,7 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
newtCanvasAWT1.requestFocus();
}
});
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bWestFA));
Assert.assertEquals(true, glWindow1FA.focusGained());
Assert.assertEquals(true, bWestFA.focusLost());
@@ -276,7 +276,7 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
cWest.requestFocus();
}
});
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(cWest, bWestFA, glWindow1FA));
Assert.assertEquals(true, bWestFA.focusGained());
Assert.assertEquals(true, glWindow1FA.focusLost());
@@ -310,10 +310,10 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
glWindow1.destroy();
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
- Window window = glWindow.getDelegatedWindow();
+ final Window window = glWindow.getDelegatedWindow();
if(debug) {
MiscUtils.setFieldIfExists(demo, "glDebug", true);
MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -323,15 +323,15 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
@@ -341,7 +341,7 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
forceGL3 = true;
}
}
- String tstname = TestParentingFocus03KeyTraversalAWT.class.getName();
+ final String tstname = TestParentingFocus03KeyTraversalAWT.class.getName();
/*
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/ManualScreenMode03aNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/ManualScreenMode03aNEWT.java
index ee71ba93d..2133f25c2 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/ManualScreenMode03aNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/ManualScreenMode03aNEWT.java
@@ -54,10 +54,10 @@ import javax.media.nativewindow.util.Dimension;
public class ManualScreenMode03aNEWT extends UITestCase {
static int waitTime = 7000; // 1 sec
- static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
+ static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final int width, final int height, final boolean onscreen, final boolean undecorated) {
caps.setOnscreen(onscreen);
- GLWindow window = GLWindow.create(screen, caps);
+ final GLWindow window = GLWindow.create(screen, caps);
window.setSize(width, height);
window.addGLEventListener(new GearsES2());
window.setVisible(true);
@@ -65,21 +65,21 @@ public class ManualScreenMode03aNEWT extends UITestCase {
}
public void run() {
- int width = 640;
- int height = 480;
- GLProfile glp = GLProfile.getDefault();
- GLCapabilities caps = new GLCapabilities(glp);
- Display display = NewtFactory.createDisplay(null); // local display
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
- GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+ final int width = 640;
+ final int height = 480;
+ final GLProfile glp = GLProfile.getDefault();
+ final GLCapabilities caps = new GLCapabilities(glp);
+ final Display display = NewtFactory.createDisplay(null); // local display
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
- Animator animator = new Animator(window);
+ final Animator animator = new Animator(window);
animator.start();
- MonitorDevice monitor = window.getMainMonitor();
+ final MonitorDevice monitor = window.getMainMonitor();
- MonitorMode mmCurrent = monitor.queryCurrentMode();
- MonitorMode mmOrig = monitor.getOriginalMode();
+ final MonitorMode mmCurrent = monitor.queryCurrentMode();
+ final MonitorMode mmOrig = monitor.getOriginalMode();
System.err.println("[0] orig : "+mmOrig);
System.err.println("[0] current: "+mmCurrent);
List<MonitorMode> monitorModes = monitor.getSupportedModes();
@@ -93,21 +93,21 @@ public class ManualScreenMode03aNEWT extends UITestCase {
monitorModes = MonitorModeUtil.filterByResolution(monitorModes, new Dimension(801, 601));
monitorModes = MonitorModeUtil.filterByRate(monitorModes, mmOrig.getRefreshRate());
monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
- MonitorMode mm = monitorModes.get(0);
+ final MonitorMode mm = monitorModes.get(0);
System.err.println("[0] set current: "+mm);
monitor.setCurrentMode(mm);
System.err.print("[0] post setting .. wait <");
try {
Thread.sleep(waitTime);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
}
System.err.println("done>");
System.exit(0);
}
- public static void main(String args[]) throws IOException {
- ManualScreenMode03aNEWT t = new ManualScreenMode03aNEWT();
+ public static void main(final String args[]) throws IOException {
+ final ManualScreenMode03aNEWT t = new ManualScreenMode03aNEWT();
t.run();
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java
index c00f02e7e..68a08b8de 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java
@@ -130,18 +130,18 @@ public class TestScreenMode00aNEWT extends UITestCase {
@Test
public void testScreenModeInfo01() throws InterruptedException {
- Display dpy = NewtFactory.createDisplay(null);
- Screen screen = NewtFactory.createScreen(dpy, screenIdx);
+ final Display dpy = NewtFactory.createDisplay(null);
+ final Screen screen = NewtFactory.createScreen(dpy, screenIdx);
screen.addReference();
Assert.assertEquals(true,screen.isNativeValid());
Assert.assertEquals(true,screen.getDisplay().isNativeValid());
System.err.println("Screen: "+screen.toString());
- List<MonitorMode> allMonitorModes = screen.getMonitorModes();
+ final List<MonitorMode> allMonitorModes = screen.getMonitorModes();
Assert.assertTrue(allMonitorModes.size()>0);
{
int i=0;
MonitorMode mmPre = null;
- for(Iterator<MonitorMode> iMode=allMonitorModes.iterator(); iMode.hasNext(); i++) {
+ for(final Iterator<MonitorMode> iMode=allMonitorModes.iterator(); iMode.hasNext(); i++) {
final MonitorMode mm = iMode.next();
System.err.println(String.format("All-0[%03d]: %s", i, mm));
if( null != mmPre ) {
@@ -154,7 +154,7 @@ public class TestScreenMode00aNEWT extends UITestCase {
{
int i=0;
MonitorMode mmPre = null;
- for(Iterator<MonitorMode> iMode=allMonitorModes.iterator(); iMode.hasNext(); i++) {
+ for(final Iterator<MonitorMode> iMode=allMonitorModes.iterator(); iMode.hasNext(); i++) {
final MonitorMode mm = iMode.next();
System.err.println(String.format("All-1[%03d]: %s", i, mm));
if( null != mmPre ) {
@@ -164,17 +164,17 @@ public class TestScreenMode00aNEWT extends UITestCase {
}
}
- List<MonitorDevice> monitors = screen.getMonitorDevices();
+ final List<MonitorDevice> monitors = screen.getMonitorDevices();
Assert.assertTrue(monitors.size()>0);
int j=0;
- for(Iterator<MonitorDevice> iMonitor=monitors.iterator(); iMonitor.hasNext(); j++) {
- MonitorDevice monitor = iMonitor.next();
+ for(final Iterator<MonitorDevice> iMonitor=monitors.iterator(); iMonitor.hasNext(); j++) {
+ final MonitorDevice monitor = iMonitor.next();
System.err.println(j+": "+monitor);
- List<MonitorMode> modes = monitor.getSupportedModes();
+ final List<MonitorMode> modes = monitor.getSupportedModes();
Assert.assertTrue(modes.size()>0);
int i=0;
MonitorMode mmPre = null;
- for(Iterator<MonitorMode> iMode=modes.iterator(); iMode.hasNext(); i++) {
+ for(final Iterator<MonitorMode> iMode=modes.iterator(); iMode.hasNext(); i++) {
final MonitorMode mm = iMode.next();
System.err.println(String.format("[%02d][%03d]: %s", j, i, mm));
if( null != mmPre ) {
@@ -184,9 +184,9 @@ public class TestScreenMode00aNEWT extends UITestCase {
}
Assert.assertTrue(allMonitorModes.containsAll(modes));
- MonitorMode sm_o = monitor.getOriginalMode();
+ final MonitorMode sm_o = monitor.getOriginalMode();
Assert.assertNotNull(sm_o);
- MonitorMode sm_c = monitor.queryCurrentMode();
+ final MonitorMode sm_c = monitor.queryCurrentMode();
System.err.println("[0] orig : "+sm_o);
System.err.println("[0] current: "+sm_c);
Assert.assertNotNull(sm_c);
@@ -199,20 +199,20 @@ public class TestScreenMode00aNEWT extends UITestCase {
Assert.assertEquals(false,screen.getDisplay().isNativeValid());
}
- static int atoi(String a) {
+ static int atoi(final String a) {
try {
return Integer.parseInt(a);
- } catch (Exception ex) { throw new RuntimeException(ex); }
+ } catch (final Exception ex) { throw new RuntimeException(ex); }
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-screen")) {
i++;
screenIdx = atoi(args[i]);
}
}
- String tstname = TestScreenMode00aNEWT.class.getName();
+ final String tstname = TestScreenMode00aNEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00bNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00bNEWT.java
index 69f19c258..518dbb8db 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00bNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00bNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.mm;
import java.io.IOException;
@@ -55,15 +55,15 @@ import javax.media.opengl.GLCapabilitiesImmutable;
/**
* Queries the current MonitorMode 50 times,
- * stressing a possible race condition.
+ * stressing a possible race condition.
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestScreenMode00bNEWT extends UITestCase {
static int width, height;
-
+
static int waitTimeShort = 4; //1 sec
static int waitTimeLong = 6; //6 sec
-
+
@BeforeClass
public static void initClass() {
setResetXRandRIfX11AfterClass();
@@ -74,45 +74,45 @@ public class TestScreenMode00bNEWT extends UITestCase {
@Test
public void testScreenModeInfo01() throws InterruptedException {
- Display display = NewtFactory.createDisplay(null);
- Screen screen = NewtFactory.createScreen(display, 0);
+ final Display display = NewtFactory.createDisplay(null);
+ final Screen screen = NewtFactory.createScreen(display, 0);
// screen.addReference();
-
+
// put some load on the screen/display context ..
- GLCapabilitiesImmutable caps = new GLCapabilities(null);
- GLWindow window = GLWindow.create(screen, caps);
+ final GLCapabilitiesImmutable caps = new GLCapabilities(null);
+ final GLWindow window = GLWindow.create(screen, caps);
window.addGLEventListener(new GearsES2());
window.setSize(256, 256);
window.setVisible(true);
- Animator anim = new Animator(window);
+ final Animator anim = new Animator(window);
anim.start();
Assert.assertEquals(true,window.isNativeValid());
Assert.assertEquals(true,screen.isNativeValid());
Assert.assertEquals(true,display.isNativeValid());
-
- List<MonitorMode> screenModes = screen.getMonitorModes();
+
+ final List<MonitorMode> screenModes = screen.getMonitorModes();
Assert.assertTrue(screenModes.size()>0);
int i=0;
- for(Iterator<MonitorMode> iter=screenModes.iterator(); iter.hasNext(); i++) {
+ for(final Iterator<MonitorMode> iter=screenModes.iterator(); iter.hasNext(); i++) {
System.err.println(i+": "+iter.next());
}
- MonitorDevice monitor = window.getMainMonitor();
- MonitorMode mm_o = monitor.getOriginalMode();
-
- Assert.assertNotNull(mm_o);
+ final MonitorDevice monitor = window.getMainMonitor();
+ final MonitorMode mm_o = monitor.getOriginalMode();
+
+ Assert.assertNotNull(mm_o);
MonitorMode mm_c = monitor.queryCurrentMode();
Assert.assertNotNull(mm_c);
System.err.println("orig: "+mm_o);
System.err.println("curr: "+mm_c);
-
+
for(i=0; i<50; i++) {
mm_c = monitor.queryCurrentMode();
Assert.assertNotNull(mm_c);
System.err.print("."+i);
}
System.err.println("!");
-
+
// screen.removeReference();
anim.stop();
window.destroy();
@@ -124,8 +124,8 @@ public class TestScreenMode00bNEWT extends UITestCase {
Assert.assertEquals(false,display.isNativeValid());
}
- public static void main(String args[]) throws IOException {
- String tstname = TestScreenMode00bNEWT.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestScreenMode00bNEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java
index 714e75695..6b353f8fc 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java
@@ -93,10 +93,10 @@ public class TestScreenMode00cNEWT extends UITestCase {
Thread.sleep(waitTimeShort);
}
- static Window createWindow(Screen screen, GLCapabilities caps, String name, int x, int y, int width, int height) {
+ static Window createWindow(final Screen screen, final GLCapabilities caps, final String name, final int x, final int y, final int width, final int height) {
Assert.assertNotNull(caps);
- GLWindow window = GLWindow.create(screen, caps);
+ final GLWindow window = GLWindow.create(screen, caps);
// Window window = NewtFactory.createWindow(screen, caps);
window.setTitle(name);
window.setPosition(x, y);
@@ -107,7 +107,7 @@ public class TestScreenMode00cNEWT extends UITestCase {
return window;
}
- static void destroyWindow(Window window) throws InterruptedException {
+ static void destroyWindow(final Window window) throws InterruptedException {
if(null!=window) {
window.destroy();
Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
@@ -181,12 +181,12 @@ public class TestScreenMode00cNEWT extends UITestCase {
// set mode
{
- MonitorMode mm = monitorModes.get(0);
+ final MonitorMode mm = monitorModes.get(0);
System.err.println("[1] set current: "+mm);
final boolean smOk = monitor.setCurrentMode(mm);
- MonitorMode mmCachedCurrent = monitor.getCurrentMode();
- MonitorMode mmQueriedCurrent = monitor.queryCurrentMode();
- boolean mmCurrentEquals = mmQueriedCurrent.equals(mmCachedCurrent);
+ final MonitorMode mmCachedCurrent = monitor.getCurrentMode();
+ final MonitorMode mmQueriedCurrent = monitor.queryCurrentMode();
+ final boolean mmCurrentEquals = mmQueriedCurrent.equals(mmCachedCurrent);
System.err.println("[1] changeOK : "+smOk);
System.err.println("[1] has current cached : "+mmCachedCurrent);
System.err.println("[1] has current queried : "+mmQueriedCurrent+", equal "+mmCurrentEquals);
@@ -254,7 +254,7 @@ public class TestScreenMode00cNEWT extends UITestCase {
Assert.assertEquals(false,screen.isNativeValid());
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
manualTest = true;
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
@@ -269,7 +269,7 @@ public class TestScreenMode00cNEWT extends UITestCase {
}
}
System.err.println("Desired mode w/ resolution "+mm_width+"x"+mm_height);
- String tstname = TestScreenMode00cNEWT.class.getName();
+ final String tstname = TestScreenMode00cNEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java
index cb9192a70..5ca133302 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java
@@ -94,10 +94,10 @@ public class TestScreenMode01aNEWT extends UITestCase {
Thread.sleep(waitTimeShort);
}
- static Window createWindow(Screen screen, GLCapabilities caps, String name, int x, int y, int width, int height) {
+ static Window createWindow(final Screen screen, final GLCapabilities caps, final String name, final int x, final int y, final int width, final int height) {
Assert.assertNotNull(caps);
- GLWindow window = GLWindow.create(screen, caps);
+ final GLWindow window = GLWindow.create(screen, caps);
// Window window = NewtFactory.createWindow(screen, caps);
window.setTitle(name);
window.setPosition(x, y);
@@ -108,7 +108,7 @@ public class TestScreenMode01aNEWT extends UITestCase {
return window;
}
- static void destroyWindow(Window window) throws InterruptedException {
+ static void destroyWindow(final Window window) throws InterruptedException {
if(null!=window) {
window.destroy();
Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
@@ -184,12 +184,12 @@ public class TestScreenMode01aNEWT extends UITestCase {
// set mode
{
- MonitorMode mm = monitorModes.get(0);
+ final MonitorMode mm = monitorModes.get(0);
System.err.println("[1] set current: "+mm);
final boolean smOk = monitor.setCurrentMode(mm);
- MonitorMode mmCachedCurrent = monitor.getCurrentMode();
- MonitorMode mmQueriedCurrent = monitor.queryCurrentMode();
- boolean mmCurrentEquals = mmQueriedCurrent.equals(mmCachedCurrent);
+ final MonitorMode mmCachedCurrent = monitor.getCurrentMode();
+ final MonitorMode mmQueriedCurrent = monitor.queryCurrentMode();
+ final boolean mmCurrentEquals = mmQueriedCurrent.equals(mmCachedCurrent);
System.err.println("[1] changeOK : "+smOk);
System.err.println("[1] has current cached : "+mmCachedCurrent);
System.err.println("[1] has current queried : "+mmQueriedCurrent+", equal "+mmCurrentEquals);
@@ -228,7 +228,7 @@ public class TestScreenMode01aNEWT extends UITestCase {
validateScreenModeReset(mmOrig, 0);
}
- void validateScreenModeReset(final MonitorMode mmOrig, int mmIdx) {
+ void validateScreenModeReset(final MonitorMode mmOrig, final int mmIdx) {
final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
@@ -247,7 +247,7 @@ public class TestScreenMode01aNEWT extends UITestCase {
Assert.assertEquals(false,screen.isNativeValid());
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
@@ -261,7 +261,7 @@ public class TestScreenMode01aNEWT extends UITestCase {
}
}
System.err.println("Desired mode w/ resolution "+mm_width+"x"+mm_height);
- String tstname = TestScreenMode01aNEWT.class.getName();
+ final String tstname = TestScreenMode01aNEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java
index e862e6b8e..bba663a10 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java
@@ -85,10 +85,10 @@ public class TestScreenMode01bNEWT extends UITestCase {
Thread.sleep(waitTimeShort);
}
- static GLWindow createWindow(Screen screen, GLCapabilities caps, String name, int screenXPos, int screenYPos, int width, int height) throws InterruptedException {
+ static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final String name, final int screenXPos, final int screenYPos, final int width, final int height) throws InterruptedException {
Assert.assertNotNull(caps);
- GLWindow window = GLWindow.create(screen, caps);
+ final GLWindow window = GLWindow.create(screen, caps);
// Window window = NewtFactory.createWindow(screen, caps);
final int[] winPos = window.convertToWindowUnits(new int[] { screenXPos, screenYPos });
window.setTitle(name);
@@ -102,7 +102,7 @@ public class TestScreenMode01bNEWT extends UITestCase {
return window;
}
- static void destroyWindow(Window window) throws InterruptedException {
+ static void destroyWindow(final Window window) throws InterruptedException {
if(null!=window) {
window.destroy();
Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
@@ -117,7 +117,7 @@ public class TestScreenMode01bNEWT extends UITestCase {
Assert.assertNotNull(screen);
screen.addReference(); // trigger creation
try {
- RectangleImmutable monitorVp = screen.getMonitorDevices().get(0).getViewport();
+ final RectangleImmutable monitorVp = screen.getMonitorDevices().get(0).getViewport();
testScreenModeChangeImpl(screen, monitorVp.getX(), monitorVp.getY());
} finally {
screen.removeReference();
@@ -137,7 +137,7 @@ public class TestScreenMode01bNEWT extends UITestCase {
System.err.println("Test Disabled (1): Monitor count < 2: "+screen);
return;
}
- RectangleImmutable monitorVp = screen.getMonitorDevices().get(1).getViewport();
+ final RectangleImmutable monitorVp = screen.getMonitorDevices().get(1).getViewport();
testScreenModeChangeImpl(screen, monitorVp.getX(), monitorVp.getY());
} finally {
screen.removeReference();
@@ -145,7 +145,7 @@ public class TestScreenMode01bNEWT extends UITestCase {
}
}
- void testScreenModeChangeImpl(final Screen screen, int screenXPos, int screenYPos) throws InterruptedException {
+ void testScreenModeChangeImpl(final Screen screen, final int screenXPos, final int screenYPos) throws InterruptedException {
Thread.sleep(waitTimeShort);
final GLCapabilities caps = new GLCapabilities(glp);
@@ -155,7 +155,7 @@ public class TestScreenMode01bNEWT extends UITestCase {
System.err.println("Test.0: Window bounds (pre): screenPos "+screenXPos+"/"+screenYPos+" [pixels], windowSize "+width+"x"+height+" [wu] within "+screen.getViewport()+" [pixels]");
- GLWindow window0 = createWindow(screen, caps, "win0", screenXPos, screenYPos, width, height);
+ final GLWindow window0 = createWindow(screen, caps, "win0", screenXPos, screenYPos, width, height);
Assert.assertNotNull(window0);
Rectangle window0WindowBounds = window0.getBounds();
DimensionImmutable window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
@@ -165,7 +165,7 @@ public class TestScreenMode01bNEWT extends UITestCase {
final Animator anim = new Animator(window0);
anim.start();
- List<MonitorMode> allMonitorModes = screen.getMonitorModes();
+ final List<MonitorMode> allMonitorModes = screen.getMonitorModes();
Assert.assertTrue(allMonitorModes.size()>0);
if(allMonitorModes.size()==1) {
// no support ..
@@ -174,7 +174,7 @@ public class TestScreenMode01bNEWT extends UITestCase {
return;
}
- MonitorDevice monitor = window0.getMainMonitor();
+ final MonitorDevice monitor = window0.getMainMonitor();
System.err.println("Test.0: Window monitor: "+monitor);
List<MonitorMode> monitorModes = monitor.getSupportedModes();
@@ -189,7 +189,7 @@ public class TestScreenMode01bNEWT extends UITestCase {
MonitorMode mmCurrent = monitor.getCurrentMode();
Assert.assertNotNull(mmCurrent);
- MonitorMode mmOrig = monitor.getOriginalMode();
+ final MonitorMode mmOrig = monitor.getOriginalMode();
Assert.assertNotNull(mmOrig);
System.err.println("[0] orig : "+mmOrig);
System.err.println("[0] current: "+mmCurrent);
@@ -214,7 +214,7 @@ public class TestScreenMode01bNEWT extends UITestCase {
// set mode
{
- MonitorMode mm = monitorModes.get(0);
+ final MonitorMode mm = monitorModes.get(0);
System.err.println("[0] set current: "+mm);
final boolean smOk = monitor.setCurrentMode(mm);
mmCurrent = monitor.getCurrentMode();
@@ -272,14 +272,14 @@ public class TestScreenMode01bNEWT extends UITestCase {
Assert.assertEquals(true,screen.isNativeValid());
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
duration = MiscUtils.atol(args[i], duration);
}
}
- String tstname = TestScreenMode01bNEWT.class.getName();
+ final String tstname = TestScreenMode01bNEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java
index bbc1cb2da..377c35ade 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java
@@ -85,10 +85,10 @@ public class TestScreenMode01cNEWT extends UITestCase {
Thread.sleep(waitTimeShort);
}
- static GLWindow createWindow(Screen screen, GLCapabilities caps, String name, int screenXPos, int screenYPos, int width, int height) throws InterruptedException {
+ static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final String name, final int screenXPos, final int screenYPos, final int width, final int height) throws InterruptedException {
Assert.assertNotNull(caps);
- GLWindow window = GLWindow.create(screen, caps);
+ final GLWindow window = GLWindow.create(screen, caps);
// Window window = NewtFactory.createWindow(screen, caps);
final int[] winPos = window.convertToWindowUnits(new int[] { screenXPos, screenYPos });
window.setTitle(name);
@@ -102,7 +102,7 @@ public class TestScreenMode01cNEWT extends UITestCase {
return window;
}
- static void destroyWindow(Window window) throws InterruptedException {
+ static void destroyWindow(final Window window) throws InterruptedException {
if(null!=window) {
window.destroy();
AWTRobotUtil.waitForRealized(window, false); // don't override a previous assertion failure
@@ -117,7 +117,7 @@ public class TestScreenMode01cNEWT extends UITestCase {
Assert.assertNotNull(screen);
screen.addReference(); // trigger creation
try {
- RectangleImmutable monitorVp = screen.getMonitorDevices().get(0).getViewport();
+ final RectangleImmutable monitorVp = screen.getMonitorDevices().get(0).getViewport();
testScreenFullscreenImpl(screen, monitorVp.getX(), monitorVp.getY(), false, null);
} finally {
screen.removeReference();
@@ -137,7 +137,7 @@ public class TestScreenMode01cNEWT extends UITestCase {
System.err.println("Test Disabled (1): Monitor count < 2: "+screen);
return;
}
- RectangleImmutable monitorVp = screen.getMonitorDevices().get(1).getViewport();
+ final RectangleImmutable monitorVp = screen.getMonitorDevices().get(1).getViewport();
testScreenFullscreenImpl(screen, monitorVp.getX(), monitorVp.getY(), false, null);
} finally {
screen.removeReference();
@@ -160,7 +160,7 @@ public class TestScreenMode01cNEWT extends UITestCase {
final ArrayList<MonitorDevice> monitors = new ArrayList<MonitorDevice>();
monitors.add(screen.getMonitorDevices().get(0)); // Q1
monitors.add(screen.getMonitorDevices().get(1)); // Q2
- RectangleImmutable monitorVp = screen.getMonitorDevices().get(0).getViewport();
+ final RectangleImmutable monitorVp = screen.getMonitorDevices().get(0).getViewport();
testScreenFullscreenImpl(screen, monitorVp.getX()+50, monitorVp.getY()+50, true, monitors);
} finally {
screen.removeReference();
@@ -180,7 +180,7 @@ public class TestScreenMode01cNEWT extends UITestCase {
System.err.println("Test Disabled (3): Monitor count < 2: "+screen);
return;
}
- RectangleImmutable monitorVp = screen.getMonitorDevices().get(1).getViewport();
+ final RectangleImmutable monitorVp = screen.getMonitorDevices().get(1).getViewport();
testScreenFullscreenImpl(screen, monitorVp.getX()-50, monitorVp.getY()+50, true, null);
} finally {
screen.removeReference();
@@ -200,7 +200,7 @@ public class TestScreenMode01cNEWT extends UITestCase {
System.err.println("Test.0: Window bounds (pre): screenPos "+screenXPos+"/"+screenYPos+" [pixels], windowSize "+width+"x"+height+" [wu] within "+screen.getViewport()+" [pixels]");
- GLWindow window0 = createWindow(screen, caps, "win0", screenXPos, screenYPos, width, height);
+ final GLWindow window0 = createWindow(screen, caps, "win0", screenXPos, screenYPos, width, height);
Assert.assertNotNull(window0);
Rectangle window0WindowBounds = window0.getBounds();
DimensionImmutable window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
@@ -211,7 +211,7 @@ public class TestScreenMode01cNEWT extends UITestCase {
final Animator anim = new Animator(window0);
anim.start();
- List<MonitorMode> allMonitorModes = screen.getMonitorModes();
+ final List<MonitorMode> allMonitorModes = screen.getMonitorModes();
Assert.assertTrue(allMonitorModes.size()>0);
MonitorDevice monitor = window0.getMainMonitor();
@@ -236,7 +236,7 @@ public class TestScreenMode01cNEWT extends UITestCase {
if( null == monitorsUsed ) {
monitorsUsed = window0.getScreen().getMonitorDevices();
}
- Rectangle monitorsUsedViewport = new Rectangle();
+ final Rectangle monitorsUsedViewport = new Rectangle();
MonitorDevice.unionOfViewports(null, monitorsUsedViewport, monitorsUsed);
Assert.assertEquals(monitorsUsedViewport, window0WindowBounds);
}
@@ -262,14 +262,14 @@ public class TestScreenMode01cNEWT extends UITestCase {
Assert.assertEquals(true,screen.isNativeValid());
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
i++;
duration = MiscUtils.atol(args[i], duration);
}
}
- String tstname = TestScreenMode01cNEWT.class.getName();
+ final String tstname = TestScreenMode01cNEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java
index 2f86d120d..4d109a99f 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java
@@ -127,11 +127,11 @@ public class TestScreenMode01dNEWT extends UITestCase {
System.err.println("*** cleanupGL.DONE");
}
- static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
+ static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final int width, final int height, final boolean onscreen, final boolean undecorated) {
Assert.assertNotNull(caps);
caps.setOnscreen(onscreen);
- GLWindow window = GLWindow.create(screen, caps);
+ final GLWindow window = GLWindow.create(screen, caps);
window.setSize(width, height);
window.addGLEventListener(new GearsES2());
Assert.assertNotNull(window);
@@ -139,7 +139,7 @@ public class TestScreenMode01dNEWT extends UITestCase {
return window;
}
- static void destroyWindow(Window window) throws InterruptedException {
+ static void destroyWindow(final Window window) throws InterruptedException {
if(null!=window) {
window.destroy();
Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
@@ -149,15 +149,15 @@ public class TestScreenMode01dNEWT extends UITestCase {
@Test
public void test01FullscreenChange01() throws InterruptedException {
Thread.sleep(waitTimeShort);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- Display display = NewtFactory.createDisplay(null); // local display
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
- GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
- Animator animator = new Animator(window);
+ final GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+ final Animator animator = new Animator(window);
animator.start();
final MonitorDevice monitor = window.getMainMonitor();
@@ -200,13 +200,13 @@ public class TestScreenMode01dNEWT extends UITestCase {
public void test02ScreenModeChange01() throws InterruptedException {
Thread.sleep(waitTimeShort);
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- Display display = NewtFactory.createDisplay(null); // local display
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
- GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+ final GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
Assert.assertNotNull(window);
final RectangleImmutable winRect = window.getBounds();
@@ -221,12 +221,12 @@ public class TestScreenMode01dNEWT extends UITestCase {
return;
}
- Animator animator = new Animator(window);
+ final Animator animator = new Animator(window);
animator.start();
MonitorMode mmCurrent = monitor.queryCurrentMode();
Assert.assertNotNull(mmCurrent);
- MonitorMode mmOrig = monitor.getOriginalMode();
+ final MonitorMode mmOrig = monitor.getOriginalMode();
Assert.assertNotNull(mmOrig);
System.err.println("[0] orig : "+mmOrig);
System.err.println("[0] current: "+mmCurrent);
@@ -251,7 +251,7 @@ public class TestScreenMode01dNEWT extends UITestCase {
// set mode
{
- MonitorMode sm = monitorModes.get(0);
+ final MonitorMode sm = monitorModes.get(0);
System.err.println("[0] set current: "+sm);
final boolean smOk = monitor.setCurrentMode(sm);
mmCurrent = monitor.getCurrentMode();
@@ -299,19 +299,19 @@ public class TestScreenMode01dNEWT extends UITestCase {
testScreenModeChangeWithFS01Impl(true) ;
}
- protected void testScreenModeChangeWithFS01Impl(boolean preFS) throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
- Display display = NewtFactory.createDisplay(null); // local display
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
- GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
- Animator animator = new Animator(window);
+ protected void testScreenModeChangeWithFS01Impl(final boolean preFS) throws InterruptedException {
+ final GLCapabilities caps = new GLCapabilities(glp);
+ final Display display = NewtFactory.createDisplay(null); // local display
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+ final Animator animator = new Animator(window);
animator.start();
final RectangleImmutable winRect = window.getBounds();
final MonitorDevice monitor = screen.getMainMonitor(winRect);
MonitorMode mmCurrent = monitor.queryCurrentMode();
Assert.assertNotNull(mmCurrent);
- MonitorMode mmOrig = monitor.getOriginalMode();
+ final MonitorMode mmOrig = monitor.getOriginalMode();
Assert.assertNotNull(mmOrig);
System.err.println("[0] orig : "+mmOrig);
System.err.println("[0] current: "+mmCurrent);
@@ -330,7 +330,7 @@ public class TestScreenMode01dNEWT extends UITestCase {
monitorModes = MonitorModeUtil.filterByRate(monitorModes, mmOrig.getRefreshRate());
monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
- MonitorMode monitorMode = monitorModes.get(0);
+ final MonitorMode monitorMode = monitorModes.get(0);
Assert.assertNotNull(monitorMode);
if(preFS) {
@@ -418,8 +418,8 @@ public class TestScreenMode01dNEWT extends UITestCase {
Assert.assertEquals(false,screen.isNativeValid());
}
- public static void main(String args[]) throws IOException {
- String tstname = TestScreenMode01dNEWT.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestScreenMode01dNEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02aNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02aNEWT.java
index e87194bc6..c2d769a2e 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02aNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02aNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.mm;
import java.io.IOException;
@@ -59,14 +59,14 @@ import javax.media.nativewindow.util.Dimension;
* Tests MonitorMode change w/ changed rotation,
* w/ and w/o fullscreen, pre and post MonitorMode change.
* <p>
- * MonitorMode change does not use highest resolution.
+ * MonitorMode change does not use highest resolution.
* </p>
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestScreenMode02aNEWT extends UITestCase {
static GLProfile glp;
static int width, height;
-
+
static int waitTimeShort = 2000; // 2 sec
static int waitTimeLong = 8000; // 8 sec
@@ -78,52 +78,52 @@ public class TestScreenMode02aNEWT extends UITestCase {
glp = GLProfile.getDefault();
}
- static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
+ static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final int width, final int height, final boolean onscreen, final boolean undecorated) {
Assert.assertNotNull(caps);
caps.setOnscreen(onscreen);
- GLWindow window = GLWindow.create(screen, caps);
+ final GLWindow window = GLWindow.create(screen, caps);
window.setSize(width, height);
window.addGLEventListener(new GearsES2(1));
Assert.assertNotNull(window);
return window;
}
- static void destroyWindow(Window window) throws InterruptedException {
+ static void destroyWindow(final Window window) throws InterruptedException {
if(null!=window) {
window.destroy();
Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
}
}
-
+
@Test
public void testScreenRotationChange01_PreWin() throws InterruptedException {
testScreenRotationChangeImpl(true, true, false);
}
-
+
@Test
public void testScreenRotationChange02_PreFull() throws InterruptedException {
testScreenRotationChangeImpl(true, true, true);
}
-
+
@Test
public void testScreenRotationChange11_PostWin() throws InterruptedException {
testScreenRotationChangeImpl(true, false, false);
}
-
+
@Test
public void testScreenRotationChange12_PostFull() throws InterruptedException {
testScreenRotationChangeImpl(true, false, true);
}
-
- void testScreenRotationChangeImpl(boolean changeMode, boolean preVis, boolean fullscreen) throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+
+ void testScreenRotationChangeImpl(final boolean changeMode, final boolean preVis, final boolean fullscreen) throws InterruptedException {
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- Display display = NewtFactory.createDisplay(null); // local display
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
- GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+ final GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
Assert.assertNotNull(window);
if( preVis ) {
window.setVisible(true);
@@ -136,9 +136,9 @@ public class TestScreenMode02aNEWT extends UITestCase {
Assert.assertEquals(true,screen.isNativeValid());
}
- Animator animator = new Animator(window);
+ final Animator animator = new Animator(window);
animator.start();
-
+
final MonitorDevice monitor = window.getMainMonitor();
final MonitorMode mmOrig = monitor.getOriginalMode();
Assert.assertNotNull(mmOrig);
@@ -154,13 +154,13 @@ public class TestScreenMode02aNEWT extends UITestCase {
return;
}
Assert.assertTrue(monitorModes.size()>0);
-
+
MonitorMode mmCurrent = monitor.getCurrentMode();
Assert.assertNotNull(mmCurrent);
System.err.println("[0] orig : "+mmOrig);
System.err.println("[0] current: "+mmCurrent);
Assert.assertEquals(mmCurrent, mmOrig);
-
+
monitorModes = MonitorModeUtil.filterByFlags(monitorModes, 0); // no interlace, double-scan etc
Assert.assertNotNull(monitorModes);
Assert.assertTrue(monitorModes.size()>0);
@@ -181,10 +181,10 @@ public class TestScreenMode02aNEWT extends UITestCase {
monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
Assert.assertNotNull(monitorModes);
Assert.assertTrue(monitorModes.size()>0);
-
+
// set mode
{
- MonitorMode mm = monitorModes.get(0);
+ final MonitorMode mm = monitorModes.get(0);
System.err.println("[0] set current: "+mm);
final boolean smOk = monitor.setCurrentMode(mm);
mmCurrent = monitor.getCurrentMode();
@@ -196,40 +196,40 @@ public class TestScreenMode02aNEWT extends UITestCase {
Assert.assertTrue(smOk);
}
}
-
+
if( !preVis ) {
if( fullscreen ) {
window.setFullscreen(true);
}
window.setVisible(true);
}
-
+
Thread.sleep(waitTimeLong);
-
+
if( !preVis && fullscreen ) {
window.setFullscreen(false);
}
-
+
if(changeMode) {
Thread.sleep(waitTimeShort);
-
+
// manual restore!
{
System.err.println("[1] set orig: "+mmOrig);
final boolean smOk = monitor.setCurrentMode(mmOrig);
- MonitorMode mmCurrent = monitor.getCurrentMode();
+ final MonitorMode mmCurrent = monitor.getCurrentMode();
System.err.println("[1] has orig?: "+mmCurrent+", changeOK "+smOk);
Assert.assertFalse(monitor.isModeChangedByUs());
Assert.assertEquals(mmOrig, mmCurrent);
Assert.assertTrue(smOk);
- }
+ }
Thread.sleep(waitTimeShort);
}
-
+
if( preVis && fullscreen ) {
window.setFullscreen(false);
}
-
+
Assert.assertEquals(true,display.isNativeValid());
Assert.assertEquals(true,screen.isNativeValid());
Assert.assertEquals(true,window.isNativeValid());
@@ -237,7 +237,7 @@ public class TestScreenMode02aNEWT extends UITestCase {
animator.stop();
destroyWindow(window);
-
+
Assert.assertEquals(false,window.isVisible());
Assert.assertEquals(false,window.isNativeValid());
Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));
@@ -245,8 +245,8 @@ public class TestScreenMode02aNEWT extends UITestCase {
Assert.assertEquals(false,display.isNativeValid());
}
- public static void main(String args[]) throws IOException {
- String tstname = TestScreenMode02aNEWT.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestScreenMode02aNEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02bNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02bNEWT.java
index 2da2abd32..47fd53e05 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02bNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02bNEWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.mm;
import java.io.IOException;
@@ -59,7 +59,7 @@ import javax.media.nativewindow.util.Dimension;
/**
* Tests MonitorMode change w/ changed rotation and fullscreen.
* <p>
- * MonitorMode change uses highest resolution.
+ * MonitorMode change uses highest resolution.
* </p>
* <p>
* Bug 734 could not be reproduced, however on tests systems
@@ -69,13 +69,13 @@ import javax.media.nativewindow.util.Dimension;
* <p>
* Documents remedy B) for NV RANDR/GL bug
* </p>
- *
+ *
* @see TestScreenMode01NEWT#cleanupGL()
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestScreenMode02bNEWT extends UITestCase {
static GLProfile glp;
-
+
static int waitTimeShort = 2000; // 2 sec
static int waitTimeLong = 8000; // 8 sec
@@ -89,11 +89,11 @@ public class TestScreenMode02bNEWT extends UITestCase {
public static void releaseClass() throws InterruptedException {
Thread.sleep(waitTimeShort);
}
-
- static GLWindow createWindow(Screen screen, GLCapabilities caps, String name, int x, int y, int width, int height) {
+
+ static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final String name, final int x, final int y, final int width, final int height) {
Assert.assertNotNull(caps);
- GLWindow window = GLWindow.create(screen, caps);
+ final GLWindow window = GLWindow.create(screen, caps);
// Window window = NewtFactory.createWindow(screen, caps);
window.setTitle(name);
window.setPosition(x, y);
@@ -103,43 +103,43 @@ public class TestScreenMode02bNEWT extends UITestCase {
return window;
}
- static void destroyWindow(Window window) throws InterruptedException {
+ static void destroyWindow(final Window window) throws InterruptedException {
if(null!=window) {
window.destroy();
Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
}
}
-
+
@Test
public void testScreenModeChange01_PreFull() throws InterruptedException {
testScreenModeChangeImpl(true);
}
-
+
@Test
public void testScreenModeChange02_PostFull() throws InterruptedException {
testScreenModeChangeImpl(false);
}
-
- void testScreenModeChangeImpl(boolean preVis) throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(glp);
+
+ void testScreenModeChangeImpl(final boolean preVis) throws InterruptedException {
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
- Display display = NewtFactory.createDisplay(null); // local display
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
screen.createNative(); // instantiate for resolution query and keep it alive !
final int swidth = screen.getWidth();
final int sheight = screen.getHeight();
- GLWindow window = createWindow(screen, caps, "win0", 0, 0, 640, 480);
+ final GLWindow window = createWindow(screen, caps, "win0", 0, 0, 640, 480);
if( preVis ) {
window.setVisible(true);
window.setFullscreen(true);
}
window.setUndecorated(true);
- Assert.assertNotNull(window);
+ Assert.assertNotNull(window);
- List<MonitorMode> allMonitorModes = screen.getMonitorModes();
+ final List<MonitorMode> allMonitorModes = screen.getMonitorModes();
Assert.assertTrue(allMonitorModes.size()>0);
if(allMonitorModes.size()==1) {
// no support ..
@@ -148,7 +148,7 @@ public class TestScreenMode02bNEWT extends UITestCase {
return;
}
- MonitorDevice monitor = window.getMainMonitor();
+ final MonitorDevice monitor = window.getMainMonitor();
List<MonitorMode> monitorModes = monitor.getSupportedModes();
Assert.assertTrue(monitorModes.size()>0);
if(monitorModes.size()==1) {
@@ -158,10 +158,10 @@ public class TestScreenMode02bNEWT extends UITestCase {
return;
}
Assert.assertTrue(allMonitorModes.containsAll(monitorModes));
-
- Animator animator = new Animator(window);
+
+ final Animator animator = new Animator(window);
animator.start();
-
+
MonitorMode mmCurrent = monitor.queryCurrentMode();
Assert.assertNotNull(mmCurrent);
final MonitorMode mmOrig = monitor.getOriginalMode();
@@ -169,7 +169,7 @@ public class TestScreenMode02bNEWT extends UITestCase {
System.err.println("[0] orig : "+mmOrig);
System.err.println("[0] current: "+mmCurrent);
Assert.assertEquals(mmCurrent, mmOrig);
-
+
monitorModes = MonitorModeUtil.filterByFlags(monitorModes, 0); // no interlace, double-scan etc
Assert.assertNotNull(monitorModes);
Assert.assertTrue(monitorModes.size()>0);
@@ -185,16 +185,16 @@ public class TestScreenMode02bNEWT extends UITestCase {
Assert.assertNotNull(monitorModes);
Assert.assertTrue(monitorModes.size()>0);
monitorModes = MonitorModeUtil.filterByRate(monitorModes, mmOrig.getRefreshRate());
- Assert.assertNotNull(monitorModes);
+ Assert.assertNotNull(monitorModes);
Assert.assertTrue(monitorModes.size()>0);
-
+
monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
Assert.assertNotNull(monitorModes);
Assert.assertTrue(monitorModes.size()>0);
// set mode
{
- MonitorMode mm = monitorModes.get(0); // highest resolution ..
+ final MonitorMode mm = monitorModes.get(0); // highest resolution ..
System.err.println("[0] set current: "+mm);
final boolean smOk = monitor.setCurrentMode(mm);
mmCurrent = monitor.getCurrentMode();
@@ -216,13 +216,13 @@ public class TestScreenMode02bNEWT extends UITestCase {
window.setFullscreen(true);
window.setVisible(true);
}
-
+
Thread.sleep(waitTimeLong);
-
+
if( !preVis ) {
window.setFullscreen(false);
}
-
+
// manual restore!
{
System.err.println("[1] set orig: "+mmOrig);
@@ -232,21 +232,21 @@ public class TestScreenMode02bNEWT extends UITestCase {
Assert.assertFalse(monitor.isModeChangedByUs());
Assert.assertEquals(mmOrig, mmCurrent);
Assert.assertTrue(smOk);
- }
+ }
Thread.sleep(waitTimeShort);
if( preVis ) {
window.setFullscreen(false);
}
-
+
Assert.assertEquals(true,display.isNativeValid());
Assert.assertEquals(true,screen.isNativeValid());
Assert.assertEquals(true,window.isNativeValid());
Assert.assertEquals(true,window.isVisible());
- animator.stop();
+ animator.stop();
destroyWindow(window);
-
+
Assert.assertEquals(false,window.isVisible());
Assert.assertEquals(false,window.isNativeValid());
Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));
@@ -254,8 +254,8 @@ public class TestScreenMode02bNEWT extends UITestCase {
Assert.assertEquals(false,display.isNativeValid());
}
- public static void main(String args[]) throws IOException {
- String tstname = TestScreenMode02bNEWT.class.getName();
+ public static void main(final String args[]) throws IOException {
+ final String tstname = TestScreenMode02bNEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/GLRunnableDummy.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/GLRunnableDummy.java
index 1ca74774b..18f2b9b4a 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/GLRunnableDummy.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/GLRunnableDummy.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.parenting;
import javax.media.opengl.*;
@@ -36,8 +36,8 @@ public class GLRunnableDummy implements GLRunnable {
float b=0.0f;
float d=0.1f;
- public boolean run(GLAutoDrawable drawable) {
- GL2ES1 gl = drawable.getGL().getGL2ES1();
+ public boolean run(final GLAutoDrawable drawable) {
+ final GL2ES1 gl = drawable.getGL().getGL2ES1();
gl.glClearColor(r, g, b, 1f);
r+=d;
if(r>1f) {
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/KeyAction.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/KeyAction.java
index 0ae94d7af..64867b054 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/KeyAction.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/KeyAction.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.parenting;
@@ -34,14 +34,14 @@ import com.jogamp.newt.event.*;
class KeyAction extends KeyAdapter {
NEWTEventFiFo eventFifo;
- public KeyAction(NEWTEventFiFo eventFifo) {
- this.eventFifo = eventFifo;
+ public KeyAction(final NEWTEventFiFo eventFifo) {
+ this.eventFifo = eventFifo;
}
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
- }
+ }
eventFifo.put(e);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java
index 005579352..75037b60c 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java
@@ -50,20 +50,20 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter {
PointerIcon[] pointerIcons = null;
int pointerIconIdx = 0;
- public NewtAWTReparentingKeyAdapter(Frame frame, NewtCanvasAWT newtCanvasAWT, GLWindow glWindow, QuitAdapter quitAdapter) {
+ public NewtAWTReparentingKeyAdapter(final Frame frame, final NewtCanvasAWT newtCanvasAWT, final GLWindow glWindow, final QuitAdapter quitAdapter) {
this.frame = frame;
this.newtCanvasAWT = newtCanvasAWT;
this.glWindow = glWindow;
this.quitAdapter = quitAdapter;
}
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
}
if( e.getKeySymbol() == KeyEvent.VK_L ) {
- javax.media.nativewindow.util.Point p0 = newtCanvasAWT.getNativeWindow().getLocationOnScreen(null);
- javax.media.nativewindow.util.Point p1 = glWindow.getLocationOnScreen(null);
+ final javax.media.nativewindow.util.Point p0 = newtCanvasAWT.getNativeWindow().getLocationOnScreen(null);
+ final javax.media.nativewindow.util.Point p1 = glWindow.getLocationOnScreen(null);
System.err.println("NewtCanvasAWT position: "+p0+", "+p1);
} else if( e.getKeySymbol() == KeyEvent.VK_D ) {
glWindow.setUndecorated(!glWindow.isUndecorated());
@@ -156,7 +156,7 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter {
try {
_pointerIcon = disp.createPointerIcon(res, 8, 8);
System.err.println("Create PointerIcon #01: "+_pointerIcon);
- } catch (Exception ex) {
+ } catch (final Exception ex) {
ex.printStackTrace();
}
pointerIcons[0] = _pointerIcon;
@@ -167,7 +167,7 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter {
try {
_pointerIcon = disp.createPointerIcon(res, 0, 0);
System.err.println("Create PointerIcon #02: "+_pointerIcon);
- } catch (Exception ex) {
+ } catch (final Exception ex) {
ex.printStackTrace();
}
pointerIcons[1] = _pointerIcon;
@@ -181,7 +181,7 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter {
System.err.println("Create PointerIcon #03: "+image);
_pointerIcon = disp.createPointerIcon(image, 32, 0);
System.err.println("Create PointerIcon #03: "+_pointerIcon);
- } catch (Exception ex) {
+ } catch (final Exception ex) {
ex.printStackTrace();
}
pointerIcons[2] = _pointerIcon;
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
index 714c397f3..d6658d809 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
@@ -67,7 +67,7 @@ public class TestParenting01NEWT extends UITestCase {
Display display = null;
Screen screen = null;
- GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
Assert.assertNotNull(glWindow1);
Assert.assertEquals(false, glWindow1.isVisible());
Assert.assertEquals(false, glWindow1.isNativeValid());
@@ -84,11 +84,11 @@ public class TestParenting01NEWT extends UITestCase {
glWindow1.setTitle("test01CreateVisibleDestroy");
glWindow1.setSize(640, 480);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
- GLWindow glWindow2 = GLWindow.create(glWindow1, glCaps);
+ final GLWindow glWindow2 = GLWindow.create(glWindow1, glCaps);
Assert.assertNotNull(glWindow2);
Assert.assertEquals(false, glWindow2.isVisible());
Assert.assertEquals(false, glWindow2.isNativeValid());
@@ -96,7 +96,7 @@ public class TestParenting01NEWT extends UITestCase {
Assert.assertSame(screen,glWindow2.getScreen());
Assert.assertSame(display,glWindow2.getScreen().getDisplay());
glWindow2.setSize(320, 240);
- GLEventListener demo2 = new GearsES2();
+ final GLEventListener demo2 = new GearsES2();
setDemoFields(demo2, glWindow2, false);
glWindow2.addGLEventListener(demo2);
@@ -150,13 +150,13 @@ public class TestParenting01NEWT extends UITestCase {
glWindow1.resetFPSCounter();
glWindow2.resetFPSCounter();
- Animator animator1 = new Animator(glWindow1);
+ final Animator animator1 = new Animator(glWindow1);
animator1.setUpdateFPSFrames(1, null);
animator1.start();
Assert.assertEquals(true, animator1.isAnimating());
Assert.assertEquals(false, animator1.isPaused());
Assert.assertNotNull(animator1.getThread());
- Animator animator2 = new Animator(glWindow2);
+ final Animator animator2 = new Animator(glWindow2);
animator2.setUpdateFPSFrames(1, null);
animator2.start();
Assert.assertEquals(true, animator2.isAnimating());
@@ -305,10 +305,10 @@ public class TestParenting01NEWT extends UITestCase {
Display display1 = null;
Screen screen1 = null;
- GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
glWindow1.setTitle("test02ReparentTop2Win");
glWindow1.setSize(640, 480);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
screen1 = glWindow1.getScreen();
@@ -322,9 +322,9 @@ public class TestParenting01NEWT extends UITestCase {
Assert.assertEquals(false,screen1.isNativeValid());
Assert.assertEquals(0,Display.getActiveDisplayNumber());
- GLWindow glWindow2 = GLWindow.create(glCaps);
+ final GLWindow glWindow2 = GLWindow.create(glCaps);
glWindow2.setSize(320, 240);
- GLEventListener demo2 = new GearsES2();
+ final GLEventListener demo2 = new GearsES2();
setDemoFields(demo2, glWindow2, false);
glWindow2.addGLEventListener(demo2);
Assert.assertSame(screen1, glWindow2.getScreen());
@@ -365,10 +365,10 @@ public class TestParenting01NEWT extends UITestCase {
System.err.println("Frames for setVisible(true) B1: "+glWindow2.getTotalFPSFrames());
Assert.assertTrue(0 < glWindow1.getTotalFPSFrames());
- Animator animator1 = new Animator(glWindow1);
+ final Animator animator1 = new Animator(glWindow1);
animator1.setUpdateFPSFrames(1, null);
animator1.start();
- Animator animator2 = new Animator(glWindow2);
+ final Animator animator2 = new Animator(glWindow2);
animator2.setUpdateFPSFrames(1, null);
animator2.start();
@@ -540,12 +540,12 @@ public class TestParenting01NEWT extends UITestCase {
Display display2 = null;
Screen screen2 = null;
- GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
screen1 = glWindow1.getScreen();
display1 = screen1.getDisplay();
glWindow1.setTitle("test03ReparentWin2Top");
glWindow1.setSize(640, 480);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
@@ -557,11 +557,11 @@ public class TestParenting01NEWT extends UITestCase {
Assert.assertEquals(false,screen1.isNativeValid());
Assert.assertEquals(0,Display.getActiveDisplayNumber());
- GLWindow glWindow2 = GLWindow.create(glWindow1, glCaps);
+ final GLWindow glWindow2 = GLWindow.create(glWindow1, glCaps);
screen2 = glWindow2.getScreen();
display2 = screen2.getDisplay();
glWindow2.setSize(320, 240);
- GLEventListener demo2 = new GearsES2();
+ final GLEventListener demo2 = new GearsES2();
setDemoFields(demo2, glWindow2, false);
glWindow2.addGLEventListener(demo2);
@@ -593,10 +593,10 @@ public class TestParenting01NEWT extends UITestCase {
Assert.assertSame(screen1,glWindow2.getScreen());
Assert.assertEquals(1,Display.getActiveDisplayNumber());
- Animator animator1 = new Animator(glWindow1);
+ final Animator animator1 = new Animator(glWindow1);
animator1.setUpdateFPSFrames(1, null);
animator1.start();
- Animator animator2 = new Animator(glWindow2);
+ final Animator animator2 = new Animator(glWindow2);
animator2.setUpdateFPSFrames(1, null);
animator2.start();
@@ -734,7 +734,7 @@ public class TestParenting01NEWT extends UITestCase {
Assert.assertEquals(0,Display.getActiveDisplayNumber());
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
if(debug) {
@@ -746,15 +746,15 @@ public class TestParenting01NEWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
boolean asMain = false;
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
@@ -767,14 +767,14 @@ public class TestParenting01NEWT extends UITestCase {
if( asMain ) {
try {
TestParenting01NEWT.initClass();
- TestParenting01NEWT m = new TestParenting01NEWT();
+ final TestParenting01NEWT m = new TestParenting01NEWT();
m.test02aReparentTop2WinReparentRecreate();
m.test01CreateVisibleDestroy();
- } catch (Throwable t ) {
+ } catch (final Throwable t ) {
t.printStackTrace();
}
} else {
- String tstname = TestParenting01NEWT.class.getName();
+ final String tstname = TestParenting01NEWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java
index 420a39cb2..6f39985f4 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java
@@ -75,7 +75,7 @@ public class TestParenting01aAWT extends UITestCase {
Assert.assertEquals(false, glWindow1.isNativeValid());
Assert.assertNull(glWindow1.getParent());
glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
@@ -165,7 +165,7 @@ public class TestParenting01aAWT extends UITestCase {
Assert.assertEquals(false, glWindow1.isVisible());
Assert.assertEquals(false, glWindow1.isNativeValid());
Assert.assertNull(glWindow1.getParent());
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
@@ -194,7 +194,7 @@ public class TestParenting01aAWT extends UITestCase {
});
Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
- Animator animator1 = new Animator(glWindow1);
+ final Animator animator1 = new Animator(glWindow1);
animator1.setUpdateFPSFrames(1, null);
animator1.start();
while(animator1.isAnimating() && animator1.getTotalFPSDuration()<durationPerTest) {
@@ -212,8 +212,8 @@ public class TestParenting01aAWT extends UITestCase {
@Test
public void test03WindowParenting02CreateVisibleDestroy3Odd() throws InterruptedException, InvocationTargetException {
- GLWindow glWindow1 = GLWindow.create(glCaps);
- GLEventListener demo1 = new RedSquareES2();
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
@@ -237,7 +237,7 @@ public class TestParenting01aAWT extends UITestCase {
}
});
- Animator animator1 = new Animator(glWindow1);
+ final Animator animator1 = new Animator(glWindow1);
animator1.setUpdateFPSFrames(1, null);
animator1.start();
Assert.assertEquals(true, animator1.isStarted());
@@ -257,8 +257,8 @@ public class TestParenting01aAWT extends UITestCase {
@Test
public void test04WindowParenting03ReparentNewtWin2Top() throws InterruptedException, InvocationTargetException {
- GLWindow glWindow1 = GLWindow.create(glCaps);
- GLEventListener demo1 = new RedSquareES2();
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
@@ -282,7 +282,7 @@ public class TestParenting01aAWT extends UITestCase {
Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
- Animator animator1 = new Animator(glWindow1);
+ final Animator animator1 = new Animator(glWindow1);
animator1.setUpdateFPSFrames(1, null);
animator1.start();
@@ -316,8 +316,8 @@ public class TestParenting01aAWT extends UITestCase {
@Test
public void test05WindowParenting04ReparentNewtWin2TopLayouted() throws InterruptedException, InvocationTargetException {
- GLWindow glWindow1 = GLWindow.create(glCaps);
- GLEventListener demo1 = new RedSquareES2();
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
@@ -347,7 +347,7 @@ public class TestParenting01aAWT extends UITestCase {
Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
- Animator animator1 = new Animator(glWindow1);
+ final Animator animator1 = new Animator(glWindow1);
animator1.setUpdateFPSFrames(1, null);
animator1.start();
@@ -381,9 +381,9 @@ public class TestParenting01aAWT extends UITestCase {
@Test
public void test06WindowParenting05ReparentAWTWinHopFrame2Frame() throws InterruptedException, InvocationTargetException {
- GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
glWindow1.setUndecorated(true);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
@@ -426,7 +426,7 @@ public class TestParenting01aAWT extends UITestCase {
Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
- Animator animator1 = new Animator(glWindow1);
+ final Animator animator1 = new Animator(glWindow1);
animator1.setUpdateFPSFrames(1, null);
animator1.start();
@@ -469,7 +469,7 @@ public class TestParenting01aAWT extends UITestCase {
glWindow1.destroy();
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
if(debug) {
@@ -481,15 +481,15 @@ public class TestParenting01aAWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
@@ -497,7 +497,7 @@ public class TestParenting01aAWT extends UITestCase {
waitReparent = atoi(args[++i]);
}
}
- String tstname = TestParenting01aAWT.class.getName();
+ final String tstname = TestParenting01aAWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aSWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aSWT.java
index 4bb64c766..770b7ce4d 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aSWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aSWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.parenting;
import java.io.IOException;
@@ -70,7 +70,7 @@ public class TestParenting01aSWT extends UITestCase {
Shell shell = null;
Composite composite1 = null;
com.jogamp.newt.Display swtNewtDisplay = null;
-
+
@BeforeClass
public static void initClass() {
width = 640;
@@ -81,7 +81,7 @@ public class TestParenting01aSWT extends UITestCase {
@Before
public void init() {
SWTAccessor.invoke(true, new Runnable() {
- public void run() {
+ public void run() {
display = new Display();
Assert.assertNotNull( display );
shell = new Shell( display );
@@ -93,7 +93,7 @@ public class TestParenting01aSWT extends UITestCase {
}});
swtNewtDisplay = NewtFactory.createDisplay(null, false); // no-reuse
}
-
+
@After
public void release() {
Assert.assertNotNull( display );
@@ -107,7 +107,7 @@ public class TestParenting01aSWT extends UITestCase {
display.dispose();
}});
}
- catch( Throwable throwable ) {
+ catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -116,18 +116,18 @@ public class TestParenting01aSWT extends UITestCase {
shell = null;
composite1 = null;
}
-
+
@Test
public void testWindowParenting01CreateVisibleDestroy1() throws InterruptedException, InvocationTargetException {
- com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, 0);
- GLWindow glWindow1 = GLWindow.create(screen, glCaps);
+ final com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, 0);
+ final GLWindow glWindow1 = GLWindow.create(screen, glCaps);
Assert.assertNotNull(glWindow1);
Assert.assertEquals(false, glWindow1.isVisible());
Assert.assertEquals(false, glWindow1.isNativeValid());
Assert.assertNull(glWindow1.getParent());
glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
@@ -144,7 +144,7 @@ public class TestParenting01aSWT extends UITestCase {
shell.open();
}
});
-
+
// visible test
Assert.assertEquals(canvas1.getNativeWindow(),glWindow1.getParent());
@@ -174,10 +174,10 @@ public class TestParenting01aSWT extends UITestCase {
Assert.assertEquals(false, glWindow1.isNativeValid());
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
- Window window = glWindow.getDelegatedWindow();
+ final Window window = glWindow.getDelegatedWindow();
if(debug) {
MiscUtils.setFieldIfExists(demo, "glDebug", true);
MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -187,21 +187,21 @@ public class TestParenting01aSWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
- String tstname = TestParenting01aSWT.class.getName();
+ final String tstname = TestParenting01aSWT.class.getName();
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
"filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java
index 598e5f10f..49e74ddc0 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java
@@ -77,10 +77,10 @@ public class TestParenting01bAWT extends UITestCase {
testAWTWinHopFrame2FrameImpl(0);
}
- public void testAWTWinHopFrame2FrameImpl(int fps) throws InterruptedException, InvocationTargetException {
- GLWindow glWindow1 = GLWindow.create(glCaps);
+ public void testAWTWinHopFrame2FrameImpl(final int fps) throws InterruptedException, InvocationTargetException {
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
glWindow1.setUndecorated(true);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
@@ -173,10 +173,10 @@ public class TestParenting01bAWT extends UITestCase {
glWindow1.destroy();
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
- Window window = glWindow.getDelegatedWindow();
+ final Window window = glWindow.getDelegatedWindow();
if(debug) {
MiscUtils.setFieldIfExists(demo, "glDebug", true);
MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -186,15 +186,15 @@ public class TestParenting01bAWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
@@ -202,7 +202,7 @@ public class TestParenting01bAWT extends UITestCase {
waitReparent = atoi(args[++i]);
}
}
- String tstname = TestParenting01bAWT.class.getName();
+ final String tstname = TestParenting01bAWT.class.getName();
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
"filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java
index 1d7401728..30be67ab3 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.parenting;
import org.junit.Assert;
@@ -69,13 +69,13 @@ public class TestParenting01cAWT extends UITestCase {
public void test01CreateVisibleDestroy1() throws InterruptedException, InvocationTargetException {
int i;
- GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
Assert.assertNotNull(glWindow1);
Assert.assertEquals(false, glWindow1.isVisible());
Assert.assertEquals(false, glWindow1.isNativeValid());
Assert.assertNull(glWindow1.getParent());
glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
@@ -92,7 +92,7 @@ public class TestParenting01cAWT extends UITestCase {
frame1.add(new Button("East"), BorderLayout.EAST);
frame1.add(new Button("West"), BorderLayout.WEST);
- Container container1 = new Container();
+ final Container container1 = new Container();
container1.setLayout(new BorderLayout());
container1.add(new Button("north"), BorderLayout.NORTH);
container1.add(new Button("south"), BorderLayout.SOUTH);
@@ -130,7 +130,7 @@ public class TestParenting01cAWT extends UITestCase {
Assert.assertEquals(true, glWindow1.isNativeValid());
final boolean wasOnscreen = glWindow1.getChosenCapabilities().isOnscreen();
-
+
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame1.remove(newtCanvasAWT);
@@ -155,9 +155,9 @@ public class TestParenting01cAWT extends UITestCase {
@Test
public void test02AWTWinHopFrame2Frame() throws InterruptedException, InvocationTargetException {
- GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
glWindow1.setUndecorated(true);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
@@ -234,10 +234,10 @@ public class TestParenting01cAWT extends UITestCase {
glWindow1.destroy();
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
- Window window = glWindow.getDelegatedWindow();
+ final Window window = glWindow.getDelegatedWindow();
if(debug) {
MiscUtils.setFieldIfExists(demo, "glDebug", true);
MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -247,21 +247,21 @@ public class TestParenting01cAWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
- String tstname = TestParenting01cAWT.class.getName();
+ final String tstname = TestParenting01cAWT.class.getName();
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
"filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java
index 4d5c3b25d..3726870e3 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.parenting;
import java.lang.reflect.*;
@@ -39,10 +39,11 @@ import org.junit.runners.MethodSorters;
import java.awt.Button;
import java.awt.BorderLayout;
import java.awt.Container;
+
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
-
+import javax.swing.WindowConstants;
import javax.media.opengl.*;
import com.jogamp.opengl.util.Animator;
@@ -69,38 +70,38 @@ public class TestParenting01cSwingAWT extends UITestCase {
glCaps = new GLCapabilities(null);
}
- static class GLDisturbanceAction implements Runnable {
+ static class GLDisturbanceAction implements Runnable {
public boolean isRunning = false;
private volatile boolean shallStop = false;
private final GLAutoDrawable glad;
private final GLRunnable glRunnable;
-
- public GLDisturbanceAction(GLAutoDrawable glad) {
+
+ public GLDisturbanceAction(final GLAutoDrawable glad) {
this.glad = glad;
this.glRunnable = new GLRunnableDummy();
}
-
+
public void waitUntilRunning() {
synchronized(this) {
while(!isRunning) {
try {
this.wait();
- } catch (InterruptedException e) { e.printStackTrace(); }
- }
+ } catch (final InterruptedException e) { e.printStackTrace(); }
+ }
}
}
-
+
public void stopAndWaitUntilDone() {
shallStop = true;
synchronized(this) {
while(isRunning) {
try {
this.wait();
- } catch (InterruptedException e) { e.printStackTrace(); }
- }
+ } catch (final InterruptedException e) { e.printStackTrace(); }
+ }
}
}
-
+
public void run() {
synchronized(this) {
isRunning = true;
@@ -111,7 +112,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
try {
glad.invoke(true, glRunnable);
Thread.sleep(100);
- } catch (Throwable t) {}
+ } catch (final Throwable t) {}
}
synchronized(this) {
isRunning = false;
@@ -119,25 +120,25 @@ public class TestParenting01cSwingAWT extends UITestCase {
}
}
}
-
+
@Test
public void test01CreateVisibleDestroy1() throws InterruptedException, InvocationTargetException {
/**
* JFrame . JPanel . Container . NewtCanvasAWT . GLWindow
*/
- GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
Assert.assertNotNull(glWindow1);
Assert.assertEquals(false, glWindow1.isVisible());
Assert.assertEquals(false, glWindow1.isNativeValid());
Assert.assertNull(glWindow1.getParent());
glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
- Animator animator1 = new Animator(glWindow1);
+ final Animator animator1 = new Animator(glWindow1);
animator1.setUpdateFPSFrames(1, null);
animator1.start();
-
+
final GLDisturbanceAction disturbanceAction = new GLDisturbanceAction(glWindow1);
new Thread(disturbanceAction).start();
disturbanceAction.waitUntilRunning();
@@ -166,7 +167,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
final JFrame jFrame1 = new JFrame("Swing Parent JFrame");
// jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+ jFrame1.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
jFrame1.setContentPane(jPanel1);
System.err.println("Demos: 1 - Visible");
SwingUtilities.invokeAndWait(new Runnable() {
@@ -204,7 +205,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(glWindow1, true));
final boolean wasOnscreen = glWindow1.getChosenCapabilities().isOnscreen();
-
+
// Always recommended to remove our native parented Window
// from the AWT resources before destruction, since it could lead
// to a BadMatch X11 error w/o.
@@ -227,11 +228,11 @@ public class TestParenting01cSwingAWT extends UITestCase {
Assert.assertEquals(true, glWindow1.isNativeValid());
} // else OK to be destroyed - due to offscreen/onscreen transition
- System.err.println("Demos: 7 - X GLWindow");
+ System.err.println("Demos: 7 - X GLWindow");
glWindow1.destroy();
Assert.assertEquals(false, glWindow1.isNativeValid());
-
- System.err.println("Demos: 8 - X DisturbanceThread");
+
+ System.err.println("Demos: 8 - X DisturbanceThread");
disturbanceAction.stopAndWaitUntilDone();
}
@@ -240,23 +241,23 @@ public class TestParenting01cSwingAWT extends UITestCase {
/**
* JFrame . JPanel . Container . NewtCanvasAWT . GLWindow
*/
- GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
Assert.assertNotNull(glWindow1);
Assert.assertEquals(false, glWindow1.isVisible());
Assert.assertEquals(false, glWindow1.isNativeValid());
Assert.assertNull(glWindow1.getParent());
glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
/*
glWindow1.addGLEventListener(new GLEventListener() {
@Override
public void init(GLAutoDrawable drawable) {
- System.err.println("XXX init");
+ System.err.println("XXX init");
}
@Override
public void dispose(GLAutoDrawable drawable) {
- System.err.println("XXX dispose");
+ System.err.println("XXX dispose");
// Thread.dumpStack();
}
@Override
@@ -265,10 +266,10 @@ public class TestParenting01cSwingAWT extends UITestCase {
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
System.err.println("XXX reshape");
// Thread.dumpStack();
- }
+ }
}); */
glWindow1.addGLEventListener(demo1);
- Animator animator1 = new Animator(glWindow1);
+ final Animator animator1 = new Animator(glWindow1);
animator1.setUpdateFPSFrames(1, null);
animator1.start();
@@ -300,7 +301,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
final JFrame jFrame1 = new JFrame("Swing Parent JFrame");
// jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+ jFrame1.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
jFrame1.setContentPane(jPanel1);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -319,7 +320,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
final JFrame jFrame2 = new JFrame("Swing Parent JFrame");
// jFrame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- jFrame2.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+ jFrame2.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
jFrame2.setContentPane(jPanel2);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -333,7 +334,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
final boolean wasOnscreen = glWindow1.getChosenCapabilities().isOnscreen();
-
+
int state = 0;
while(animator1.isAnimating() && animator1.getTotalFPSDuration()<3*durationPerTest) {
Thread.sleep(durationPerTest);
@@ -353,7 +354,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
jPanel2.remove(newtCanvasAWT);
container1.add(newtCanvasAWT, BorderLayout.CENTER);
jFrame1.validate();
- jFrame2.validate();
+ jFrame2.validate();
} });
break;
}
@@ -376,11 +377,11 @@ public class TestParenting01cSwingAWT extends UITestCase {
jFrame1.validate();
System.err.println("Demos: 1 - X Container 2");
jPanel2.remove(newtCanvasAWT);
- jFrame2.validate();
+ jFrame2.validate();
} }); */
/*
* Invisible X11 windows may also case BadMatch (-> XAWT related)
- */
+ */
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
System.err.println("Demos: 2 - !visible");
@@ -401,18 +402,18 @@ public class TestParenting01cSwingAWT extends UITestCase {
Assert.assertEquals(true, glWindow1.isNativeValid());
} // else OK to be destroyed - due to offscreen/onscreen transition
- System.err.println("Demos: 6 - X GLWindow");
+ System.err.println("Demos: 6 - X GLWindow");
glWindow1.destroy();
Assert.assertEquals(false, glWindow1.isNativeValid());
-
- System.err.println("Demos: 7 - X DisturbanceThread");
- disturbanceAction.stopAndWaitUntilDone();
+
+ System.err.println("Demos: 7 - X DisturbanceThread");
+ disturbanceAction.stopAndWaitUntilDone();
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
- Window window = glWindow.getDelegatedWindow();
+ final Window window = glWindow.getDelegatedWindow();
if(debug) {
MiscUtils.setFieldIfExists(demo, "glDebug", true);
MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -422,15 +423,15 @@ public class TestParenting01cSwingAWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01dAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01dAWT.java
index 288918e48..ad8a6f50e 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01dAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01dAWT.java
@@ -75,14 +75,14 @@ public class TestParenting01dAWT extends UITestCase {
static class MyGLEventListenerCounter extends GLEventListenerCounter {
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
super.init(drawable);
System.err.println("MyGLEventListenerCounter.init: "+this);
// Thread.dumpStack();
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
super.dispose(drawable);
System.err.println("MyGLEventListenerCounter.dispose: "+this);
// Thread.dumpStack();
@@ -99,7 +99,7 @@ public class TestParenting01dAWT extends UITestCase {
testGLWindowInvisibleReparentRecreateImpl(true /* triggerPreserveGLState */);
}
- private void testGLWindowInvisibleReparentRecreateImpl(boolean triggerPreserveGLState) throws InterruptedException, InvocationTargetException {
+ private void testGLWindowInvisibleReparentRecreateImpl(final boolean triggerPreserveGLState) throws InterruptedException, InvocationTargetException {
final GLWindow glWindow1 = GLWindow.create(glCaps);
Assert.assertNotNull(glWindow1);
Assert.assertEquals(false, glWindow1.isVisible());
@@ -108,7 +108,7 @@ public class TestParenting01dAWT extends UITestCase {
glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
final MyGLEventListenerCounter glelCounter = new MyGLEventListenerCounter();
glWindow1.addGLEventListener(glelCounter);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
glWindow1.addGLEventListener(demo1);
Assert.assertEquals("Init Counter Invalid "+glelCounter, 0, glelCounter.initCount);
@@ -238,13 +238,13 @@ public class TestParenting01dAWT extends UITestCase {
}
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
}
}
- String tstname = TestParenting01dAWT.class.getName();
+ final String tstname = TestParenting01dAWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java
index b304a2ce7..ed5c2f8a1 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java
@@ -85,7 +85,7 @@ public class TestParenting02AWT extends UITestCase {
}
public void runNewtChildOnAWTParent(final boolean useLayout, final boolean deferredPeer) throws InterruptedException, InvocationTargetException {
- NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+ final NEWTEventFiFo eventFifo = new NEWTEventFiFo();
// setup NEWT GLWindow ..
final GLWindow glWindow = GLWindow.create(new GLCapabilities(null));
@@ -194,7 +194,7 @@ public class TestParenting02AWT extends UITestCase {
}
long duration = durationPerTest;
- long step = 20;
+ final long step = 20;
NEWTEvent event;
boolean shouldQuit = false;
@@ -204,9 +204,9 @@ public class TestParenting02AWT extends UITestCase {
duration -= step;
while( null != ( event = eventFifo.get() ) ) {
- Window source = (Window) event.getSource();
+ final Window source = (Window) event.getSource();
if(event instanceof KeyEvent) {
- KeyEvent keyEvent = (KeyEvent) event;
+ final KeyEvent keyEvent = (KeyEvent) event;
switch(keyEvent.getKeyChar()) {
case 'q':
shouldQuit = true;
@@ -237,10 +237,10 @@ public class TestParenting02AWT extends UITestCase {
} } );
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
- Window window = glWindow.getDelegatedWindow();
+ final Window window = glWindow.getDelegatedWindow();
if(debug) {
MiscUtils.setFieldIfExists(demo, "glDebug", true);
MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -250,15 +250,15 @@ public class TestParenting02AWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
verbose = true;
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
@@ -267,7 +267,7 @@ public class TestParenting02AWT extends UITestCase {
waitReparent = atoi(args[++i]);
}
}
- String tstname = TestParenting02AWT.class.getName();
+ final String tstname = TestParenting02AWT.class.getName();
org.junit.runner.JUnitCore.main(tstname);
/*
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java
index 9f56ecdbf..c9a96868f 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java
@@ -61,22 +61,22 @@ public class TestParenting02NEWT extends UITestCase {
height = 480;
}
- static Window createWindow(Screen screen, Capabilities caps) {
+ static Window createWindow(final Screen screen, final Capabilities caps) {
Assert.assertNotNull(caps);
- Window window = NewtFactory.createWindow(screen, caps) ;
+ final Window window = NewtFactory.createWindow(screen, caps) ;
Assert.assertNotNull(window);
return window;
}
- static Window createWindow(NativeWindow parent, Capabilities caps) {
+ static Window createWindow(final NativeWindow parent, final Capabilities caps) {
Assert.assertNotNull(caps);
- Window window = NewtFactory.createWindow(parent, caps);
+ final Window window = NewtFactory.createWindow(parent, caps);
window.setUndecorated(true);
Assert.assertNotNull(window);
return window;
}
- static void destroyWindow(Display display, Screen screen, Window window, GLWindow glWindow) {
+ static void destroyWindow(final Display display, final Screen screen, final Window window, final GLWindow glWindow) {
if(null!=glWindow) {
glWindow.destroy();
}
@@ -93,21 +93,21 @@ public class TestParenting02NEWT extends UITestCase {
@Test
public void test01NewtOnNewtParentChildDraw() throws InterruptedException {
- GLCapabilities caps = new GLCapabilities(null);
+ final GLCapabilities caps = new GLCapabilities(null);
Assert.assertNotNull(caps);
- Display display = NewtFactory.createDisplay(null); // local display
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
int x = 1;
int y = 1;
- NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+ final NEWTEventFiFo eventFifo = new NEWTEventFiFo();
- Window window1 = createWindow(screen, caps);
+ final Window window1 = createWindow(screen, caps);
Assert.assertNotNull(window1);
- GLWindow glWindow1 = GLWindow.create(window1);
+ final GLWindow glWindow1 = GLWindow.create(window1);
Assert.assertNotNull(glWindow1);
glWindow1.setSize(width, height);
Assert.assertEquals(width,glWindow1.getWidth());
@@ -117,7 +117,7 @@ public class TestParenting02NEWT extends UITestCase {
//glWindow1.addKeyListener(new TraceKeyAdapter(new KeyAction(eventFifo)));
//glWindow1.addWindowListener(new TraceWindowAdapter());
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, window1, glWindow1, false);
// glWindow1.addGLEventListener(demo1);
@@ -126,9 +126,9 @@ public class TestParenting02NEWT extends UITestCase {
Assert.assertNotNull(capsChosen);
Assert.assertTrue(capsChosen.isOnscreen()==true);
- Window window2 = createWindow(window1, caps);
+ final Window window2 = createWindow(window1, caps);
Assert.assertNotNull(window2);
- GLWindow glWindow2 = GLWindow.create(window2);
+ final GLWindow glWindow2 = GLWindow.create(window2);
Assert.assertNotNull(glWindow2);
glWindow2.setSize(width/2, height/2);
//Assert.assertEquals(width/2,glWindow2.getWidth());
@@ -139,7 +139,7 @@ public class TestParenting02NEWT extends UITestCase {
//glWindow2.addWindowListener(new TraceWindowAdapter(new WindowAction(eventFifo)));
// glWindow2.addMouseListener(new TraceMouseAdapter());
- GLEventListener demo2 = new GearsES2();
+ final GLEventListener demo2 = new GearsES2();
setDemoFields(demo2, window2, glWindow2, false);
// glWindow2.addGLEventListener(demo2);
@@ -153,7 +153,7 @@ public class TestParenting02NEWT extends UITestCase {
boolean shouldQuit = false;
long duration = durationPerTest;
- long step = 20;
+ final long step = 20;
NEWTEvent event;
while (duration>0 && !shouldQuit) {
@@ -167,11 +167,11 @@ public class TestParenting02NEWT extends UITestCase {
Thread.sleep(step);
while( null != ( event = eventFifo.get() ) ) {
- Window source = (Window) event.getSource();
+ final Window source = (Window) event.getSource();
if(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY == event.getEventType()) {
shouldQuit = true;
} else if(event instanceof KeyEvent) {
- KeyEvent keyEvent = (KeyEvent) event;
+ final KeyEvent keyEvent = (KeyEvent) event;
switch(keyEvent.getKeyChar()) {
case 'q':
shouldQuit = true;
@@ -187,7 +187,7 @@ public class TestParenting02NEWT extends UITestCase {
destroyWindow(display, screen, window1, glWindow1);
}
- public static void setDemoFields(GLEventListener demo, Window window, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final Window window, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(window);
if(debug) {
@@ -199,21 +199,21 @@ public class TestParenting02NEWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
- String tstname = TestParenting02NEWT.class.getName();
+ final String tstname = TestParenting02NEWT.class.getName();
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
"filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
index b7497196c..fde366dd2 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
@@ -78,18 +78,18 @@ public class TestParenting03AWT extends UITestCase {
testImpl(true);
}
- public void testImpl(boolean use2nd) throws InterruptedException, InvocationTargetException {
+ public void testImpl(final boolean use2nd) throws InterruptedException, InvocationTargetException {
final Frame frame1 = new Frame("AWT Parent Frame");
- GLWindow glWindow1 = GLWindow.create(glCaps);
+ final GLWindow glWindow1 = GLWindow.create(glCaps);
glWindow1.setUpdateFPSFrames(1, null);
final NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(glWindow1);
newtCanvasAWT1.setPreferredSize(glSize);
- GLEventListener demo1 = new GearsES2(1);
+ final GLEventListener demo1 = new GearsES2(1);
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
glWindow1.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT1, glWindow1, null));
- GLAnimatorControl animator1 = new Animator(glWindow1);
+ final GLAnimatorControl animator1 = new Animator(glWindow1);
animator1.start();
GLWindow glWindow2 = null;
@@ -101,7 +101,7 @@ public class TestParenting03AWT extends UITestCase {
newtCanvasAWT2 = new NewtCanvasAWT(glWindow2);
newtCanvasAWT2.setPreferredSize(glSize);
- GLEventListener demo2 = new GearsES2(1);
+ final GLEventListener demo2 = new GearsES2(1);
setDemoFields(demo2, glWindow2, false);
glWindow2.addGLEventListener(demo2);
glWindow2.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT2, glWindow2, null));
@@ -191,10 +191,10 @@ public class TestParenting03AWT extends UITestCase {
}
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
- Window window = glWindow.getDelegatedWindow();
+ final Window window = glWindow.getDelegatedWindow();
if(debug) {
MiscUtils.setFieldIfExists(demo, "glDebug", true);
MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -204,15 +204,15 @@ public class TestParenting03AWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
@@ -220,7 +220,7 @@ public class TestParenting03AWT extends UITestCase {
waitAdd2nd = atoi(args[++i]);
}
}
- String tstname = TestParenting03AWT.class.getName();
+ final String tstname = TestParenting03AWT.class.getName();
/*
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java
index 126aaaffa..3ff4ecdaa 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.parenting;
import java.awt.BorderLayout;
@@ -74,26 +74,26 @@ public class TestParenting04AWT extends UITestCase {
// Will produce some artifacts .. resizing etc
winHopFrame2Frame(false);
}
-
+
@Test
public void test02WinHopFrame2FrameDetachFirst() throws InterruptedException, InvocationTargetException {
- // Note: detaching first setNEWTChild(null) is much cleaner visually
+ // Note: detaching first setNEWTChild(null) is much cleaner visually
winHopFrame2Frame(true);
}
-
+
protected void winHopFrame2Frame(final boolean detachFirst) throws InterruptedException, InvocationTargetException {
final GLWindow glWindow1 = GLWindow.create(glCaps);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
- Animator anim1 = new Animator(glWindow1);
+ final Animator anim1 = new Animator(glWindow1);
final GLWindow glWindow2 = GLWindow.create(glCaps);
- GLEventListener demo2 = new GearsES2();
+ final GLEventListener demo2 = new GearsES2();
setDemoFields(demo2, glWindow2, false);
glWindow2.addGLEventListener(demo2);
- Animator anim2 = new Animator(glWindow2);
-
+ final Animator anim2 = new Animator(glWindow2);
+
final NewtCanvasAWT canvas1 = new NewtCanvasAWT(glWindow1);
final NewtCanvasAWT canvas2 = new NewtCanvasAWT(glWindow2);
@@ -119,7 +119,7 @@ public class TestParenting04AWT extends UITestCase {
}
});
Assert.assertEquals(canvas1.getNativeWindow(),glWindow1.getParent());
-
+
final Frame frame2 = new Frame("AWT Parent Frame");
frame2.setLayout(new BorderLayout());
frame2.add(new Button("North"), BorderLayout.NORTH);
@@ -145,7 +145,7 @@ public class TestParenting04AWT extends UITestCase {
anim1.start();
anim2.start();
-
+
int state;
for(state=0; state<3; state++) {
Thread.sleep(durationPerTest);
@@ -156,7 +156,7 @@ public class TestParenting04AWT extends UITestCase {
// 1 -> 2
if(detachFirst) {
canvas1.setNEWTChild(null);
- canvas2.setNEWTChild(null);
+ canvas2.setNEWTChild(null);
} else {
canvas2.setNEWTChild(null); // free g2 of w2
}
@@ -175,7 +175,7 @@ public class TestParenting04AWT extends UITestCase {
// 2 -> 1
if(detachFirst) {
canvas1.setNEWTChild(null);
- canvas2.setNEWTChild(null);
+ canvas2.setNEWTChild(null);
} else {
canvas2.setNEWTChild(null);
}
@@ -199,13 +199,13 @@ public class TestParenting04AWT extends UITestCase {
glWindow1.destroy();
glWindow2.destroy();
Assert.assertEquals(false, glWindow1.isNativeValid());
- Assert.assertEquals(false, glWindow2.isNativeValid());
+ Assert.assertEquals(false, glWindow2.isNativeValid());
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
- Window window = glWindow.getDelegatedWindow();
+ final Window window = glWindow.getDelegatedWindow();
if(debug) {
MiscUtils.setFieldIfExists(demo, "glDebug", true);
MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -215,21 +215,21 @@ public class TestParenting04AWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
- String tstname = TestParenting04AWT.class.getName();
+ final String tstname = TestParenting04AWT.class.getName();
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
"filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04SWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04SWT.java
index 586db8a2b..631d2309a 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04SWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04SWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.parenting;
import java.io.IOException;
@@ -74,7 +74,7 @@ public class TestParenting04SWT extends UITestCase {
Composite composite1 = null;
Composite composite2 = null;
com.jogamp.newt.Display swtNewtDisplay = null;
-
+
@BeforeClass
public static void initClass() {
width = 400;
@@ -85,17 +85,17 @@ public class TestParenting04SWT extends UITestCase {
@Before
public void init() {
SWTAccessor.invoke(true, new Runnable() {
- public void run() {
+ public void run() {
display = new Display();
Assert.assertNotNull( display );
-
+
shell1 = new Shell( display );
Assert.assertNotNull( shell1 );
shell1.setLayout( new FillLayout() );
composite1 = new Composite( shell1, SWT.NONE );
composite1.setLayout( new FillLayout() );
Assert.assertNotNull( composite1 );
-
+
shell2 = new Shell( display );
Assert.assertNotNull( shell2 );
shell2.setLayout( new FillLayout() );
@@ -105,7 +105,7 @@ public class TestParenting04SWT extends UITestCase {
}});
swtNewtDisplay = NewtFactory.createDisplay(null, false); // no-reuse
}
-
+
@After
public void release() {
Assert.assertNotNull( display );
@@ -123,7 +123,7 @@ public class TestParenting04SWT extends UITestCase {
display.dispose();
}});
}
- catch( Throwable throwable ) {
+ catch( final Throwable throwable ) {
throwable.printStackTrace();
Assume.assumeNoException( throwable );
}
@@ -134,37 +134,37 @@ public class TestParenting04SWT extends UITestCase {
composite1 = null;
composite2 = null;
}
-
+
@Test
public void test01WinHopFrame2FrameDirectHop() throws InterruptedException, InvocationTargetException {
// Will produce some artifacts .. resizing etc
winHopFrame2Frame(false);
}
-
+
@Test
public void test02WinHopFrame2FrameDetachFirst() throws InterruptedException, InvocationTargetException {
- // Note: detaching first setNEWTChild(null) is much cleaner visually
+ // Note: detaching first setNEWTChild(null) is much cleaner visually
winHopFrame2Frame(true);
}
-
+
protected void winHopFrame2Frame(final boolean detachFirst) throws InterruptedException, InvocationTargetException {
- com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, 0);
-
+ final com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, 0);
+
final GLWindow glWindow1 = GLWindow.create(screen, glCaps);
- GLEventListener demo1 = new RedSquareES2();
+ final GLEventListener demo1 = new RedSquareES2();
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
- Animator anim1 = new Animator(glWindow1);
-
+ final Animator anim1 = new Animator(glWindow1);
+
final GLWindow glWindow2 = GLWindow.create(screen, glCaps);
- GLEventListener demo2 = new GearsES2();
+ final GLEventListener demo2 = new GearsES2();
setDemoFields(demo2, glWindow2, false);
glWindow2.addGLEventListener(demo2);
- Animator anim2 = new Animator(glWindow2);
+ final Animator anim2 = new Animator(glWindow2);
final NewtCanvasSWT canvas1 = NewtCanvasSWT.create( composite1, 0, glWindow1 );
final NewtCanvasSWT canvas2 = NewtCanvasSWT.create( composite2, 0, glWindow2 );
-
+
SWTAccessor.invoke(true, new Runnable() {
public void run() {
shell1.setText( getSimpleTestName(".")+"-Win1" );
@@ -176,13 +176,13 @@ public class TestParenting04SWT extends UITestCase {
shell2.setLocation(width + 50, 0);
shell2.open();
}
- });
+ });
Assert.assertEquals(canvas1.getNativeWindow(),glWindow1.getParent());
Assert.assertEquals(canvas2.getNativeWindow(),glWindow2.getParent());
anim1.start();
anim2.start();
-
+
int state;
for(state=0; state<3; state++) {
for(int i=0; i*10<durationPerTest; i++) {
@@ -198,7 +198,7 @@ public class TestParenting04SWT extends UITestCase {
// 1 -> 2
if(detachFirst) {
canvas1.setNEWTChild(null);
- canvas2.setNEWTChild(null);
+ canvas2.setNEWTChild(null);
} else {
canvas2.setNEWTChild(null); // free g2 of w2
}
@@ -212,7 +212,7 @@ public class TestParenting04SWT extends UITestCase {
// 2 -> 1
if(detachFirst) {
canvas1.setNEWTChild(null);
- canvas2.setNEWTChild(null);
+ canvas2.setNEWTChild(null);
} else {
canvas2.setNEWTChild(null);
}
@@ -226,13 +226,13 @@ public class TestParenting04SWT extends UITestCase {
canvas1.dispose();
canvas2.dispose();
Assert.assertEquals(false, glWindow1.isNativeValid());
- Assert.assertEquals(false, glWindow2.isNativeValid());
+ Assert.assertEquals(false, glWindow2.isNativeValid());
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
- Window window = glWindow.getDelegatedWindow();
+ final Window window = glWindow.getDelegatedWindow();
if(debug) {
MiscUtils.setFieldIfExists(demo, "glDebug", true);
MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -242,21 +242,21 @@ public class TestParenting04SWT extends UITestCase {
}
}
- static int atoi(String a) {
+ static int atoi(final String a) {
int i=0;
try {
i = Integer.parseInt(a);
- } catch (Exception ex) { ex.printStackTrace(); }
+ } catch (final Exception ex) { ex.printStackTrace(); }
return i;
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = atoi(args[++i]);
}
}
- String tstname = TestParenting04SWT.class.getName();
+ final String tstname = TestParenting04SWT.class.getName();
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
"filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentChildWindowBug632NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentChildWindowBug632NEWT.java
index b2286a8b7..c9390f124 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentChildWindowBug632NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentChildWindowBug632NEWT.java
@@ -31,44 +31,44 @@ public class TestTranslucentChildWindowBug632NEWT extends UITestCase {
glp = GLProfile.getDefault();
opaque = false;
}
-
- static GLWindow createParentWindow(GLCapabilitiesImmutable caps, int width, int height)
+
+ static GLWindow createParentWindow(final GLCapabilitiesImmutable caps, final int width, final int height)
throws InterruptedException
{
Assert.assertNotNull(caps);
//
// Create native windowing resources .. X11/Win/OSX
- //
+ //
GLWindow glWindow;
glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
-
+
glWindow.setTitle("NEWT Parenting Window Test");
-
+
glWindow.addGLEventListener(new GearsES2(1));
glWindow.setSize(width, height);
glWindow.setVisible(true);
Assert.assertEquals(true,glWindow.isVisible());
Assert.assertEquals(true,glWindow.isNativeValid());
-
+
return glWindow;
}
-
- static GLWindow createNestedWindow(NativeWindow nativeParentWindow, GLCapabilitiesImmutable caps, int x, int y, int width, int height)
+
+ static GLWindow createNestedWindow(final NativeWindow nativeParentWindow, final GLCapabilitiesImmutable caps, final int x, final int y, final int width, final int height)
throws InterruptedException {
-
+
Assert.assertNotNull(nativeParentWindow);
Assert.assertNotNull(caps);
//
// Create native windowing resources .. X11/Win/OSX
- //
+ //
GLWindow glWindow;
glWindow = GLWindow.create(nativeParentWindow, caps);
Assert.assertNotNull(glWindow);
-
+
glWindow.setTitle("NEWT Parenting Window Test");
-
+
glWindow.addGLEventListener(new GearsES2(1));
glWindow.setPosition(x, y);
@@ -76,60 +76,60 @@ public class TestTranslucentChildWindowBug632NEWT extends UITestCase {
glWindow.setVisible(true);
Assert.assertEquals(true,glWindow.isVisible());
Assert.assertEquals(true,glWindow.isNativeValid());
-
+
return glWindow;
}
-
- static void destroyWindow(GLWindow glWindow) {
+
+ static void destroyWindow(final GLWindow glWindow) {
if(null!=glWindow) {
glWindow.destroy();
Assert.assertEquals(false,glWindow.isNativeValid());
}
}
-
+
@Test
public void testWindow00() throws InterruptedException {
final Animator animator = new Animator();
- GLCapabilities caps = new GLCapabilities(glp);
+ final GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
caps.setBackgroundOpaque(opaque);
- GLWindow window1 = createParentWindow(caps, 400, 400);
+ final GLWindow window1 = createParentWindow(caps, 400, 400);
Assert.assertEquals(true,window1.isNativeValid());
Assert.assertEquals(true,window1.isVisible());
animator.add(window1);
-
- GLWindow window2 = createNestedWindow(window1, caps, 400-300, 400-300, 300, 300);
+
+ final GLWindow window2 = createNestedWindow(window1, caps, 400-300, 400-300, 300, 300);
Assert.assertEquals(true,window2.isNativeValid());
Assert.assertEquals(true,window2.isVisible());
animator.add(window2);
-
+
animator.start();
-
- AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
+
+ final AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
Thread.sleep(durationPerTest/2);
-
+
window1.setSize(512, 512);
window2.setPosition(512-300, 512-300);
-
+
Thread.sleep(durationPerTest/2);
-
+
animator.stop();
-
+
destroyWindow(window2);
destroyWindow(window1);
}
-
- public static void main(String[] args) throws IOException {
+
+ public static void main(final String[] args) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
}
}
- String testName = TestTranslucentChildWindowBug632NEWT.class.getName();
+ final String testName = TestTranslucentChildWindowBug632NEWT.class.getName();
org.junit.runner.JUnitCore.main(testName);
- }
+ }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java
index f273f7672..3eb0c1325 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.newt.parenting;
import java.awt.BorderLayout;
@@ -82,23 +82,23 @@ public class TestTranslucentParentingAWT extends UITestCase {
static Frame getTranslucentFrame() {
GraphicsConfiguration gc=null;
- GraphicsDevice[] devices= GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
+ final GraphicsDevice[] devices= GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
for (int i = 0; i < devices.length ; i++)
{
- GraphicsConfiguration[] configs = devices[i].getConfigurations();
+ final GraphicsConfiguration[] configs = devices[i].getConfigurations();
for (int j = 0; j < configs.length ; j++) {
- GraphicsConfiguration config = configs[j];
- ColorModel tcm = config.getColorModel(Transparency.TRANSLUCENT);
- boolean capable1 = ( null != tcm ) ? tcm.getTransparency() == Transparency.TRANSLUCENT : false;
+ final GraphicsConfiguration config = configs[j];
+ final ColorModel tcm = config.getColorModel(Transparency.TRANSLUCENT);
+ final boolean capable1 = ( null != tcm ) ? tcm.getTransparency() == Transparency.TRANSLUCENT : false;
boolean capable2 = false;
try {
capable2 = ((Boolean)ReflectionUtil.callStaticMethod(
- "com.sun.awt.AWTUtilities", "isTranslucencyCapable",
- new Class<?>[] { GraphicsConfiguration.class },
- new Object[] { config } ,
+ "com.sun.awt.AWTUtilities", "isTranslucencyCapable",
+ new Class<?>[] { GraphicsConfiguration.class },
+ new Object[] { config } ,
GraphicsConfiguration.class.getClassLoader())).booleanValue();
System.err.println("com.sun.awt.AWTUtilities.isTranslucencyCapable(config) passed: "+capable2);
- } catch (RuntimeException re) {
+ } catch (final RuntimeException re) {
System.err.println("com.sun.awt.AWTUtilities.isTranslucencyCapable(config) failed: "+re.getMessage());
}
System.err.println(i+":"+j+" "+config+", "+tcm+", capable "+capable1+"/"+capable2);
@@ -117,7 +117,7 @@ public class TestTranslucentParentingAWT extends UITestCase {
frame.setTitle("AWT Parent Frame (opaque: "+(null==gc)+")");
return frame;
}
-
+
public void testWindowParenting1AWTOneNewtChild() throws InterruptedException, InvocationTargetException {
final Frame frame1 = getTranslucentFrame();
final GLWindow glWindow1 = GLWindow.create(glCaps);
@@ -126,13 +126,13 @@ public class TestTranslucentParentingAWT extends UITestCase {
final NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(frame1.getGraphicsConfiguration(), glWindow1);
newtCanvasAWT1.setPreferredSize(size);
- GLEventListener demo1 = new GearsES2(1);
+ final GLEventListener demo1 = new GearsES2(1);
setDemoFields(demo1, glWindow1, false);
glWindow1.addGLEventListener(demo1);
- GLAnimatorControl animator1 = new Animator(glWindow1);
+ final GLAnimatorControl animator1 = new Animator(glWindow1);
animator1.start();
- Container cont1 = new Container();
+ final Container cont1 = new Container();
cont1.setLayout(new BorderLayout());
cont1.add(newtCanvasAWT1, BorderLayout.CENTER);
cont1.setVisible(true);
@@ -167,10 +167,10 @@ public class TestTranslucentParentingAWT extends UITestCase {
glWindow1.destroy();
}
- public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+ public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
Assert.assertNotNull(demo);
Assert.assertNotNull(glWindow);
- Window window = glWindow.getDelegatedWindow();
+ final Window window = glWindow.getDelegatedWindow();
if(debug) {
MiscUtils.setFieldIfExists(demo, "glDebug", true);
MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -180,7 +180,7 @@ public class TestTranslucentParentingAWT extends UITestCase {
}
}
- public static void main(String args[]) throws IOException {
+ public static void main(final String args[]) throws IOException {
for(int i=0; i<args.length; i++) {
if(args[i].equals("-time")) {
durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
@@ -188,7 +188,7 @@ public class TestTranslucentParentingAWT extends UITestCase {
waitAdd2nd = MiscUtils.atol(args[++i], waitAdd2nd);
}
}
- String tstname = TestTranslucentParentingAWT.class.getName();
+ final String tstname = TestTranslucentParentingAWT.class.getName();
/*
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
tstname,
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/WindowAction.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/WindowAction.java
index 05793b96e..b960103d9 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/WindowAction.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/WindowAction.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -33,14 +33,14 @@ import com.jogamp.newt.event.*;
class WindowAction extends WindowAdapter {
NEWTEventFiFo eventFifo;
- public WindowAction(NEWTEventFiFo eventFifo) {
- this.eventFifo = eventFifo;
+ public WindowAction(final NEWTEventFiFo eventFifo) {
+ this.eventFifo = eventFifo;
}
- public void windowDestroyNotify(WindowEvent e) {
+ public void windowDestroyNotify(final WindowEvent e) {
eventFifo.put(e);
}
- public void windowDestroyed(WindowEvent e) {
+ public void windowDestroyed(final WindowEvent e) {
eventFifo.put(e);
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTFocusAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/AWTFocusAdapter.java
index 32ff6022c..d574186cf 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTFocusAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTFocusAdapter.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.util;
import java.awt.event.FocusEvent;
@@ -38,21 +38,21 @@ public class AWTFocusAdapter implements FocusEventCountAdapter, FocusListener {
boolean wasTemporary;
boolean verbose = true;
- public AWTFocusAdapter(String prefix) {
+ public AWTFocusAdapter(final String prefix) {
this.prefix = prefix;
reset();
}
- public void setVerbose(boolean v) { verbose = false; }
+ public void setVerbose(final boolean v) { verbose = false; }
public boolean focusLost() {
- return focusCount<0;
+ return focusCount<0;
}
-
+
public boolean focusGained() {
return focusCount>0;
}
-
+
public void reset() {
focusCount = 0;
wasTemporary = false;
@@ -64,7 +64,7 @@ public class AWTFocusAdapter implements FocusEventCountAdapter, FocusListener {
}
/* @Override */
- public void focusGained(FocusEvent e) {
+ public void focusGained(final FocusEvent e) {
if(focusCount<0) { focusCount=0; }
focusCount++;
wasTemporary = e.isTemporary();
@@ -74,7 +74,7 @@ public class AWTFocusAdapter implements FocusEventCountAdapter, FocusListener {
}
/* @Override */
- public void focusLost(FocusEvent e) {
+ public void focusLost(final FocusEvent e) {
if(focusCount>0) { focusCount=0; }
focusCount--;
wasTemporary = e.isTemporary();
@@ -82,6 +82,6 @@ public class AWTFocusAdapter implements FocusEventCountAdapter, FocusListener {
System.err.println("FOCUS AWT LOST "+(wasTemporary?"TEMP":"PERM")+" [fc "+focusCount+"]: "+prefix+", "+e);
}
}
-
- public String toString() { return prefix+"[focusCount "+focusCount +", temp "+wasTemporary+"]"; }
+
+ public String toString() { return prefix+"[focusCount "+focusCount +", temp "+wasTemporary+"]"; }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTKeyAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/AWTKeyAdapter.java
index 9461af5c0..84c19612b 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTKeyAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTKeyAdapter.java
@@ -42,12 +42,12 @@ public class AWTKeyAdapter extends java.awt.event.KeyAdapter implements KeyEvent
List<EventObject> queue = new ArrayList<EventObject>();
boolean verbose = true;
- public AWTKeyAdapter(String prefix) {
+ public AWTKeyAdapter(final String prefix) {
this.prefix = prefix;
reset();
}
- public synchronized void setVerbose(boolean v) { verbose = v; }
+ public synchronized void setVerbose(final boolean v) { verbose = v; }
public synchronized boolean isPressed() {
return pressed;
@@ -61,11 +61,11 @@ public class AWTKeyAdapter extends java.awt.event.KeyAdapter implements KeyEvent
return consumed;
}
- public synchronized int getKeyPressedCount(boolean autoRepeatOnly) {
+ public synchronized int getKeyPressedCount(final boolean autoRepeatOnly) {
return keyPressed;
}
- public synchronized int getKeyReleasedCount(boolean autoRepeatOnly) {
+ public synchronized int getKeyReleasedCount(final boolean autoRepeatOnly) {
return keyReleased;
}
@@ -85,7 +85,7 @@ public class AWTKeyAdapter extends java.awt.event.KeyAdapter implements KeyEvent
queue.clear();
}
- public synchronized void keyPressed(KeyEvent e) {
+ public synchronized void keyPressed(final KeyEvent e) {
pressed = true;
keyPressed++;
queue.add(e);
@@ -94,7 +94,7 @@ public class AWTKeyAdapter extends java.awt.event.KeyAdapter implements KeyEvent
}
}
- public synchronized void keyReleased(KeyEvent e) {
+ public synchronized void keyReleased(final KeyEvent e) {
pressed = false;
keyReleased++;
if(e.isConsumed()) {
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java
index c1bec79f5..2a4f7a71f 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java
@@ -41,12 +41,12 @@ public class AWTMouseAdapter extends java.awt.event.MouseAdapter implements Inpu
List<EventObject> queue = new ArrayList<EventObject>();
boolean verbose = true;
- public AWTMouseAdapter(String prefix) {
+ public AWTMouseAdapter(final String prefix) {
this.prefix = prefix;
reset();
}
- public synchronized void setVerbose(boolean v) { verbose = v; }
+ public synchronized void setVerbose(final boolean v) { verbose = v; }
public synchronized boolean isPressed() {
return pressed;
@@ -75,7 +75,7 @@ public class AWTMouseAdapter extends java.awt.event.MouseAdapter implements Inpu
queue.clear();
}
- public synchronized void mousePressed(MouseEvent e) {
+ public synchronized void mousePressed(final MouseEvent e) {
pressed = true;
queue.add(e);
if( verbose ) {
@@ -83,7 +83,7 @@ public class AWTMouseAdapter extends java.awt.event.MouseAdapter implements Inpu
}
}
- public synchronized void mouseReleased(MouseEvent e) {
+ public synchronized void mouseReleased(final MouseEvent e) {
pressed = false;
queue.add(e);
if( verbose ) {
@@ -91,7 +91,7 @@ public class AWTMouseAdapter extends java.awt.event.MouseAdapter implements Inpu
}
}
- public synchronized void mouseClicked(java.awt.event.MouseEvent e) {
+ public synchronized void mouseClicked(final java.awt.event.MouseEvent e) {
mouseClicked+=e.getClickCount();
if(e.isConsumed()) {
consumed++;
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
index aa9611c6f..318ba17f1 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
@@ -61,7 +61,7 @@ public class AWTRobotUtil {
static class OurUncaughtExceptionHandler implements UncaughtExceptionHandler {
@Override
- public void uncaughtException(Thread t, Throwable e) {
+ public void uncaughtException(final Thread t, final Throwable e) {
System.err.println("*** AWTRobotUtil: UncaughtException (this Thread "+Thread.currentThread().getName()+") : Thread <"+t.getName()+">, "+e.getClass().getName()+": "+e.getMessage());
e.printStackTrace();
}
@@ -83,7 +83,7 @@ public class AWTRobotUtil {
for (int wait=0; wait<POLL_DIVIDER && !awtEDTAliveFlag; wait++) {
try {
Thread.sleep(TIME_SLICE);
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
e.printStackTrace();
}
}
@@ -102,7 +102,7 @@ public class AWTRobotUtil {
}
/** Issuing {@link #validateAWTEDTIsAlive()} before calling {@link Robot#waitForIdle()}. */
- public static void waitForIdle(Robot robot) {
+ public static void waitForIdle(final Robot robot) {
validateAWTEDTIsAlive();
robot.waitForIdle();
}
@@ -121,7 +121,7 @@ public class AWTRobotUtil {
System.err.println("******** clearAWTFocus.X");
}
- public static int[] getCenterLocation(Object obj, boolean onTitleBarIfWindow)
+ public static int[] getCenterLocation(final Object obj, final boolean onTitleBarIfWindow)
throws InterruptedException, InvocationTargetException {
if(obj instanceof com.jogamp.newt.Window) {
return getCenterLocationNEWT((com.jogamp.newt.Window)obj, onTitleBarIfWindow);
@@ -131,26 +131,26 @@ public class AWTRobotUtil {
throw new RuntimeException("Neither AWT nor NEWT: "+obj);
}
}
- private static int[] getCenterLocationNEWT(com.jogamp.newt.Window win, boolean onTitleBarIfWindow)
+ private static int[] getCenterLocationNEWT(final com.jogamp.newt.Window win, final boolean onTitleBarIfWindow)
throws InterruptedException, InvocationTargetException {
- javax.media.nativewindow.util.Point p0 = win.getLocationOnScreen(null);
+ final javax.media.nativewindow.util.Point p0 = win.getLocationOnScreen(null);
if( onTitleBarIfWindow ) {
- javax.media.nativewindow.util.InsetsImmutable insets = win.getInsets();
+ final javax.media.nativewindow.util.InsetsImmutable insets = win.getInsets();
p0.translate(win.getWidth()/2, insets.getTopHeight()/2);
} else {
p0.translate(win.getWidth()/2, win.getHeight()/2);
}
return new int[] { p0.getX(), p0.getY() };
}
- private static int[] getCenterLocationAWT(java.awt.Component comp, boolean onTitleBarIfWindow)
+ private static int[] getCenterLocationAWT(final java.awt.Component comp, final boolean onTitleBarIfWindow)
throws InterruptedException, InvocationTargetException {
int x0, y0;
- java.awt.Point p0 = comp.getLocationOnScreen();
- java.awt.Rectangle r0 = comp.getBounds();
+ final java.awt.Point p0 = comp.getLocationOnScreen();
+ final java.awt.Rectangle r0 = comp.getBounds();
if( onTitleBarIfWindow && comp instanceof java.awt.Window) {
- java.awt.Window window = (java.awt.Window) comp;
- java.awt.Insets insets = window.getInsets();
+ final java.awt.Window window = (java.awt.Window) comp;
+ final java.awt.Insets insets = window.getInsets();
y0 = (int) ( p0.getY() + insets.top / 2.0 + .5 ) ;
} else {
y0 = (int) ( p0.getY() + r0.getHeight() / 2.0 + .5 ) ;
@@ -159,7 +159,7 @@ public class AWTRobotUtil {
return new int[] { x0, y0 };
}
- public static int[] getClientLocation(Object obj, int x, int y)
+ public static int[] getClientLocation(final Object obj, final int x, final int y)
throws InterruptedException, InvocationTargetException {
if(obj instanceof com.jogamp.newt.Window) {
return getClientLocationNEWT((com.jogamp.newt.Window)obj, x, y);
@@ -169,18 +169,18 @@ public class AWTRobotUtil {
throw new RuntimeException("Neither AWT nor NEWT: "+obj);
}
}
- private static int[] getClientLocationNEWT(com.jogamp.newt.Window win, int x, int y)
+ private static int[] getClientLocationNEWT(final com.jogamp.newt.Window win, final int x, final int y)
throws InterruptedException, InvocationTargetException {
- javax.media.nativewindow.util.Point p0 = win.getLocationOnScreen(null);
+ final javax.media.nativewindow.util.Point p0 = win.getLocationOnScreen(null);
return new int[] { p0.getX(), p0.getY() };
}
- private static int[] getClientLocationAWT(java.awt.Component comp, int x, int y)
+ private static int[] getClientLocationAWT(final java.awt.Component comp, final int x, final int y)
throws InterruptedException, InvocationTargetException {
- java.awt.Point p0 = comp.getLocationOnScreen();
+ final java.awt.Point p0 = comp.getLocationOnScreen();
return new int[] { (int)p0.getX(), (int)p0.getY() };
}
- public static void awtRobotMouseMove(Robot robot, int x, int y) {
+ public static void awtRobotMouseMove(final Robot robot, final int x, final int y) {
robot.mouseMove( x, y );
robot.delay(ROBOT_DELAY);
}
@@ -196,14 +196,14 @@ public class AWTRobotUtil {
throws AWTException, InterruptedException, InvocationTargetException {
// just for event tracing ..
- AWTWindowFocusAdapter winFA = new AWTWindowFocusAdapter("window");
+ final AWTWindowFocusAdapter winFA = new AWTWindowFocusAdapter("window");
window.addWindowFocusListener(winFA);
if(null == robot) {
robot = new Robot();
robot.setAutoWaitForIdle(true);
}
- int[] p0 = getCenterLocation(window, false);
+ final int[] p0 = getCenterLocation(window, false);
System.err.println("toFront: robot pos: "+p0[0]+"/"+p0[1]);
awtRobotMouseMove(robot, p0[0], p0[1] );
@@ -237,7 +237,7 @@ public class AWTRobotUtil {
* centerMouse
* @param onTitleBarIfWindow TODO
*/
- public static void centerMouse(Robot robot, Object obj, boolean onTitleBarIfWindow)
+ public static void centerMouse(Robot robot, final Object obj, final boolean onTitleBarIfWindow)
throws AWTException, InterruptedException, InvocationTargetException {
if(null == robot) {
@@ -245,12 +245,12 @@ public class AWTRobotUtil {
robot.setAutoWaitForIdle(true);
}
- int[] p0 = getCenterLocation(obj, onTitleBarIfWindow);
+ final int[] p0 = getCenterLocation(obj, onTitleBarIfWindow);
System.err.println("centerMouse: robot pos: "+p0[0]+"x"+p0[1]+", onTitleBarIfWindow: "+onTitleBarIfWindow);
awtRobotMouseMove(robot, p0[0], p0[1] );
}
- public static void setMouseToClientLocation(Robot robot, Object obj, int x, int y)
+ public static void setMouseToClientLocation(Robot robot, final Object obj, final int x, final int y)
throws AWTException, InterruptedException, InvocationTargetException {
if(null == robot) {
@@ -258,11 +258,11 @@ public class AWTRobotUtil {
robot.setAutoWaitForIdle(true);
}
- int[] p0 = getClientLocation(obj, x, y);
+ final int[] p0 = getClientLocation(obj, x, y);
awtRobotMouseMove(robot, p0[0], p0[1] );
}
- public static int getClickTimeout(Object obj) {
+ public static int getClickTimeout(final Object obj) {
if(obj instanceof com.jogamp.newt.Window) {
return com.jogamp.newt.event.MouseEvent.getClickTimeout();
} else if(NativeWindowFactory.isAWTAvailable() && obj instanceof java.awt.Component) {
@@ -283,7 +283,7 @@ public class AWTRobotUtil {
* requestFocus, if robot is valid, use mouse operation,
* otherwise programmatic, ie call requestFocus
*/
- public static void requestFocus(Robot robot, Object obj)
+ public static void requestFocus(final Robot robot, final Object obj)
throws AWTException, InterruptedException, InvocationTargetException {
requestFocus(robot, obj, true);
}
@@ -292,7 +292,7 @@ public class AWTRobotUtil {
* requestFocus, if robot is valid, use mouse operation,
* otherwise programmatic, ie call requestFocus
*/
- public static void requestFocus(Robot robot, Object obj, boolean onTitleBarIfWindow)
+ public static void requestFocus(final Robot robot, final Object obj, final boolean onTitleBarIfWindow)
throws AWTException, InterruptedException, InvocationTargetException {
if(null != robot) {
final int mouseButton = java.awt.event.InputEvent.BUTTON1_MASK;
@@ -314,12 +314,12 @@ public class AWTRobotUtil {
}
}
}
- private static void requestFocusNEWT(com.jogamp.newt.Window win, boolean onTitleBarIfWindow)
+ private static void requestFocusNEWT(final com.jogamp.newt.Window win, final boolean onTitleBarIfWindow)
throws AWTException, InterruptedException, InvocationTargetException {
win.requestFocus();
System.err.println("requestFocus: NEWT Component");
}
- private static void requestFocusAWT(final java.awt.Component comp, boolean onTitleBarIfWindow)
+ private static void requestFocusAWT(final java.awt.Component comp, final boolean onTitleBarIfWindow)
throws AWTException, InterruptedException, InvocationTargetException {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
@@ -328,7 +328,7 @@ public class AWTRobotUtil {
}});
}
- public static void requestFocus(Robot robot, Object obj, int x, int y)
+ public static void requestFocus(final Robot robot, final Object obj, final int x, final int y)
throws AWTException, InterruptedException, InvocationTargetException {
validateAWTEDTIsAlive();
@@ -338,7 +338,7 @@ public class AWTRobotUtil {
if( idling ) {
robot.waitForIdle();
} else {
- try { Thread.sleep(50); } catch (InterruptedException e) { }
+ try { Thread.sleep(50); } catch (final InterruptedException e) { }
}
robot.mousePress(mouseButton);
robot.mouseRelease(mouseButton);
@@ -346,7 +346,7 @@ public class AWTRobotUtil {
robot.delay( d );
}
- public static boolean hasFocus(Object obj) {
+ public static boolean hasFocus(final Object obj) {
if(obj instanceof com.jogamp.newt.Window) {
return ((com.jogamp.newt.Window) obj).hasFocus();
} else if(NativeWindowFactory.isAWTAvailable() && obj instanceof java.awt.Component) {
@@ -362,7 +362,7 @@ public class AWTRobotUtil {
*
* @return True if the Window became the global focused Window within TIME_OUT
*/
- public static boolean waitForFocus(Object obj) throws InterruptedException {
+ public static boolean waitForFocus(final Object obj) throws InterruptedException {
int wait;
if(obj instanceof com.jogamp.newt.Window) {
final com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
@@ -385,8 +385,8 @@ public class AWTRobotUtil {
*
* @return True if the Window became the global focused Window within TIME_OUT
*/
- public static boolean waitForFocus(FocusEventCountAdapter gain,
- FocusEventCountAdapter lost) throws InterruptedException {
+ public static boolean waitForFocus(final FocusEventCountAdapter gain,
+ final FocusEventCountAdapter lost) throws InterruptedException {
int wait;
for (wait=0; wait<POLL_DIVIDER; wait++) {
if( ( null == lost || lost.focusLost() ) && ( null == gain || gain.focusGained() ) ) {
@@ -401,16 +401,16 @@ public class AWTRobotUtil {
*
* @return True if the Window became the global focused Window within TIME_OUT
*/
- public static boolean waitForFocus(Object obj, FocusEventCountAdapter gain,
- FocusEventCountAdapter lost) throws InterruptedException {
+ public static boolean waitForFocus(final Object obj, final FocusEventCountAdapter gain,
+ final FocusEventCountAdapter lost) throws InterruptedException {
if(!waitForFocus(obj)) {
return false;
}
return waitForFocus(gain, lost);
}
- public static void assertRequestFocusAndWait(Robot robot, Object requestFocus, Object waitForFocus,
- FocusEventCountAdapter gain, FocusEventCountAdapter lost)
+ public static void assertRequestFocusAndWait(final Robot robot, final Object requestFocus, final Object waitForFocus,
+ final FocusEventCountAdapter gain, final FocusEventCountAdapter lost)
throws AWTException, InterruptedException, InvocationTargetException {
int i = 0;
@@ -455,8 +455,8 @@ public class AWTRobotUtil {
robot.delay(msDelay);
}
- public static int keyType(int i, Robot robot, int keyCode,
- Object obj, KeyEventCountAdapter counter) throws InterruptedException, AWTException, InvocationTargetException
+ public static int keyType(final int i, final Robot robot, final int keyCode,
+ final Object obj, final KeyEventCountAdapter counter) throws InterruptedException, AWTException, InvocationTargetException
{
int tc = 0;
int j;
@@ -489,7 +489,7 @@ public class AWTRobotUtil {
}
/** No validation is performed .. */
- public static int keyPress(int i, Robot robot, boolean press, int keyCode, int msDelay) {
+ public static int keyPress(final int i, final Robot robot, final boolean press, final int keyCode, final int msDelay) {
final long t0 = System.currentTimeMillis();
if(press) {
awtRobotKeyPress(robot, keyCode, msDelay);
@@ -501,7 +501,7 @@ public class AWTRobotUtil {
}
/** No validation is performed .. */
- public static int newtKeyPress(int i, Robot robot, boolean press, short newtKeyCode, int msDelay) {
+ public static int newtKeyPress(final int i, final Robot robot, final boolean press, final short newtKeyCode, final int msDelay) {
final int keyCode = AWTNewtEventFactory.newtKeyCode2AWTKeyCode(newtKeyCode);
final long t0 = System.currentTimeMillis();
if(press) {
@@ -517,8 +517,8 @@ public class AWTRobotUtil {
* @param keyCode TODO
* @param counter shall return the number of keys typed (press + release)
*/
- public static void assertKeyType(Robot robot, int keyCode, int typeCount,
- Object obj, KeyEventCountAdapter counter)
+ public static void assertKeyType(Robot robot, final int keyCode, final int typeCount,
+ final Object obj, final KeyEventCountAdapter counter)
throws AWTException, InterruptedException, InvocationTargetException {
if(null == robot) {
@@ -549,8 +549,8 @@ public class AWTRobotUtil {
* @param keyCode TODO
* @param counter shall return the number of keys typed (press + release)
*/
- public static void assertKeyPress(Robot robot, int keyCode, int typeCount,
- Object obj, KeyEventCountAdapter counter)
+ public static void assertKeyPress(Robot robot, final int keyCode, final int typeCount,
+ final Object obj, final KeyEventCountAdapter counter)
throws AWTException, InterruptedException, InvocationTargetException {
if(null == robot) {
@@ -577,8 +577,8 @@ public class AWTRobotUtil {
Assert.assertEquals("Wrong key count", typeCount, counter.getCount()-c0);
}
- static int mouseClick(int i, Robot robot, int mouseButton,
- Object obj, InputEventCountAdapter counter) throws InterruptedException, AWTException, InvocationTargetException
+ static int mouseClick(final int i, final Robot robot, final int mouseButton,
+ final Object obj, final InputEventCountAdapter counter) throws InterruptedException, AWTException, InvocationTargetException
{
int j;
int tc = 0;
@@ -611,8 +611,8 @@ public class AWTRobotUtil {
* @param mouseButton ie InputEvent.BUTTON1_MASK
* @param clickCount ie 1, or 2
*/
- public static void assertMouseClick(Robot robot, int mouseButton, int clickCount,
- Object obj, InputEventCountAdapter counter)
+ public static void assertMouseClick(Robot robot, final int mouseButton, final int clickCount,
+ final Object obj, final InputEventCountAdapter counter)
throws AWTException, InterruptedException, InvocationTargetException {
if(null == robot) {
@@ -647,15 +647,15 @@ public class AWTRobotUtil {
*
* @return True if the Component becomes <code>visible</code> within TIME_OUT
*/
- public static boolean waitForVisible(Object obj, boolean visible) throws InterruptedException {
+ public static boolean waitForVisible(final Object obj, final boolean visible) throws InterruptedException {
int wait;
if(obj instanceof com.jogamp.newt.Window) {
- com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
+ final com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
for (wait=0; wait<POLL_DIVIDER && visible != win.isVisible(); wait++) {
Thread.sleep(TIME_SLICE);
}
} else if(NativeWindowFactory.isAWTAvailable() && obj instanceof java.awt.Component) {
- java.awt.Component comp = (java.awt.Component) obj;
+ final java.awt.Component comp = (java.awt.Component) obj;
for (wait=0; wait<POLL_DIVIDER && visible != comp.isShowing(); wait++) {
Thread.sleep(TIME_SLICE);
}
@@ -669,7 +669,7 @@ public class AWTRobotUtil {
*
* @return True if the GLDrawable receives the expected size within TIME_OUT
*/
- public static boolean waitForSize(GLDrawable drawable, int width, int height) throws InterruptedException {
+ public static boolean waitForSize(final GLDrawable drawable, final int width, final int height) throws InterruptedException {
int wait;
for (wait=0; wait<POLL_DIVIDER && ( width != drawable.getSurfaceWidth() || height != drawable.getSurfaceHeight() ) ; wait++) {
Thread.sleep(TIME_SLICE);
@@ -683,7 +683,7 @@ public class AWTRobotUtil {
* @return True if the Component becomes realized (not displayable, native invalid) within TIME_OUT
* @throws InterruptedException
*/
- public static boolean waitForRealized(Object obj, boolean realized) throws InterruptedException {
+ public static boolean waitForRealized(final Object obj, final boolean realized) throws InterruptedException {
return waitForRealized(obj, null, realized);
}
@@ -694,11 +694,11 @@ public class AWTRobotUtil {
* @return True if the Component becomes realized (not displayable, native invalid) within TIME_OUT
* @throws InterruptedException
*/
- public static boolean waitForRealized(Object obj, Runnable waitAction, boolean realized) throws InterruptedException {
+ public static boolean waitForRealized(final Object obj, final Runnable waitAction, final boolean realized) throws InterruptedException {
long t0 = System.currentTimeMillis();
long t1 = t0;
if(obj instanceof com.jogamp.newt.Screen) {
- com.jogamp.newt.Screen screen = (com.jogamp.newt.Screen) obj;
+ final com.jogamp.newt.Screen screen = (com.jogamp.newt.Screen) obj;
while( (t1-t0) < TIME_OUT && realized != screen.isNativeValid() ) {
if( null != waitAction ) {
waitAction.run();
@@ -708,7 +708,7 @@ public class AWTRobotUtil {
t1 = System.currentTimeMillis();
}
} else if(obj instanceof com.jogamp.newt.Window) {
- com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
+ final com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
while( (t1-t0) < TIME_OUT && realized != win.isNativeValid() ) {
if( null != waitAction ) {
waitAction.run();
@@ -718,7 +718,7 @@ public class AWTRobotUtil {
t1 = System.currentTimeMillis();
}
} else if (NativeWindowFactory.isAWTAvailable() && obj instanceof java.awt.Component) {
- java.awt.Component comp = (java.awt.Component) obj;
+ final java.awt.Component comp = (java.awt.Component) obj;
while( (t1-t0) < TIME_OUT && realized != comp.isShowing() ) {
if( null != waitAction ) {
waitAction.run();
@@ -729,7 +729,7 @@ public class AWTRobotUtil {
}
// if GLCanvas, ensure it got also painted -> drawable.setRealized(true);
if( (t1-t0) < TIME_OUT && comp instanceof GLAutoDrawable) {
- GLAutoDrawable glad = (GLAutoDrawable) comp;
+ final GLAutoDrawable glad = (GLAutoDrawable) comp;
t0 = System.currentTimeMillis();
while( (t1-t0) < TIME_OUT && realized != glad.isRealized() ) {
if( null != waitAction ) {
@@ -756,7 +756,7 @@ public class AWTRobotUtil {
}
}
} else if(obj instanceof GLAutoDrawable) {
- GLAutoDrawable glad = (GLAutoDrawable) obj;
+ final GLAutoDrawable glad = (GLAutoDrawable) obj;
while( (t1-t0) < TIME_OUT && realized != glad.isRealized() ) {
if( null != waitAction ) {
waitAction.run();
@@ -775,7 +775,7 @@ public class AWTRobotUtil {
*
* @return True if the GLContext becomes created or not within TIME_OUT
*/
- public static boolean waitForContextCreated(GLAutoDrawable autoDrawable, boolean created) throws InterruptedException {
+ public static boolean waitForContextCreated(final GLAutoDrawable autoDrawable, final boolean created) throws InterruptedException {
if( null == autoDrawable ) {
return !created;
}
@@ -808,18 +808,18 @@ public class AWTRobotUtil {
* @return True if the Window is closing and closed (if willClose is true), each within TIME_OUT
* @throws InterruptedException
*/
- public static boolean closeWindow(Object obj, boolean willClose, WindowClosingListener closingListener) throws InterruptedException {
+ public static boolean closeWindow(final Object obj, final boolean willClose, final WindowClosingListener closingListener) throws InterruptedException {
closingListener.reset();
if(obj instanceof java.awt.Window) {
final java.awt.Window win = (java.awt.Window) obj;
- java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit();
+ final java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit();
final java.awt.EventQueue evtQ = tk.getSystemEventQueue();
AWTEDTExecutor.singleton.invoke(true, new Runnable() {
public void run() {
evtQ.postEvent(new java.awt.event.WindowEvent(win, java.awt.event.WindowEvent.WINDOW_CLOSING));
} });
} else if(obj instanceof com.jogamp.newt.Window) {
- com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
+ final com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
WindowImplAccess.windowDestroyNotify(win);
}
int wait;
@@ -834,7 +834,7 @@ public class AWTRobotUtil {
return wait<POLL_DIVIDER;
}
- public static WindowClosingListener addClosingListener(Object obj) {
+ public static WindowClosingListener addClosingListener(final Object obj) {
WindowClosingListener cl = null;
if(obj instanceof java.awt.Window) {
final java.awt.Window win = (java.awt.Window) obj;
@@ -845,8 +845,8 @@ public class AWTRobotUtil {
} } );
cl = acl;
} else if(obj instanceof com.jogamp.newt.Window) {
- com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
- NEWTWindowClosingAdapter ncl = new NEWTWindowClosingAdapter();
+ final com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
+ final NEWTWindowClosingAdapter ncl = new NEWTWindowClosingAdapter();
win.addWindowListener(ncl);
cl = ncl;
} else {
@@ -883,11 +883,11 @@ public class AWTRobotUtil {
public boolean isWindowClosed() {
return 0 < closed;
}
- public void windowClosing(java.awt.event.WindowEvent e) {
+ public void windowClosing(final java.awt.event.WindowEvent e) {
closing++;
System.err.println("AWTWindowClosingAdapter.windowClosing: "+this);
}
- public void windowClosed(java.awt.event.WindowEvent e) {
+ public void windowClosed(final java.awt.event.WindowEvent e) {
closed++;
System.err.println("AWTWindowClosingAdapter.windowClosed: "+this);
}
@@ -917,11 +917,11 @@ public class AWTRobotUtil {
public boolean isWindowClosed() {
return 0 < closed;
}
- public void windowDestroyNotify(WindowEvent e) {
+ public void windowDestroyNotify(final WindowEvent e) {
closing++;
System.err.println("NEWTWindowClosingAdapter.windowDestroyNotify: "+this);
}
- public void windowDestroyed(WindowEvent e) {
+ public void windowDestroyed(final WindowEvent e) {
closed++;
System.err.println("NEWTWindowClosingAdapter.windowDestroyed: "+this);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTWindowFocusAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/AWTWindowFocusAdapter.java
index 2e74dfae8..e2cafb1de 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTWindowFocusAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTWindowFocusAdapter.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.util;
import java.awt.event.WindowEvent;
@@ -37,27 +37,27 @@ public class AWTWindowFocusAdapter implements FocusEventCountAdapter, WindowFocu
int focusCount;
boolean verbose = true;
- public AWTWindowFocusAdapter(String prefix) {
+ public AWTWindowFocusAdapter(final String prefix) {
this.prefix = prefix;
reset();
}
- public void setVerbose(boolean v) { verbose = false; }
+ public void setVerbose(final boolean v) { verbose = false; }
public boolean focusLost() {
- return focusCount<0;
+ return focusCount<0;
}
-
+
public boolean focusGained() {
return focusCount>0;
}
-
+
public void reset() {
focusCount = 0;
}
/* @Override */
- public void windowGainedFocus(WindowEvent e) {
+ public void windowGainedFocus(final WindowEvent e) {
if(focusCount<0) { focusCount=0; }
focusCount++;
if( verbose ) {
@@ -66,13 +66,13 @@ public class AWTWindowFocusAdapter implements FocusEventCountAdapter, WindowFocu
}
/* @Override */
- public void windowLostFocus(WindowEvent e) {
+ public void windowLostFocus(final WindowEvent e) {
if(focusCount>0) { focusCount=0; }
focusCount--;
if( verbose ) {
System.err.println("FOCUS AWT LOST (Window) [fc "+focusCount+"]: "+prefix+", "+e);
}
}
-
+
public String toString() { return prefix+"[focusCount "+focusCount +"]"; }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/DumpGLInfo.java b/src/test/com/jogamp/opengl/test/junit/util/DumpGLInfo.java
index 99db0753b..ec8276dee 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/DumpGLInfo.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/DumpGLInfo.java
@@ -35,17 +35,17 @@ import com.jogamp.opengl.JoglVersion;
public class DumpGLInfo implements GLEventListener {
- public void init(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
+ public void init(final GLAutoDrawable drawable) {
+ final GL gl = drawable.getGL();
System.err.println(JoglVersion.getGLInfo(gl, null, true));
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapter.java
index 906e4a7c9..804a4eabe 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapter.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.util;
/**
@@ -36,7 +36,7 @@ package com.jogamp.opengl.test.junit.util;
*/
public interface EventCountAdapter {
void reset();
-
+
/** Instance starts in verbose mode, call w/ false to disable verbosity. */
void setVerbose(boolean v);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapterUtil.java b/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapterUtil.java
index d919d7cb6..b2db3e017 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapterUtil.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapterUtil.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.util;
import java.util.List;
@@ -33,15 +33,15 @@ import java.util.Iterator;
public abstract class EventCountAdapterUtil {
- public static void reset(EventCountAdapter[] adapters) {
+ public static void reset(final EventCountAdapter[] adapters) {
for(int i=0; i<adapters.length; i++) {
adapters[i].reset();
}
}
- public static void reset(List/*<EventCountAdapter>*/ adapters) {
- for(Iterator i = adapters.iterator(); i.hasNext(); ) {
- EventCountAdapter adapter = (EventCountAdapter) i.next();
+ public static void reset(final List/*<EventCountAdapter>*/ adapters) {
+ for(final Iterator i = adapters.iterator(); i.hasNext(); ) {
+ final EventCountAdapter adapter = (EventCountAdapter) i.next();
adapter.reset();
}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/FocusEventCountAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/FocusEventCountAdapter.java
index 461c72683..54b14543d 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/FocusEventCountAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/FocusEventCountAdapter.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.util;
public interface FocusEventCountAdapter extends EventCountAdapter {
diff --git a/src/test/com/jogamp/opengl/test/junit/util/GLEventListenerCounter.java b/src/test/com/jogamp/opengl/test/junit/util/GLEventListenerCounter.java
index b0f6e2c7e..981c5c17c 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/GLEventListenerCounter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/GLEventListenerCounter.java
@@ -44,22 +44,22 @@ public class GLEventListenerCounter implements GLEventListener {
}
@Override
- public void init(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {
initCount++;
}
@Override
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
disposeCount++;
}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
displayCount++;
}
@Override
- public void reshape(GLAutoDrawable d, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable d, final int x, final int y, final int width, final int height) {
reshapeCount++;
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java b/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java
index 926d4490c..5c2b2c56f 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java
@@ -41,25 +41,25 @@ public class GLSLSimpleProgram {
private int fragShader;
private boolean isValid;
- private GLSLSimpleProgram(int shaderProgram, int vertShader, int fragShader) {
+ private GLSLSimpleProgram(final int shaderProgram, final int vertShader, final int fragShader) {
this.shaderProgram = shaderProgram;
this.vertShader = vertShader;
this.fragShader = fragShader;
this.isValid = true;
}
- public static GLSLSimpleProgram create(GL2ES2 gl, String vertShaderCode, String fragShaderCode, boolean link) {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream pbaos = new PrintStream(baos);
+ public static GLSLSimpleProgram create(final GL2ES2 gl, final String vertShaderCode, final String fragShaderCode, final boolean link) {
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final PrintStream pbaos = new PrintStream(baos);
- int vertShader = gl.glCreateShader(GL2ES2.GL_VERTEX_SHADER);
+ final int vertShader = gl.glCreateShader(GL2ES2.GL_VERTEX_SHADER);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- int fragShader = gl.glCreateShader(GL2ES2.GL_FRAGMENT_SHADER);
+ final int fragShader = gl.glCreateShader(GL2ES2.GL_FRAGMENT_SHADER);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- String[] vlines = new String[] { gl.getContext().getGLSLVersionString()+vertShaderCode };
- int[] vlengths = new int[] { vlines[0].length() };
+ final String[] vlines = new String[] { gl.getContext().getGLSLVersionString()+vertShaderCode };
+ final int[] vlengths = new int[] { vlines[0].length() };
gl.glShaderSource(vertShader, vlines.length, vlines, vlengths, 0);
gl.glCompileShader(vertShader);
if(!ShaderUtil.isShaderStatusValid(gl, vertShader, GL2ES2.GL_COMPILE_STATUS, pbaos)) {
@@ -69,9 +69,9 @@ public class GLSLSimpleProgram {
pbaos.flush(); baos.reset();
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
- String[] flines = new String[] { gl.getContext().getGLSLVersionString()+fragShaderCode };
- int[] flengths = new int[] { flines[0].length() };
+
+ final String[] flines = new String[] { gl.getContext().getGLSLVersionString()+fragShaderCode };
+ final int[] flengths = new int[] { flines[0].length() };
gl.glShaderSource(fragShader, flines.length, flines, flengths, 0);
gl.glCompileShader(fragShader);
if(!ShaderUtil.isShaderStatusValid(gl, fragShader, GL2ES2.GL_COMPILE_STATUS, pbaos)) {
@@ -81,7 +81,7 @@ public class GLSLSimpleProgram {
pbaos.flush(); baos.reset();
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- int shaderProgram = gl.glCreateProgram();
+ final int shaderProgram = gl.glCreateProgram();
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
gl.glAttachShader(shaderProgram, vertShader);
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
@@ -96,11 +96,11 @@ public class GLSLSimpleProgram {
}
}
Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
- GLSLSimpleProgram res = new GLSLSimpleProgram(shaderProgram, vertShader, fragShader);
+ final GLSLSimpleProgram res = new GLSLSimpleProgram(shaderProgram, vertShader, fragShader);
return res;
}
- public void release(GL2ES2 gl) {
+ public void release(final GL2ES2 gl) {
gl.glUseProgram(0);
gl.glDetachShader(shaderProgram, vertShader);
gl.glDeleteShader(vertShader);
@@ -124,7 +124,7 @@ public class GLSLSimpleProgram {
public int getVertShader() {
return vertShader;
}
-
+
public boolean isValid() {
return isValid;
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/KeyEventCountAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/KeyEventCountAdapter.java
index 1d6d97a17..aaafeacee 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/KeyEventCountAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/KeyEventCountAdapter.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,17 +20,17 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.util;
public interface KeyEventCountAdapter extends InputEventCountAdapter {
public int getKeyPressedCount(boolean autoRepeatOnly);
-
- public int getKeyReleasedCount(boolean autoRepeatOnly);
+
+ public int getKeyReleasedCount(boolean autoRepeatOnly);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/MiscUtils.java b/src/test/com/jogamp/opengl/test/junit/util/MiscUtils.java
index 746e7ee55..e401534bd 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/MiscUtils.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/MiscUtils.java
@@ -44,63 +44,63 @@ import javax.media.opengl.GLContext;
import com.jogamp.common.os.Platform;
public class MiscUtils {
- public static boolean atob(String str, boolean def) {
+ public static boolean atob(final String str, final boolean def) {
try {
return Boolean.parseBoolean(str);
- } catch (Exception ex) {
+ } catch (final Exception ex) {
ex.printStackTrace();
}
return def;
}
- public static int atoi(String str, int def) {
+ public static int atoi(final String str, final int def) {
try {
return Integer.parseInt(str);
- } catch (Exception ex) {
+ } catch (final Exception ex) {
ex.printStackTrace();
}
return def;
}
- public static long atol(String str, long def) {
+ public static long atol(final String str, final long def) {
try {
return Long.parseLong(str);
- } catch (Exception ex) {
+ } catch (final Exception ex) {
ex.printStackTrace();
}
return def;
}
- public static float atof(String str, float def) {
+ public static float atof(final String str, final float def) {
try {
return Float.parseFloat(str);
- } catch (Exception ex) {
+ } catch (final Exception ex) {
ex.printStackTrace();
}
return def;
}
- public static String toHexString(byte hex) {
+ public static String toHexString(final byte hex) {
return "0x" + Integer.toHexString( hex & 0x000000FF );
}
- public static String toHexString(short hex) {
+ public static String toHexString(final short hex) {
return "0x" + Integer.toHexString( hex & 0x0000FFFF );
}
- public static String toHexString(int hex) {
+ public static String toHexString(final int hex) {
return "0x" + Integer.toHexString( hex );
}
- public static String toHexString(long hex) {
+ public static String toHexString(final long hex) {
return "0x" + Long.toHexString( hex );
}
- public static void assertFloatBufferEquals(String errmsg, FloatBuffer expected, FloatBuffer actual, float delta) {
+ public static void assertFloatBufferEquals(final String errmsg, final FloatBuffer expected, final FloatBuffer actual, final float delta) {
if(null == expected && null == actual) {
return;
}
- String msg = null != errmsg ? errmsg + " " : "";
+ final String msg = null != errmsg ? errmsg + " " : "";
if(null == expected) {
throw new AssertionError(msg+"; Expected is null, but actual not: "+actual);
}
@@ -122,14 +122,14 @@ public class MiscUtils {
}
}
- public static void assertFloatBufferNotEqual(String errmsg, FloatBuffer expected, FloatBuffer actual, float delta) {
+ public static void assertFloatBufferNotEqual(final String errmsg, final FloatBuffer expected, final FloatBuffer actual, final float delta) {
if(null == expected || null == actual) {
return;
}
if(expected.remaining() != actual.remaining()) {
return;
}
- String msg = null != errmsg ? errmsg + " " : "";
+ final String msg = null != errmsg ? errmsg + " " : "";
final int a0 = expected.position();
final int b0 = actual.position();
for(int i=0; i<expected.remaining(); i++) {
@@ -143,18 +143,18 @@ public class MiscUtils {
throw new AssertionError(msg+"; Expected and actual are equal.");
}
- public static boolean setFieldIfExists(Object instance, String fieldName, Object value) {
+ public static boolean setFieldIfExists(final Object instance, final String fieldName, final Object value) {
try {
- Field f = instance.getClass().getField(fieldName);
+ final Field f = instance.getClass().getField(fieldName);
if(value instanceof Boolean || f.getType().isInstance(value)) {
f.set(instance, value);
return true;
} else {
System.out.println(instance.getClass()+" '"+fieldName+"' field not assignable with "+value.getClass()+", it's a: "+f.getType());
}
- } catch (IllegalAccessException ex) {
+ } catch (final IllegalAccessException ex) {
throw new RuntimeException(ex);
- } catch (NoSuchFieldException nsfe) {
+ } catch (final NoSuchFieldException nsfe) {
// OK - throw new RuntimeException(instance.getClass()+" has no '"+fieldName+"' field", nsfe);
}
return false;
@@ -168,14 +168,14 @@ public class MiscUtils {
final Object sync;
volatile boolean eos = false;
- public StreamDump(OutputStream out, String prefix, InputStream is, Object sync) {
+ public StreamDump(final OutputStream out, final String prefix, final InputStream is, final Object sync) {
this.is = is;
this.outString = null;
this.outStream = out;
this.prefix = prefix;
this.sync = sync;
}
- public StreamDump(StringBuilder sb, InputStream is, Object sync) {
+ public StreamDump(final StringBuilder sb, final InputStream is, final Object sync) {
this.is = is;
this.outString = sb;
this.outStream = null;
@@ -203,7 +203,7 @@ public class MiscUtils {
outStream.flush();
}
}
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
System.err.println("Caught "+ioe.getClass().getName()+": "+ioe.getMessage());
ioe.printStackTrace();
} finally {
@@ -214,7 +214,7 @@ public class MiscUtils {
}
}
- public static void dumpSharedGLContext(GLContext self) {
+ public static void dumpSharedGLContext(final GLContext self) {
int i = 0, j = 0;
System.err.println("Myself: hash 0x"+Integer.toHexString(self.hashCode())+", \t(isShared "+self.isShared()+", created "+self.isCreated()+")");
{
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTFocusAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTFocusAdapter.java
index ccb1bde78..23e08179a 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/NEWTFocusAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTFocusAdapter.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.util;
import com.jogamp.newt.event.WindowEvent;
@@ -38,26 +38,26 @@ public class NEWTFocusAdapter implements WindowListener, FocusEventCountAdapter
int focusCount;
boolean verbose = true;
- public NEWTFocusAdapter(String prefix) {
+ public NEWTFocusAdapter(final String prefix) {
this.prefix = prefix;
reset();
}
- public void setVerbose(boolean v) { verbose = false; }
+ public void setVerbose(final boolean v) { verbose = false; }
public boolean focusLost() {
- return focusCount<0;
+ return focusCount<0;
}
-
+
public boolean focusGained() {
return focusCount>0;
}
-
+
public void reset() {
focusCount = 0;
}
- public void windowGainedFocus(WindowEvent e) {
+ public void windowGainedFocus(final WindowEvent e) {
if(focusCount<0) { focusCount=0; }
focusCount++;
if( verbose ) {
@@ -65,7 +65,7 @@ public class NEWTFocusAdapter implements WindowListener, FocusEventCountAdapter
}
}
- public void windowLostFocus(WindowEvent e) {
+ public void windowLostFocus(final WindowEvent e) {
if(focusCount>0) { focusCount=0; }
focusCount--;
if( verbose ) {
@@ -73,12 +73,12 @@ public class NEWTFocusAdapter implements WindowListener, FocusEventCountAdapter
}
}
- public void windowResized(WindowEvent e) { }
- public void windowMoved(WindowEvent e) { }
- public void windowDestroyNotify(WindowEvent e) { }
- public void windowDestroyed(WindowEvent e) { }
- public void windowRepaint(WindowUpdateEvent e) { }
-
- public String toString() { return prefix+"[focusCount "+focusCount+"]"; }
+ public void windowResized(final WindowEvent e) { }
+ public void windowMoved(final WindowEvent e) { }
+ public void windowDestroyNotify(final WindowEvent e) { }
+ public void windowDestroyed(final WindowEvent e) { }
+ public void windowRepaint(final WindowUpdateEvent e) { }
+
+ public String toString() { return prefix+"[focusCount "+focusCount+"]"; }
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTGLContext.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTGLContext.java
index a76b67d57..cd3a1eaa2 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/NEWTGLContext.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTGLContext.java
@@ -41,102 +41,102 @@ import org.junit.Assert;
public class NEWTGLContext {
- public static class WindowContext {
+ public static class WindowContext {
public final Window window;
public final GLDrawable drawable;
public final GLContext context;
-
- public WindowContext(Window w, GLDrawable d, GLContext c) {
+
+ public WindowContext(final Window w, final GLDrawable d, final GLContext c) {
window = w;
drawable = d;
context = c;
}
}
- public static WindowContext createOffscreenWindow(GLCapabilities caps, int width, int height, boolean debugGL) throws InterruptedException {
+ public static WindowContext createOffscreenWindow(final GLCapabilities caps, final int width, final int height, final boolean debugGL) throws InterruptedException {
caps.setOnscreen(false);
caps.setPBuffer(true);
-
+
//
// Create native windowing resources .. X11/Win/OSX
- //
- Display display = NewtFactory.createDisplay(null); // local display
+ //
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
-
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
-
- Window window = NewtFactory.createWindow(screen, caps);
+
+ final Window window = NewtFactory.createWindow(screen, caps);
Assert.assertNotNull(window);
window.setSize(width, height);
window.setVisible(true);
Assert.assertTrue(AWTRobotUtil.waitForVisible(window, true));
Assert.assertTrue(AWTRobotUtil.waitForRealized(window, true));
-
- GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
- GLDrawable drawable = factory.createGLDrawable(window);
+
+ final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
+ final GLDrawable drawable = factory.createGLDrawable(window);
Assert.assertNotNull(drawable);
-
+
drawable.setRealized(true);
Assert.assertTrue(drawable.isRealized());
-
- GLContext context = drawable.createContext(null);
+
+ final GLContext context = drawable.createContext(null);
Assert.assertNotNull(context);
-
+
context.enableGLDebugMessage(debugGL);
-
- int res = context.makeCurrent();
+
+ final int res = context.makeCurrent();
Assert.assertTrue(GLContext.CONTEXT_CURRENT_NEW==res || GLContext.CONTEXT_CURRENT==res);
-
+
return new WindowContext(window, drawable, context);
}
- public static WindowContext createOnscreenWindow(GLCapabilities caps, int width, int height, boolean debugGL) throws InterruptedException {
+ public static WindowContext createOnscreenWindow(final GLCapabilities caps, final int width, final int height, final boolean debugGL) throws InterruptedException {
//
// Create native windowing resources .. X11/Win/OSX
- //
- Display display = NewtFactory.createDisplay(null); // local display
+ //
+ final Display display = NewtFactory.createDisplay(null); // local display
Assert.assertNotNull(display);
-
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+
+ final Screen screen = NewtFactory.createScreen(display, 0); // screen 0
Assert.assertNotNull(screen);
-
- Window window = NewtFactory.createWindow(screen, caps);
+
+ final Window window = NewtFactory.createWindow(screen, caps);
Assert.assertNotNull(window);
window.setSize(width, height);
window.setVisible(true);
Assert.assertTrue(AWTRobotUtil.waitForVisible(window, true));
Assert.assertTrue(AWTRobotUtil.waitForRealized(window, true));
-
- GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
- GLDrawable drawable = factory.createGLDrawable(window);
+
+ final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
+ final GLDrawable drawable = factory.createGLDrawable(window);
Assert.assertNotNull(drawable);
-
+
drawable.setRealized(true);
Assert.assertTrue(drawable.isRealized());
-
- GLContext context = drawable.createContext(null);
+
+ final GLContext context = drawable.createContext(null);
Assert.assertNotNull(context);
-
+
context.enableGLDebugMessage(debugGL);
-
- int res = context.makeCurrent();
+
+ final int res = context.makeCurrent();
Assert.assertTrue(GLContext.CONTEXT_CURRENT_NEW==res || GLContext.CONTEXT_CURRENT==res);
-
+
return new WindowContext(window, drawable, context);
}
- public static void destroyWindow(WindowContext winctx) {
- GLDrawable drawable = winctx.context.getGLDrawable();
-
+ public static void destroyWindow(final WindowContext winctx) {
+ final GLDrawable drawable = winctx.context.getGLDrawable();
+
Assert.assertNotNull(winctx.context);
winctx.context.destroy();
-
+
Assert.assertNotNull(drawable);
drawable.setRealized(false);
-
+
Assert.assertNotNull(winctx.window);
winctx.window.destroy();
}
-
+
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java
index 0e86afd93..95cd0e7d3 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java
@@ -46,12 +46,12 @@ public class NEWTKeyAdapter extends KeyAdapter implements KeyEventCountAdapter {
List<EventObject> queue = new ArrayList<EventObject>();
boolean verbose = true;
- public NEWTKeyAdapter(String prefix) {
+ public NEWTKeyAdapter(final String prefix) {
this.prefix = prefix;
reset();
}
- public synchronized void setVerbose(boolean v) { verbose = v; }
+ public synchronized void setVerbose(final boolean v) { verbose = v; }
public synchronized boolean isPressed() {
return pressed;
@@ -65,11 +65,11 @@ public class NEWTKeyAdapter extends KeyAdapter implements KeyEventCountAdapter {
return consumed;
}
- public synchronized int getKeyPressedCount(boolean autoRepeatOnly) {
+ public synchronized int getKeyPressedCount(final boolean autoRepeatOnly) {
return autoRepeatOnly ? keyPressedAR: keyPressed;
}
- public synchronized int getKeyReleasedCount(boolean autoRepeatOnly) {
+ public synchronized int getKeyReleasedCount(final boolean autoRepeatOnly) {
return autoRepeatOnly ? keyReleasedAR: keyReleased;
}
@@ -91,7 +91,7 @@ public class NEWTKeyAdapter extends KeyAdapter implements KeyEventCountAdapter {
queue.clear();
}
- public synchronized void keyPressed(KeyEvent e) {
+ public synchronized void keyPressed(final KeyEvent e) {
pressed = true;
keyPressed++;
if( 0 != ( e.getModifiers() & InputEvent.AUTOREPEAT_MASK ) ) {
@@ -103,7 +103,7 @@ public class NEWTKeyAdapter extends KeyAdapter implements KeyEventCountAdapter {
}
}
- public synchronized void keyReleased(KeyEvent e) {
+ public synchronized void keyReleased(final KeyEvent e) {
pressed = false;
keyReleased++;
if(e.isConsumed()) {
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyUtil.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyUtil.java
index 89bafbd8c..623d18229 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyUtil.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyUtil.java
@@ -46,7 +46,7 @@ public class NEWTKeyUtil {
public final short max;
public final String description;
- public CodeSeg(int min, int max, String description) {
+ public CodeSeg(final int min, final int max, final String description) {
this.min = (short)min;
this.max = (short)max;
this.description = description;
@@ -57,7 +57,7 @@ public class NEWTKeyUtil {
public final String description;
public final KeyEvent event;
- public CodeEvent(short code, String description, KeyEvent event) {
+ public CodeEvent(final short code, final String description, final KeyEvent event) {
this.code = code;
this.description = description;
this.event = event;
@@ -67,13 +67,13 @@ public class NEWTKeyUtil {
}
}
- public static void dumpKeyEvents(List<EventObject> keyEvents) {
+ public static void dumpKeyEvents(final List<EventObject> keyEvents) {
for(int i=0; i<keyEvents.size(); i++) {
System.err.println(i+": "+keyEvents.get(i));
}
}
- public static boolean validateKeyCodes(CodeSeg[] codeSegments, List<List<EventObject>> keyEventsList, boolean verbose) {
+ public static boolean validateKeyCodes(final CodeSeg[] codeSegments, final List<List<EventObject>> keyEventsList, final boolean verbose) {
final List<CodeEvent> missCodes = new ArrayList<CodeEvent>();
int totalCodeCount = 0;
boolean res = true;
@@ -91,7 +91,7 @@ public class NEWTKeyUtil {
}
return res;
}
- public static boolean validateKeyCodes(List<CodeEvent> missCodes, CodeSeg codeSeg, List<EventObject> keyEvents, boolean verbose) {
+ public static boolean validateKeyCodes(final List<CodeEvent> missCodes, final CodeSeg codeSeg, final List<EventObject> keyEvents, final boolean verbose) {
final int codeCount = codeSeg.max - codeSeg.min + 1;
int misses = 0;
int evtIdx = 0;
@@ -118,7 +118,7 @@ public class NEWTKeyUtil {
return res;
}
- public static void validateKeyEvent(KeyEvent e, short eventType, int modifiers, short keyCode, char keyChar) {
+ public static void validateKeyEvent(final KeyEvent e, final short eventType, final int modifiers, final short keyCode, final char keyChar) {
if(0 <= eventType) {
Assert.assertTrue("KeyEvent type mismatch, expected 0x"+Integer.toHexString(eventType)+", has "+e, eventType == e.getEventType());
}
@@ -133,7 +133,7 @@ public class NEWTKeyUtil {
}
}
- public static short getNextKeyEventType(KeyEvent e) {
+ public static short getNextKeyEventType(final KeyEvent e) {
final int et = e.getEventType();
switch( et ) {
case KeyEvent.EVENT_KEY_PRESSED:
@@ -146,8 +146,8 @@ public class NEWTKeyUtil {
}
}
- public static void validateKeyEventOrder(List<EventObject> keyEvents) {
- IntIntHashMap keyCode2NextEvent = new IntIntHashMap();
+ public static void validateKeyEventOrder(final List<EventObject> keyEvents) {
+ final IntIntHashMap keyCode2NextEvent = new IntIntHashMap();
for(int i=0; i<keyEvents.size(); i++) {
final KeyEvent e = (KeyEvent) keyEvents.get(i);
int eet = keyCode2NextEvent.get(e.getKeyCode());
@@ -168,9 +168,9 @@ public class NEWTKeyUtil {
* @param expPressedCountAR number of auto-repeat key press events
* @param expReleasedCountAR number of auto-repeat key release events
*/
- public static void validateKeyAdapterStats(NEWTKeyAdapter keyAdapter,
- int expPressedCountSI, int expReleasedCountSI,
- int expPressedCountAR, int expReleasedCountAR) {
+ public static void validateKeyAdapterStats(final NEWTKeyAdapter keyAdapter,
+ final int expPressedCountSI, final int expReleasedCountSI,
+ final int expPressedCountAR, final int expReleasedCountAR) {
final int expPressReleaseCountSI = expPressedCountSI + expReleasedCountSI;
final int expPressReleaseCountAR = expPressedCountAR + expReleasedCountAR;
final int expPressReleaseCountALL = expPressReleaseCountSI + expPressReleaseCountAR;
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java
index 22e241f71..bd191dd2c 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java
@@ -44,12 +44,12 @@ public class NEWTMouseAdapter extends MouseAdapter implements InputEventCountAda
List<EventObject> queue = new ArrayList<EventObject>();
boolean verbose = true;
- public NEWTMouseAdapter(String prefix) {
+ public NEWTMouseAdapter(final String prefix) {
this.prefix = prefix;
reset();
}
- public synchronized void setVerbose(boolean v) { verbose = v; }
+ public synchronized void setVerbose(final boolean v) { verbose = v; }
public synchronized boolean isPressed() {
return pressed;
@@ -78,7 +78,7 @@ public class NEWTMouseAdapter extends MouseAdapter implements InputEventCountAda
queue.clear();
}
- public synchronized void mousePressed(MouseEvent e) {
+ public synchronized void mousePressed(final MouseEvent e) {
pressed = true;
queue.add(e);
if( verbose ) {
@@ -86,7 +86,7 @@ public class NEWTMouseAdapter extends MouseAdapter implements InputEventCountAda
}
}
- public synchronized void mouseReleased(MouseEvent e) {
+ public synchronized void mouseReleased(final MouseEvent e) {
pressed = false;
queue.add(e);
if( verbose ) {
@@ -94,7 +94,7 @@ public class NEWTMouseAdapter extends MouseAdapter implements InputEventCountAda
}
}
- public synchronized void mouseClicked(MouseEvent e) {
+ public synchronized void mouseClicked(final MouseEvent e) {
mouseClicked+=e.getClickCount();
if(e.isConsumed()) {
consumed++;
diff --git a/src/test/com/jogamp/opengl/test/junit/util/QuitAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/QuitAdapter.java
index 467dd7fae..b355d51e3 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/QuitAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/QuitAdapter.java
@@ -34,21 +34,21 @@ public class QuitAdapter extends WindowAdapter implements WindowListener, KeyLis
boolean shouldQuit = false;
boolean enabled = true;
- public void enable(boolean v) { enabled = v; }
+ public void enable(final boolean v) { enabled = v; }
public void clear() { shouldQuit = false; }
public boolean shouldQuit() { return shouldQuit; }
public void doQuit() { shouldQuit=true; }
- public void windowDestroyNotify(WindowEvent e) {
+ public void windowDestroyNotify(final WindowEvent e) {
if( enabled ) {
System.err.println("QUIT Window "+Thread.currentThread());
shouldQuit = true;
}
}
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
if( !e.isPrintableKey() || e.isAutoRepeat() ) {
return;
}
@@ -59,6 +59,6 @@ public class QuitAdapter extends WindowAdapter implements WindowListener, KeyLis
}
}
}
- public void keyPressed(KeyEvent e) {}
+ public void keyPressed(final KeyEvent e) {}
}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
index e6958bc48..0044a5708 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
@@ -94,7 +94,7 @@ public abstract class UITestCase {
return testSupported;
}
- public static void setTestSupported(boolean v) {
+ public static void setTestSupported(final boolean v) {
System.err.println("setTestSupported: "+v);
testSupported = v;
}
@@ -169,13 +169,13 @@ public abstract class UITestCase {
System.err.println("XRandR Reset Error Code "+errorCode);
}
}
- } catch (Exception e) {
+ } catch (final Exception e) {
System.err.println("Caught "+e.getClass().getName()+": "+e.getMessage());
e.printStackTrace();
}
}
}
- private static String getFirst(String line) {
+ private static String getFirst(final String line) {
final StringTokenizer tok = new StringTokenizer(line);
if( tok.hasMoreTokens() ) {
final String s = tok.nextToken().trim();
@@ -186,7 +186,7 @@ public abstract class UITestCase {
return null;
}
- public static int processCommand(String[] cmdline, OutputStream outstream, String outPrefix) {
+ public static int processCommand(final String[] cmdline, final OutputStream outstream, final String outPrefix) {
int errorCode = 0;
final Object ioSync = new Object();
try {
@@ -202,7 +202,7 @@ public abstract class UITestCase {
p.waitFor(); // should be fine by now ..
errorCode = p.exitValue();
}
- } catch (Exception e) {
+ } catch (final Exception e) {
System.err.println("Caught "+e.getClass().getName()+": "+e.getMessage());
e.printStackTrace();
errorCode = Integer.MIN_VALUE;
@@ -215,7 +215,7 @@ public abstract class UITestCase {
int ml = 0;
final TestClass tc = new TestClass(getClass());
final List<FrameworkMethod> testMethods = tc.getAnnotatedMethods(org.junit.Test.class);
- for(Iterator<FrameworkMethod> iter=testMethods.iterator(); iter.hasNext(); ) {
+ for(final Iterator<FrameworkMethod> iter=testMethods.iterator(); iter.hasNext(); ) {
final int l = iter.next().getName().length();
if( ml < l ) { ml = l; }
}
@@ -228,11 +228,11 @@ public abstract class UITestCase {
return _unitTestName.getMethodName();
}
- public final String getSimpleTestName(String separator) {
+ public final String getSimpleTestName(final String separator) {
return getClass().getSimpleName()+separator+getTestMethodName();
}
- public final String getFullTestName(String separator) {
+ public final String getFullTestName(final String separator) {
return getClass().getName()+separator+getTestMethodName();
}
@@ -267,17 +267,17 @@ public abstract class UITestCase {
System.err.println("++++ UITestCase.tearDown: "+getFullTestName(" - "));
}
- public static void waitForKey(String preMessage) {
- BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ public static void waitForKey(final String preMessage) {
+ final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.err.println(preMessage+"> Press enter to continue");
try {
System.err.println(stdin.readLine());
- } catch (IOException e) { }
+ } catch (final IOException e) { }
}
static final String unsupportedTestMsg = "Test not supported on this platform.";
- public String getSnapshotFilename(int sn, String postSNDetail, GLCapabilitiesImmutable caps, int width, int height, boolean sinkHasAlpha, String fileSuffix, String destPath) {
+ public String getSnapshotFilename(final int sn, String postSNDetail, final GLCapabilitiesImmutable caps, final int width, final int height, final boolean sinkHasAlpha, String fileSuffix, final String destPath) {
if(null == fileSuffix) {
fileSuffix = TextureIO.PNG;
}
@@ -332,7 +332,7 @@ public abstract class UITestCase {
* It shall not end with a directory separator, {@link File#separatorChar}.
* If <code>null</code> the current working directory is being used.
*/
- public void snapshot(int sn, String postSNDetail, GL gl, GLReadBufferUtil readBufferUtil, String fileSuffix, String destPath) {
+ public void snapshot(final int sn, final String postSNDetail, final GL gl, final GLReadBufferUtil readBufferUtil, final String fileSuffix, final String destPath) {
final GLDrawable drawable = gl.getContext().getGLReadDrawable();
final String filename = getSnapshotFilename(sn, postSNDetail,
@@ -342,15 +342,15 @@ public abstract class UITestCase {
gl.glFinish(); // just make sure rendering finished ..
try {
snapshot(gl, readBufferUtil, filename);
- } catch (ClassNotFoundException cnfe) {
+ } catch (final ClassNotFoundException cnfe) {
// Texture class belongs to jogl-util.jar which my not be included in test environment!
System.err.println("Caught ClassNotFoundException: "+cnfe.getMessage());
- } catch (NoClassDefFoundError cnfe) {
+ } catch (final NoClassDefFoundError cnfe) {
// Texture class belongs to jogl-util.jar which my not be included in test environment!
System.err.println("Caught NoClassDefFoundError: "+cnfe.getMessage());
}
}
- private void snapshot(GL gl, GLReadBufferUtil readBufferUtil, String filename) throws ClassNotFoundException, NoClassDefFoundError {
+ private void snapshot(final GL gl, final GLReadBufferUtil readBufferUtil, final String filename) throws ClassNotFoundException, NoClassDefFoundError {
if(readBufferUtil.readPixels(gl, false)) {
readBufferUtil.write(new File(filename));
}
@@ -364,7 +364,7 @@ public abstract class UITestCase {
private volatile int displayCount=0;
private volatile int reshapeCount=0;
private volatile String postSNDetail = null;
- public SnapshotGLEventListener(GLReadBufferUtil screenshot) {
+ public SnapshotGLEventListener(final GLReadBufferUtil screenshot) {
this.screenshot = screenshot;
}
public SnapshotGLEventListener() {
@@ -373,9 +373,9 @@ public abstract class UITestCase {
public int getDisplayCount() { return displayCount; }
public int getReshapeCount() { return reshapeCount; }
public GLReadBufferUtil getGLReadBufferUtil() { return screenshot; }
- public void init(GLAutoDrawable drawable) {}
- public void dispose(GLAutoDrawable drawable) {}
- public void display(GLAutoDrawable drawable) {
+ public void init(final GLAutoDrawable drawable) {}
+ public void dispose(final GLAutoDrawable drawable) {}
+ public void display(final GLAutoDrawable drawable) {
final GL gl = drawable.getGL();
final boolean _makeShot = makeShot || makeShotAlways;
if(verbose) {
@@ -387,7 +387,7 @@ public abstract class UITestCase {
}
displayCount++;
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
if(verbose) {
System.err.println(Thread.currentThread().getName()+": ** reshape: "+reshapeCount+": "+width+"x"+height+" - "+drawable.getSurfaceWidth()+"x"+drawable.getSurfaceHeight());
}
@@ -396,13 +396,13 @@ public abstract class UITestCase {
public void setMakeSnapshot() {
makeShot=true;
}
- public void setMakeSnapshotAlways(boolean v) {
+ public void setMakeSnapshotAlways(final boolean v) {
makeShotAlways=v;
}
- public void setVerbose(boolean v) {
+ public void setVerbose(final boolean v) {
verbose=v;
}
- public void setPostSNDetail(String v) {
+ public void setPostSNDetail(final String v) {
postSNDetail = v;
}
};
diff --git a/src/test/com/jogamp/opengl/test/junit/util/ValidateLockListener.java b/src/test/com/jogamp/opengl/test/junit/util/ValidateLockListener.java
index 73c1ad74c..ceb171529 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/ValidateLockListener.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/ValidateLockListener.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package com.jogamp.opengl.test.junit.util;
@@ -36,10 +36,10 @@ import javax.media.opengl.GLEventListener;
public class ValidateLockListener implements GLEventListener {
- private void validateLock(GLAutoDrawable drawable) {
+ private void validateLock(final GLAutoDrawable drawable) {
final NativeSurface ns = drawable.getNativeSurface();
ns.getGraphicsConfiguration().getScreen().getDevice().validateLocked();
-
+
final Thread current = Thread.currentThread();
final Thread owner = ns.getSurfaceLockOwner();
if( ns.isSurfaceLockedByOtherThread() ) {
@@ -49,23 +49,23 @@ public class ValidateLockListener implements GLEventListener {
if( null == owner ) {
throw new RuntimeException(current.getName()+": Not locked: "+ns);
}
- throw new RuntimeException(current.getName()+": Locked by another thread(2), owner "+owner+", "+ns);
+ throw new RuntimeException(current.getName()+": Locked by another thread(2), owner "+owner+", "+ns);
}
}
-
- public void init(GLAutoDrawable drawable) {
+
+ public void init(final GLAutoDrawable drawable) {
validateLock(drawable);
}
- public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
validateLock(drawable);
}
- public void display(GLAutoDrawable drawable) {
+ public void display(final GLAutoDrawable drawable) {
validateLock(drawable);
}
- public void dispose(GLAutoDrawable drawable) {
+ public void dispose(final GLAutoDrawable drawable) {
validateLock(drawable);
}
}
diff --git a/src/test/jogamp/newt/WindowImplAccess.java b/src/test/jogamp/newt/WindowImplAccess.java
index 3387a2ae2..b98835f37 100644
--- a/src/test/jogamp/newt/WindowImplAccess.java
+++ b/src/test/jogamp/newt/WindowImplAccess.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -34,13 +34,13 @@ import com.jogamp.newt.Window;
* Allows access to protected methods of WindowImpl
*/
public class WindowImplAccess {
- public static final void windowDestroyNotify(Window win) {
+ public static final void windowDestroyNotify(final Window win) {
final WindowImpl winImpl = (WindowImpl) win.getDelegatedWindow();
winImpl.runOnEDTIfAvail(true, new Runnable() {
public void run() {
winImpl.windowDestroyNotify(false);
}
- });
+ });
}
}