diff --git a/jme3-examples/src/main/java/jme3test/TestChooser.java b/jme3-examples/src/main/java/jme3test/TestChooser.java index c47196035..dc7c540dd 100644 --- a/jme3-examples/src/main/java/jme3test/TestChooser.java +++ b/jme3-examples/src/main/java/jme3test/TestChooser.java @@ -258,50 +258,50 @@ public class TestChooser extends JDialog { new Thread(new Runnable(){ public void run(){ for (int i = 0; i < appClass.size(); i++) { - Class clazz = (Class)appClass.get(i); - try { - if (LegacyApplication.class.isAssignableFrom(clazz)) { - Object app = clazz.newInstance(); - if (app instanceof SimpleApplication) { - final Method settingMethod = clazz.getMethod("setShowSettings", boolean.class); - settingMethod.invoke(app, showSetting); - } - final Method mainMethod = clazz.getMethod("start"); - mainMethod.invoke(app); - Field contextField = LegacyApplication.class.getDeclaredField("context"); - contextField.setAccessible(true); - JmeContext context = null; - while (context == null) { - context = (JmeContext) contextField.get(app); - Thread.sleep(100); - } - while (!context.isCreated()) { - Thread.sleep(100); - } - while (context.isCreated()) { - Thread.sleep(100); - } - } else { + Class clazz = (Class)appClass.get(i); + try { + if (LegacyApplication.class.isAssignableFrom(clazz)) { + Object app = clazz.newInstance(); + if (app instanceof SimpleApplication) { + final Method settingMethod = clazz.getMethod("setShowSettings", boolean.class); + settingMethod.invoke(app, showSetting); + } + final Method mainMethod = clazz.getMethod("start"); + mainMethod.invoke(app); + Field contextField = LegacyApplication.class.getDeclaredField("context"); + contextField.setAccessible(true); + JmeContext context = null; + while (context == null) { + context = (JmeContext) contextField.get(app); + Thread.sleep(100); + } + while (!context.isCreated()) { + Thread.sleep(100); + } + while (context.isCreated()) { + Thread.sleep(100); + } + } else { final Method mainMethod = clazz.getMethod("main", (new String[0]).getClass()); mainMethod.invoke(clazz, new Object[]{new String[0]}); - } - // wait for destroy - System.gc(); - } catch (IllegalAccessException ex) { - logger.log(Level.SEVERE, "Cannot access constructor: "+clazz.getName(), ex); - } catch (IllegalArgumentException ex) { - logger.log(Level.SEVERE, "main() had illegal argument: "+clazz.getName(), ex); - } catch (InvocationTargetException ex) { - logger.log(Level.SEVERE, "main() method had exception: "+clazz.getName(), ex); - } catch (InstantiationException ex) { - logger.log(Level.SEVERE, "Failed to create app: "+clazz.getName(), ex); - } catch (NoSuchMethodException ex){ - logger.log(Level.SEVERE, "Test class doesn't have main method: "+clazz.getName(), ex); - } catch (Exception ex) { - logger.log(Level.SEVERE, "Cannot start test: "+clazz.getName(), ex); + } + // wait for destroy + System.gc(); + } catch (IllegalAccessException ex) { + logger.log(Level.SEVERE, "Cannot access constructor: "+clazz.getName(), ex); + } catch (IllegalArgumentException ex) { + logger.log(Level.SEVERE, "main() had illegal argument: "+clazz.getName(), ex); + } catch (InvocationTargetException ex) { + logger.log(Level.SEVERE, "main() method had exception: "+clazz.getName(), ex); + } catch (InstantiationException ex) { + logger.log(Level.SEVERE, "Failed to create app: "+clazz.getName(), ex); + } catch (NoSuchMethodException ex){ + logger.log(Level.SEVERE, "Test class doesn't have main method: "+clazz.getName(), ex); + } catch (Exception ex) { + logger.log(Level.SEVERE, "Cannot start test: "+clazz.getName(), ex); ex.printStackTrace(); } - } + } } }).start(); } diff --git a/jme3-examples/src/main/java/jme3test/light/TestTangentGen.java b/jme3-examples/src/main/java/jme3test/light/TestTangentGen.java index 042a85705..a824f754a 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestTangentGen.java +++ b/jme3-examples/src/main/java/jme3test/light/TestTangentGen.java @@ -129,9 +129,9 @@ public class TestTangentGen extends SimpleApplication { IntBuffer ib = BufferUtils.createIntBuffer(indexes.length); ib.put(indexes); strip.setBuffer(Type.Position, 3, vb); - strip.setBuffer(Type.Normal, 3, nb); - strip.setBuffer(Type.TexCoord, 2, tb); - strip.setBuffer(Type.Index, 3, ib); + strip.setBuffer(Type.Normal, 3, nb); + strip.setBuffer(Type.TexCoord, 2, tb); + strip.setBuffer(Type.Index, 3, ib); strip.updateBound(); return strip; } diff --git a/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java b/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java index b8066dd6a..e757e6cef 100644 --- a/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java +++ b/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java @@ -47,7 +47,7 @@ import com.jme3.scene.Spatial; public class TestBlenderObjectAnim extends SimpleApplication { public static void main(String[] args) { - TestBlenderObjectAnim app = new TestBlenderObjectAnim(); + TestBlenderObjectAnim app = new TestBlenderObjectAnim(); app.start(); } @@ -70,13 +70,13 @@ public class TestBlenderObjectAnim extends SimpleApplication { Spatial model = this.findNode(rootNode, "Cube"); model.center(); - // Because it's old .blend file need to migrate object. - AnimMigrationUtils.migrate(model); + // Because it's old .blend file need to migrate object. + AnimMigrationUtils.migrate(model); - AnimComposer animComposer = model.getControl(AnimComposer.class); - animComposer.getAnimClips().forEach(animClip -> System.out.println("AnimClip name: " + animClip.getName())); - AnimClip animClip = animComposer.getAnimClip("Action"); // Action, Action.001 - animComposer.setCurrentAction(animClip.getName()); + AnimComposer animComposer = model.getControl(AnimComposer.class); + animComposer.getAnimClips().forEach(animClip -> System.out.println("AnimClip name: " + animClip.getName())); + AnimClip animClip = animComposer.getAnimClip("Action"); // Action, Action.001 + animComposer.setCurrentAction(animClip.getName()); } /** diff --git a/jme3-examples/src/main/java/jme3test/model/anim/TestSpatialAnim.java b/jme3-examples/src/main/java/jme3test/model/anim/TestSpatialAnim.java index 73a205e1a..6ca1611d1 100644 --- a/jme3-examples/src/main/java/jme3test/model/anim/TestSpatialAnim.java +++ b/jme3-examples/src/main/java/jme3test/model/anim/TestSpatialAnim.java @@ -16,7 +16,7 @@ import com.jme3.scene.shape.Box; public class TestSpatialAnim extends SimpleApplication { public static void main(String[] args) { - TestSpatialAnim app = new TestSpatialAnim(); + TestSpatialAnim app = new TestSpatialAnim(); app.start(); } @@ -58,13 +58,13 @@ public class TestSpatialAnim extends SimpleApplication { Vector3f[] translations = new Vector3f[totalFrames]; Quaternion[] rotations = new Quaternion[totalFrames]; Vector3f[] scales = new Vector3f[totalFrames]; - for (int i = 0; i < totalFrames; ++i) { - times[i] = t; - t += dT; - translations[i] = new Vector3f(x, 0, 0); - x += dX; - rotations[i] = Quaternion.IDENTITY; - scales[i] = Vector3f.UNIT_XYZ; + for (int i = 0; i < totalFrames; ++i) { + times[i] = t; + t += dT; + translations[i] = new Vector3f(x, 0, 0); + x += dX; + rotations[i] = Quaternion.IDENTITY; + scales[i] = Vector3f.UNIT_XYZ; } TransformTrack transformTrack = new TransformTrack(geom, times, translations, rotations, scales); TransformTrack transformTrackChild = new TransformTrack(childGeom, times, translations, rotations, scales); diff --git a/jme3-examples/src/main/java/jme3test/opencl/TestVertexBufferSharing.java b/jme3-examples/src/main/java/jme3test/opencl/TestVertexBufferSharing.java index 0e4314fbc..e25094f38 100644 --- a/jme3-examples/src/main/java/jme3test/opencl/TestVertexBufferSharing.java +++ b/jme3-examples/src/main/java/jme3test/opencl/TestVertexBufferSharing.java @@ -155,7 +155,7 @@ public class TestVertexBufferSharing extends SimpleApplication { } LOG.info("create new program from sources"); } - program.register(); + program.register(); kernel = program.createKernel("ScaleKernel").register(); } private void initOpenCL2() { diff --git a/jme3-examples/src/main/java/jme3test/renderer/TestDepthStencil.java b/jme3-examples/src/main/java/jme3test/renderer/TestDepthStencil.java index 77528893a..431bdbfc3 100644 --- a/jme3-examples/src/main/java/jme3test/renderer/TestDepthStencil.java +++ b/jme3-examples/src/main/java/jme3test/renderer/TestDepthStencil.java @@ -86,12 +86,12 @@ public class TestDepthStencil extends SimpleApplication { @Override protected void controlUpdate(float tpf) { Material mat = sphere.getMaterial(); - mat.getAdditionalRenderState().setStencil(enableStencil, + mat.getAdditionalRenderState().setStencil(enableStencil, RenderState.StencilOperation.Keep, RenderState.StencilOperation.Keep, RenderState.StencilOperation.Keep, RenderState.StencilOperation.Keep, RenderState.StencilOperation.Keep, RenderState.StencilOperation.Keep, RenderState.TestFunction.Never, RenderState.TestFunction.Never //TestFunction.Always, TestFunction.Always - ); + ); } @Override